Skip to content

Commit 8fdb05d

Browse files
committed
Merge tag 'net-6.19-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from wireless and Netfilter. Previous releases - regressions: - eth: stmmac: fix stm32 (and potentially others) resume regression - nf_tables: fix inverted genmask check in nft_map_catchall_activate() - usb: r8152: fix resume reset deadlock - fix reporting RXH_XFRM_NO_CHANGE as input_xfrm for RSS contexts Previous releases - always broken: - sched: cls_u32: use skb_header_pointer_careful() to avoid OOB reads with malicious u32 rules - eth: ice: timestamping related fixes" * tag 'net-6.19-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (38 commits) ipv6: Fix ECMP sibling count mismatch when clearing RTF_ADDRCONF netfilter: nf_tables: fix inverted genmask check in nft_map_catchall_activate() net: cpsw: Execute ndo_set_rx_mode callback in a work queue net: cpsw_new: Execute ndo_set_rx_mode callback in a work queue gve: Correct ethtool rx_dropped calculation gve: Fix stats report corruption on queue count change selftest: net: add a test-case for encap segmentation after GRO net: gro: fix outer network offset net: add proper RCU protection to /proc/net/ptype net: ethernet: adi: adin1110: Check return value of devm_gpiod_get_optional() in adin1110_check_spi() wifi: iwlwifi: mvm: pause TCM on fast resume wifi: iwlwifi: mld: cancel mlo_scan_start_wk net: spacemit: k1-emac: fix jumbo frame support net: enetc: Convert 16-bit register reads to 32-bit for ENETC v4 net: enetc: Convert 16-bit register writes to 32-bit for ENETC v4 net: enetc: Remove CBDR cacheability AXI settings for ENETC v4 net: enetc: Remove SI/BDR cacheability AXI settings for ENETC v4 tipc: use kfree_sensitive() for session key material net: stmmac: fix stm32 (and potentially others) resume regression net: rss: fix reporting RXH_XFRM_NO_CHANGE as input_xfrm for contexts ...
2 parents b206246 + bbf4a17 commit 8fdb05d

38 files changed

Lines changed: 513 additions & 234 deletions

File tree

MAINTAINERS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20978,6 +20978,18 @@ F: Documentation/devicetree/bindings/net/pse-pd/
2097820978
F: drivers/net/pse-pd/
2097920979
F: net/ethtool/pse-pd.c
2098020980

20981+
PSP SECURITY PROTOCOL
20982+
M: Daniel Zahka <[email protected]>
20983+
M: Jakub Kicinski <[email protected]>
20984+
M: Willem de Bruijn <[email protected]>
20985+
F: Documentation/netlink/specs/psp.yaml
20986+
F: Documentation/networking/psp.rst
20987+
F: include/net/psp/
20988+
F: include/net/psp.h
20989+
F: include/uapi/linux/psp.h
20990+
F: net/psp/
20991+
K: struct\ psp(_assoc|_dev|hdr)\b
20992+
2098120993
PSTORE FILESYSTEM
2098220994
M: Kees Cook <[email protected]>
2098320995
R: Tony Luck <[email protected]>

drivers/net/ethernet/adi/adin1110.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,9 @@ static int adin1110_check_spi(struct adin1110_priv *priv)
10891089

