History

Merge tag 'net-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Jakub Kicinski: "Including fixes from CAN, netfilter, wireguard and IPsec. I'd like to highlight [ lowlight? - Linus ] Florian W stepping down as a netfilter maintainer due to constant stream of bug reports. Not sure what we can do but IIUC this is not the first such case. Current release - regressions: - rxrpc: fix use of page_frag_alloc_align(), it changed semantics and we added a new caller in a different subtree - xfrm: allow UDP encapsulation only in offload modes Current release - new code bugs: - tcp: fix refcnt handling in __inet_hash_connect() - Revert "net: Re-use and set mono_delivery_time bit for userspace tstamp packets", conflicted with some expectations in BPF uAPI Previous releases - regressions: - ipv4: raw: fix sending packets from raw sockets via IPsec tunnels - devlink: fix devlink's parallel command processing - veth: do not manipulate GRO when using XDP - esp: fix bad handling of pages from page_pool Previous releases - always broken: - report RCU QS for busy network kthreads (with Paul McK's blessing) - tcp/rds: fix use-after-free on netns with kernel TCP reqsk - virt: vmxnet3: fix missing reserved tailroom with XDP Misc: - couple of build fixes for Documentation" * tag 'net-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (59 commits) selftests: forwarding: Fix ping failure due to short timeout MAINTAINERS: step down as netfilter maintainer netfilter: nf_tables: Fix a memory leak in nf_tables_updchain net: dsa: mt7530: fix handling of all link-local frames net: dsa: mt7530: fix link-local frames that ingress vlan filtering ports bpf: report RCU QS in cpumap kthread net: report RCU QS on threaded NAPI repolling rcu: add a helper to report consolidated flavor QS ionic: update documentation for XDP support lib/bitmap: Fix bitmap_scatter() and bitmap_gather() kernel doc netfilter: nf_tables: do not compare internal table flags on updates netfilter: nft_set_pipapo: release elements in clone only from destroy path octeontx2-af: Use separate handlers for interrupts octeontx2-pf: Send UP messages to VF only when VF is up. octeontx2-pf: Use default max_active works instead of one octeontx2-pf: Wait till detach_resources msg is complete octeontx2: Detect the mbox up or down message via register devlink: fix port new reply cmd type tcp: Clear req->syncookie in reqsk_alloc(). net/bnx2x: Prevent access to a freed page in page_pool ...

Linus Torvalds committed 2 years ago

Commit cba9ffd2 parents 1d35aae f99c5f571 files · +610 −346Browse files

Unified · Split

71 files
  1. Documentation/networking/device_drivers/ethernet/pensando/ionic.rst +22 −0
  2. Documentation/networking/multi-pf-netdev.rst +29 −29
  3. Documentation/networking/net_cachelines/net_device.rst +1 −1
  4. MAINTAINERS +0 −1
  5. drivers/net/can/kvaser_pciefd.c +2 −2
  6. drivers/net/dsa/mt7530.c +48 −18
  7. drivers/net/dsa/mt7530.h +21 −1
  8. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +3 −3
  9. drivers/net/ethernet/marvell/octeontx2/af/cgx.c +1 −1
  10. drivers/net/ethernet/marvell/octeontx2/af/mbox.c +41 −2
  11. drivers/net/ethernet/marvell/octeontx2/af/mbox.h +6 −0
  12. drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c +11 −6
  13. drivers/net/ethernet/marvell/octeontx2/af/rvu.c +25 −6
  14. drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2 −0
  15. drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +13 −7
  16. drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +1 −1
  17. drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +1 −1
  18. drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +82 −37
  19. drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +43 −28
  20. drivers/net/ethernet/mediatek/mtk_eth_soc.c +3 −4
  21. drivers/net/ethernet/mediatek/mtk_ppe.c +11 −7
  22. drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c +1 −1
  23. drivers/net/phy/phy_device.c +2 −2
  24. drivers/net/veth.c +0 −18
  25. drivers/net/vmxnet3/vmxnet3_xdp.c +3 −3
  26. drivers/net/wan/fsl_qmc_hdlc.c +1 −1
  27. drivers/net/wireguard/device.c +2 −9
  28. drivers/net/wireguard/netlink.c +5 −5
  29. drivers/net/wireguard/receive.c +3 −3
  30. drivers/soc/fsl/qbman/qman.c +14 −11
  31. include/linux/bitmap.h +23 −21
  32. include/linux/netdevice.h +1 −1
  33. include/linux/rcupdate.h +31 −0
  34. include/linux/skbuff.h +13 −3
  35. include/linux/socket.h +0 −7
  36. include/net/request_sock.h +6 −1
  37. kernel/bpf/cpumap.c +3 −0
  38. net/core/dev.c +6 −2
  39. net/devlink/netlink.c +7 −6
  40. net/devlink/port.c +1 −1
  41. net/hsr/hsr_framereg.c +4 −0
  42. net/hsr/hsr_main.c +11 −4
  43. net/ipv4/esp4.c +4 −4
  44. net/ipv4/inet_hashtables.c +1 −1
  45. net/ipv4/inet_timewait_sock.c +19 −22
  46. net/ipv4/ip_output.c +0 −1
  47. net/ipv4/raw.c +1 −1
  48. net/ipv4/syncookies.c +3 −0
  49. net/ipv4/tcp_minisocks.c +0 −4
  50. net/ipv6/esp6.c +4 −4
  51. net/ipv6/ip6_output.c +1 −1
  52. net/ipv6/raw.c +1 −1
  53. net/ipv6/syncookies.c +3 −0
  54. net/netfilter/nf_tables_api.c +15 −14
  55. net/netfilter/nft_set_pipapo.c +1 −4
  56. net/packet/af_packet.c +3 −5
  57. net/rds/send.c +2 −3
  58. net/rxrpc/sendmsg.c +2 −2
  59. net/rxrpc/txbuf.c +2 −2
  60. net/sched/sch_fq_pie.c +2 −0
  61. net/sched/sch_taprio.c +2 −1
  62. net/socket.c +7 −7
  63. net/xfrm/xfrm_device.c +2 −1
  64. tools/net/ynl/Makefile.deps +1 −0
  65. tools/perf/trace/beauty/include/linux/socket.h +0 −7
  66. tools/testing/selftests/net/forwarding/vxlan_bridge_1d_ipv6.sh +2 −2
  67. tools/testing/selftests/net/forwarding/vxlan_bridge_1q_ipv6.sh +2 −2
  68. tools/testing/selftests/net/udpgro_fwd.sh +4 −0
  69. tools/testing/selftests/net/veth.sh +21 −3
  70. tools/testing/selftests/wireguard/qemu/arch/riscv32.config +1 −0
  71. tools/testing/selftests/wireguard/qemu/arch/riscv64.config +1 −0
