Skip to content

Commit 51df8e0

Browse files
committed
Merge tag 'net-6.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from bpf and netfilter. Current release - regressions: - core: fix rc7's __skb_datagram_iter() regression Current release - new code bugs: - eth: bnxt: fix crashes when reducing ring count with active RSS contexts Previous releases - regressions: - sched: fix UAF when resolving a clash - skmsg: skip zero length skb in sk_msg_recvmsg2 - sunrpc: fix kernel free on connection failure in xs_tcp_setup_socket - tcp: avoid too many retransmit packets - tcp: fix incorrect undo caused by DSACK of TLP retransmit - udp: Set SOCK_RCU_FREE earlier in udp_lib_get_port(). - eth: ks8851: fix deadlock with the SPI chip variant - eth: i40e: fix XDP program unloading while removing the driver Previous releases - always broken: - bpf: - fix too early release of tcx_entry - fail bpf_timer_cancel when callback is being cancelled - bpf: fix order of args in call to bpf_map_kvcalloc - netfilter: nf_tables: prefer nft_chain_validate - ppp: reject claimed-as-LCP but actually malformed packets - wireguard: avoid unaligned 64-bit memory accesses" * tag 'net-6.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (33 commits) net, sunrpc: Remap EPERM in case of connection failure in xs_tcp_setup_socket net/sched: Fix UAF when resolving a clash net: ks8851: Fix potential TX stall after interface reopen udp: Set SOCK_RCU_FREE earlier in udp_lib_get_port(). netfilter: nf_tables: prefer nft_chain_validate netfilter: nfnetlink_queue: drop bogus WARN_ON ethtool: netlink: do not return SQI value if link is down ppp: reject claimed-as-LCP but actually malformed packets selftests/bpf: Add timer lockup selftest net: ethernet: mtk-star-emac: set mac_managed_pm when probing e1000e: fix force smbus during suspend flow tcp: avoid too many retransmit packets bpf: Defer work in bpf_timer_cancel_and_free bpf: Fail bpf_timer_cancel when callback is being cancelled bpf: fix order of args in call to bpf_map_kvcalloc net: ethernet: lantiq_etop: fix double free in detach i40e: Fix XDP program unloading while removing the driver net: fix rc7's __skb_datagram_iter() net: ks8851: Fix deadlock with the SPI chip variant octeontx2-af: Fix incorrect value output on error path in rvu_check_rsrc_availability() ...
2 parents 83ab4b4 + d7c199e commit 51df8e0

File tree

37 files changed

+561
-255
lines changed

37 files changed

+561
-255
lines changed

Documentation/networking/devlink/devlink-region.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ example usage
4949
$ devlink region show [ DEV/REGION ]
5050
$ devlink region del DEV/REGION snapshot SNAPSHOT_ID
5151
$ devlink region dump DEV/REGION [ snapshot SNAPSHOT_ID ]
52-
$ devlink region read DEV/REGION [ snapshot SNAPSHOT_ID ] address ADDRESS length length
52+
$ devlink region read DEV/REGION [ snapshot SNAPSHOT_ID ] address ADDRESS length LENGTH
5353
5454
# Show all of the exposed regions with region sizes:
5555
$ devlink region show

drivers/net/dsa/lan9303-core.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,31 +1047,31 @@ static int lan9303_get_sset_count(struct dsa_switch *ds, int port, int sset)
10471047
return ARRAY_SIZE(lan9303_mib);
10481048
}
10491049

1050-
static int lan9303_phy_read(struct dsa_switch *ds, int phy, int regnum)
1050+
static int lan9303_phy_read(struct dsa_switch *ds, int port, int regnum)
10511051
{
10521052
struct lan9303 *chip = ds->priv;
10531053
int phy_base = chip->phy_addr_base;
10541054

1055-
if (phy == phy_base)
1055+
if (port == 0)
10561056
return lan9303_virt_phy_reg_read(chip, regnum);
1057-
if (phy > phy_base + 2)
1057+
if (port > 2)
10581058
return -ENODEV;
10591059

1060-
return chip->ops->phy_read(chip, phy, regnum);
1060+
return chip->ops->phy_read(chip, phy_base + port, regnum);
10611061
}
10621062