10901090
reset_gpio = devm_gpiod_get_optional(&priv->spidev->dev, "reset",
10911091
GPIOD_OUT_LOW);
1092+
if (IS_ERR(reset_gpio))
1093+
return dev_err_probe(&priv->spidev->dev, PTR_ERR(reset_gpio),
1094+
"failed to get reset gpio\n");
10921095
if (reset_gpio) {
10931096
/* MISO pin is used for internal configuration, can't have
10941097
* anyone else disturbing the SDO line.

drivers/net/ethernet/cavium/liquidio/lio_main.c

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3505,6 +3505,23 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)
35053505
*/
35063506
netdev->netdev_ops = &lionetdevops;
35073507

3508+
lio = GET_LIO(netdev);
3509+
3510+
memset(lio, 0, sizeof(struct lio));
3511+
3512+
lio->ifidx = ifidx_or_pfnum;
3513+
3514+
props = &octeon_dev->props[i];
3515+
props->gmxport = resp->cfg_info.linfo.gmxport;
3516+
props->netdev = netdev;
3517+
3518+
/* Point to the properties for octeon device to which this
3519+
* interface belongs.
3520+
*/
3521+
lio->oct_dev = octeon_dev;
3522+
lio->octprops = props;
3523+
lio->netdev = netdev;
3524+
35083525
retval = netif_set_real_num_rx_queues(netdev, num_oqueues);
35093526
if (retval) {
35103527
dev_err(&octeon_dev->pci_dev->dev,
@@ -3521,16 +3538,6 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)
35213538
goto setup_nic_dev_free;
35223539
}
35233540

3524-
lio = GET_LIO(netdev);
3525-
3526-
memset(lio, 0, sizeof(struct lio));
3527-
3528-
lio->ifidx = ifidx_or_pfnum;
3529-
3530-
props = &octeon_dev->props[i];
3531-
props->gmxport = resp->cfg_info.linfo.gmxport;
3532-
props->netdev = netdev;
3533-
35343541
lio->linfo.num_rxpciq = num_oqueues;
35353542
lio->linfo.num_txpciq = num_iqueues;
35363543
for (j = 0; j < num_oqueues; j++) {
@@ -3596,13 +3603,6 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)
35963603
netdev->min_mtu = LIO_MIN_MTU_SIZE;
35973604
netdev->max_mtu = LIO_MAX_MTU_SIZE;
35983605

3599-
/* Point to the properties for octeon device to which this
3600-
* interface belongs.
3601-
*/
3602-
lio->oct_dev = octeon_dev;
3603-
lio->octprops = props;
3604-
lio->netdev = netdev;
3605-
36063606
dev_dbg(&octeon_dev->pci_dev->dev,
36073607
"if%d gmx: %d hw_addr: 0x%llx\n", i,
36083608
lio->linfo.gmxport, CVM_CAST64(lio->linfo.hw_addr));
@@ -3750,6 +3750,7 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)
37503750
if (!devlink) {
37513751
device_unlock(&octeon_dev->pci_dev->dev);
37523752
dev_err(&octeon_dev->pci_dev->dev, "devlink alloc failed\n");
3753+
i--;
37533754
goto setup_nic_dev_free;
37543755
}
37553756

@@ -3765,11 +3766,11 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)
37653766

37663767
setup_nic_dev_free:
37673768

3768-
while (i--) {
3769+
do {
37693770
dev_err(&octeon_dev->pci_dev->dev,
37703771
"NIC ifidx:%d Setup failed\n", i);
37713772
liquidio_destroy_nic_device(octeon_dev, i);
3772-
}
3773+
} while (i--);
37733774

37743775
setup_nic_dev_done:
37753776

drivers/net/ethernet/cavium/liquidio/lio_vf_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,11 +2212,11 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)
22122212

22132213
setup_nic_dev_free:
22142214

2215-
while (i--) {
2215+
do {
22162216
dev_err(&octeon_dev->pci_dev->dev,
22172217
"NIC ifidx:%d Setup failed\n", i);
22182218
liquidio_destroy_nic_device(octeon_dev, i);
2219-
}
2219+
} while (i--);
22202220

22212221
setup_nic_dev_done:
22222222

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,10 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg)
15311531
}
15321532

15331533
if_id = (status & 0xFFFF0000) >> 16;
1534+
if (if_id >= ethsw->sw_attr.num_ifs) {
1535+
dev_err(dev, "Invalid if_id %d in IRQ status\n", if_id);
1536+
goto out;
1537+
}
15341538
port_priv = ethsw->ports[if_id];
15351539

15361540
if (status & DPSW_IRQ_EVENT_LINK_CHANGED)
@@ -3024,6 +3028,12 @@ static int dpaa2_switch_init(struct fsl_mc_device *sw_dev)
30243028
goto err_close;
30253029
}
30263030

3031+
if (!ethsw->sw_attr.num_ifs) {
3032+
dev_err(dev, "DPSW device has no interfaces\n");
3033+
err = -ENODEV;
3034+
goto err_close;
3035+
}
3036+
30273037
err = dpsw_get_api_version(ethsw->mc_io, 0,
30283038
&ethsw->major,
30293039
&ethsw->minor);

drivers/net/ethernet/freescale/enetc/enetc.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2512,10 +2512,13 @@ int enetc_configure_si(struct enetc_ndev_priv *priv)
25122512
struct enetc_hw *hw = &si->hw;
25132513
int err;
25142514

