Skip to content

Commit 34c36f4

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) Validate tunnel options length in act_tunnel_key, from Xin Long. 2) Fix DMA sync bug in gve driver, from Adi Suresh. 3) TSO kills performance on some r8169 chips due to HW issues, disable by default in that case, from Corinna Vinschen. 4) Fix clock disable mismatch in fec driver, from Chubong Yuan. 5) Fix interrupt status bits define in hns3 driver, from Huazhong Tan. 6) Fix workqueue deadlocks in qeth driver, from Julian Wiedmann. 7) Don't napi_disable() twice in r8152 driver, from Hayes Wang. 8) Fix SKB extension memory leak, from Florian Westphal. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (54 commits) r8152: avoid to call napi_disable twice MAINTAINERS: Add myself as maintainer of virtio-vsock udp: drop skb extensions before marking skb stateless net: rtnetlink: prevent underflows in do_setvfinfo() can: m_can_platform: remove unnecessary m_can_class_resume() call can: m_can_platform: set net_device structure as driver data hv_netvsc: Fix send_table offset in case of a host bug hv_netvsc: Fix offset usage in netvsc_send_table() net-ipv6: IPV6_TRANSPARENT - check NET_RAW prior to NET_ADMIN sfc: Only cancel the PPS workqueue if it exists nfc: port100: handle command failure cleanly net-sysfs: fix netdev_queue_add_kobject() breakage r8152: Re-order napi_disable in rtl8152_close net: qca_spi: Move reset_count to struct qcaspi net: qca_spi: fix receive buffer size check net/ibmvnic: Ignore H_FUNCTION return from H_EOI to tolerate XIVE mode Revert "net/ibmvnic: Fix EOI when running in XIVE mode" net/mlxfw: Verify FSM error code translation doesn't exceed array size net/mlx5: Update the list of the PCI supported devices net/mlx5: Fix auto group size calculation ...
2 parents b485275 + 5b1d9c1 commit 34c36f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+356
-178
lines changed

MAINTAINERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ F: drivers/net/ethernet/alacritech/*
643643

644644
FORCEDETH GIGABIT ETHERNET DRIVER
645645
M: Rain River <[email protected]>
646-
M: Zhu Yanjun <yanjun.zhu@oracle.com>
646+
M: Zhu Yanjun <zyjzyj2000@gmail.com>
647647
648648
S: Maintained
649649
F: drivers/net/ethernet/nvidia/*
@@ -17215,6 +17215,7 @@ F: virt/lib/
1721517215

1721617216
VIRTIO AND VHOST VSOCK DRIVER
1721717217
M: Stefan Hajnoczi <[email protected]>
17218+
M: Stefano Garzarella <[email protected]>
1721817219
1721917220
1722017221

drivers/net/can/m_can/m_can_platform.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static int m_can_plat_probe(struct platform_device *pdev)
107107

108108
mcan_class->is_peripheral = false;
109109

110-
platform_set_drvdata(pdev, mcan_class->dev);
110+
platform_set_drvdata(pdev, mcan_class->net);
111111

112112
m_can_init_ram(mcan_class);
113113

@@ -166,8 +166,6 @@ static int __maybe_unused m_can_runtime_resume(struct device *dev)
166166
if (err)
167167
clk_disable_unprepare(mcan_class->hclk);
168168

169-
m_can_class_resume(dev);
170-
171169
return err;
172170
}
173171

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3636,22 +3636,29 @@ fec_drv_remove(struct platform_device *pdev)
36363636
struct net_device *ndev = platform_get_drvdata(pdev);
36373637
struct fec_enet_private *fep = netdev_priv(ndev);
36383638
struct device_node *np = pdev->dev.of_node;
3639+
int ret;
3640+
3641+
ret = pm_runtime_get_sync(&pdev->dev);
3642+
if (ret < 0)
3643+
return ret;
36393644

36403645
cancel_work_sync(&fep->tx_timeout_work);
36413646
fec_ptp_stop(pdev);
36423647
unregister_netdev(ndev);
36433648
fec_enet_mii_remove(fep);
36443649
if (fep->reg_phy)
36453650
regulator_disable(fep->reg_phy);
3646-
pm_runtime_put(&pdev->dev);
3647-
pm_runtime_disable(&pdev->dev);
3648-
clk_disable_unprepare(fep->clk_ahb);
3649-
clk_disable_unprepare(fep->clk_ipg);
3651+
36503652
if (of_phy_is_fixed_link(np))
36513653
of_phy_deregister_fixed_link(np);
36523654
of_node_put(fep->phy_node);
36533655
free_netdev(ndev);
36543656

3657+
clk_disable_unprepare(fep->clk_ahb);
3658+
clk_disable_unprepare(fep->clk_ipg);
3659+
pm_runtime_put_noidle(&pdev->dev);
3660+
pm_runtime_disable(&pdev->dev);
3661+
36553662
return 0;
36563663
}
36573664

drivers/net/ethernet/google/gve/gve_tx.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,13 @@ static void gve_tx_fill_seg_desc(union gve_tx_desc *seg_desc,
393393
static void gve_dma_sync_for_device(struct device *dev, dma_addr_t *page_buses,
394394
u64 iov_offset, u64 iov_len)
395395
{
396+
u64 last_page = (iov_offset + iov_len - 1) / PAGE_SIZE;
397+
u64 first_page = iov_offset / PAGE_SIZE;
396398
dma_addr_t dma;
397-
u64 addr;
399+
u64 page;
398400

399-
for (addr = iov_offset; addr < iov_offset + iov_len;
400-
addr += PAGE_SIZE) {
401-
dma = page_buses[addr / PAGE_SIZE];
401+
for (page = first_page; page <= last_page; page++) {
402+
dma = page_buses[page];
402403
dma_sync_single_for_device(dev, dma, PAGE_SIZE, DMA_TO_DEVICE);
403404
}
404405
}

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ enum HLCGE_PORT_TYPE {
166166
#define HCLGE_GLOBAL_RESET_BIT 0
167167
#define HCLGE_CORE_RESET_BIT 1
168168
#define HCLGE_IMP_RESET_BIT 2
169-
#define HCLGE_RESET_INT_M GENMASK(2, 0)
169+
#define HCLGE_RESET_INT_M GENMASK(7, 5)
170170
#define HCLGE_FUN_RST_ING 0x20C00
171171
#define HCLGE_FUN_RST_ING_B 0
172172

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,10 +2878,15 @@ static int enable_scrq_irq(struct ibmvnic_adapter *adapter,
28782878

28792879
if (test_bit(0, &adapter->resetting) &&
28802880
adapter->reset_reason == VNIC_RESET_MOBILITY) {
2881-
struct irq_desc *desc = irq_to_desc(scrq->irq);
2882-
struct irq_chip *chip = irq_desc_get_chip(desc);
2881+
u64 val = (0xff000000) | scrq->hw_irq;
28832882

2884-
chip->irq_eoi(&desc->irq_data);
2883+
rc = plpar_hcall_norets(H_EOI, val);
2884+
/* H_EOI would fail with rc = H_FUNCTION when running
2885+
* in XIVE mode which is expected, but not an error.
2886+
*/
2887+
if (rc && (rc != H_FUNCTION))
2888+
dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n",
2889+
val, rc);
28852890
}
28862891

