History

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

Pull networking fixes from Jakub Kicinski: "Including fixes from wireless. No known regressions at this point. Current release - fix to a fix: - eth: Revert "net/mlx5e: Update and set Xon/Xoff upon port speed set" - wifi: iwlwifi: pcie: fix byte count table for 7000/8000 devices - net: clear sk->sk_ino in sk_set_socket(sk, NULL), fix CRIU Previous releases - regressions: - bonding: set random address only when slaves already exist - rxrpc: fix untrusted unsigned subtract - eth: - ice: fix Rx page leak on multi-buffer frames - mlx5: don't return mlx5_link_info table when speed is unknown Previous releases - always broken: - tls: make sure to abort the stream if headers are bogus - tcp: fix null-deref when using TCP-AO with TCP_REPAIR - dpll: fix skipping last entry in clock quality level reporting - eth: qed: don't collect too many protection override GRC elements, fix memory corruption" * tag 'net-6.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (51 commits) octeontx2-pf: Fix use-after-free bugs in otx2_sync_tstamp() cnic: Fix use-after-free bugs in cnic_delete_task devlink rate: Remove unnecessary 'static' from a couple places MAINTAINERS: update sundance entry net: liquidio: fix overflow in octeon_init_instr_queue() net: clear sk->sk_ino in sk_set_socket(sk, NULL) Revert "net/mlx5e: Update and set Xon/Xoff upon port speed set" selftests: tls: test skb copy under mem pressure and OOB tls: make sure to abort the stream if headers are bogus selftest: packetdrill: Add tcp_fastopen_server_reset-after-disconnect.pkt. tcp: Clear tcp_sk(sk)->fastopen_rsk in tcp_disconnect(). octeon_ep: fix VF MAC address lifecycle handling selftests: bonding: add vlan over bond testing bonding: don't set oif to bond dev when getting NS target destination net: rfkill: gpio: Fix crash due to dereferencering uninitialized pointer net/mlx5e: Add a miss level for ipsec crypto offload net/mlx5e: Harden uplink netdev access against device unbind MAINTAINERS: make the DPLL entry cover drivers doc/netlink: Fix typos in operation attributes igc: don't fail igc_probe() on LED setup error ...

Linus Torvalds committed 1 year ago

Commit cbf658d2 parents 86cc796 f8b468764 files · +640 −179Browse files

Unified · Split

64 files
  1. Documentation/netlink/specs/conntrack.yaml +4 −5
  2. Documentation/netlink/specs/mptcp_pm.yaml +2 −2
  3. MAINTAINERS +2 −2
  4. drivers/dpll/dpll_netlink.c +2 −2
  5. drivers/net/bonding/bond_main.c +1 −1
  6. drivers/net/ethernet/broadcom/cnic.c +1 −2
  7. drivers/net/ethernet/cavium/liquidio/request_manager.c +1 −1
  8. drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +1 −1
  9. drivers/net/ethernet/intel/i40e/i40e_txrx.c +0 −3
  10. drivers/net/ethernet/intel/ice/ice_txrx.c +34 −46
  11. drivers/net/ethernet/intel/ice/ice_txrx.h +0 −1
  12. drivers/net/ethernet/intel/igc/igc.h +1 −0
  13. drivers/net/ethernet/intel/igc/igc_main.c +9 −3
  14. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +12 −10
  15. drivers/net/ethernet/marvell/octeon_ep/octep_main.c +16 −0
  16. drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c +3 −0
  17. drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c +1 −1
  18. drivers/net/ethernet/mellanox/mlx5/core/en/fs.h +1 −0
  19. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h +1 −0
  20. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c +2 −1
  21. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0 −2
  22. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +22 −5
  23. drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +1 −0
  24. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +2 −2
  25. drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h +14 −1
  26. drivers/net/ethernet/mellanox/mlx5/core/port.c +5 −1
  27. drivers/net/ethernet/natsemi/ns83820.c +6 −7
  28. drivers/net/ethernet/qlogic/qed/qed_debug.c +4 −3
  29. drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c +1 −1
  30. include/linux/mlx5/driver.h +1 −0
  31. include/net/dst_metadata.h +9 −2
  32. include/net/sock.h +3 −2
  33. include/uapi/linux/mptcp.h +2 −0
  34. include/uapi/linux/mptcp_pm.h +2 −2
  35. net/core/dev.c +1 −1
  36. net/devlink/rate.c +2 −2
  37. net/ethtool/common.c +2 −2
  38. net/ipv4/tcp.c +5 −0
  39. net/ipv4/tcp_ao.c +3 −1
  40. net/mptcp/options.c +3 −3
  41. net/mptcp/pm_netlink.c +7 −0
  42. net/mptcp/protocol.c +16 −0
  43. net/mptcp/subflow.c +4 −0
  44. net/rds/ib_frmr.c +12 −8
  45. net/rfkill/rfkill-gpio.c +2 −2
  46. net/rxrpc/rxgk.c +10 −8
  47. net/rxrpc/rxgk_app.c +20 −9
  48. net/rxrpc/rxgk_common.h +12 −2
  49. net/tls/tls.h +1 −0
  50. net/tls/tls_strp.c +9 −5
  51. net/tls/tls_sw.c +1 −2
  52. tools/testing/selftests/drivers/net/bonding/bond_options.sh +195 −2
  53. tools/testing/selftests/drivers/net/bonding/bond_topo_2d1c.sh +3 −0
  54. tools/testing/selftests/drivers/net/bonding/bond_topo_3d1c.sh +2 −0
  55. tools/testing/selftests/drivers/net/bonding/config +1 −0
  56. tools/testing/selftests/net/mptcp/mptcp_connect.c +6 −5
  57. tools/testing/selftests/net/mptcp/mptcp_connect.sh +5 −1
  58. tools/testing/selftests/net/mptcp/mptcp_lib.sh +1 −1
  59. tools/testing/selftests/net/mptcp/mptcp_sockopt.c +10 −6
  60. tools/testing/selftests/net/mptcp/pm_nl_ctl.c +7 −0
  61. tools/testing/selftests/net/mptcp/userspace_pm.sh +11 −3
  62. tools/testing/selftests/net/openvswitch/openvswitch.sh +81 −7
  63. tools/testing/selftests/net/packetdrill/tcp_fastopen_server_reset-after-disconnect.pkt +26 −0
  64. tools/testing/selftests/net/tls.c +16 −0