2515-
/* set SI cache attributes */
2516-
enetc_wr(hw, ENETC_SICAR0,
2517-
ENETC_SICAR_RD_COHERENT | ENETC_SICAR_WR_COHERENT);
2518-
enetc_wr(hw, ENETC_SICAR1, ENETC_SICAR_MSI);
2515+
if (is_enetc_rev1(si)) {
2516+
/* set SI cache attributes */
2517+
enetc_wr(hw, ENETC_SICAR0,
2518+
ENETC_SICAR_RD_COHERENT | ENETC_SICAR_WR_COHERENT);
2519+
enetc_wr(hw, ENETC_SICAR1, ENETC_SICAR_MSI);
2520+
}
2521+
25192522
/* enable SI */
25202523
enetc_wr(hw, ENETC_SIMR, ENETC_SIMR_EN);
25212524

drivers/net/ethernet/freescale/enetc/enetc4_pf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ static void enetc4_pf_set_si_primary_mac(struct enetc_hw *hw, int si,
5959

6060
if (si != 0) {
6161
__raw_writel(upper, hw->port + ENETC4_PSIPMAR0(si));
62-
__raw_writew(lower, hw->port + ENETC4_PSIPMAR1(si));
62+
__raw_writel(lower, hw->port + ENETC4_PSIPMAR1(si));
6363
} else {
6464
__raw_writel(upper, hw->port + ENETC4_PMAR0);
65-
__raw_writew(lower, hw->port + ENETC4_PMAR1);
65+
__raw_writel(lower, hw->port + ENETC4_PMAR1);
6666
}
6767
}
6868

