Skip to content

Commit fc0c054

Browse files
committed
Merge tag 'net-5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from bpf. Current release - regressions: - vhost_net: fix OoB on sendmsg() failure - mlx5: bridge, fix uninitialized variable usage - bnxt_en: fix error recovery regression Current release - new code bugs: - bpf, mm: fix lockdep warning triggered by stack_map_get_build_id_offset() Previous releases - regressions: - r6040: restore MDIO clock frequency after MAC reset - tcp: fix tp->undo_retrans accounting in tcp_sacktag_one() - dsa: flush switchdev workqueue before tearing down CPU/DSA ports Previous releases - always broken: - ptp: dp83640: don't define PAGE0, avoid compiler warning - igc: fix tunnel segmentation offloads - phylink: update SFP selected interface on advertising changes - stmmac: fix system hang caused by eee_ctrl_timer during suspend/resume - mlx5e: fix mutual exclusion between CQE compression and HW TS Misc: - bpf, cgroups: fix cgroup v2 fallback on v1/v2 mixed mode - sfc: fallback for lack of xdp tx queues - hns3: add option to turn off page pool feature" * tag 'net-5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (67 commits) mlxbf_gige: clear valid_polarity upon open igc: fix tunnel offloading net/{mlx5|nfp|bnxt}: Remove unnecessary RTNL lock assert net: wan: wanxl: define CROSS_COMPILE_M68K selftests: nci: replace unsigned int with int net: dsa: flush switchdev workqueue before tearing down CPU/DSA ports Revert "net: phy: Uniform PHY driver access" net: dsa: destroy the phylink instance on any error in dsa_slave_phy_setup ptp: dp83640: don't define PAGE0 bnx2x: Fix enabling network interfaces without VFs Revert "Revert "ipv4: fix memory leaks in ip_cmsg_send() callers"" tcp: fix tp->undo_retrans accounting in tcp_sacktag_one() net-caif: avoid user-triggerable WARN_ON(1) bpf, selftests: Add test case for mixed cgroup v1/v2 bpf, selftests: Add cgroup v1 net_cls classid helpers bpf, cgroups: Fix cgroup v2 fallback on v1/v2 mixed mode bpf: Add oversize check before call kvcalloc() net: hns3: fix the timing issue of VF clearing interrupt sources net: hns3: fix the exception when query imp info net: hns3: disable mac in flr process ...
2 parents 3c0d2a4 + ee8a960 commit fc0c054

Some content is hidden

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

80 files changed

+770
-384
lines changed

Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ properties:
1919
- const: allwinner,sun8i-v3s-emac
2020
- const: allwinner,sun50i-a64-emac
2121
- items:
22-
- const: allwinner,sun50i-h6-emac
22+
- enum:
23+
- allwinner,sun20i-d1-emac
24+
- allwinner,sun50i-h6-emac
2325
- const: allwinner,sun50i-a64-emac
2426

2527
reg:

drivers/net/dsa/lantiq_gswip.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,6 +1885,12 @@ static int gswip_gphy_fw_load(struct gswip_priv *priv, struct gswip_gphy_fw *gph
18851885

18861886
reset_control_assert(gphy_fw->reset);
18871887

1888+
/* The vendor BSP uses a 200ms delay after asserting the reset line.
1889+
* Without this some users are observing that the PHY is not coming up
1890+
* on the MDIO bus.
1891+
*/
1892+
msleep(200);
1893+
18881894
ret = request_firmware(&fw, gphy_fw->fw_name, dev);
18891895
if (ret) {
18901896
dev_err(dev, "failed to load firmware: %s, error: %i\n",

drivers/net/dsa/qca8k.c

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,8 @@ qca8k_mdio_busy_wait(struct mii_bus *bus, u32 reg, u32 mask)
643643
}
644644

645645
static int
646-
qca8k_mdio_write(struct mii_bus *salve_bus, int phy, int regnum, u16 data)
646+
qca8k_mdio_write(struct mii_bus *bus, int phy, int regnum, u16 data)
647647
{
648-
struct qca8k_priv *priv = salve_bus->priv;
649-
struct mii_bus *bus = priv->bus;
650648
u16 r1, r2, page;
651649
u32 val;
652650
int ret;
@@ -682,10 +680,8 @@ qca8k_mdio_write(struct mii_bus *salve_bus, int phy, int regnum, u16 data)
682680
}
683681

684682
static int
685-
qca8k_mdio_read(struct mii_bus *salve_bus, int phy, int regnum)
683+
qca8k_mdio_read(struct mii_bus *bus, int phy, int regnum)
686684
{
687-
struct qca8k_priv *priv = salve_bus->priv;
688-
struct mii_bus *bus = priv->bus;
689685
u16 r1, r2, page;
690686
u32 val;
691687
int ret;
@@ -726,6 +722,24 @@ qca8k_mdio_read(struct mii_bus *salve_bus, int phy, int regnum)
726722
return ret;
727723
}
728724

725+
static int
726+
qca8k_internal_mdio_write(struct mii_bus *slave_bus, int phy, int regnum, u16 data)
727+
{
728+
struct qca8k_priv *priv = slave_bus->priv;
729+
struct mii_bus *bus = priv->bus;
730+
731+
return qca8k_mdio_write(bus, phy, regnum, data);
732+
}
733+
734+
static int
735+
qca8k_internal_mdio_read(struct mii_bus *slave_bus, int phy, int regnum)
736+
{
737+
struct qca8k_priv *priv = slave_bus->priv;
738+
struct mii_bus *bus = priv->bus;
739+
740+
return qca8k_mdio_read(bus, phy, regnum);
741+
}
742+
729743
static int
730744
qca8k_phy_write(struct dsa_switch *ds, int port, int regnum, u16 data)
731745
{
@@ -775,8 +789,8 @@ qca8k_mdio_register(struct qca8k_priv *priv, struct device_node *mdio)
775789

776790
bus->priv = (void *)priv;
777791
bus->name = "qca8k slave mii";
778-
bus->read = qca8k_mdio_read;
779-
bus->write = qca8k_mdio_write;
792+
bus->read = qca8k_internal_mdio_read;
793+
bus->write = qca8k_internal_mdio_write;
780794
snprintf(bus->id, MII_BUS_ID_SIZE, "qca8k-%d",
781795
ds->index);
782796

drivers/net/ethernet/8390/ne.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -922,13 +922,16 @@ static void __init ne_add_devices(void)
922922
}
923923
}
924924

925-
#ifdef MODULE
926925
static int __init ne_init(void)
927926
{
928927
int retval;
929-
ne_add_devices();
928+
929+
if (IS_MODULE(CONFIG_NE2000))
930+
ne_add_devices();
931+
930932
retval = platform_driver_probe(&ne_driver, ne_drv_probe);
931-
if (retval) {
933+
934+
if (IS_MODULE(CONFIG_NE2000) && retval) {
932935
if (io[0] == 0)
933936
pr_notice("ne.c: You must supply \"io=0xNNN\""
934937
" value(s) for ISA cards.\n");
@@ -941,18 +944,8 @@ static int __init ne_init(void)
941944
return retval;
942945
}
943946
module_init(ne_init);
944-
#else /* MODULE */
945-
static int __init ne_init(void)
946-
{
947-
int retval = platform_driver_probe(&ne_driver, ne_drv_probe);
948-
949-
/* Unregister unused platform_devices. */
950-
ne_loop_rm_unreg(0);
951-
return retval;
952-
}
953-
module_init(ne_init);
954947

955-
#ifdef CONFIG_NETDEV_LEGACY_INIT
948+
#if !defined(MODULE) && defined(CONFIG_NETDEV_LEGACY_INIT)
956949
struct net_device * __init ne_probe(int unit)
957950
{
958951
int this_dev;
@@ -994,7 +987,6 @@ struct net_device * __init ne_probe(int unit)
994987
return ERR_PTR(-ENODEV);
995988
}
996989
#endif
997-
#endif /* MODULE */
998990

999991
static void __exit ne_exit(void)
1000992
{

drivers/net/ethernet/amd/ni65.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ static void ni65_stop_start(struct net_device *dev,struct priv *p)
748748
#ifdef XMT_VIA_SKB
749749
skb_save[i] = p->tmd_skb[i];
750750
#endif
751-
buffer[i] = (u32) isa_bus_to_virt(tmdp->u.buffer);
751+
buffer[i] = (unsigned long)isa_bus_to_virt(tmdp->u.buffer);
752752
blen[i] = tmdp->blen;
753753
tmdp->u.s.status = 0x0;
754754
}

drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param,
12241224

12251225
/* SR-IOV capability was enabled but there are no VFs*/
12261226
if (iov->total == 0) {
1227-
err = -EINVAL;
1227+
err = 0;
12281228
goto failed;
12291229
}
12301230

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,12 +2213,11 @@ static int bnxt_async_event_process(struct bnxt *bp,
22132213
DIV_ROUND_UP(fw_health->polling_dsecs * HZ,
22142214
bp->current_interval * 10);
22152215
fw_health->tmr_counter = fw_health->tmr_multiplier;
2216-
if (!fw_health->enabled) {
2216+
if (!fw_health->enabled)
22172217
fw_health->last_fw_heartbeat =
22182218
bnxt_fw_health_readl(bp, BNXT_FW_HEARTBEAT_REG);
2219-
fw_health->last_fw_reset_cnt =
2220-
bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG);
2221-
}
2219+
fw_health->last_fw_reset_cnt =
2220+
bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG);
22222221
netif_info(bp, drv, bp->dev,
22232222
"Error recovery info: error recovery[1], master[%d], reset count[%u], health status: 0x%x\n",
22242223
fw_health->master, fw_health->last_fw_reset_cnt,
@@ -2730,6 +2729,9 @@ static void bnxt_free_tx_skbs(struct bnxt *bp)
27302729
struct bnxt_tx_ring_info *txr = &bp->tx_ring[i];
27312730
int j;
27322731

2732+
if (!txr->tx_buf_ring)
2733+
continue;
2734+
27332735
for (j = 0; j < max_idx;) {
27342736
struct bnxt_sw_tx_bd *tx_buf = &txr->tx_buf_ring[j];
27352737
struct sk_buff *skb;
@@ -2814,6 +2816,9 @@ static void bnxt_free_one_rx_ring_skbs(struct bnxt *bp, int ring_nr)
28142816
}
28152817

28162818
skip_rx_tpa_free:
2819+
if (!rxr->rx_buf_ring)
2820+
goto skip_rx_buf_free;
2821+
28172822
for (i = 0; i < max_idx; i++) {
28182823
struct bnxt_sw_rx_bd *rx_buf = &rxr->rx_buf_ring[i];
28192824
dma_addr_t mapping = rx_buf->mapping;
@@ -2836,6 +2841,11 @@ static void bnxt_free_one_rx_ring_skbs(struct bnxt *bp, int ring_nr)
28362841
kfree(data);
28372842
}
28382843
}
2844+
2845+
skip_rx_buf_free:
2846+
if (!rxr->rx_agg_ring)
2847+
goto skip_rx_agg_free;
2848+
28392849
for (i = 0; i < max_agg_idx; i++) {
28402850
struct bnxt_sw_rx_agg_bd *rx_agg_buf = &rxr->rx_agg_ring[i];
28412851
struct page *page = rx_agg_buf->page;
@@ -2852,6 +2862,8 @@ static void bnxt_free_one_rx_ring_skbs(struct bnxt *bp, int ring_nr)
28522862

28532863
__free_page(page);
28542864
}
2865+
2866+
skip_rx_agg_free:
28552867
if (rxr->rx_page) {
28562868
__free_page(rxr->rx_page);
28572869
rxr->rx_page = NULL;
@@ -2900,6 +2912,9 @@ static void bnxt_free_ring(struct bnxt *bp, struct bnxt_ring_mem_info *rmem)
29002912
struct pci_dev *pdev = bp->pdev;
29012913
int i;
29022914

2915+
if (!rmem->pg_arr)
2916+
goto skip_pages;
2917+
29032918
for (i = 0; i < rmem->nr_pages; i++) {
29042919
if (!rmem->pg_arr[i])
29052920
continue;
@@ -2909,6 +2924,7 @@ static void bnxt_free_ring(struct bnxt *bp, struct bnxt_ring_mem_info *rmem)
29092924

29102925
rmem->pg_arr[i] = NULL;
29112926
}
2927+
skip_pages:
29122928
if (rmem->pg_tbl) {
29132929
size_t pg_tbl_size = rmem->nr_pages * 8;
29142930

@@ -3228,10 +3244,14 @@ static int bnxt_alloc_tx_rings(struct bnxt *bp)
32283244

32293245
static void bnxt_free_cp_arrays(struct bnxt_cp_ring_info *cpr)
32303246
{
3247+
struct bnxt_ring_struct *ring = &cpr->cp_ring_struct;
3248+
32313249
kfree(cpr->cp_desc_ring);
32323250
cpr->cp_desc_ring = NULL;
3251+
ring->ring_mem.pg_arr = NULL;
32333252
kfree(cpr->cp_desc_mapping);
32343253
cpr->cp_desc_mapping = NULL;
3254+
ring->ring_mem.dma_arr = NULL;
32353255
}
32363256

32373257
static int bnxt_alloc_cp_arrays(struct bnxt_cp_ring_info *cpr, int n)
@@ -12207,6 +12227,11 @@ static void bnxt_fw_reset_task(struct work_struct *work)
1220712227
return;
1220812228
}
1220912229

12230+
if ((bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY) &&
12231+
bp->fw_health->enabled) {
12232+
bp->fw_health->last_fw_reset_cnt =
12233+
bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG);
12234+
}
1221012235
bp->fw_reset_state = 0;
1221112236
/* Make sure fw_reset_state is 0 before clearing the flag */
1221212237
smp_mb__before_atomic();

drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,9 +1884,6 @@ bnxt_tc_indr_block_cb_lookup(struct bnxt *bp, struct net_device *netdev)
18841884
{
18851885
struct bnxt_flower_indr_block_cb_priv *cb_priv;
18861886

1887-
/* All callback list access should be protected by RTNL. */
1888-
ASSERT_RTNL();
1889-
18901887
list_for_each_entry(cb_priv, &bp->tc_indr_block_list, list)
18911888
if (cb_priv->tunnel_netdev == netdev)
18921889
return cb_priv;

drivers/net/ethernet/cadence/macb_pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ static void macb_remove(struct pci_dev *pdev)
111111
struct platform_device *plat_dev = pci_get_drvdata(pdev);
112112
struct macb_platform_data *plat_data = dev_get_platdata(&plat_dev->dev);
113113

114-
platform_device_unregister(plat_dev);
115114
clk_unregister(plat_data->pclk);
116115
clk_unregister(plat_data->hclk);
116+
platform_device_unregister(plat_dev);
117117
}
118118

119119
static const struct pci_device_id dev_id_table[] = {

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ static unsigned int tx_sgl = 1;
6161
module_param(tx_sgl, uint, 0600);
6262
MODULE_PARM_DESC(tx_sgl, "Minimum number of frags when using dma_map_sg() to optimize the IOMMU mapping");
6363

64+
static bool page_pool_enabled = true;
65+
module_param(page_pool_enabled, bool, 0400);
66+
6467
#define HNS3_SGL_SIZE(nfrag) (sizeof(struct scatterlist) * (nfrag) + \
6568
sizeof(struct sg_table))
6669
#define HNS3_MAX_SGL_SIZE ALIGN(HNS3_SGL_SIZE(HNS3_MAX_TSO_BD_NUM), \
@@ -73,6 +76,7 @@ MODULE_PARM_DESC(tx_sgl, "Minimum number of frags when using dma_map_sg() to opt
7376
#define HNS3_OUTER_VLAN_TAG 2
7477

7578
#define HNS3_MIN_TX_LEN 33U
79+
#define HNS3_MIN_TUN_PKT_LEN 65U
7680

7781
/* hns3_pci_tbl - PCI Device ID Table
7882
*
@@ -1424,8 +1428,11 @@ static int hns3_set_l2l3l4(struct sk_buff *skb, u8 ol4_proto,
14241428
l4.tcp->doff);
14251429
break;
14261430
case IPPROTO_UDP:
1427-
if (hns3_tunnel_csum_bug(skb))
1428-
return skb_checksum_help(skb);
1431+
if (hns3_tunnel_csum_bug(skb)) {
1432+
int ret = skb_put_padto(skb, HNS3_MIN_TUN_PKT_LEN);
1433+
1434+
return ret ? ret : skb_checksum_help(skb);
1435+
}
14291436

14301437
hns3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4CS_B, 1);
14311438
hns3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4T_S,
@@ -4753,7 +4760,8 @@ static int hns3_alloc_ring_memory(struct hns3_enet_ring *ring)
47534760
goto out_with_desc_cb;
47544761

47554762
if (!HNAE3_IS_TX_RING(ring)) {
4756-
hns3_alloc_page_pool(ring);
4763+
if (page_pool_enabled)
4764+
hns3_alloc_page_pool(ring);
47574765

47584766
ret = hns3_alloc_ring_buffers(ring);
47594767
if (ret)

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,10 @@ hclge_dbg_get_imp_stats_info(struct hclge_dev *hdev, char *buf, int len)
17241724
}
17251725

17261726
bd_num = le32_to_cpu(req->bd_num);
1727+
if (!bd_num) {
1728+
dev_err(&hdev->pdev->dev, "imp statistics bd number is 0!\n");
1729+
return -EINVAL;
1730+
}
17271731

17281732
desc_src = kcalloc(bd_num, sizeof(struct hclge_desc), GFP_KERNEL);
17291733
if (!desc_src)

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,9 +1528,10 @@ static void hclge_init_kdump_kernel_config(struct hclge_dev *hdev)
15281528
static int hclge_configure(struct hclge_dev *hdev)
15291529
{
15301530
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev);
1531+
const struct cpumask *cpumask = cpu_online_mask;
15311532
struct hclge_cfg cfg;
15321533
unsigned int i;
1533-
int ret;
1534+
int node, ret;
15341535

15351536
ret = hclge_get_cfg(hdev, &cfg);
15361537
if (ret)
@@ -1595,11 +1596,12 @@ static int hclge_configure(struct hclge_dev *hdev)
15951596

15961597
hclge_init_kdump_kernel_config(hdev);
15971598

1598-
/* Set the init affinity based on pci func number */
1599-
i = cpumask_weight(cpumask_of_node(dev_to_node(&hdev->pdev->dev)));
1600-
i = i ? PCI_FUNC(hdev->pdev->devfn) % i : 0;
1601-
cpumask_set_cpu(cpumask_local_spread(i, dev_to_node(&hdev->pdev->dev)),
1602-
&hdev->affinity_mask);
1599+
/* Set the affinity based on numa node */
1600+
node = dev_to_node(&hdev->pdev->dev);
1601+
if (node != NUMA_NO_NODE)
1602+
cpumask = cpumask_of_node(node);
1603+
1604+
cpumask_copy(&hdev->affinity_mask, cpumask);
16031605

16041606
return ret;
16051607
}
@@ -8125,11 +8127,12 @@ static void hclge_ae_stop(struct hnae3_handle *handle)
81258127
hclge_clear_arfs_rules(hdev);
81268128
spin_unlock_bh(&hdev->fd_rule_lock);
81278129

8128-
/* If it is not PF reset, the firmware will disable the MAC,
8130+
/* If it is not PF reset or FLR, the firmware will disable the MAC,
81298131
* so it only need to stop phy here.
81308132
*/
81318133
if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) &&
8132-
hdev->reset_type != HNAE3_FUNC_RESET) {
8134+
hdev->reset_type != HNAE3_FUNC_RESET &&
8135+
hdev->reset_type != HNAE3_FLR_RESET) {
81338136
hclge_mac_stop_phy(hdev);
81348137
hclge_update_link_status(hdev);
81358138
return;

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2465,6 +2465,8 @@ static irqreturn_t hclgevf_misc_irq_handle(int irq, void *data)
24652465

24662466
hclgevf_enable_vector(&hdev->misc_vector, false);
24672467
event_cause = hclgevf_check_evt_cause(hdev, &clearval);
2468+
if (event_cause != HCLGEVF_VECTOR0_EVENT_OTHER)
2469+
hclgevf_clear_event_cause(hdev, clearval);
24682470

24692471
switch (event_cause) {
24702472
case HCLGEVF_VECTOR0_EVENT_RST:
@@ -2477,10 +2479,8 @@ static irqreturn_t hclgevf_misc_irq_handle(int irq, void *data)
24772479
break;
24782480
}
24792481

2480-
if (event_cause != HCLGEVF_VECTOR0_EVENT_OTHER) {
2481-
hclgevf_clear_event_cause(hdev, clearval);
2482+
if (event_cause != HCLGEVF_VECTOR0_EVENT_OTHER)
24822483
hclgevf_enable_vector(&hdev->misc_vector, true);
2483-
}
24842484

24852485
return IRQ_HANDLED;
24862486
}

0 commit comments

Comments
 (0)