28872892
rc = plpar_hcall_norets(H_VIOCTL, adapter->vdev->unit_address,

drivers/net/ethernet/mellanox/mlx4/en_ethtool.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,6 +1745,7 @@ static int mlx4_en_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
17451745
err = mlx4_en_get_flow(dev, cmd, cmd->fs.location);
17461746
break;
17471747
case ETHTOOL_GRXCLSRLALL:
1748+
cmd->data = MAX_NUM_OF_FS_RULES;
17481749
while ((!err || err == -ENOENT) && priority < cmd->rule_cnt) {
17491750
err = mlx4_en_get_flow(dev, cmd, i);
17501751
if (!err)
@@ -1811,6 +1812,7 @@ static int mlx4_en_set_channels(struct net_device *dev,
18111812
struct mlx4_en_dev *mdev = priv->mdev;
18121813
struct mlx4_en_port_profile new_prof;
18131814
struct mlx4_en_priv *tmp;
1815+
int total_tx_count;
18141816
int port_up = 0;
18151817
int xdp_count;
18161818
int err = 0;
@@ -1825,13 +1827,12 @@ static int mlx4_en_set_channels(struct net_device *dev,
18251827

18261828
mutex_lock(&mdev->state_lock);
18271829
xdp_count = priv->tx_ring_num[TX_XDP] ? channel->rx_count : 0;
1828-
if (channel->tx_count * priv->prof->num_up + xdp_count >
1829-
priv->mdev->profile.max_num_tx_rings_p_up * priv->prof->num_up) {
1830+
total_tx_count = channel->tx_count * priv->prof->num_up + xdp_count;
1831+
if (total_tx_count > MAX_TX_RINGS) {
18301832
err = -EINVAL;
18311833
en_err(priv,
18321834
"Total number of TX and XDP rings (%d) exceeds the maximum supported (%d)\n",
1833-
channel->tx_count * priv->prof->num_up + xdp_count,
1834-
MAX_TX_RINGS);
1835+
total_tx_count, MAX_TX_RINGS);
18351836
goto out;
18361837
}
18371838

drivers/net/ethernet/mellanox/mlx4/en_netdev.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ int mlx4_en_alloc_tx_queue_per_tc(struct net_device *dev, u8 tc)
9191
struct mlx4_en_dev *mdev = priv->mdev;
9292
struct mlx4_en_port_profile new_prof;
9393
struct mlx4_en_priv *tmp;
94+
int total_count;
9495
int port_up = 0;
9596
int err = 0;
9697

@@ -104,6 +105,14 @@ int mlx4_en_alloc_tx_queue_per_tc(struct net_device *dev, u8 tc)
104105
MLX4_EN_NUM_UP_HIGH;
105106
new_prof.tx_ring_num[TX] = new_prof.num_tx_rings_p_up *
106107
new_prof.num_up;
108+
total_count = new_prof.tx_ring_num[TX] + new_prof.tx_ring_num[TX_XDP];
109+
if (total_count > MAX_TX_RINGS) {
110+
err = -EINVAL;
111+
en_err(priv,
112+
"Total number of TX and XDP rings (%d) exceeds the maximum supported (%d)\n",
113+
total_count, MAX_TX_RINGS);
114+
goto out;
115+
}
107116
err = mlx4_en_try_alloc_resources(priv, tmp, &new_prof, true);
108117
if (err)
109118
goto out;

drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,15 @@ int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv,
239239
if (max_encap_size < ipv4_encap_size) {
240240
mlx5_core_warn(priv->mdev, "encap size %d too big, max supported is %d\n",
241241
ipv4_encap_size, max_encap_size);
242-
return -EOPNOTSUPP;
242+
err = -EOPNOTSUPP;
243+
goto out;
243244
}
244245

245246
encap_header = kzalloc(ipv4_encap_size, GFP_KERNEL);
246-
if (!encap_header)
247-
return -ENOMEM;
247+
if (!encap_header) {
248+
err = -ENOMEM;
249+
goto out;
250+
}
248251

249252
/* used by mlx5e_detach_encap to lookup a neigh hash table
250253
* entry in the neigh hash table when a user deletes a rule
@@ -355,12 +358,15 @@ int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv,
355358
if (max_encap_size < ipv6_encap_size) {
356359
mlx5_core_warn(priv->mdev, "encap size %d too big, max supported is %d\n",
357360
ipv6_encap_size, max_encap_size);
358-
return -EOPNOTSUPP;
361+
err = -EOPNOTSUPP;
362+
goto out;
359363
}
360364

361365
encap_header = kzalloc(ipv6_encap_size, GFP_KERNEL);
362-
if (!encap_header)
363-
return -ENOMEM;
366+
if (!encap_header) {
367+
err = -ENOMEM;
368+
goto out;
369+
}
364370

365371
/* used by mlx5e_detach_encap to lookup a neigh hash table
366372
* entry in the neigh hash table when a user deletes a rule

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,9 @@ static int get_fec_supported_advertised(struct mlx5_core_dev *dev,
708708

709709
static void ptys2ethtool_supported_advertised_port(struct ethtool_link_ksettings *link_ksettings,
710710
u32 eth_proto_cap,
711-
u8 connector_type)
711+
u8 connector_type, bool ext)
712712
{
713-
if (!connector_type || connector_type >= MLX5E_CONNECTOR_TYPE_NUMBER) {
713+
if ((!connector_type && !ext) || connector_type >= MLX5E_CONNECTOR_TYPE_NUMBER) {
714714
if (eth_proto_cap & (MLX5E_PROT_MASK(MLX5E_10GBASE_CR)
715715
| MLX5E_PROT_MASK(MLX5E_10GBASE_SR)
716716
| MLX5E_PROT_MASK(MLX5E_40GBASE_CR4)
@@ -842,9 +842,9 @@ static int ptys2connector_type[MLX5E_CONNECTOR_TYPE_NUMBER] = {
842842
[MLX5E_PORT_OTHER] = PORT_OTHER,
843843
};
844844

845-
static u8 get_connector_port(u32 eth_proto, u8 connector_type)
845+
static u8 get_connector_port(u32 eth_proto, u8 connector_type, bool ext)
846846
{
847-
if (connector_type && connector_type < MLX5E_CONNECTOR_TYPE_NUMBER)
847+
if ((connector_type || ext) && connector_type < MLX5E_CONNECTOR_TYPE_NUMBER)
848848
return ptys2connector_type[connector_type];
849849

850850
if (eth_proto &
@@ -945,9 +945,9 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
945945
eth_proto_oper = eth_proto_oper ? eth_proto_oper : eth_proto_cap;
946946

947947
link_ksettings->base.port = get_connector_port(eth_proto_oper,
948-
connector_type);
948+
connector_type, ext);
949949
ptys2ethtool_supported_advertised_port(link_ksettings, eth_proto_admin,
950-
connector_type);
950+
connector_type, ext);
951951
get_lp_advertising(mdev, eth_proto_lp, link_ksettings);
952952

953953
if (an_status == MLX5_AN_COMPLETE)

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4252,9 +4252,12 @@ static netdev_features_t mlx5e_tunnel_features_check(struct mlx5e_priv *priv,
42524252

42534253
switch (proto) {
42544254
case IPPROTO_GRE:
4255+
return features;
42554256
case IPPROTO_IPIP:
42564257
case IPPROTO_IPV6:
4257-
return features;
4258+
if (mlx5e_tunnel_proto_supported(priv->mdev, IPPROTO_IPIP))
4259+
return features;
4260+
break;
42584261
case IPPROTO_UDP:
42594262
udph = udp_hdr(skb);
42604263
port = be16_to_cpu(udph->dest);

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3268,7 +3268,20 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
32683268

32693269
action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
32703270
MLX5_FLOW_CONTEXT_ACTION_COUNT;
3271-
if (netdev_port_same_parent_id(priv->netdev, out_dev)) {
3271+
if (encap) {
3272+
parse_attr->mirred_ifindex[attr->out_count] =
3273+
out_dev->ifindex;
3274+
parse_attr->tun_info[attr->out_count] = dup_tun_info(info);
3275+
if (!parse_attr->tun_info[attr->out_count])
3276+
return -ENOMEM;
3277+
encap = false;
3278+
attr->dests[attr->out_count].flags |=
3279+
MLX5_ESW_DEST_ENCAP;
3280+
attr->out_count++;
3281+
/* attr->dests[].rep is resolved when we
3282+
* handle encap
3283+
*/
3284+
} else if (netdev_port_same_parent_id(priv->netdev, out_dev)) {
32723285
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
32733286
struct net_device *uplink_dev = mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH);
32743287
struct net_device *uplink_upper;
@@ -3310,19 +3323,6 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
33103323
attr->dests[attr->out_count].rep = rpriv->rep;
33113324
attr->dests[attr->out_count].mdev = out_priv->mdev;
33123325
attr->out_count++;
3313-
} else if (encap) {
3314-
parse_attr->mirred_ifindex[attr->out_count] =
3315-
out_dev->ifindex;
3316-
parse_attr->tun_info[attr->out_count] = dup_tun_info(info);
3317-
if (!parse_attr->tun_info[attr->out_count])
3318-
return -ENOMEM;
3319-
encap = false;
3320-
attr->dests[attr->out_count].flags |=
3321-
MLX5_ESW_DEST_ENCAP;
3322-
attr->out_count++;
3323-
/* attr->dests[].rep is resolved when we
3324-
* handle encap
3325-
*/
33263326
} else if (parse_attr->filter_dev != priv->netdev) {
33273327
/* All mlx5 devices are called to configure
33283328
* high level device filters. Therefore, the
@@ -4000,9 +4000,8 @@ int mlx5e_tc_configure_matchall(struct mlx5e_priv *priv,
40004000
struct tc_cls_matchall_offload *ma)
40014001
{
40024002
struct netlink_ext_ack *extack = ma->common.extack;
4003-
int prio = TC_H_MAJ(ma->common.prio) >> 16;
40044003

4005-
if (prio != 1) {
4004+
if (ma->common.prio != 1) {
40064005
NL_SET_ERR_MSG_MOD(extack, "only priority 1 is supported");
40074006
return -EINVAL;
40084007
}

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2117,7 +2117,7 @@ int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw,
21172117

21182118
unlock:
21192119
mutex_unlock(&esw->state_lock);
2120-
return 0;
2120+
return err;
21212121
}
21222122

21232123
int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw,

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ static void del_sw_flow_group(struct fs_node *node)
579579

580580
rhashtable_destroy(&fg->ftes_hash);
581581
ida_destroy(&fg->fte_allocator);
582-
if (ft->autogroup.active)
582+
if (ft->autogroup.active && fg->max_ftes == ft->autogroup.group_size)
583583
ft->autogroup.num_groups--;
584584
err = rhltable_remove(&ft->fgs_hash,
585585
&fg->hash,
@@ -1126,6 +1126,8 @@ mlx5_create_auto_grouped_flow_table(struct mlx5_flow_namespace *ns,
11261126

11271127
ft->autogroup.active = true;
11281128
ft->autogroup.required_groups = max_num_groups;
1129+
/* We save place for flow groups in addition to max types */
1130+
ft->autogroup.group_size = ft->max_fte / (max_num_groups + 1);
11291131

11301132
return ft;
11311133
}
@@ -1328,8 +1330,7 @@ static struct mlx5_flow_group *alloc_auto_flow_group(struct mlx5_flow_table *ft
13281330
return ERR_PTR(-ENOENT);
13291331

13301332
if (ft->autogroup.num_groups < ft->autogroup.required_groups)
1331-
/* We save place for flow groups in addition to max types */
1332-
group_size = ft->max_fte / (ft->autogroup.required_groups + 1);
1333+
group_size = ft->autogroup.group_size;
13331334

13341335
/* ft->max_fte == ft->autogroup.max_types */
13351336
if (group_size == 0)
@@ -1356,7 +1357,8 @@ static struct mlx5_flow_group *alloc_auto_flow_group(struct mlx5_flow_table *ft
13561357
if (IS_ERR(fg))
13571358
goto out;
13581359

1359-
ft->autogroup.num_groups++;
1360+
if (group_size == ft->autogroup.group_size)
1361+
ft->autogroup.num_groups++;
13601362

13611363
out:
13621364
return fg;

drivers/net/ethernet/mellanox/mlx5/core/fs_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ struct mlx5_flow_table {
162162
struct {
163163
bool active;
164164
unsigned int required_groups;
165+
unsigned int group_size;
165166
unsigned int num_groups;
166167
} autogroup;
167168
/* Protect fwd_rules */

drivers/net/ethernet/mellanox/mlx5/core/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,7 @@ static const struct pci_device_id mlx5_core_pci_table[] = {
15661566
{ PCI_VDEVICE(MELLANOX, 0x101c), MLX5_PCI_DEV_IS_VF}, /* ConnectX-6 VF */
15671567
{ PCI_VDEVICE(MELLANOX, 0x101d) }, /* ConnectX-6 Dx */
15681568
{ PCI_VDEVICE(MELLANOX, 0x101e), MLX5_PCI_DEV_IS_VF}, /* ConnectX Family mlx5Gen Virtual Function */
1569+
{ PCI_VDEVICE(MELLANOX, 0x101f) }, /* ConnectX-6 LX */
15691570
{ PCI_VDEVICE(MELLANOX, 0xa2d2) }, /* BlueField integrated ConnectX-5 network controller */
15701571
{ PCI_VDEVICE(MELLANOX, 0xa2d3), MLX5_PCI_DEV_IS_VF}, /* BlueField integrated ConnectX-5 network controller VF */
15711572
{ PCI_VDEVICE(MELLANOX, 0xa2d6) }, /* BlueField-2 integrated ConnectX-6 Dx network controller */

0 commit comments

Comments
 (0)