Skip to content

Commit a4a35f6

Browse files
committed
Merge tag 'net-6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from wireless and netfilter Current release - regressions: - udp: fall back to software USO if IPv6 extension headers are present - wifi: iwlwifi: correctly lookup DMA address in SG table Current release - new code bugs: - eth: mlx5e: fix queue stats access to non-existing channels splat Previous releases - regressions: - eth: mlx5e: take state lock during tx timeout reporter - eth: mlxbf_gige: disable RX filters until RX path initialized - eth: igc: fix reset adapter logics when tx mode change Previous releases - always broken: - tcp: update window clamping condition - netfilter: - nf_queue: drop packets with cloned unconfirmed conntracks - nf_tables: Add locking for NFT_MSG_GETOBJ_RESET requests - vsock: fix recursive ->recvmsg calls - dsa: vsc73xx: fix MDIO bus access and PHY opera - eth: gtp: pull network headers in gtp_dev_xmit() - eth: igc: fix packet still tx after gate close by reducing i226 MAC retry buffer - eth: mana: fix RX buf alloc_size alignment and atomic op panic - eth: hns3: fix a deadlock problem when config TC during resetting" * tag 'net-6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (58 commits) net: hns3: use correct release function during uninitialization net: hns3: void array out of bound when loop tnl_num net: hns3: fix a deadlock problem when config TC during resetting net: hns3: use the user's cfg after reset net: hns3: fix wrong use of semaphore up selftests: net: lib: kill PIDs before del netns pse-core: Conditionally set current limit during PI regulator registration net: thunder_bgx: Fix netdev structure allocation net: ethtool: Allow write mechanism of LPL and both LPL and EPL vsock: fix recursive ->recvmsg calls selftest: af_unix: Fix kselftest compilation warnings netfilter: nf_tables: Add locking for NFT_MSG_GETOBJ_RESET requests netfilter: nf_tables: Introduce nf_tables_getobj_single netfilter: nf_tables: Audit log dump reset after the fact selftests: netfilter: add test for br_netfilter+conntrack+queue combination netfilter: nf_queue: drop packets with cloned unconfirmed conntracks netfilter: flowtable: initialise extack before use netfilter: nfnetlink: Initialise extack before use in ACKs netfilter: allow ipv6 fragments to arrive on different devices tcp: Update window clamping condition ...
2 parents 20573d8 + 9c5af2d commit a4a35f6

File tree

63 files changed

+790
-261
lines changed

Some content is hidden

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

63 files changed

+790
-261
lines changed

Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ properties:
3838

3939
managed: true
4040

41+
phys:
42+
description: A reference to the SerDes lane(s)
43+
maxItems: 1
44+
4145
required:
4246
- reg
4347

drivers/atm/idt77252.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,8 +1118,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
11181118
rpp->len += skb->len;
11191119

