History

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

Pull networking fixes from Jakub Kicinski: "Including fixes from Bluetooth and wireless. A few more fixes for the locking changes trickling in. Nothing too alarming, I suspect those will continue for another release. Other than that things are slowing down nicely. Current release - fix to a fix: - Bluetooth: hci_event: use key encryption size when its known - tools: ynl-gen: allow multi-attr without nested-attributes again Current release - regressions: - locking fixes: - lock lower level devices when updating features - eth: bnxt_en: bring back rtnl_lock() in the bnxt_open() path - devmem: fix panic when Netlink socket closes after module unload Current release - new code bugs: - eth: txgbe: fixes for FW communication on new AML devices Previous releases - always broken: - sched: flush gso_skb list too during ->change(), avoid potential null-deref on reconfig - wifi: mt76: disable NAPI on driver removal - hv_netvsc: fix error 'nvsp_rndis_pkt_complete error status: 2'" * tag 'net-6.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (44 commits) net: devmem: fix kernel panic when netlink socket close after module unload tsnep: fix timestamping with a stacked DSA driver net/tls: fix kernel panic when alloc_page failed bnxt_en: bring back rtnl_lock() in the bnxt_open() path mlxsw: spectrum_router: Fix use-after-free when deleting GRE net devices wifi: mac80211: Set n_channels after allocating struct cfg80211_scan_request octeontx2-pf: Do not reallocate all ntuple filters wifi: mt76: mt7925: fix missing hdr_trans_tlv command for broadcast wtbl wifi: mt76: disable napi on driver removal Drivers: hv: vmbus: Remove vmbus_sendpacket_pagebuffer() hv_netvsc: Remove rmsg_pgcnt hv_netvsc: Preserve contiguous PFN grouping in the page buffer array hv_netvsc: Use vmbus_sendpacket_mpb_desc() to send VMBus messages Drivers: hv: Allow vmbus_sendpacket_mpb_desc() to create multiple ranges octeontx2-af: Fix CGX Receive counters net: ethernet: mtk_eth_soc: fix typo for declaration MT7988 ESW capability net: libwx: Fix FW mailbox unknown command net: libwx: Fix FW mailbox reply timeout net: txgbe: Fix to calculate EEPROM checksum for AML devices octeontx2-pf: macsec: Fix incorrect max transmit size in TX secy ...

Linus Torvalds committed 1 year ago

Commit ef935652 parents 088d132 0afc44d64 files · +698 −361Browse files

Unified · Split

64 files
  1. Documentation/netlink/specs/tc.yaml +6 −4
  2. Documentation/networking/timestamping.rst +3 −5
  3. drivers/hv/channel.c +3 −62
  4. drivers/net/dsa/b53/b53_common.c +33 −0
  5. drivers/net/dsa/b53/b53_regs.h +14 −0
  6. drivers/net/dsa/microchip/ksz_common.c +107 −28
  7. drivers/net/dsa/sja1105/sja1105_main.c +1 −5
  8. drivers/net/ethernet/broadcom/bnxt/bnxt.c +29 −7
  9. drivers/net/ethernet/cadence/macb_main.c +6 −13
  10. drivers/net/ethernet/engleder/tsnep_main.c +19 −11
  11. drivers/net/ethernet/marvell/octeontx2/af/cgx.c +5 −0
  12. drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c +2 −1
  13. drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +1 −0
  14. drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c +1 −0
  15. drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c +5 −5
  16. drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c +2 −1
  17. drivers/net/ethernet/mediatek/mtk_eth_soc.c +1 −1
  18. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +4 −0
  19. drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +3 −0
  20. drivers/net/ethernet/qlogic/qede/qede_main.c +1 −1
  21. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +5 −2
  22. drivers/net/ethernet/wangxun/libwx/wx_hw.c +8 −2
  23. drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c +7 −1
  24. drivers/net/ethernet/wangxun/txgbe/txgbe_type.h +2 −0
  25. drivers/net/hyperv/hyperv_net.h +12 −1
  26. drivers/net/hyperv/netvsc.c +48 −9
  27. drivers/net/hyperv/netvsc_drv.c +14 −48
  28. drivers/net/hyperv/rndis_filter.c +5 −19
  29. drivers/net/phy/micrel.c +0 −7
  30. drivers/net/wireless/mediatek/mt76/dma.c +1 −0
  31. drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +2 −2
  32. drivers/scsi/storvsc_drv.c +1 −0
  33. include/linux/hyperv.h +0 −7
  34. include/linux/micrel_phy.h +0 −1
  35. include/net/bluetooth/hci_core.h +1 −0
  36. include/net/sch_generic.h +15 −0
  37. net/batman-adv/hard-interface.c +18 −13
  38. net/bluetooth/hci_conn.c +24 −0
  39. net/bluetooth/hci_event.c +42 −31
  40. net/bluetooth/mgmt.c +6 −3
  41. net/core/dev.c +2 −0
  42. net/core/devmem.c +7 −0
  43. net/core/devmem.h +2 −0
  44. net/core/netdev-genl.c +11 −0
  45. net/mac80211/main.c +4 −2
  46. net/mctp/device.c +12 −5
  47. net/mctp/route.c +3 −1
  48. net/sched/sch_codel.c +1 −1
  49. net/sched/sch_fq.c +1 −1
  50. net/sched/sch_fq_codel.c +1 −1
  51. net/sched/sch_fq_pie.c +1 −1
  52. net/sched/sch_hhf.c +1 −1
  53. net/sched/sch_pie.c +1 −1
  54. net/tls/tls_strp.c +2 −1
  55. tools/net/ynl/pyynl/ethtool.py +15 −7
  56. tools/net/ynl/pyynl/ynl_gen_c.py +3 −4
  57. tools/testing/selftests/drivers/net/hw/ncdevmem.c +22 −33
  58. tools/testing/selftests/tc-testing/tc-tests/qdiscs/codel.json +24 −0
  59. tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq.json +22 −0
  60. tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq_codel.json +22 −0
  61. tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq_pie.json +22 −0
  62. tools/testing/selftests/tc-testing/tc-tests/qdiscs/hhf.json +22 −0
  63. tools/testing/selftests/tc-testing/tc-tests/qdiscs/pie.json +24 −0
  64. tools/testing/vsock/vsock_test.c +16 −12