1063-
static int lan9303_phy_write(struct dsa_switch *ds, int phy, int regnum,
1063+
static int lan9303_phy_write(struct dsa_switch *ds, int port, int regnum,
10641064
u16 val)
10651065
{
10661066
struct lan9303 *chip = ds->priv;
10671067
int phy_base = chip->phy_addr_base;
10681068

1069-
if (phy == phy_base)
1069+
if (port == 0)
10701070
return lan9303_virt_phy_reg_write(chip, regnum, val);
1071-
if (phy > phy_base + 2)
1071+
if (port > 2)
10721072
return -ENODEV;
10731073

1074-
return chip->ops->phy_write(chip, phy, regnum, val);
1074+
return chip->ops->phy_write(chip, phy_base + port, regnum, val);
10751075
}
10761076

10771077
static int lan9303_port_enable(struct dsa_switch *ds, int port,
@@ -1099,7 +1099,7 @@ static void lan9303_port_disable(struct dsa_switch *ds, int port)
10991099
vlan_vid_del(dsa_port_to_conduit(dp), htons(ETH_P_8021Q), port);
11001100

11011101
lan9303_disable_processing_port(chip, port);
1102-
lan9303_phy_write(ds, chip->phy_addr_base + port, MII_BMCR, BMCR_PDOWN);
1102+
lan9303_phy_write(ds, port, MII_BMCR, BMCR_PDOWN);
11031103
}
11041104

11051105
static int lan9303_port_bridge_join(struct dsa_switch *ds, int port,
@@ -1374,8 +1374,6 @@ static const struct dsa_switch_ops lan9303_switch_ops = {
13741374

13751375
static int lan9303_register_switch(struct lan9303 *chip)
13761376
{
1377-
int base;
1378-
13791377
chip->ds = devm_kzalloc(chip->dev, sizeof(*chip->ds), GFP_KERNEL);
13801378
if (!chip->ds)
13811379
return -ENOMEM;
@@ -1385,8 +1383,7 @@ static int lan9303_register_switch(struct lan9303 *chip)
13851383
chip->ds->priv = chip;
13861384
chip->ds->ops = &lan9303_switch_ops;
13871385
chip->ds->phylink_mac_ops = &lan9303_phylink_mac_ops;
1388-
base = chip->phy_addr_base;
1389-
chip->ds->phys_mii_mask = GENMASK(LAN9303_NUM_PORTS - 1 + base, base);
1386+
chip->ds->phys_mii_mask = GENMASK(LAN9303_NUM_PORTS - 1, 0);
13901387

13911388
return dsa_register_switch(chip->ds);
13921389
}

drivers/net/ethernet/broadcom/asp2/bcmasp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,7 @@ static int bcmasp_probe(struct platform_device *pdev)
13801380
dev_err(dev, "Cannot create eth interface %d\n", i);
13811381
bcmasp_remove_intfs(priv);
13821382
of_node_put(intf_node);
1383+
ret = -ENOMEM;
13831384
goto of_put_exit;
13841385
}
13851386
list_add_tail(&intf->list, &priv->intfs);

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6146,6 +6146,21 @@ static u16 bnxt_get_max_rss_ring(struct bnxt *bp)
61466146
return max_ring;
61476147
}
61486148

6149+
u16 bnxt_get_max_rss_ctx_ring(struct bnxt *bp)
6150+
{
6151+
u16 i, tbl_size, max_ring = 0;
6152+
struct bnxt_rss_ctx *rss_ctx;
6153+
6154+
tbl_size = bnxt_get_rxfh_indir_size(bp->dev);
6155+
6156+
list_for_each_entry(rss_ctx, &bp->rss_ctx_list, list) {
6157+
for (i = 0; i < tbl_size; i++)
6158+
max_ring = max(max_ring, rss_ctx->rss_indir_tbl[i]);
6159+
}
6160+
6161+
return max_ring;
6162+
}
6163+
61496164
int bnxt_get_nr_rss_ctxs(struct bnxt *bp, int rx_rings)
61506165
{
61516166
if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) {

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2776,6 +2776,7 @@ int bnxt_hwrm_vnic_set_tpa(struct bnxt *bp, struct bnxt_vnic_info *vnic,
27762776
void bnxt_fill_ipv6_mask(__be32 mask[4]);
27772777
int bnxt_alloc_rss_indir_tbl(struct bnxt *bp, struct bnxt_rss_ctx *rss_ctx);
27782778
void bnxt_set_dflt_rss_indir_tbl(struct bnxt *bp, struct bnxt_rss_ctx *rss_ctx);
2779+
u16 bnxt_get_max_rss_ctx_ring(struct bnxt *bp);
27792780
int bnxt_get_nr_rss_ctxs(struct bnxt *bp, int rx_rings);
27802781
int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic);
27812782
int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic,

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,12 @@ static int bnxt_set_channels(struct net_device *dev,
961961
return rc;
962962
}
963963

964+
if (req_rx_rings < bp->rx_nr_rings &&
965+
req_rx_rings <= bnxt_get_max_rss_ctx_ring(bp)) {
966+
netdev_warn(dev, "Can't deactivate rings used by RSS contexts\n");
967+
return -EINVAL;
968+
}
969+
964970
if (bnxt_get_nr_rss_ctxs(bp, req_rx_rings) !=
965971
bnxt_get_nr_rss_ctxs(bp, bp->rx_nr_rings) &&
966972
netif_is_rxfh_configured(dev)) {

drivers/net/ethernet/intel/e1000e/ich8lan.c

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,46 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
11081108
return 0;
11091109
}
11101110

1111+
/**
1112+
* e1000e_force_smbus - Force interfaces to transition to SMBUS mode.
1113+
* @hw: pointer to the HW structure
1114+
*
1115+
* Force the MAC and the PHY to SMBUS mode. Assumes semaphore already
1116+
* acquired.
1117+
*
1118+
* Return: 0 on success, negative errno on failure.
1119+
**/
1120+
static s32 e1000e_force_smbus(struct e1000_hw *hw)
1121+
{
1122+
u16 smb_ctrl = 0;
1123+
u32 ctrl_ext;
1124+
s32 ret_val;
1125+
1126+
/* Switching PHY interface always returns MDI error
1127+
* so disable retry mechanism to avoid wasting time
1128+
*/
1129+
e1000e_disable_phy_retry(hw);
1130+
1131+
/* Force SMBus mode in the PHY */
1132+
ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &smb_ctrl);
1133+
if (ret_val) {
1134+
e1000e_enable_phy_retry(hw);
1135+
return ret_val;
1136+
}
1137+
1138+
smb_ctrl |= CV_SMB_CTRL_FORCE_SMBUS;
1139+
e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, smb_ctrl);
1140+
1141+
e1000e_enable_phy_retry(hw);
1142+
1143+
/* Force SMBus mode in the MAC */
1144+
ctrl_ext = er32(CTRL_EXT);
1145+
ctrl_ext |= E1000_CTRL_EXT_FORCE_SMBUS;
1146+
ew32(CTRL_EXT, ctrl_ext);
1147+
1148+
return 0;
1149+
}
1150+
11111151
/**
11121152
* e1000_enable_ulp_lpt_lp - configure Ultra Low Power mode for LynxPoint-LP
11131153
* @hw: pointer to the HW structure
@@ -1165,6 +1205,14 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx)
11651205
if (ret_val)
11661206
goto out;
11671207

1208+
if (hw->mac.type != e1000_pch_mtp) {
1209+
ret_val = e1000e_force_smbus(hw);
1210+
if (ret_val) {
1211+
e_dbg("Failed to force SMBUS: %d\n", ret_val);
1212+
goto release;
1213+
}
1214+
}
1215+
11681216
/* Si workaround for ULP entry flow on i127/rev6 h/w. Enable
11691217
* LPLU and disable Gig speed when entering ULP
11701218
*/
@@ -1225,27 +1273,12 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx)
12251273
}
12261274