Documentation/networking/device_drivers/ethernet/pensando/ionic.rst+22−0
@@ -99,6 +99,12 @@ Minimal SR-IOV support is currently offered and can be enabled by setting · 98 unmodified lines
9999 the sysfs 'sriov_numvfs' value, if supported by your particular firmware
100100 configuration.
101101
102+XDP
103+---
104+
105+Support for XDP includes the basics, plus Jumbo frames, Redirect and
106+ndo_xmit. There is no current support for zero-copy sockets or HW offload.
107+
102108 Statistics
103109 ==========
104110
@@ -138,6 +144,12 @@ Driver port specific:: · 33 unmodified lines
138144 rx_csum_none: 0
139145 rx_csum_complete: 3
140146 rx_csum_error: 0
147+ xdp_drop: 0
148+ xdp_aborted: 0
149+ xdp_pass: 0
150+ xdp_tx: 0
151+ xdp_redirect: 0
152+ xdp_frames: 0
141153
142154 Driver queue specific::
143155
@@ -149,9 +161,12 @@ Driver queue specific:: · 5 unmodified lines
149161 tx_0_frags: 0
150162 tx_0_tso: 0
151163 tx_0_tso_bytes: 0
164+ tx_0_hwstamp_valid: 0
165+ tx_0_hwstamp_invalid: 0
152166 tx_0_csum_none: 3
153167 tx_0_csum: 0
154168 tx_0_vlan_inserted: 0
169+ tx_0_xdp_frames: 0
155170 rx_0_pkts: 2
156171 rx_0_bytes: 120
157172 rx_0_dma_map_err: 0
@@ -159,8 +174,15 @@ Driver queue specific:: · 1 unmodified line
159174 rx_0_csum_none: 0
160175 rx_0_csum_complete: 0
161176 rx_0_csum_error: 0
177+ rx_0_hwstamp_valid: 0
178+ rx_0_hwstamp_invalid: 0
162179 rx_0_dropped: 0
163180 rx_0_vlan_stripped: 0
181+ rx_0_xdp_drop: 0
182+ rx_0_xdp_aborted: 0
183+ rx_0_xdp_pass: 0
184+ rx_0_xdp_tx: 0
185+ rx_0_xdp_redirect: 0
164186
165187 Firmware port specific::
166188
Documentation/networking/multi-pf-netdev.rst+29−29
@@ -87,35 +87,35 @@ all using the same instance under "priv->mdev". · 86 unmodified lines
8787
8888 Observability
8989 =============
90−The relation between PF, irq, napi, and queue can be observed via netlink spec:
91−
92−$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml --dump queue-get --json='{"ifindex": 13}'
93−[{'id': 0, 'ifindex': 13, 'napi-id': 539, 'type': 'rx'},
94− {'id': 1, 'ifindex': 13, 'napi-id': 540, 'type': 'rx'},
95− {'id': 2, 'ifindex': 13, 'napi-id': 541, 'type': 'rx'},
96− {'id': 3, 'ifindex': 13, 'napi-id': 542, 'type': 'rx'},
97− {'id': 4, 'ifindex': 13, 'napi-id': 543, 'type': 'rx'},
98− {'id': 0, 'ifindex': 13, 'napi-id': 539, 'type': 'tx'},
99− {'id': 1, 'ifindex': 13, 'napi-id': 540, 'type': 'tx'},
100− {'id': 2, 'ifindex': 13, 'napi-id': 541, 'type': 'tx'},
101− {'id': 3, 'ifindex': 13, 'napi-id': 542, 'type': 'tx'},
102− {'id': 4, 'ifindex': 13, 'napi-id': 543, 'type': 'tx'}]
103−
104−$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml --dump napi-get --json='{"ifindex": 13}'
105−[{'id': 543, 'ifindex': 13, 'irq': 42},
106− {'id': 542, 'ifindex': 13, 'irq': 41},
107− {'id': 541, 'ifindex': 13, 'irq': 40},
108− {'id': 540, 'ifindex': 13, 'irq': 39},
109− {'id': 539, 'ifindex': 13, 'irq': 36}]
110−
111−Here you can clearly observe our channels distribution policy:
112−
113−$ ls /proc/irq/{36,39,40,41,42}/mlx5* -d -1
114−/proc/irq/36/mlx5_comp1@pci:0000:08:00.0
115−/proc/irq/39/mlx5_comp1@pci:0000:09:00.0
116−/proc/irq/40/mlx5_comp2@pci:0000:08:00.0
117−/proc/irq/41/mlx5_comp2@pci:0000:09:00.0
118−/proc/irq/42/mlx5_comp3@pci:0000:08:00.0
90+The relation between PF, irq, napi, and queue can be observed via netlink spec::
91+
92+ $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml --dump queue-get --json='{"ifindex": 13}'
93+ [{'id': 0, 'ifindex': 13, 'napi-id': 539, 'type': 'rx'},
94+ {'id': 1, 'ifindex': 13, 'napi-id': 540, 'type': 'rx'},
95+ {'id': 2, 'ifindex': 13, 'napi-id': 541, 'type': 'rx'},
96+ {'id': 3, 'ifindex': 13, 'napi-id': 542, 'type': 'rx'},
97+ {'id': 4, 'ifindex': 13, 'napi-id': 543, 'type': 'rx'},
98+ {'id': 0, 'ifindex': 13, 'napi-id': 539, 'type': 'tx'},
99+ {'id': 1, 'ifindex': 13, 'napi-id': 540, 'type': 'tx'},
100+ {'id': 2, 'ifindex': 13, 'napi-id': 541, 'type': 'tx'},
101+ {'id': 3, 'ifindex': 13, 'napi-id': 542, 'type': 'tx'},
102+ {'id': 4, 'ifindex': 13, 'napi-id': 543, 'type': 'tx'}]
103+
104+ $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml --dump napi-get --json='{"ifindex": 13}'
105+ [{'id': 543, 'ifindex': 13, 'irq': 42},
106+ {'id': 542, 'ifindex': 13, 'irq': 41},
107+ {'id': 541, 'ifindex': 13, 'irq': 40},
108+ {'id': 540, 'ifindex': 13, 'irq': 39},
109+ {'id': 539, 'ifindex': 13, 'irq': 36}]
110+
111+Here you can clearly observe our channels distribution policy::
112+
113+ $ ls /proc/irq/{36,39,40,41,42}/mlx5* -d -1
114+ /proc/irq/36/mlx5_comp1@pci:0000:08:00.0
115+ /proc/irq/39/mlx5_comp1@pci:0000:09:00.0
116+ /proc/irq/40/mlx5_comp2@pci:0000:08:00.0
117+ /proc/irq/41/mlx5_comp2@pci:0000:09:00.0
118+ /proc/irq/42/mlx5_comp3@pci:0000:08:00.0
119119
120120 Steering
121121 ========
Documentation/networking/net_cachelines/net_device.rst+1−1
@@ -13,7 +13,7 @@ struct_dev_ifalias* ifalias · 12 unmodified lines
1313 unsigned_long mem_end
1414 unsigned_long mem_start
1515 unsigned_long base_addr
16−unsigned_long state
16+unsigned_long state read_mostly read_mostly netif_running(dev)
1717 struct_list_head dev_list
1818 struct_list_head napi_list
1919 struct_list_head unreg_list
MAINTAINERS+0−1
@@ -15237,7 +15237,6 @@ F: drivers/net/ethernet/neterion/ · 15236 unmodified lines
1523715237 NETFILTER
1523815238 M: Pablo Neira Ayuso <pablo@netfilter.org>
1523915239 M: Jozsef Kadlecsik <kadlec@netfilter.org>
15240−M: Florian Westphal <fw@strlen.de>
1524115240 L: netfilter-devel@vger.kernel.org
1524215241 L: coreteam@netfilter.org
1524315242 S: Maintained
drivers/net/can/kvaser_pciefd.c+2−2
@@ -370,8 +370,8 @@ static const struct kvaser_pciefd_irq_mask kvaser_pciefd_sf2_irq_mask = { · 369 unmodified lines
370370
371371 static const struct kvaser_pciefd_irq_mask kvaser_pciefd_xilinx_irq_mask = {
372372 .kcan_rx0 = BIT(4),
373− .kcan_tx = { BIT(16), BIT(17), BIT(18), BIT(19) },
374− .all = GENMASK(19, 16) | BIT(4),
373+ .kcan_tx = { BIT(16), BIT(17), BIT(18), BIT(19), BIT(20), BIT(21), BIT(22), BIT(23) },
374+ .all = GENMASK(23, 16) | BIT(4),
375375 };
376376
377377 static const struct kvaser_pciefd_dev_ops kvaser_pciefd_altera_dev_ops = {
drivers/net/dsa/mt7530.c+48−18
@@ -950,20 +950,56 @@ static void mt7530_setup_port5(struct dsa_switch *ds, phy_interface_t interface) · 949 unmodified lines
950950 mutex_unlock(&priv->reg_mutex);
951951 }
952952
953+/* On page 205, section "8.6.3 Frame filtering" of the active standard, IEEE Std
954+ * 802.1Q™-2022, it is stated that frames with 01:80:C2:00:00:00-0F as MAC DA
955+ * must only be propagated to C-VLAN and MAC Bridge components. That means
956+ * VLAN-aware and VLAN-unaware bridges. On the switch designs with CPU ports,
957+ * these frames are supposed to be processed by the CPU (software). So we make
958+ * the switch only forward them to the CPU port. And if received from a CPU
959+ * port, forward to a single port. The software is responsible of making the
960+ * switch conform to the latter by setting a single port as destination port on
961+ * the special tag.
962+ *
963+ * This switch intellectual property cannot conform to this part of the standard
964+ * fully. Whilst the REV_UN frame tag covers the remaining :04-0D and :0F MAC
965+ * DAs, it also includes :22-FF which the scope of propagation is not supposed
966+ * to be restricted for these MAC DAs.
967+ */
953968 static void
954969 mt753x_trap_frames(struct mt7530_priv *priv)
955970 {
956− /* Trap BPDUs to the CPU port(s) */
957− mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK,
971+ /* Trap 802.1X PAE frames and BPDUs to the CPU port(s) and egress them
972+ * VLAN-untagged.
973+ */
974+ mt7530_rmw(priv, MT753X_BPC, MT753X_PAE_EG_TAG_MASK |
975+ MT753X_PAE_PORT_FW_MASK | MT753X_BPDU_EG_TAG_MASK |
976+ MT753X_BPDU_PORT_FW_MASK,
977+ MT753X_PAE_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
978+ MT753X_PAE_PORT_FW(MT753X_BPDU_CPU_ONLY) |
979+ MT753X_BPDU_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
958980 MT753X_BPDU_CPU_ONLY);
959981
960− /* Trap 802.1X PAE frames to the CPU port(s) */
961− mt7530_rmw(priv, MT753X_BPC, MT753X_PAE_PORT_FW_MASK,
962− MT753X_PAE_PORT_FW(MT753X_BPDU_CPU_ONLY));
982+ /* Trap frames with :01 and :02 MAC DAs to the CPU port(s) and egress
983+ * them VLAN-untagged.
984+ */
985+ mt7530_rmw(priv, MT753X_RGAC1, MT753X_R02_EG_TAG_MASK |
986+ MT753X_R02_PORT_FW_MASK | MT753X_R01_EG_TAG_MASK |
987+ MT753X_R01_PORT_FW_MASK,
988+ MT753X_R02_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
989+ MT753X_R02_PORT_FW(MT753X_BPDU_CPU_ONLY) |
990+ MT753X_R01_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
991+ MT753X_BPDU_CPU_ONLY);
963992
964− /* Trap LLDP frames with :0E MAC DA to the CPU port(s) */
965− mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_PORT_FW_MASK,
966− MT753X_R0E_PORT_FW(MT753X_BPDU_CPU_ONLY));
993+ /* Trap frames with :03 and :0E MAC DAs to the CPU port(s) and egress
994+ * them VLAN-untagged.
995+ */
996+ mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_EG_TAG_MASK |
997+ MT753X_R0E_PORT_FW_MASK | MT753X_R03_EG_TAG_MASK |
998+ MT753X_R03_PORT_FW_MASK,
999+ MT753X_R0E_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
1000+ MT753X_R0E_PORT_FW(MT753X_BPDU_CPU_ONLY) |
1001+ MT753X_R03_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
1002+ MT753X_BPDU_CPU_ONLY);
9671003 }
9681004
9691005 static void
@@ -2192,22 +2228,16 @@ mt7530_setup(struct dsa_switch *ds) · 1222 unmodified lines
21922228 }
21932229 }
21942230
2195− /* Disable LEDs before reset to prevent the MT7530 sampling a
2196− * potentially incorrect HT_XTAL_FSEL value.
2197− */
2198− mt7530_write(priv, MT7530_LED_EN, 0);
2199− usleep_range(1000, 1100);
2200−
22012231 /* Reset whole chip through gpio pin or memory-mapped registers for
22022232 * different type of hardware
22032233 */
22042234 if (priv->mcm) {
22052235 reset_control_assert(priv->rstc);
2206− usleep_range(1000, 1100);
2236+ usleep_range(5000, 5100);
22072237 reset_control_deassert(priv->rstc);
22082238 } else {
22092239 gpiod_set_value_cansleep(priv->reset, 0);
2210− usleep_range(1000, 1100);
2240+ usleep_range(5000, 5100);
22112241 gpiod_set_value_cansleep(priv->reset, 1);
22122242 }
22132243
@@ -2420,11 +2450,11 @@ mt7531_setup(struct dsa_switch *ds) · 206 unmodified lines
24202450 */
24212451 if (priv->mcm) {
24222452 reset_control_assert(priv->rstc);
2423− usleep_range(1000, 1100);
2453+ usleep_range(5000, 5100);
24242454 reset_control_deassert(priv->rstc);
24252455 } else {
24262456 gpiod_set_value_cansleep(priv->reset, 0);
2427− usleep_range(1000, 1100);
2457+ usleep_range(5000, 5100);
24282458 gpiod_set_value_cansleep(priv->reset, 1);
24292459 }
24302460
drivers/net/dsa/mt7530.h+21−1
@@ -65,14 +65,33 @@ enum mt753x_id { · 64 unmodified lines
6565
6666 /* Registers for BPDU and PAE frame control*/
6767 #define MT753X_BPC 0x24
68−#define MT753X_BPDU_PORT_FW_MASK GENMASK(2, 0)
68+#define MT753X_PAE_EG_TAG_MASK GENMASK(24, 22)
69+#define MT753X_PAE_EG_TAG(x) FIELD_PREP(MT753X_PAE_EG_TAG_MASK, x)
6970 #define MT753X_PAE_PORT_FW_MASK GENMASK(18, 16)
7071 #define MT753X_PAE_PORT_FW(x) FIELD_PREP(MT753X_PAE_PORT_FW_MASK, x)
72+#define MT753X_BPDU_EG_TAG_MASK GENMASK(8, 6)
73+#define MT753X_BPDU_EG_TAG(x) FIELD_PREP(MT753X_BPDU_EG_TAG_MASK, x)
74+#define MT753X_BPDU_PORT_FW_MASK GENMASK(2, 0)
75+
76+/* Register for :01 and :02 MAC DA frame control */
77+#define MT753X_RGAC1 0x28
78+#define MT753X_R02_EG_TAG_MASK GENMASK(24, 22)
79+#define MT753X_R02_EG_TAG(x) FIELD_PREP(MT753X_R02_EG_TAG_MASK, x)
80+#define MT753X_R02_PORT_FW_MASK GENMASK(18, 16)
81+#define MT753X_R02_PORT_FW(x) FIELD_PREP(MT753X_R02_PORT_FW_MASK, x)
82+#define MT753X_R01_EG_TAG_MASK GENMASK(8, 6)
83+#define MT753X_R01_EG_TAG(x) FIELD_PREP(MT753X_R01_EG_TAG_MASK, x)
84+#define MT753X_R01_PORT_FW_MASK GENMASK(2, 0)
7185
7286 /* Register for :03 and :0E MAC DA frame control */
7387 #define MT753X_RGAC2 0x2c
88+#define MT753X_R0E_EG_TAG_MASK GENMASK(24, 22)
89+#define MT753X_R0E_EG_TAG(x) FIELD_PREP(MT753X_R0E_EG_TAG_MASK, x)
7490 #define MT753X_R0E_PORT_FW_MASK GENMASK(18, 16)
7591 #define MT753X_R0E_PORT_FW(x) FIELD_PREP(MT753X_R0E_PORT_FW_MASK, x)
92+#define MT753X_R03_EG_TAG_MASK GENMASK(8, 6)
93+#define MT753X_R03_EG_TAG(x) FIELD_PREP(MT753X_R03_EG_TAG_MASK, x)
94+#define MT753X_R03_PORT_FW_MASK GENMASK(2, 0)
7695
7796 enum mt753x_bpdu_port_fw {
7897 MT753X_BPDU_FOLLOW_MFC,
@@ -253,6 +272,7 @@ enum mt7530_port_mode { · 174 unmodified lines
253272 enum mt7530_vlan_port_eg_tag {
254273 MT7530_VLAN_EG_DISABLED = 0,
255274 MT7530_VLAN_EG_CONSISTENT = 1,
275+ MT7530_VLAN_EG_UNTAGGED = 4,
256276 };
257277
258278 enum mt7530_vlan_port_attr {
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h+3−3
@@ -1002,9 +1002,6 @@ static inline void bnx2x_set_fw_mac_addr(__le16 *fw_hi, __le16 *fw_mid, · 1001 unmodified lines
10021002 static inline void bnx2x_free_rx_mem_pool(struct bnx2x *bp,
10031003 struct bnx2x_alloc_pool *pool)
10041004 {
1005− if (!pool->page)
1006− return;
1007−
10081005 put_page(pool->page);
10091006
10101007 pool->page = NULL;
@@ -1015,6 +1012,9 @@ static inline void bnx2x_free_rx_sge_range(struct bnx2x *bp, · 4 unmodified lines
10151012 {
10161013 int i;
10171014
1015+ if (!fp->page_pool.page)
1016+ return;
1017+
10181018 if (fp->mode == TPA_MODE_DISABLED)
10191019 return;
10201020
drivers/net/ethernet/marvell/octeontx2/af/cgx.c+1−1
@@ -1338,7 +1338,7 @@ static irqreturn_t cgx_fwi_event_handler(int irq, void *data) · 1337 unmodified lines
13381338
13391339 /* Release thread waiting for completion */
13401340 lmac->cmd_pend = false;
1341− wake_up_interruptible(&lmac->wq_cmd_cmplt);
1341+ wake_up(&lmac->wq_cmd_cmplt);
13421342 break;
13431343 case CGX_EVT_ASYNC:
13441344 if (cgx_event_is_linkevent(event))
drivers/net/ethernet/marvell/octeontx2/af/mbox.c+41−2
@@ -214,11 +214,12 @@ int otx2_mbox_busy_poll_for_rsp(struct otx2_mbox *mbox, int devid) · 213 unmodified lines
214214 }
215215 EXPORT_SYMBOL(otx2_mbox_busy_poll_for_rsp);
216216
217−void otx2_mbox_msg_send(struct otx2_mbox *mbox, int devid)
217+static void otx2_mbox_msg_send_data(struct otx2_mbox *mbox, int devid, u64 data)
218218 {
219219 struct otx2_mbox_dev *mdev = &mbox->dev[devid];
220220 struct mbox_hdr *tx_hdr, *rx_hdr;
221221 void *hw_mbase = mdev->hwbase;
222+ u64 intr_val;
222223
223224 tx_hdr = hw_mbase + mbox->tx_start;
224225 rx_hdr = hw_mbase + mbox->rx_start;
@@ -254,14 +255,52 @@ void otx2_mbox_msg_send(struct otx2_mbox *mbox, int devid) · 29 unmodified lines
254255
255256 spin_unlock(&mdev->mbox_lock);
256257
258+ /* Check if interrupt pending */
259+ intr_val = readq((void __iomem *)mbox->reg_base +
260+ (mbox->trigger | (devid << mbox->tr_shift)));
261+
262+ intr_val |= data;
257263 /* The interrupt should be fired after num_msgs is written
258264 * to the shared memory
259265 */
260− writeq(1, (void __iomem *)mbox->reg_base +
266+ writeq(intr_val, (void __iomem *)mbox->reg_base +
261267 (mbox->trigger | (devid << mbox->tr_shift)));
262268 }
269+
270+void otx2_mbox_msg_send(struct otx2_mbox *mbox, int devid)
271+{
272+ otx2_mbox_msg_send_data(mbox, devid, MBOX_DOWN_MSG);
273+}
263274 EXPORT_SYMBOL(otx2_mbox_msg_send);
264275
276+void otx2_mbox_msg_send_up(struct otx2_mbox *mbox, int devid)
277+{
278+ otx2_mbox_msg_send_data(mbox, devid, MBOX_UP_MSG);
279+}
280+EXPORT_SYMBOL(otx2_mbox_msg_send_up);
281+
282+bool otx2_mbox_wait_for_zero(struct otx2_mbox *mbox, int devid)
283+{
284+ u64 data;
285+
286+ data = readq((void __iomem *)mbox->reg_base +
287+ (mbox->trigger | (devid << mbox->tr_shift)));
288+
289+ /* If data is non-zero wait for ~1ms and return to caller
290+ * whether data has changed to zero or not after the wait.
291+ */
292+ if (!data)
293+ return true;
294+
295+ usleep_range(950, 1000);
296+
297+ data = readq((void __iomem *)mbox->reg_base +
298+ (mbox->trigger | (devid << mbox->tr_shift)));
299+
300+ return data == 0;
301+}
302+EXPORT_SYMBOL(otx2_mbox_wait_for_zero);
303+
265304 struct mbox_msghdr *otx2_mbox_alloc_msg_rsp(struct otx2_mbox *mbox, int devid,
266305 int size, int size_rsp)
267306 {
drivers/net/ethernet/marvell/octeontx2/af/mbox.h+6−0
@@ -16,6 +16,9 @@ · 15 unmodified lines
1616
1717 #define MBOX_SIZE SZ_64K
1818
19+#define MBOX_DOWN_MSG 1
20+#define MBOX_UP_MSG 2
21+
1922 /* AF/PF: PF initiated, PF/VF VF initiated */
2023 #define MBOX_DOWN_RX_START 0
2124 #define MBOX_DOWN_RX_SIZE (46 * SZ_1K)
@@ -101,6 +104,7 @@ int otx2_mbox_regions_init(struct otx2_mbox *mbox, void __force **hwbase, · 79 unmodified lines
101104 struct pci_dev *pdev, void __force *reg_base,
102105 int direction, int ndevs, unsigned long *bmap);
103106 void otx2_mbox_msg_send(struct otx2_mbox *mbox, int devid);
107+void otx2_mbox_msg_send_up(struct otx2_mbox *mbox, int devid);
104108 int otx2_mbox_wait_for_rsp(struct otx2_mbox *mbox, int devid);
105109 int otx2_mbox_busy_poll_for_rsp(struct otx2_mbox *mbox, int devid);
106110 struct mbox_msghdr *otx2_mbox_alloc_msg_rsp(struct otx2_mbox *mbox, int devid,
@@ -118,6 +122,8 @@ static inline struct mbox_msghdr *otx2_mbox_alloc_msg(struct otx2_mbox *mbox, · 11 unmodified lines
118122 return otx2_mbox_alloc_msg_rsp(mbox, devid, size, 0);
119123 }
120124
125+bool otx2_mbox_wait_for_zero(struct otx2_mbox *mbox, int devid);
126+
121127 /* Mailbox message types */
122128 #define MBOX_MSG_MASK 0xFFFF
123129 #define MBOX_MSG_INVALID 0xFFFE
drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c+11−6
@@ -121,13 +121,17 @@ int mcs_add_intr_wq_entry(struct mcs *mcs, struct mcs_intr_event *event) · 120 unmodified lines
121121 static int mcs_notify_pfvf(struct mcs_intr_event *event, struct rvu *rvu)
122122 {
123123 struct mcs_intr_info *req;
124− int err, pf;
124+ int pf;
125125
126126 pf = rvu_get_pf(event->pcifunc);
127127
128+ mutex_lock(&rvu->mbox_lock);
129+
128130 req = otx2_mbox_alloc_msg_mcs_intr_notify(rvu, pf);
129− if (!req)
131+ if (!req) {
132+ mutex_unlock(&rvu->mbox_lock);
130133 return -ENOMEM;
134+ }
131135
132136 req->mcs_id = event->mcs_id;
133137 req->intr_mask = event->intr_mask;
@@ -135,10 +139,11 @@ static int mcs_notify_pfvf(struct mcs_intr_event *event, struct rvu *rvu) · 1 unmodified line
135139 req->hdr.pcifunc = event->pcifunc;
136140 req->lmac_id = event->lmac_id;
137141
138− otx2_mbox_msg_send(&rvu->afpf_wq_info.mbox_up, pf);
139− err = otx2_mbox_wait_for_rsp(&rvu->afpf_wq_info.mbox_up, pf);
140− if (err)
141− dev_warn(rvu->dev, "MCS notification to pf %d failed\n", pf);
142+ otx2_mbox_wait_for_zero(&rvu->afpf_wq_info.mbox_up, pf);
143+
144+ otx2_mbox_msg_send_up(&rvu->afpf_wq_info.mbox_up, pf);
145+
146+ mutex_unlock(&rvu->mbox_lock);
142147
143148 return 0;
144149 }
drivers/net/ethernet/marvell/octeontx2/af/rvu.c+25−6
@@ -2119,7 +2119,7 @@ bad_message: · 2118 unmodified lines
21192119 }
21202120 }
21212121
2122−static void __rvu_mbox_handler(struct rvu_work *mwork, int type)
2122+static void __rvu_mbox_handler(struct rvu_work *mwork, int type, bool poll)
21232123 {
21242124 struct rvu *rvu = mwork->rvu;
21252125 int offset, err, id, devid;
@@ -2186,6 +2186,9 @@ static void __rvu_mbox_handler(struct rvu_work *mwork, int type) · 60 unmodified lines
21862186 }
21872187 mw->mbox_wrk[devid].num_msgs = 0;
21882188
2189+ if (poll)
2190+ otx2_mbox_wait_for_zero(mbox, devid);
2191+
21892192 /* Send mbox responses to VF/PF */
21902193 otx2_mbox_msg_send(mbox, devid);
21912194 }
@@ -2193,15 +2196,18 @@ static void __rvu_mbox_handler(struct rvu_work *mwork, int type) · 1 unmodified line
21932196 static inline void rvu_afpf_mbox_handler(struct work_struct *work)
21942197 {
21952198 struct rvu_work *mwork = container_of(work, struct rvu_work, work);
2199+ struct rvu *rvu = mwork->rvu;
21962200
2197− __rvu_mbox_handler(mwork, TYPE_AFPF);
2201+ mutex_lock(&rvu->mbox_lock);
2202+ __rvu_mbox_handler(mwork, TYPE_AFPF, true);
2203+ mutex_unlock(&rvu->mbox_lock);
21982204 }
21992205
22002206 static inline void rvu_afvf_mbox_handler(struct work_struct *work)
22012207 {
22022208 struct rvu_work *mwork = container_of(work, struct rvu_work, work);
22032209
2204− __rvu_mbox_handler(mwork, TYPE_AFVF);
2210+ __rvu_mbox_handler(mwork, TYPE_AFVF, false);
22052211 }
22062212
22072213 static void __rvu_mbox_up_handler(struct rvu_work *mwork, int type)
@@ -2376,6 +2382,8 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw, · 168 unmodified lines
23762382 }
23772383 }
23782384
2385+ mutex_init(&rvu->mbox_lock);
2386+
23792387 mbox_regions = kcalloc(num, sizeof(void *), GFP_KERNEL);
23802388 if (!mbox_regions) {
23812389 err = -ENOMEM;
@@ -2525,10 +2533,9 @@ static void rvu_queue_work(struct mbox_wq_info *mw, int first, · 143 unmodified lines
25252533 }
25262534 }
25272535
2528−static irqreturn_t rvu_mbox_intr_handler(int irq, void *rvu_irq)
2536+static irqreturn_t rvu_mbox_pf_intr_handler(int irq, void *rvu_irq)
25292537 {
25302538 struct rvu *rvu = (struct rvu *)rvu_irq;
2531− int vfs = rvu->vfs;
25322539 u64 intr;
25332540
25342541 intr = rvu_read64(rvu, BLKADDR_RVUM, RVU_AF_PFAF_MBOX_INT);
@@ -2542,6 +2549,18 @@ static irqreturn_t rvu_mbox_intr_handler(int irq, void *rvu_irq) · 7 unmodified lines
25422549
25432550 rvu_queue_work(&rvu->afpf_wq_info, 0, rvu->hw->total_pfs, intr);
25442551
2552+ return IRQ_HANDLED;
2553+}
2554+
2555+static irqreturn_t rvu_mbox_intr_handler(int irq, void *rvu_irq)
2556+{
2557+ struct rvu *rvu = (struct rvu *)rvu_irq;
2558+ int vfs = rvu->vfs;
2559+ u64 intr;
2560+
2561+ /* Sync with mbox memory region */
2562+ rmb();
2563+
25452564 /* Handle VF interrupts */
25462565 if (vfs > 64) {
25472566 intr = rvupf_read64(rvu, RVU_PF_VFPF_MBOX_INTX(1));
@@ -2886,7 +2905,7 @@ static int rvu_register_interrupts(struct rvu *rvu) · 338 unmodified lines
28862905 /* Register mailbox interrupt handler */
28872906 sprintf(&rvu->irq_name[RVU_AF_INT_VEC_MBOX * NAME_SIZE], "RVUAF Mbox");
28882907 ret = request_irq(pci_irq_vector(rvu->pdev, RVU_AF_INT_VEC_MBOX),
2889− rvu_mbox_intr_handler, 0,
2908+ rvu_mbox_pf_intr_handler, 0,
28902909 &rvu->irq_name[RVU_AF_INT_VEC_MBOX * NAME_SIZE], rvu);
28912910 if (ret) {
28922911 dev_err(rvu->dev,
drivers/net/ethernet/marvell/octeontx2/af/rvu.h+2−0
@@ -591,6 +591,8 @@ struct rvu { · 590 unmodified lines
591591 spinlock_t mcs_intrq_lock;
592592 /* CPT interrupt lock */
593593 spinlock_t cpt_intr_lock;
594+
595+ struct mutex mbox_lock; /* Serialize mbox up and down msgs */
594596 };
595597
596598 static inline void rvu_write64(struct rvu *rvu, u64 block, u64 offset, u64 val)
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c+13−7
@@ -232,7 +232,7 @@ static void cgx_notify_pfs(struct cgx_link_event *event, struct rvu *rvu) · 231 unmodified lines
232232 struct cgx_link_user_info *linfo;
233233 struct cgx_link_info_msg *msg;
234234 unsigned long pfmap;
235− int err, pfid;
235+ int pfid;
236236
237237 linfo = &event->link_uinfo;
238238 pfmap = cgxlmac_to_pfmap(rvu, event->cgx_id, event->lmac_id);
@@ -255,16 +255,22 @@ static void cgx_notify_pfs(struct cgx_link_event *event, struct rvu *rvu) · 16 unmodified lines
255255 continue;
256256 }
257257
258+ mutex_lock(&rvu->mbox_lock);
259+
258260 /* Send mbox message to PF */
259261 msg = otx2_mbox_alloc_msg_cgx_link_event(rvu, pfid);
260− if (!msg)
262+ if (!msg) {
263+ mutex_unlock(&rvu->mbox_lock);
261264 continue;
265+ }
266+
262267 msg->link_info = *linfo;
263− otx2_mbox_msg_send(&rvu->afpf_wq_info.mbox_up, pfid);
264− err = otx2_mbox_wait_for_rsp(&rvu->afpf_wq_info.mbox_up, pfid);
265− if (err)
266− dev_warn(rvu->dev, "notification to pf %d failed\n",
267− pfid);
268+
269+ otx2_mbox_wait_for_zero(&rvu->afpf_wq_info.mbox_up, pfid);
270+
271+ otx2_mbox_msg_send_up(&rvu->afpf_wq_info.mbox_up, pfid);
272+
273+ mutex_unlock(&rvu->mbox_lock);
268274 } while (pfmap);
269275 }
270276
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c+1−1
@@ -1592,7 +1592,7 @@ int otx2_detach_resources(struct mbox *mbox) · 1591 unmodified lines
15921592 detach->partial = false;
15931593
15941594 /* Send detach request to AF */
1595− otx2_mbox_msg_send(&mbox->mbox, 0);
1595+ otx2_sync_mbox_msg(mbox);
15961596 mutex_unlock(&mbox->lock);
15971597 return 0;
15981598 }
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h+1−1
@@ -815,7 +815,7 @@ static inline int otx2_sync_mbox_up_msg(struct mbox *mbox, int devid) · 814 unmodified lines
815815
816816 if (!otx2_mbox_nonempty(&mbox->mbox_up, devid))
817817 return 0;
818− otx2_mbox_msg_send(&mbox->mbox_up, devid);
818+ otx2_mbox_msg_send_up(&mbox->mbox_up, devid);
819819 err = otx2_mbox_wait_for_rsp(&mbox->mbox_up, devid);
820820 if (err)
821821 return err;
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c+82−37
@@ -292,8 +292,8 @@ static int otx2_pf_flr_init(struct otx2_nic *pf, int num_vfs) · 291 unmodified lines
292292 return 0;
293293 }
294294
295−static void otx2_queue_work(struct mbox *mw, struct workqueue_struct *mbox_wq,
296− int first, int mdevs, u64 intr, int type)
295+static void otx2_queue_vf_work(struct mbox *mw, struct workqueue_struct *mbox_wq,
296+ int first, int mdevs, u64 intr)
297297 {
298298 struct otx2_mbox_dev *mdev;
299299 struct otx2_mbox *mbox;
@@ -307,40 +307,26 @@ static void otx2_queue_work(struct mbox *mw, struct workqueue_struct *mbox_wq, · 7 unmodified lines
307307
308308 mbox = &mw->mbox;
309309 mdev = &mbox->dev[i];
310− if (type == TYPE_PFAF)
311− otx2_sync_mbox_bbuf(mbox, i);
312310 hdr = mdev->mbase + mbox->rx_start;
313311 /* The hdr->num_msgs is set to zero immediately in the interrupt
314− * handler to ensure that it holds a correct value next time
315− * when the interrupt handler is called.
316− * pf->mbox.num_msgs holds the data for use in pfaf_mbox_handler
317− * pf>mbox.up_num_msgs holds the data for use in
318− * pfaf_mbox_up_handler.
312+ * handler to ensure that it holds a correct value next time
313+ * when the interrupt handler is called. pf->mw[i].num_msgs
314+ * holds the data for use in otx2_pfvf_mbox_handler and
315+ * pf->mw[i].up_num_msgs holds the data for use in
316+ * otx2_pfvf_mbox_up_handler.
319317 */
320318 if (hdr->num_msgs) {
321319 mw[i].num_msgs = hdr->num_msgs;
322320 hdr->num_msgs = 0;
323− if (type == TYPE_PFAF)
324− memset(mbox->hwbase + mbox->rx_start, 0,
325− ALIGN(sizeof(struct mbox_hdr),
326− sizeof(u64)));
327−
328321 queue_work(mbox_wq, &mw[i].mbox_wrk);
329322 }
330323
331324 mbox = &mw->mbox_up;
332325 mdev = &mbox->dev[i];
333− if (type == TYPE_PFAF)
334− otx2_sync_mbox_bbuf(mbox, i);
335326 hdr = mdev->mbase + mbox->rx_start;
336327 if (hdr->num_msgs) {
337328 mw[i].up_num_msgs = hdr->num_msgs;
338329 hdr->num_msgs = 0;
339− if (type == TYPE_PFAF)
340− memset(mbox->hwbase + mbox->rx_start, 0,
341− ALIGN(sizeof(struct mbox_hdr),
342− sizeof(u64)));
343−
344330 queue_work(mbox_wq, &mw[i].mbox_up_wrk);
345331 }
346332 }
@@ -356,8 +342,10 @@ static void otx2_forward_msg_pfvf(struct otx2_mbox_dev *mdev, · 9 unmodified lines
356342 /* Msgs are already copied, trigger VF's mbox irq */
357343 smp_wmb();
358344
345+ otx2_mbox_wait_for_zero(pfvf_mbox, devid);
346+
359347 offset = pfvf_mbox->trigger | (devid << pfvf_mbox->tr_shift);
360− writeq(1, (void __iomem *)pfvf_mbox->reg_base + offset);
348+ writeq(MBOX_DOWN_MSG, (void __iomem *)pfvf_mbox->reg_base + offset);
361349
362350 /* Restore VF's mbox bounce buffer region address */
363351 src_mdev->mbase = bbuf_base;
@@ -547,7 +535,7 @@ static void otx2_pfvf_mbox_up_handler(struct work_struct *work) · 183 unmodified lines
547535 end:
548536 offset = mbox->rx_start + msg->next_msgoff;
549537 if (mdev->msgs_acked == (vf_mbox->up_num_msgs - 1))
550− __otx2_mbox_reset(mbox, 0);
538+ __otx2_mbox_reset(mbox, vf_idx);
551539 mdev->msgs_acked++;
552540 }
553541 }
@@ -564,8 +552,7 @@ static irqreturn_t otx2_pfvf_mbox_intr_handler(int irq, void *pf_irq) · 10 unmodified lines
564552 if (vfs > 64) {
565553 intr = otx2_read64(pf, RVU_PF_VFPF_MBOX_INTX(1));
566554 otx2_write64(pf, RVU_PF_VFPF_MBOX_INTX(1), intr);
567− otx2_queue_work(mbox, pf->mbox_pfvf_wq, 64, vfs, intr,
568− TYPE_PFVF);
555+ otx2_queue_vf_work(mbox, pf->mbox_pfvf_wq, 64, vfs, intr);
569556 if (intr)
570557 trace_otx2_msg_interrupt(mbox->mbox.pdev, "VF(s) to PF", intr);
571558 vfs = 64;
@@ -574,7 +561,7 @@ static irqreturn_t otx2_pfvf_mbox_intr_handler(int irq, void *pf_irq) · 2 unmodified lines
574561 intr = otx2_read64(pf, RVU_PF_VFPF_MBOX_INTX(0));
575562 otx2_write64(pf, RVU_PF_VFPF_MBOX_INTX(0), intr);
576563
577− otx2_queue_work(mbox, pf->mbox_pfvf_wq, 0, vfs, intr, TYPE_PFVF);
564+ otx2_queue_vf_work(mbox, pf->mbox_pfvf_wq, 0, vfs, intr);
578565
579566 if (intr)
580567 trace_otx2_msg_interrupt(mbox->mbox.pdev, "VF(s) to PF", intr);
@@ -597,8 +584,9 @@ static int otx2_pfvf_mbox_init(struct otx2_nic *pf, int numvfs) · 16 unmodified lines
597584 if (!pf->mbox_pfvf)
598585 return -ENOMEM;
599586
600− pf->mbox_pfvf_wq = alloc_ordered_workqueue("otx2_pfvf_mailbox",
601− WQ_HIGHPRI | WQ_MEM_RECLAIM);
587+ pf->mbox_pfvf_wq = alloc_workqueue("otx2_pfvf_mailbox",
588+ WQ_UNBOUND | WQ_HIGHPRI |
589+ WQ_MEM_RECLAIM, 0);
602590 if (!pf->mbox_pfvf_wq)
603591 return -ENOMEM;
604592
@@ -821,20 +809,22 @@ static void otx2_pfaf_mbox_handler(struct work_struct *work) · 216 unmodified lines
821809 struct mbox *af_mbox;
822810 struct otx2_nic *pf;
823811 int offset, id;
812+ u16 num_msgs;
824813
825814 af_mbox = container_of(work, struct mbox, mbox_wrk);
826815 mbox = &af_mbox->mbox;
827816 mdev = &mbox->dev[0];
828817 rsp_hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
818+ num_msgs = rsp_hdr->num_msgs;
829819
830820 offset = mbox->rx_start + ALIGN(sizeof(*rsp_hdr), MBOX_MSG_ALIGN);
831821 pf = af_mbox->pfvf;
832822
833− for (id = 0; id < af_mbox->num_msgs; id++) {
823+ for (id = 0; id < num_msgs; id++) {
834824 msg = (struct mbox_msghdr *)(mdev->mbase + offset);
835825 otx2_process_pfaf_mbox_msg(pf, msg);
836826 offset = mbox->rx_start + msg->next_msgoff;
837− if (mdev->msgs_acked == (af_mbox->num_msgs - 1))
827+ if (mdev->msgs_acked == (num_msgs - 1))
838828 __otx2_mbox_reset(mbox, 0);
839829 mdev->msgs_acked++;
840830 }
@@ -945,12 +935,14 @@ static void otx2_pfaf_mbox_up_handler(struct work_struct *work) · 104 unmodified lines
945935 int offset, id, devid = 0;
946936 struct mbox_hdr *rsp_hdr;
947937 struct mbox_msghdr *msg;
938+ u16 num_msgs;
948939
949940 rsp_hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
941+ num_msgs = rsp_hdr->num_msgs;
950942
951943 offset = mbox->rx_start + ALIGN(sizeof(*rsp_hdr), MBOX_MSG_ALIGN);
952944
953− for (id = 0; id < af_mbox->up_num_msgs; id++) {
945+ for (id = 0; id < num_msgs; id++) {
954946 msg = (struct mbox_msghdr *)(mdev->mbase + offset);
955947
956948 devid = msg->pcifunc & RVU_PFVF_FUNC_MASK;
@@ -959,10 +951,11 @@ static void otx2_pfaf_mbox_up_handler(struct work_struct *work) · 2 unmodified lines
959951 otx2_process_mbox_msg_up(pf, msg);
960952 offset = mbox->rx_start + msg->next_msgoff;
961953 }
962− if (devid) {
954+ /* Forward to VF iff VFs are really present */
955+ if (devid && pci_num_vf(pf->pdev)) {
963956 otx2_forward_vf_mbox_msgs(pf, &pf->mbox.mbox_up,
964957 MBOX_DIR_PFVF_UP, devid - 1,
965− af_mbox->up_num_msgs);
958+ num_msgs);
966959 return;
967960 }
968961
@@ -972,16 +965,49 @@ static void otx2_pfaf_mbox_up_handler(struct work_struct *work) · 3 unmodified lines
972965 static irqreturn_t otx2_pfaf_mbox_intr_handler(int irq, void *pf_irq)
973966 {
974967 struct otx2_nic *pf = (struct otx2_nic *)pf_irq;
975− struct mbox *mbox;
968+ struct mbox *mw = &pf->mbox;
969+ struct otx2_mbox_dev *mdev;
970+ struct otx2_mbox *mbox;
971+ struct mbox_hdr *hdr;
972+ u64 mbox_data;
976973
977974 /* Clear the IRQ */
978975 otx2_write64(pf, RVU_PF_INT, BIT_ULL(0));
979976
980− mbox = &pf->mbox;
981977
982− trace_otx2_msg_interrupt(mbox->mbox.pdev, "AF to PF", BIT_ULL(0));
978+ mbox_data = otx2_read64(pf, RVU_PF_PFAF_MBOX0);
979+
980+ if (mbox_data & MBOX_UP_MSG) {
981+ mbox_data &= ~MBOX_UP_MSG;
982+ otx2_write64(pf, RVU_PF_PFAF_MBOX0, mbox_data);
983+
984+ mbox = &mw->mbox_up;
985+ mdev = &mbox->dev[0];
986+ otx2_sync_mbox_bbuf(mbox, 0);
987+
988+ hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
989+ if (hdr->num_msgs)
990+ queue_work(pf->mbox_wq, &mw->mbox_up_wrk);
991+
992+ trace_otx2_msg_interrupt(pf->pdev, "UP message from AF to PF",
993+ BIT_ULL(0));
994+ }
995+
996+ if (mbox_data & MBOX_DOWN_MSG) {
997+ mbox_data &= ~MBOX_DOWN_MSG;
998+ otx2_write64(pf, RVU_PF_PFAF_MBOX0, mbox_data);
999+
1000+ mbox = &mw->mbox;
1001+ mdev = &mbox->dev[0];
1002+ otx2_sync_mbox_bbuf(mbox, 0);
1003+
1004+ hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
1005+ if (hdr->num_msgs)
1006+ queue_work(pf->mbox_wq, &mw->mbox_wrk);
9831007
984− otx2_queue_work(mbox, pf->mbox_wq, 0, 1, 1, TYPE_PFAF);
1008+ trace_otx2_msg_interrupt(pf->pdev, "DOWN reply from AF to PF",
1009+ BIT_ULL(0));
1010+ }
9851011
9861012 return IRQ_HANDLED;
9871013 }
@@ -3087,6 +3113,7 @@ static void otx2_vf_link_event_task(struct work_struct *work) · 2099 unmodified lines
30873113 struct otx2_vf_config *config;
30883114 struct cgx_link_info_msg *req;
30893115 struct mbox_msghdr *msghdr;
3116+ struct delayed_work *dwork;
30903117 struct otx2_nic *pf;
30913118 int vf_idx;
30923119
@@ -3095,10 +3122,24 @@ static void otx2_vf_link_event_task(struct work_struct *work) · 2 unmodified lines
30953122 vf_idx = config - config->pf->vf_configs;
30963123 pf = config->pf;
30973124
3125+ if (config->intf_down)
3126+ return;
3127+
3128+ mutex_lock(&pf->mbox.lock);
3129+
3130+ dwork = &config->link_event_work;
3131+
3132+ if (!otx2_mbox_wait_for_zero(&pf->mbox_pfvf[0].mbox_up, vf_idx)) {
3133+ schedule_delayed_work(dwork, msecs_to_jiffies(100));
3134+ mutex_unlock(&pf->mbox.lock);
3135+ return;
3136+ }
3137+
30983138 msghdr = otx2_mbox_alloc_msg_rsp(&pf->mbox_pfvf[0].mbox_up, vf_idx,
30993139 sizeof(*req), sizeof(struct msg_rsp));
31003140 if (!msghdr) {
31013141 dev_err(pf->dev, "Failed to create VF%d link event\n", vf_idx);
3142+ mutex_unlock(&pf->mbox.lock);
31023143 return;
31033144 }
31043145
@@ -3107,7 +3148,11 @@ static void otx2_vf_link_event_task(struct work_struct *work) · 2 unmodified lines
31073148 req->hdr.sig = OTX2_MBOX_REQ_SIG;
31083149 memcpy(&req->link_info, &pf->linfo, sizeof(req->link_info));
31093150
3151+ otx2_mbox_wait_for_zero(&pf->mbox_pfvf[0].mbox_up, vf_idx);
3152+
31103153 otx2_sync_mbox_up_msg(&pf->mbox_pfvf[0], vf_idx);
3154+
3155+ mutex_unlock(&pf->mbox.lock);
31113156 }
31123157
31133158 static int otx2_sriov_enable(struct pci_dev *pdev, int numvfs)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c+43−28
@@ -89,16 +89,20 @@ static void otx2vf_vfaf_mbox_handler(struct work_struct *work) · 88 unmodified lines
8989 struct otx2_mbox *mbox;
9090 struct mbox *af_mbox;
9191 int offset, id;
92+ u16 num_msgs;
9293
9394 af_mbox = container_of(work, struct mbox, mbox_wrk);
9495 mbox = &af_mbox->mbox;
9596 mdev = &mbox->dev[0];
9697 rsp_hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
97− if (af_mbox->num_msgs == 0)
98+ num_msgs = rsp_hdr->num_msgs;
99+
100+ if (num_msgs == 0)
98101 return;
102+
99103 offset = mbox->rx_start + ALIGN(sizeof(*rsp_hdr), MBOX_MSG_ALIGN);
100104
101− for (id = 0; id < af_mbox->num_msgs; id++) {
105+ for (id = 0; id < num_msgs; id++) {
102106 msg = (struct mbox_msghdr *)(mdev->mbase + offset);
103107 otx2vf_process_vfaf_mbox_msg(af_mbox->pfvf, msg);
104108 offset = mbox->rx_start + msg->next_msgoff;
@@ -151,6 +155,7 @@ static void otx2vf_vfaf_mbox_up_handler(struct work_struct *work) · 46 unmodified lines
151155 struct mbox *vf_mbox;
152156 struct otx2_nic *vf;
153157 int offset, id;
158+ u16 num_msgs;
154159
155160 vf_mbox = container_of(work, struct mbox, mbox_up_wrk);
156161 vf = vf_mbox->pfvf;
@@ -158,12 +163,14 @@ static void otx2vf_vfaf_mbox_up_handler(struct work_struct *work) · 1 unmodified line
158163 mdev = &mbox->dev[0];
159164
160165 rsp_hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
161− if (vf_mbox->up_num_msgs == 0)
166+ num_msgs = rsp_hdr->num_msgs;
167+
168+ if (num_msgs == 0)
162169 return;
163170
164171 offset = mbox->rx_start + ALIGN(sizeof(*rsp_hdr), MBOX_MSG_ALIGN);
165172
166− for (id = 0; id < vf_mbox->up_num_msgs; id++) {
173+ for (id = 0; id < num_msgs; id++) {
167174 msg = (struct mbox_msghdr *)(mdev->mbase + offset);
168175 otx2vf_process_mbox_msg_up(vf, msg);
169176 offset = mbox->rx_start + msg->next_msgoff;
@@ -178,40 +185,48 @@ static irqreturn_t otx2vf_vfaf_mbox_intr_handler(int irq, void *vf_irq) · 8 unmodified lines
178185 struct otx2_mbox_dev *mdev;
179186 struct otx2_mbox *mbox;
180187 struct mbox_hdr *hdr;
188+ u64 mbox_data;
181189
182190 /* Clear the IRQ */
183191 otx2_write64(vf, RVU_VF_INT, BIT_ULL(0));
184192
193+ mbox_data = otx2_read64(vf, RVU_VF_VFPF_MBOX0);
194+
185195 /* Read latest mbox data */
186196 smp_rmb();
187197
188− /* Check for PF => VF response messages */
189− mbox = &vf->mbox.mbox;
190− mdev = &mbox->dev[0];
191− otx2_sync_mbox_bbuf(mbox, 0);
198+ if (mbox_data & MBOX_DOWN_MSG) {
199+ mbox_data &= ~MBOX_DOWN_MSG;
200+ otx2_write64(vf, RVU_VF_VFPF_MBOX0, mbox_data);
201+
202+ /* Check for PF => VF response messages */
203+ mbox = &vf->mbox.mbox;
204+ mdev = &mbox->dev[0];
205+ otx2_sync_mbox_bbuf(mbox, 0);
192206
193− trace_otx2_msg_interrupt(mbox->pdev, "PF to VF", BIT_ULL(0));
207+ hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
208+ if (hdr->num_msgs)
209+ queue_work(vf->mbox_wq, &vf->mbox.mbox_wrk);
194210
195− hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
196− if (hdr->num_msgs) {
197− vf->mbox.num_msgs = hdr->num_msgs;
198− hdr->num_msgs = 0;
199− memset(mbox->hwbase + mbox->rx_start, 0,
200− ALIGN(sizeof(struct mbox_hdr), sizeof(u64)));
201− queue_work(vf->mbox_wq, &vf->mbox.mbox_wrk);
211+ trace_otx2_msg_interrupt(mbox->pdev, "DOWN reply from PF to VF",
212+ BIT_ULL(0));
202213 }
203− /* Check for PF => VF notification messages */
204− mbox = &vf->mbox.mbox_up;
205− mdev = &mbox->dev[0];
206− otx2_sync_mbox_bbuf(mbox, 0);
207214
208− hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
209− if (hdr->num_msgs) {
210− vf->mbox.up_num_msgs = hdr->num_msgs;
211− hdr->num_msgs = 0;
212− memset(mbox->hwbase + mbox->rx_start, 0,
213− ALIGN(sizeof(struct mbox_hdr), sizeof(u64)));
214− queue_work(vf->mbox_wq, &vf->mbox.mbox_up_wrk);
215+ if (mbox_data & MBOX_UP_MSG) {
216+ mbox_data &= ~MBOX_UP_MSG;
217+ otx2_write64(vf, RVU_VF_VFPF_MBOX0, mbox_data);
218+
219+ /* Check for PF => VF notification messages */
220+ mbox = &vf->mbox.mbox_up;
221+ mdev = &mbox->dev[0];
222+ otx2_sync_mbox_bbuf(mbox, 0);
223+
224+ hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
225+ if (hdr->num_msgs)
226+ queue_work(vf->mbox_wq, &vf->mbox.mbox_up_wrk);
227+
228+ trace_otx2_msg_interrupt(mbox->pdev, "UP message from PF to VF",
229+ BIT_ULL(0));
215230 }
216231
217232 return IRQ_HANDLED;
@@ -760,8 +775,8 @@ static void otx2vf_remove(struct pci_dev *pdev) · 542 unmodified lines
760775 otx2_mcam_flow_del(vf);
761776 otx2_shutdown_tc(vf);
762777 otx2_shutdown_qos(vf);
763− otx2vf_disable_mbox_intr(vf);
764778 otx2_detach_resources(&vf->mbox);
779+ otx2vf_disable_mbox_intr(vf);
765780 free_percpu(vf->hw.lmt_info);
766781 if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))
767782 qmem_free(vf->dev, vf->dync_lmt);
drivers/net/ethernet/mediatek/mtk_eth_soc.c+3−4
@@ -677,8 +677,7 @@ static int mtk_mac_finish(struct phylink_config *config, unsigned int mode, · 676 unmodified lines
677677 mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
678678 mcr_new = mcr_cur;
679679 mcr_new |= MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE |
680− MAC_MCR_BACKOFF_EN | MAC_MCR_BACKPR_EN | MAC_MCR_FORCE_LINK |
681− MAC_MCR_RX_FIFO_CLR_DIS;
680+ MAC_MCR_BACKOFF_EN | MAC_MCR_BACKPR_EN | MAC_MCR_RX_FIFO_CLR_DIS;
682681
683682 /* Only update control register when needed! */
684683 if (mcr_new != mcr_cur)
@@ -694,7 +693,7 @@ static void mtk_mac_link_down(struct phylink_config *config, unsigned int mode, · 9 unmodified lines
694693 phylink_config);
695694 u32 mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
696695
697− mcr &= ~(MAC_MCR_TX_EN | MAC_MCR_RX_EN);
696+ mcr &= ~(MAC_MCR_TX_EN | MAC_MCR_RX_EN | MAC_MCR_FORCE_LINK);
698697 mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
699698 }
700699
@@ -803,7 +802,7 @@ static void mtk_mac_link_up(struct phylink_config *config, · 102 unmodified lines
803802 if (rx_pause)
804803 mcr |= MAC_MCR_FORCE_RX_FC;
805804
806− mcr |= MAC_MCR_TX_EN | MAC_MCR_RX_EN;
805+ mcr |= MAC_MCR_TX_EN | MAC_MCR_RX_EN | MAC_MCR_FORCE_LINK;
807806 mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
808807 }
809808
drivers/net/ethernet/mediatek/mtk_ppe.c+11−7
@@ -994,7 +994,7 @@ void mtk_ppe_start(struct mtk_ppe *ppe) · 993 unmodified lines
994994 MTK_PPE_KEEPALIVE_DISABLE) |
995995 FIELD_PREP(MTK_PPE_TB_CFG_HASH_MODE, 1) |
996996 FIELD_PREP(MTK_PPE_TB_CFG_SCAN_MODE,
997− MTK_PPE_SCAN_MODE_KEEPALIVE_AGE) |
997+ MTK_PPE_SCAN_MODE_CHECK_AGE) |
998998 FIELD_PREP(MTK_PPE_TB_CFG_ENTRY_NUM,
999999 MTK_PPE_ENTRIES_SHIFT);
10001000 if (mtk_is_netsys_v2_or_greater(ppe->eth))
@@ -1090,17 +1090,21 @@ int mtk_ppe_stop(struct mtk_ppe *ppe) · 89 unmodified lines
10901090
10911091 mtk_ppe_cache_enable(ppe, false);
10921092
1093− /* disable offload engine */
1094− ppe_clear(ppe, MTK_PPE_GLO_CFG, MTK_PPE_GLO_CFG_EN);
1095− ppe_w32(ppe, MTK_PPE_FLOW_CFG, 0);
1096−
10971093 /* disable aging */
10981094 val = MTK_PPE_TB_CFG_AGE_NON_L4 |
10991095 MTK_PPE_TB_CFG_AGE_UNBIND |
11001096 MTK_PPE_TB_CFG_AGE_TCP |
11011097 MTK_PPE_TB_CFG_AGE_UDP |
1102− MTK_PPE_TB_CFG_AGE_TCP_FIN;
1098+ MTK_PPE_TB_CFG_AGE_TCP_FIN |
1099+ MTK_PPE_TB_CFG_SCAN_MODE;
11031100 ppe_clear(ppe, MTK_PPE_TB_CFG, val);
11041101
1105− return mtk_ppe_wait_busy(ppe);
1102+ if (mtk_ppe_wait_busy(ppe))
1103+ return -ETIMEDOUT;
1104+
1105+ /* disable offload engine */
1106+ ppe_clear(ppe, MTK_PPE_GLO_CFG, MTK_PPE_GLO_CFG_EN);
1107+ ppe_w32(ppe, MTK_PPE_FLOW_CFG, 0);
1108+
1109+ return 0;
11061110 }
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c+1−1
@@ -571,7 +571,7 @@ static int txgbe_clock_register(struct txgbe *txgbe) · 570 unmodified lines
571571 char clk_name[32];
572572 struct clk *clk;
573573
574− snprintf(clk_name, sizeof(clk_name), "i2c_designware.%d",
574+ snprintf(clk_name, sizeof(clk_name), "i2c_dw.%d",
575575 pci_dev_id(pdev));
576576
577577 clk = clk_register_fixed_rate(NULL, clk_name, NULL, 0, 156250000);
drivers/net/phy/phy_device.c+2−2
@@ -2831,8 +2831,8 @@ EXPORT_SYMBOL(genphy_resume); · 2830 unmodified lines
28312831 int genphy_loopback(struct phy_device *phydev, bool enable)
28322832 {
28332833 if (enable) {
2834− u16 val, ctl = BMCR_LOOPBACK;
2835− int ret;
2834+ u16 ctl = BMCR_LOOPBACK;
2835+ int ret, val;
28362836
28372837 ctl |= mii_bmcr_encode_fixed(phydev->speed, phydev->duplex);
28382838
drivers/net/veth.c+0−18
@@ -1464,8 +1464,6 @@ static netdev_features_t veth_fix_features(struct net_device *dev, · 1463 unmodified lines
14641464 if (peer_priv->_xdp_prog)
14651465 features &= ~NETIF_F_GSO_SOFTWARE;
14661466 }
1467− if (priv->_xdp_prog)
1468− features |= NETIF_F_GRO;
14691467
14701468 return features;
14711469 }
@@ -1569,14 +1567,6 @@ static int veth_xdp_set(struct net_device *dev, struct bpf_prog *prog, · 97 unmodified lines
15691567 }
15701568
15711569 if (!old_prog) {
1572− if (!veth_gro_requested(dev)) {
1573− /* user-space did not require GRO, but adding
1574− * XDP is supposed to get GRO working
1575− */
1576− dev->features |= NETIF_F_GRO;
1577− netdev_features_change(dev);
1578− }
1579−
15801570 peer->hw_features &= ~NETIF_F_GSO_SOFTWARE;
15811571 peer->max_mtu = max_mtu;
15821572 }
@@ -1592,14 +1582,6 @@ static int veth_xdp_set(struct net_device *dev, struct bpf_prog *prog, · 9 unmodified lines
15921582 if (dev->flags & IFF_UP)
15931583 veth_disable_xdp(dev);
15941584
1595− /* if user-space did not require GRO, since adding XDP
1596− * enabled it, clear it now
1597− */
1598− if (!veth_gro_requested(dev)) {
1599− dev->features &= ~NETIF_F_GRO;
1600− netdev_features_change(dev);
1601− }
1602−
16031585 if (peer) {
16041586 peer->hw_features |= NETIF_F_GSO_SOFTWARE;
16051587 peer->max_mtu = ETH_MAX_MTU;
drivers/net/vmxnet3/vmxnet3_xdp.c+3−3
@@ -382,12 +382,12 @@ vmxnet3_process_xdp(struct vmxnet3_adapter *adapter, · 381 unmodified lines
382382 page = rbi->page;
383383 dma_sync_single_for_cpu(&adapter->pdev->dev,
384384 page_pool_get_dma_addr(page) +
385− rq->page_pool->p.offset, rcd->len,
385+ rq->page_pool->p.offset, rbi->len,
386386 page_pool_get_dma_dir(rq->page_pool));
387387
388− xdp_init_buff(&xdp, rbi->len, &rq->xdp_rxq);
388+ xdp_init_buff(&xdp, PAGE_SIZE, &rq->xdp_rxq);
389389 xdp_prepare_buff(&xdp, page_address(page), rq->page_pool->p.offset,
390− rcd->len, false);
390+ rbi->len, false);
391391 xdp_buff_clear_frags_flag(&xdp);
392392
393393 xdp_prog = rcu_dereference(rq->adapter->xdp_bpf_prog);
drivers/net/wan/fsl_qmc_hdlc.c+1−1
@@ -780,7 +780,7 @@ static const struct of_device_id qmc_hdlc_id_table[] = { · 779 unmodified lines
780780 { .compatible = "fsl,qmc-hdlc" },
781781 {} /* sentinel */
782782 };
783−MODULE_DEVICE_TABLE(of, qmc_hdlc_driver);
783+MODULE_DEVICE_TABLE(of, qmc_hdlc_id_table);
784784
785785 static struct platform_driver qmc_hdlc_driver = {
786786 .driver = {
drivers/net/wireguard/device.c+2−9
@@ -237,7 +237,6 @@ static const struct net_device_ops netdev_ops = { · 236 unmodified lines
237237 .ndo_open = wg_open,
238238 .ndo_stop = wg_stop,
239239 .ndo_start_xmit = wg_xmit,
240− .ndo_get_stats64 = dev_get_tstats64
241240 };
242241
243242 static void wg_destruct(struct net_device *dev)
@@ -262,7 +261,6 @@ static void wg_destruct(struct net_device *dev) · 18 unmodified lines
262261 rcu_barrier(); /* Wait for all the peers to be actually freed. */
263262 wg_ratelimiter_uninit();
264263 memzero_explicit(&wg->static_identity, sizeof(wg->static_identity));
265− free_percpu(dev->tstats);
266264 kvfree(wg->index_hashtable);
267265 kvfree(wg->peer_hashtable);
268266 mutex_unlock(&wg->device_update_lock);
@@ -297,6 +295,7 @@ static void wg_setup(struct net_device *dev) · 28 unmodified lines
297295 dev->hw_enc_features |= WG_NETDEV_FEATURES;
298296 dev->mtu = ETH_DATA_LEN - overhead;
299297 dev->max_mtu = round_down(INT_MAX, MESSAGE_PADDING_MULTIPLE) - overhead;
298+ dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
300299
301300 SET_NETDEV_DEVTYPE(dev, &device_type);
302301
@@ -331,14 +330,10 @@ static int wg_newlink(struct net *src_net, struct net_device *dev, · 28 unmodified lines
331330 if (!wg->index_hashtable)
332331 goto err_free_peer_hashtable;
333332
334− dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
335− if (!dev->tstats)
336− goto err_free_index_hashtable;
337−
338333 wg->handshake_receive_wq = alloc_workqueue("wg-kex-%s",
339334 WQ_CPU_INTENSIVE | WQ_FREEZABLE, 0, dev->name);
340335 if (!wg->handshake_receive_wq)
341− goto err_free_tstats;
336+ goto err_free_index_hashtable;
342337
343338 wg->handshake_send_wq = alloc_workqueue("wg-kex-%s",
344339 WQ_UNBOUND | WQ_FREEZABLE, 0, dev->name);
@@ -397,8 +392,6 @@ err_destroy_handshake_send: · 52 unmodified lines
397392 destroy_workqueue(wg->handshake_send_wq);
398393 err_destroy_handshake_receive:
399394 destroy_workqueue(wg->handshake_receive_wq);
400−err_free_tstats:
401− free_percpu(dev->tstats);
402395 err_free_index_hashtable:
403396 kvfree(wg->index_hashtable);
404397 err_free_peer_hashtable:
drivers/net/wireguard/netlink.c+5−5
@@ -164,8 +164,8 @@ get_peer(struct wg_peer *peer, struct sk_buff *skb, struct dump_ctx *ctx) · 163 unmodified lines
164164 if (!allowedips_node)
165165 goto no_allowedips;
166166 if (!ctx->allowedips_seq)
167− ctx->allowedips_seq = peer->device->peer_allowedips.seq;
168− else if (ctx->allowedips_seq != peer->device->peer_allowedips.seq)
167+ ctx->allowedips_seq = ctx->wg->peer_allowedips.seq;
168+ else if (ctx->allowedips_seq != ctx->wg->peer_allowedips.seq)
169169 goto no_allowedips;
170170
171171 allowedips_nest = nla_nest_start(skb, WGPEER_A_ALLOWEDIPS);
@@ -255,17 +255,17 @@ static int wg_get_device_dump(struct sk_buff *skb, struct netlink_callback *cb) · 83 unmodified lines
255255 if (!peers_nest)
256256 goto out;
257257 ret = 0;
258− /* If the last cursor was removed via list_del_init in peer_remove, then
258+ lockdep_assert_held(&wg->device_update_lock);
259+ /* If the last cursor was removed in peer_remove or peer_remove_all, then
259260 * we just treat this the same as there being no more peers left. The
260261 * reason is that seq_nr should indicate to userspace that this isn't a
261262 * coherent dump anyway, so they'll try again.
262263 */
263264 if (list_empty(&wg->peer_list) ||
264− (ctx->next_peer && list_empty(&ctx->next_peer->peer_list))) {
265+ (ctx->next_peer && ctx->next_peer->is_dead)) {
265266 nla_nest_cancel(skb, peers_nest);
266267 goto out;
267268 }
268− lockdep_assert_held(&wg->device_update_lock);
269269 peer = list_prepare_entry(ctx->next_peer, &wg->peer_list, peer_list);
270270 list_for_each_entry_continue(peer, &wg->peer_list, peer_list) {
271271 if (get_peer(peer, skb, ctx)) {
drivers/net/wireguard/receive.c+3−3
@@ -251,7 +251,7 @@ static bool decrypt_packet(struct sk_buff *skb, struct noise_keypair *keypair) · 250 unmodified lines
251251
252252 if (unlikely(!READ_ONCE(keypair->receiving.is_valid) ||
253253 wg_birthdate_has_expired(keypair->receiving.birthdate, REJECT_AFTER_TIME) ||
254− keypair->receiving_counter.counter >= REJECT_AFTER_MESSAGES)) {
254+ READ_ONCE(keypair->receiving_counter.counter) >= REJECT_AFTER_MESSAGES)) {
255255 WRITE_ONCE(keypair->receiving.is_valid, false);
256256 return false;
257257 }
@@ -318,7 +318,7 @@ static bool counter_validate(struct noise_replay_counter *counter, u64 their_cou · 60 unmodified lines
318318 for (i = 1; i <= top; ++i)
319319 counter->backtrack[(i + index_current) &
320320 ((COUNTER_BITS_TOTAL / BITS_PER_LONG) - 1)] = 0;
321− counter->counter = their_counter;
321+ WRITE_ONCE(counter->counter, their_counter);
322322 }
323323
324324 index &= (COUNTER_BITS_TOTAL / BITS_PER_LONG) - 1;
@@ -463,7 +463,7 @@ int wg_packet_rx_poll(struct napi_struct *napi, int budget) · 138 unmodified lines
463463 net_dbg_ratelimited("%s: Packet has invalid nonce %llu (max %llu)\n",
464464 peer->device->dev->name,
465465 PACKET_CB(skb)->nonce,
466− keypair->receiving_counter.counter);
466+ READ_ONCE(keypair->receiving_counter.counter));
467467 goto next;
468468 }
469469
drivers/soc/fsl/qbman/qman.c+14−11
@@ -991,7 +991,7 @@ struct qman_portal { · 990 unmodified lines
991991 /* linked-list of CSCN handlers. */
992992 struct list_head cgr_cbs;
993993 /* list lock */
994− spinlock_t cgr_lock;
994+ raw_spinlock_t cgr_lock;
995995 struct work_struct congestion_work;
996996 struct work_struct mr_work;
997997 char irqname[MAX_IRQNAME];
@@ -1281,7 +1281,7 @@ static int qman_create_portal(struct qman_portal *portal, · 283 unmodified lines
12811281 /* if the given mask is NULL, assume all CGRs can be seen */
12821282 qman_cgrs_fill(&portal->cgrs[0]);
12831283 INIT_LIST_HEAD(&portal->cgr_cbs);
1284− spin_lock_init(&portal->cgr_lock);
1284+ raw_spin_lock_init(&portal->cgr_lock);
12851285 INIT_WORK(&portal->congestion_work, qm_congestion_task);
12861286 INIT_WORK(&portal->mr_work, qm_mr_process_task);
12871287 portal->bits = 0;
@@ -1456,11 +1456,14 @@ static void qm_congestion_task(struct work_struct *work) · 168 unmodified lines
14561456 union qm_mc_result *mcr;
14571457 struct qman_cgr *cgr;
14581458
1459− spin_lock(&p->cgr_lock);
1459+ /*
1460+ * FIXME: QM_MCR_TIMEOUT is 10ms, which is too long for a raw spinlock!
1461+ */
1462+ raw_spin_lock_irq(&p->cgr_lock);
14601463 qm_mc_start(&p->p);
14611464 qm_mc_commit(&p->p, QM_MCC_VERB_QUERYCONGESTION);
14621465 if (!qm_mc_result_timeout(&p->p, &mcr)) {
1463− spin_unlock(&p->cgr_lock);
1466+ raw_spin_unlock_irq(&p->cgr_lock);
14641467 dev_crit(p->config->dev, "QUERYCONGESTION timeout\n");
14651468 qman_p_irqsource_add(p, QM_PIRQ_CSCI);
14661469 return;
@@ -1476,7 +1479,7 @@ static void qm_congestion_task(struct work_struct *work) · 9 unmodified lines
14761479 list_for_each_entry(cgr, &p->cgr_cbs, node)
14771480 if (cgr->cb && qman_cgrs_get(&c, cgr->cgrid))
14781481 cgr->cb(p, cgr, qman_cgrs_get(&rr, cgr->cgrid));
1479− spin_unlock(&p->cgr_lock);
1482+ raw_spin_unlock_irq(&p->cgr_lock);
14801483 qman_p_irqsource_add(p, QM_PIRQ_CSCI);
14811484 }
14821485
@@ -2440,7 +2443,7 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags, · 957 unmodified lines
24402443 preempt_enable();
24412444
24422445 cgr->chan = p->config->channel;
2443− spin_lock(&p->cgr_lock);
2446+ raw_spin_lock_irq(&p->cgr_lock);
24442447
24452448 if (opts) {
24462449 struct qm_mcc_initcgr local_opts = *opts;
@@ -2477,7 +2480,7 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags, · 30 unmodified lines
24772480 qman_cgrs_get(&p->cgrs[1], cgr->cgrid))
24782481 cgr->cb(p, cgr, 1);
24792482 out:
2480− spin_unlock(&p->cgr_lock);
2483+ raw_spin_unlock_irq(&p->cgr_lock);
24812484 put_affine_portal();
24822485 return ret;
24832486 }
@@ -2512,7 +2515,7 @@ int qman_delete_cgr(struct qman_cgr *cgr) · 28 unmodified lines
25122515 return -EINVAL;
25132516
25142517 memset(&local_opts, 0, sizeof(struct qm_mcc_initcgr));
2515− spin_lock_irqsave(&p->cgr_lock, irqflags);
2518+ raw_spin_lock_irqsave(&p->cgr_lock, irqflags);
25162519 list_del(&cgr->node);
25172520 /*
25182521 * If there are no other CGR objects for this CGRID in the list,
@@ -2537,7 +2540,7 @@ int qman_delete_cgr(struct qman_cgr *cgr) · 18 unmodified lines
25372540 /* add back to the list */
25382541 list_add(&cgr->node, &p->cgr_cbs);
25392542 release_lock:
2540− spin_unlock_irqrestore(&p->cgr_lock, irqflags);
2543+ raw_spin_unlock_irqrestore(&p->cgr_lock, irqflags);
25412544 put_affine_portal();
25422545 return ret;
25432546 }
@@ -2577,9 +2580,9 @@ static int qman_update_cgr(struct qman_cgr *cgr, struct qm_mcc_initcgr *opts) · 33 unmodified lines
25772580 if (!p)
25782581 return -EINVAL;
25792582
2580− spin_lock_irqsave(&p->cgr_lock, irqflags);
2583+ raw_spin_lock_irqsave(&p->cgr_lock, irqflags);
25812584 ret = qm_modify_cgr(cgr, 0, opts);
2582− spin_unlock_irqrestore(&p->cgr_lock, irqflags);
2585+ raw_spin_unlock_irqrestore(&p->cgr_lock, irqflags);
25832586 put_affine_portal();
25842587 return ret;
25852588 }
include/linux/bitmap.h+23−21
@@ -522,17 +522,18 @@ static inline void bitmap_replace(unsigned long *dst, · 521 unmodified lines
522522 *
523523 * (Bits 0, 1, 2, 3, 4, 5 are copied to the bits 0, 1, 4, 8, 9, 12)
524524 *
525− * A more 'visual' description of the operation:
526− * src: 0000000001011010
527− * ||||||
528− * +------+|||||
529− * | +----+||||
530− * | |+----+|||
531− * | || +-+||
532− * | || | ||
533− * mask: ...v..vv...v..vv
534− * ...0..11...0..10
535− * dst: 0000001100000010
525+ * A more 'visual' description of the operation::
526+ *
527+ * src: 0000000001011010
528+ * ||||||
529+ * +------+|||||
530+ * | +----+||||
531+ * | |+----+|||
532+ * | || +-+||
533+ * | || | ||
534+ * mask: ...v..vv...v..vv
535+ * ...0..11...0..10
536+ * dst: 0000001100000010
536537 *
537538 * A relationship exists between bitmap_scatter() and bitmap_gather().
538539 * bitmap_gather() can be seen as the 'reverse' bitmap_scatter() operation.
@@ -568,16 +569,17 @@ static inline void bitmap_scatter(unsigned long *dst, const unsigned long *src, · 29 unmodified lines
568569 *
569570 * (Bits 0, 1, 4, 8, 9, 12 are copied to the bits 0, 1, 2, 3, 4, 5)
570571 *
571− * A more 'visual' description of the operation:
572− * mask: ...v..vv...v..vv
573− * src: 0000001100000010
574− * ^ ^^ ^ 0
575− * | || | 10
576− * | || > 010
577− * | |+--> 1010
578− * | +--> 11010
579− * +----> 011010
580− * dst: 0000000000011010
572+ * A more 'visual' description of the operation::
573+ *
574+ * mask: ...v..vv...v..vv
575+ * src: 0000001100000010
576+ * ^ ^^ ^ 0
577+ * | || | 10
578+ * | || > 010
579+ * | |+--> 1010
580+ * | +--> 11010
581+ * +----> 011010
582+ * dst: 0000000000011010
581583 *
582584 * A relationship exists between bitmap_gather() and bitmap_scatter(). See
583585 * bitmap_scatter() for the bitmap scatter detailed operations.
include/linux/netdevice.h+1−1
@@ -2072,6 +2072,7 @@ struct net_device { · 2071 unmodified lines
20722072 struct pcpu_sw_netstats __percpu *tstats;
20732073 struct pcpu_dstats __percpu *dstats;
20742074 };
2075+ unsigned long state;
20752076 unsigned int flags;
20762077 unsigned short hard_header_len;
20772078 netdev_features_t features;
@@ -2117,7 +2118,6 @@ struct net_device { · 39 unmodified lines
21172118 * part of the usual set specified in Space.c.
21182119 */
21192120
2120− unsigned long state;
21212121
21222122 struct list_head dev_list;
21232123 struct list_head napi_list;
include/linux/rcupdate.h+31−0
@@ -247,6 +247,37 @@ do { \ · 246 unmodified lines
247247 cond_resched(); \
248248 } while (0)
249249
250+/**
251+ * rcu_softirq_qs_periodic - Report RCU and RCU-Tasks quiescent states
252+ * @old_ts: jiffies at start of processing.
253+ *
254+ * This helper is for long-running softirq handlers, such as NAPI threads in
255+ * networking. The caller should initialize the variable passed in as @old_ts
256+ * at the beginning of the softirq handler. When invoked frequently, this macro
257+ * will invoke rcu_softirq_qs() every 100 milliseconds thereafter, which will
258+ * provide both RCU and RCU-Tasks quiescent states. Note that this macro
259+ * modifies its old_ts argument.
260+ *
261+ * Because regions of code that have disabled softirq act as RCU read-side
262+ * critical sections, this macro should be invoked with softirq (and
263+ * preemption) enabled.
264+ *
265+ * The macro is not needed when CONFIG_PREEMPT_RT is defined. RT kernels would
266+ * have more chance to invoke schedule() calls and provide necessary quiescent
267+ * states. As a contrast, calling cond_resched() only won't achieve the same
268+ * effect because cond_resched() does not provide RCU-Tasks quiescent states.
269+ */
270+#define rcu_softirq_qs_periodic(old_ts) \
271+do { \
272+ if (!IS_ENABLED(CONFIG_PREEMPT_RT) && \
273+ time_after(jiffies, (old_ts) + HZ / 10)) { \
274+ preempt_disable(); \
275+ rcu_softirq_qs(); \
276+ preempt_enable(); \
277+ (old_ts) = jiffies; \
278+ } \
279+} while (0)
280+
250281 /*
251282 * Infrastructure to implement the synchronize_() primitives in
252283 * TREE_RCU and rcu_barrier_() primitives in TINY_RCU.
include/linux/skbuff.h+13−3
@@ -822,9 +822,9 @@ typedef unsigned char *sk_buff_data_t; · 821 unmodified lines
822822 * @decrypted: Decrypted SKB
823823 * @slow_gro: state present at GRO time, slower prepare step required
824824 * @mono_delivery_time: When set, skb->tstamp has the
825− * delivery_time in mono clock base (i.e., EDT) or a clock base chosen
826− * by SO_TXTIME. If zero, skb->tstamp has the (rcv) timestamp at
827− * ingress.
825+ * delivery_time in mono clock base (i.e. EDT). Otherwise, the
826+ * skb->tstamp has the (rcv) timestamp at ingress and
827+ * delivery_time at egress.
828828 * @napi_id: id of the NAPI struct this skb came from
829829 * @sender_cpu: (aka @napi_id) source CPU in XPS
830830 * @alloc_cpu: CPU which did the skb allocation.
@@ -3523,6 +3523,16 @@ int skb_cow_data_for_xdp(struct page_pool *pool, struct sk_buff **pskb, · 2692 unmodified lines
35233523 struct bpf_prog *prog);
35243524 bool napi_pp_put_page(struct page *page, bool napi_safe);
35253525
3526+static inline void
3527+skb_page_unref(const struct sk_buff *skb, struct page *page, bool napi_safe)
3528+{
3529+#ifdef CONFIG_PAGE_POOL
3530+ if (skb->pp_recycle && napi_pp_put_page(page, napi_safe))
3531+ return;
3532+#endif
3533+ put_page(page);
3534+}
3535+
35263536 static inline void
35273537 napi_frag_unref(skb_frag_t *frag, bool recycle, bool napi_safe)
35283538 {
include/linux/socket.h+0−7
@@ -422,13 +422,6 @@ extern long __sys_recvmsg_sock(struct socket *sock, struct msghdr *msg, · 421 unmodified lines
422422 struct user_msghdr __user *umsg,
423423 struct sockaddr __user *uaddr,
424424 unsigned int flags);
425−extern int sendmsg_copy_msghdr(struct msghdr *msg,
426− struct user_msghdr __user *umsg, unsigned flags,
427− struct iovec **iov);
428−extern int recvmsg_copy_msghdr(struct msghdr *msg,
429− struct user_msghdr __user *umsg, unsigned flags,
430− struct sockaddr __user **uaddr,
431− struct iovec **iov);
432425 extern int __copy_msghdr(struct msghdr *kmsg,
433426 struct user_msghdr *umsg,
434427 struct sockaddr __user **save_addr);
include/net/request_sock.h+6−1
@@ -61,7 +61,11 @@ struct request_sock { · 60 unmodified lines
6161 struct request_sock *dl_next;
6262 u16 mss;
6363 u8 num_retrans; /* number of retransmits */
64− u8 syncookie:1; /* syncookie: encode tcpopts in timestamp */
64+ u8 syncookie:1; /* True if
65+ * 1) tcpopts needs to be encoded in
66+ * TS of SYN+ACK
67+ * 2) ACK is validated by BPF kfunc.
68+ */
6569 u8 num_timeout:7; /* number of timeouts */
6670 u32 ts_recent;
6771 struct timer_list rsk_timer;
@@ -144,6 +148,7 @@ reqsk_alloc(const struct request_sock_ops *ops, struct sock *sk_listener, · 76 unmodified lines
144148 sk_node_init(&req_to_sk(req)->sk_node);
145149 sk_tx_queue_clear(req_to_sk(req));
146150 req->saved_syn = NULL;
151+ req->syncookie = 0;
147152 req->timeout = 0;
148153 req->num_timeout = 0;
149154 req->num_retrans = 0;
kernel/bpf/cpumap.c+3−0
@@ -263,6 +263,7 @@ static int cpu_map_bpf_prog_run(struct bpf_cpu_map_entry *rcpu, void **frames, · 262 unmodified lines
263263 static int cpu_map_kthread_run(void *data)
264264 {
265265 struct bpf_cpu_map_entry *rcpu = data;
266+ unsigned long last_qs = jiffies;
266267
267268 complete(&rcpu->kthread_running);
268269 set_current_state(TASK_INTERRUPTIBLE);
@@ -288,10 +289,12 @@ static int cpu_map_kthread_run(void *data) · 19 unmodified lines
288289 if (__ptr_ring_empty(rcpu->queue)) {
289290 schedule();
290291 sched = 1;
292+ last_qs = jiffies;
291293 } else {
292294 __set_current_state(TASK_RUNNING);
293295 }
294296 } else {
297+ rcu_softirq_qs_periodic(last_qs);
295298 sched = cond_resched();
296299 }
297300
net/core/dev.c+6−2
@@ -2245,7 +2245,7 @@ void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) · 2244 unmodified lines
22452245 rcu_read_lock();
22462246 again:
22472247 list_for_each_entry_rcu(ptype, ptype_list, list) {
2248− if (ptype->ignore_outgoing)
2248+ if (READ_ONCE(ptype->ignore_outgoing))
22492249 continue;
22502250
22512251 /* Never send packets back to the socket
@@ -6743,6 +6743,8 @@ static int napi_threaded_poll(void *data) · 4491 unmodified lines
67436743 void *have;
67446744
67456745 while (!napi_thread_wait(napi)) {
6746+ unsigned long last_qs = jiffies;
6747+
67466748 for (;;) {
67476749 bool repoll = false;
67486750
@@ -6767,6 +6769,7 @@ static int napi_threaded_poll(void *data) · 18 unmodified lines
67676769 if (!repoll)
67686770 break;
67696771
6772+ rcu_softirq_qs_periodic(last_qs);
67706773 cond_resched();
67716774 }
67726775 }
@@ -11665,11 +11668,12 @@ static void __init net_dev_struct_check(void) · 4892 unmodified lines
1166511668
1166611669 /* TXRX read-mostly hotpath */
1166711670 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, lstats);
11671+ CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, state);
1166811672 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, flags);
1166911673 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, hard_header_len);
1167011674 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, features);
1167111675 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, ip6_ptr);
11672− CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_txrx, 38);
11676+ CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_txrx, 46);
1167311677
1167411678 /* RX read-mostly hotpath */
1167511679 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_rx, ptype_specific);
net/devlink/netlink.c+7−6
@@ -193,12 +193,13 @@ devlink_get_from_attrs_lock(struct net *net, struct nlattr **attrs, · 192 unmodified lines
193193 devname = nla_data(attrs[DEVLINK_ATTR_DEV_NAME]);
194194
195195 devlinks_xa_for_each_registered_get(net, index, devlink) {
196− devl_dev_lock(devlink, dev_lock);
197− if (devl_is_registered(devlink) &&
198− strcmp(devlink->dev->bus->name, busname) == 0 &&
199− strcmp(dev_name(devlink->dev), devname) == 0)
200− return devlink;
201− devl_dev_unlock(devlink, dev_lock);
196+ if (strcmp(devlink->dev->bus->name, busname) == 0 &&
197+ strcmp(dev_name(devlink->dev), devname) == 0) {
198+ devl_dev_lock(devlink, dev_lock);
199+ if (devl_is_registered(devlink))
200+ return devlink;
201+ devl_dev_unlock(devlink, dev_lock);
202+ }
202203 devlink_put(devlink);
203204 }
204205
net/devlink/port.c+1−1
@@ -889,7 +889,7 @@ int devlink_nl_port_new_doit(struct sk_buff *skb, struct genl_info *info) · 888 unmodified lines
889889 err = -ENOMEM;
890890 goto err_out_port_del;
891891 }
892− err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_NEW,
892+ err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_PORT_NEW,
893893 info->snd_portid, info->snd_seq, 0, NULL);
894894 if (WARN_ON_ONCE(err))
895895 goto err_out_msg_free;
net/hsr/hsr_framereg.c+4−0
@@ -228,6 +228,10 @@ struct hsr_node *hsr_get_node(struct hsr_port *port, struct list_head *node_db, · 227 unmodified lines
228228 */
229229 if (ethhdr->h_proto == htons(ETH_P_PRP) ||
230230 ethhdr->h_proto == htons(ETH_P_HSR)) {
231+ /* Check if skb contains hsr_ethhdr */
232+ if (skb->mac_len < sizeof(struct hsr_ethhdr))
233+ return NULL;
234+
231235 /* Use the existing sequence_nr from the tag as starting point
232236 * for filtering duplicate frames.
233237 */
net/hsr/hsr_main.c+11−4
@@ -148,14 +148,21 @@ static struct notifier_block hsr_nb = { · 147 unmodified lines
148148
149149 static int __init hsr_init(void)
150150 {
151− int res;
151+ int err;
152152
153153 BUILD_BUG_ON(sizeof(struct hsr_tag) != HSR_HLEN);
154154
155− register_netdevice_notifier(&hsr_nb);
156− res = hsr_netlink_init();
155+ err = register_netdevice_notifier(&hsr_nb);
156+ if (err)
157+ return err;
158+
159+ err = hsr_netlink_init();
160+ if (err) {
161+ unregister_netdevice_notifier(&hsr_nb);
162+ return err;
163+ }
157164
158− return res;
165+ return 0;
159166 }
160167
161168 static void __exit hsr_exit(void)
net/ipv4/esp4.c+4−4
@@ -95,7 +95,7 @@ static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead, · 94 unmodified lines
9595 __alignof__(struct scatterlist));
9696 }
9797
98−static void esp_ssg_unref(struct xfrm_state *x, void *tmp)
98+static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb)
9999 {
100100 struct crypto_aead *aead = x->data;
101101 int extralen = 0;
@@ -114,7 +114,7 @@ static void esp_ssg_unref(struct xfrm_state *x, void *tmp) · 12 unmodified lines
114114 */
115115 if (req->src != req->dst)
116116 for (sg = sg_next(req->src); sg; sg = sg_next(sg))
117− put_page(sg_page(sg));
117+ skb_page_unref(skb, sg_page(sg), false);
118118 }
119119
120120 #ifdef CONFIG_INET_ESPINTCP
@@ -260,7 +260,7 @@ static void esp_output_done(void *data, int err) · 139 unmodified lines
260260 }
261261
262262 tmp = ESP_SKB_CB(skb)->tmp;
263− esp_ssg_unref(x, tmp);
263+ esp_ssg_unref(x, tmp, skb);
264264 kfree(tmp);
265265
266266 if (xo && (xo->flags & XFRM_DEV_RESUME)) {
@@ -639,7 +639,7 @@ int esp_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info * · 372 unmodified lines
639639 }
640640
641641 if (sg != dsg)
642− esp_ssg_unref(x, tmp);
642+ esp_ssg_unref(x, tmp, skb);
643643
644644 if (!err && x->encap && x->encap->encap_type == TCP_ENCAP_ESPINTCP)
645645 err = esp_output_tail_tcp(x, skb);
net/ipv4/inet_hashtables.c+1−1
@@ -1135,7 +1135,7 @@ error: · 1134 unmodified lines
11351135 sock_prot_inuse_add(net, sk->sk_prot, -1);
11361136
11371137 spin_lock(lock);
1138− sk_nulls_del_node_init_rcu(sk);
1138+ __sk_nulls_del_node_init_rcu(sk);
11391139 spin_unlock(lock);
11401140
11411141 sk->sk_hash = 0;
net/ipv4/inet_timewait_sock.c+19−22
@@ -263,12 +263,12 @@ void __inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo, bool rearm) · 262 unmodified lines
263263 }
264264 EXPORT_SYMBOL_GPL(__inet_twsk_schedule);
265265
266+/* Remove all non full sockets (TIME_WAIT and NEW_SYN_RECV) for dead netns */
266267 void inet_twsk_purge(struct inet_hashinfo *hashinfo, int family)
267268 {
268− struct inet_timewait_sock *tw;
269− struct sock *sk;
270269 struct hlist_nulls_node *node;
271270 unsigned int slot;
271+ struct sock *sk;
272272
273273 for (slot = 0; slot <= hashinfo->ehash_mask; slot++) {
274274 struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
@@ -277,38 +277,35 @@ restart_rcu: · 2 unmodified lines
277277 rcu_read_lock();
278278 restart:
279279 sk_nulls_for_each_rcu(sk, node, &head->chain) {
280− if (sk->sk_state != TCP_TIME_WAIT) {
281− /* A kernel listener socket might not hold refcnt for net,
282− * so reqsk_timer_handler() could be fired after net is
283− * freed. Userspace listener and reqsk never exist here.
284− */
285− if (unlikely(sk->sk_state == TCP_NEW_SYN_RECV &&
286− hashinfo->pernet)) {
287− struct request_sock *req = inet_reqsk(sk);
288−
289− inet_csk_reqsk_queue_drop_and_put(req->rsk_listener, req);
290− }
280+ int state = inet_sk_state_load(sk);
291281
282+ if ((1 << state) & ~(TCPF_TIME_WAIT |
283+ TCPF_NEW_SYN_RECV))
292284 continue;
293− }
294285
295− tw = inet_twsk(sk);
296− if ((tw->tw_family != family) ||
297− refcount_read(&twsk_net(tw)->ns.count))
286+ if (sk->sk_family != family ||
287+ refcount_read(&sock_net(sk)->ns.count))
298288 continue;
299289
300− if (unlikely(!refcount_inc_not_zero(&tw->tw_refcnt)))
290+ if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
301291 continue;
302292
303− if (unlikely((tw->tw_family != family) ||
304− refcount_read(&twsk_net(tw)->ns.count))) {
305− inet_twsk_put(tw);
293+ if (unlikely(sk->sk_family != family ||
294+ refcount_read(&sock_net(sk)->ns.count))) {
295+ sock_gen_put(sk);
306296 goto restart;
307297 }
308298
309299 rcu_read_unlock();
310300 local_bh_disable();
311− inet_twsk_deschedule_put(tw);
301+ if (state == TCP_TIME_WAIT) {
302+ inet_twsk_deschedule_put(inet_twsk(sk));
303+ } else {
304+ struct request_sock *req = inet_reqsk(sk);
305+
306+ inet_csk_reqsk_queue_drop_and_put(req->rsk_listener,
307+ req);
308+ }
312309 local_bh_enable();
313310 goto restart_rcu;
314311 }
net/ipv4/ip_output.c+0−1
@@ -1458,7 +1458,6 @@ struct sk_buff *__ip_make_skb(struct sock *sk, · 1457 unmodified lines
14581458 skb->priority = (cork->tos != -1) ? cork->priority: READ_ONCE(sk->sk_priority);
14591459 skb->mark = cork->mark;
14601460 skb->tstamp = cork->transmit_time;
1461− skb->mono_delivery_time = !!skb->tstamp;
14621461 /*
14631462 * Steal rt from cork.dst to avoid a pair of atomic_inc/atomic_dec
14641463 * on dst refcount
net/ipv4/raw.c+1−1
@@ -357,10 +357,10 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4, · 356 unmodified lines
357357 goto error;
358358 skb_reserve(skb, hlen);
359359
360+ skb->protocol = htons(ETH_P_IP);
360361 skb->priority = READ_ONCE(sk->sk_priority);
361362 skb->mark = sockc->mark;
362363 skb->tstamp = sockc->transmit_time;
363− skb->mono_delivery_time = !!skb->tstamp;
364364 skb_dst_set(skb, &rt->dst);
365365 *rtp = NULL;
366366
net/ipv4/syncookies.c+3−0
@@ -474,6 +474,9 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) · 473 unmodified lines
474474 ireq->wscale_ok, &rcv_wscale,
475475 dst_metric(&rt->dst, RTAX_INITRWND));
476476
477+ /* req->syncookie is set true only if ACK is validated
478+ * by BPF kfunc, then, rcv_wscale is already configured.
479+ */
477480 if (!req->syncookie)
478481 ireq->rcv_wscale = rcv_wscale;
479482 ireq->ecn_ok &= cookie_ecn_ok(net, &rt->dst);
net/ipv4/tcp_minisocks.c+0−4
@@ -398,10 +398,6 @@ void tcp_twsk_purge(struct list_head *net_exit_list, int family) · 397 unmodified lines
398398 /* Even if tw_refcount == 1, we must clean up kernel reqsk */
399399 inet_twsk_purge(net->ipv4.tcp_death_row.hashinfo, family);
400400 } else if (!purged_once) {
401− /* The last refcount is decremented in tcp_sk_exit_batch() */
402− if (refcount_read(&net->ipv4.tcp_death_row.tw_refcount) == 1)
403− continue;
404−
405401 inet_twsk_purge(&tcp_hashinfo, family);
406402 purged_once = true;
407403 }
net/ipv6/esp6.c+4−4
@@ -112,7 +112,7 @@ static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead, · 111 unmodified lines
112112 __alignof__(struct scatterlist));
113113 }
114114
115−static void esp_ssg_unref(struct xfrm_state *x, void *tmp)
115+static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb)
116116 {
117117 struct crypto_aead *aead = x->data;
118118 int extralen = 0;
@@ -131,7 +131,7 @@ static void esp_ssg_unref(struct xfrm_state *x, void *tmp) · 12 unmodified lines
131131 */
132132 if (req->src != req->dst)
133133 for (sg = sg_next(req->src); sg; sg = sg_next(sg))
134− put_page(sg_page(sg));
134+ skb_page_unref(skb, sg_page(sg), false);
135135 }
136136
137137 #ifdef CONFIG_INET6_ESPINTCP
@@ -294,7 +294,7 @@ static void esp_output_done(void *data, int err) · 156 unmodified lines
294294 }
295295
296296 tmp = ESP_SKB_CB(skb)->tmp;
297− esp_ssg_unref(x, tmp);
297+ esp_ssg_unref(x, tmp, skb);
298298 kfree(tmp);
299299
300300 esp_output_encap_csum(skb);
@@ -677,7 +677,7 @@ int esp6_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info · 376 unmodified lines
677677 }
678678
679679 if (sg != dsg)
680− esp_ssg_unref(x, tmp);
680+ esp_ssg_unref(x, tmp, skb);
681681
682682 if (!err && x->encap && x->encap->encap_type == TCP_ENCAP_ESPINTCP)
683683 err = esp_output_tail_tcp(x, skb);
net/ipv6/ip6_output.c+1−1
@@ -1925,7 +1925,7 @@ struct sk_buff *__ip6_make_skb(struct sock *sk, · 1924 unmodified lines
19251925 skb->priority = READ_ONCE(sk->sk_priority);
19261926 skb->mark = cork->base.mark;
19271927 skb->tstamp = cork->base.transmit_time;
1928− skb->mono_delivery_time = !!skb->tstamp;
1928+
19291929 ip6_cork_steal_dst(skb, cork);
19301930 IP6_INC_STATS(net, rt->rt6i_idev, IPSTATS_MIB_OUTREQUESTS);
19311931 if (proto == IPPROTO_ICMPV6) {
net/ipv6/raw.c+1−1
@@ -622,7 +622,7 @@ static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length, · 621 unmodified lines
622622 skb->priority = READ_ONCE(sk->sk_priority);
623623 skb->mark = sockc->mark;
624624 skb->tstamp = sockc->transmit_time;
625− skb->mono_delivery_time = !!skb->tstamp;
625+
626626 skb_put(skb, length);
627627 skb_reset_network_header(skb);
628628 iph = ipv6_hdr(skb);
net/ipv6/syncookies.c+3−0
@@ -258,6 +258,9 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) · 257 unmodified lines
258258 ireq->wscale_ok, &rcv_wscale,
259259 dst_metric(dst, RTAX_INITRWND));
260260
261+ /* req->syncookie is set true only if ACK is validated
262+ * by BPF kfunc, then, rcv_wscale is already configured.
263+ */
261264 if (!req->syncookie)
262265 ireq->rcv_wscale = rcv_wscale;
263266 ireq->ecn_ok &= cookie_ecn_ok(net, dst);
net/netfilter/nf_tables_api.c+15−14
@@ -1213,7 +1213,7 @@ static int nf_tables_updtable(struct nft_ctx *ctx) · 1212 unmodified lines
12131213 if (flags & ~NFT_TABLE_F_MASK)
12141214 return -EOPNOTSUPP;
12151215
1216− if (flags == ctx->table->flags)
1216+ if (flags == (ctx->table->flags & NFT_TABLE_F_MASK))
12171217 return 0;
12181218
12191219 if ((nft_table_has_owner(ctx->table) &&
@@ -2631,19 +2631,6 @@ static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy, · 1411 unmodified lines
26312631 }
26322632 }
26332633
2634− if (nla[NFTA_CHAIN_COUNTERS]) {
2635− if (!nft_is_base_chain(chain)) {
2636− err = -EOPNOTSUPP;
2637− goto err_hooks;
2638− }
2639−
2640− stats = nft_stats_alloc(nla[NFTA_CHAIN_COUNTERS]);
2641− if (IS_ERR(stats)) {
2642− err = PTR_ERR(stats);
2643− goto err_hooks;
2644− }
2645− }
2646−
26472634 if (!(table->flags & NFT_TABLE_F_DORMANT) &&
26482635 nft_is_base_chain(chain) &&
26492636 !list_empty(&hook.list)) {
@@ -2658,6 +2645,20 @@ static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy, · 8 unmodified lines
26582645 }
26592646
26602647 unregister = true;
2648+
2649+ if (nla[NFTA_CHAIN_COUNTERS]) {
2650+ if (!nft_is_base_chain(chain)) {
2651+ err = -EOPNOTSUPP;
2652+ goto err_hooks;
2653+ }
2654+
2655+ stats = nft_stats_alloc(nla[NFTA_CHAIN_COUNTERS]);
2656+ if (IS_ERR(stats)) {
2657+ err = PTR_ERR(stats);
2658+ goto err_hooks;
2659+ }
2660+ }
2661+
26612662 err = -ENOMEM;
26622663 trans = nft_trans_alloc(ctx, NFT_MSG_NEWCHAIN,
26632664 sizeof(struct nft_trans_chain));
net/netfilter/nft_set_pipapo.c+1−4
@@ -2329,8 +2329,6 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx, · 2328 unmodified lines
23292329 if (m) {
23302330 rcu_barrier();
23312331
2332− nft_set_pipapo_match_destroy(ctx, set, m);
2333−
23342332 for_each_possible_cpu(cpu)
23352333 pipapo_free_scratch(m, cpu);
23362334 free_percpu(m->scratch);
@@ -2342,8 +2340,7 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx, · 5 unmodified lines
23422340 if (priv->clone) {
23432341 m = priv->clone;
23442342
2345− if (priv->dirty)
2346− nft_set_pipapo_match_destroy(ctx, set, m);
2343+ nft_set_pipapo_match_destroy(ctx, set, m);
23472344
23482345 for_each_possible_cpu(cpu)
23492346 pipapo_free_scratch(priv->clone, cpu);
net/packet/af_packet.c+3−5
@@ -2057,7 +2057,7 @@ retry: · 2056 unmodified lines
20572057 skb->priority = READ_ONCE(sk->sk_priority);
20582058 skb->mark = READ_ONCE(sk->sk_mark);
20592059 skb->tstamp = sockc.transmit_time;
2060− skb->mono_delivery_time = !!skb->tstamp;
2060+
20612061 skb_setup_tx_timestamp(skb, sockc.tsflags);
20622062
20632063 if (unlikely(extra_len == 4))
@@ -2586,7 +2586,6 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb, · 522 unmodified lines
25862586 skb->priority = READ_ONCE(po->sk.sk_priority);
25872587 skb->mark = READ_ONCE(po->sk.sk_mark);
25882588 skb->tstamp = sockc->transmit_time;
2589− skb->mono_delivery_time = !!skb->tstamp;
25902589 skb_setup_tx_timestamp(skb, sockc->tsflags);
25912590 skb_zcopy_set_nouarg(skb, ph.raw);
25922591
@@ -3065,7 +3064,6 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) · 472 unmodified lines
30653064 skb->priority = READ_ONCE(sk->sk_priority);
30663065 skb->mark = sockc.mark;
30673066 skb->tstamp = sockc.transmit_time;
3068− skb->mono_delivery_time = !!skb->tstamp;
30693067
30703068 if (unlikely(extra_len == 4))
30713069 skb->no_fcs = 1;
@@ -4000,7 +3998,7 @@ packet_setsockopt(struct socket *sock, int level, int optname, sockptr_t optval, · 928 unmodified lines
40003998 if (val < 0 || val > 1)
40013999 return -EINVAL;
40024000
4003− po->prot_hook.ignore_outgoing = !!val;
4001+ WRITE_ONCE(po->prot_hook.ignore_outgoing, !!val);
40044002 return 0;
40054003 }
40064004 case PACKET_TX_HAS_OFF:
@@ -4134,7 +4132,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname, · 127 unmodified lines
41344132 0);
41354133 break;
41364134 case PACKET_IGNORE_OUTGOING:
4137− val = po->prot_hook.ignore_outgoing;
4135+ val = READ_ONCE(po->prot_hook.ignore_outgoing);
41384136 break;
41394137 case PACKET_ROLLOVER_STATS:
41404138 if (!po->rollover)
net/rds/send.c+2−3
@@ -103,13 +103,12 @@ EXPORT_SYMBOL_GPL(rds_send_path_reset); · 102 unmodified lines
103103
104104 static int acquire_in_xmit(struct rds_conn_path *cp)
105105 {
106− return test_and_set_bit(RDS_IN_XMIT, &cp->cp_flags) == 0;
106+ return test_and_set_bit_lock(RDS_IN_XMIT, &cp->cp_flags) == 0;
107107 }
108108
109109 static void release_in_xmit(struct rds_conn_path *cp)
110110 {
111− clear_bit(RDS_IN_XMIT, &cp->cp_flags);
112− smp_mb__after_atomic();
111+ clear_bit_unlock(RDS_IN_XMIT, &cp->cp_flags);
113112 /*
114113 * We don't use wait_on_bit()/wake_up_bit() because our waking is in a
115114 * hot path and finding waiters is very rare. We don't want to walk
net/rxrpc/sendmsg.c+2−2
@@ -349,8 +349,8 @@ reload: · 348 unmodified lines
349349 */
350350 remain = more ? INT_MAX : msg_data_left(msg);
351351 txb = call->conn->security->alloc_txbuf(call, remain, sk->sk_allocation);
352− if (IS_ERR(txb)) {
353− ret = PTR_ERR(txb);
352+ if (!txb) {
353+ ret = -ENOMEM;
354354 goto maybe_error;
355355 }
356356 }
net/rxrpc/txbuf.c+2−2
@@ -33,8 +33,8 @@ struct rxrpc_txbuf *rxrpc_alloc_data_txbuf(struct rxrpc_call *call, size_t data_ · 32 unmodified lines
3333 total = hoff + sizeof(*whdr) + data_size;
3434
3535 mutex_lock(&call->conn->tx_data_alloc_lock);
36− buf = page_frag_alloc_align(&call->conn->tx_data_alloc, total, gfp,
37− ~(data_align - 1) & ~(L1_CACHE_BYTES - 1));
36+ buf = __page_frag_alloc_align(&call->conn->tx_data_alloc, total, gfp,
37+ ~(data_align - 1) & ~(L1_CACHE_BYTES - 1));
3838 mutex_unlock(&call->conn->tx_data_alloc_lock);
3939 if (!buf) {
4040 kfree(txb);
net/sched/sch_fq_pie.c+2−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 */
1111
1212 #include <linux/jhash.h>
13+#include <linux/module.h>
1314 #include <linux/sizes.h>
1415 #include <linux/vmalloc.h>
1516 #include <net/pkt_cls.h>
@@ -563,6 +564,7 @@ static struct Qdisc_ops fq_pie_qdisc_ops __read_mostly = { · 547 unmodified lines
563564 .dump_stats = fq_pie_dump_stats,
564565 .owner = THIS_MODULE,
565566 };
567+MODULE_ALIAS_NET_SCH("fq_pie");
566568
567569 static int __init fq_pie_module_init(void)
568570 {
net/sched/sch_taprio.c+2−1
@@ -997,7 +997,8 @@ static const struct nla_policy entry_policy[TCA_TAPRIO_SCHED_ENTRY_MAX + 1] = { · 996 unmodified lines
997997 };
998998
999999 static const struct nla_policy taprio_tc_policy[TCA_TAPRIO_TC_ENTRY_MAX + 1] = {
1000− [TCA_TAPRIO_TC_ENTRY_INDEX] = { .type = NLA_U32 },
1000+ [TCA_TAPRIO_TC_ENTRY_INDEX] = NLA_POLICY_MAX(NLA_U32,
1001+ TC_QOPT_MAX_QUEUE),
10011002 [TCA_TAPRIO_TC_ENTRY_MAX_SDU] = { .type = NLA_U32 },
10021003 [TCA_TAPRIO_TC_ENTRY_FP] = NLA_POLICY_RANGE(NLA_U32,
10031004 TC_FP_EXPRESS,
net/socket.c+7−7
@@ -2600,9 +2600,9 @@ out: · 2599 unmodified lines
26002600 return err;
26012601 }
26022602
2603−int sendmsg_copy_msghdr(struct msghdr *msg,
2604− struct user_msghdr __user *umsg, unsigned flags,
2605− struct iovec **iov)
2603+static int sendmsg_copy_msghdr(struct msghdr *msg,
2604+ struct user_msghdr __user *umsg, unsigned flags,
2605+ struct iovec **iov)
26062606 {
26072607 int err;
26082608
@@ -2753,10 +2753,10 @@ SYSCALL_DEFINE4(sendmmsg, int, fd, struct mmsghdr __user *, mmsg, · 144 unmodified lines
27532753 return __sys_sendmmsg(fd, mmsg, vlen, flags, true);
27542754 }
27552755
2756−int recvmsg_copy_msghdr(struct msghdr *msg,
2757− struct user_msghdr __user *umsg, unsigned flags,
2758− struct sockaddr __user **uaddr,
2759− struct iovec **iov)
2756+static int recvmsg_copy_msghdr(struct msghdr *msg,
2757+ struct user_msghdr __user *umsg, unsigned flags,
2758+ struct sockaddr __user **uaddr,
2759+ struct iovec **iov)
27602760 {
27612761 ssize_t err;
27622762
net/xfrm/xfrm_device.c+2−1
@@ -407,7 +407,8 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x) · 406 unmodified lines
407407 struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
408408 struct net_device *dev = x->xso.dev;
409409
410− if (!x->type_offload)
410+ if (!x->type_offload ||
411+ (x->xso.type == XFRM_DEV_OFFLOAD_UNSPECIFIED && x->encap))
411412 return false;
412413
413414 if (x->xso.type == XFRM_DEV_OFFLOAD_PACKET ||
tools/net/ynl/Makefile.deps+1−0
@@ -20,6 +20,7 @@ CFLAGS_ethtool:=$(call get_hdr_inc,_LINUX_ETHTOOL_NETLINK_H_,ethtool_netlink.h) · 19 unmodified lines
2020 CFLAGS_handshake:=$(call get_hdr_inc,_LINUX_HANDSHAKE_H,handshake.h)
2121 CFLAGS_mptcp_pm:=$(call get_hdr_inc,_LINUX_MPTCP_PM_H,mptcp_pm.h)
2222 CFLAGS_netdev:=$(call get_hdr_inc,_LINUX_NETDEV_H,netdev.h)
23+CFLAGS_nlctrl:=$(call get_hdr_inc,__LINUX_GENERIC_NETLINK_H,genetlink.h)
2324 CFLAGS_nfsd:=$(call get_hdr_inc,_LINUX_NFSD_NETLINK_H,nfsd_netlink.h)
2425 CFLAGS_ovs_datapath:=$(call get_hdr_inc,__LINUX_OPENVSWITCH_H,openvswitch.h)
2526 CFLAGS_ovs_flow:=$(call get_hdr_inc,__LINUX_OPENVSWITCH_H,openvswitch.h)
tools/perf/trace/beauty/include/linux/socket.h+0−7
@@ -422,13 +422,6 @@ extern long __sys_recvmsg_sock(struct socket *sock, struct msghdr *msg, · 421 unmodified lines
422422 struct user_msghdr __user *umsg,
423423 struct sockaddr __user *uaddr,
424424 unsigned int flags);
425−extern int sendmsg_copy_msghdr(struct msghdr *msg,
426− struct user_msghdr __user *umsg, unsigned flags,
427− struct iovec **iov);
428−extern int recvmsg_copy_msghdr(struct msghdr *msg,
429− struct user_msghdr __user *umsg, unsigned flags,
430− struct sockaddr __user **uaddr,
431− struct iovec **iov);
432425 extern int __copy_msghdr(struct msghdr *kmsg,
433426 struct user_msghdr *umsg,
434427 struct sockaddr __user **save_addr);
tools/testing/selftests/net/forwarding/vxlan_bridge_1d_ipv6.sh+2−2
@@ -354,7 +354,7 @@ __ping_ipv4() · 353 unmodified lines
354354
355355 # Send 100 packets and verify that at least 100 packets hit the rule,
356356 # to overcome ARP noise.
357− PING_COUNT=100 PING_TIMEOUT=11 ping_do $dev $dst_ip
357+ PING_COUNT=100 PING_TIMEOUT=20 ping_do $dev $dst_ip
358358 check_err $? "Ping failed"
359359
360360 tc_check_at_least_x_packets "dev $rp1 egress" 101 10 100
@@ -410,7 +410,7 @@ __ping_ipv6() · 49 unmodified lines
410410
411411 # Send 100 packets and verify that at least 100 packets hit the rule,
412412 # to overcome neighbor discovery noise.
413− PING_COUNT=100 PING_TIMEOUT=11 ping6_do $dev $dst_ip
413+ PING_COUNT=100 PING_TIMEOUT=20 ping6_do $dev $dst_ip
414414 check_err $? "Ping failed"
415415
416416 tc_check_at_least_x_packets "dev $rp1 egress" 101 100
tools/testing/selftests/net/forwarding/vxlan_bridge_1q_ipv6.sh+2−2
@@ -457,7 +457,7 @@ __ping_ipv4() · 456 unmodified lines
457457
458458 # Send 100 packets and verify that at least 100 packets hit the rule,
459459 # to overcome ARP noise.
460− PING_COUNT=100 PING_TIMEOUT=11 ping_do $dev $dst_ip
460+ PING_COUNT=100 PING_TIMEOUT=20 ping_do $dev $dst_ip
461461 check_err $? "Ping failed"
462462
463463 tc_check_at_least_x_packets "dev $rp1 egress" 101 10 100
@@ -522,7 +522,7 @@ __ping_ipv6() · 58 unmodified lines
522522
523523 # Send 100 packets and verify that at least 100 packets hit the rule,
524524 # to overcome neighbor discovery noise.
525− PING_COUNT=100 PING_TIMEOUT=11 ping6_do $dev $dst_ip
525+ PING_COUNT=100 PING_TIMEOUT=20 ping6_do $dev $dst_ip
526526 check_err $? "Ping failed"
527527
528528 tc_check_at_least_x_packets "dev $rp1 egress" 101 100
tools/testing/selftests/net/udpgro_fwd.sh+4−0
@@ -217,6 +217,7 @@ for family in 4 6; do · 216 unmodified lines
217217 cleanup
218218
219219 create_ns
220+ ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
220221 ip netns exec $NS_DST ethtool -K veth$DST rx-gro-list on
221222 run_test "GRO frag list" $BM_NET$DST 1 0
222223 cleanup
@@ -227,6 +228,7 @@ for family in 4 6; do · 4 unmodified lines
227228 # use NAT to circumvent GRO FWD check
228229 create_ns
229230 ip -n $NS_DST addr add dev veth$DST $BM_NET$DST_NAT/$SUFFIX
231+ ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
230232 ip netns exec $NS_DST ethtool -K veth$DST rx-udp-gro-forwarding on
231233 ip netns exec $NS_DST $IPT -t nat -I PREROUTING -d $BM_NET$DST_NAT \
232234 -j DNAT --to-destination $BM_NET$DST
@@ -240,6 +242,7 @@ for family in 4 6; do · 7 unmodified lines
240242 cleanup
241243
242244 create_vxlan_pair
245+ ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
243246 ip netns exec $NS_DST ethtool -K veth$DST rx-gro-list on
244247 run_test "GRO frag list over UDP tunnel" $OL_NET$DST 1 1
245248 cleanup
@@ -247,6 +250,7 @@ for family in 4 6; do · 1 unmodified line
247250 # use NAT to circumvent GRO FWD check
248251 create_vxlan_pair
249252 ip -n $NS_DST addr add dev $VXDEV$DST $OL_NET$DST_NAT/$SUFFIX
253+ ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
250254 ip netns exec $NS_DST ethtool -K veth$DST rx-udp-gro-forwarding on
251255 ip netns exec $NS_DST $IPT -t nat -I PREROUTING -d $OL_NET$DST_NAT \
252256 -j DNAT --to-destination $OL_NET$DST
tools/testing/selftests/net/veth.sh+21−3
@@ -249,9 +249,9 @@ cleanup · 248 unmodified lines
249249 create_ns
250250 ip -n $NS_DST link set dev veth$DST up
251251 ip -n $NS_DST link set dev veth$DST xdp object ${BPF_FILE} section xdp
252−chk_gro_flag "gro vs xdp while down - gro flag on" $DST on
252+chk_gro_flag "gro vs xdp while down - gro flag off" $DST off
253253 ip -n $NS_DST link set dev veth$DST down
254−chk_gro_flag " - after down" $DST on
254+chk_gro_flag " - after down" $DST off
255255 ip -n $NS_DST link set dev veth$DST xdp off
256256 chk_gro_flag " - after xdp off" $DST off
257257 ip -n $NS_DST link set dev veth$DST up
@@ -260,6 +260,21 @@ ip -n $NS_SRC link set dev veth$SRC xdp object ${BPF_FILE} section xdp · 2 unmodified lines
260260 chk_gro_flag " - after peer xdp" $DST off
261261 cleanup
262262
263+create_ns
264+ip -n $NS_DST link set dev veth$DST up
265+ip -n $NS_DST link set dev veth$DST xdp object ${BPF_FILE} section xdp
266+ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
267+chk_gro_flag "gro vs xdp while down - gro flag on" $DST on
268+ip -n $NS_DST link set dev veth$DST down
269+chk_gro_flag " - after down" $DST on
270+ip -n $NS_DST link set dev veth$DST xdp off
271+chk_gro_flag " - after xdp off" $DST on
272+ip -n $NS_DST link set dev veth$DST up
273+chk_gro_flag " - after up" $DST on
274+ip -n $NS_SRC link set dev veth$SRC xdp object ${BPF_FILE} section xdp
275+chk_gro_flag " - after peer xdp" $DST on
276+cleanup
277+
263278 create_ns
264279 chk_channels "default channels" $DST 1 1
265280
@@ -327,11 +342,14 @@ if [ $CPUS -gt 2 ]; then · 61 unmodified lines
327342 fi
328343
329344 ip -n $NS_DST link set dev veth$DST xdp object ${BPF_FILE} section xdp 2>/dev/null
330−chk_gro_flag "with xdp attached - gro flag" $DST on
345+chk_gro_flag "with xdp attached - gro flag" $DST off
331346 chk_gro_flag " - peer gro flag" $SRC off
332347 chk_tso_flag " - tso flag" $SRC off
333348 chk_tso_flag " - peer tso flag" $DST on
334349 ip netns exec $NS_DST ethtool -K veth$DST rx-udp-gro-forwarding on
350+chk_gro " - no aggregation" 10
351+ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
352+chk_gro_flag " - gro flag with GRO on" $DST on
335353 chk_gro " - aggregation" 1
336354
337355
tools/testing/selftests/wireguard/qemu/arch/riscv32.config+1−0
@@ -3,6 +3,7 @@ CONFIG_ARCH_RV32I=y · 2 unmodified lines
33 CONFIG_MMU=y
44 CONFIG_FPU=y
55 CONFIG_SOC_VIRT=y
6+CONFIG_RISCV_ISA_FALLBACK=y
67 CONFIG_SERIAL_8250=y
78 CONFIG_SERIAL_8250_CONSOLE=y
89 CONFIG_SERIAL_OF_PLATFORM=y
tools/testing/selftests/wireguard/qemu/arch/riscv64.config+1−0
@@ -2,6 +2,7 @@ CONFIG_ARCH_RV64I=y · 1 unmodified line
22 CONFIG_MMU=y
33 CONFIG_FPU=y
44 CONFIG_SOC_VIRT=y
5+CONFIG_RISCV_ISA_FALLBACK=y
56 CONFIG_SERIAL_8250=y
67 CONFIG_SERIAL_8250_CONSOLE=y
78 CONFIG_SERIAL_OF_PLATFORM=y

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t