@@ -73,7 +73,7 @@ static void enetc4_pf_get_si_primary_mac(struct enetc_hw *hw, int si,
7373
u16 lower;
7474

7575
upper = __raw_readl(hw->port + ENETC4_PSIPMAR0(si));
76-
lower = __raw_readw(hw->port + ENETC4_PSIPMAR1(si));
76+
lower = __raw_readl(hw->port + ENETC4_PSIPMAR1(si));
7777

7878
put_unaligned_le32(upper, addr);
7979
put_unaligned_le16(lower, addr + 4);

drivers/net/ethernet/freescale/enetc/enetc_cbdr.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ int enetc4_setup_cbdr(struct enetc_si *si)
7474
if (!user->ring)
7575
return -ENOMEM;
7676

77-
/* set CBDR cache attributes */
78-
enetc_wr(hw, ENETC_SICAR2,
79-
ENETC_SICAR_RD_COHERENT | ENETC_SICAR_WR_COHERENT);
80-
8177
regs.pir = hw->reg + ENETC_SICBDRPIR;
8278
regs.cir = hw->reg + ENETC_SICBDRCIR;
8379
regs.mr = hw->reg + ENETC_SICBDRMR;

drivers/net/ethernet/freescale/enetc/enetc_hw.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,13 +708,24 @@ struct enetc_cmd_rfse {
708708
#define ENETC_RFSE_EN BIT(15)
709709
#define ENETC_RFSE_MODE_BD 2
710710

711+
static inline void enetc_get_primary_mac_addr(struct enetc_hw *hw, u8 *addr)
712+
{
713+
u32 upper;
714+
u16 lower;
715+
716+
upper = __raw_readl(hw->reg + ENETC_SIPMAR0);
717+
lower = __raw_readl(hw->reg + ENETC_SIPMAR1);
718+
719+
put_unaligned_le32(upper, addr);
720+
put_unaligned_le16(lower, addr + 4);
721+
}
722+
711723
static inline void enetc_load_primary_mac_addr(struct enetc_hw *hw,
712724
struct net_device *ndev)
713725
{
714-
u8 addr[ETH_ALEN] __aligned(4);
726+
u8 addr[ETH_ALEN];
715727

716-
*(u32 *)addr = __raw_readl(hw->reg + ENETC_SIPMAR0);
717-
*(u16 *)(addr + 4) = __raw_readw(hw->reg + ENETC_SIPMAR1);
728+
enetc_get_primary_mac_addr(hw, addr);
718729
eth_hw_addr_set(ndev, addr);
719730
}
720731

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

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,13 @@ gve_get_ethtool_stats(struct net_device *netdev,
152152
u64 tmp_rx_pkts, tmp_rx_hsplit_pkt, tmp_rx_bytes, tmp_rx_hsplit_bytes,
153153
tmp_rx_skb_alloc_fail, tmp_rx_buf_alloc_fail,
154154
tmp_rx_desc_err_dropped_pkt, tmp_rx_hsplit_unsplit_pkt,
155-
tmp_tx_pkts, tmp_tx_bytes;
155+
tmp_tx_pkts, tmp_tx_bytes,
156+
tmp_xdp_tx_errors, tmp_xdp_redirect_errors;
156157
u64 rx_buf_alloc_fail, rx_desc_err_dropped_pkt, rx_hsplit_unsplit_pkt,
157158
rx_pkts, rx_hsplit_pkt, rx_skb_alloc_fail, rx_bytes, tx_pkts, tx_bytes,
158-
tx_dropped;
159-
int stats_idx, base_stats_idx, max_stats_idx;
159+
tx_dropped, xdp_tx_errors, xdp_redirect_errors;
160+
int rx_base_stats_idx, max_rx_stats_idx, max_tx_stats_idx;
161+
int stats_idx, stats_region_len, nic_stats_len;
160162
struct stats *report_stats;
161163
int *rx_qid_to_stats_idx;
162164
int *tx_qid_to_stats_idx;
@@ -198,6 +200,7 @@ gve_get_ethtool_stats(struct net_device *netdev,
198200
for (rx_pkts = 0, rx_bytes = 0, rx_hsplit_pkt = 0,
199201
rx_skb_alloc_fail = 0, rx_buf_alloc_fail = 0,
200202
rx_desc_err_dropped_pkt = 0, rx_hsplit_unsplit_pkt = 0,
203+
xdp_tx_errors = 0, xdp_redirect_errors = 0,
201204
ring = 0;
202205
ring < priv->rx_cfg.num_queues; ring++) {
203206
if (priv->rx) {
@@ -215,6 +218,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
215218
rx->rx_desc_err_dropped_pkt;
216219
tmp_rx_hsplit_unsplit_pkt =
217220
rx->rx_hsplit_unsplit_pkt;
221+
tmp_xdp_tx_errors = rx->xdp_tx_errors;
222+
tmp_xdp_redirect_errors =
223+
rx->xdp_redirect_errors;
218224
} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
219225
start));
220226
rx_pkts += tmp_rx_pkts;
@@ -224,6 +230,8 @@ gve_get_ethtool_stats(struct net_device *netdev,
224230
rx_buf_alloc_fail += tmp_rx_buf_alloc_fail;
225231
rx_desc_err_dropped_pkt += tmp_rx_desc_err_dropped_pkt;
226232
rx_hsplit_unsplit_pkt += tmp_rx_hsplit_unsplit_pkt;
233+
xdp_tx_errors += tmp_xdp_tx_errors;
234+
xdp_redirect_errors += tmp_xdp_redirect_errors;
227235
}
228236
}
229237
for (tx_pkts = 0, tx_bytes = 0, tx_dropped = 0, ring = 0;
@@ -249,8 +257,8 @@ gve_get_ethtool_stats(struct net_device *netdev,
249257
data[i++] = rx_bytes;
250258
data[i++] = tx_bytes;
251259
/* total rx dropped packets */
252-
data[i++] = rx_skb_alloc_fail + rx_buf_alloc_fail +
253-
rx_desc_err_dropped_pkt;
260+
data[i++] = rx_skb_alloc_fail + rx_desc_err_dropped_pkt +
261+
xdp_tx_errors + xdp_redirect_errors;
254262
data[i++] = tx_dropped;
255263
data[i++] = priv->tx_timeo_cnt;
256264
data[i++] = rx_skb_alloc_fail;
@@ -265,20 +273,38 @@ gve_get_ethtool_stats(struct net_device *netdev,
265273
data[i++] = priv->stats_report_trigger_cnt;
266274
i = GVE_MAIN_STATS_LEN;
267275

268-
/* For rx cross-reporting stats, start from nic rx stats in report */
269-
base_stats_idx = GVE_TX_STATS_REPORT_NUM * num_tx_queues +
270-
GVE_RX_STATS_REPORT_NUM * priv->rx_cfg.num_queues;
271-
/* The boundary between driver stats and NIC stats shifts if there are
272-
* stopped queues.
273-
*/
274-
base_stats_idx += NIC_RX_STATS_REPORT_NUM * num_stopped_rxqs +
275-
NIC_TX_STATS_REPORT_NUM * num_stopped_txqs;
276-
max_stats_idx = NIC_RX_STATS_REPORT_NUM *
277-
(priv->rx_cfg.num_queues - num_stopped_rxqs) +
278-
base_stats_idx;
276+
rx_base_stats_idx = 0;
277+
max_rx_stats_idx = 0;
278+
max_tx_stats_idx = 0;
279+
stats_region_len = priv->stats_report_len -
280+
sizeof(struct gve_stats_report);
281+
nic_stats_len = (NIC_RX_STATS_REPORT_NUM * priv->rx_cfg.num_queues +
282+
NIC_TX_STATS_REPORT_NUM * num_tx_queues) * sizeof(struct stats);
283+
if (unlikely((stats_region_len -
284+
nic_stats_len) % sizeof(struct stats))) {
285+
net_err_ratelimited("Starting index of NIC stats should be multiple of stats size");
286+
} else {
287+
/* For rx cross-reporting stats,
288+
* start from nic rx stats in report
289+
*/
290+
rx_base_stats_idx = (stats_region_len - nic_stats_len) /
291+
sizeof(struct stats);
292+
/* The boundary between driver stats and NIC stats
293+
* shifts if there are stopped queues
294+
*/
295+
rx_base_stats_idx += NIC_RX_STATS_REPORT_NUM *
296+
num_stopped_rxqs + NIC_TX_STATS_REPORT_NUM *
297+
num_stopped_txqs;
298+
max_rx_stats_idx = NIC_RX_STATS_REPORT_NUM *
299+
(priv->rx_cfg.num_queues - num_stopped_rxqs) +
300+
rx_base_stats_idx;
301+
max_tx_stats_idx = NIC_TX_STATS_REPORT_NUM *
302+
(num_tx_queues - num_stopped_txqs) +
303+
max_rx_stats_idx;
304+
}
279305
/* Preprocess the stats report for rx, map queue id to start index */
280306
skip_nic_stats = false;
281-
for (stats_idx = base_stats_idx; stats_idx < max_stats_idx;
307+
for (stats_idx = rx_base_stats_idx; stats_idx < max_rx_stats_idx;
282308
stats_idx += NIC_RX_STATS_REPORT_NUM) {
283309
u32 stat_name = be32_to_cpu(report_stats[stats_idx].stat_name);
284310
u32 queue_id = be32_to_cpu(report_stats[stats_idx].queue_id);
@@ -311,6 +337,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
311337
tmp_rx_buf_alloc_fail = rx->rx_buf_alloc_fail;
312338
tmp_rx_desc_err_dropped_pkt =
313339
rx->rx_desc_err_dropped_pkt;
340+
tmp_xdp_tx_errors = rx->xdp_tx_errors;
341+
tmp_xdp_redirect_errors =
342+
rx->xdp_redirect_errors;
314343
} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
315344
start));
316345
data[i++] = tmp_rx_bytes;
@@ -321,8 +350,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
321350
data[i++] = rx->rx_frag_alloc_cnt;
322351
/* rx dropped packets */
323352
data[i++] = tmp_rx_skb_alloc_fail +
324-
tmp_rx_buf_alloc_fail +
325-
tmp_rx_desc_err_dropped_pkt;
353+
tmp_rx_desc_err_dropped_pkt +
354+
tmp_xdp_tx_errors +
355+
tmp_xdp_redirect_errors;
326356
data[i++] = rx->rx_copybreak_pkt;
327357
data[i++] = rx->rx_copied_pkt;
328358
/* stats from NIC */
@@ -354,14 +384,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
354384
i += priv->rx_cfg.num_queues * NUM_GVE_RX_CNTS;
355385
}
356386

357-
/* For tx cross-reporting stats, start from nic tx stats in report */
358-
base_stats_idx = max_stats_idx;
359-
max_stats_idx = NIC_TX_STATS_REPORT_NUM *
360-
(num_tx_queues - num_stopped_txqs) +
361-
max_stats_idx;
362-
/* Preprocess the stats report for tx, map queue id to start index */
363387
skip_nic_stats = false;
364-
for (stats_idx = base_stats_idx; stats_idx < max_stats_idx;
388+
/* NIC TX stats start right after NIC RX stats */
389+
for (stats_idx = max_rx_stats_idx; stats_idx < max_tx_stats_idx;
365390
stats_idx += NIC_TX_STATS_REPORT_NUM) {
366391
u32 stat_name = be32_to_cpu(report_stats[stats_idx].stat_name);
367392
u32 queue_id = be32_to_cpu(report_stats[stats_idx].queue_id);

0 commit comments

Comments
 (0)