12271275
release:
1228-
/* Switching PHY interface always returns MDI error
1229-
* so disable retry mechanism to avoid wasting time
1230-
*/
1231-
e1000e_disable_phy_retry(hw);
1232-
1233-
/* Force SMBus mode in PHY */
1234-
ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg);
1235-
if (ret_val) {
1236-
e1000e_enable_phy_retry(hw);
1237-
hw->phy.ops.release(hw);
1238-
goto out;
1276+
if (hw->mac.type == e1000_pch_mtp) {
1277+
ret_val = e1000e_force_smbus(hw);
1278+
if (ret_val)
1279+
e_dbg("Failed to force SMBUS over MTL system: %d\n",
1280+
ret_val);
12391281
}
1240-
phy_reg |= CV_SMB_CTRL_FORCE_SMBUS;
1241-
e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg);
1242-
1243-
e1000e_enable_phy_retry(hw);
1244-
1245-
/* Force SMBus mode in MAC */
1246-
mac_reg = er32(CTRL_EXT);
1247-
mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS;
1248-
ew32(CTRL_EXT, mac_reg);
12491282

12501283
hw->phy.ops.release(hw);
12511284
out:

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13293,6 +13293,10 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi, struct bpf_prog *prog,
1329313293
bool need_reset;
1329413294
int i;
1329513295