Documentation/netlink/specs/conntrack.yaml+4−5
@@ -575,8 +575,8 @@ operations: · 574 unmodified lines
575575 - nat-dst
576576 - timeout
577577 - mark
578− - counter-orig
579− - counter-reply
578+ - counters-orig
579+ - counters-reply
580580 - use
581581 - id
582582 - nat-dst
@@ -591,7 +591,6 @@ operations: · 8 unmodified lines
591591 request:
592592 value: 0x101
593593 attributes:
594− - nfgen-family
595594 - mark
596595 - filter
597596 - status
@@ -608,8 +607,8 @@ operations: · 10 unmodified lines
608607 - nat-dst
609608 - timeout
610609 - mark
611− - counter-orig
612− - counter-reply
610+ - counters-orig
611+ - counters-reply
613612 - use
614613 - id
615614 - nat-dst
Documentation/netlink/specs/mptcp_pm.yaml+2−2
@@ -28,13 +28,13 @@ definitions: · 27 unmodified lines
2828 traffic-patterns it can take a long time until the
2929 MPTCP_EVENT_ESTABLISHED is sent.
3030 Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,
31− dport, server-side.
31+ dport, server-side, [flags].
3232 -
3333 name: established
3434 doc: >-
3535 A MPTCP connection is established (can start new subflows).
3636 Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,
37− dport, server-side.
37+ dport, server-side, [flags].
3838 -
3939 name: closed
4040 doc: >-
MAINTAINERS+2−2
@@ -7430,7 +7430,7 @@ S: Supported · 7429 unmodified lines
74307430 F: Documentation/devicetree/bindings/dpll/dpll-device.yaml
74317431 F: Documentation/devicetree/bindings/dpll/dpll-pin.yaml
74327432 F: Documentation/driver-api/dpll.rst
7433−F: drivers/dpll/*
7433+F: drivers/dpll/
74347434 F: include/linux/dpll.h
74357435 F: include/uapi/linux/dpll.h
74367436
@@ -24259,7 +24259,7 @@ F: Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml · 16822 unmodified lines
2425924259 F: drivers/input/keyboard/sun4i-lradc-keys.c
2426024260
2426124261 SUNDANCE NETWORK DRIVER
24262−M: Denis Kirjanov <dkirjanov@suse.de>
24262+M: Denis Kirjanov <kirjanov@gmail.com>
2426324263 L: netdev@vger.kernel.org
2426424264 S: Maintained
2426524265 F: drivers/net/ethernet/dlink/sundance.c
drivers/dpll/dpll_netlink.c+2−2
@@ -211,8 +211,8 @@ static int · 210 unmodified lines
211211 dpll_msg_add_clock_quality_level(struct sk_buff *msg, struct dpll_device *dpll,
212212 struct netlink_ext_ack *extack)
213213 {
214+ DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX + 1) = { 0 };
214215 const struct dpll_device_ops *ops = dpll_device_ops(dpll);
215− DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX) = { 0 };
216216 enum dpll_clock_quality_level ql;
217217 int ret;
218218
@@ -221,7 +221,7 @@ dpll_msg_add_clock_quality_level(struct sk_buff *msg, struct dpll_device *dpll, · 2 unmodified lines
221221 ret = ops->clock_quality_level_get(dpll, dpll_priv(dpll), qls, extack);
222222 if (ret)
223223 return ret;
224− for_each_set_bit(ql, qls, DPLL_CLOCK_QUALITY_LEVEL_MAX)
224+ for_each_set_bit(ql, qls, DPLL_CLOCK_QUALITY_LEVEL_MAX + 1)
225225 if (nla_put_u32(msg, DPLL_A_CLOCK_QUALITY_LEVEL, ql))
226226 return -EMSGSIZE;
227227
drivers/net/bonding/bond_main.c+1−1
@@ -2132,6 +2132,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, · 2131 unmodified lines
21322132 memcpy(ss.__data, bond_dev->dev_addr, bond_dev->addr_len);
21332133 } else if (bond->params.fail_over_mac == BOND_FOM_FOLLOW &&
21342134 BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP &&
2135+ bond_has_slaves(bond) &&
21352136 memcmp(slave_dev->dev_addr, bond_dev->dev_addr, bond_dev->addr_len) == 0) {
21362137 /* Set slave to random address to avoid duplicate mac
21372138 * address in later fail over.
@@ -3355,7 +3356,6 @@ static void bond_ns_send_all(struct bonding *bond, struct slave *slave) · 1217 unmodified lines
33553356 /* Find out through which dev should the packet go */
33563357 memset(&fl6, 0, sizeof(struct flowi6));
33573358 fl6.daddr = targets[i];
3358− fl6.flowi6_oif = bond->dev->ifindex;
33593359
33603360 dst = ip6_route_output(dev_net(bond->dev), NULL, &fl6);
33613361 if (dst->error) {
drivers/net/ethernet/broadcom/cnic.c+1−2
@@ -4230,8 +4230,7 @@ static void cnic_cm_stop_bnx2x_hw(struct cnic_dev *dev) · 4229 unmodified lines
42304230
42314231 cnic_bnx2x_delete_wait(dev, 0);
42324232
4233− cancel_delayed_work(&cp->delete_task);
4234− flush_workqueue(cnic_wq);
4233+ cancel_delayed_work_sync(&cp->delete_task);
42354234
42364235 if (atomic_read(&cp->iscsi_conn) != 0)
42374236 netdev_warn(dev->netdev, "%d iSCSI connections not destroyed\n",
drivers/net/ethernet/cavium/liquidio/request_manager.c+1−1
@@ -126,7 +126,7 @@ int octeon_init_instr_queue(struct octeon_device *oct, · 125 unmodified lines
126126 oct->io_qmask.iq |= BIT_ULL(iq_no);
127127
128128 /* Set the 32B/64B mode for each input queue */
129− oct->io_qmask.iq64B |= ((conf->instr_type == 64) << iq_no);
129+ oct->io_qmask.iq64B |= ((u64)(conf->instr_type == 64) << iq_no);
130130 iq->iqcmd_64B = (conf->instr_type == 64);
131131
132132 oct->fn_list.setup_iq_regs(oct, iq_no);
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c+1−1
@@ -2736,7 +2736,7 @@ static int dpaa2_switch_setup_dpbp(struct ethsw_core *ethsw) · 2735 unmodified lines
27362736 dev_err(dev, "dpsw_ctrl_if_set_pools() failed\n");
27372737 goto err_get_attr;
27382738 }
2739− ethsw->bpid = dpbp_attrs.id;
2739+ ethsw->bpid = dpbp_attrs.bpid;
27402740
27412741 return 0;
27422742
drivers/net/ethernet/intel/i40e/i40e_txrx.c+0−3
@@ -948,9 +948,6 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi, · 947 unmodified lines
948948 if (!eop_desc)
949949 break;
950950
951− /* prevent any other reads prior to eop_desc */
952− smp_rmb();
953−
954951 i40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf);
955952 /* we have caught up to head, no work left to do */
956953 if (tx_head == tx_desc)
drivers/net/ethernet/intel/ice/ice_txrx.c+34−46
@@ -894,10 +894,6 @@ ice_add_xdp_frag(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp, · 893 unmodified lines
894894 __skb_fill_page_desc_noacc(sinfo, sinfo->nr_frags++, rx_buf->page,
895895 rx_buf->page_offset, size);
896896 sinfo->xdp_frags_size += size;
897− /* remember frag count before XDP prog execution; bpf_xdp_adjust_tail()
898− * can pop off frags but driver has to handle it on its own
899− */
900− rx_ring->nr_frags = sinfo->nr_frags;
901897
902898 if (page_is_pfmemalloc(rx_buf->page))
903899 xdp_buff_set_frag_pfmemalloc(xdp);
@@ -968,20 +964,20 @@ ice_get_rx_buf(struct ice_rx_ring *rx_ring, const unsigned int size, · 64 unmodified lines
968964 /**
969965 * ice_get_pgcnts - grab page_count() for gathered fragments
970966 * @rx_ring: Rx descriptor ring to store the page counts on
967+ * @ntc: the next to clean element (not included in this frame!)
971968 *
972969 * This function is intended to be called right before running XDP
973970 * program so that the page recycling mechanism will be able to take
974971 * a correct decision regarding underlying pages; this is done in such
975972 * way as XDP program can change the refcount of page
976973 */
977−static void ice_get_pgcnts(struct ice_rx_ring *rx_ring)
974+static void ice_get_pgcnts(struct ice_rx_ring *rx_ring, unsigned int ntc)
978975 {
979− u32 nr_frags = rx_ring->nr_frags + 1;
980976 u32 idx = rx_ring->first_desc;
981977 struct ice_rx_buf *rx_buf;
982978 u32 cnt = rx_ring->count;
983979
984− for (int i = 0; i < nr_frags; i++) {
980+ while (idx != ntc) {
985981 rx_buf = &rx_ring->rx_buf[idx];
986982 rx_buf->pgcnt = page_count(rx_buf->page);
987983
@@ -1154,62 +1150,51 @@ ice_put_rx_buf(struct ice_rx_ring *rx_ring, struct ice_rx_buf *rx_buf) · 166 unmodified lines
11541150 }
11551151
11561152 /**
1157− * ice_put_rx_mbuf - ice_put_rx_buf() caller, for all frame frags
1153+ * ice_put_rx_mbuf - ice_put_rx_buf() caller, for all buffers in frame
11581154 * @rx_ring: Rx ring with all the auxiliary data
11591155 * @xdp: XDP buffer carrying linear + frags part
1160− * @xdp_xmit: XDP_TX/XDP_REDIRECT verdict storage
1161− * @ntc: a current next_to_clean value to be stored at rx_ring
1156+ * @ntc: the next to clean element (not included in this frame!)
11621157 * @verdict: return code from XDP program execution
11631158 *
1164− * Walk through gathered fragments and satisfy internal page
1165− * recycle mechanism; we take here an action related to verdict
1166− * returned by XDP program;
1159+ * Called after XDP program is completed, or on error with verdict set to
1160+ * ICE_XDP_CONSUMED.
1161+ *
1162+ * Walk through buffers from first_desc to the end of the frame, releasing
1163+ * buffers and satisfying internal page recycle mechanism. The action depends
1164+ * on verdict from XDP program.
11671165 */
11681166 static void ice_put_rx_mbuf(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp,
1169− u32 *xdp_xmit, u32 ntc, u32 verdict)
1167+ u32 ntc, u32 verdict)
11701168 {
1171− u32 nr_frags = rx_ring->nr_frags + 1;
11721169 u32 idx = rx_ring->first_desc;
11731170 u32 cnt = rx_ring->count;
1174− u32 post_xdp_frags = 1;
11751171 struct ice_rx_buf *buf;
1176− int i;
1172+ u32 xdp_frags = 0;
1173+ int i = 0;
11771174
11781175 if (unlikely(xdp_buff_has_frags(xdp)))
1179− post_xdp_frags += xdp_get_shared_info_from_buff(xdp)->nr_frags;
1176+ xdp_frags = xdp_get_shared_info_from_buff(xdp)->nr_frags;
11801177
1181− for (i = 0; i < post_xdp_frags; i++) {
1178+ while (idx != ntc) {
11821179 buf = &rx_ring->rx_buf[idx];
1180+ if (++idx == cnt)
1181+ idx = 0;
11831182
1184− if (verdict & (ICE_XDP_TX | ICE_XDP_REDIR)) {
1183+ /* An XDP program could release fragments from the end of the
1184+ * buffer. For these, we need to keep the pagecnt_bias as-is.
1185+ * To do this, only adjust pagecnt_bias for fragments up to
1186+ * the total remaining after the XDP program has run.
1187+ */
1188+ if (verdict != ICE_XDP_CONSUMED)
11851189 ice_rx_buf_adjust_pg_offset(buf, xdp->frame_sz);
1186− *xdp_xmit |= verdict;
1187− } else if (verdict & ICE_XDP_CONSUMED) {
1190+ else if (i++ <= xdp_frags)
11881191 buf->pagecnt_bias++;
1189− } else if (verdict == ICE_XDP_PASS) {
1190− ice_rx_buf_adjust_pg_offset(buf, xdp->frame_sz);
1191− }
11921192
11931193 ice_put_rx_buf(rx_ring, buf);
1194−
1195− if (++idx == cnt)
1196− idx = 0;
1197− }
1198− /* handle buffers that represented frags released by XDP prog;
1199− * for these we keep pagecnt_bias as-is; refcount from struct page
1200− * has been decremented within XDP prog and we do not have to increase
1201− * the biased refcnt
1202− */
1203− for (; i < nr_frags; i++) {
1204− buf = &rx_ring->rx_buf[idx];
1205− ice_put_rx_buf(rx_ring, buf);
1206− if (++idx == cnt)
1207− idx = 0;
12081194 }
12091195
12101196 xdp->data = NULL;
12111197 rx_ring->first_desc = ntc;
1212− rx_ring->nr_frags = 0;
12131198 }
12141199
12151200 /**
@@ -1317,6 +1302,10 @@ static int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget) · 101 unmodified lines
13171302 /* retrieve a buffer from the ring */
13181303 rx_buf = ice_get_rx_buf(rx_ring, size, ntc);
13191304
1305+ /* Increment ntc before calls to ice_put_rx_mbuf() */
1306+ if (++ntc == cnt)
1307+ ntc = 0;
1308+
13201309 if (!xdp->data) {
13211310 void *hard_start;
13221311
@@ -1325,24 +1314,23 @@ static int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget) · 2 unmodified lines
13251314 xdp_prepare_buff(xdp, hard_start, offset, size, !!offset);
13261315 xdp_buff_clear_frags_flag(xdp);
13271316 } else if (ice_add_xdp_frag(rx_ring, xdp, rx_buf, size)) {
1328− ice_put_rx_mbuf(rx_ring, xdp, NULL, ntc, ICE_XDP_CONSUMED);
1317+ ice_put_rx_mbuf(rx_ring, xdp, ntc, ICE_XDP_CONSUMED);
13291318 break;
13301319 }
1331− if (++ntc == cnt)
1332− ntc = 0;
13331320
13341321 /* skip if it is NOP desc */
13351322 if (ice_is_non_eop(rx_ring, rx_desc))
13361323 continue;
13371324
1338− ice_get_pgcnts(rx_ring);
1325+ ice_get_pgcnts(rx_ring, ntc);
13391326 xdp_verdict = ice_run_xdp(rx_ring, xdp, xdp_prog, xdp_ring, rx_desc);
13401327 if (xdp_verdict == ICE_XDP_PASS)
13411328 goto construct_skb;
13421329 total_rx_bytes += xdp_get_buff_len(xdp);
13431330 total_rx_pkts++;
13441331
1345− ice_put_rx_mbuf(rx_ring, xdp, &xdp_xmit, ntc, xdp_verdict);
1332+ ice_put_rx_mbuf(rx_ring, xdp, ntc, xdp_verdict);
1333+ xdp_xmit |= xdp_verdict & (ICE_XDP_TX | ICE_XDP_REDIR);
13461334
13471335 continue;
13481336 construct_skb:
@@ -1355,7 +1343,7 @@ construct_skb: · 6 unmodified lines
13551343 rx_ring->ring_stats->rx_stats.alloc_buf_failed++;
13561344 xdp_verdict = ICE_XDP_CONSUMED;
13571345 }
1358− ice_put_rx_mbuf(rx_ring, xdp, &xdp_xmit, ntc, xdp_verdict);
1346+ ice_put_rx_mbuf(rx_ring, xdp, ntc, xdp_verdict);
13591347
13601348 if (!skb)
13611349 break;
drivers/net/ethernet/intel/ice/ice_txrx.h+0−1
@@ -358,7 +358,6 @@ struct ice_rx_ring { · 357 unmodified lines
358358 struct ice_tx_ring *xdp_ring;
359359 struct ice_rx_ring *next; /* pointer to next ring in q_vector */
360360 struct xsk_buff_pool *xsk_pool;
361− u32 nr_frags;
362361 u16 max_frame;
363362 u16 rx_buf_len;
364363 dma_addr_t dma; /* physical address of ring */
drivers/net/ethernet/intel/igc/igc.h+1−0
@@ -345,6 +345,7 @@ struct igc_adapter { · 344 unmodified lines
345345 /* LEDs */
346346 struct mutex led_mutex;
347347 struct igc_led_classdev *leds;
348+ bool leds_available;
348349 };
349350
350351 void igc_up(struct igc_adapter *adapter);
drivers/net/ethernet/intel/igc/igc_main.c+9−3
@@ -7335,8 +7335,14 @@ static int igc_probe(struct pci_dev *pdev, · 7334 unmodified lines
73357335
73367336 if (IS_ENABLED(CONFIG_IGC_LEDS)) {
73377337 err = igc_led_setup(adapter);
7338− if (err)
7339− goto err_register;
7338+ if (err) {
7339+ netdev_warn_once(netdev,
7340+ "LED init failed (%d); continuing without LED support\n",
7341+ err);
7342+ adapter->leds_available = false;
7343+ } else {
7344+ adapter->leds_available = true;
7345+ }
73407346 }
73417347
73427348 return 0;
@@ -7392,7 +7398,7 @@ static void igc_remove(struct pci_dev *pdev) · 49 unmodified lines
73927398 cancel_work_sync(&adapter->watchdog_task);
73937399 hrtimer_cancel(&adapter->hrtimer);
73947400
7395− if (IS_ENABLED(CONFIG_IGC_LEDS))
7401+ if (IS_ENABLED(CONFIG_IGC_LEDS) && adapter->leds_available)
73967402 igc_led_free(adapter);
73977403
73987404 /* Release control of h/w to f/w. If f/w is AMT enabled, this
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+12−10
@@ -6973,6 +6973,13 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter, · 6972 unmodified lines
69736973 break;
69746974 }
69756975
6976+ /* Make sure the SWFW semaphore is in a valid state */
6977+ if (hw->mac.ops.init_swfw_sync)
6978+ hw->mac.ops.init_swfw_sync(hw);
6979+
6980+ if (hw->mac.type == ixgbe_mac_e610)
6981+ mutex_init(&hw->aci.lock);
6982+
69766983 #ifdef IXGBE_FCOE
69776984 /* FCoE support exists, always init the FCoE lock */
69786985 spin_lock_init(&adapter->fcoe.lock);
@@ -11643,10 +11650,6 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 4664 unmodified lines
1164311650 if (err)
1164411651 goto err_sw_init;
1164511652
11646− /* Make sure the SWFW semaphore is in a valid state */
11647− if (hw->mac.ops.init_swfw_sync)
11648− hw->mac.ops.init_swfw_sync(hw);
11649−
1165011653 if (ixgbe_check_fw_error(adapter))
1165111654 return ixgbe_recovery_probe(adapter);
1165211655
@@ -11850,8 +11853,6 @@ skip_sriov: · 197 unmodified lines
1185011853 ether_addr_copy(hw->mac.addr, hw->mac.perm_addr);
1185111854 ixgbe_mac_set_default_filter(adapter);
1185211855
11853− if (hw->mac.type == ixgbe_mac_e610)
11854− mutex_init(&hw->aci.lock);
1185511856 timer_setup(&adapter->service_timer, ixgbe_service_timer, 0);
1185611857
1185711858 if (ixgbe_removed(hw->hw_addr)) {
@@ -12007,9 +12008,9 @@ err_register: · 149 unmodified lines
1200712008 devl_unlock(adapter->devlink);
1200812009 ixgbe_release_hw_control(adapter);
1200912010 ixgbe_clear_interrupt_scheme(adapter);
12011+err_sw_init:
1201012012 if (hw->mac.type == ixgbe_mac_e610)
1201112013 mutex_destroy(&adapter->hw.aci.lock);
12012−err_sw_init:
1201312014 ixgbe_disable_sriov(adapter);
1201412015 adapter->flags2 &= ~IXGBE_FLAG2_SEARCH_FOR_SFP;
1201512016 iounmap(adapter->io_addr);
@@ -12060,10 +12061,8 @@ static void ixgbe_remove(struct pci_dev *pdev) · 44 unmodified lines
1206012061 set_bit(__IXGBE_REMOVING, &adapter->state);
1206112062 cancel_work_sync(&adapter->service_task);
1206212063
12063− if (adapter->hw.mac.type == ixgbe_mac_e610) {
12064+ if (adapter->hw.mac.type == ixgbe_mac_e610)
1206412065 ixgbe_disable_link_status_events(adapter);
12065− mutex_destroy(&adapter->hw.aci.lock);
12066− }
1206712066
1206812067 if (adapter->mii_bus)
1206912068 mdiobus_unregister(adapter->mii_bus);
@@ -12123,6 +12122,9 @@ static void ixgbe_remove(struct pci_dev *pdev) · 53 unmodified lines
1212312122 disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);
1212412123 free_netdev(netdev);
1212512124
12125+ if (adapter->hw.mac.type == ixgbe_mac_e610)
12126+ mutex_destroy(&adapter->hw.aci.lock);
12127+
1212612128 if (disable_dev)
1212712129 pci_disable_device(pdev);
1212812130 }
drivers/net/ethernet/marvell/octeon_ep/octep_main.c+16−0
@@ -1124,11 +1124,24 @@ static int octep_set_features(struct net_device *dev, netdev_features_t features · 1123 unmodified lines
11241124 return err;
11251125 }
11261126
1127+static bool octep_is_vf_valid(struct octep_device *oct, int vf)
1128+{
1129+ if (vf >= CFG_GET_ACTIVE_VFS(oct->conf)) {
1130+ netdev_err(oct->netdev, "Invalid VF ID %d\n", vf);
1131+ return false;
1132+ }
1133+
1134+ return true;
1135+}
1136+
11271137 static int octep_get_vf_config(struct net_device *dev, int vf,
11281138 struct ifla_vf_info *ivi)
11291139 {
11301140 struct octep_device *oct = netdev_priv(dev);
11311141
1142+ if (!octep_is_vf_valid(oct, vf))
1143+ return -EINVAL;
1144+
11321145 ivi->vf = vf;
11331146 ether_addr_copy(ivi->mac, oct->vf_info[vf].mac_addr);
11341147 ivi->spoofchk = true;
@@ -1143,6 +1156,9 @@ static int octep_set_vf_mac(struct net_device *dev, int vf, u8 *mac) · 8 unmodified lines
11431156 struct octep_device *oct = netdev_priv(dev);
11441157 int err;
11451158
1159+ if (!octep_is_vf_valid(oct, vf))
1160+ return -EINVAL;
1161+
11461162 if (!is_valid_ether_addr(mac)) {
11471163 dev_err(&oct->pdev->dev, "Invalid MAC Address %pM\n", mac);
11481164 return -EADDRNOTAVAIL;
drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c+3−0
@@ -196,6 +196,7 @@ static void octep_pfvf_get_mac_addr(struct octep_device *oct, u32 vf_id, · 195 unmodified lines
196196 vf_id);
197197 return;
198198 }
199+ ether_addr_copy(oct->vf_info[vf_id].mac_addr, rsp->s_set_mac.mac_addr);
199200 rsp->s_set_mac.type = OCTEP_PFVF_MBOX_TYPE_RSP_ACK;
200201 }
201202
@@ -205,6 +206,8 @@ static void octep_pfvf_dev_remove(struct octep_device *oct, u32 vf_id, · 3 unmodified lines
205206 {
206207 int err;
207208
209+ /* Reset VF-specific information maintained by the PF */
210+ memset(&oct->vf_info[vf_id], 0, sizeof(struct octep_pfvf_info));
208211 err = octep_ctrl_net_dev_remove(oct, vf_id);
209212 if (err) {
210213 rsp->s.type = OCTEP_PFVF_MBOX_TYPE_RSP_NACK;
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c+1−1
@@ -491,7 +491,7 @@ void otx2_ptp_destroy(struct otx2_nic *pfvf) · 490 unmodified lines
491491 if (!ptp)
492492 return;
493493
494− cancel_delayed_work(&pfvf->ptp->synctstamp_work);
494+ cancel_delayed_work_sync(&pfvf->ptp->synctstamp_work);
495495
496496 ptp_clock_unregister(ptp->ptp_clock);
497497 kfree(ptp);
drivers/net/ethernet/mellanox/mlx5/core/en/fs.h+1−0
@@ -92,6 +92,7 @@ enum { · 91 unmodified lines
9292 MLX5E_ACCEL_FS_ESP_FT_LEVEL = MLX5E_INNER_TTC_FT_LEVEL + 1,
9393 MLX5E_ACCEL_FS_ESP_FT_ERR_LEVEL,
9494 MLX5E_ACCEL_FS_POL_FT_LEVEL,
95+ MLX5E_ACCEL_FS_POL_MISS_FT_LEVEL,
9596 MLX5E_ACCEL_FS_ESP_FT_ROCE_LEVEL,
9697 #endif
9798 };
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h+1−0
@@ -185,6 +185,7 @@ struct mlx5e_ipsec_rx_create_attr { · 184 unmodified lines
185185 u32 family;
186186 int prio;
187187 int pol_level;
188+ int pol_miss_level;
188189 int sa_level;
189190 int status_level;
190191 enum mlx5_flow_namespace_type chains_ns;
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c+2−1
@@ -747,6 +747,7 @@ static void ipsec_rx_create_attr_set(struct mlx5e_ipsec *ipsec, · 746 unmodified lines
747747 attr->family = family;
748748 attr->prio = MLX5E_NIC_PRIO;
749749 attr->pol_level = MLX5E_ACCEL_FS_POL_FT_LEVEL;
750+ attr->pol_miss_level = MLX5E_ACCEL_FS_POL_MISS_FT_LEVEL;
750751 attr->sa_level = MLX5E_ACCEL_FS_ESP_FT_LEVEL;
751752 attr->status_level = MLX5E_ACCEL_FS_ESP_FT_ERR_LEVEL;
752753 attr->chains_ns = MLX5_FLOW_NAMESPACE_KERNEL;
@@ -833,7 +834,7 @@ static int ipsec_rx_chains_create_miss(struct mlx5e_ipsec *ipsec, · 80 unmodified lines
833834
834835 ft_attr.max_fte = 1;
835836 ft_attr.autogroup.max_num_groups = 1;
836− ft_attr.level = attr->pol_level;
837+ ft_attr.level = attr->pol_miss_level;
837838 ft_attr.prio = attr->prio;
838839
839840 ft = mlx5_create_auto_grouped_flow_table(attr->ns, &ft_attr);
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+0−2
@@ -139,8 +139,6 @@ void mlx5e_update_carrier(struct mlx5e_priv *priv) · 138 unmodified lines
139139 if (up) {
140140 netdev_info(priv->netdev, "Link up\n");
141141 netif_carrier_on(priv->netdev);
142− mlx5e_port_manual_buffer_config(priv, 0, priv->netdev->mtu,
143− NULL, NULL, NULL);
144142 } else {
145143 netdev_info(priv->netdev, "Link down\n");
146144 netif_carrier_off(priv->netdev);
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+22−5
@@ -1506,12 +1506,21 @@ static const struct mlx5e_profile mlx5e_uplink_rep_profile = { · 1505 unmodified lines
15061506 static int
15071507 mlx5e_vport_uplink_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
15081508 {
1509− struct mlx5e_priv *priv = netdev_priv(mlx5_uplink_netdev_get(dev));
15101509 struct mlx5e_rep_priv *rpriv = mlx5e_rep_to_rep_priv(rep);
1510+ struct net_device *netdev;
1511+ struct mlx5e_priv *priv;
1512+ int err;
1513+
1514+ netdev = mlx5_uplink_netdev_get(dev);
1515+ if (!netdev)
1516+ return 0;
15111517
1518+ priv = netdev_priv(netdev);
15121519 rpriv->netdev = priv->netdev;
1513− return mlx5e_netdev_change_profile(priv, &mlx5e_uplink_rep_profile,
1514− rpriv);
1520+ err = mlx5e_netdev_change_profile(priv, &mlx5e_uplink_rep_profile,
1521+ rpriv);
1522+ mlx5_uplink_netdev_put(dev, netdev);
1523+ return err;
15151524 }
15161525
15171526 static void
@@ -1638,8 +1647,16 @@ mlx5e_vport_rep_unload(struct mlx5_eswitch_rep *rep) · 120 unmodified lines
16381647 {
16391648 struct mlx5e_rep_priv *rpriv = mlx5e_rep_to_rep_priv(rep);
16401649 struct net_device *netdev = rpriv->netdev;
1641− struct mlx5e_priv *priv = netdev_priv(netdev);
1642− void *ppriv = priv->ppriv;
1650+ struct mlx5e_priv *priv;
1651+ void *ppriv;
1652+
1653+ if (!netdev) {
1654+ ppriv = rpriv;
1655+ goto free_ppriv;
1656+ }
1657+
1658+ priv = netdev_priv(netdev);
1659+ ppriv = priv->ppriv;
16431660
16441661 if (rep->vport == MLX5_VPORT_UPLINK) {
16451662 mlx5e_vport_uplink_rep_unload(rpriv);
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c+1−0
@@ -1515,6 +1515,7 @@ static u32 mlx5_esw_qos_lag_link_speed_get_locked(struct mlx5_core_dev *mdev) · 1514 unmodified lines
15151515 speed = lksettings.base.speed;
15161516
15171517 out:
1518+ mlx5_uplink_netdev_put(mdev, slave);
15181519 return speed;
15191520 }
15201521
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+2−2
@@ -114,9 +114,9 @@ · 113 unmodified lines
114114 #define ETHTOOL_NUM_PRIOS 11
115115 #define ETHTOOL_MIN_LEVEL (KERNEL_MIN_LEVEL + ETHTOOL_NUM_PRIOS)
116116 /* Vlan, mac, ttc, inner ttc, {UDP/ANY/aRFS/accel/{esp, esp_err}}, IPsec policy,
117− * {IPsec RoCE MPV,Alias table},IPsec RoCE policy
117+ * IPsec policy miss, {IPsec RoCE MPV,Alias table},IPsec RoCE policy
118118 */
119−#define KERNEL_NIC_PRIO_NUM_LEVELS 10
119+#define KERNEL_NIC_PRIO_NUM_LEVELS 11
120120 #define KERNEL_NIC_NUM_PRIOS 1
121121 /* One more level for tc, and one more for promisc */
122122 #define KERNEL_MIN_LEVEL (KERNEL_NIC_PRIO_NUM_LEVELS + 2)
drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h+14−1
@@ -47,7 +47,20 @@ int mlx5_crdump_collect(struct mlx5_core_dev *dev, u32 *cr_data); · 46 unmodified lines
4747
4848 static inline struct net_device *mlx5_uplink_netdev_get(struct mlx5_core_dev *mdev)
4949 {
50− return mdev->mlx5e_res.uplink_netdev;
50+ struct mlx5e_resources *mlx5e_res = &mdev->mlx5e_res;
51+ struct net_device *netdev;
52+
53+ mutex_lock(&mlx5e_res->uplink_netdev_lock);
54+ netdev = mlx5e_res->uplink_netdev;
55+ netdev_hold(netdev, &mlx5e_res->tracker, GFP_KERNEL);
56+ mutex_unlock(&mlx5e_res->uplink_netdev_lock);
57+ return netdev;
58+}
59+
60+static inline void mlx5_uplink_netdev_put(struct mlx5_core_dev *mdev,
61+ struct net_device *netdev)
62+{
63+ netdev_put(netdev, &mdev->mlx5e_res.tracker);
5164 }
5265
5366 struct mlx5_sd;
drivers/net/ethernet/mellanox/mlx5/core/port.c+5−1
@@ -1170,7 +1170,11 @@ const struct mlx5_link_info *mlx5_port_ptys2info(struct mlx5_core_dev *mdev, · 1169 unmodified lines
11701170 mlx5e_port_get_link_mode_info_arr(mdev, &table, &max_size,
11711171 force_legacy);
11721172 i = find_first_bit(&temp, max_size);
1173− if (i < max_size)
1173+
1174+ /* mlx5e_link_info has holes. Check speed
1175+ * is not zero as indication of one.
1176+ */
1177+ if (i < max_size && table[i].speed)
11741178 return &table[i];
11751179
11761180 return NULL;
drivers/net/ethernet/natsemi/ns83820.c+6−7
@@ -820,7 +820,7 @@ static void rx_irq(struct net_device *ndev) · 819 unmodified lines
820820 struct ns83820 *dev = PRIV(ndev);
821821 struct rx_info *info = &dev->rx_info;
822822 unsigned next_rx;
823− int rx_rc, len;
823+ int len;
824824 u32 cmdsts;
825825 __le32 *desc;
826826 unsigned long flags;
@@ -881,8 +881,10 @@ static void rx_irq(struct net_device *ndev) · 54 unmodified lines
881881 if (likely(CMDSTS_OK & cmdsts)) {
882882 #endif
883883 skb_put(skb, len);
884− if (unlikely(!skb))
884+ if (unlikely(!skb)) {
885+ ndev->stats.rx_dropped++;
885886 goto netdev_mangle_me_harder_failed;
887+ }
886888 if (cmdsts & CMDSTS_DEST_MULTI)
887889 ndev->stats.multicast++;
888890 ndev->stats.rx_packets++;
@@ -901,15 +903,12 @@ static void rx_irq(struct net_device *ndev) · 12 unmodified lines
901903 __vlan_hwaccel_put_tag(skb, htons(ETH_P_IPV6), tag);
902904 }
903905 #endif
904− rx_rc = netif_rx(skb);
905− if (NET_RX_DROP == rx_rc) {
906−netdev_mangle_me_harder_failed:
907− ndev->stats.rx_dropped++;
908− }
906+ netif_rx(skb);
909907 } else {
910908 dev_kfree_skb_irq(skb);
911909 }
912910
911+netdev_mangle_me_harder_failed:
913912 nr++;
914913 next_rx = info->next_rx;
915914 desc = info->descs + (DESC_SIZE * next_rx);
drivers/net/ethernet/qlogic/qed/qed_debug.c+4−3
@@ -4462,10 +4462,11 @@ static enum dbg_status qed_protection_override_dump(struct qed_hwfn *p_hwfn, · 4461 unmodified lines
44624462 goto out;
44634463 }
44644464
4465− /* Add override window info to buffer */
4465+ /* Add override window info to buffer, preventing buffer overflow */
44664466 override_window_dwords =
4467− qed_rd(p_hwfn, p_ptt, GRC_REG_NUMBER_VALID_OVERRIDE_WINDOW) *
4468− PROTECTION_OVERRIDE_ELEMENT_DWORDS;
4467+ min(qed_rd(p_hwfn, p_ptt, GRC_REG_NUMBER_VALID_OVERRIDE_WINDOW) *
4468+ PROTECTION_OVERRIDE_ELEMENT_DWORDS,
4469+ PROTECTION_OVERRIDE_DEPTH_DWORDS);
44694470 if (override_window_dwords) {
44704471 addr = BYTES_TO_DWORDS(GRC_REG_PROTECTION_OVERRIDE_WINDOW);
44714472 offset += qed_grc_dump_addr_range(p_hwfn,
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c+1−1
@@ -2092,7 +2092,7 @@ static void iwl_txq_gen1_update_byte_cnt_tbl(struct iwl_trans *trans, · 2091 unmodified lines
20922092 break;
20932093 }
20942094
2095− if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_9000 &&
2095+ if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_7000 &&
20962096 trans->mac_cfg->device_family < IWL_DEVICE_FAMILY_AX210)
20972097 len = DIV_ROUND_UP(len, 4);
20982098
include/linux/mlx5/driver.h+1−0
@@ -663,6 +663,7 @@ struct mlx5e_resources { · 662 unmodified lines
663663 bool tisn_valid;
664664 } hw_objs;
665665 struct net_device *uplink_netdev;
666+ netdevice_tracker tracker;
666667 struct mutex uplink_netdev_lock;
667668 struct mlx5_crypto_dek_priv *dek_priv;
668669 };
include/net/dst_metadata.h+9−2
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #define __NET_DST_METADATA_H 1
44
55 #include <linux/skbuff.h>
6+#include <net/ip.h>
67 #include <net/ip_tunnels.h>
78 #include <net/macsec.h>
89 #include <net/dst.h>
@@ -220,9 +221,15 @@ static inline struct metadata_dst *ip_tun_rx_dst(struct sk_buff *skb, · 211 unmodified lines
220221 int md_size)
221222 {
222223 const struct iphdr *iph = ip_hdr(skb);
224+ struct metadata_dst *tun_dst;
225+
226+ tun_dst = __ip_tun_set_dst(iph->saddr, iph->daddr, iph->tos, iph->ttl,
227+ 0, flags, tunnel_id, md_size);
223228
224− return __ip_tun_set_dst(iph->saddr, iph->daddr, iph->tos, iph->ttl,
225− 0, flags, tunnel_id, md_size);
229+ if (tun_dst && (iph->frag_off & htons(IP_DF)))
230+ __set_bit(IP_TUNNEL_DONT_FRAGMENT_BIT,
231+ tun_dst->u.tun_info.key.tun_flags);
232+ return tun_dst;
226233 }
227234
228235 static inline struct metadata_dst *__ipv6_tun_set_dst(const struct in6_addr *saddr,
include/net/sock.h+3−2
@@ -2061,6 +2061,9 @@ static inline void sk_set_socket(struct sock *sk, struct socket *sock) · 2060 unmodified lines
20612061 if (sock) {
20622062 WRITE_ONCE(sk->sk_uid, SOCK_INODE(sock)->i_uid);
20632063 WRITE_ONCE(sk->sk_ino, SOCK_INODE(sock)->i_ino);
2064+ } else {
2065+ /* Note: sk_uid is unchanged. */
2066+ WRITE_ONCE(sk->sk_ino, 0);
20642067 }
20652068 }
20662069
@@ -2082,8 +2085,6 @@ static inline void sock_orphan(struct sock *sk) · 15 unmodified lines
20822085 sock_set_flag(sk, SOCK_DEAD);
20832086 sk_set_socket(sk, NULL);
20842087 sk->sk_wq = NULL;
2085− /* Note: sk_uid is unchanged. */
2086− WRITE_ONCE(sk->sk_ino, 0);
20872088 write_unlock_bh(&sk->sk_callback_lock);
20882089 }
20892090
include/uapi/linux/mptcp.h+2−0
@@ -31,6 +31,8 @@ · 30 unmodified lines
3131 #define MPTCP_INFO_FLAG_FALLBACK _BITUL(0)
3232 #define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1)
3333
34+#define MPTCP_PM_EV_FLAG_DENY_JOIN_ID0 _BITUL(0)
35+
3436 #define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0)
3537 #define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)
3638 #define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)
include/uapi/linux/mptcp_pm.h+2−2
@@ -16,10 +16,10 @@ · 15 unmodified lines
1616 * good time to allocate memory and send ADD_ADDR if needed. Depending on the
1717 * traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABLISHED
1818 * is sent. Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6,
19− * sport, dport, server-side.
19+ * sport, dport, server-side, [flags].
2020 * @MPTCP_EVENT_ESTABLISHED: A MPTCP connection is established (can start new
2121 * subflows). Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6,
22− * sport, dport, server-side.
22+ * sport, dport, server-side, [flags].
2323 * @MPTCP_EVENT_CLOSED: A MPTCP connection has stopped. Attribute: token.
2424 * @MPTCP_EVENT_ANNOUNCED: A new address has been announced by the peer.
2525 * Attributes: token, rem_id, family, daddr4 | daddr6 [, dport].
net/core/dev.c+1−1
@@ -6965,7 +6965,7 @@ static void napi_stop_kthread(struct napi_struct *napi) · 6964 unmodified lines
69656965 * the kthread.
69666966 */
69676967 while (true) {
6968− if (!test_bit(NAPIF_STATE_SCHED_THREADED, &napi->state))
6968+ if (!test_bit(NAPI_STATE_SCHED_THREADED, &napi->state))
69696969 break;
69706970
69716971 msleep(20);
net/devlink/rate.c+2−2
@@ -34,7 +34,7 @@ devlink_rate_leaf_get_from_info(struct devlink *devlink, struct genl_info *info) · 33 unmodified lines
3434 static struct devlink_rate *
3535 devlink_rate_node_get_by_name(struct devlink *devlink, const char *node_name)
3636 {
37− static struct devlink_rate *devlink_rate;
37+ struct devlink_rate *devlink_rate;
3838
3939 list_for_each_entry(devlink_rate, &devlink->rate_list, list) {
4040 if (devlink_rate_is_node(devlink_rate) &&
@@ -819,8 +819,8 @@ EXPORT_SYMBOL_GPL(devl_rate_leaf_destroy); · 778 unmodified lines
819819 */
820820 void devl_rate_nodes_destroy(struct devlink *devlink)
821821 {
822− static struct devlink_rate *devlink_rate, *tmp;
823822 const struct devlink_ops *ops = devlink->ops;
823+ struct devlink_rate *devlink_rate, *tmp;
824824
825825 devl_assert_locked(devlink);
826826
net/ethtool/common.c+2−2
@@ -905,7 +905,7 @@ int ethtool_net_get_ts_info_by_phc(struct net_device *dev, · 904 unmodified lines
905905 int err;
906906
907907 if (!ops->get_ts_info)
908− return -ENODEV;
908+ return -EOPNOTSUPP;
909909
910910 /* Does ptp comes from netdev */
911911 ethtool_init_tsinfo(info);
@@ -973,7 +973,7 @@ int ethtool_get_ts_info_by_phc(struct net_device *dev, · 61 unmodified lines
973973 int err;
974974
975975 err = ethtool_net_get_ts_info_by_phc(dev, info, hwprov_desc);
976− if (err == -ENODEV) {
976+ if (err == -ENODEV || err == -EOPNOTSUPP) {
977977 struct phy_device *phy;
978978
979979 phy = ethtool_phy_get_ts_info_by_phc(dev, info, hwprov_desc);
net/ipv4/tcp.c+5−0
@@ -3327,6 +3327,7 @@ int tcp_disconnect(struct sock *sk, int flags) · 3326 unmodified lines
33273327 struct inet_connection_sock *icsk = inet_csk(sk);
33283328 struct tcp_sock *tp = tcp_sk(sk);
33293329 int old_state = sk->sk_state;
3330+ struct request_sock *req;
33303331 u32 seq;
33313332
33323333 if (old_state != TCP_CLOSE)
@@ -3442,6 +3443,10 @@ int tcp_disconnect(struct sock *sk, int flags) · 109 unmodified lines
34423443
34433444
34443445 /* Clean up fastopen related fields */
3446+ req = rcu_dereference_protected(tp->fastopen_rsk,
3447+ lockdep_sock_is_held(sk));
3448+ if (req)
3449+ reqsk_fastopen_remove(sk, req, false);
34453450 tcp_free_fastopen_req(tp);
34463451 inet_clear_bit(DEFER_CONNECT, sk);
34473452 tp->fastopen_client_fail = 0;
net/ipv4/tcp_ao.c+3−1
@@ -1178,7 +1178,9 @@ void tcp_ao_finish_connect(struct sock *sk, struct sk_buff *skb) · 1177 unmodified lines
11781178 if (!ao)
11791179 return;
11801180
1181− WRITE_ONCE(ao->risn, tcp_hdr(skb)->seq);
1181+ /* sk with TCP_REPAIR_ON does not have skb in tcp_finish_connect */
1182+ if (skb)
1183+ WRITE_ONCE(ao->risn, tcp_hdr(skb)->seq);
11821184 ao->rcv_sne = 0;
11831185
11841186 hlist_for_each_entry_rcu(key, &ao->head, node, lockdep_sock_is_held(sk))
net/mptcp/options.c+3−3
@@ -985,13 +985,13 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk, · 984 unmodified lines
985985 return false;
986986 }
987987
988− if (mp_opt->deny_join_id0)
989− WRITE_ONCE(msk->pm.remote_deny_join_id0, true);
990−
991988 if (unlikely(!READ_ONCE(msk->pm.server_side)))
992989 pr_warn_once("bogus mpc option on established client sk");
993990
994991 set_fully_established:
992+ if (mp_opt->deny_join_id0)
993+ WRITE_ONCE(msk->pm.remote_deny_join_id0, true);
994+
995995 mptcp_data_lock((struct sock *)msk);
996996 __mptcp_subflow_fully_established(msk, subflow, mp_opt);
997997 mptcp_data_unlock((struct sock *)msk);
net/mptcp/pm_netlink.c+7−0
@@ -408,6 +408,7 @@ static int mptcp_event_created(struct sk_buff *skb, · 407 unmodified lines
408408 const struct sock *ssk)
409409 {
410410 int err = nla_put_u32(skb, MPTCP_ATTR_TOKEN, READ_ONCE(msk->token));
411+ u16 flags = 0;
411412
412413 if (err)
413414 return err;
@@ -415,6 +416,12 @@ static int mptcp_event_created(struct sk_buff *skb, · 1 unmodified line
415416 if (nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, READ_ONCE(msk->pm.server_side)))
416417 return -EMSGSIZE;
417418
419+ if (READ_ONCE(msk->pm.remote_deny_join_id0))
420+ flags |= MPTCP_PM_EV_FLAG_DENY_JOIN_ID0;
421+
422+ if (flags && nla_put_u16(skb, MPTCP_ATTR_FLAGS, flags))
423+ return -EMSGSIZE;
424+
418425 return mptcp_event_add_subflow(skb, ssk);
419426 }
420427
net/mptcp/protocol.c+16−0
@@ -371,6 +371,20 @@ static void mptcp_close_wake_up(struct sock *sk) · 370 unmodified lines
371371 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
372372 }
373373
374+static void mptcp_shutdown_subflows(struct mptcp_sock *msk)
375+{
376+ struct mptcp_subflow_context *subflow;
377+
378+ mptcp_for_each_subflow(msk, subflow) {
379+ struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
380+ bool slow;
381+
382+ slow = lock_sock_fast(ssk);
383+ tcp_shutdown(ssk, SEND_SHUTDOWN);
384+ unlock_sock_fast(ssk, slow);
385+ }
386+}
387+
374388 /* called under the msk socket lock */
375389 static bool mptcp_pending_data_fin_ack(struct sock *sk)
376390 {
@@ -395,6 +409,7 @@ static void mptcp_check_data_fin_ack(struct sock *sk) · 18 unmodified lines
395409 break;
396410 case TCP_CLOSING:
397411 case TCP_LAST_ACK:
412+ mptcp_shutdown_subflows(msk);
398413 mptcp_set_state(sk, TCP_CLOSE);
399414 break;
400415 }
@@ -563,6 +578,7 @@ static bool mptcp_check_data_fin(struct sock *sk) · 162 unmodified lines
563578 mptcp_set_state(sk, TCP_CLOSING);
564579 break;
565580 case TCP_FIN_WAIT2:
581+ mptcp_shutdown_subflows(msk);
566582 mptcp_set_state(sk, TCP_CLOSE);
567583 break;
568584 default:
net/mptcp/subflow.c+4−0
@@ -883,6 +883,10 @@ create_child: · 882 unmodified lines
883883
884884 ctx->subflow_id = 1;
885885 owner = mptcp_sk(ctx->conn);
886+
887+ if (mp_opt.deny_join_id0)
888+ WRITE_ONCE(owner->pm.remote_deny_join_id0, true);
889+
886890 mptcp_pm_new_connection(owner, child, 1);
887891
888892 /* with OoO packets we can reach here without ingress
net/rds/ib_frmr.c+12−8
@@ -133,12 +133,15 @@ static int rds_ib_post_reg_frmr(struct rds_ib_mr *ibmr) · 132 unmodified lines
133133
134134 ret = ib_map_mr_sg_zbva(frmr->mr, ibmr->sg, ibmr->sg_dma_len,
135135 &off, PAGE_SIZE);
136− if (unlikely(ret != ibmr->sg_dma_len))
137− return ret < 0 ? ret : -EINVAL;
136+ if (unlikely(ret != ibmr->sg_dma_len)) {
137+ ret = ret < 0 ? ret : -EINVAL;
138+ goto out_inc;
139+ }
138140
139− if (cmpxchg(&frmr->fr_state,
140− FRMR_IS_FREE, FRMR_IS_INUSE) != FRMR_IS_FREE)
141− return -EBUSY;
141+ if (cmpxchg(&frmr->fr_state, FRMR_IS_FREE, FRMR_IS_INUSE) != FRMR_IS_FREE) {
142+ ret = -EBUSY;
143+ goto out_inc;
144+ }
142145
143146 atomic_inc(&ibmr->ic->i_fastreg_inuse_count);
144147
@@ -166,11 +169,10 @@ static int rds_ib_post_reg_frmr(struct rds_ib_mr *ibmr) · 21 unmodified lines
166169 /* Failure here can be because of -ENOMEM as well */
167170 rds_transition_frwr_state(ibmr, FRMR_IS_INUSE, FRMR_IS_STALE);
168171
169− atomic_inc(&ibmr->ic->i_fastreg_wrs);
170172 if (printk_ratelimit())
171173 pr_warn("RDS/IB: %s returned error(%d)\n",
172174 __func__, ret);
173− goto out;
175+ goto out_inc;
174176 }
175177
176178 /* Wait for the registration to complete in order to prevent an invalid
@@ -179,8 +181,10 @@ static int rds_ib_post_reg_frmr(struct rds_ib_mr *ibmr) · 2 unmodified lines
179181 */
180182 wait_event(frmr->fr_reg_done, !frmr->fr_reg);
181183
182−out:
184+ return ret;
183185
186+out_inc:
187+ atomic_inc(&ibmr->ic->i_fastreg_wrs);
184188 return ret;
185189 }
186190
net/rfkill/rfkill-gpio.c+2−2
@@ -94,10 +94,10 @@ static const struct dmi_system_id rfkill_gpio_deny_table[] = { · 93 unmodified lines
9494 static int rfkill_gpio_probe(struct platform_device *pdev)
9595 {
9696 struct rfkill_gpio_data *rfkill;
97− struct gpio_desc *gpio;
97+ const char *type_name = NULL;
9898 const char *name_property;
9999 const char *type_property;
100− const char *type_name;
100+ struct gpio_desc *gpio;
101101 int ret;
102102
103103 if (dmi_check_system(rfkill_gpio_deny_table))
net/rxrpc/rxgk.c+10−8
@@ -475,7 +475,7 @@ static int rxgk_verify_packet_integrity(struct rxrpc_call *call, · 474 unmodified lines
475475 struct krb5_buffer metadata;
476476 unsigned int offset = sp->offset, len = sp->len;
477477 size_t data_offset = 0, data_len = len;
478− u32 ac;
478+ u32 ac = 0;
479479 int ret = -ENOMEM;
480480
481481 _enter("");
@@ -499,9 +499,10 @@ static int rxgk_verify_packet_integrity(struct rxrpc_call *call, · 17 unmodified lines
499499 ret = rxgk_verify_mic_skb(gk->krb5, gk->rx_Kc, &metadata,
500500 skb, &offset, &len, &ac);
501501 kfree(hdr);
502− if (ret == -EPROTO) {
503− rxrpc_abort_eproto(call, skb, ac,
504− rxgk_abort_1_verify_mic_eproto);
502+ if (ret < 0) {
503+ if (ret != -ENOMEM)
504+ rxrpc_abort_eproto(call, skb, ac,
505+ rxgk_abort_1_verify_mic_eproto);
505506 } else {
506507 sp->offset = offset;
507508 sp->len = len;
@@ -524,15 +525,16 @@ static int rxgk_verify_packet_encrypted(struct rxrpc_call *call, · 16 unmodified lines
524525 struct rxgk_header hdr;
525526 unsigned int offset = sp->offset, len = sp->len;
526527 int ret;
527− u32 ac;
528+ u32 ac = 0;
528529
529530 _enter("");
530531
531532 ret = rxgk_decrypt_skb(gk->krb5, gk->rx_enc, skb, &offset, &len, &ac);
532− if (ret == -EPROTO)
533− rxrpc_abort_eproto(call, skb, ac, rxgk_abort_2_decrypt_eproto);
534− if (ret < 0)
533+ if (ret < 0) {
534+ if (ret != -ENOMEM)
535+ rxrpc_abort_eproto(call, skb, ac, rxgk_abort_2_decrypt_eproto);
535536 goto error;
537+ }
536538
537539 if (len < sizeof(hdr)) {
538540 ret = rxrpc_abort_eproto(call, skb, RXGK_PACKETSHORT,
net/rxrpc/rxgk_app.c+20−9
@@ -54,6 +54,10 @@ int rxgk_yfs_decode_ticket(struct rxrpc_connection *conn, struct sk_buff *skb, · 53 unmodified lines
5454
5555 _enter("");
5656
57+ if (ticket_len < 10 * sizeof(__be32))
58+ return rxrpc_abort_conn(conn, skb, RXGK_INCONSISTENCY, -EPROTO,
59+ rxgk_abort_resp_short_yfs_tkt);
60+
5761 /* Get the session key length */
5862 ret = skb_copy_bits(skb, ticket_offset, tmp, sizeof(tmp));
5963 if (ret < 0)
@@ -187,7 +191,7 @@ int rxgk_extract_token(struct rxrpc_connection *conn, struct sk_buff *skb, · 127 unmodified lines
187191 struct key *server_key;
188192 unsigned int ticket_offset, ticket_len;
189193 u32 kvno, enctype;
190− int ret, ec;
194+ int ret, ec = 0;
191195
192196 struct {
193197 __be32 kvno;
@@ -195,22 +199,23 @@ int rxgk_extract_token(struct rxrpc_connection *conn, struct sk_buff *skb, · 1 unmodified line
195199 __be32 token_len;
196200 } container;
197201
202+ if (token_len < sizeof(container))
203+ goto short_packet;
204+
198205 /* Decode the RXGK_TokenContainer object. This tells us which server
199206 * key we should be using. We can then fetch the key, get the secret
200207 * and set up the crypto to extract the token.
201208 */
202209 if (skb_copy_bits(skb, token_offset, &container, sizeof(container)) < 0)
203− return rxrpc_abort_conn(conn, skb, RXGK_PACKETSHORT, -EPROTO,
204− rxgk_abort_resp_tok_short);
210+ goto short_packet;
205211
206212 kvno = ntohl(container.kvno);
207213 enctype = ntohl(container.enctype);
208214 ticket_len = ntohl(container.token_len);
209215 ticket_offset = token_offset + sizeof(container);
210216
211− if (xdr_round_up(ticket_len) > token_len - 3 * 4)
212− return rxrpc_abort_conn(conn, skb, RXGK_PACKETSHORT, -EPROTO,
213− rxgk_abort_resp_tok_short);
217+ if (xdr_round_up(ticket_len) > token_len - sizeof(container))
218+ goto short_packet;
214219
215220 _debug("KVNO %u", kvno);
216221 _debug("ENC %u", enctype);
@@ -236,9 +241,11 @@ int rxgk_extract_token(struct rxrpc_connection *conn, struct sk_buff *skb, · 19 unmodified lines
236241 &ticket_offset, &ticket_len, &ec);
237242 crypto_free_aead(token_enc);
238243 token_enc = NULL;
239− if (ret < 0)
240− return rxrpc_abort_conn(conn, skb, ec, ret,
241− rxgk_abort_resp_tok_dec);
244+ if (ret < 0) {
245+ if (ret != -ENOMEM)
246+ return rxrpc_abort_conn(conn, skb, ec, ret,
247+ rxgk_abort_resp_tok_dec);
248+ }
242249
243250 ret = conn->security->default_decode_ticket(conn, skb, ticket_offset,
244251 ticket_len, _key);
@@ -283,4 +290,8 @@ temporary_error: · 38 unmodified lines
283290 * also come out this way if the ticket decryption fails.
284291 */
285292 return ret;
293+
294+short_packet:
295+ return rxrpc_abort_conn(conn, skb, RXGK_PACKETSHORT, -EPROTO,
296+ rxgk_abort_resp_tok_short);
286297 }
net/rxrpc/rxgk_common.h+12−2
@@ -88,11 +88,16 @@ int rxgk_decrypt_skb(const struct krb5_enctype *krb5, · 87 unmodified lines
8888 *_offset += offset;
8989 *_len = len;
9090 break;
91+ case -EBADMSG: /* Checksum mismatch. */
9192 case -EPROTO:
92− case -EBADMSG:
9393 *_error_code = RXGK_SEALEDINCON;
9494 break;
95+ case -EMSGSIZE:
96+ *_error_code = RXGK_PACKETSHORT;
97+ break;
98+ case -ENOPKG: /* Would prefer RXGK_BADETYPE, but not available for YFS. */
9599 default:
100+ *_error_code = RXGK_INCONSISTENCY;
96101 break;
97102 }
98103
@@ -127,11 +132,16 @@ int rxgk_verify_mic_skb(const struct krb5_enctype *krb5, · 28 unmodified lines
127132 *_offset += offset;
128133 *_len = len;
129134 break;
135+ case -EBADMSG: /* Checksum mismatch */
130136 case -EPROTO:
131− case -EBADMSG:
132137 *_error_code = RXGK_SEALEDINCON;
133138 break;
139+ case -EMSGSIZE:
140+ *_error_code = RXGK_PACKETSHORT;
141+ break;
142+ case -ENOPKG: /* Would prefer RXGK_BADETYPE, but not available for YFS. */
134143 default:
144+ *_error_code = RXGK_INCONSISTENCY;
135145 break;
136146 }
137147
net/tls/tls.h+1−0
@@ -141,6 +141,7 @@ void update_sk_prot(struct sock *sk, struct tls_context *ctx); · 140 unmodified lines
141141
142142 int wait_on_pending_writer(struct sock *sk, long *timeo);
143143 void tls_err_abort(struct sock *sk, int err);
144+void tls_strp_abort_strp(struct tls_strparser *strp, int err);
144145
145146 int init_prot_info(struct tls_prot_info *prot,
146147 const struct tls_crypto_info *crypto_info,
net/tls/tls_strp.c+9−5
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313
1414 static struct workqueue_struct *tls_strp_wq;
1515
16−static void tls_strp_abort_strp(struct tls_strparser *strp, int err)
16+void tls_strp_abort_strp(struct tls_strparser *strp, int err)
1717 {
1818 if (strp->stopped)
1919 return;
@@ -211,11 +211,17 @@ static int tls_strp_copyin_frag(struct tls_strparser *strp, struct sk_buff *skb, · 191 unmodified lines
211211 struct sk_buff *in_skb, unsigned int offset,
212212 size_t in_len)
213213 {
214+ unsigned int nfrag = skb->len / PAGE_SIZE;
214215 size_t len, chunk;
215216 skb_frag_t *frag;
216217 int sz;
217218
218− frag = &skb_shinfo(skb)->frags[skb->len / PAGE_SIZE];
219+ if (unlikely(nfrag >= skb_shinfo(skb)->nr_frags)) {
220+ DEBUG_NET_WARN_ON_ONCE(1);
221+ return -EMSGSIZE;
222+ }
223+
224+ frag = &skb_shinfo(skb)->frags[nfrag];
219225
220226 len = in_len;
221227 /* First make sure we got the header */
@@ -520,10 +526,8 @@ static int tls_strp_read_sock(struct tls_strparser *strp) · 298 unmodified lines
520526 tls_strp_load_anchor_with_queue(strp, inq);
521527 if (!strp->stm.full_len) {
522528 sz = tls_rx_msg_size(strp, strp->anchor);
523− if (sz < 0) {
524− tls_strp_abort_strp(strp, sz);
529+ if (sz < 0)
525530 return sz;
526− }
527531
528532 strp->stm.full_len = sz;
529533
net/tls/tls_sw.c+1−2
@@ -2474,8 +2474,7 @@ int tls_rx_msg_size(struct tls_strparser *strp, struct sk_buff *skb) · 2473 unmodified lines
24742474 return data_len + TLS_HEADER_SIZE;
24752475
24762476 read_failure:
2477− tls_err_abort(strp->sk, ret);
2478−
2477+ tls_strp_abort_strp(strp, ret);
24792478 return ret;
24802479 }
24812480
tools/testing/selftests/drivers/net/bonding/bond_options.sh+195−2
@@ -7,6 +7,8 @@ ALL_TESTS=" · 6 unmodified lines
77 prio
88 arp_validate
99 num_grat_arp
10+ fail_over_mac
11+ vlan_over_bond
1012 "
1113
1214 lib_dir=$(dirname "$0")
@@ -352,8 +354,8 @@ garp_test() · 339 unmodified lines
352354
353355 exp_num=$(echo "${param}" | cut -f6 -d ' ')
354356 active_slave=$(cmd_jq "ip -n ${s_ns} -d -j link show bond0" ".[].linkinfo.info_data.active_slave")
355− slowwait_for_counter $((exp_num + 5)) $exp_num \
356− tc_rule_handle_stats_get "dev s${active_slave#eth} ingress" 101 ".packets" "-n ${g_ns}"
357+ slowwait_for_counter $((exp_num + 5)) $exp_num tc_rule_handle_stats_get \
358+ "dev s${active_slave#eth} ingress" 101 ".packets" "-n ${g_ns}" &> /dev/null
357359
358360 # check result
359361 real_num=$(tc_rule_handle_stats_get "dev s${active_slave#eth} ingress" 101 ".packets" "-n ${g_ns}")
@@ -376,6 +378,197 @@ num_grat_arp() · 16 unmodified lines
376378 done
377379 }
378380
381+check_all_mac_same()
382+{
383+ RET=0
384+ # all slaves should have same mac address (with the first port's mac)
385+ local bond_mac=$(ip -n "$s_ns" -j link show bond0 | jq -r '.[]["address"]')
386+ local eth0_mac=$(ip -n "$s_ns" -j link show eth0 | jq -r '.[]["address"]')
387+ local eth1_mac=$(ip -n "$s_ns" -j link show eth1 | jq -r '.[]["address"]')
388+ local eth2_mac=$(ip -n "$s_ns" -j link show eth2 | jq -r '.[]["address"]')
389+ if [ "$bond_mac" != "${mac[0]}" ] || [ "$eth0_mac" != "$bond_mac" ] || \
390+ [ "$eth1_mac" != "$bond_mac" ] || [ "$eth2_mac" != "$bond_mac" ]; then
391+ RET=1
392+ fi
393+}
394+
395+check_bond_mac_same_with_first()
396+{
397+ RET=0
398+ # bond mac address should be same with the first added slave
399+ local bond_mac=$(ip -n "$s_ns" -j link show bond0 | jq -r '.[]["address"]')
400+ if [ "$bond_mac" != "${mac[0]}" ]; then
401+ RET=1
402+ fi
403+}
404+
405+check_bond_mac_same_with_active()
406+{
407+ RET=0
408+ # bond mac address should be same with active slave
409+ local bond_mac=$(ip -n "$s_ns" -j link show bond0 | jq -r '.[]["address"]')
410+ local active_slave=$(cmd_jq "ip -n ${s_ns} -d -j link show bond0" ".[].linkinfo.info_data.active_slave")
411+ local active_slave_mac=$(ip -n "$s_ns" -j link show "$active_slave" | jq -r '.[]["address"]')
412+ if [ "$bond_mac" != "$active_slave_mac" ]; then
413+ RET=1
414+ fi
415+}
416+
417+check_backup_slave_mac_not_change()
418+{
419+ RET=0
420+ # backup slave's mac address is not changed
421+ if ip -n "$s_ns" -d -j link show type bond_slave | jq -e '.[]
422+ | select(.linkinfo.info_slave_data.state=="BACKUP")
423+ | select(.address != .linkinfo.info_slave_data.perm_hwaddr)' &> /dev/null; then
424+ RET=1
425+ fi
426+}
427+
428+check_backup_slave_mac_inherit()
429+{
430+ local backup_mac
431+ RET=0
432+
433+ # backup slaves should use mac[1] or mac[2]
434+ local backup_macs=$(ip -n "$s_ns" -d -j link show type bond_slave | \
435+ jq -r '.[] | select(.linkinfo.info_slave_data.state=="BACKUP") | .address')
436+ for backup_mac in $backup_macs; do
437+ if [ "$backup_mac" != "${mac[1]}" ] && [ "$backup_mac" != "${mac[2]}" ]; then
438+ RET=1
439+ fi
440+ done
441+}
442+
443+check_first_slave_random_mac()
444+{
445+ RET=0
446+ # remove the first added slave and added it back
447+ ip -n "$s_ns" link set eth0 nomaster
448+ ip -n "$s_ns" link set eth0 master bond0
449+
450+ # the first slave should use random mac address
451+ eth0_mac=$(ip -n "$s_ns" -j link show eth0 | jq -r '.[]["address"]')
452+ [ "$eth0_mac" = "${mac[0]}" ] && RET=1
453+ log_test "bond fail_over_mac follow" "random first slave mac"
454+
455+ # remove the first slave, the permanent MAC address should be restored back
456+ ip -n "$s_ns" link set eth0 nomaster
457+ eth0_mac=$(ip -n "$s_ns" -j link show eth0 | jq -r '.[]["address"]')
458+ [ "$eth0_mac" != "${mac[0]}" ] && RET=1
459+}
460+
461+do_active_backup_failover()
462+{
463+ local active_slave=$(cmd_jq "ip -n ${s_ns} -d -j link show bond0" ".[].linkinfo.info_data.active_slave")
464+ ip -n ${s_ns} link set ${active_slave} down
465+ slowwait 2 active_slave_changed $active_slave
466+ ip -n ${s_ns} link set ${active_slave} up
467+}
468+
469+fail_over_mac()
470+{
471+ # Bring down the first interface on the switch to force the bond to
472+ # select another active interface instead of the first one that joined.
473+ ip -n "$g_ns" link set s0 down
474+
475+ # fail_over_mac none
476+ bond_reset "mode active-backup miimon 100 fail_over_mac 0"
477+ check_all_mac_same
478+ log_test "fail_over_mac 0" "all slaves have same mac"
479+ do_active_backup_failover
480+ check_all_mac_same
481+ log_test "fail_over_mac 0" "failover: all slaves have same mac"
482+
483+ # fail_over_mac active
484+ bond_reset "mode active-backup miimon 100 fail_over_mac 1"
485+ check_bond_mac_same_with_active
486+ log_test "fail_over_mac 1" "bond mac is same with active slave mac"
487+ check_backup_slave_mac_not_change
488+ log_test "fail_over_mac 1" "backup slave mac is not changed"
489+ do_active_backup_failover
490+ check_bond_mac_same_with_active
491+ log_test "fail_over_mac 1" "failover: bond mac is same with active slave mac"
492+ check_backup_slave_mac_not_change
493+ log_test "fail_over_mac 1" "failover: backup slave mac is not changed"
494+
495+ # fail_over_mac follow
496+ bond_reset "mode active-backup miimon 100 fail_over_mac 2"
497+ check_bond_mac_same_with_first
498+ log_test "fail_over_mac 2" "bond mac is same with first slave mac"
499+ check_bond_mac_same_with_active
500+ log_test "fail_over_mac 2" "bond mac is same with active slave mac"
501+ check_backup_slave_mac_inherit
502+ log_test "fail_over_mac 2" "backup slave mac inherit"
503+ do_active_backup_failover
504+ check_bond_mac_same_with_first
505+ log_test "fail_over_mac 2" "failover: bond mac is same with first slave mac"
506+ check_bond_mac_same_with_active
507+ log_test "fail_over_mac 2" "failover: bond mac is same with active slave mac"
508+ check_backup_slave_mac_inherit
509+ log_test "fail_over_mac 2" "failover: backup slave mac inherit"
510+ check_first_slave_random_mac
511+ log_test "fail_over_mac 2" "first slave mac random"
512+}
513+
514+vlan_over_bond_arp()
515+{
516+ local mode="$1"
517+ RET=0
518+
519+ bond_reset "mode $mode arp_interval 100 arp_ip_target 192.0.3.10"
520+ ip -n "${s_ns}" link add bond0.3 link bond0 type vlan id 3
521+ ip -n "${s_ns}" link set bond0.3 up
522+ ip -n "${s_ns}" addr add 192.0.3.1/24 dev bond0.3
523+ ip -n "${s_ns}" addr add 2001:db8::3:1/64 dev bond0.3
524+
525+ slowwait_for_counter 5 5 tc_rule_handle_stats_get \
526+ "dev eth0.3 ingress" 101 ".packets" "-n ${c_ns}" &> /dev/null || RET=1
527+ log_test "vlan over bond arp" "$mode"
528+}
529+
530+vlan_over_bond_ns()
531+{
532+ local mode="$1"
533+ RET=0
534+
535+ if skip_ns; then
536+ log_test_skip "vlan_over_bond ns" "$mode"
537+ return 0
538+ fi
539+
540+ bond_reset "mode $mode arp_interval 100 ns_ip6_target 2001:db8::3:10"
541+ ip -n "${s_ns}" link add bond0.3 link bond0 type vlan id 3
542+ ip -n "${s_ns}" link set bond0.3 up
543+ ip -n "${s_ns}" addr add 192.0.3.1/24 dev bond0.3
544+ ip -n "${s_ns}" addr add 2001:db8::3:1/64 dev bond0.3
545+
546+ slowwait_for_counter 5 5 tc_rule_handle_stats_get \
547+ "dev eth0.3 ingress" 102 ".packets" "-n ${c_ns}" &> /dev/null || RET=1
548+ log_test "vlan over bond ns" "$mode"
549+}
550+
551+vlan_over_bond()
552+{
553+ # add vlan 3 for client
554+ ip -n "${c_ns}" link add eth0.3 link eth0 type vlan id 3
555+ ip -n "${c_ns}" link set eth0.3 up
556+ ip -n "${c_ns}" addr add 192.0.3.10/24 dev eth0.3
557+ ip -n "${c_ns}" addr add 2001:db8::3:10/64 dev eth0.3
558+
559+ # Add tc rule to check the vlan pkts
560+ tc -n "${c_ns}" qdisc add dev eth0.3 clsact
561+ tc -n "${c_ns}" filter add dev eth0.3 ingress protocol arp \
562+ handle 101 flower skip_hw arp_op request \
563+ arp_sip 192.0.3.1 arp_tip 192.0.3.10 action pass
564+ tc -n "${c_ns}" filter add dev eth0.3 ingress protocol ipv6 \
565+ handle 102 flower skip_hw ip_proto icmpv6 \
566+ type 135 src_ip 2001:db8::3:1 action pass
567+
568+ vlan_over_bond_arp "active-backup"
569+ vlan_over_bond_ns "active-backup"
570+}
571+
379572 trap cleanup EXIT
380573
381574 setup_prepare
tools/testing/selftests/drivers/net/bonding/bond_topo_2d1c.sh+3−0
@@ -39,6 +39,8 @@ g_ip4="192.0.2.254" · 38 unmodified lines
3939 s_ip6="2001:db8::1"
4040 c_ip6="2001:db8::10"
4141 g_ip6="2001:db8::254"
42+mac[0]="00:0a:0b:0c:0d:01"
43+mac[1]="00:0a:0b:0c:0d:02"
4244
4345 gateway_create()
4446 {
@@ -62,6 +64,7 @@ server_create() · 17 unmodified lines
6264
6365 for i in $(seq 0 1); do
6466 ip -n ${s_ns} link add eth${i} type veth peer name s${i} netns ${g_ns}
67+ ip -n "${s_ns}" link set "eth${i}" addr "${mac[$i]}"
6568
6669 ip -n ${g_ns} link set s${i} up
6770 ip -n ${g_ns} link set s${i} master br0
tools/testing/selftests/drivers/net/bonding/bond_topo_3d1c.sh+2−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 # +-------------------------------------+
2727
2828 source bond_topo_2d1c.sh
29+mac[2]="00:0a:0b:0c:0d:03"
2930
3031 setup_prepare()
3132 {
@@ -36,6 +37,7 @@ setup_prepare() · 4 unmodified lines
3637 # Add the extra device as we use 3 down links for bond0
3738 local i=2
3839 ip -n ${s_ns} link add eth${i} type veth peer name s${i} netns ${g_ns}
40+ ip -n "${s_ns}" link set "eth${i}" addr "${mac[$i]}"
3941 ip -n ${g_ns} link set s${i} up
4042 ip -n ${g_ns} link set s${i} master br0
4143 ip -n ${s_ns} link set eth${i} master bond0
tools/testing/selftests/drivers/net/bonding/config+1−0
@@ -10,3 +10,4 @@ CONFIG_NET_CLS_MATCHALL=m · 9 unmodified lines
1010 CONFIG_NET_SCH_INGRESS=y
1111 CONFIG_NLMON=y
1212 CONFIG_VETH=y
13+CONFIG_VLAN_8021Q=m
tools/testing/selftests/net/mptcp/mptcp_connect.c+6−5
@@ -1093,6 +1093,7 @@ int main_loop_s(int listensock) · 1092 unmodified lines
10931093 struct pollfd polls;
10941094 socklen_t salen;
10951095 int remotesock;
1096+ int err = 0;
10961097 int fd = 0;
10971098
10981099 again:
@@ -1125,7 +1126,7 @@ again: · 26 unmodified lines
11251126 SOCK_TEST_TCPULP(remotesock, 0);
11261127
11271128 memset(&winfo, 0, sizeof(winfo));
1128− copyfd_io(fd, remotesock, 1, true, &winfo);
1129+ err = copyfd_io(fd, remotesock, 1, true, &winfo);
11291130 } else {
11301131 perror("accept");
11311132 return 1;
@@ -1134,10 +1135,10 @@ again: · 2 unmodified lines
11341135 if (cfg_input)
11351136 close(fd);
11361137
1137− if (--cfg_repeat > 0)
1138+ if (!err && --cfg_repeat > 0)
11381139 goto again;
11391140
1140− return 0;
1141+ return err;
11411142 }
11421143
11431144 static void init_rng(void)
@@ -1247,7 +1248,7 @@ void xdisconnect(int fd) · 103 unmodified lines
12471248 else
12481249 xerror("bad family");
12491250
1250− strcpy(cmd, "ss -M | grep -q ");
1251+ strcpy(cmd, "ss -Mnt | grep -q ");
12511252 cmdlen = strlen(cmd);
12521253 if (!inet_ntop(addr.ss_family, raw_addr, &cmd[cmdlen],
12531254 sizeof(cmd) - cmdlen))
@@ -1257,7 +1258,7 @@ void xdisconnect(int fd) · 3 unmodified lines
12571258
12581259 /*
12591260 * wait until the pending data is completely flushed and all
1260− * the MPTCP sockets reached the closed status.
1261+ * the sockets reached the closed status.
12611262 * disconnect will bypass/ignore/drop any pending data.
12621263 */
12631264 for (i = 0; ; i += msec_sleep) {
tools/testing/selftests/net/mptcp/mptcp_connect.sh+5−1
@@ -211,6 +211,11 @@ if $checksum; then · 210 unmodified lines
211211 done
212212 fi
213213
214+if $capture; then
215+ rndh="${ns1:4}"
216+ mptcp_lib_pr_info "Packet capture files will have this prefix: ${rndh}-"
217+fi
218+
214219 set_ethtool_flags() {
215220 local ns="$1"
216221 local dev="$2"
@@ -361,7 +366,6 @@ do_transfer() · 144 unmodified lines
361366
362367 if $capture; then
363368 local capuser
364− local rndh="${connector_ns:4}"
365369 if [ -z $SUDO_USER ] ; then
366370 capuser=""
367371 else
tools/testing/selftests/net/mptcp/mptcp_lib.sh+1−1
@@ -384,7 +384,7 @@ mptcp_lib_make_file() { · 383 unmodified lines
384384 mptcp_lib_print_file_err() {
385385 ls -l "${1}" 1>&2
386386 echo "Trailing bytes are: "
387− tail -c 27 "${1}"
387+ tail -c 32 "${1}" | od -x | head -n2
388388 }
389389
390390 # $1: input file ; $2: output file ; $3: what kind of file
tools/testing/selftests/net/mptcp/mptcp_sockopt.c+10−6
@@ -667,22 +667,26 @@ static void process_one_client(int fd, int pipefd) · 666 unmodified lines
667667
668668 do_getsockopts(&s, fd, ret, ret2);
669669 if (s.mptcpi_rcv_delta != (uint64_t)ret + 1)
670− xerror("mptcpi_rcv_delta %" PRIu64 ", expect %" PRIu64, s.mptcpi_rcv_delta, ret + 1, s.mptcpi_rcv_delta - ret);
670+ xerror("mptcpi_rcv_delta %" PRIu64 ", expect %" PRIu64 ", diff %" PRId64,
671+ s.mptcpi_rcv_delta, ret + 1, s.mptcpi_rcv_delta - (ret + 1));
671672
672673 /* be nice when running on top of older kernel */
673674 if (s.pkt_stats_avail) {
674675 if (s.last_sample.mptcpi_bytes_sent != ret2)
675− xerror("mptcpi_bytes_sent %" PRIu64 ", expect %" PRIu64,
676+ xerror("mptcpi_bytes_sent %" PRIu64 ", expect %" PRIu64
677+ ", diff %" PRId64,
676678 s.last_sample.mptcpi_bytes_sent, ret2,
677679 s.last_sample.mptcpi_bytes_sent - ret2);
678680 if (s.last_sample.mptcpi_bytes_received != ret)
679− xerror("mptcpi_bytes_received %" PRIu64 ", expect %" PRIu64,
681+ xerror("mptcpi_bytes_received %" PRIu64 ", expect %" PRIu64
682+ ", diff %" PRId64,
680683 s.last_sample.mptcpi_bytes_received, ret,
681684 s.last_sample.mptcpi_bytes_received - ret);
682685 if (s.last_sample.mptcpi_bytes_acked != ret)
683− xerror("mptcpi_bytes_acked %" PRIu64 ", expect %" PRIu64,
684− s.last_sample.mptcpi_bytes_acked, ret2,
685− s.last_sample.mptcpi_bytes_acked - ret2);
686+ xerror("mptcpi_bytes_acked %" PRIu64 ", expect %" PRIu64
687+ ", diff %" PRId64,
688+ s.last_sample.mptcpi_bytes_acked, ret,
689+ s.last_sample.mptcpi_bytes_acked - ret);
686690 }
687691
688692 close(fd);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c+7−0
@@ -188,6 +188,13 @@ static int capture_events(int fd, int event_group) · 187 unmodified lines
188188 fprintf(stderr, ",error:%u", *(__u8 *)RTA_DATA(attrs));
189189 else if (attrs->rta_type == MPTCP_ATTR_SERVER_SIDE)
190190 fprintf(stderr, ",server_side:%u", *(__u8 *)RTA_DATA(attrs));
191+ else if (attrs->rta_type == MPTCP_ATTR_FLAGS) {
192+ __u16 flags = *(__u16 *)RTA_DATA(attrs);
193+
194+ /* only print when present, easier */
195+ if (flags & MPTCP_PM_EV_FLAG_DENY_JOIN_ID0)
196+ fprintf(stderr, ",deny_join_id0:1");
197+ }
191198
192199 attrs = RTA_NEXT(attrs, msg_len);
193200 }
tools/testing/selftests/net/mptcp/userspace_pm.sh+11−3
@@ -201,6 +201,9 @@ make_connection() · 200 unmodified lines
201201 is_v6="v4"
202202 fi
203203
204+ # set this on the client side only: will not affect the rest
205+ ip netns exec "$ns2" sysctl -q net.mptcp.allow_join_initial_addr_port=0
206+
204207 :>"$client_evts"
205208 :>"$server_evts"
206209
@@ -223,23 +226,28 @@ make_connection() · 16 unmodified lines
223226 local client_token
224227 local client_port
225228 local client_serverside
229+ local client_nojoin
226230 local server_token
227231 local server_serverside
232+ local server_nojoin
228233
229234 client_token=$(mptcp_lib_evts_get_info token "$client_evts")
230235 client_port=$(mptcp_lib_evts_get_info sport "$client_evts")
231236 client_serverside=$(mptcp_lib_evts_get_info server_side "$client_evts")
237+ client_nojoin=$(mptcp_lib_evts_get_info deny_join_id0 "$client_evts")
232238 server_token=$(mptcp_lib_evts_get_info token "$server_evts")
233239 server_serverside=$(mptcp_lib_evts_get_info server_side "$server_evts")
240+ server_nojoin=$(mptcp_lib_evts_get_info deny_join_id0 "$server_evts")
234241
235242 print_test "Established IP${is_v6} MPTCP Connection ns2 => ns1"
236− if [ "$client_token" != "" ] && [ "$server_token" != "" ] && [ "$client_serverside" = 0 ] &&
237− [ "$server_serverside" = 1 ]
243+ if [ "${client_token}" != "" ] && [ "${server_token}" != "" ] &&
244+ [ "${client_serverside}" = 0 ] && [ "${server_serverside}" = 1 ] &&
245+ [ "${client_nojoin:-0}" = 0 ] && [ "${server_nojoin:-0}" = 1 ]
238246 then
239247 test_pass
240248 print_title "Connection info: ${client_addr}:${client_port} -> ${connect_addr}:${app_port}"
241249 else
242− test_fail "Expected tokens (c:${client_token} - s:${server_token}) and server (c:${client_serverside} - s:${server_serverside})"
250+ test_fail "Expected tokens (c:${client_token} - s:${server_token}), server (c:${client_serverside} - s:${server_serverside}), nojoin (c:${client_nojoin} - s:${server_nojoin})"
243251 mptcp_lib_result_print_all_tap
244252 exit ${KSFT_FAIL}
245253 fi
tools/testing/selftests/net/openvswitch/openvswitch.sh+81−7
@@ -25,6 +25,7 @@ tests=" · 24 unmodified lines
2525 nat_related_v4 ip4-nat-related: ICMP related matches work with SNAT
2626 netlink_checks ovsnl: validate netlink attrs and settings
2727 upcall_interfaces ovs: test the upcall interfaces
28+ tunnel_metadata ovs: test extraction of tunnel metadata
2829 drop_reason drop: test drop reasons are emitted
2930 psample psample: Sampling packets with psample"
3031
@@ -113,13 +114,13 @@ ovs_add_dp () { · 82 unmodified lines
113114 }
114115
115116 ovs_add_if () {
116− info "Adding IF to DP: br:$2 if:$3"
117− if [ "$4" != "-u" ]; then
118− ovs_sbx "$1" python3 $ovs_base/ovs-dpctl.py add-if "$2" "$3" \
119− || return 1
117+ info "Adding IF to DP: br:$3 if:$4 ($2)"
118+ if [ "$5" != "-u" ]; then
119+ ovs_sbx "$1" python3 $ovs_base/ovs-dpctl.py add-if \
120+ -t "$2" "$3" "$4" || return 1
120121 else
121122 python3 $ovs_base/ovs-dpctl.py add-if \
122− -u "$2" "$3" >$ovs_dir/$3.out 2>$ovs_dir/$3.err &
123+ -u -t "$2" "$3" "$4" >$ovs_dir/$4.out 2>$ovs_dir/$4.err &
123124 pid=$!
124125 on_exit "ovs_sbx $1 kill -TERM $pid 2>/dev/null"
125126 fi
@@ -166,9 +167,9 @@ ovs_add_netns_and_veths () { · 40 unmodified lines
166167 fi
167168
168169 if [ "$7" != "-u" ]; then
169− ovs_add_if "$1" "$2" "$4" || return 1
170+ ovs_add_if "$1" "netdev" "$2" "$4" || return 1
170171 else
171− ovs_add_if "$1" "$2" "$4" -u || return 1
172+ ovs_add_if "$1" "netdev" "$2" "$4" -u || return 1
172173 fi
173174
174175 if [ $TRACING -eq 1 ]; then
@@ -756,6 +757,79 @@ test_upcall_interfaces() { · 581 unmodified lines
756757 return 0
757758 }
758759
760+ovs_add_kernel_tunnel() {
761+ local sbxname=$1; shift
762+ local ns=$1; shift
763+ local tnl_type=$1; shift
764+ local name=$1; shift
765+ local addr=$1; shift
766+
767+ info "setting up kernel ${tnl_type} tunnel ${name}"
768+ ovs_sbx "${sbxname}" ip -netns ${ns} link add dev ${name} type ${tnl_type} $* || return 1
769+ on_exit "ovs_sbx ${sbxname} ip -netns ${ns} link del ${name} >/dev/null 2>&1"
770+ ovs_sbx "${sbxname}" ip -netns ${ns} addr add dev ${name} ${addr} || return 1
771+ ovs_sbx "${sbxname}" ip -netns ${ns} link set dev ${name} mtu 1450 up || return 1
772+}
773+
774+test_tunnel_metadata() {
775+ which arping >/dev/null 2>&1 || return $ksft_skip
776+
777+ sbxname="test_tunnel_metadata"
778+ sbx_add "${sbxname}" || return 1
779+
780+ info "setting up new DP"
781+ ovs_add_dp "${sbxname}" tdp0 -V 2:1 || return 1
782+
783+ ovs_add_netns_and_veths "${sbxname}" tdp0 tns left0 l0 \
784+ 172.31.110.1/24 || return 1
785+
786+ info "removing veth interface from openvswitch and setting IP"
787+ ovs_del_if "${sbxname}" tdp0 left0 || return 1
788+ ovs_sbx "${sbxname}" ip addr add 172.31.110.2/24 dev left0 || return 1
789+ ovs_sbx "${sbxname}" ip link set left0 up || return 1
790+
791+ info "setting up tunnel port in openvswitch"
792+ ovs_add_if "${sbxname}" "vxlan" tdp0 ovs-vxlan0 -u || return 1
793+ on_exit "ovs_sbx ${sbxname} ip link del ovs-vxlan0"
794+ ovs_wait ip link show ovs-vxlan0 &>/dev/null || return 1
795+ ovs_sbx "${sbxname}" ip link set ovs-vxlan0 up || return 1
796+
797+ configs=$(echo '
798+ 1 172.31.221.1/24 1155332 32 set udpcsum flags\(df\|csum\)
799+ 2 172.31.222.1/24 1234567 45 set noudpcsum flags\(df\)
800+ 3 172.31.223.1/24 1020304 23 unset udpcsum flags\(csum\)
801+ 4 172.31.224.1/24 1357986 15 unset noudpcsum' | sed '/^$/d')
802+
803+ while read -r i addr id ttl df csum flags; do
804+ ovs_add_kernel_tunnel "${sbxname}" tns vxlan vxlan${i} ${addr} \
805+ remote 172.31.110.2 id ${id} dstport 4789 \
806+ ttl ${ttl} df ${df} ${csum} || return 1
807+ done <<< "${configs}"
808+
809+ ovs_wait grep -q 'listening on upcall packet handler' \
810+ ${ovs_dir}/ovs-vxlan0.out || return 1
811+
812+ info "sending arping"
813+ for i in 1 2 3 4; do
814+ ovs_sbx "${sbxname}" ip netns exec tns \
815+ arping -I vxlan${i} 172.31.22${i}.2 -c 1 \
816+ >${ovs_dir}/arping.stdout 2>${ovs_dir}/arping.stderr
817+ done
818+
819+ info "checking that received decapsulated packets carry correct metadata"
820+ while read -r i addr id ttl df csum flags; do
821+ arp_hdr="arp\\(sip=172.31.22${i}.1,tip=172.31.22${i}.2,op=1,sha="
822+ addrs="src=172.31.110.1,dst=172.31.110.2"
823+ ports="tp_src=[0-9]*,tp_dst=4789"
824+ tnl_md="tunnel\\(tun_id=${id},${addrs},ttl=${ttl},${ports},${flags}\\)"
825+
826+ ovs_sbx "${sbxname}" grep -qE "MISS upcall.*${tnl_md}.*${arp_hdr}" \
827+ ${ovs_dir}/ovs-vxlan0.out || return 1
828+ done <<< "${configs}"
829+
830+ return 0
831+}
832+
759833 run_test() {
760834 (
761835 tname="$1"
tools/testing/selftests/net/packetdrill/tcp_fastopen_server_reset-after-disconnect.pkt+26−0
@@ -0,0 +1,26 @@
1+// SPDX-License-Identifier: GPL-2.0
2+`./defaults.sh
3+ ./set_sysctls.py /proc/sys/net/ipv4/tcp_fastopen=0x602 /proc/sys/net/ipv4/tcp_timestamps=0`
4+
5+ 0 socket(..., SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 3
6+ +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
7+ +0 bind(3, ..., ...) = 0
8+ +0 listen(3, 1) = 0
9+
10+ +0 < S 0:10(10) win 32792 <mss 1460,nop,nop,sackOK>
11+ +0 > S. 0:0(0) ack 11 win 65535 <mss 1460,nop,nop,sackOK>
12+
13+// sk->sk_state is TCP_SYN_RECV
14+ +.1 accept(3, ..., ...) = 4
15+
16+// tcp_disconnect() sets sk->sk_state to TCP_CLOSE
17+ +0 connect(4, AF_UNSPEC, ...) = 0
18+ +0 > R. 1:1(0) ack 11 win 65535
19+
20+// connect() sets sk->sk_state to TCP_SYN_SENT
21+ +0 fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
22+ +0 connect(4, ..., ...) = -1 EINPROGRESS (Operation is now in progress)
23+ +0 > S 0:0(0) win 65535 <mss 1460,nop,nop,sackOK,nop,wscale 8>
24+
25+// tp->fastopen_rsk must be NULL
26+ +1 > S 0:0(0) win 65535 <mss 1460,nop,nop,sackOK,nop,wscale 8>
tools/testing/selftests/net/tls.c+16−0
@@ -2770,6 +2770,22 @@ TEST_F(tls_err, poll_partial_rec_async) · 2769 unmodified lines
27702770 }
27712771 }
27722772
2773+/* Use OOB+large send to trigger copy mode due to memory pressure.
2774+ * OOB causes a short read.
2775+ */
2776+TEST_F(tls_err, oob_pressure)
2777+{
2778+ char buf[1<<16];
2779+ int i;
2780+
2781+ memrnd(buf, sizeof(buf));
2782+
2783+ EXPECT_EQ(send(self->fd2, buf, 5, MSG_OOB), 5);
2784+ EXPECT_EQ(send(self->fd2, buf, sizeof(buf), 0), sizeof(buf));
2785+ for (i = 0; i < 64; i++)
2786+ EXPECT_EQ(send(self->fd2, buf, 5, MSG_OOB), 5);
2787+}
2788+
27732789 TEST(non_established) {
27742790 struct tls12_crypto_info_aes_gcm_256 tls12;
27752791 struct sockaddr_in addr;

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