Documentation/netlink/specs/tc.yaml+6−4
@@ -2017,7 +2017,8 @@ attribute-sets: · 2016 unmodified lines
20172017 attributes:
20182018 -
20192019 name: act
2020− type: nest
2020+ type: indexed-array
2021+ sub-type: nest
20212022 nested-attributes: tc-act-attrs
20222023 -
20232024 name: police
@@ -2250,7 +2251,8 @@ attribute-sets: · 226 unmodified lines
22502251 attributes:
22512252 -
22522253 name: act
2253− type: nest
2254+ type: indexed-array
2255+ sub-type: nest
22542256 nested-attributes: tc-act-attrs
22552257 -
22562258 name: police
@@ -2745,7 +2747,7 @@ attribute-sets: · 488 unmodified lines
27452747 type: u16
27462748 byte-order: big-endian
27472749 -
2748− name: key-l2-tpv3-sid
2750+ name: key-l2tpv3-sid
27492751 type: u32
27502752 byte-order: big-endian
27512753 -
@@ -3504,7 +3506,7 @@ attribute-sets: · 752 unmodified lines
35043506 name: rate64
35053507 type: u64
35063508 -
3507− name: prate4
3509+ name: prate64
35083510 type: u64
35093511 -
35103512 name: burst
Documentation/networking/timestamping.rst+3−5
@@ -811,11 +811,9 @@ Documentation/devicetree/bindings/ptp/timestamper.txt for more details. · 810 unmodified lines
811811 3.2.4 Other caveats for MAC drivers
812812 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
813813
814−Stacked PHCs, especially DSA (but not only) - since that doesn't require any
815−modification to MAC drivers, so it is more difficult to ensure correctness of
816−all possible code paths - is that they uncover bugs which were impossible to
817−trigger before the existence of stacked PTP clocks. One example has to do with
818−this line of code, already presented earlier::
814+The use of stacked PHCs may uncover MAC driver bugs which were impossible to
815+trigger without them. One example has to do with this line of code, already
816+presented earlier::
819817
820818 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
821819
drivers/hv/channel.c+3−62
@@ -1077,68 +1077,10 @@ int vmbus_sendpacket(struct vmbus_channel *channel, void *buffer, · 1076 unmodified lines
10771077 EXPORT_SYMBOL(vmbus_sendpacket);
10781078
10791079 /*
1080− * vmbus_sendpacket_pagebuffer - Send a range of single-page buffer
1081− * packets using a GPADL Direct packet type. This interface allows you
1082− * to control notifying the host. This will be useful for sending
1083− * batched data. Also the sender can control the send flags
1084− * explicitly.
1085− */
1086−int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
1087− struct hv_page_buffer pagebuffers[],
1088− u32 pagecount, void *buffer, u32 bufferlen,
1089− u64 requestid)
1090−{
1091− int i;
1092− struct vmbus_channel_packet_page_buffer desc;
1093− u32 descsize;
1094− u32 packetlen;
1095− u32 packetlen_aligned;
1096− struct kvec bufferlist[3];
1097− u64 aligned_data = 0;
1098−
1099− if (pagecount > MAX_PAGE_BUFFER_COUNT)
1100− return -EINVAL;
1101−
1102− /*
1103− * Adjust the size down since vmbus_channel_packet_page_buffer is the
1104− * largest size we support
1105− */
1106− descsize = sizeof(struct vmbus_channel_packet_page_buffer) -
1107− ((MAX_PAGE_BUFFER_COUNT - pagecount) *
1108− sizeof(struct hv_page_buffer));
1109− packetlen = descsize + bufferlen;
1110− packetlen_aligned = ALIGN(packetlen, sizeof(u64));
1111−
1112− /* Setup the descriptor */
1113− desc.type = VM_PKT_DATA_USING_GPA_DIRECT;
1114− desc.flags = VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED;
1115− desc.dataoffset8 = descsize >> 3; /* in 8-bytes granularity */
1116− desc.length8 = (u16)(packetlen_aligned >> 3);
1117− desc.transactionid = VMBUS_RQST_ERROR; /* will be updated in hv_ringbuffer_write() */
1118− desc.reserved = 0;
1119− desc.rangecount = pagecount;
1120−
1121− for (i = 0; i < pagecount; i++) {
1122− desc.range[i].len = pagebuffers[i].len;
1123− desc.range[i].offset = pagebuffers[i].offset;
1124− desc.range[i].pfn = pagebuffers[i].pfn;
1125− }
1126−
1127− bufferlist[0].iov_base = &desc;
1128− bufferlist[0].iov_len = descsize;
1129− bufferlist[1].iov_base = buffer;
1130− bufferlist[1].iov_len = bufferlen;
1131− bufferlist[2].iov_base = &aligned_data;
1132− bufferlist[2].iov_len = (packetlen_aligned - packetlen);
1133−
1134− return hv_ringbuffer_write(channel, bufferlist, 3, requestid, NULL);
1135−}
1136−EXPORT_SYMBOL_GPL(vmbus_sendpacket_pagebuffer);
1137−
1138−/*
1139− * vmbus_sendpacket_multipagebuffer - Send a multi-page buffer packet
1080+ * vmbus_sendpacket_mpb_desc - Send one or more multi-page buffer packets
11401081 * using a GPADL Direct packet type.
1141− * The buffer includes the vmbus descriptor.
1082+ * The desc argument must include space for the VMBus descriptor. The
1083+ * rangecount field must already be set.
11421084 */
11431085 int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel,
11441086 struct vmbus_packet_mpb_array *desc,
@@ -1160,7 +1102,6 @@ int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel, · 15 unmodified lines
11601102 desc->length8 = (u16)(packetlen_aligned >> 3);
11611103 desc->transactionid = VMBUS_RQST_ERROR; /* will be updated in hv_ringbuffer_write() */
11621104 desc->reserved = 0;
1163− desc->rangecount = 1;
11641105
11651106 bufferlist[0].iov_base = desc;
11661107 bufferlist[0].iov_len = desc_size;
drivers/net/dsa/b53/b53_common.c+33−0
@@ -326,6 +326,26 @@ static void b53_get_vlan_entry(struct b53_device *dev, u16 vid, · 325 unmodified lines
326326 }
327327 }
328328
329+static void b53_set_eap_mode(struct b53_device *dev, int port, int mode)
330+{
331+ u64 eap_conf;
332+
333+ if (is5325(dev) || is5365(dev) || dev->chip_id == BCM5389_DEVICE_ID)
334+ return;
335+
336+ b53_read64(dev, B53_EAP_PAGE, B53_PORT_EAP_CONF(port), &eap_conf);
337+
338+ if (is63xx(dev)) {
339+ eap_conf &= ~EAP_MODE_MASK_63XX;
340+ eap_conf |= (u64)mode << EAP_MODE_SHIFT_63XX;
341+ } else {
342+ eap_conf &= ~EAP_MODE_MASK;
343+ eap_conf |= (u64)mode << EAP_MODE_SHIFT;
344+ }
345+
346+ b53_write64(dev, B53_EAP_PAGE, B53_PORT_EAP_CONF(port), eap_conf);
347+}
348+
329349 static void b53_set_forwarding(struct b53_device *dev, int enable)
330350 {
331351 u8 mgmt;
@@ -586,6 +606,13 @@ int b53_setup_port(struct dsa_switch *ds, int port) · 254 unmodified lines
586606 b53_port_set_mcast_flood(dev, port, true);
587607 b53_port_set_learning(dev, port, false);
588608
609+ /* Force all traffic to go to the CPU port to prevent the ASIC from
610+ * trying to forward to bridged ports on matching FDB entries, then
611+ * dropping frames because it isn't allowed to forward there.
612+ */
613+ if (dsa_is_user_port(ds, port))
614+ b53_set_eap_mode(dev, port, EAP_MODE_SIMPLIFIED);
615+
589616 return 0;
590617 }
591618 EXPORT_SYMBOL(b53_setup_port);
@@ -2042,6 +2069,9 @@ int b53_br_join(struct dsa_switch *ds, int port, struct dsa_bridge bridge, · 1450 unmodified lines
20422069 pvlan |= BIT(i);
20432070 }
20442071
2072+ /* Disable redirection of unknown SA to the CPU port */
2073+ b53_set_eap_mode(dev, port, EAP_MODE_BASIC);
2074+
20452075 /* Configure the local port VLAN control membership to include
20462076 * remote ports and update the local port bitmask
20472077 */
@@ -2077,6 +2107,9 @@ void b53_br_leave(struct dsa_switch *ds, int port, struct dsa_bridge bridge) · 29 unmodified lines
20772107 pvlan &= ~BIT(i);
20782108 }
20792109
2110+ /* Enable redirection of unknown SA to the CPU port */
2111+ b53_set_eap_mode(dev, port, EAP_MODE_SIMPLIFIED);
2112+
20802113 b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), pvlan);
20812114 dev->ports[port].vlan_ctl_mask = pvlan;
20822115
drivers/net/dsa/b53/b53_regs.h+14−0
@@ -50,6 +50,9 @@ · 49 unmodified lines
5050 /* Jumbo Frame Registers */
5151 #define B53_JUMBO_PAGE 0x40
5252
53+/* EAP Registers */
54+#define B53_EAP_PAGE 0x42
55+
5356 /* EEE Control Registers Page */
5457 #define B53_EEE_PAGE 0x92
5558
@@ -480,6 +483,17 @@ · 424 unmodified lines
480483 #define JMS_MIN_SIZE 1518
481484 #define JMS_MAX_SIZE 9724
482485
486+/*************************************************************************
487+ * EAP Page Registers
488+ *************************************************************************/
489+#define B53_PORT_EAP_CONF(i) (0x20 + 8 * (i))
490+#define EAP_MODE_SHIFT 51
491+#define EAP_MODE_SHIFT_63XX 50
492+#define EAP_MODE_MASK (0x3ull << EAP_MODE_SHIFT)
493+#define EAP_MODE_MASK_63XX (0x3ull << EAP_MODE_SHIFT_63XX)
494+#define EAP_MODE_BASIC 0
495+#define EAP_MODE_SIMPLIFIED 3
496+
483497 /*************************************************************************
484498 * EEE Configuration Page Registers
485499 *************************************************************************/
drivers/net/dsa/microchip/ksz_common.c+107−28
@@ -265,16 +265,70 @@ static void ksz_phylink_mac_link_down(struct phylink_config *config, · 264 unmodified lines
265265 unsigned int mode,
266266 phy_interface_t interface);
267267
268+/**
269+ * ksz_phylink_mac_disable_tx_lpi() - Callback to signal LPI support (Dummy)
270+ * @config: phylink config structure
271+ *
272+ * This function is a dummy handler. See ksz_phylink_mac_enable_tx_lpi() for
273+ * a detailed explanation of EEE/LPI handling in KSZ switches.
274+ */
275+static void ksz_phylink_mac_disable_tx_lpi(struct phylink_config *config)
276+{
277+}
278+
279+/**
280+ * ksz_phylink_mac_enable_tx_lpi() - Callback to signal LPI support (Dummy)
281+ * @config: phylink config structure
282+ * @timer: timer value before entering LPI (unused)
283+ * @tx_clock_stop: whether to stop the TX clock in LPI mode (unused)
284+ *
285+ * This function signals to phylink that the driver architecture supports
286+ * LPI management, enabling phylink to control EEE advertisement during
287+ * negotiation according to IEEE Std 802.3 (Clause 78).
288+ *
289+ * Hardware Management of EEE/LPI State:
290+ * For KSZ switch ports with integrated PHYs (e.g., KSZ9893R ports 1-2),
291+ * observation and testing suggest that the actual EEE / Low Power Idle (LPI)
292+ * state transitions are managed autonomously by the hardware based on
293+ * the auto-negotiation results. (Note: While the datasheet describes EEE
294+ * operation based on negotiation, it doesn't explicitly detail the internal
295+ * MAC/PHY interaction, so autonomous hardware management of the MAC state
296+ * for LPI is inferred from observed behavior).
297+ * This hardware control, consistent with the switch's ability to operate
298+ * autonomously via strapping, means MAC-level software intervention is not
299+ * required or exposed for managing the LPI state once EEE is negotiated.
300+ * (Ref: KSZ9893R Data Sheet DS00002420D, primarily Section 4.7.5 explaining
301+ * EEE, also Sections 4.1.7 on Auto-Negotiation and 3.2.1 on Configuration
302+ * Straps).
303+ *
304+ * Additionally, ports configured as MAC interfaces (e.g., KSZ9893R port 3)
305+ * lack documented MAC-level LPI control.
306+ *
307+ * Therefore, this callback performs no action and serves primarily to inform
308+ * phylink of LPI awareness and to document the inferred hardware behavior.
309+ *
310+ * Returns: 0 (Always success)
311+ */
312+static int ksz_phylink_mac_enable_tx_lpi(struct phylink_config *config,
313+ u32 timer, bool tx_clock_stop)
314+{
315+ return 0;
316+}
317+
268318 static const struct phylink_mac_ops ksz88x3_phylink_mac_ops = {
269319 .mac_config = ksz88x3_phylink_mac_config,
270320 .mac_link_down = ksz_phylink_mac_link_down,
271321 .mac_link_up = ksz8_phylink_mac_link_up,
322+ .mac_disable_tx_lpi = ksz_phylink_mac_disable_tx_lpi,
323+ .mac_enable_tx_lpi = ksz_phylink_mac_enable_tx_lpi,
272324 };
273325
274326 static const struct phylink_mac_ops ksz8_phylink_mac_ops = {
275327 .mac_config = ksz_phylink_mac_config,
276328 .mac_link_down = ksz_phylink_mac_link_down,
277329 .mac_link_up = ksz8_phylink_mac_link_up,
330+ .mac_disable_tx_lpi = ksz_phylink_mac_disable_tx_lpi,
331+ .mac_enable_tx_lpi = ksz_phylink_mac_enable_tx_lpi,
278332 };
279333
280334 static const struct ksz_dev_ops ksz88xx_dev_ops = {
@@ -358,6 +412,8 @@ static const struct phylink_mac_ops ksz9477_phylink_mac_ops = { · 77 unmodified lines
358412 .mac_config = ksz_phylink_mac_config,
359413 .mac_link_down = ksz_phylink_mac_link_down,
360414 .mac_link_up = ksz9477_phylink_mac_link_up,
415+ .mac_disable_tx_lpi = ksz_phylink_mac_disable_tx_lpi,
416+ .mac_enable_tx_lpi = ksz_phylink_mac_enable_tx_lpi,
361417 };
362418
363419 static const struct ksz_dev_ops ksz9477_dev_ops = {
@@ -401,6 +457,8 @@ static const struct phylink_mac_ops lan937x_phylink_mac_ops = { · 37 unmodified lines
401457 .mac_config = ksz_phylink_mac_config,
402458 .mac_link_down = ksz_phylink_mac_link_down,
403459 .mac_link_up = ksz9477_phylink_mac_link_up,
460+ .mac_disable_tx_lpi = ksz_phylink_mac_disable_tx_lpi,
461+ .mac_enable_tx_lpi = ksz_phylink_mac_enable_tx_lpi,
404462 };
405463
406464 static const struct ksz_dev_ops lan937x_dev_ops = {
@@ -2016,6 +2074,18 @@ static void ksz_phylink_get_caps(struct dsa_switch *ds, int port, · 1609 unmodified lines
20162074
20172075 if (dev->dev_ops->get_caps)
20182076 dev->dev_ops->get_caps(dev, port, config);
2077+
2078+ if (ds->ops->support_eee && ds->ops->support_eee(ds, port)) {
2079+ memcpy(config->lpi_interfaces, config->supported_interfaces,
2080+ sizeof(config->lpi_interfaces));
2081+
2082+ config->lpi_capabilities = MAC_100FD;
2083+ if (dev->info->gbit_capable[port])
2084+ config->lpi_capabilities |= MAC_1000FD;
2085+
2086+ /* EEE is fully operational */
2087+ config->eee_enabled_default = true;
2088+ }
20192089 }
20202090
20212091 void ksz_r_mib_stats64(struct ksz_device *dev, int port)
@@ -3008,31 +3078,6 @@ static u32 ksz_get_phy_flags(struct dsa_switch *ds, int port) · 986 unmodified lines
30083078 if (!port)
30093079 return MICREL_KSZ8_P1_ERRATA;
30103080 break;
3011− case KSZ8567_CHIP_ID:
3012− /* KSZ8567R Errata DS80000752C Module 4 */
3013− case KSZ8765_CHIP_ID:
3014− case KSZ8794_CHIP_ID:
3015− case KSZ8795_CHIP_ID:
3016− /* KSZ879x/KSZ877x/KSZ876x Errata DS80000687C Module 2 */
3017− case KSZ9477_CHIP_ID:
3018− /* KSZ9477S Errata DS80000754A Module 4 */
3019− case KSZ9567_CHIP_ID:
3020− /* KSZ9567S Errata DS80000756A Module 4 */
3021− case KSZ9896_CHIP_ID:
3022− /* KSZ9896C Errata DS80000757A Module 3 */
3023− case KSZ9897_CHIP_ID:
3024− case LAN9646_CHIP_ID:
3025− /* KSZ9897R Errata DS80000758C Module 4 */
3026− /* Energy Efficient Ethernet (EEE) feature select must be manually disabled
3027− * The EEE feature is enabled by default, but it is not fully
3028− * operational. It must be manually disabled through register
3029− * controls. If not disabled, the PHY ports can auto-negotiate
3030− * to enable EEE, and this feature can cause link drops when
3031− * linked to another device supporting EEE.
3032− *
3033− * The same item appears in the errata for all switches above.
3034− */
3035− return MICREL_NO_EEE;
30363081 }
30373082
30383083 return 0;
@@ -3466,6 +3511,20 @@ static int ksz_max_mtu(struct dsa_switch *ds, int port) · 427 unmodified lines
34663511 return -EOPNOTSUPP;
34673512 }
34683513
3514+/**
3515+ * ksz_support_eee - Determine Energy Efficient Ethernet (EEE) support for a
3516+ * port
3517+ * @ds: Pointer to the DSA switch structure
3518+ * @port: Port number to check
3519+ *
3520+ * This function also documents devices where EEE was initially advertised but
3521+ * later withdrawn due to reliability issues, as described in official errata
3522+ * documents. These devices are explicitly listed to record known limitations,
3523+ * even if there is no technical necessity for runtime checks.
3524+ *
3525+ * Returns: true if the internal PHY on the given port supports fully
3526+ * operational EEE, false otherwise.
3527+ */
34693528 static bool ksz_support_eee(struct dsa_switch *ds, int port)
34703529 {
34713530 struct ksz_device *dev = ds->priv;
@@ -3475,15 +3534,35 @@ static bool ksz_support_eee(struct dsa_switch *ds, int port) · 3 unmodified lines
34753534
34763535 switch (dev->chip_id) {
34773536 case KSZ8563_CHIP_ID:
3537+ case KSZ9563_CHIP_ID:
3538+ case KSZ9893_CHIP_ID:
3539+ return true;
34783540 case KSZ8567_CHIP_ID:
3541+ /* KSZ8567R Errata DS80000752C Module 4 */
3542+ case KSZ8765_CHIP_ID:
3543+ case KSZ8794_CHIP_ID:
3544+ case KSZ8795_CHIP_ID:
3545+ /* KSZ879x/KSZ877x/KSZ876x Errata DS80000687C Module 2 */
34793546 case KSZ9477_CHIP_ID:
3480− case KSZ9563_CHIP_ID:
3547+ /* KSZ9477S Errata DS80000754A Module 4 */
34813548 case KSZ9567_CHIP_ID:
3482− case KSZ9893_CHIP_ID:
3549+ /* KSZ9567S Errata DS80000756A Module 4 */
34833550 case KSZ9896_CHIP_ID:
3551+ /* KSZ9896C Errata DS80000757A Module 3 */
34843552 case KSZ9897_CHIP_ID:
34853553 case LAN9646_CHIP_ID:
3486− return true;
3554+ /* KSZ9897R Errata DS80000758C Module 4 */
3555+ /* Energy Efficient Ethernet (EEE) feature select must be
3556+ * manually disabled
3557+ * The EEE feature is enabled by default, but it is not fully
3558+ * operational. It must be manually disabled through register
3559+ * controls. If not disabled, the PHY ports can auto-negotiate
3560+ * to enable EEE, and this feature can cause link drops when
3561+ * linked to another device supporting EEE.
3562+ *
3563+ * The same item appears in the errata for all switches above.
3564+ */
3565+ break;
34873566 }
34883567
34893568 return false;
drivers/net/dsa/sja1105/sja1105_main.c+1−5
@@ -2081,6 +2081,7 @@ static void sja1105_bridge_stp_state_set(struct dsa_switch *ds, int port, · 2080 unmodified lines
20812081 switch (state) {
20822082 case BR_STATE_DISABLED:
20832083 case BR_STATE_BLOCKING:
2084+ case BR_STATE_LISTENING:
20842085 /* From UM10944 description of DRPDTAG (why put this there?):
20852086 * "Management traffic flows to the port regardless of the state
20862087 * of the INGRESS flag". So BPDUs are still be allowed to pass.
@@ -2090,11 +2091,6 @@ static void sja1105_bridge_stp_state_set(struct dsa_switch *ds, int port, · 3 unmodified lines
20902091 mac[port].egress = false;
20912092 mac[port].dyn_learn = false;
20922093 break;
2093− case BR_STATE_LISTENING:
2094− mac[port].ingress = true;
2095− mac[port].egress = false;
2096− mac[port].dyn_learn = false;
2097− break;
20982094 case BR_STATE_LEARNING:
20992095 mac[port].ingress = true;
21002096 mac[port].egress = false;
drivers/net/ethernet/broadcom/bnxt/bnxt.c+29−7
@@ -14013,13 +14013,28 @@ static void bnxt_unlock_sp(struct bnxt *bp) · 14012 unmodified lines
1401314013 netdev_unlock(bp->dev);
1401414014 }
1401514015
14016+/* Same as bnxt_lock_sp() with additional rtnl_lock */
14017+static void bnxt_rtnl_lock_sp(struct bnxt *bp)
14018+{
14019+ clear_bit(BNXT_STATE_IN_SP_TASK, &bp->state);
14020+ rtnl_lock();
14021+ netdev_lock(bp->dev);
14022+}
14023+
14024+static void bnxt_rtnl_unlock_sp(struct bnxt *bp)
14025+{
14026+ set_bit(BNXT_STATE_IN_SP_TASK, &bp->state);
14027+ netdev_unlock(bp->dev);
14028+ rtnl_unlock();
14029+}
14030+
1401614031 /* Only called from bnxt_sp_task() */
1401714032 static void bnxt_reset(struct bnxt *bp, bool silent)
1401814033 {
14019− bnxt_lock_sp(bp);
14034+ bnxt_rtnl_lock_sp(bp);
1402014035 if (test_bit(BNXT_STATE_OPEN, &bp->state))
1402114036 bnxt_reset_task(bp, silent);
14022− bnxt_unlock_sp(bp);
14037+ bnxt_rtnl_unlock_sp(bp);
1402314038 }
1402414039
1402514040 /* Only called from bnxt_sp_task() */
@@ -14027,9 +14042,9 @@ static void bnxt_rx_ring_reset(struct bnxt *bp) · 1 unmodified line
1402714042 {
1402814043 int i;
1402914044
14030− bnxt_lock_sp(bp);
14045+ bnxt_rtnl_lock_sp(bp);
1403114046 if (!test_bit(BNXT_STATE_OPEN, &bp->state)) {
14032− bnxt_unlock_sp(bp);
14047+ bnxt_rtnl_unlock_sp(bp);
1403314048 return;
1403414049 }
1403514050 /* Disable and flush TPA before resetting the RX ring */
@@ -14068,7 +14083,7 @@ static void bnxt_rx_ring_reset(struct bnxt *bp) · 32 unmodified lines
1406814083 }
1406914084 if (bp->flags & BNXT_FLAG_TPA)
1407014085 bnxt_set_tpa(bp, true);
14071− bnxt_unlock_sp(bp);
14086+ bnxt_rtnl_unlock_sp(bp);
1407214087 }
1407314088
1407414089 static void bnxt_fw_fatal_close(struct bnxt *bp)
@@ -14960,15 +14975,17 @@ static void bnxt_fw_reset_task(struct work_struct *work) · 885 unmodified lines
1496014975 bp->fw_reset_state = BNXT_FW_RESET_STATE_OPENING;
1496114976 fallthrough;
1496214977 case BNXT_FW_RESET_STATE_OPENING:
14963− while (!netdev_trylock(bp->dev)) {
14978+ while (!rtnl_trylock()) {
1496414979 bnxt_queue_fw_reset_work(bp, HZ / 10);
1496514980 return;
1496614981 }
14982+ netdev_lock(bp->dev);
1496714983 rc = bnxt_open(bp->dev);
1496814984 if (rc) {
1496914985 netdev_err(bp->dev, "bnxt_open() failed during FW reset\n");
1497014986 bnxt_fw_reset_abort(bp, rc);
1497114987 netdev_unlock(bp->dev);
14988+ rtnl_unlock();
1497214989 goto ulp_start;
1497314990 }
1497414991
@@ -14988,6 +15005,7 @@ static void bnxt_fw_reset_task(struct work_struct *work) · 13 unmodified lines
1498815005 bnxt_dl_health_fw_status_update(bp, true);
1498915006 }
1499015007 netdev_unlock(bp->dev);
15008+ rtnl_unlock();
1499115009 bnxt_ulp_start(bp, 0);
1499215010 bnxt_reenable_sriov(bp);
1499315011 netdev_lock(bp->dev);
@@ -15936,7 +15954,7 @@ err_reset: · 942 unmodified lines
1593615954 rc);
1593715955 napi_enable_locked(&bnapi->napi);
1593815956 bnxt_db_nq_arm(bp, &cpr->cp_db, cpr->cp_raw_cons);
15939− bnxt_reset_task(bp, true);
15957+ netif_close(dev);
1594015958 return rc;
1594115959 }
1594215960
@@ -16752,6 +16770,7 @@ static int bnxt_resume(struct device *device) · 809 unmodified lines
1675216770 struct bnxt *bp = netdev_priv(dev);
1675316771 int rc = 0;
1675416772
16773+ rtnl_lock();
1675516774 netdev_lock(dev);
1675616775 rc = pci_enable_device(bp->pdev);
1675716776 if (rc) {
@@ -16796,6 +16815,7 @@ static int bnxt_resume(struct device *device) · 38 unmodified lines
1679616815
1679716816 resume_exit:
1679816817 netdev_unlock(bp->dev);
16818+ rtnl_unlock();
1679916819 bnxt_ulp_start(bp, rc);
1680016820 if (!rc)
1680116821 bnxt_reenable_sriov(bp);
@@ -16961,6 +16981,7 @@ static void bnxt_io_resume(struct pci_dev *pdev) · 159 unmodified lines
1696116981 int err;
1696216982
1696316983 netdev_info(bp->dev, "PCI Slot Resume\n");
16984+ rtnl_lock();
1696416985 netdev_lock(netdev);
1696516986
1696616987 err = bnxt_hwrm_func_qcaps(bp);
@@ -16978,6 +16999,7 @@ static void bnxt_io_resume(struct pci_dev *pdev) · 11 unmodified lines
1697816999 netif_device_attach(netdev);
1697917000
1698017001 netdev_unlock(netdev);
17002+ rtnl_unlock();
1698117003 bnxt_ulp_start(bp, err);
1698217004 if (!err)
1698317005 bnxt_reenable_sriov(bp);
drivers/net/ethernet/cadence/macb_main.c+6−13
@@ -997,22 +997,15 @@ static void macb_update_stats(struct macb *bp) · 996 unmodified lines
997997
998998 static int macb_halt_tx(struct macb *bp)
999999 {
1000− unsigned long halt_time, timeout;
1001− u32 status;
1000+ u32 status;
10021001
10031002 macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(THALT));
10041003
1005− timeout = jiffies + usecs_to_jiffies(MACB_HALT_TIMEOUT);
1006− do {
1007− halt_time = jiffies;
1008− status = macb_readl(bp, TSR);
1009− if (!(status & MACB_BIT(TGO)))
1010− return 0;
1011−
1012− udelay(250);
1013− } while (time_before(halt_time, timeout));
1014−
1015− return -ETIMEDOUT;
1004+ /* Poll TSR until TGO is cleared or timeout. */
1005+ return read_poll_timeout_atomic(macb_readl, status,
1006+ !(status & MACB_BIT(TGO)),
1007+ 250, MACB_HALT_TIMEOUT, false,
1008+ bp, TSR);
10161009 }
10171010
10181011 static void macb_tx_unmap(struct macb *bp, struct macb_tx_skb *tx_skb, int budget)
drivers/net/ethernet/engleder/tsnep_main.c+19−11
@@ -67,6 +67,8 @@ · 66 unmodified lines
6767 #define TSNEP_TX_TYPE_XDP_NDO_MAP_PAGE (TSNEP_TX_TYPE_XDP_NDO | TSNEP_TX_TYPE_MAP_PAGE)
6868 #define TSNEP_TX_TYPE_XDP (TSNEP_TX_TYPE_XDP_TX | TSNEP_TX_TYPE_XDP_NDO)
6969 #define TSNEP_TX_TYPE_XSK BIT(12)
70+#define TSNEP_TX_TYPE_TSTAMP BIT(13)
71+#define TSNEP_TX_TYPE_SKB_TSTAMP (TSNEP_TX_TYPE_SKB | TSNEP_TX_TYPE_TSTAMP)
7072
7173 #define TSNEP_XDP_TX BIT(0)
7274 #define TSNEP_XDP_REDIRECT BIT(1)
@@ -386,8 +388,7 @@ static void tsnep_tx_activate(struct tsnep_tx *tx, int index, int length, · 313 unmodified lines
386388 if (entry->skb) {
387389 entry->properties = length & TSNEP_DESC_LENGTH_MASK;
388390 entry->properties |= TSNEP_DESC_INTERRUPT_FLAG;
389− if ((entry->type & TSNEP_TX_TYPE_SKB) &&
390− (skb_shinfo(entry->skb)->tx_flags & SKBTX_IN_PROGRESS))
391+ if ((entry->type & TSNEP_TX_TYPE_SKB_TSTAMP) == TSNEP_TX_TYPE_SKB_TSTAMP)
391392 entry->properties |= TSNEP_DESC_EXTENDED_WRITEBACK_FLAG;
392393
393394 /* toggle user flag to prevent false acknowledge
@@ -479,7 +480,8 @@ static int tsnep_tx_map_frag(skb_frag_t *frag, struct tsnep_tx_entry *entry, · 85 unmodified lines
479480 return mapped;
480481 }
481482
482−static int tsnep_tx_map(struct sk_buff *skb, struct tsnep_tx *tx, int count)
483+static int tsnep_tx_map(struct sk_buff *skb, struct tsnep_tx *tx, int count,
484+ bool do_tstamp)
483485 {
484486 struct device *dmadev = tx->adapter->dmadev;
485487 struct tsnep_tx_entry *entry;
@@ -505,6 +507,9 @@ static int tsnep_tx_map(struct sk_buff *skb, struct tsnep_tx *tx, int count) · 19 unmodified lines
505507 entry->type = TSNEP_TX_TYPE_SKB_INLINE;
506508 mapped = 0;
507509 }
510+
511+ if (do_tstamp)
512+ entry->type |= TSNEP_TX_TYPE_TSTAMP;
508513 } else {
509514 skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1];
510515
@@ -558,11 +563,12 @@ static int tsnep_tx_unmap(struct tsnep_tx *tx, int index, int count) · 47 unmodified lines
558563 static netdev_tx_t tsnep_xmit_frame_ring(struct sk_buff *skb,
559564 struct tsnep_tx *tx)
560565 {
561− int count = 1;
562566 struct tsnep_tx_entry *entry;
567+ bool do_tstamp = false;
568+ int count = 1;
563569 int length;
564− int i;
565570 int retval;
571+ int i;
566572
567573 if (skb_shinfo(skb)->nr_frags > 0)
568574 count += skb_shinfo(skb)->nr_frags;
@@ -579,7 +585,13 @@ static netdev_tx_t tsnep_xmit_frame_ring(struct sk_buff *skb, · 10 unmodified lines
579585 entry = &tx->entry[tx->write];
580586 entry->skb = skb;
581587
582− retval = tsnep_tx_map(skb, tx, count);
588+ if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
589+ tx->adapter->hwtstamp_config.tx_type == HWTSTAMP_TX_ON) {
590+ skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
591+ do_tstamp = true;
592+ }
593+
594+ retval = tsnep_tx_map(skb, tx, count, do_tstamp);
583595 if (retval < 0) {
584596 tsnep_tx_unmap(tx, tx->write, count);
585597 dev_kfree_skb_any(entry->skb);
@@ -591,9 +603,6 @@ static netdev_tx_t tsnep_xmit_frame_ring(struct sk_buff *skb, · 5 unmodified lines
591603 }
592604 length = retval;
593605
594− if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)
595− skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
596−
597606 for (i = 0; i < count; i++)
598607 tsnep_tx_activate(tx, (tx->write + i) & TSNEP_RING_MASK, length,
599608 i == count - 1);
@@ -844,8 +853,7 @@ static bool tsnep_tx_poll(struct tsnep_tx *tx, int napi_budget) · 244 unmodified lines
844853
845854 length = tsnep_tx_unmap(tx, tx->read, count);
846855
847− if ((entry->type & TSNEP_TX_TYPE_SKB) &&
848− (skb_shinfo(entry->skb)->tx_flags & SKBTX_IN_PROGRESS) &&
856+ if (((entry->type & TSNEP_TX_TYPE_SKB_TSTAMP) == TSNEP_TX_TYPE_SKB_TSTAMP) &&
849857 (__le32_to_cpu(entry->desc_wb->properties) &
850858 TSNEP_DESC_EXTENDED_WRITEBACK_FLAG)) {
851859 struct skb_shared_hwtstamps hwtstamps;
drivers/net/ethernet/marvell/octeontx2/af/cgx.c+5−0
@@ -717,6 +717,11 @@ int cgx_get_rx_stats(void *cgxd, int lmac_id, int idx, u64 *rx_stat) · 716 unmodified lines
717717
718718 if (!is_lmac_valid(cgx, lmac_id))
719719 return -ENODEV;
720+
721+ /* pass lmac as 0 for CGX_CMR_RX_STAT9-12 */
722+ if (idx >= CGX_RX_STAT_GLOBAL_INDEX)
723+ lmac_id = 0;
724+
720725 *rx_stat = cgx_read(cgx, lmac_id, CGXX_CMRX_RX_STAT0 + (idx * 8));
721726 return 0;
722727 }
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c+2−1
@@ -531,7 +531,8 @@ static int cn10k_mcs_write_tx_secy(struct otx2_nic *pfvf, · 530 unmodified lines
531531 if (sw_tx_sc->encrypt)
532532 sectag_tci |= (MCS_TCI_E | MCS_TCI_C);
533533
534− policy = FIELD_PREP(MCS_TX_SECY_PLCY_MTU, secy->netdev->mtu);
534+ policy = FIELD_PREP(MCS_TX_SECY_PLCY_MTU,
535+ pfvf->netdev->mtu + OTX2_ETH_HLEN);
535536 /* Write SecTag excluding AN bits(1..0) */
536537 policy |= FIELD_PREP(MCS_TX_SECY_PLCY_ST_TCI, sectag_tci >> 2);
537538 policy |= FIELD_PREP(MCS_TX_SECY_PLCY_ST_OFFSET, tag_offset);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h+1−0
@@ -356,6 +356,7 @@ struct otx2_flow_config { · 355 unmodified lines
356356 struct list_head flow_list_tc;
357357 u8 ucast_flt_cnt;
358358 bool ntuple;
359+ u16 ntuple_cnt;
359360 };
360361
361362 struct dev_hw_ops {
drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c+1−0
@@ -41,6 +41,7 @@ static int otx2_dl_mcam_count_set(struct devlink *devlink, u32 id, · 40 unmodified lines
4141 if (!pfvf->flow_cfg)
4242 return 0;
4343
44+ pfvf->flow_cfg->ntuple_cnt = ctx->val.vu16;
4445 otx2_alloc_mcam_entries(pfvf, ctx->val.vu16);
4546
4647 return 0;
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c+5−5
@@ -315,7 +315,7 @@ static void otx2_get_pauseparam(struct net_device *netdev, · 314 unmodified lines
315315 struct otx2_nic *pfvf = netdev_priv(netdev);
316316 struct cgx_pause_frm_cfg *req, *rsp;
317317
318− if (is_otx2_lbkvf(pfvf->pdev))
318+ if (is_otx2_lbkvf(pfvf->pdev) || is_otx2_sdp_rep(pfvf->pdev))
319319 return;
320320
321321 mutex_lock(&pfvf->mbox.lock);
@@ -347,7 +347,7 @@ static int otx2_set_pauseparam(struct net_device *netdev, · 25 unmodified lines
347347 if (pause->autoneg)
348348 return -EOPNOTSUPP;
349349
350− if (is_otx2_lbkvf(pfvf->pdev))
350+ if (is_otx2_lbkvf(pfvf->pdev) || is_otx2_sdp_rep(pfvf->pdev))
351351 return -EOPNOTSUPP;
352352
353353 if (pause->rx_pause)
@@ -941,8 +941,8 @@ static u32 otx2_get_link(struct net_device *netdev) · 587 unmodified lines
941941 {
942942 struct otx2_nic *pfvf = netdev_priv(netdev);
943943
944− /* LBK link is internal and always UP */
945− if (is_otx2_lbkvf(pfvf->pdev))
944+ /* LBK and SDP links are internal and always UP */
945+ if (is_otx2_lbkvf(pfvf->pdev) || is_otx2_sdp_rep(pfvf->pdev))
946946 return 1;
947947 return pfvf->linfo.link_up;
948948 }
@@ -1413,7 +1413,7 @@ static int otx2vf_get_link_ksettings(struct net_device *netdev, · 464 unmodified lines
14131413 {
14141414 struct otx2_nic *pfvf = netdev_priv(netdev);
14151415
1416− if (is_otx2_lbkvf(pfvf->pdev)) {
1416+ if (is_otx2_lbkvf(pfvf->pdev) || is_otx2_sdp_rep(pfvf->pdev)) {
14171417 cmd->base.duplex = DUPLEX_FULL;
14181418 cmd->base.speed = SPEED_100000;
14191419 } else {
drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c+2−1
@@ -247,7 +247,7 @@ int otx2_mcam_entry_init(struct otx2_nic *pfvf) · 246 unmodified lines
247247 mutex_unlock(&pfvf->mbox.lock);
248248
249249 /* Allocate entries for Ntuple filters */
250− count = otx2_alloc_mcam_entries(pfvf, OTX2_DEFAULT_FLOWCOUNT);
250+ count = otx2_alloc_mcam_entries(pfvf, flow_cfg->ntuple_cnt);
251251 if (count <= 0) {
252252 otx2_clear_ntuple_flow_info(pfvf, flow_cfg);
253253 return 0;
@@ -307,6 +307,7 @@ int otx2_mcam_flow_init(struct otx2_nic *pf) · 53 unmodified lines
307307 INIT_LIST_HEAD(&pf->flow_cfg->flow_list_tc);
308308
309309 pf->flow_cfg->ucast_flt_cnt = OTX2_DEFAULT_UNICAST_FLOWS;
310+ pf->flow_cfg->ntuple_cnt = OTX2_DEFAULT_FLOWCOUNT;
310311
311312 /* Allocate bare minimum number of MCAM entries needed for
312313 * unicast and ntuple filters.
drivers/net/ethernet/mediatek/mtk_eth_soc.c+1−1
@@ -4748,7 +4748,7 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) · 4747 unmodified lines
47484748 }
47494749
47504750 if (mtk_is_netsys_v3_or_greater(mac->hw) &&
4751− MTK_HAS_CAPS(mac->hw->soc->caps, MTK_ESW_BIT) &&
4751+ MTK_HAS_CAPS(mac->hw->soc->caps, MTK_ESW) &&
47524752 id == MTK_GMAC1_ID) {
47534753 mac->phylink_config.mac_capabilities = MAC_ASYM_PAUSE |
47544754 MAC_SYM_PAUSE |
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+4−0
@@ -4349,6 +4349,10 @@ static netdev_features_t mlx5e_fix_uplink_rep_features(struct net_device *netdev · 4348 unmodified lines
43494349 if (netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER)
43504350 netdev_warn(netdev, "Disabling HW_VLAN CTAG FILTERING, not supported in switchdev mode\n");
43514351
4352+ features &= ~NETIF_F_HW_MACSEC;
4353+ if (netdev->features & NETIF_F_HW_MACSEC)
4354+ netdev_warn(netdev, "Disabling HW MACsec offload, not supported in switchdev mode\n");
4355+
43524356 return features;
43534357 }
43544358
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+3−0
@@ -3014,6 +3014,9 @@ static int mlxsw_sp_neigh_rif_made_sync(struct mlxsw_sp *mlxsw_sp, · 3013 unmodified lines
30143014 .rif = rif,
30153015 };
30163016
3017+ if (!mlxsw_sp_dev_lower_is_port(mlxsw_sp_rif_dev(rif)))
3018+ return 0;
3019+
30173020 neigh_for_each(&arp_tbl, mlxsw_sp_neigh_rif_made_sync_each, &rms);
30183021 if (rms.err)
30193022 goto err_arp;
drivers/net/ethernet/qlogic/qede/qede_main.c+1−1
@@ -203,7 +203,7 @@ static struct pci_driver qede_pci_driver = { · 202 unmodified lines
203203 };
204204
205205 static struct qed_eth_cb_ops qede_ll_ops = {
206− {
206+ .common = {
207207 #ifdef CONFIG_RFS_ACCEL
208208 .arfs_filter_op = qede_arfs_filter_op,
209209 #endif
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c+5−2
@@ -1484,8 +1484,11 @@ static int qlcnic_sriov_channel_cfg_cmd(struct qlcnic_adapter *adapter, u8 cmd_o · 1483 unmodified lines
14841484 }
14851485
14861486 cmd_op = (cmd.rsp.arg[0] & 0xff);
1487− if (cmd.rsp.arg[0] >> 25 == 2)
1488− return 2;
1487+ if (cmd.rsp.arg[0] >> 25 == 2) {
1488+ ret = 2;
1489+ goto out;
1490+ }
1491+
14891492 if (cmd_op == QLCNIC_BC_CMD_CHANNEL_INIT)
14901493 set_bit(QLC_BC_VF_STATE, &vf->state);
14911494 else
drivers/net/ethernet/wangxun/libwx/wx_hw.c+8−2
@@ -434,14 +434,20 @@ static int wx_host_interface_command_r(struct wx *wx, u32 *buffer, · 433 unmodified lines
434434 wr32m(wx, WX_SW2FW_MBOX_CMD, WX_SW2FW_MBOX_CMD_VLD, WX_SW2FW_MBOX_CMD_VLD);
435435
436436 /* polling reply from FW */
437− err = read_poll_timeout(wx_poll_fw_reply, reply, reply, 1000, 50000,
438− true, wx, buffer, send_cmd);
437+ err = read_poll_timeout(wx_poll_fw_reply, reply, reply, 2000,
438+ timeout * 1000, true, wx, buffer, send_cmd);
439439 if (err) {
440440 wx_err(wx, "Polling from FW messages timeout, cmd: 0x%x, index: %d\n",
441441 send_cmd, wx->swfw_index);
442442 goto rel_out;
443443 }
444444
445+ if (hdr->cmd_or_resp.ret_status == 0x80) {
446+ wx_err(wx, "Unknown FW command: 0x%x\n", send_cmd);
447+ err = -EINVAL;
448+ goto rel_out;
449+ }
450+
445451 /* expect no reply from FW then return */
446452 if (!return_data)
447453 goto rel_out;
drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c+7−1
@@ -99,9 +99,15 @@ static int txgbe_calc_eeprom_checksum(struct wx *wx, u16 *checksum) · 98 unmodified lines
9999 }
100100 local_buffer = eeprom_ptrs;
101101
102− for (i = 0; i < TXGBE_EEPROM_LAST_WORD; i++)
102+ for (i = 0; i < TXGBE_EEPROM_LAST_WORD; i++) {
103+ if (wx->mac.type == wx_mac_aml) {
104+ if (i >= TXGBE_EEPROM_I2C_SRART_PTR &&
105+ i < TXGBE_EEPROM_I2C_END_PTR)
106+ local_buffer[i] = 0xffff;
107+ }
103108 if (i != wx->eeprom.sw_region_offset + TXGBE_EEPROM_CHECKSUM)
104109 *checksum += local_buffer[i];
110+ }
105111
106112 kvfree(eeprom_ptrs);
107113
drivers/net/ethernet/wangxun/txgbe/txgbe_type.h+2−0
@@ -158,6 +158,8 @@ · 157 unmodified lines
158158 #define TXGBE_EEPROM_VERSION_L 0x1D
159159 #define TXGBE_EEPROM_VERSION_H 0x1E
160160 #define TXGBE_ISCSI_BOOT_CONFIG 0x07
161+#define TXGBE_EEPROM_I2C_SRART_PTR 0x580
162+#define TXGBE_EEPROM_I2C_END_PTR 0x800
161163
162164 #define TXGBE_MAX_MSIX_VECTORS 64
163165 #define TXGBE_MAX_FDIR_INDICES 63
drivers/net/hyperv/hyperv_net.h+12−1
@@ -158,7 +158,6 @@ struct hv_netvsc_packet { · 157 unmodified lines
158158 u8 cp_partial; /* partial copy into send buffer */
159159
160160 u8 rmsg_size; /* RNDIS header and PPI size */
161− u8 rmsg_pgcnt; /* page count of RNDIS header and PPI */
162161 u8 page_buf_cnt;
163162
164163 u16 q_idx;
@@ -893,6 +892,18 @@ struct nvsp_message { · 728 unmodified lines
893892 sizeof(struct nvsp_message))
894893 #define NETVSC_MIN_IN_MSG_SIZE sizeof(struct vmpacket_descriptor)
895894
895+/* Maximum # of contiguous data ranges that can make up a trasmitted packet.
896+ * Typically it's the max SKB fragments plus 2 for the rndis packet and the
897+ * linear portion of the SKB. But if MAX_SKB_FRAGS is large, the value may
898+ * need to be limited to MAX_PAGE_BUFFER_COUNT, which is the max # of entries
899+ * in a GPA direct packet sent to netvsp over VMBus.
900+ */
901+#if MAX_SKB_FRAGS + 2 < MAX_PAGE_BUFFER_COUNT
902+#define MAX_DATA_RANGES (MAX_SKB_FRAGS + 2)
903+#else
904+#define MAX_DATA_RANGES MAX_PAGE_BUFFER_COUNT
905+#endif
906+
896907 /* Estimated requestor size:
897908 * out_ring_size/min_out_msg_size + in_ring_size/min_in_msg_size
898909 */
drivers/net/hyperv/netvsc.c+48−9
@@ -953,8 +953,7 @@ static void netvsc_copy_to_send_buf(struct netvsc_device *net_device, · 952 unmodified lines
953953 + pend_size;
954954 int i;
955955 u32 padding = 0;
956− u32 page_count = packet->cp_partial ? packet->rmsg_pgcnt :
957− packet->page_buf_cnt;
956+ u32 page_count = packet->cp_partial ? 1 : packet->page_buf_cnt;
958957 u32 remain;
959958
960959 /* Add padding */
@@ -1055,6 +1054,42 @@ static int netvsc_dma_map(struct hv_device *hv_dev, · 94 unmodified lines
10551054 return 0;
10561055 }
10571056
1057+/* Build an "array" of mpb entries describing the data to be transferred
1058+ * over VMBus. After the desc header fields, each "array" entry is variable
1059+ * size, and each entry starts after the end of the previous entry. The
1060+ * "offset" and "len" fields for each entry imply the size of the entry.
1061+ *
1062+ * The pfns are in HV_HYP_PAGE_SIZE, because all communication with Hyper-V
1063+ * uses that granularity, even if the system page size of the guest is larger.
1064+ * Each entry in the input "pb" array must describe a contiguous range of
1065+ * guest physical memory so that the pfns are sequential if the range crosses
1066+ * a page boundary. The offset field must be < HV_HYP_PAGE_SIZE.
1067+ */
1068+static inline void netvsc_build_mpb_array(struct hv_page_buffer *pb,
1069+ u32 page_buffer_count,
1070+ struct vmbus_packet_mpb_array *desc,
1071+ u32 *desc_size)
1072+{
1073+ struct hv_mpb_array *mpb_entry = &desc->range;
1074+ int i, j;
1075+
1076+ for (i = 0; i < page_buffer_count; i++) {
1077+ u32 offset = pb[i].offset;
1078+ u32 len = pb[i].len;
1079+
1080+ mpb_entry->offset = offset;
1081+ mpb_entry->len = len;
1082+
1083+ for (j = 0; j < HVPFN_UP(offset + len); j++)
1084+ mpb_entry->pfn_array[j] = pb[i].pfn + j;
1085+
1086+ mpb_entry = (struct hv_mpb_array *)&mpb_entry->pfn_array[j];
1087+ }
1088+
1089+ desc->rangecount = page_buffer_count;
1090+ *desc_size = (char *)mpb_entry - (char *)desc;
1091+}
1092+
10581093 static inline int netvsc_send_pkt(
10591094 struct hv_device *device,
10601095 struct hv_netvsc_packet *packet,
@@ -1097,8 +1132,11 @@ static inline int netvsc_send_pkt( · 36 unmodified lines
10971132
10981133 packet->dma_range = NULL;
10991134 if (packet->page_buf_cnt) {
1135+ struct vmbus_channel_packet_page_buffer desc;
1136+ u32 desc_size;
1137+
11001138 if (packet->cp_partial)
1101− pb += packet->rmsg_pgcnt;
1139+ pb++;
11021140
11031141 ret = netvsc_dma_map(ndev_ctx->device_ctx, packet, pb);
11041142 if (ret) {
@@ -1106,11 +1144,12 @@ static inline int netvsc_send_pkt( · 1 unmodified line
11061144 goto exit;
11071145 }
11081146
1109− ret = vmbus_sendpacket_pagebuffer(out_channel,
1110− pb, packet->page_buf_cnt,
1111− &nvmsg, sizeof(nvmsg),
1112− req_id);
1113−
1147+ netvsc_build_mpb_array(pb, packet->page_buf_cnt,
1148+ (struct vmbus_packet_mpb_array *)&desc,
1149+ &desc_size);
1150+ ret = vmbus_sendpacket_mpb_desc(out_channel,
1151+ (struct vmbus_packet_mpb_array *)&desc,
1152+ desc_size, &nvmsg, sizeof(nvmsg), req_id);
11141153 if (ret)
11151154 netvsc_dma_unmap(ndev_ctx->device_ctx, packet);
11161155 } else {
@@ -1259,7 +1298,7 @@ int netvsc_send(struct net_device *ndev, · 142 unmodified lines
12591298 packet->send_buf_index = section_index;
12601299
12611300 if (packet->cp_partial) {
1262− packet->page_buf_cnt -= packet->rmsg_pgcnt;
1301+ packet->page_buf_cnt--;
12631302 packet->total_data_buflen = msd_len + packet->rmsg_size;
12641303 } else {
12651304 packet->page_buf_cnt = 0;
drivers/net/hyperv/netvsc_drv.c+14−48
@@ -326,43 +326,10 @@ static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb, · 325 unmodified lines
326326 return txq;
327327 }
328328
329−static u32 fill_pg_buf(unsigned long hvpfn, u32 offset, u32 len,
330− struct hv_page_buffer *pb)
331−{
332− int j = 0;
333−
334− hvpfn += offset >> HV_HYP_PAGE_SHIFT;
335− offset = offset & ~HV_HYP_PAGE_MASK;
336−
337− while (len > 0) {
338− unsigned long bytes;
339−
340− bytes = HV_HYP_PAGE_SIZE - offset;
341− if (bytes > len)
342− bytes = len;
343− pb[j].pfn = hvpfn;
344− pb[j].offset = offset;
345− pb[j].len = bytes;
346−
347− offset += bytes;
348− len -= bytes;
349−
350− if (offset == HV_HYP_PAGE_SIZE && len) {
351− hvpfn++;
352− offset = 0;
353− j++;
354− }
355− }
356−
357− return j + 1;
358−}
359−
360329 static u32 init_page_array(void *hdr, u32 len, struct sk_buff *skb,
361330 struct hv_netvsc_packet *packet,
362331 struct hv_page_buffer *pb)
363332 {
364− u32 slots_used = 0;
365− char *data = skb->data;
366333 int frags = skb_shinfo(skb)->nr_frags;
367334 int i;
368335
@@ -371,28 +338,27 @@ static u32 init_page_array(void *hdr, u32 len, struct sk_buff *skb, · 2 unmodified lines
371338 * 2. skb linear data
372339 * 3. skb fragment data
373340 */
374− slots_used += fill_pg_buf(virt_to_hvpfn(hdr),
375− offset_in_hvpage(hdr),
376− len,
377− &pb[slots_used]);
378341
342+ pb[0].offset = offset_in_hvpage(hdr);
343+ pb[0].len = len;
344+ pb[0].pfn = virt_to_hvpfn(hdr);
379345 packet->rmsg_size = len;
380− packet->rmsg_pgcnt = slots_used;
381346
382− slots_used += fill_pg_buf(virt_to_hvpfn(data),
383− offset_in_hvpage(data),
384− skb_headlen(skb),
385− &pb[slots_used]);
347+ pb[1].offset = offset_in_hvpage(skb->data);
348+ pb[1].len = skb_headlen(skb);
349+ pb[1].pfn = virt_to_hvpfn(skb->data);
386350
387351 for (i = 0; i < frags; i++) {
388352 skb_frag_t *frag = skb_shinfo(skb)->frags + i;
353+ struct hv_page_buffer *cur_pb = &pb[i + 2];
354+ u64 pfn = page_to_hvpfn(skb_frag_page(frag));
355+ u32 offset = skb_frag_off(frag);
389356
390− slots_used += fill_pg_buf(page_to_hvpfn(skb_frag_page(frag)),
391− skb_frag_off(frag),
392− skb_frag_size(frag),
393− &pb[slots_used]);
357+ cur_pb->offset = offset_in_hvpage(offset);
358+ cur_pb->len = skb_frag_size(frag);
359+ cur_pb->pfn = pfn + (offset >> HV_HYP_PAGE_SHIFT);
394360 }
395− return slots_used;
361+ return frags + 2;
396362 }
397363
398364 static int count_skb_frag_slots(struct sk_buff *skb)
@@ -483,7 +449,7 @@ static int netvsc_xmit(struct sk_buff *skb, struct net_device *net, bool xdp_tx) · 84 unmodified lines
483449 struct net_device *vf_netdev;
484450 u32 rndis_msg_size;
485451 u32 hash;
486− struct hv_page_buffer pb[MAX_PAGE_BUFFER_COUNT];
452+ struct hv_page_buffer pb[MAX_DATA_RANGES];
487453
488454 /* If VF is present and up then redirect packets to it.
489455 * Skip the VF if it is marked down or has no carrier.
drivers/net/hyperv/rndis_filter.c+5−19
@@ -225,8 +225,7 @@ static int rndis_filter_send_request(struct rndis_device *dev, · 224 unmodified lines
225225 struct rndis_request *req)
226226 {
227227 struct hv_netvsc_packet *packet;
228− struct hv_page_buffer page_buf[2];
229− struct hv_page_buffer *pb = page_buf;
228+ struct hv_page_buffer pb;
230229 int ret;
231230
232231 /* Setup the packet to send it */
@@ -235,27 +234,14 @@ static int rndis_filter_send_request(struct rndis_device *dev, · 2 unmodified lines
235234 packet->total_data_buflen = req->request_msg.msg_len;
236235 packet->page_buf_cnt = 1;
237236
238− pb[0].pfn = virt_to_phys(&req->request_msg) >>
239− HV_HYP_PAGE_SHIFT;
240− pb[0].len = req->request_msg.msg_len;
241− pb[0].offset = offset_in_hvpage(&req->request_msg);
242−
243− /* Add one page_buf when request_msg crossing page boundary */
244− if (pb[0].offset + pb[0].len > HV_HYP_PAGE_SIZE) {
245− packet->page_buf_cnt++;
246− pb[0].len = HV_HYP_PAGE_SIZE -
247− pb[0].offset;
248− pb[1].pfn = virt_to_phys((void *)&req->request_msg
249− + pb[0].len) >> HV_HYP_PAGE_SHIFT;
250− pb[1].offset = 0;
251− pb[1].len = req->request_msg.msg_len -
252− pb[0].len;
253− }
237+ pb.pfn = virt_to_phys(&req->request_msg) >> HV_HYP_PAGE_SHIFT;
238+ pb.len = req->request_msg.msg_len;
239+ pb.offset = offset_in_hvpage(&req->request_msg);
254240
255241 trace_rndis_send(dev->ndev, 0, &req->request_msg);
256242
257243 rcu_read_lock_bh();
258− ret = netvsc_send(dev->ndev, packet, NULL, pb, NULL, false);
244+ ret = netvsc_send(dev->ndev, packet, NULL, &pb, NULL, false);
259245 rcu_read_unlock_bh();
260246
261247 return ret;
drivers/net/phy/micrel.c+0−7
@@ -2027,12 +2027,6 @@ static int ksz9477_config_init(struct phy_device *phydev) · 2026 unmodified lines
20272027 return err;
20282028 }
20292029
2030− /* According to KSZ9477 Errata DS80000754C (Module 4) all EEE modes
2031− * in this switch shall be regarded as broken.
2032− */
2033− if (phydev->dev_flags & MICREL_NO_EEE)
2034− phy_disable_eee(phydev);
2035−
20362030 return kszphy_config_init(phydev);
20372031 }
20382032
@@ -5705,7 +5699,6 @@ static struct phy_driver ksphy_driver[] = { · 3666 unmodified lines
57055699 .handle_interrupt = kszphy_handle_interrupt,
57065700 .suspend = genphy_suspend,
57075701 .resume = ksz9477_resume,
5708− .get_features = ksz9477_get_features,
57095702 } };
57105703
57115704 module_phy_driver(ksphy_driver);
drivers/net/wireless/mediatek/mt76/dma.c+1−0
@@ -1011,6 +1011,7 @@ void mt76_dma_cleanup(struct mt76_dev *dev) · 1010 unmodified lines
10111011 int i;
10121012
10131013 mt76_worker_disable(&dev->tx_worker);
1014+ napi_disable(&dev->tx_napi);
10141015 netif_napi_del(&dev->tx_napi);
10151016
10161017 for (i = 0; i < ARRAY_SIZE(dev->phys); i++) {
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c+2−2
@@ -1924,14 +1924,14 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy, · 1923 unmodified lines
19241924 mt7925_mcu_sta_mld_tlv(skb, info->vif, info->link_sta->sta);
19251925 mt7925_mcu_sta_eht_mld_tlv(skb, info->vif, info->link_sta->sta);
19261926 }
1927−
1928− mt7925_mcu_sta_hdr_trans_tlv(skb, info->vif, info->link_sta);
19291927 }
19301928
19311929 if (!info->enable) {
19321930 mt7925_mcu_sta_remove_tlv(skb);
19331931 mt76_connac_mcu_add_tlv(skb, STA_REC_MLD_OFF,
19341932 sizeof(struct tlv));
1933+ } else {
1934+ mt7925_mcu_sta_hdr_trans_tlv(skb, info->vif, info->link_sta);
19351935 }
19361936
19371937 return mt76_mcu_skb_send_msg(dev, skb, info->cmd, true);
drivers/scsi/storvsc_drv.c+1−0
@@ -1819,6 +1819,7 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd) · 1818 unmodified lines
18191819 return SCSI_MLQUEUE_DEVICE_BUSY;
18201820 }
18211821
1822+ payload->rangecount = 1;
18221823 payload->range.len = length;
18231824 payload->range.offset = offset_in_hvpg;
18241825
include/linux/hyperv.h+0−7
@@ -1167,13 +1167,6 @@ extern int vmbus_sendpacket(struct vmbus_channel *channel, · 1166 unmodified lines
11671167 enum vmbus_packet_type type,
11681168 u32 flags);
11691169
1170−extern int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
1171− struct hv_page_buffer pagebuffers[],
1172− u32 pagecount,
1173− void *buffer,
1174− u32 bufferlen,
1175− u64 requestid);
1176−
11771170 extern int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel,
11781171 struct vmbus_packet_mpb_array *mpb,
11791172 u32 desc_size,
include/linux/micrel_phy.h+0−1
@@ -44,7 +44,6 @@ · 43 unmodified lines
4444 #define MICREL_PHY_50MHZ_CLK BIT(0)
4545 #define MICREL_PHY_FXEN BIT(1)
4646 #define MICREL_KSZ8_P1_ERRATA BIT(2)
47−#define MICREL_NO_EEE BIT(3)
4847
4948 #define MICREL_KSZ9021_EXTREG_CTRL 0xB
5049 #define MICREL_KSZ9021_EXTREG_DATA_WRITE 0xC
include/net/bluetooth/hci_core.h+1−0
@@ -1798,6 +1798,7 @@ struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list, · 1797 unmodified lines
17981798 void hci_uuids_clear(struct hci_dev *hdev);
17991799
18001800 void hci_link_keys_clear(struct hci_dev *hdev);
1801+u8 *hci_conn_key_enc_size(struct hci_conn *conn);
18011802 struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
18021803 struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn,
18031804 bdaddr_t *bdaddr, u8 *val, u8 type,
include/net/sch_generic.h+15−0
@@ -1031,6 +1031,21 @@ static inline struct sk_buff *__qdisc_dequeue_head(struct qdisc_skb_head *qh) · 1030 unmodified lines
10311031 return skb;
10321032 }
10331033
1034+static inline struct sk_buff *qdisc_dequeue_internal(struct Qdisc *sch, bool direct)
1035+{
1036+ struct sk_buff *skb;
1037+
1038+ skb = __skb_dequeue(&sch->gso_skb);
1039+ if (skb) {
1040+ sch->q.qlen--;
1041+ return skb;
1042+ }
1043+ if (direct)
1044+ return __qdisc_dequeue_head(&sch->q);
1045+ else
1046+ return sch->dequeue(sch);
1047+}
1048+
10341049 static inline struct sk_buff *qdisc_dequeue_head(struct Qdisc *sch)
10351050 {
10361051 struct sk_buff *skb = __qdisc_dequeue_head(&sch->q);
net/batman-adv/hard-interface.c+18−13
@@ -506,28 +506,32 @@ batadv_hardif_is_iface_up(const struct batadv_hard_iface *hard_iface) · 505 unmodified lines
506506 return false;
507507 }
508508
509−static void batadv_check_known_mac_addr(const struct net_device *net_dev)
509+static void batadv_check_known_mac_addr(const struct batadv_hard_iface *hard_iface)
510510 {
511− const struct batadv_hard_iface *hard_iface;
511+ const struct net_device *mesh_iface = hard_iface->mesh_iface;
512+ const struct batadv_hard_iface *tmp_hard_iface;
512513
513− rcu_read_lock();
514− list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
515− if (hard_iface->if_status != BATADV_IF_ACTIVE &&
516− hard_iface->if_status != BATADV_IF_TO_BE_ACTIVATED)
514+ if (!mesh_iface)
515+ return;
516+
517+ list_for_each_entry(tmp_hard_iface, &batadv_hardif_list, list) {
518+ if (tmp_hard_iface == hard_iface)
519+ continue;
520+
521+ if (tmp_hard_iface->mesh_iface != mesh_iface)
517522 continue;
518523
519− if (hard_iface->net_dev == net_dev)
524+ if (tmp_hard_iface->if_status == BATADV_IF_NOT_IN_USE)
520525 continue;
521526
522− if (!batadv_compare_eth(hard_iface->net_dev->dev_addr,
523− net_dev->dev_addr))
527+ if (!batadv_compare_eth(tmp_hard_iface->net_dev->dev_addr,
528+ hard_iface->net_dev->dev_addr))
524529 continue;
525530
526531 pr_warn("The newly added mac address (%pM) already exists on: %s\n",
527− net_dev->dev_addr, hard_iface->net_dev->name);
532+ hard_iface->net_dev->dev_addr, tmp_hard_iface->net_dev->name);
528533 pr_warn("It is strongly recommended to keep mac addresses unique to avoid problems!\n");
529534 }
530− rcu_read_unlock();
531535 }
532536
533537 /**
@@ -763,6 +767,8 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, · 229 unmodified lines
763767 hard_iface->net_dev->name, hardif_mtu,
764768 required_mtu);
765769
770+ batadv_check_known_mac_addr(hard_iface);
771+
766772 if (batadv_hardif_is_iface_up(hard_iface))
767773 batadv_hardif_activate_interface(hard_iface);
768774 else
@@ -901,7 +907,6 @@ batadv_hardif_add_interface(struct net_device *net_dev) · 132 unmodified lines
901907
902908 batadv_v_hardif_init(hard_iface);
903909
904− batadv_check_known_mac_addr(hard_iface->net_dev);
905910 kref_get(&hard_iface->refcount);
906911 list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list);
907912 batadv_hardif_generation++;
@@ -988,7 +993,7 @@ static int batadv_hard_if_event(struct notifier_block *this, · 80 unmodified lines
988993 if (hard_iface->if_status == BATADV_IF_NOT_IN_USE)
989994 goto hardif_put;
990995
991− batadv_check_known_mac_addr(hard_iface->net_dev);
996+ batadv_check_known_mac_addr(hard_iface);
992997
993998 bat_priv = netdev_priv(hard_iface->mesh_iface);
994999 bat_priv->algo_ops->iface.update_mac(hard_iface);
net/bluetooth/hci_conn.c+24−0
@@ -3023,3 +3023,27 @@ void hci_conn_tx_dequeue(struct hci_conn *conn) · 3022 unmodified lines
30233023
30243024 kfree_skb(skb);
30253025 }
3026+
3027+u8 *hci_conn_key_enc_size(struct hci_conn *conn)
3028+{
3029+ if (conn->type == ACL_LINK) {
3030+ struct link_key *key;
3031+
3032+ key = hci_find_link_key(conn->hdev, &conn->dst);
3033+ if (!key)
3034+ return NULL;
3035+
3036+ return &key->pin_len;
3037+ } else if (conn->type == LE_LINK) {
3038+ struct smp_ltk *ltk;
3039+
3040+ ltk = hci_find_ltk(conn->hdev, &conn->dst, conn->dst_type,
3041+ conn->role);
3042+ if (!ltk)
3043+ return NULL;
3044+
3045+ return &ltk->enc_size;
3046+ }
3047+
3048+ return NULL;
3049+}
net/bluetooth/hci_event.c+42−31
@@ -739,10 +739,17 @@ static u8 hci_cc_read_enc_key_size(struct hci_dev *hdev, void *data, · 738 unmodified lines
739739 handle);
740740 conn->enc_key_size = 0;
741741 } else {
742+ u8 *key_enc_size = hci_conn_key_enc_size(conn);
743+
742744 conn->enc_key_size = rp->key_size;
743745 status = 0;
744746
745− if (conn->enc_key_size < hdev->min_enc_key_size) {
747+ /* Attempt to check if the key size is too small or if it has
748+ * been downgraded from the last time it was stored as part of
749+ * the link_key.
750+ */
751+ if (conn->enc_key_size < hdev->min_enc_key_size ||
752+ (key_enc_size && conn->enc_key_size < *key_enc_size)) {
746753 /* As slave role, the conn->state has been set to
747754 * BT_CONNECTED and l2cap conn req might not be received
748755 * yet, at this moment the l2cap layer almost does
@@ -755,6 +762,10 @@ static u8 hci_cc_read_enc_key_size(struct hci_dev *hdev, void *data, · 6 unmodified lines
755762 clear_bit(HCI_CONN_ENCRYPT, &conn->flags);
756763 clear_bit(HCI_CONN_AES_CCM, &conn->flags);
757764 }
765+
766+ /* Update the key encryption size with the connection one */
767+ if (key_enc_size && *key_enc_size != conn->enc_key_size)
768+ *key_enc_size = conn->enc_key_size;
758769 }
759770
760771 hci_encrypt_cfm(conn, status);
@@ -3065,6 +3076,34 @@ static void hci_inquiry_result_evt(struct hci_dev *hdev, void *edata, · 2304 unmodified lines
30653076 hci_dev_unlock(hdev);
30663077 }
30673078
3079+static int hci_read_enc_key_size(struct hci_dev *hdev, struct hci_conn *conn)
3080+{
3081+ struct hci_cp_read_enc_key_size cp;
3082+ u8 *key_enc_size = hci_conn_key_enc_size(conn);
3083+
3084+ if (!read_key_size_capable(hdev)) {
3085+ conn->enc_key_size = HCI_LINK_KEY_SIZE;
3086+ return -EOPNOTSUPP;
3087+ }
3088+
3089+ bt_dev_dbg(hdev, "hcon %p", conn);
3090+
3091+ memset(&cp, 0, sizeof(cp));
3092+ cp.handle = cpu_to_le16(conn->handle);
3093+
3094+ /* If the key enc_size is already known, use it as conn->enc_key_size,
3095+ * otherwise use hdev->min_enc_key_size so the likes of
3096+ * l2cap_check_enc_key_size don't fail while waiting for
3097+ * HCI_OP_READ_ENC_KEY_SIZE response.
3098+ */
3099+ if (key_enc_size && *key_enc_size)
3100+ conn->enc_key_size = *key_enc_size;
3101+ else
3102+ conn->enc_key_size = hdev->min_enc_key_size;
3103+
3104+ return hci_send_cmd(hdev, HCI_OP_READ_ENC_KEY_SIZE, sizeof(cp), &cp);
3105+}
3106+
30683107 static void hci_conn_complete_evt(struct hci_dev *hdev, void *data,
30693108 struct sk_buff *skb)
30703109 {
@@ -3157,23 +3196,11 @@ static void hci_conn_complete_evt(struct hci_dev *hdev, void *data, · 86 unmodified lines
31573196 if (ev->encr_mode == 1 && !test_bit(HCI_CONN_ENCRYPT, &conn->flags) &&
31583197 ev->link_type == ACL_LINK) {
31593198 struct link_key *key;
3160− struct hci_cp_read_enc_key_size cp;
31613199
31623200 key = hci_find_link_key(hdev, &ev->bdaddr);
31633201 if (key) {
31643202 set_bit(HCI_CONN_ENCRYPT, &conn->flags);
3165−
3166− if (!read_key_size_capable(hdev)) {
3167− conn->enc_key_size = HCI_LINK_KEY_SIZE;
3168− } else {
3169− cp.handle = cpu_to_le16(conn->handle);
3170− if (hci_send_cmd(hdev, HCI_OP_READ_ENC_KEY_SIZE,
3171− sizeof(cp), &cp)) {
3172− bt_dev_err(hdev, "sending read key size failed");
3173− conn->enc_key_size = HCI_LINK_KEY_SIZE;
3174− }
3175− }
3176−
3203+ hci_read_enc_key_size(hdev, conn);
31773204 hci_encrypt_cfm(conn, ev->status);
31783205 }
31793206 }
@@ -3612,24 +3639,8 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data, · 432 unmodified lines
36123639
36133640 /* Try reading the encryption key size for encrypted ACL links */
36143641 if (!ev->status && ev->encrypt && conn->type == ACL_LINK) {
3615− struct hci_cp_read_enc_key_size cp;
3616−
3617− /* Only send HCI_Read_Encryption_Key_Size if the
3618− * controller really supports it. If it doesn't, assume
3619− * the default size (16).
3620− */
3621− if (!read_key_size_capable(hdev)) {
3622− conn->enc_key_size = HCI_LINK_KEY_SIZE;
3623− goto notify;
3624− }
3625−
3626− cp.handle = cpu_to_le16(conn->handle);
3627− if (hci_send_cmd(hdev, HCI_OP_READ_ENC_KEY_SIZE,
3628− sizeof(cp), &cp)) {
3629− bt_dev_err(hdev, "sending read key size failed");
3630− conn->enc_key_size = HCI_LINK_KEY_SIZE;
3642+ if (hci_read_enc_key_size(hdev, conn))
36313643 goto notify;
3632− }
36333644
36343645 goto unlock;
36353646 }
net/bluetooth/mgmt.c+6−3
@@ -7506,11 +7506,16 @@ static void add_device_complete(struct hci_dev *hdev, void *data, int err) · 7505 unmodified lines
75067506 struct mgmt_cp_add_device *cp = cmd->param;
75077507
75087508 if (!err) {
7509+ struct hci_conn_params *params;
7510+
7511+ params = hci_conn_params_lookup(hdev, &cp->addr.bdaddr,
7512+ le_addr_type(cp->addr.type));
7513+
75097514 device_added(cmd->sk, hdev, &cp->addr.bdaddr, cp->addr.type,
75107515 cp->action);
75117516 device_flags_changed(NULL, hdev, &cp->addr.bdaddr,
75127517 cp->addr.type, hdev->conn_flags,
7513− PTR_UINT(cmd->user_data));
7518+ params ? params->flags : 0);
75147519 }
75157520
75167521 mgmt_cmd_complete(cmd->sk, hdev->id, MGMT_OP_ADD_DEVICE,
@@ -7613,8 +7618,6 @@ static int add_device(struct sock *sk, struct hci_dev *hdev, · 96 unmodified lines
76137618 goto unlock;
76147619 }
76157620
7616− cmd->user_data = UINT_PTR(current_flags);
7617−
76187621 err = hci_cmd_sync_queue(hdev, add_device_sync, cmd,
76197622 add_device_complete);
76207623 if (err < 0) {
net/core/dev.c+2−0
@@ -10441,6 +10441,7 @@ static void netdev_sync_lower_features(struct net_device *upper, · 10440 unmodified lines
1044110441 if (!(features & feature) && (lower->features & feature)) {
1044210442 netdev_dbg(upper, "Disabling feature %pNF on lower dev %s.\n",
1044310443 &feature, lower->name);
10444+ netdev_lock_ops(lower);
1044410445 lower->wanted_features &= ~feature;
1044510446 __netdev_update_features(lower);
1044610447
@@ -10449,6 +10450,7 @@ static void netdev_sync_lower_features(struct net_device *upper, · 2 unmodified lines
1044910450 &feature, lower->name);
1045010451 else
1045110452 netdev_features_change(lower);
10453+ netdev_unlock_ops(lower);
1045210454 }
1045310455 }
1045410456 }
net/core/devmem.c+7−0
@@ -200,6 +200,8 @@ net_devmem_bind_dmabuf(struct net_device *dev, unsigned int dmabuf_fd, · 199 unmodified lines
200200
201201 refcount_set(&binding->ref, 1);
202202
203+ mutex_init(&binding->lock);
204+
203205 binding->dmabuf = dmabuf;
204206
205207 binding->attachment = dma_buf_attach(binding->dmabuf, dev->dev.parent);
@@ -379,6 +381,11 @@ static void mp_dmabuf_devmem_uninstall(void *mp_priv, · 173 unmodified lines
379381 xa_for_each(&binding->bound_rxqs, xa_idx, bound_rxq) {
380382 if (bound_rxq == rxq) {
381383 xa_erase(&binding->bound_rxqs, xa_idx);
384+ if (xa_empty(&binding->bound_rxqs)) {
385+ mutex_lock(&binding->lock);
386+ binding->dev = NULL;
387+ mutex_unlock(&binding->lock);
388+ }
382389 break;
383390 }
384391 }
net/core/devmem.h+2−0
@@ -20,6 +20,8 @@ struct net_devmem_dmabuf_binding { · 19 unmodified lines
2020 struct sg_table *sgt;
2121 struct net_device *dev;
2222 struct gen_pool *chunk_pool;
23+ /* Protect dev */
24+ struct mutex lock;
2325
2426 /* The user holds a ref (via the netlink API) for as long as they want
2527 * the binding to remain alive. Each page pool using this binding holds
net/core/netdev-genl.c+11−0
@@ -979,14 +979,25 @@ void netdev_nl_sock_priv_destroy(struct netdev_nl_sock *priv) · 978 unmodified lines
979979 {
980980 struct net_devmem_dmabuf_binding *binding;
981981 struct net_devmem_dmabuf_binding *temp;
982+ netdevice_tracker dev_tracker;
982983 struct net_device *dev;
983984
984985 mutex_lock(&priv->lock);
985986 list_for_each_entry_safe(binding, temp, &priv->bindings, list) {
987+ mutex_lock(&binding->lock);
986988 dev = binding->dev;
989+ if (!dev) {
990+ mutex_unlock(&binding->lock);
991+ net_devmem_unbind_dmabuf(binding);
992+ continue;
993+ }
994+ netdev_hold(dev, &dev_tracker, GFP_KERNEL);
995+ mutex_unlock(&binding->lock);
996+
987997 netdev_lock(dev);
988998 net_devmem_unbind_dmabuf(binding);
989999 netdev_unlock(dev);
1000+ netdev_put(dev, &dev_tracker);
9901001 }
9911002 mutex_unlock(&priv->lock);
9921003 }
net/mac80211/main.c+4−2
@@ -1354,10 +1354,12 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) · 1353 unmodified lines
13541354 hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_MONITOR);
13551355
13561356
1357− local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) +
1358− sizeof(void *) * channels, GFP_KERNEL);
1357+ local->int_scan_req = kzalloc(struct_size(local->int_scan_req,
1358+ channels, channels),
1359+ GFP_KERNEL);
13591360 if (!local->int_scan_req)
13601361 return -ENOMEM;
1362+ local->int_scan_req->n_channels = channels;
13611363
13621364 eth_broadcast_addr(local->int_scan_req->bssid);
13631365
net/mctp/device.c+12−5
@@ -117,11 +117,18 @@ static int mctp_dump_addrinfo(struct sk_buff *skb, struct netlink_callback *cb) · 116 unmodified lines
117117 struct net_device *dev;
118118 struct ifaddrmsg *hdr;
119119 struct mctp_dev *mdev;
120− int ifindex, rc;
121−
122− hdr = nlmsg_data(cb->nlh);
123− // filter by ifindex if requested
124− ifindex = hdr->ifa_index;
120+ int ifindex = 0, rc;
121+
122+ /* Filter by ifindex if a header is provided */
123+ if (cb->nlh->nlmsg_len >= nlmsg_msg_size(sizeof(*hdr))) {
124+ hdr = nlmsg_data(cb->nlh);
125+ ifindex = hdr->ifa_index;
126+ } else {
127+ if (cb->strict_check) {
128+ NL_SET_ERR_MSG(cb->extack, "mctp: Invalid header for addr dump request");
129+ return -EINVAL;
130+ }
131+ }
125132
126133 rcu_read_lock();
127134 for_each_netdev_dump(net, dev, mcb->ifindex) {
net/mctp/route.c+3−1
@@ -313,8 +313,10 @@ static void mctp_flow_prepare_output(struct sk_buff *skb, struct mctp_dev *dev) · 312 unmodified lines
313313
314314 key = flow->key;
315315
316− if (WARN_ON(key->dev && key->dev != dev))
316+ if (key->dev) {
317+ WARN_ON(key->dev != dev);
317318 return;
319+ }
318320
319321 mctp_dev_set_key(dev, key);
320322 }
net/sched/sch_codel.c+1−1
@@ -144,7 +144,7 @@ static int codel_change(struct Qdisc *sch, struct nlattr *opt, · 143 unmodified lines
144144
145145 qlen = sch->q.qlen;
146146 while (sch->q.qlen > sch->limit) {
147− struct sk_buff *skb = __qdisc_dequeue_head(&sch->q);
147+ struct sk_buff *skb = qdisc_dequeue_internal(sch, true);
148148
149149 dropped += qdisc_pkt_len(skb);
150150 qdisc_qstats_backlog_dec(sch, skb);
net/sched/sch_fq.c+1−1
@@ -1136,7 +1136,7 @@ static int fq_change(struct Qdisc *sch, struct nlattr *opt, · 1135 unmodified lines
11361136 sch_tree_lock(sch);
11371137 }
11381138 while (sch->q.qlen > sch->limit) {
1139− struct sk_buff *skb = fq_dequeue(sch);
1139+ struct sk_buff *skb = qdisc_dequeue_internal(sch, false);
11401140
11411141 if (!skb)
11421142 break;
net/sched/sch_fq_codel.c+1−1
@@ -441,7 +441,7 @@ static int fq_codel_change(struct Qdisc *sch, struct nlattr *opt, · 440 unmodified lines
441441
442442 while (sch->q.qlen > sch->limit ||
443443 q->memory_usage > q->memory_limit) {
444− struct sk_buff *skb = fq_codel_dequeue(sch);
444+ struct sk_buff *skb = qdisc_dequeue_internal(sch, false);
445445
446446 q->cstats.drop_len += qdisc_pkt_len(skb);
447447 rtnl_kfree_skbs(skb, skb);
net/sched/sch_fq_pie.c+1−1
@@ -366,7 +366,7 @@ static int fq_pie_change(struct Qdisc *sch, struct nlattr *opt, · 365 unmodified lines
366366
367367 /* Drop excess packets if new limit is lower */
368368 while (sch->q.qlen > sch->limit) {
369− struct sk_buff *skb = fq_pie_qdisc_dequeue(sch);
369+ struct sk_buff *skb = qdisc_dequeue_internal(sch, false);
370370
371371 len_dropped += qdisc_pkt_len(skb);
372372 num_dropped += 1;
net/sched/sch_hhf.c+1−1
@@ -564,7 +564,7 @@ static int hhf_change(struct Qdisc *sch, struct nlattr *opt, · 563 unmodified lines
564564 qlen = sch->q.qlen;
565565 prev_backlog = sch->qstats.backlog;
566566 while (sch->q.qlen > sch->limit) {
567− struct sk_buff *skb = hhf_dequeue(sch);
567+ struct sk_buff *skb = qdisc_dequeue_internal(sch, false);
568568
569569 rtnl_kfree_skbs(skb, skb);
570570 }
net/sched/sch_pie.c+1−1
@@ -195,7 +195,7 @@ static int pie_change(struct Qdisc *sch, struct nlattr *opt, · 194 unmodified lines
195195 /* Drop excess packets if new limit is lower */
196196 qlen = sch->q.qlen;
197197 while (sch->q.qlen > sch->limit) {
198− struct sk_buff *skb = __qdisc_dequeue_head(&sch->q);
198+ struct sk_buff *skb = qdisc_dequeue_internal(sch, true);
199199
200200 dropped += qdisc_pkt_len(skb);
201201 qdisc_qstats_backlog_dec(sch, skb);
net/tls/tls_strp.c+2−1
@@ -396,7 +396,6 @@ static int tls_strp_read_copy(struct tls_strparser *strp, bool qshort) · 395 unmodified lines
396396 return 0;
397397
398398 shinfo = skb_shinfo(strp->anchor);
399− shinfo->frag_list = NULL;
400399
401400 /* If we don't know the length go max plus page for cipher overhead */
402401 need_spc = strp->stm.full_len ?: TLS_MAX_PAYLOAD_SIZE + PAGE_SIZE;
@@ -412,6 +411,8 @@ static int tls_strp_read_copy(struct tls_strparser *strp, bool qshort) · 9 unmodified lines
412411 page, 0, 0);
413412 }
414413
414+ shinfo->frag_list = NULL;
415+
415416 strp->copy_mode = 1;
416417 strp->stm.offset = 0;
417418
tools/net/ynl/pyynl/ethtool.py+15−7
@@ -338,16 +338,24 @@ def main(): · 337 unmodified lines
338338 print('Capabilities:')
339339 [print(f'\t{v}') for v in bits_to_dict(tsinfo['timestamping'])]
340340
341− print(f'PTP Hardware Clock: {tsinfo["phc-index"]}')
341+ print(f'PTP Hardware Clock: {tsinfo.get("phc-index", "none")}')
342342
343− print('Hardware Transmit Timestamp Modes:')
344− [print(f'\t{v}') for v in bits_to_dict(tsinfo['tx-types'])]
343+ if 'tx-types' in tsinfo:
344+ print('Hardware Transmit Timestamp Modes:')
345+ [print(f'\t{v}') for v in bits_to_dict(tsinfo['tx-types'])]
346+ else:
347+ print('Hardware Transmit Timestamp Modes: none')
348+
349+ if 'rx-filters' in tsinfo:
350+ print('Hardware Receive Filter Modes:')
351+ [print(f'\t{v}') for v in bits_to_dict(tsinfo['rx-filters'])]
352+ else:
353+ print('Hardware Receive Filter Modes: none')
345354
346− print('Hardware Receive Filter Modes:')
347− [print(f'\t{v}') for v in bits_to_dict(tsinfo['rx-filters'])]
355+ if 'stats' in tsinfo and tsinfo['stats']:
356+ print('Statistics:')
357+ [print(f'\t{k}: {v}') for k, v in tsinfo['stats'].items()]
348358
349− print('Statistics:')
350− [print(f'\t{k}: {v}') for k, v in tsinfo['stats'].items()]
351359 return
352360
353361 print(f'Settings for {args.device}:')
tools/net/ynl/pyynl/ynl_gen_c.py+3−4
@@ -1143,10 +1143,9 @@ class Family(SpecFamily): · 1142 unmodified lines
11431143 self.pure_nested_structs[nested].request = True
11441144 if attr in rs_members['reply']:
11451145 self.pure_nested_structs[nested].reply = True
1146−
1147− if spec.is_multi_val():
1148− child = self.pure_nested_structs.get(nested)
1149− child.in_multi_val = True
1146+ if spec.is_multi_val():
1147+ child = self.pure_nested_structs.get(nested)
1148+ child.in_multi_val = True
11501149
11511150 self._sort_pure_types()
11521151
tools/testing/selftests/drivers/net/hw/ncdevmem.c+22−33
@@ -431,6 +431,22 @@ static int parse_address(const char *str, int port, struct sockaddr_in6 *sin6) · 430 unmodified lines
431431 return 0;
432432 }
433433
434+static struct netdev_queue_id *create_queues(void)
435+{
436+ struct netdev_queue_id *queues;
437+ size_t i = 0;
438+
439+ queues = calloc(num_queues, sizeof(*queues));
440+ for (i = 0; i < num_queues; i++) {
441+ queues[i]._present.type = 1;
442+ queues[i]._present.id = 1;
443+ queues[i].type = NETDEV_QUEUE_TYPE_RX;
444+ queues[i].id = start_queue + i;
445+ }
446+
447+ return queues;
448+}
449+
434450 int do_server(struct memory_buffer *mem)
435451 {
436452 char ctrl_data[sizeof(int) * 20000];
@@ -448,7 +464,6 @@ int do_server(struct memory_buffer *mem) · 11 unmodified lines
448464 char buffer[256];
449465 int socket_fd;
450466 int client_fd;
451− size_t i = 0;
452467 int ret;
453468
454469 ret = parse_address(server_ip, atoi(port), &server_sin);
@@ -471,16 +486,7 @@ int do_server(struct memory_buffer *mem) · 16 unmodified lines
471486
472487 sleep(1);
473488
474− queues = malloc(sizeof(*queues) * num_queues);
475−
476− for (i = 0; i < num_queues; i++) {
477− queues[i]._present.type = 1;
478− queues[i]._present.id = 1;
479− queues[i].type = NETDEV_QUEUE_TYPE_RX;
480− queues[i].id = start_queue + i;
481− }
482−
483− if (bind_rx_queue(ifindex, mem->fd, queues, num_queues, &ys))
489+ if (bind_rx_queue(ifindex, mem->fd, create_queues(), num_queues, &ys))
484490 error(1, 0, "Failed to bind\n");
485491
486492 tmp_mem = malloc(mem->size);
@@ -545,7 +551,6 @@ int do_server(struct memory_buffer *mem) · 58 unmodified lines
545551 goto cleanup;
546552 }
547553
548− i++;
549554 for (cm = CMSG_FIRSTHDR(&msg); cm; cm = CMSG_NXTHDR(&msg, cm)) {
550555 if (cm->cmsg_level != SOL_SOCKET ||
551556 (cm->cmsg_type != SCM_DEVMEM_DMABUF &&
@@ -630,10 +635,8 @@ cleanup: · 78 unmodified lines
630635
631636 void run_devmem_tests(void)
632637 {
633− struct netdev_queue_id *queues;
634638 struct memory_buffer *mem;
635639 struct ynl_sock *ys;
636− size_t i = 0;
637640
638641 mem = provider->alloc(getpagesize() * NUM_PAGES);
639642
@@ -641,38 +644,24 @@ void run_devmem_tests(void) · 1 unmodified line
641644 if (configure_rss())
642645 error(1, 0, "rss error\n");
643646
644− queues = calloc(num_queues, sizeof(*queues));
645−
646647 if (configure_headersplit(1))
647648 error(1, 0, "Failed to configure header split\n");
648649
649− if (!bind_rx_queue(ifindex, mem->fd, queues, num_queues, &ys))
650+ if (!bind_rx_queue(ifindex, mem->fd,
651+ calloc(num_queues, sizeof(struct netdev_queue_id)),
652+ num_queues, &ys))
650653 error(1, 0, "Binding empty queues array should have failed\n");
651654
652− for (i = 0; i < num_queues; i++) {
653− queues[i]._present.type = 1;
654− queues[i]._present.id = 1;
655− queues[i].type = NETDEV_QUEUE_TYPE_RX;
656− queues[i].id = start_queue + i;
657− }
658−
659655 if (configure_headersplit(0))
660656 error(1, 0, "Failed to configure header split\n");
661657
662− if (!bind_rx_queue(ifindex, mem->fd, queues, num_queues, &ys))
658+ if (!bind_rx_queue(ifindex, mem->fd, create_queues(), num_queues, &ys))
663659 error(1, 0, "Configure dmabuf with header split off should have failed\n");
664660
665661 if (configure_headersplit(1))
666662 error(1, 0, "Failed to configure header split\n");
667663
668− for (i = 0; i < num_queues; i++) {
669− queues[i]._present.type = 1;
670− queues[i]._present.id = 1;
671− queues[i].type = NETDEV_QUEUE_TYPE_RX;
672− queues[i].id = start_queue + i;
673− }
674−
675− if (bind_rx_queue(ifindex, mem->fd, queues, num_queues, &ys))
664+ if (bind_rx_queue(ifindex, mem->fd, create_queues(), num_queues, &ys))
676665 error(1, 0, "Failed to bind\n");
677666
678667 /* Deactivating a bound queue should not be legal */
tools/testing/selftests/tc-testing/tc-tests/qdiscs/codel.json+24−0
@@ -189,5 +189,29 @@ · 188 unmodified lines
189189 "teardown": [
190190 "$TC qdisc del dev $DUMMY handle 1: root"
191191 ]
192+ },
193+ {
194+ "id": "deb1",
195+ "name": "CODEL test qdisc limit trimming",
196+ "category": ["qdisc", "codel"],
197+ "plugins": {
198+ "requires": ["nsPlugin", "scapyPlugin"]
199+ },
200+ "setup": [
201+ "$TC qdisc add dev $DEV1 handle 1: root codel limit 10"
202+ ],
203+ "scapy": [
204+ {
205+ "iface": "$DEV0",
206+ "count": 10,
207+ "packet": "Ether(type=0x800)/IP(src='10.0.0.10',dst='10.0.0.20')/TCP(sport=5000,dport=10)"
208+ }
209+ ],
210+ "cmdUnderTest": "$TC qdisc change dev $DEV1 handle 1: root codel limit 1",
211+ "expExitCode": "0",
212+ "verifyCmd": "$TC qdisc show dev $DEV1",
213+ "matchPattern": "qdisc codel 1: root refcnt [0-9]+ limit 1p target 5ms interval 100ms",
214+ "matchCount": "1",
215+ "teardown": ["$TC qdisc del dev $DEV1 handle 1: root"]
192216 }
193217 ]
tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq.json+22−0
@@ -377,5 +377,27 @@ · 376 unmodified lines
377377 "teardown": [
378378 "$TC qdisc del dev $DUMMY handle 1: root"
379379 ]
380+ },
381+ {
382+ "id": "9479",
383+ "name": "FQ test qdisc limit trimming",
384+ "category": ["qdisc", "fq"],
385+ "plugins": {"requires": ["nsPlugin", "scapyPlugin"]},
386+ "setup": [
387+ "$TC qdisc add dev $DEV1 handle 1: root fq limit 10"
388+ ],
389+ "scapy": [
390+ {
391+ "iface": "$DEV0",
392+ "count": 10,
393+ "packet": "Ether(type=0x800)/IP(src='10.0.0.10',dst='10.0.0.20')/TCP(sport=5000,dport=10)"
394+ }
395+ ],
396+ "cmdUnderTest": "$TC qdisc change dev $DEV1 handle 1: root fq limit 1",
397+ "expExitCode": "0",
398+ "verifyCmd": "$TC qdisc show dev $DEV1",
399+ "matchPattern": "qdisc fq 1: root refcnt [0-9]+ limit 1p",
400+ "matchCount": "1",
401+ "teardown": ["$TC qdisc del dev $DEV1 handle 1: root"]
380402 }
381403 ]
tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq_codel.json+22−0
@@ -294,5 +294,27 @@ · 293 unmodified lines
294294 "teardown": [
295295 "$TC qdisc del dev $DUMMY handle 1: root"
296296 ]
297+ },
298+ {
299+ "id": "0436",
300+ "name": "FQ_CODEL test qdisc limit trimming",
301+ "category": ["qdisc", "fq_codel"],
302+ "plugins": {"requires": ["nsPlugin", "scapyPlugin"]},
303+ "setup": [
304+ "$TC qdisc add dev $DEV1 handle 1: root fq_codel limit 10"
305+ ],
306+ "scapy": [
307+ {
308+ "iface": "$DEV0",
309+ "count": 10,
310+ "packet": "Ether(type=0x800)/IP(src='10.0.0.10',dst='10.0.0.20')/TCP(sport=5000,dport=10)"
311+ }
312+ ],
313+ "cmdUnderTest": "$TC qdisc change dev $DEV1 handle 1: root fq_codel limit 1",
314+ "expExitCode": "0",
315+ "verifyCmd": "$TC qdisc show dev $DEV1",
316+ "matchPattern": "qdisc fq_codel 1: root refcnt [0-9]+ limit 1p flows 1024 quantum.*target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64",
317+ "matchCount": "1",
318+ "teardown": ["$TC qdisc del dev $DEV1 handle 1: root"]
297319 }
298320 ]
tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq_pie.json+22−0
@@ -18,5 +18,27 @@ · 17 unmodified lines
1818 "matchCount": "1",
1919 "teardown": [
2020 ]
21+ },
22+ {
23+ "id": "83bf",
24+ "name": "FQ_PIE test qdisc limit trimming",
25+ "category": ["qdisc", "fq_pie"],
26+ "plugins": {"requires": ["nsPlugin", "scapyPlugin"]},
27+ "setup": [
28+ "$TC qdisc add dev $DEV1 handle 1: root fq_pie limit 10"
29+ ],
30+ "scapy": [
31+ {
32+ "iface": "$DEV0",
33+ "count": 10,
34+ "packet": "Ether(type=0x800)/IP(src='10.0.0.10',dst='10.0.0.20')/TCP(sport=5000,dport=10)"
35+ }
36+ ],
37+ "cmdUnderTest": "$TC qdisc change dev $DEV1 handle 1: root fq_pie limit 1",
38+ "expExitCode": "0",
39+ "verifyCmd": "$TC qdisc show dev $DEV1",
40+ "matchPattern": "qdisc fq_pie 1: root refcnt [0-9]+ limit 1p",
41+ "matchCount": "1",
42+ "teardown": ["$TC qdisc del dev $DEV1 handle 1: root"]
2143 }
2244 ]
tools/testing/selftests/tc-testing/tc-tests/qdiscs/hhf.json+22−0
@@ -188,5 +188,27 @@ · 187 unmodified lines
188188 "teardown": [
189189 "$TC qdisc del dev $DUMMY handle 1: root"
190190 ]
191+ },
192+ {
193+ "id": "385f",
194+ "name": "HHF test qdisc limit trimming",
195+ "category": ["qdisc", "hhf"],
196+ "plugins": {"requires": ["nsPlugin", "scapyPlugin"]},
197+ "setup": [
198+ "$TC qdisc add dev $DEV1 handle 1: root hhf limit 10"
199+ ],
200+ "scapy": [
201+ {
202+ "iface": "$DEV0",
203+ "count": 10,
204+ "packet": "Ether(type=0x800)/IP(src='10.0.0.10',dst='10.0.0.20')/TCP(sport=5000,dport=10)"
205+ }
206+ ],
207+ "cmdUnderTest": "$TC qdisc change dev $DEV1 handle 1: root hhf limit 1",
208+ "expExitCode": "0",
209+ "verifyCmd": "$TC qdisc show dev $DEV1",
210+ "matchPattern": "qdisc hhf 1: root refcnt [0-9]+ limit 1p.*hh_limit 2048 reset_timeout 40ms admit_bytes 128Kb evict_timeout 1s non_hh_weight 2",
211+ "matchCount": "1",
212+ "teardown": ["$TC qdisc del dev $DEV1 handle 1: root"]
191213 }
192214 ]
tools/testing/selftests/tc-testing/tc-tests/qdiscs/pie.json+24−0
@@ -0,0 +1,24 @@
1+[
2+ {
3+ "id": "6158",
4+ "name": "PIE test qdisc limit trimming",
5+ "category": ["qdisc", "pie"],
6+ "plugins": {"requires": ["nsPlugin", "scapyPlugin"]},
7+ "setup": [
8+ "$TC qdisc add dev $DEV1 handle 1: root pie limit 10"
9+ ],
10+ "scapy": [
11+ {
12+ "iface": "$DEV0",
13+ "count": 10,
14+ "packet": "Ether(type=0x800)/IP(src='10.0.0.10',dst='10.0.0.20')/TCP(sport=5000,dport=10)"
15+ }
16+ ],
17+ "cmdUnderTest": "$TC qdisc change dev $DEV1 handle 1: root pie limit 1",
18+ "expExitCode": "0",
19+ "verifyCmd": "$TC qdisc show dev $DEV1",
20+ "matchPattern": "qdisc pie 1: root refcnt [0-9]+ limit 1p",
21+ "matchCount": "1",
22+ "teardown": ["$TC qdisc del dev $DEV1 handle 1: root"]
23+ }
24+]
tools/testing/vsock/vsock_test.c+16−12
@@ -1264,21 +1264,25 @@ static void test_unsent_bytes_client(const struct test_opts *opts, int type) · 1263 unmodified lines
12641264 send_buf(fd, buf, sizeof(buf), 0, sizeof(buf));
12651265 control_expectln("RECEIVED");
12661266
1267− ret = ioctl(fd, SIOCOUTQ, &sock_bytes_unsent);
1268− if (ret < 0) {
1269− if (errno == EOPNOTSUPP) {
1270− fprintf(stderr, "Test skipped, SIOCOUTQ not supported.\n");
1271− } else {
1267+ /* SIOCOUTQ isn't guaranteed to instantly track sent data. Even though
1268+ * the "RECEIVED" message means that the other side has received the
1269+ * data, there can be a delay in our kernel before updating the "unsent
1270+ * bytes" counter. Repeat SIOCOUTQ until it returns 0.
1271+ */
1272+ timeout_begin(TIMEOUT);
1273+ do {
1274+ ret = ioctl(fd, SIOCOUTQ, &sock_bytes_unsent);
1275+ if (ret < 0) {
1276+ if (errno == EOPNOTSUPP) {
1277+ fprintf(stderr, "Test skipped, SIOCOUTQ not supported.\n");
1278+ break;
1279+ }
12721280 perror("ioctl");
12731281 exit(EXIT_FAILURE);
12741282 }
1275− } else if (ret == 0 && sock_bytes_unsent != 0) {
1276− fprintf(stderr,
1277− "Unexpected 'SIOCOUTQ' value, expected 0, got %i\n",
1278− sock_bytes_unsent);
1279− exit(EXIT_FAILURE);
1280− }
1281−
1283+ timeout_check("SIOCOUTQ");
1284+ } while (sock_bytes_unsent != 0);
1285+ timeout_end();
12821286 close(fd);
12831287 }
12841288

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