13296+
/* VSI shall be deleted in a moment, block loading new programs */
13297+
if (prog && test_bit(__I40E_IN_REMOVE, pf->state))
13298+
return -EINVAL;
13299+
1329613300
/* Don't allow frames that span over multiple buffers */
1329713301
if (vsi->netdev->mtu > frame_size - I40E_PACKET_HDR_PAD) {
1329813302
NL_SET_ERR_MSG_MOD(extack, "MTU too large for linear frames and XDP prog does not support frags");
@@ -13301,14 +13305,9 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi, struct bpf_prog *prog,
1330113305

1330213306
/* When turning XDP on->off/off->on we reset and rebuild the rings. */
1330313307
need_reset = (i40e_enabled_xdp_vsi(vsi) != !!prog);
13304-
1330513308
if (need_reset)
1330613309
i40e_prep_for_reset(pf);
1330713310

13308-
/* VSI shall be deleted in a moment, just return EINVAL */
13309-
if (test_bit(__I40E_IN_REMOVE, pf->state))
13310-
return -EINVAL;
13311-
1331213311
old_prog = xchg(&vsi->xdp_prog, prog);
1331313312

1331413313
if (need_reset) {

drivers/net/ethernet/lantiq_etop.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ ltq_etop_free_channel(struct net_device *dev, struct ltq_etop_chan *ch)
217217
if (ch->dma.irq)
218218
free_irq(ch->dma.irq, priv);
219219
if (IS_RX(ch->idx)) {
220-
int desc;
220+
struct ltq_dma_channel *dma = &ch->dma;
221221

222-
for (desc = 0; desc < LTQ_DESC_NUM; desc++)
222+
for (dma->desc = 0; dma->desc < LTQ_DESC_NUM; dma->desc++)
223223
dev_kfree_skb_any(ch->skb[ch->dma.desc]);
224224
}
225225
}

drivers/net/ethernet/marvell/octeontx2/af/rvu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ static int rvu_check_rsrc_availability(struct rvu *rvu,
16431643
if (req->ssow > block->lf.max) {
16441644
dev_err(&rvu->pdev->dev,
16451645
"Func 0x%x: Invalid SSOW req, %d > max %d\n",
1646-
pcifunc, req->sso, block->lf.max);
1646+
pcifunc, req->ssow, block->lf.max);
16471647
return -EINVAL;
16481648
}
16491649
mappedlfs = rvu_get_rsrc_mapcount(pfvf, block->addr);

0 commit comments

Comments
 (0)