11201120
if (stat & SAR_RSQE_EPDU) {
1121+
unsigned int len, truesize;
11211122
unsigned char *l1l2;
1122-
unsigned int len;
11231123

11241124
l1l2 = (unsigned char *) ((unsigned long) skb->data + skb->len - 6);
11251125

@@ -1189,14 +1189,15 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
11891189
ATM_SKB(skb)->vcc = vcc;
11901190
__net_timestamp(skb);
11911191

1192+
truesize = skb->truesize;
11921193
vcc->push(vcc, skb);
11931194
atomic_inc(&vcc->stats->rx);
11941195

1195-
if (skb->truesize > SAR_FB_SIZE_3)
1196+
if (truesize > SAR_FB_SIZE_3)
11961197
add_rx_skb(card, 3, SAR_FB_SIZE_3, 1);
1197-
else if (skb->truesize > SAR_FB_SIZE_2)
1198+
else if (truesize > SAR_FB_SIZE_2)
11981199
add_rx_skb(card, 2, SAR_FB_SIZE_2, 1);
1199-
else if (skb->truesize > SAR_FB_SIZE_1)
1200+
else if (truesize > SAR_FB_SIZE_1)
12001201
add_rx_skb(card, 1, SAR_FB_SIZE_1, 1);
12011202
else
12021203
add_rx_skb(card, 0, SAR_FB_SIZE_0, 1);

drivers/net/dsa/vitesse-vsc73xx-core.c

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
#define VSC73XX_BLOCK_ARBITER 0x5 /* Only subblock 0 */
4141
#define VSC73XX_BLOCK_SYSTEM 0x7 /* Only subblock 0 */
4242

43+
/* MII Block subblock */
44+
#define VSC73XX_BLOCK_MII_INTERNAL 0x0 /* Internal MDIO subblock */
45+
#define VSC73XX_BLOCK_MII_EXTERNAL 0x1 /* External MDIO subblock */
46+
4347
#define CPU_PORT 6 /* CPU port */
4448

4549
/* MAC Block registers */
@@ -225,6 +229,8 @@
225229
#define VSC73XX_MII_CMD 0x1
226230
#define VSC73XX_MII_DATA 0x2
227231

232+
#define VSC73XX_MII_STAT_BUSY BIT(3)
233+
228234
/* Arbiter block 5 registers */
229235
#define VSC73XX_ARBEMPTY 0x0c
230236
#define VSC73XX_ARBDISC 0x0e
@@ -299,6 +305,7 @@
299305
#define IS_739X(a) (IS_7395(a) || IS_7398(a))
300306

301307
#define VSC73XX_POLL_SLEEP_US 1000
308+
#define VSC73XX_MDIO_POLL_SLEEP_US 5
302309
#define VSC73XX_POLL_TIMEOUT_US 10000
303310

304311
struct vsc73xx_counter {
@@ -527,19 +534,43 @@ static int vsc73xx_detect(struct vsc73xx *vsc)
527534
return 0;
528535
}
529536

537+
static int vsc73xx_mdio_busy_check(struct vsc73xx *vsc)
538+
{
539+
int ret, err;
540+
u32 val;
541+
542+
ret = read_poll_timeout(vsc73xx_read, err,
543+
err < 0 || !(val & VSC73XX_MII_STAT_BUSY),
544+
VSC73XX_MDIO_POLL_SLEEP_US,
545+
VSC73XX_POLL_TIMEOUT_US, false, vsc,
546+
VSC73XX_BLOCK_MII, VSC73XX_BLOCK_MII_INTERNAL,
547+
VSC73XX_MII_STAT, &val);
548+
if (ret)
549+
return ret;
550+
return err;
551+
}
552+
530553
static int vsc73xx_phy_read(struct dsa_switch *ds, int phy, int regnum)
531554
{
532555
struct vsc73xx *vsc = ds->priv;
533556
u32 cmd;
534557
u32 val;
535558
int ret;
536559

560+
ret = vsc73xx_mdio_busy_check(vsc);
561+
if (ret)
562+
return ret;
563+
537564
/* Setting bit 26 means "read" */
538565
cmd = BIT(26) | (phy << 21) | (regnum << 16);
539566
ret = vsc73xx_write(vsc, VSC73XX_BLOCK_MII, 0, 1, cmd);
540567
if (ret)
541568
return ret;
542-
msleep(2);
569+
570+
ret = vsc73xx_mdio_busy_check(vsc);
571+
if (ret)
572+
return ret;
573+
543574
ret = vsc73xx_read(vsc, VSC73XX_BLOCK_MII, 0, 2, &val);
544575
if (ret)
545576
return ret;
@@ -563,18 +594,11 @@ static int vsc73xx_phy_write(struct dsa_switch *ds, int phy, int regnum,
563594
u32 cmd;
564595
int ret;
565596

566-
/* It was found through tedious experiments that this router
567-
* chip really hates to have it's PHYs reset. They
568-
* never recover if that happens: autonegotiation stops
569-
* working after a reset. Just filter out this command.
570-
* (Resetting the whole chip is OK.)
571-
*/
572-
if (regnum == 0 && (val & BIT(15))) {
573-
dev_info(vsc->dev, "reset PHY - disallowed\n");
574-
return 0;
575-
}
597+
ret = vsc73xx_mdio_busy_check(vsc);
598+
if (ret)
599+
return ret;
576600

577-
cmd = (phy << 21) | (regnum << 16);
601+
cmd = (phy << 21) | (regnum << 16) | val;
578602
ret = vsc73xx_write(vsc, VSC73XX_BLOCK_MII, 0, 1, cmd);
579603
if (ret)
580604
return ret;
@@ -957,6 +981,11 @@ static void vsc73xx_mac_link_up(struct phylink_config *config,
957981

958982
if (duplex == DUPLEX_FULL)
959983
val |= VSC73XX_MAC_CFG_FDX;
984+
else
985+
/* In datasheet description ("Port Mode Procedure" in 5.6.2)
986+
* this bit is configured only for half duplex.
987+
*/
988+
val |= VSC73XX_MAC_CFG_WEXC_DIS;
960989

961990
/* This routine is described in the datasheet (below ARBDISC register
962991
* description)
@@ -967,7 +996,6 @@ static void vsc73xx_mac_link_up(struct phylink_config *config,
967996
get_random_bytes(&seed, 1);
968997
val |= seed << VSC73XX_MAC_CFG_SEED_OFFSET;
969998
val |= VSC73XX_MAC_CFG_SEED_LOAD;
970-
val |= VSC73XX_MAC_CFG_WEXC_DIS;
971999

9721000
/* Those bits are responsible for MTU only. Kernel takes care about MTU,
9731001
* let's enable +8 bytes frame length unconditionally.

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5250,8 +5250,8 @@ static int __maybe_unused macb_suspend(struct device *dev)
52505250
if (bp->wol & MACB_WOL_ENABLED) {
52515251
/* Check for IP address in WOL ARP mode */
52525252
idev = __in_dev_get_rcu(bp->dev);
5253-
if (idev && idev->ifa_list)
5254-
ifa = rcu_access_pointer(idev->ifa_list);
5253+
if (idev)
5254+
ifa = rcu_dereference(idev->ifa_list);
52555255
if ((bp->wolopts & WAKE_ARP) && !ifa) {
52565256
netdev_err(netdev, "IP address not assigned as required by WoL walk ARP\n");
52575257
return -EOPNOTSUPP;

drivers/net/ethernet/cavium/thunder/thunder_bgx.c

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,18 +1054,12 @@ static int phy_interface_mode(u8 lmac_type)
10541054

10551055
static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid)
10561056
{
1057-
struct lmac *lmac, **priv;
1057+
struct lmac *lmac;
10581058
u64 cfg;
10591059

10601060
lmac = &bgx->lmac[lmacid];
10611061
lmac->bgx = bgx;
10621062

1063-
lmac->netdev = alloc_netdev_dummy(sizeof(struct lmac *));
1064-
if (!lmac->netdev)
1065-
return -ENOMEM;
1066-
priv = netdev_priv(lmac->netdev);
1067-
*priv = lmac;
1068-
10691063
if ((lmac->lmac_type == BGX_MODE_SGMII) ||
10701064
(lmac->lmac_type == BGX_MODE_QSGMII) ||
10711065
(lmac->lmac_type == BGX_MODE_RGMII)) {
@@ -1191,7 +1185,6 @@ static void bgx_lmac_disable(struct bgx *bgx, u8 lmacid)
11911185
(lmac->lmac_type != BGX_MODE_10G_KR) && lmac->phydev)
11921186
phy_disconnect(lmac->phydev);
11931187

1194-
free_netdev(lmac->netdev);
11951188
lmac->phydev = NULL;
11961189
}
11971190

@@ -1653,6 +1646,23 @@ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
16531646

16541647
bgx_get_qlm_mode(bgx);
16551648

1649+
for (lmac = 0; lmac < bgx->lmac_count; lmac++) {
1650+
struct lmac *lmacp, **priv;
1651+
1652+
lmacp = &bgx->lmac[lmac];
1653+
lmacp->netdev = alloc_netdev_dummy(sizeof(struct lmac *));
1654+
1655+
if (!lmacp->netdev) {
1656+
for (int i = 0; i < lmac; i++)
1657+
free_netdev(bgx->lmac[i].netdev);
1658+
err = -ENOMEM;
1659+
goto err_enable;
1660+
}
1661+
1662+
priv = netdev_priv(lmacp->netdev);
1663+
*priv = lmacp;
1664+
}
1665+
16561666
err = bgx_init_phy(bgx);
16571667
if (err)
16581668
goto err_enable;
@@ -1692,8 +1702,10 @@ static void bgx_remove(struct pci_dev *pdev)
16921702
u8 lmac;
16931703

16941704
/* Disable all LMACs */
1695-
for (lmac = 0; lmac < bgx->lmac_count; lmac++)
1705+
for (lmac = 0; lmac < bgx->lmac_count; lmac++) {
16961706
bgx_lmac_disable(bgx, lmac);
1707+
free_netdev(bgx->lmac[lmac].netdev);
1708+
}
16971709

16981710
pci_free_irq(pdev, GMPX_GMI_TX_INT, bgx);
16991711

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5724,6 +5724,9 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)
57245724
struct net_device *netdev = handle->kinfo.netdev;
57255725
struct hns3_nic_priv *priv = netdev_priv(netdev);
57265726

5727+
if (!test_bit(HNS3_NIC_STATE_DOWN, &priv->state))
5728+
hns3_nic_net_stop(netdev);
5729+
57275730
if (!test_and_clear_bit(HNS3_NIC_STATE_INITED, &priv->state)) {
57285731
netdev_warn(netdev, "already uninitialized\n");
57295732
return 0;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,8 +1598,7 @@ static void hclge_query_reg_info_of_ssu(struct hclge_dev *hdev)
15981598
{
15991599
u32 loop_para[HCLGE_MOD_MSG_PARA_ARRAY_MAX_SIZE] = {0};
16001600
struct hclge_mod_reg_common_msg msg;
1601-
u8 i, j, num;
1602-
u32 loop_time;
1601+
u8 i, j, num, loop_time;
16031602

16041603
num = ARRAY_SIZE(hclge_ssu_reg_common_msg);
16051604
for (i = 0; i < num; i++) {
@@ -1609,7 +1608,8 @@ static void hclge_query_reg_info_of_ssu(struct hclge_dev *hdev)
16091608
loop_time = 1;
16101609
loop_para[0] = 0;
16111610
if (msg.need_para) {
1612-
loop_time = hdev->ae_dev->dev_specs.tnl_num;
1611+
loop_time = min(hdev->ae_dev->dev_specs.tnl_num,
1612+
HCLGE_MOD_MSG_PARA_ARRAY_MAX_SIZE);
16131613
for (j = 0; j < loop_time; j++)
16141614
loop_para[j] = j + 1;
16151615
}

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

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,8 +2653,17 @@ static int hclge_cfg_mac_speed_dup_h(struct hnae3_handle *handle, int speed,
26532653
{
26542654
struct hclge_vport *vport = hclge_get_vport(handle);
26552655
struct hclge_dev *hdev = vport->back;
2656+
int ret;
2657+
2658+
ret = hclge_cfg_mac_speed_dup(hdev, speed, duplex, lane_num);
2659+
2660+
if (ret)
2661+
return ret;
26562662

2657-
return hclge_cfg_mac_speed_dup(hdev, speed, duplex, lane_num);
2663+
hdev->hw.mac.req_speed = speed;
2664+
hdev->hw.mac.req_duplex = duplex;
2665+
2666+
return 0;
26582667
}
26592668

26602669
static int hclge_set_autoneg_en(struct hclge_dev *hdev, bool enable)
@@ -2956,17 +2965,20 @@ static int hclge_mac_init(struct hclge_dev *hdev)
29562965
if (!test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
29572966
hdev->hw.mac.duplex = HCLGE_MAC_FULL;
29582967

2959-
ret = hclge_cfg_mac_speed_dup_hw(hdev, hdev->hw.mac.speed,
2960-
hdev->hw.mac.duplex, hdev->hw.mac.lane_num);
2961-
if (ret)
2962-
return ret;
2963-
29642968
if (hdev->hw.mac.support_autoneg) {
29652969
ret = hclge_set_autoneg_en(hdev, hdev->hw.mac.autoneg);
29662970
if (ret)
29672971
return ret;
29682972
}
29692973

2974+
if (!hdev->hw.mac.autoneg) {
2975+
ret = hclge_cfg_mac_speed_dup_hw(hdev, hdev->hw.mac.req_speed,
2976+
hdev->hw.mac.req_duplex,
2977+
hdev->hw.mac.lane_num);
2978+
if (ret)
2979+
return ret;
2980+
}
2981+
29702982
mac->link = 0;
29712983

29722984
if (mac->user_fec_mode & BIT(HNAE3_FEC_USER_DEF)) {
@@ -11444,7 +11456,7 @@ static void hclge_pci_uninit(struct hclge_dev *hdev)
1144411456

1144511457
pcim_iounmap(pdev, hdev->hw.hw.io_base);
1144611458
pci_free_irq_vectors(pdev);
11447-
pci_release_mem_regions(pdev);
11459+
pci_release_regions(pdev);
1144811460
pci_disable_device(pdev);
1144911461
}
1145011462

@@ -11516,8 +11528,8 @@ static void hclge_reset_done(struct hnae3_ae_dev *ae_dev)
1151611528
dev_err(&hdev->pdev->dev, "fail to rebuild, ret=%d\n", ret);
1151711529

1151811530
hdev->reset_type = HNAE3_NONE_RESET;
11519-
clear_bit(HCLGE_STATE_RST_HANDLING, &hdev->state);
11520-
up(&hdev->reset_sem);
11531+
if (test_and_clear_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
11532+
up(&hdev->reset_sem);
1152111533
}
1152211534

1152311535
static void hclge_clear_resetting_state(struct hclge_dev *hdev)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ static void hclge_mac_adjust_link(struct net_device *netdev)
191191
if (ret)
192192
netdev_err(netdev, "failed to adjust link.\n");
193193

194+
hdev->hw.mac.req_speed = (u32)speed;
195+
hdev->hw.mac.req_duplex = (u8)duplex;
196+
194197
ret = hclge_cfg_flowctrl(hdev);
195198
if (ret)
196199
netdev_err(netdev, "failed to configure flow control.\n");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,8 +1747,8 @@ static void hclgevf_reset_done(struct hnae3_ae_dev *ae_dev)
17471747
ret);
17481748

17491749
hdev->reset_type = HNAE3_NONE_RESET;
1750-
clear_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state);
1751-
up(&hdev->reset_sem);
1750+
if (test_and_clear_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state))
1751+
up(&hdev->reset_sem);
17521752
}
17531753

17541754
static u32 hclgevf_get_fw_version(struct hnae3_handle *handle)

0 commit comments

Comments
 (0)