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 ...
Unified · Split
| @@ -2017,7 +2017,8 @@ attribute-sets: · 2016 unmodified lines | |||
| 2017 | attributes: | 2017 | attributes: |
| 2018 | - | 2018 | - |
| 2019 | name: act | 2019 | name: act |
| 2020 | type: nest | 2020 | type: indexed-array |
| 2021 | sub-type: nest | ||
| 2021 | nested-attributes: tc-act-attrs | 2022 | nested-attributes: tc-act-attrs |
| 2022 | - | 2023 | - |
| 2023 | name: police | 2024 | name: police |
| @@ -2250,7 +2251,8 @@ attribute-sets: · 226 unmodified lines | |||
| 2250 | attributes: | 2251 | attributes: |
| 2251 | - | 2252 | - |
| 2252 | name: act | 2253 | name: act |
| 2253 | type: nest | 2254 | type: indexed-array |
| 2255 | sub-type: nest | ||
| 2254 | nested-attributes: tc-act-attrs | 2256 | nested-attributes: tc-act-attrs |
| 2255 | - | 2257 | - |
| 2256 | name: police | 2258 | name: police |
| @@ -2745,7 +2747,7 @@ attribute-sets: · 488 unmodified lines | |||
| 2745 | type: u16 | 2747 | type: u16 |
| 2746 | byte-order: big-endian | 2748 | byte-order: big-endian |
| 2747 | - | 2749 | - |
| 2748 | name: key-l2-tpv3-sid | 2750 | name: key-l2tpv3-sid |
| 2749 | type: u32 | 2751 | type: u32 |
| 2750 | byte-order: big-endian | 2752 | byte-order: big-endian |
| 2751 | - | 2753 | - |
| @@ -3504,7 +3506,7 @@ attribute-sets: · 752 unmodified lines | |||
| 3504 | name: rate64 | 3506 | name: rate64 |
| 3505 | type: u64 | 3507 | type: u64 |
| 3506 | - | 3508 | - |
| 3507 | name: prate4 | 3509 | name: prate64 |
| 3508 | type: u64 | 3510 | type: u64 |
| 3509 | - | 3511 | - |
| 3510 | name: burst | 3512 | name: burst |
| @@ -811,11 +811,9 @@ Documentation/devicetree/bindings/ptp/timestamper.txt for more details. · 810 unmodified lines | |||
| 811 | 3.2.4 Other caveats for MAC drivers | 811 | 3.2.4 Other caveats for MAC drivers |
| 812 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 812 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 813 | 813 | ||
| 814 | Stacked PHCs, especially DSA (but not only) - since that doesn't require any | 814 | The use of stacked PHCs may uncover MAC driver bugs which were impossible to |
| 815 | modification to MAC drivers, so it is more difficult to ensure correctness of | 815 | trigger without them. One example has to do with this line of code, already |
| 816 | all possible code paths - is that they uncover bugs which were impossible to | 816 | presented earlier:: |
| 817 | trigger before the existence of stacked PTP clocks. One example has to do with | ||
| 818 | this line of code, already presented earlier:: | ||
| 819 | 817 | ||
| 820 | skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; | 818 | skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; |
| 821 | 819 | ||
| @@ -1077,68 +1077,10 @@ int vmbus_sendpacket(struct vmbus_channel *channel, void *buffer, · 1076 unmodified lines | |||
| 1077 | EXPORT_SYMBOL(vmbus_sendpacket); | 1077 | EXPORT_SYMBOL(vmbus_sendpacket); |
| 1078 | 1078 | ||
| 1079 | /* | 1079 | /* |
| 1080 | * vmbus_sendpacket_pagebuffer - Send a range of single-page buffer | 1080 | * vmbus_sendpacket_mpb_desc - Send one or more multi-page buffer packets |
| 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 | ||
| 1140 | * using a GPADL Direct packet type. | 1081 | * 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. | ||
| 1142 | */ | 1084 | */ |
| 1143 | int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel, | 1085 | int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel, |
| 1144 | struct vmbus_packet_mpb_array *desc, | 1086 | struct vmbus_packet_mpb_array *desc, |
| @@ -1160,7 +1102,6 @@ int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel, · 15 unmodified lines | |||
| 1160 | desc->length8 = (u16)(packetlen_aligned >> 3); | 1102 | desc->length8 = (u16)(packetlen_aligned >> 3); |
| 1161 | desc->transactionid = VMBUS_RQST_ERROR; /* will be updated in hv_ringbuffer_write() */ | 1103 | desc->transactionid = VMBUS_RQST_ERROR; /* will be updated in hv_ringbuffer_write() */ |
| 1162 | desc->reserved = 0; | 1104 | desc->reserved = 0; |
| 1163 | desc->rangecount = 1; | ||
| 1164 | 1105 | ||
| 1165 | bufferlist[0].iov_base = desc; | 1106 | bufferlist[0].iov_base = desc; |
| 1166 | bufferlist[0].iov_len = desc_size; | 1107 | bufferlist[0].iov_len = desc_size; |
| @@ -326,6 +326,26 @@ static void b53_get_vlan_entry(struct b53_device *dev, u16 vid, · 325 unmodified lines | |||
| 326 | } | 326 | } |
| 327 | } | 327 | } |
| 328 | 328 | ||
| 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 | |||
| 329 | static void b53_set_forwarding(struct b53_device *dev, int enable) | 349 | static void b53_set_forwarding(struct b53_device *dev, int enable) |
| 330 | { | 350 | { |
| 331 | u8 mgmt; | 351 | u8 mgmt; |
| @@ -586,6 +606,13 @@ int b53_setup_port(struct dsa_switch *ds, int port) · 254 unmodified lines | |||
| 586 | b53_port_set_mcast_flood(dev, port, true); | 606 | b53_port_set_mcast_flood(dev, port, true); |
| 587 | b53_port_set_learning(dev, port, false); | 607 | b53_port_set_learning(dev, port, false); |
| 588 | 608 | ||
| 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 | |||
| 589 | return 0; | 616 | return 0; |
| 590 | } | 617 | } |
| 591 | EXPORT_SYMBOL(b53_setup_port); | 618 | 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 | |||
| 2042 | pvlan |= BIT(i); | 2069 | pvlan |= BIT(i); |
| 2043 | } | 2070 | } |
| 2044 | 2071 | ||
| 2072 | /* Disable redirection of unknown SA to the CPU port */ | ||
| 2073 | b53_set_eap_mode(dev, port, EAP_MODE_BASIC); | ||
| 2074 | |||
| 2045 | /* Configure the local port VLAN control membership to include | 2075 | /* Configure the local port VLAN control membership to include |
| 2046 | * remote ports and update the local port bitmask | 2076 | * remote ports and update the local port bitmask |
| 2047 | */ | 2077 | */ |
| @@ -2077,6 +2107,9 @@ void b53_br_leave(struct dsa_switch *ds, int port, struct dsa_bridge bridge) · 29 unmodified lines | |||
| 2077 | pvlan &= ~BIT(i); | 2107 | pvlan &= ~BIT(i); |
| 2078 | } | 2108 | } |
| 2079 | 2109 | ||
| 2110 | /* Enable redirection of unknown SA to the CPU port */ | ||
| 2111 | b53_set_eap_mode(dev, port, EAP_MODE_SIMPLIFIED); | ||
| 2112 | |||
| 2080 | b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), pvlan); | 2113 | b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), pvlan); |
| 2081 | dev->ports[port].vlan_ctl_mask = pvlan; | 2114 | dev->ports[port].vlan_ctl_mask = pvlan; |
| 2082 | 2115 | ||
| @@ -50,6 +50,9 @@ · 49 unmodified lines | |||
| 50 | /* Jumbo Frame Registers */ | 50 | /* Jumbo Frame Registers */ |
| 51 | #define B53_JUMBO_PAGE 0x40 | 51 | #define B53_JUMBO_PAGE 0x40 |
| 52 | 52 | ||
| 53 | /* EAP Registers */ | ||
| 54 | #define B53_EAP_PAGE 0x42 | ||
| 55 | |||
| 53 | /* EEE Control Registers Page */ | 56 | /* EEE Control Registers Page */ |
| 54 | #define B53_EEE_PAGE 0x92 | 57 | #define B53_EEE_PAGE 0x92 |
| 55 | 58 | ||
| @@ -480,6 +483,17 @@ · 424 unmodified lines | |||
| 480 | #define JMS_MIN_SIZE 1518 | 483 | #define JMS_MIN_SIZE 1518 |
| 481 | #define JMS_MAX_SIZE 9724 | 484 | #define JMS_MAX_SIZE 9724 |
| 482 | 485 | ||
| 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 | |||
| 483 | /************************************************************************* | 497 | /************************************************************************* |
| 484 | * EEE Configuration Page Registers | 498 | * EEE Configuration Page Registers |
| 485 | *************************************************************************/ | 499 | *************************************************************************/ |
| @@ -265,16 +265,70 @@ static void ksz_phylink_mac_link_down(struct phylink_config *config, · 264 unmodified lines | |||
| 265 | unsigned int mode, | 265 | unsigned int mode, |
| 266 | phy_interface_t interface); | 266 | phy_interface_t interface); |
| 267 | 267 | ||
| 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 | |||
| 268 | static const struct phylink_mac_ops ksz88x3_phylink_mac_ops = { | 318 | static const struct phylink_mac_ops ksz88x3_phylink_mac_ops = { |
| 269 | .mac_config = ksz88x3_phylink_mac_config, | 319 | .mac_config = ksz88x3_phylink_mac_config, |
| 270 | .mac_link_down = ksz_phylink_mac_link_down, | 320 | .mac_link_down = ksz_phylink_mac_link_down, |
| 271 | .mac_link_up = ksz8_phylink_mac_link_up, | 321 | .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, | ||
| 272 | }; | 324 | }; |
| 273 | 325 | ||
| 274 | static const struct phylink_mac_ops ksz8_phylink_mac_ops = { | 326 | static const struct phylink_mac_ops ksz8_phylink_mac_ops = { |
| 275 | .mac_config = ksz_phylink_mac_config, | 327 | .mac_config = ksz_phylink_mac_config, |
| 276 | .mac_link_down = ksz_phylink_mac_link_down, | 328 | .mac_link_down = ksz_phylink_mac_link_down, |
| 277 | .mac_link_up = ksz8_phylink_mac_link_up, | 329 | .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, | ||
| 278 | }; | 332 | }; |
| 279 | 333 | ||
| 280 | static const struct ksz_dev_ops ksz88xx_dev_ops = { | 334 | 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 | |||
| 358 | .mac_config = ksz_phylink_mac_config, | 412 | .mac_config = ksz_phylink_mac_config, |
| 359 | .mac_link_down = ksz_phylink_mac_link_down, | 413 | .mac_link_down = ksz_phylink_mac_link_down, |
| 360 | .mac_link_up = ksz9477_phylink_mac_link_up, | 414 | .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, | ||
| 361 | }; | 417 | }; |
| 362 | 418 | ||
| 363 | static const struct ksz_dev_ops ksz9477_dev_ops = { | 419 | 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 | |||
| 401 | .mac_config = ksz_phylink_mac_config, | 457 | .mac_config = ksz_phylink_mac_config, |
| 402 | .mac_link_down = ksz_phylink_mac_link_down, | 458 | .mac_link_down = ksz_phylink_mac_link_down, |
| 403 | .mac_link_up = ksz9477_phylink_mac_link_up, | 459 | .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, | ||
| 404 | }; | 462 | }; |
| 405 | 463 | ||
| 406 | static const struct ksz_dev_ops lan937x_dev_ops = { | 464 | 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 | |||
| 2016 | 2074 | ||
| 2017 | if (dev->dev_ops->get_caps) | 2075 | if (dev->dev_ops->get_caps) |
| 2018 | dev->dev_ops->get_caps(dev, port, config); | 2076 | 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 | } | ||
| 2019 | } | 2089 | } |
| 2020 | 2090 | ||
| 2021 | void ksz_r_mib_stats64(struct ksz_device *dev, int port) | 2091 | 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 | |||
| 3008 | if (!port) | 3078 | if (!port) |
| 3009 | return MICREL_KSZ8_P1_ERRATA; | 3079 | return MICREL_KSZ8_P1_ERRATA; |
| 3010 | break; | 3080 | 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; | ||
| 3036 | } | 3081 | } |
| 3037 | 3082 | ||
| 3038 | return 0; | 3083 | return 0; |
| @@ -3466,6 +3511,20 @@ static int ksz_max_mtu(struct dsa_switch *ds, int port) · 427 unmodified lines | |||
| 3466 | return -EOPNOTSUPP; | 3511 | return -EOPNOTSUPP; |
| 3467 | } | 3512 | } |
| 3468 | 3513 | ||
| 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 | */ | ||
| 3469 | static bool ksz_support_eee(struct dsa_switch *ds, int port) | 3528 | static bool ksz_support_eee(struct dsa_switch *ds, int port) |
| 3470 | { | 3529 | { |
| 3471 | struct ksz_device *dev = ds->priv; | 3530 | struct ksz_device *dev = ds->priv; |
| @@ -3475,15 +3534,35 @@ static bool ksz_support_eee(struct dsa_switch *ds, int port) · 3 unmodified lines | |||
| 3475 | 3534 | ||
| 3476 | switch (dev->chip_id) { | 3535 | switch (dev->chip_id) { |
| 3477 | case KSZ8563_CHIP_ID: | 3536 | case KSZ8563_CHIP_ID: |
| 3537 | case KSZ9563_CHIP_ID: | ||
| 3538 | case KSZ9893_CHIP_ID: | ||
| 3539 | return true; | ||
| 3478 | case KSZ8567_CHIP_ID: | 3540 | 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 */ | ||
| 3479 | case KSZ9477_CHIP_ID: | 3546 | case KSZ9477_CHIP_ID: |
| 3480 | case KSZ9563_CHIP_ID: | 3547 | /* KSZ9477S Errata DS80000754A Module 4 */ |
| 3481 | case KSZ9567_CHIP_ID: | 3548 | case KSZ9567_CHIP_ID: |
| 3482 | case KSZ9893_CHIP_ID: | 3549 | /* KSZ9567S Errata DS80000756A Module 4 */ |
| 3483 | case KSZ9896_CHIP_ID: | 3550 | case KSZ9896_CHIP_ID: |
| 3551 | /* KSZ9896C Errata DS80000757A Module 3 */ | ||
| 3484 | case KSZ9897_CHIP_ID: | 3552 | case KSZ9897_CHIP_ID: |
| 3485 | case LAN9646_CHIP_ID: | 3553 | 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; | ||
| 3487 | } | 3566 | } |
| 3488 | 3567 | ||
| 3489 | return false; | 3568 | return false; |
| @@ -2081,6 +2081,7 @@ static void sja1105_bridge_stp_state_set(struct dsa_switch *ds, int port, · 2080 unmodified lines | |||
| 2081 | switch (state) { | 2081 | switch (state) { |
| 2082 | case BR_STATE_DISABLED: | 2082 | case BR_STATE_DISABLED: |
| 2083 | case BR_STATE_BLOCKING: | 2083 | case BR_STATE_BLOCKING: |
| 2084 | case BR_STATE_LISTENING: | ||
| 2084 | /* From UM10944 description of DRPDTAG (why put this there?): | 2085 | /* From UM10944 description of DRPDTAG (why put this there?): |
| 2085 | * "Management traffic flows to the port regardless of the state | 2086 | * "Management traffic flows to the port regardless of the state |
| 2086 | * of the INGRESS flag". So BPDUs are still be allowed to pass. | 2087 | * 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 | |||
| 2090 | mac[port].egress = false; | 2091 | mac[port].egress = false; |
| 2091 | mac[port].dyn_learn = false; | 2092 | mac[port].dyn_learn = false; |
| 2092 | break; | 2093 | break; |
| 2093 | case BR_STATE_LISTENING: | ||
| 2094 | mac[port].ingress = true; | ||
| 2095 | mac[port].egress = false; | ||
| 2096 | mac[port].dyn_learn = false; | ||
| 2097 | break; | ||
| 2098 | case BR_STATE_LEARNING: | 2094 | case BR_STATE_LEARNING: |
| 2099 | mac[port].ingress = true; | 2095 | mac[port].ingress = true; |
| 2100 | mac[port].egress = false; | 2096 | mac[port].egress = false; |
| @@ -14013,13 +14013,28 @@ static void bnxt_unlock_sp(struct bnxt *bp) · 14012 unmodified lines | |||
| 14013 | netdev_unlock(bp->dev); | 14013 | netdev_unlock(bp->dev); |
| 14014 | } | 14014 | } |
| 14015 | 14015 | ||
| 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 | |||
| 14016 | /* Only called from bnxt_sp_task() */ | 14031 | /* Only called from bnxt_sp_task() */ |
| 14017 | static void bnxt_reset(struct bnxt *bp, bool silent) | 14032 | static void bnxt_reset(struct bnxt *bp, bool silent) |
| 14018 | { | 14033 | { |
| 14019 | bnxt_lock_sp(bp); | 14034 | bnxt_rtnl_lock_sp(bp); |
| 14020 | if (test_bit(BNXT_STATE_OPEN, &bp->state)) | 14035 | if (test_bit(BNXT_STATE_OPEN, &bp->state)) |
| 14021 | bnxt_reset_task(bp, silent); | 14036 | bnxt_reset_task(bp, silent); |
| 14022 | bnxt_unlock_sp(bp); | 14037 | bnxt_rtnl_unlock_sp(bp); |
| 14023 | } | 14038 | } |
| 14024 | 14039 | ||
| 14025 | /* Only called from bnxt_sp_task() */ | 14040 | /* Only called from bnxt_sp_task() */ |
| @@ -14027,9 +14042,9 @@ static void bnxt_rx_ring_reset(struct bnxt *bp) · 1 unmodified line | |||
| 14027 | { | 14042 | { |
| 14028 | int i; | 14043 | int i; |
| 14029 | 14044 | ||
| 14030 | bnxt_lock_sp(bp); | 14045 | bnxt_rtnl_lock_sp(bp); |
| 14031 | if (!test_bit(BNXT_STATE_OPEN, &bp->state)) { | 14046 | if (!test_bit(BNXT_STATE_OPEN, &bp->state)) { |
| 14032 | bnxt_unlock_sp(bp); | 14047 | bnxt_rtnl_unlock_sp(bp); |
| 14033 | return; | 14048 | return; |
| 14034 | } | 14049 | } |
| 14035 | /* Disable and flush TPA before resetting the RX ring */ | 14050 | /* 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 | |||
| 14068 | } | 14083 | } |
| 14069 | if (bp->flags & BNXT_FLAG_TPA) | 14084 | if (bp->flags & BNXT_FLAG_TPA) |
| 14070 | bnxt_set_tpa(bp, true); | 14085 | bnxt_set_tpa(bp, true); |
| 14071 | bnxt_unlock_sp(bp); | 14086 | bnxt_rtnl_unlock_sp(bp); |
| 14072 | } | 14087 | } |
| 14073 | 14088 | ||
| 14074 | static void bnxt_fw_fatal_close(struct bnxt *bp) | 14089 | 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 | |||
| 14960 | bp->fw_reset_state = BNXT_FW_RESET_STATE_OPENING; | 14975 | bp->fw_reset_state = BNXT_FW_RESET_STATE_OPENING; |
| 14961 | fallthrough; | 14976 | fallthrough; |
| 14962 | case BNXT_FW_RESET_STATE_OPENING: | 14977 | case BNXT_FW_RESET_STATE_OPENING: |
| 14963 | while (!netdev_trylock(bp->dev)) { | 14978 | while (!rtnl_trylock()) { |
| 14964 | bnxt_queue_fw_reset_work(bp, HZ / 10); | 14979 | bnxt_queue_fw_reset_work(bp, HZ / 10); |
| 14965 | return; | 14980 | return; |
| 14966 | } | 14981 | } |
| 14982 | netdev_lock(bp->dev); | ||
| 14967 | rc = bnxt_open(bp->dev); | 14983 | rc = bnxt_open(bp->dev); |
| 14968 | if (rc) { | 14984 | if (rc) { |
| 14969 | netdev_err(bp->dev, "bnxt_open() failed during FW reset\n"); | 14985 | netdev_err(bp->dev, "bnxt_open() failed during FW reset\n"); |
| 14970 | bnxt_fw_reset_abort(bp, rc); | 14986 | bnxt_fw_reset_abort(bp, rc); |
| 14971 | netdev_unlock(bp->dev); | 14987 | netdev_unlock(bp->dev); |
| 14988 | rtnl_unlock(); | ||
| 14972 | goto ulp_start; | 14989 | goto ulp_start; |
| 14973 | } | 14990 | } |
| 14974 | 14991 | ||
| @@ -14988,6 +15005,7 @@ static void bnxt_fw_reset_task(struct work_struct *work) · 13 unmodified lines | |||
| 14988 | bnxt_dl_health_fw_status_update(bp, true); | 15005 | bnxt_dl_health_fw_status_update(bp, true); |
| 14989 | } | 15006 | } |
| 14990 | netdev_unlock(bp->dev); | 15007 | netdev_unlock(bp->dev); |
| 15008 | rtnl_unlock(); | ||
| 14991 | bnxt_ulp_start(bp, 0); | 15009 | bnxt_ulp_start(bp, 0); |
| 14992 | bnxt_reenable_sriov(bp); | 15010 | bnxt_reenable_sriov(bp); |
| 14993 | netdev_lock(bp->dev); | 15011 | netdev_lock(bp->dev); |
| @@ -15936,7 +15954,7 @@ err_reset: · 942 unmodified lines | |||
| 15936 | rc); | 15954 | rc); |
| 15937 | napi_enable_locked(&bnapi->napi); | 15955 | napi_enable_locked(&bnapi->napi); |
| 15938 | bnxt_db_nq_arm(bp, &cpr->cp_db, cpr->cp_raw_cons); | 15956 | bnxt_db_nq_arm(bp, &cpr->cp_db, cpr->cp_raw_cons); |
| 15939 | bnxt_reset_task(bp, true); | 15957 | netif_close(dev); |
| 15940 | return rc; | 15958 | return rc; |
| 15941 | } | 15959 | } |
| 15942 | 15960 | ||
| @@ -16752,6 +16770,7 @@ static int bnxt_resume(struct device *device) · 809 unmodified lines | |||
| 16752 | struct bnxt *bp = netdev_priv(dev); | 16770 | struct bnxt *bp = netdev_priv(dev); |
| 16753 | int rc = 0; | 16771 | int rc = 0; |
| 16754 | 16772 | ||
| 16773 | rtnl_lock(); | ||
| 16755 | netdev_lock(dev); | 16774 | netdev_lock(dev); |
| 16756 | rc = pci_enable_device(bp->pdev); | 16775 | rc = pci_enable_device(bp->pdev); |
| 16757 | if (rc) { | 16776 | if (rc) { |
| @@ -16796,6 +16815,7 @@ static int bnxt_resume(struct device *device) · 38 unmodified lines | |||
| 16796 | 16815 | ||
| 16797 | resume_exit: | 16816 | resume_exit: |
| 16798 | netdev_unlock(bp->dev); | 16817 | netdev_unlock(bp->dev); |
| 16818 | rtnl_unlock(); | ||
| 16799 | bnxt_ulp_start(bp, rc); | 16819 | bnxt_ulp_start(bp, rc); |
| 16800 | if (!rc) | 16820 | if (!rc) |
| 16801 | bnxt_reenable_sriov(bp); | 16821 | bnxt_reenable_sriov(bp); |
| @@ -16961,6 +16981,7 @@ static void bnxt_io_resume(struct pci_dev *pdev) · 159 unmodified lines | |||
| 16961 | int err; | 16981 | int err; |
| 16962 | 16982 | ||
| 16963 | netdev_info(bp->dev, "PCI Slot Resume\n"); | 16983 | netdev_info(bp->dev, "PCI Slot Resume\n"); |
| 16984 | rtnl_lock(); | ||
| 16964 | netdev_lock(netdev); | 16985 | netdev_lock(netdev); |
| 16965 | 16986 | ||
| 16966 | err = bnxt_hwrm_func_qcaps(bp); | 16987 | err = bnxt_hwrm_func_qcaps(bp); |
| @@ -16978,6 +16999,7 @@ static void bnxt_io_resume(struct pci_dev *pdev) · 11 unmodified lines | |||
| 16978 | netif_device_attach(netdev); | 16999 | netif_device_attach(netdev); |
| 16979 | 17000 | ||
| 16980 | netdev_unlock(netdev); | 17001 | netdev_unlock(netdev); |
| 17002 | rtnl_unlock(); | ||
| 16981 | bnxt_ulp_start(bp, err); | 17003 | bnxt_ulp_start(bp, err); |
| 16982 | if (!err) | 17004 | if (!err) |
| 16983 | bnxt_reenable_sriov(bp); | 17005 | bnxt_reenable_sriov(bp); |
| @@ -997,22 +997,15 @@ static void macb_update_stats(struct macb *bp) · 996 unmodified lines | |||
| 997 | 997 | ||
| 998 | static int macb_halt_tx(struct macb *bp) | 998 | static int macb_halt_tx(struct macb *bp) |
| 999 | { | 999 | { |
| 1000 | unsigned long halt_time, timeout; | 1000 | u32 status; |
| 1001 | u32 status; | ||
| 1002 | 1001 | ||
| 1003 | macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(THALT)); | 1002 | macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(THALT)); |
| 1004 | 1003 | ||
| 1005 | timeout = jiffies + usecs_to_jiffies(MACB_HALT_TIMEOUT); | 1004 | /* Poll TSR until TGO is cleared or timeout. */ |
| 1006 | do { | 1005 | return read_poll_timeout_atomic(macb_readl, status, |
| 1007 | halt_time = jiffies; | 1006 | !(status & MACB_BIT(TGO)), |
| 1008 | status = macb_readl(bp, TSR); | 1007 | 250, MACB_HALT_TIMEOUT, false, |
| 1009 | if (!(status & MACB_BIT(TGO))) | 1008 | bp, TSR); |
| 1010 | return 0; | ||
| 1011 | |||
| 1012 | udelay(250); | ||
| 1013 | } while (time_before(halt_time, timeout)); | ||
| 1014 | |||
| 1015 | return -ETIMEDOUT; | ||
| 1016 | } | 1009 | } |
| 1017 | 1010 | ||
| 1018 | static void macb_tx_unmap(struct macb *bp, struct macb_tx_skb *tx_skb, int budget) | 1011 | static void macb_tx_unmap(struct macb *bp, struct macb_tx_skb *tx_skb, int budget) |
| @@ -67,6 +67,8 @@ · 66 unmodified lines | |||
| 67 | #define TSNEP_TX_TYPE_XDP_NDO_MAP_PAGE (TSNEP_TX_TYPE_XDP_NDO | TSNEP_TX_TYPE_MAP_PAGE) | 67 | #define TSNEP_TX_TYPE_XDP_NDO_MAP_PAGE (TSNEP_TX_TYPE_XDP_NDO | TSNEP_TX_TYPE_MAP_PAGE) |
| 68 | #define TSNEP_TX_TYPE_XDP (TSNEP_TX_TYPE_XDP_TX | TSNEP_TX_TYPE_XDP_NDO) | 68 | #define TSNEP_TX_TYPE_XDP (TSNEP_TX_TYPE_XDP_TX | TSNEP_TX_TYPE_XDP_NDO) |
| 69 | #define TSNEP_TX_TYPE_XSK BIT(12) | 69 | #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) | ||
| 70 | 72 | ||
| 71 | #define TSNEP_XDP_TX BIT(0) | 73 | #define TSNEP_XDP_TX BIT(0) |
| 72 | #define TSNEP_XDP_REDIRECT BIT(1) | 74 | #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 | |||
| 386 | if (entry->skb) { | 388 | if (entry->skb) { |
| 387 | entry->properties = length & TSNEP_DESC_LENGTH_MASK; | 389 | entry->properties = length & TSNEP_DESC_LENGTH_MASK; |
| 388 | entry->properties |= TSNEP_DESC_INTERRUPT_FLAG; | 390 | entry->properties |= TSNEP_DESC_INTERRUPT_FLAG; |
| 389 | if ((entry->type & TSNEP_TX_TYPE_SKB) && | 391 | if ((entry->type & TSNEP_TX_TYPE_SKB_TSTAMP) == TSNEP_TX_TYPE_SKB_TSTAMP) |
| 390 | (skb_shinfo(entry->skb)->tx_flags & SKBTX_IN_PROGRESS)) | ||
| 391 | entry->properties |= TSNEP_DESC_EXTENDED_WRITEBACK_FLAG; | 392 | entry->properties |= TSNEP_DESC_EXTENDED_WRITEBACK_FLAG; |
| 392 | 393 | ||
| 393 | /* toggle user flag to prevent false acknowledge | 394 | /* 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 | |||
| 479 | return mapped; | 480 | return mapped; |
| 480 | } | 481 | } |
| 481 | 482 | ||
| 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) | ||
| 483 | { | 485 | { |
| 484 | struct device *dmadev = tx->adapter->dmadev; | 486 | struct device *dmadev = tx->adapter->dmadev; |
| 485 | struct tsnep_tx_entry *entry; | 487 | 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 | |||
| 505 | entry->type = TSNEP_TX_TYPE_SKB_INLINE; | 507 | entry->type = TSNEP_TX_TYPE_SKB_INLINE; |
| 506 | mapped = 0; | 508 | mapped = 0; |
| 507 | } | 509 | } |
| 510 | |||
| 511 | if (do_tstamp) | ||
| 512 | entry->type |= TSNEP_TX_TYPE_TSTAMP; | ||
| 508 | } else { | 513 | } else { |
| 509 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1]; | 514 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1]; |
| 510 | 515 | ||
| @@ -558,11 +563,12 @@ static int tsnep_tx_unmap(struct tsnep_tx *tx, int index, int count) · 47 unmodified lines | |||
| 558 | static netdev_tx_t tsnep_xmit_frame_ring(struct sk_buff *skb, | 563 | static netdev_tx_t tsnep_xmit_frame_ring(struct sk_buff *skb, |
| 559 | struct tsnep_tx *tx) | 564 | struct tsnep_tx *tx) |
| 560 | { | 565 | { |
| 561 | int count = 1; | ||
| 562 | struct tsnep_tx_entry *entry; | 566 | struct tsnep_tx_entry *entry; |
| 567 | bool do_tstamp = false; | ||
| 568 | int count = 1; | ||
| 563 | int length; | 569 | int length; |
| 564 | int i; | ||
| 565 | int retval; | 570 | int retval; |
| 571 | int i; | ||
| 566 | 572 | ||
| 567 | if (skb_shinfo(skb)->nr_frags > 0) | 573 | if (skb_shinfo(skb)->nr_frags > 0) |
| 568 | count += skb_shinfo(skb)->nr_frags; | 574 | 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 | |||
| 579 | entry = &tx->entry[tx->write]; | 585 | entry = &tx->entry[tx->write]; |
| 580 | entry->skb = skb; | 586 | entry->skb = skb; |
| 581 | 587 | ||
| 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); | ||
| 583 | if (retval < 0) { | 595 | if (retval < 0) { |
| 584 | tsnep_tx_unmap(tx, tx->write, count); | 596 | tsnep_tx_unmap(tx, tx->write, count); |
| 585 | dev_kfree_skb_any(entry->skb); | 597 | 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 | |||
| 591 | } | 603 | } |
| 592 | length = retval; | 604 | length = retval; |
| 593 | 605 | ||
| 594 | if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) | ||
| 595 | skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; | ||
| 596 | |||
| 597 | for (i = 0; i < count; i++) | 606 | for (i = 0; i < count; i++) |
| 598 | tsnep_tx_activate(tx, (tx->write + i) & TSNEP_RING_MASK, length, | 607 | tsnep_tx_activate(tx, (tx->write + i) & TSNEP_RING_MASK, length, |
| 599 | i == count - 1); | 608 | i == count - 1); |
| @@ -844,8 +853,7 @@ static bool tsnep_tx_poll(struct tsnep_tx *tx, int napi_budget) · 244 unmodified lines | |||
| 844 | 853 | ||
| 845 | length = tsnep_tx_unmap(tx, tx->read, count); | 854 | length = tsnep_tx_unmap(tx, tx->read, count); |
| 846 | 855 | ||
| 847 | if ((entry->type & TSNEP_TX_TYPE_SKB) && | 856 | if (((entry->type & TSNEP_TX_TYPE_SKB_TSTAMP) == TSNEP_TX_TYPE_SKB_TSTAMP) && |
| 848 | (skb_shinfo(entry->skb)->tx_flags & SKBTX_IN_PROGRESS) && | ||
| 849 | (__le32_to_cpu(entry->desc_wb->properties) & | 857 | (__le32_to_cpu(entry->desc_wb->properties) & |
| 850 | TSNEP_DESC_EXTENDED_WRITEBACK_FLAG)) { | 858 | TSNEP_DESC_EXTENDED_WRITEBACK_FLAG)) { |
| 851 | struct skb_shared_hwtstamps hwtstamps; | 859 | struct skb_shared_hwtstamps hwtstamps; |
| @@ -717,6 +717,11 @@ int cgx_get_rx_stats(void *cgxd, int lmac_id, int idx, u64 *rx_stat) · 716 unmodified lines | |||
| 717 | 717 | ||
| 718 | if (!is_lmac_valid(cgx, lmac_id)) | 718 | if (!is_lmac_valid(cgx, lmac_id)) |
| 719 | return -ENODEV; | 719 | 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 | |||
| 720 | *rx_stat = cgx_read(cgx, lmac_id, CGXX_CMRX_RX_STAT0 + (idx * 8)); | 725 | *rx_stat = cgx_read(cgx, lmac_id, CGXX_CMRX_RX_STAT0 + (idx * 8)); |
| 721 | return 0; | 726 | return 0; |
| 722 | } | 727 | } |
| @@ -531,7 +531,8 @@ static int cn10k_mcs_write_tx_secy(struct otx2_nic *pfvf, · 530 unmodified lines | |||
| 531 | if (sw_tx_sc->encrypt) | 531 | if (sw_tx_sc->encrypt) |
| 532 | sectag_tci |= (MCS_TCI_E | MCS_TCI_C); | 532 | sectag_tci |= (MCS_TCI_E | MCS_TCI_C); |
| 533 | 533 | ||
| 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); | ||
| 535 | /* Write SecTag excluding AN bits(1..0) */ | 536 | /* Write SecTag excluding AN bits(1..0) */ |
| 536 | policy |= FIELD_PREP(MCS_TX_SECY_PLCY_ST_TCI, sectag_tci >> 2); | 537 | policy |= FIELD_PREP(MCS_TX_SECY_PLCY_ST_TCI, sectag_tci >> 2); |
| 537 | policy |= FIELD_PREP(MCS_TX_SECY_PLCY_ST_OFFSET, tag_offset); | 538 | policy |= FIELD_PREP(MCS_TX_SECY_PLCY_ST_OFFSET, tag_offset); |
| @@ -356,6 +356,7 @@ struct otx2_flow_config { · 355 unmodified lines | |||
| 356 | struct list_head flow_list_tc; | 356 | struct list_head flow_list_tc; |
| 357 | u8 ucast_flt_cnt; | 357 | u8 ucast_flt_cnt; |
| 358 | bool ntuple; | 358 | bool ntuple; |
| 359 | u16 ntuple_cnt; | ||
| 359 | }; | 360 | }; |
| 360 | 361 | ||
| 361 | struct dev_hw_ops { | 362 | struct dev_hw_ops { |
| @@ -41,6 +41,7 @@ static int otx2_dl_mcam_count_set(struct devlink *devlink, u32 id, · 40 unmodified lines | |||
| 41 | if (!pfvf->flow_cfg) | 41 | if (!pfvf->flow_cfg) |
| 42 | return 0; | 42 | return 0; |
| 43 | 43 | ||
| 44 | pfvf->flow_cfg->ntuple_cnt = ctx->val.vu16; | ||
| 44 | otx2_alloc_mcam_entries(pfvf, ctx->val.vu16); | 45 | otx2_alloc_mcam_entries(pfvf, ctx->val.vu16); |
| 45 | 46 | ||
| 46 | return 0; | 47 | return 0; |
| @@ -315,7 +315,7 @@ static void otx2_get_pauseparam(struct net_device *netdev, · 314 unmodified lines | |||
| 315 | struct otx2_nic *pfvf = netdev_priv(netdev); | 315 | struct otx2_nic *pfvf = netdev_priv(netdev); |
| 316 | struct cgx_pause_frm_cfg *req, *rsp; | 316 | struct cgx_pause_frm_cfg *req, *rsp; |
| 317 | 317 | ||
| 318 | if (is_otx2_lbkvf(pfvf->pdev)) | 318 | if (is_otx2_lbkvf(pfvf->pdev) || is_otx2_sdp_rep(pfvf->pdev)) |
| 319 | return; | 319 | return; |
| 320 | 320 | ||
| 321 | mutex_lock(&pfvf->mbox.lock); | 321 | mutex_lock(&pfvf->mbox.lock); |
| @@ -347,7 +347,7 @@ static int otx2_set_pauseparam(struct net_device *netdev, · 25 unmodified lines | |||
| 347 | if (pause->autoneg) | 347 | if (pause->autoneg) |
| 348 | return -EOPNOTSUPP; | 348 | return -EOPNOTSUPP; |
| 349 | 349 | ||
| 350 | if (is_otx2_lbkvf(pfvf->pdev)) | 350 | if (is_otx2_lbkvf(pfvf->pdev) || is_otx2_sdp_rep(pfvf->pdev)) |
| 351 | return -EOPNOTSUPP; | 351 | return -EOPNOTSUPP; |
| 352 | 352 | ||
| 353 | if (pause->rx_pause) | 353 | if (pause->rx_pause) |
| @@ -941,8 +941,8 @@ static u32 otx2_get_link(struct net_device *netdev) · 587 unmodified lines | |||
| 941 | { | 941 | { |
| 942 | struct otx2_nic *pfvf = netdev_priv(netdev); | 942 | struct otx2_nic *pfvf = netdev_priv(netdev); |
| 943 | 943 | ||
| 944 | /* LBK link is internal and always UP */ | 944 | /* LBK and SDP links are internal and always UP */ |
| 945 | if (is_otx2_lbkvf(pfvf->pdev)) | 945 | if (is_otx2_lbkvf(pfvf->pdev) || is_otx2_sdp_rep(pfvf->pdev)) |
| 946 | return 1; | 946 | return 1; |
| 947 | return pfvf->linfo.link_up; | 947 | return pfvf->linfo.link_up; |
| 948 | } | 948 | } |
| @@ -1413,7 +1413,7 @@ static int otx2vf_get_link_ksettings(struct net_device *netdev, · 464 unmodified lines | |||
| 1413 | { | 1413 | { |
| 1414 | struct otx2_nic *pfvf = netdev_priv(netdev); | 1414 | struct otx2_nic *pfvf = netdev_priv(netdev); |
| 1415 | 1415 | ||
| 1416 | if (is_otx2_lbkvf(pfvf->pdev)) { | 1416 | if (is_otx2_lbkvf(pfvf->pdev) || is_otx2_sdp_rep(pfvf->pdev)) { |
| 1417 | cmd->base.duplex = DUPLEX_FULL; | 1417 | cmd->base.duplex = DUPLEX_FULL; |
| 1418 | cmd->base.speed = SPEED_100000; | 1418 | cmd->base.speed = SPEED_100000; |
| 1419 | } else { | 1419 | } else { |
| @@ -247,7 +247,7 @@ int otx2_mcam_entry_init(struct otx2_nic *pfvf) · 246 unmodified lines | |||
| 247 | mutex_unlock(&pfvf->mbox.lock); | 247 | mutex_unlock(&pfvf->mbox.lock); |
| 248 | 248 | ||
| 249 | /* Allocate entries for Ntuple filters */ | 249 | /* 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); |
| 251 | if (count <= 0) { | 251 | if (count <= 0) { |
| 252 | otx2_clear_ntuple_flow_info(pfvf, flow_cfg); | 252 | otx2_clear_ntuple_flow_info(pfvf, flow_cfg); |
| 253 | return 0; | 253 | return 0; |
| @@ -307,6 +307,7 @@ int otx2_mcam_flow_init(struct otx2_nic *pf) · 53 unmodified lines | |||
| 307 | INIT_LIST_HEAD(&pf->flow_cfg->flow_list_tc); | 307 | INIT_LIST_HEAD(&pf->flow_cfg->flow_list_tc); |
| 308 | 308 | ||
| 309 | pf->flow_cfg->ucast_flt_cnt = OTX2_DEFAULT_UNICAST_FLOWS; | 309 | pf->flow_cfg->ucast_flt_cnt = OTX2_DEFAULT_UNICAST_FLOWS; |
| 310 | pf->flow_cfg->ntuple_cnt = OTX2_DEFAULT_FLOWCOUNT; | ||
| 310 | 311 | ||
| 311 | /* Allocate bare minimum number of MCAM entries needed for | 312 | /* Allocate bare minimum number of MCAM entries needed for |
| 312 | * unicast and ntuple filters. | 313 | * unicast and ntuple filters. |
| @@ -4748,7 +4748,7 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) · 4747 unmodified lines | |||
| 4748 | } | 4748 | } |
| 4749 | 4749 | ||
| 4750 | if (mtk_is_netsys_v3_or_greater(mac->hw) && | 4750 | 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) && |
| 4752 | id == MTK_GMAC1_ID) { | 4752 | id == MTK_GMAC1_ID) { |
| 4753 | mac->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | | 4753 | mac->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | |
| 4754 | MAC_SYM_PAUSE | | 4754 | MAC_SYM_PAUSE | |
| @@ -4349,6 +4349,10 @@ static netdev_features_t mlx5e_fix_uplink_rep_features(struct net_device *netdev · 4348 unmodified lines | |||
| 4349 | if (netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER) | 4349 | if (netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER) |
| 4350 | netdev_warn(netdev, "Disabling HW_VLAN CTAG FILTERING, not supported in switchdev mode\n"); | 4350 | netdev_warn(netdev, "Disabling HW_VLAN CTAG FILTERING, not supported in switchdev mode\n"); |
| 4351 | 4351 | ||
| 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 | |||
| 4352 | return features; | 4356 | return features; |
| 4353 | } | 4357 | } |
| 4354 | 4358 | ||
| @@ -3014,6 +3014,9 @@ static int mlxsw_sp_neigh_rif_made_sync(struct mlxsw_sp *mlxsw_sp, · 3013 unmodified lines | |||
| 3014 | .rif = rif, | 3014 | .rif = rif, |
| 3015 | }; | 3015 | }; |
| 3016 | 3016 | ||
| 3017 | if (!mlxsw_sp_dev_lower_is_port(mlxsw_sp_rif_dev(rif))) | ||
| 3018 | return 0; | ||
| 3019 | |||
| 3017 | neigh_for_each(&arp_tbl, mlxsw_sp_neigh_rif_made_sync_each, &rms); | 3020 | neigh_for_each(&arp_tbl, mlxsw_sp_neigh_rif_made_sync_each, &rms); |
| 3018 | if (rms.err) | 3021 | if (rms.err) |
| 3019 | goto err_arp; | 3022 | goto err_arp; |
| @@ -203,7 +203,7 @@ static struct pci_driver qede_pci_driver = { · 202 unmodified lines | |||
| 203 | }; | 203 | }; |
| 204 | 204 | ||
| 205 | static struct qed_eth_cb_ops qede_ll_ops = { | 205 | static struct qed_eth_cb_ops qede_ll_ops = { |
| 206 | { | 206 | .common = { |
| 207 | #ifdef CONFIG_RFS_ACCEL | 207 | #ifdef CONFIG_RFS_ACCEL |
| 208 | .arfs_filter_op = qede_arfs_filter_op, | 208 | .arfs_filter_op = qede_arfs_filter_op, |
| 209 | #endif | 209 | #endif |
| @@ -1484,8 +1484,11 @@ static int qlcnic_sriov_channel_cfg_cmd(struct qlcnic_adapter *adapter, u8 cmd_o · 1483 unmodified lines | |||
| 1484 | } | 1484 | } |
| 1485 | 1485 | ||
| 1486 | cmd_op = (cmd.rsp.arg[0] & 0xff); | 1486 | cmd_op = (cmd.rsp.arg[0] & 0xff); |
| 1487 | if (cmd.rsp.arg[0] >> 25 == 2) | 1487 | if (cmd.rsp.arg[0] >> 25 == 2) { |
| 1488 | return 2; | 1488 | ret = 2; |
| 1489 | goto out; | ||
| 1490 | } | ||
| 1491 | |||
| 1489 | if (cmd_op == QLCNIC_BC_CMD_CHANNEL_INIT) | 1492 | if (cmd_op == QLCNIC_BC_CMD_CHANNEL_INIT) |
| 1490 | set_bit(QLC_BC_VF_STATE, &vf->state); | 1493 | set_bit(QLC_BC_VF_STATE, &vf->state); |
| 1491 | else | 1494 | else |
| @@ -434,14 +434,20 @@ static int wx_host_interface_command_r(struct wx *wx, u32 *buffer, · 433 unmodified lines | |||
| 434 | wr32m(wx, WX_SW2FW_MBOX_CMD, WX_SW2FW_MBOX_CMD_VLD, WX_SW2FW_MBOX_CMD_VLD); | 434 | wr32m(wx, WX_SW2FW_MBOX_CMD, WX_SW2FW_MBOX_CMD_VLD, WX_SW2FW_MBOX_CMD_VLD); |
| 435 | 435 | ||
| 436 | /* polling reply from FW */ | 436 | /* polling reply from FW */ |
| 437 | err = read_poll_timeout(wx_poll_fw_reply, reply, reply, 1000, 50000, | 437 | err = read_poll_timeout(wx_poll_fw_reply, reply, reply, 2000, |
| 438 | true, wx, buffer, send_cmd); | 438 | timeout * 1000, true, wx, buffer, send_cmd); |
| 439 | if (err) { | 439 | if (err) { |
| 440 | wx_err(wx, "Polling from FW messages timeout, cmd: 0x%x, index: %d\n", | 440 | wx_err(wx, "Polling from FW messages timeout, cmd: 0x%x, index: %d\n", |
| 441 | send_cmd, wx->swfw_index); | 441 | send_cmd, wx->swfw_index); |
| 442 | goto rel_out; | 442 | goto rel_out; |
| 443 | } | 443 | } |
| 444 | 444 | ||
| 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 | |||
| 445 | /* expect no reply from FW then return */ | 451 | /* expect no reply from FW then return */ |
| 446 | if (!return_data) | 452 | if (!return_data) |
| 447 | goto rel_out; | 453 | goto rel_out; |
| @@ -99,9 +99,15 @@ static int txgbe_calc_eeprom_checksum(struct wx *wx, u16 *checksum) · 98 unmodified lines | |||
| 99 | } | 99 | } |
| 100 | local_buffer = eeprom_ptrs; | 100 | local_buffer = eeprom_ptrs; |
| 101 | 101 | ||
| 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 | } | ||
| 103 | if (i != wx->eeprom.sw_region_offset + TXGBE_EEPROM_CHECKSUM) | 108 | if (i != wx->eeprom.sw_region_offset + TXGBE_EEPROM_CHECKSUM) |
| 104 | *checksum += local_buffer[i]; | 109 | *checksum += local_buffer[i]; |
| 110 | } | ||
| 105 | 111 | ||
| 106 | kvfree(eeprom_ptrs); | 112 | kvfree(eeprom_ptrs); |
| 107 | 113 | ||
| @@ -158,6 +158,8 @@ · 157 unmodified lines | |||
| 158 | #define TXGBE_EEPROM_VERSION_L 0x1D | 158 | #define TXGBE_EEPROM_VERSION_L 0x1D |
| 159 | #define TXGBE_EEPROM_VERSION_H 0x1E | 159 | #define TXGBE_EEPROM_VERSION_H 0x1E |
| 160 | #define TXGBE_ISCSI_BOOT_CONFIG 0x07 | 160 | #define TXGBE_ISCSI_BOOT_CONFIG 0x07 |
| 161 | #define TXGBE_EEPROM_I2C_SRART_PTR 0x580 | ||
| 162 | #define TXGBE_EEPROM_I2C_END_PTR 0x800 | ||
| 161 | 163 | ||
| 162 | #define TXGBE_MAX_MSIX_VECTORS 64 | 164 | #define TXGBE_MAX_MSIX_VECTORS 64 |
| 163 | #define TXGBE_MAX_FDIR_INDICES 63 | 165 | #define TXGBE_MAX_FDIR_INDICES 63 |
| @@ -158,7 +158,6 @@ struct hv_netvsc_packet { · 157 unmodified lines | |||
| 158 | u8 cp_partial; /* partial copy into send buffer */ | 158 | u8 cp_partial; /* partial copy into send buffer */ |
| 159 | 159 | ||
| 160 | u8 rmsg_size; /* RNDIS header and PPI size */ | 160 | u8 rmsg_size; /* RNDIS header and PPI size */ |
| 161 | u8 rmsg_pgcnt; /* page count of RNDIS header and PPI */ | ||
| 162 | u8 page_buf_cnt; | 161 | u8 page_buf_cnt; |
| 163 | 162 | ||
| 164 | u16 q_idx; | 163 | u16 q_idx; |
| @@ -893,6 +892,18 @@ struct nvsp_message { · 728 unmodified lines | |||
| 893 | sizeof(struct nvsp_message)) | 892 | sizeof(struct nvsp_message)) |
| 894 | #define NETVSC_MIN_IN_MSG_SIZE sizeof(struct vmpacket_descriptor) | 893 | #define NETVSC_MIN_IN_MSG_SIZE sizeof(struct vmpacket_descriptor) |
| 895 | 894 | ||
| 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 | |||
| 896 | /* Estimated requestor size: | 907 | /* Estimated requestor size: |
| 897 | * out_ring_size/min_out_msg_size + in_ring_size/min_in_msg_size | 908 | * out_ring_size/min_out_msg_size + in_ring_size/min_in_msg_size |
| 898 | */ | 909 | */ |
| @@ -953,8 +953,7 @@ static void netvsc_copy_to_send_buf(struct netvsc_device *net_device, · 952 unmodified lines | |||
| 953 | + pend_size; | 953 | + pend_size; |
| 954 | int i; | 954 | int i; |
| 955 | u32 padding = 0; | 955 | u32 padding = 0; |
| 956 | u32 page_count = packet->cp_partial ? packet->rmsg_pgcnt : | 956 | u32 page_count = packet->cp_partial ? 1 : packet->page_buf_cnt; |
| 957 | packet->page_buf_cnt; | ||
| 958 | u32 remain; | 957 | u32 remain; |
| 959 | 958 | ||
| 960 | /* Add padding */ | 959 | /* Add padding */ |
| @@ -1055,6 +1054,42 @@ static int netvsc_dma_map(struct hv_device *hv_dev, · 94 unmodified lines | |||
| 1055 | return 0; | 1054 | return 0; |
| 1056 | } | 1055 | } |
| 1057 | 1056 | ||
| 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 | |||
| 1058 | static inline int netvsc_send_pkt( | 1093 | static inline int netvsc_send_pkt( |
| 1059 | struct hv_device *device, | 1094 | struct hv_device *device, |
| 1060 | struct hv_netvsc_packet *packet, | 1095 | struct hv_netvsc_packet *packet, |
| @@ -1097,8 +1132,11 @@ static inline int netvsc_send_pkt( · 36 unmodified lines | |||
| 1097 | 1132 | ||
| 1098 | packet->dma_range = NULL; | 1133 | packet->dma_range = NULL; |
| 1099 | if (packet->page_buf_cnt) { | 1134 | if (packet->page_buf_cnt) { |
| 1135 | struct vmbus_channel_packet_page_buffer desc; | ||
| 1136 | u32 desc_size; | ||
| 1137 | |||
| 1100 | if (packet->cp_partial) | 1138 | if (packet->cp_partial) |
| 1101 | pb += packet->rmsg_pgcnt; | 1139 | pb++; |
| 1102 | 1140 | ||
| 1103 | ret = netvsc_dma_map(ndev_ctx->device_ctx, packet, pb); | 1141 | ret = netvsc_dma_map(ndev_ctx->device_ctx, packet, pb); |
| 1104 | if (ret) { | 1142 | if (ret) { |
| @@ -1106,11 +1144,12 @@ static inline int netvsc_send_pkt( · 1 unmodified line | |||
| 1106 | goto exit; | 1144 | goto exit; |
| 1107 | } | 1145 | } |
| 1108 | 1146 | ||
| 1109 | ret = vmbus_sendpacket_pagebuffer(out_channel, | 1147 | netvsc_build_mpb_array(pb, packet->page_buf_cnt, |
| 1110 | pb, packet->page_buf_cnt, | 1148 | (struct vmbus_packet_mpb_array *)&desc, |
| 1111 | &nvmsg, sizeof(nvmsg), | 1149 | &desc_size); |
| 1112 | req_id); | 1150 | ret = vmbus_sendpacket_mpb_desc(out_channel, |
| 1113 | 1151 | (struct vmbus_packet_mpb_array *)&desc, | |
| 1152 | desc_size, &nvmsg, sizeof(nvmsg), req_id); | ||
| 1114 | if (ret) | 1153 | if (ret) |
| 1115 | netvsc_dma_unmap(ndev_ctx->device_ctx, packet); | 1154 | netvsc_dma_unmap(ndev_ctx->device_ctx, packet); |
| 1116 | } else { | 1155 | } else { |
| @@ -1259,7 +1298,7 @@ int netvsc_send(struct net_device *ndev, · 142 unmodified lines | |||
| 1259 | packet->send_buf_index = section_index; | 1298 | packet->send_buf_index = section_index; |
| 1260 | 1299 | ||
| 1261 | if (packet->cp_partial) { | 1300 | if (packet->cp_partial) { |
| 1262 | packet->page_buf_cnt -= packet->rmsg_pgcnt; | 1301 | packet->page_buf_cnt--; |
| 1263 | packet->total_data_buflen = msd_len + packet->rmsg_size; | 1302 | packet->total_data_buflen = msd_len + packet->rmsg_size; |
| 1264 | } else { | 1303 | } else { |
| 1265 | packet->page_buf_cnt = 0; | 1304 | packet->page_buf_cnt = 0; |
| @@ -326,43 +326,10 @@ static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb, · 325 unmodified lines | |||
| 326 | return txq; | 326 | return txq; |
| 327 | } | 327 | } |
| 328 | 328 | ||
| 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 | |||
| 360 | static u32 init_page_array(void *hdr, u32 len, struct sk_buff *skb, | 329 | static u32 init_page_array(void *hdr, u32 len, struct sk_buff *skb, |
| 361 | struct hv_netvsc_packet *packet, | 330 | struct hv_netvsc_packet *packet, |
| 362 | struct hv_page_buffer *pb) | 331 | struct hv_page_buffer *pb) |
| 363 | { | 332 | { |
| 364 | u32 slots_used = 0; | ||
| 365 | char *data = skb->data; | ||
| 366 | int frags = skb_shinfo(skb)->nr_frags; | 333 | int frags = skb_shinfo(skb)->nr_frags; |
| 367 | int i; | 334 | int i; |
| 368 | 335 | ||
| @@ -371,28 +338,27 @@ static u32 init_page_array(void *hdr, u32 len, struct sk_buff *skb, · 2 unmodified lines | |||
| 371 | * 2. skb linear data | 338 | * 2. skb linear data |
| 372 | * 3. skb fragment data | 339 | * 3. skb fragment data |
| 373 | */ | 340 | */ |
| 374 | slots_used += fill_pg_buf(virt_to_hvpfn(hdr), | ||
| 375 | offset_in_hvpage(hdr), | ||
| 376 | len, | ||
| 377 | &pb[slots_used]); | ||
| 378 | 341 | ||
| 342 | pb[0].offset = offset_in_hvpage(hdr); | ||
| 343 | pb[0].len = len; | ||
| 344 | pb[0].pfn = virt_to_hvpfn(hdr); | ||
| 379 | packet->rmsg_size = len; | 345 | packet->rmsg_size = len; |
| 380 | packet->rmsg_pgcnt = slots_used; | ||
| 381 | 346 | ||
| 382 | slots_used += fill_pg_buf(virt_to_hvpfn(data), | 347 | pb[1].offset = offset_in_hvpage(skb->data); |
| 383 | offset_in_hvpage(data), | 348 | pb[1].len = skb_headlen(skb); |
| 384 | skb_headlen(skb), | 349 | pb[1].pfn = virt_to_hvpfn(skb->data); |
| 385 | &pb[slots_used]); | ||
| 386 | 350 | ||
| 387 | for (i = 0; i < frags; i++) { | 351 | for (i = 0; i < frags; i++) { |
| 388 | skb_frag_t *frag = skb_shinfo(skb)->frags + i; | 352 | 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); | ||
| 389 | 356 | ||
| 390 | slots_used += fill_pg_buf(page_to_hvpfn(skb_frag_page(frag)), | 357 | cur_pb->offset = offset_in_hvpage(offset); |
| 391 | skb_frag_off(frag), | 358 | cur_pb->len = skb_frag_size(frag); |
| 392 | skb_frag_size(frag), | 359 | cur_pb->pfn = pfn + (offset >> HV_HYP_PAGE_SHIFT); |
| 393 | &pb[slots_used]); | ||
| 394 | } | 360 | } |
| 395 | return slots_used; | 361 | return frags + 2; |
| 396 | } | 362 | } |
| 397 | 363 | ||
| 398 | static int count_skb_frag_slots(struct sk_buff *skb) | 364 | 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 | |||
| 483 | struct net_device *vf_netdev; | 449 | struct net_device *vf_netdev; |
| 484 | u32 rndis_msg_size; | 450 | u32 rndis_msg_size; |
| 485 | u32 hash; | 451 | u32 hash; |
| 486 | struct hv_page_buffer pb[MAX_PAGE_BUFFER_COUNT]; | 452 | struct hv_page_buffer pb[MAX_DATA_RANGES]; |
| 487 | 453 | ||
| 488 | /* If VF is present and up then redirect packets to it. | 454 | /* If VF is present and up then redirect packets to it. |
| 489 | * Skip the VF if it is marked down or has no carrier. | 455 | * Skip the VF if it is marked down or has no carrier. |
| @@ -225,8 +225,7 @@ static int rndis_filter_send_request(struct rndis_device *dev, · 224 unmodified lines | |||
| 225 | struct rndis_request *req) | 225 | struct rndis_request *req) |
| 226 | { | 226 | { |
| 227 | struct hv_netvsc_packet *packet; | 227 | struct hv_netvsc_packet *packet; |
| 228 | struct hv_page_buffer page_buf[2]; | 228 | struct hv_page_buffer pb; |
| 229 | struct hv_page_buffer *pb = page_buf; | ||
| 230 | int ret; | 229 | int ret; |
| 231 | 230 | ||
| 232 | /* Setup the packet to send it */ | 231 | /* Setup the packet to send it */ |
| @@ -235,27 +234,14 @@ static int rndis_filter_send_request(struct rndis_device *dev, · 2 unmodified lines | |||
| 235 | packet->total_data_buflen = req->request_msg.msg_len; | 234 | packet->total_data_buflen = req->request_msg.msg_len; |
| 236 | packet->page_buf_cnt = 1; | 235 | packet->page_buf_cnt = 1; |
| 237 | 236 | ||
| 238 | pb[0].pfn = virt_to_phys(&req->request_msg) >> | 237 | pb.pfn = virt_to_phys(&req->request_msg) >> HV_HYP_PAGE_SHIFT; |
| 239 | HV_HYP_PAGE_SHIFT; | 238 | pb.len = req->request_msg.msg_len; |
| 240 | pb[0].len = req->request_msg.msg_len; | 239 | pb.offset = offset_in_hvpage(&req->request_msg); |
| 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 | } | ||
| 254 | 240 | ||
| 255 | trace_rndis_send(dev->ndev, 0, &req->request_msg); | 241 | trace_rndis_send(dev->ndev, 0, &req->request_msg); |
| 256 | 242 | ||
| 257 | rcu_read_lock_bh(); | 243 | 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); |
| 259 | rcu_read_unlock_bh(); | 245 | rcu_read_unlock_bh(); |
| 260 | 246 | ||
| 261 | return ret; | 247 | return ret; |
| @@ -2027,12 +2027,6 @@ static int ksz9477_config_init(struct phy_device *phydev) · 2026 unmodified lines | |||
| 2027 | return err; | 2027 | return err; |
| 2028 | } | 2028 | } |
| 2029 | 2029 | ||
| 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 | |||
| 2036 | return kszphy_config_init(phydev); | 2030 | return kszphy_config_init(phydev); |
| 2037 | } | 2031 | } |
| 2038 | 2032 | ||
| @@ -5705,7 +5699,6 @@ static struct phy_driver ksphy_driver[] = { · 3666 unmodified lines | |||
| 5705 | .handle_interrupt = kszphy_handle_interrupt, | 5699 | .handle_interrupt = kszphy_handle_interrupt, |
| 5706 | .suspend = genphy_suspend, | 5700 | .suspend = genphy_suspend, |
| 5707 | .resume = ksz9477_resume, | 5701 | .resume = ksz9477_resume, |
| 5708 | .get_features = ksz9477_get_features, | ||
| 5709 | } }; | 5702 | } }; |
| 5710 | 5703 | ||
| 5711 | module_phy_driver(ksphy_driver); | 5704 | module_phy_driver(ksphy_driver); |
| @@ -1011,6 +1011,7 @@ void mt76_dma_cleanup(struct mt76_dev *dev) · 1010 unmodified lines | |||
| 1011 | int i; | 1011 | int i; |
| 1012 | 1012 | ||
| 1013 | mt76_worker_disable(&dev->tx_worker); | 1013 | mt76_worker_disable(&dev->tx_worker); |
| 1014 | napi_disable(&dev->tx_napi); | ||
| 1014 | netif_napi_del(&dev->tx_napi); | 1015 | netif_napi_del(&dev->tx_napi); |
| 1015 | 1016 | ||
| 1016 | for (i = 0; i < ARRAY_SIZE(dev->phys); i++) { | 1017 | for (i = 0; i < ARRAY_SIZE(dev->phys); i++) { |
| @@ -1924,14 +1924,14 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy, · 1923 unmodified lines | |||
| 1924 | mt7925_mcu_sta_mld_tlv(skb, info->vif, info->link_sta->sta); | 1924 | mt7925_mcu_sta_mld_tlv(skb, info->vif, info->link_sta->sta); |
| 1925 | mt7925_mcu_sta_eht_mld_tlv(skb, info->vif, info->link_sta->sta); | 1925 | mt7925_mcu_sta_eht_mld_tlv(skb, info->vif, info->link_sta->sta); |
| 1926 | } | 1926 | } |
| 1927 | |||
| 1928 | mt7925_mcu_sta_hdr_trans_tlv(skb, info->vif, info->link_sta); | ||
| 1929 | } | 1927 | } |
| 1930 | 1928 | ||
| 1931 | if (!info->enable) { | 1929 | if (!info->enable) { |
| 1932 | mt7925_mcu_sta_remove_tlv(skb); | 1930 | mt7925_mcu_sta_remove_tlv(skb); |
| 1933 | mt76_connac_mcu_add_tlv(skb, STA_REC_MLD_OFF, | 1931 | mt76_connac_mcu_add_tlv(skb, STA_REC_MLD_OFF, |
| 1934 | sizeof(struct tlv)); | 1932 | sizeof(struct tlv)); |
| 1933 | } else { | ||
| 1934 | mt7925_mcu_sta_hdr_trans_tlv(skb, info->vif, info->link_sta); | ||
| 1935 | } | 1935 | } |
| 1936 | 1936 | ||
| 1937 | return mt76_mcu_skb_send_msg(dev, skb, info->cmd, true); | 1937 | return mt76_mcu_skb_send_msg(dev, skb, info->cmd, true); |
| @@ -1819,6 +1819,7 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd) · 1818 unmodified lines | |||
| 1819 | return SCSI_MLQUEUE_DEVICE_BUSY; | 1819 | return SCSI_MLQUEUE_DEVICE_BUSY; |
| 1820 | } | 1820 | } |
| 1821 | 1821 | ||
| 1822 | payload->rangecount = 1; | ||
| 1822 | payload->range.len = length; | 1823 | payload->range.len = length; |
| 1823 | payload->range.offset = offset_in_hvpg; | 1824 | payload->range.offset = offset_in_hvpg; |
| 1824 | 1825 | ||
| @@ -1167,13 +1167,6 @@ extern int vmbus_sendpacket(struct vmbus_channel *channel, · 1166 unmodified lines | |||
| 1167 | enum vmbus_packet_type type, | 1167 | enum vmbus_packet_type type, |
| 1168 | u32 flags); | 1168 | u32 flags); |
| 1169 | 1169 | ||
| 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 | |||
| 1177 | extern int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel, | 1170 | extern int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel, |
| 1178 | struct vmbus_packet_mpb_array *mpb, | 1171 | struct vmbus_packet_mpb_array *mpb, |
| 1179 | u32 desc_size, | 1172 | u32 desc_size, |
| @@ -44,7 +44,6 @@ · 43 unmodified lines | |||
| 44 | #define MICREL_PHY_50MHZ_CLK BIT(0) | 44 | #define MICREL_PHY_50MHZ_CLK BIT(0) |
| 45 | #define MICREL_PHY_FXEN BIT(1) | 45 | #define MICREL_PHY_FXEN BIT(1) |
| 46 | #define MICREL_KSZ8_P1_ERRATA BIT(2) | 46 | #define MICREL_KSZ8_P1_ERRATA BIT(2) |
| 47 | #define MICREL_NO_EEE BIT(3) | ||
| 48 | 47 | ||
| 49 | #define MICREL_KSZ9021_EXTREG_CTRL 0xB | 48 | #define MICREL_KSZ9021_EXTREG_CTRL 0xB |
| 50 | #define MICREL_KSZ9021_EXTREG_DATA_WRITE 0xC | 49 | #define MICREL_KSZ9021_EXTREG_DATA_WRITE 0xC |
| @@ -1798,6 +1798,7 @@ struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list, · 1797 unmodified lines | |||
| 1798 | void hci_uuids_clear(struct hci_dev *hdev); | 1798 | void hci_uuids_clear(struct hci_dev *hdev); |
| 1799 | 1799 | ||
| 1800 | void hci_link_keys_clear(struct hci_dev *hdev); | 1800 | void hci_link_keys_clear(struct hci_dev *hdev); |
| 1801 | u8 *hci_conn_key_enc_size(struct hci_conn *conn); | ||
| 1801 | struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); | 1802 | struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); |
| 1802 | struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, | 1803 | struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, |
| 1803 | bdaddr_t *bdaddr, u8 *val, u8 type, | 1804 | bdaddr_t *bdaddr, u8 *val, u8 type, |
| @@ -1031,6 +1031,21 @@ static inline struct sk_buff *__qdisc_dequeue_head(struct qdisc_skb_head *qh) · 1030 unmodified lines | |||
| 1031 | return skb; | 1031 | return skb; |
| 1032 | } | 1032 | } |
| 1033 | 1033 | ||
| 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 | |||
| 1034 | static inline struct sk_buff *qdisc_dequeue_head(struct Qdisc *sch) | 1049 | static inline struct sk_buff *qdisc_dequeue_head(struct Qdisc *sch) |
| 1035 | { | 1050 | { |
| 1036 | struct sk_buff *skb = __qdisc_dequeue_head(&sch->q); | 1051 | struct sk_buff *skb = __qdisc_dequeue_head(&sch->q); |
| @@ -506,28 +506,32 @@ batadv_hardif_is_iface_up(const struct batadv_hard_iface *hard_iface) · 505 unmodified lines | |||
| 506 | return false; | 506 | return false; |
| 507 | } | 507 | } |
| 508 | 508 | ||
| 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) |
| 510 | { | 510 | { |
| 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; | ||
| 512 | 513 | ||
| 513 | rcu_read_lock(); | 514 | if (!mesh_iface) |
| 514 | list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { | 515 | return; |
| 515 | if (hard_iface->if_status != BATADV_IF_ACTIVE && | 516 | |
| 516 | hard_iface->if_status != BATADV_IF_TO_BE_ACTIVATED) | 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) | ||
| 517 | continue; | 522 | continue; |
| 518 | 523 | ||
| 519 | if (hard_iface->net_dev == net_dev) | 524 | if (tmp_hard_iface->if_status == BATADV_IF_NOT_IN_USE) |
| 520 | continue; | 525 | continue; |
| 521 | 526 | ||
| 522 | if (!batadv_compare_eth(hard_iface->net_dev->dev_addr, | 527 | if (!batadv_compare_eth(tmp_hard_iface->net_dev->dev_addr, |
| 523 | net_dev->dev_addr)) | 528 | hard_iface->net_dev->dev_addr)) |
| 524 | continue; | 529 | continue; |
| 525 | 530 | ||
| 526 | pr_warn("The newly added mac address (%pM) already exists on: %s\n", | 531 | 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); |
| 528 | pr_warn("It is strongly recommended to keep mac addresses unique to avoid problems!\n"); | 533 | pr_warn("It is strongly recommended to keep mac addresses unique to avoid problems!\n"); |
| 529 | } | 534 | } |
| 530 | rcu_read_unlock(); | ||
| 531 | } | 535 | } |
| 532 | 536 | ||
| 533 | /** | 537 | /** |
| @@ -763,6 +767,8 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, · 229 unmodified lines | |||
| 763 | hard_iface->net_dev->name, hardif_mtu, | 767 | hard_iface->net_dev->name, hardif_mtu, |
| 764 | required_mtu); | 768 | required_mtu); |
| 765 | 769 | ||
| 770 | batadv_check_known_mac_addr(hard_iface); | ||
| 771 | |||
| 766 | if (batadv_hardif_is_iface_up(hard_iface)) | 772 | if (batadv_hardif_is_iface_up(hard_iface)) |
| 767 | batadv_hardif_activate_interface(hard_iface); | 773 | batadv_hardif_activate_interface(hard_iface); |
| 768 | else | 774 | else |
| @@ -901,7 +907,6 @@ batadv_hardif_add_interface(struct net_device *net_dev) · 132 unmodified lines | |||
| 901 | 907 | ||
| 902 | batadv_v_hardif_init(hard_iface); | 908 | batadv_v_hardif_init(hard_iface); |
| 903 | 909 | ||
| 904 | batadv_check_known_mac_addr(hard_iface->net_dev); | ||
| 905 | kref_get(&hard_iface->refcount); | 910 | kref_get(&hard_iface->refcount); |
| 906 | list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list); | 911 | list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list); |
| 907 | batadv_hardif_generation++; | 912 | batadv_hardif_generation++; |
| @@ -988,7 +993,7 @@ static int batadv_hard_if_event(struct notifier_block *this, · 80 unmodified lines | |||
| 988 | if (hard_iface->if_status == BATADV_IF_NOT_IN_USE) | 993 | if (hard_iface->if_status == BATADV_IF_NOT_IN_USE) |
| 989 | goto hardif_put; | 994 | goto hardif_put; |
| 990 | 995 | ||
| 991 | batadv_check_known_mac_addr(hard_iface->net_dev); | 996 | batadv_check_known_mac_addr(hard_iface); |
| 992 | 997 | ||
| 993 | bat_priv = netdev_priv(hard_iface->mesh_iface); | 998 | bat_priv = netdev_priv(hard_iface->mesh_iface); |
| 994 | bat_priv->algo_ops->iface.update_mac(hard_iface); | 999 | bat_priv->algo_ops->iface.update_mac(hard_iface); |
| @@ -3023,3 +3023,27 @@ void hci_conn_tx_dequeue(struct hci_conn *conn) · 3022 unmodified lines | |||
| 3023 | 3023 | ||
| 3024 | kfree_skb(skb); | 3024 | kfree_skb(skb); |
| 3025 | } | 3025 | } |
| 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 <k->enc_size; | ||
| 3046 | } | ||
| 3047 | |||
| 3048 | return NULL; | ||
| 3049 | } | ||
| @@ -739,10 +739,17 @@ static u8 hci_cc_read_enc_key_size(struct hci_dev *hdev, void *data, · 738 unmodified lines | |||
| 739 | handle); | 739 | handle); |
| 740 | conn->enc_key_size = 0; | 740 | conn->enc_key_size = 0; |
| 741 | } else { | 741 | } else { |
| 742 | u8 *key_enc_size = hci_conn_key_enc_size(conn); | ||
| 743 | |||
| 742 | conn->enc_key_size = rp->key_size; | 744 | conn->enc_key_size = rp->key_size; |
| 743 | status = 0; | 745 | status = 0; |
| 744 | 746 | ||
| 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)) { | ||
| 746 | /* As slave role, the conn->state has been set to | 753 | /* As slave role, the conn->state has been set to |
| 747 | * BT_CONNECTED and l2cap conn req might not be received | 754 | * BT_CONNECTED and l2cap conn req might not be received |
| 748 | * yet, at this moment the l2cap layer almost does | 755 | * 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 | |||
| 755 | clear_bit(HCI_CONN_ENCRYPT, &conn->flags); | 762 | clear_bit(HCI_CONN_ENCRYPT, &conn->flags); |
| 756 | clear_bit(HCI_CONN_AES_CCM, &conn->flags); | 763 | clear_bit(HCI_CONN_AES_CCM, &conn->flags); |
| 757 | } | 764 | } |
| 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; | ||
| 758 | } | 769 | } |
| 759 | 770 | ||
| 760 | hci_encrypt_cfm(conn, status); | 771 | hci_encrypt_cfm(conn, status); |
| @@ -3065,6 +3076,34 @@ static void hci_inquiry_result_evt(struct hci_dev *hdev, void *edata, · 2304 unmodified lines | |||
| 3065 | hci_dev_unlock(hdev); | 3076 | hci_dev_unlock(hdev); |
| 3066 | } | 3077 | } |
| 3067 | 3078 | ||
| 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 | |||
| 3068 | static void hci_conn_complete_evt(struct hci_dev *hdev, void *data, | 3107 | static void hci_conn_complete_evt(struct hci_dev *hdev, void *data, |
| 3069 | struct sk_buff *skb) | 3108 | struct sk_buff *skb) |
| 3070 | { | 3109 | { |
| @@ -3157,23 +3196,11 @@ static void hci_conn_complete_evt(struct hci_dev *hdev, void *data, · 86 unmodified lines | |||
| 3157 | if (ev->encr_mode == 1 && !test_bit(HCI_CONN_ENCRYPT, &conn->flags) && | 3196 | if (ev->encr_mode == 1 && !test_bit(HCI_CONN_ENCRYPT, &conn->flags) && |
| 3158 | ev->link_type == ACL_LINK) { | 3197 | ev->link_type == ACL_LINK) { |
| 3159 | struct link_key *key; | 3198 | struct link_key *key; |
| 3160 | struct hci_cp_read_enc_key_size cp; | ||
| 3161 | 3199 | ||
| 3162 | key = hci_find_link_key(hdev, &ev->bdaddr); | 3200 | key = hci_find_link_key(hdev, &ev->bdaddr); |
| 3163 | if (key) { | 3201 | if (key) { |
| 3164 | set_bit(HCI_CONN_ENCRYPT, &conn->flags); | 3202 | set_bit(HCI_CONN_ENCRYPT, &conn->flags); |
| 3165 | 3203 | hci_read_enc_key_size(hdev, conn); | |
| 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 | |||
| 3177 | hci_encrypt_cfm(conn, ev->status); | 3204 | hci_encrypt_cfm(conn, ev->status); |
| 3178 | } | 3205 | } |
| 3179 | } | 3206 | } |
| @@ -3612,24 +3639,8 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data, · 432 unmodified lines | |||
| 3612 | 3639 | ||
| 3613 | /* Try reading the encryption key size for encrypted ACL links */ | 3640 | /* Try reading the encryption key size for encrypted ACL links */ |
| 3614 | if (!ev->status && ev->encrypt && conn->type == ACL_LINK) { | 3641 | if (!ev->status && ev->encrypt && conn->type == ACL_LINK) { |
| 3615 | struct hci_cp_read_enc_key_size cp; | 3642 | if (hci_read_enc_key_size(hdev, conn)) |
| 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; | ||
| 3631 | goto notify; | 3643 | goto notify; |
| 3632 | } | ||
| 3633 | 3644 | ||
| 3634 | goto unlock; | 3645 | goto unlock; |
| 3635 | } | 3646 | } |
| @@ -7506,11 +7506,16 @@ static void add_device_complete(struct hci_dev *hdev, void *data, int err) · 7505 unmodified lines | |||
| 7506 | struct mgmt_cp_add_device *cp = cmd->param; | 7506 | struct mgmt_cp_add_device *cp = cmd->param; |
| 7507 | 7507 | ||
| 7508 | if (!err) { | 7508 | 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 | |||
| 7509 | device_added(cmd->sk, hdev, &cp->addr.bdaddr, cp->addr.type, | 7514 | device_added(cmd->sk, hdev, &cp->addr.bdaddr, cp->addr.type, |
| 7510 | cp->action); | 7515 | cp->action); |
| 7511 | device_flags_changed(NULL, hdev, &cp->addr.bdaddr, | 7516 | device_flags_changed(NULL, hdev, &cp->addr.bdaddr, |
| 7512 | cp->addr.type, hdev->conn_flags, | 7517 | cp->addr.type, hdev->conn_flags, |
| 7513 | PTR_UINT(cmd->user_data)); | 7518 | params ? params->flags : 0); |
| 7514 | } | 7519 | } |
| 7515 | 7520 | ||
| 7516 | mgmt_cmd_complete(cmd->sk, hdev->id, MGMT_OP_ADD_DEVICE, | 7521 | 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 | |||
| 7613 | goto unlock; | 7618 | goto unlock; |
| 7614 | } | 7619 | } |
| 7615 | 7620 | ||
| 7616 | cmd->user_data = UINT_PTR(current_flags); | ||
| 7617 | |||
| 7618 | err = hci_cmd_sync_queue(hdev, add_device_sync, cmd, | 7621 | err = hci_cmd_sync_queue(hdev, add_device_sync, cmd, |
| 7619 | add_device_complete); | 7622 | add_device_complete); |
| 7620 | if (err < 0) { | 7623 | if (err < 0) { |
| @@ -10441,6 +10441,7 @@ static void netdev_sync_lower_features(struct net_device *upper, · 10440 unmodified lines | |||
| 10441 | if (!(features & feature) && (lower->features & feature)) { | 10441 | if (!(features & feature) && (lower->features & feature)) { |
| 10442 | netdev_dbg(upper, "Disabling feature %pNF on lower dev %s.\n", | 10442 | netdev_dbg(upper, "Disabling feature %pNF on lower dev %s.\n", |
| 10443 | &feature, lower->name); | 10443 | &feature, lower->name); |
| 10444 | netdev_lock_ops(lower); | ||
| 10444 | lower->wanted_features &= ~feature; | 10445 | lower->wanted_features &= ~feature; |
| 10445 | __netdev_update_features(lower); | 10446 | __netdev_update_features(lower); |
| 10446 | 10447 | ||
| @@ -10449,6 +10450,7 @@ static void netdev_sync_lower_features(struct net_device *upper, · 2 unmodified lines | |||
| 10449 | &feature, lower->name); | 10450 | &feature, lower->name); |
| 10450 | else | 10451 | else |
| 10451 | netdev_features_change(lower); | 10452 | netdev_features_change(lower); |
| 10453 | netdev_unlock_ops(lower); | ||
| 10452 | } | 10454 | } |
| 10453 | } | 10455 | } |
| 10454 | } | 10456 | } |
| @@ -200,6 +200,8 @@ net_devmem_bind_dmabuf(struct net_device *dev, unsigned int dmabuf_fd, · 199 unmodified lines | |||
| 200 | 200 | ||
| 201 | refcount_set(&binding->ref, 1); | 201 | refcount_set(&binding->ref, 1); |
| 202 | 202 | ||
| 203 | mutex_init(&binding->lock); | ||
| 204 | |||
| 203 | binding->dmabuf = dmabuf; | 205 | binding->dmabuf = dmabuf; |
| 204 | 206 | ||
| 205 | binding->attachment = dma_buf_attach(binding->dmabuf, dev->dev.parent); | 207 | 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 | |||
| 379 | xa_for_each(&binding->bound_rxqs, xa_idx, bound_rxq) { | 381 | xa_for_each(&binding->bound_rxqs, xa_idx, bound_rxq) { |
| 380 | if (bound_rxq == rxq) { | 382 | if (bound_rxq == rxq) { |
| 381 | xa_erase(&binding->bound_rxqs, xa_idx); | 383 | 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 | } | ||
| 382 | break; | 389 | break; |
| 383 | } | 390 | } |
| 384 | } | 391 | } |
| @@ -20,6 +20,8 @@ struct net_devmem_dmabuf_binding { · 19 unmodified lines | |||
| 20 | struct sg_table *sgt; | 20 | struct sg_table *sgt; |
| 21 | struct net_device *dev; | 21 | struct net_device *dev; |
| 22 | struct gen_pool *chunk_pool; | 22 | struct gen_pool *chunk_pool; |
| 23 | /* Protect dev */ | ||
| 24 | struct mutex lock; | ||
| 23 | 25 | ||
| 24 | /* The user holds a ref (via the netlink API) for as long as they want | 26 | /* The user holds a ref (via the netlink API) for as long as they want |
| 25 | * the binding to remain alive. Each page pool using this binding holds | 27 | * the binding to remain alive. Each page pool using this binding holds |
| @@ -979,14 +979,25 @@ void netdev_nl_sock_priv_destroy(struct netdev_nl_sock *priv) · 978 unmodified lines | |||
| 979 | { | 979 | { |
| 980 | struct net_devmem_dmabuf_binding *binding; | 980 | struct net_devmem_dmabuf_binding *binding; |
| 981 | struct net_devmem_dmabuf_binding *temp; | 981 | struct net_devmem_dmabuf_binding *temp; |
| 982 | netdevice_tracker dev_tracker; | ||
| 982 | struct net_device *dev; | 983 | struct net_device *dev; |
| 983 | 984 | ||
| 984 | mutex_lock(&priv->lock); | 985 | mutex_lock(&priv->lock); |
| 985 | list_for_each_entry_safe(binding, temp, &priv->bindings, list) { | 986 | list_for_each_entry_safe(binding, temp, &priv->bindings, list) { |
| 987 | mutex_lock(&binding->lock); | ||
| 986 | dev = binding->dev; | 988 | 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 | |||
| 987 | netdev_lock(dev); | 997 | netdev_lock(dev); |
| 988 | net_devmem_unbind_dmabuf(binding); | 998 | net_devmem_unbind_dmabuf(binding); |
| 989 | netdev_unlock(dev); | 999 | netdev_unlock(dev); |
| 1000 | netdev_put(dev, &dev_tracker); | ||
| 990 | } | 1001 | } |
| 991 | mutex_unlock(&priv->lock); | 1002 | mutex_unlock(&priv->lock); |
| 992 | } | 1003 | } |
| @@ -1354,10 +1354,12 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) · 1353 unmodified lines | |||
| 1354 | hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_MONITOR); | 1354 | hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_MONITOR); |
| 1355 | 1355 | ||
| 1356 | 1356 | ||
| 1357 | local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) + | 1357 | local->int_scan_req = kzalloc(struct_size(local->int_scan_req, |
| 1358 | sizeof(void *) * channels, GFP_KERNEL); | 1358 | channels, channels), |
| 1359 | GFP_KERNEL); | ||
| 1359 | if (!local->int_scan_req) | 1360 | if (!local->int_scan_req) |
| 1360 | return -ENOMEM; | 1361 | return -ENOMEM; |
| 1362 | local->int_scan_req->n_channels = channels; | ||
| 1361 | 1363 | ||
| 1362 | eth_broadcast_addr(local->int_scan_req->bssid); | 1364 | eth_broadcast_addr(local->int_scan_req->bssid); |
| 1363 | 1365 | ||
| @@ -117,11 +117,18 @@ static int mctp_dump_addrinfo(struct sk_buff *skb, struct netlink_callback *cb) · 116 unmodified lines | |||
| 117 | struct net_device *dev; | 117 | struct net_device *dev; |
| 118 | struct ifaddrmsg *hdr; | 118 | struct ifaddrmsg *hdr; |
| 119 | struct mctp_dev *mdev; | 119 | struct mctp_dev *mdev; |
| 120 | int ifindex, rc; | 120 | int ifindex = 0, rc; |
| 121 | 121 | ||
| 122 | hdr = nlmsg_data(cb->nlh); | 122 | /* Filter by ifindex if a header is provided */ |
| 123 | // filter by ifindex if requested | 123 | if (cb->nlh->nlmsg_len >= nlmsg_msg_size(sizeof(*hdr))) { |
| 124 | ifindex = hdr->ifa_index; | 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 | } | ||
| 125 | 132 | ||
| 126 | rcu_read_lock(); | 133 | rcu_read_lock(); |
| 127 | for_each_netdev_dump(net, dev, mcb->ifindex) { | 134 | for_each_netdev_dump(net, dev, mcb->ifindex) { |
| @@ -313,8 +313,10 @@ static void mctp_flow_prepare_output(struct sk_buff *skb, struct mctp_dev *dev) · 312 unmodified lines | |||
| 313 | 313 | ||
| 314 | key = flow->key; | 314 | key = flow->key; |
| 315 | 315 | ||
| 316 | if (WARN_ON(key->dev && key->dev != dev)) | 316 | if (key->dev) { |
| 317 | WARN_ON(key->dev != dev); | ||
| 317 | return; | 318 | return; |
| 319 | } | ||
| 318 | 320 | ||
| 319 | mctp_dev_set_key(dev, key); | 321 | mctp_dev_set_key(dev, key); |
| 320 | } | 322 | } |
| @@ -144,7 +144,7 @@ static int codel_change(struct Qdisc *sch, struct nlattr *opt, · 143 unmodified lines | |||
| 144 | 144 | ||
| 145 | qlen = sch->q.qlen; | 145 | qlen = sch->q.qlen; |
| 146 | while (sch->q.qlen > sch->limit) { | 146 | 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); |
| 148 | 148 | ||
| 149 | dropped += qdisc_pkt_len(skb); | 149 | dropped += qdisc_pkt_len(skb); |
| 150 | qdisc_qstats_backlog_dec(sch, skb); | 150 | qdisc_qstats_backlog_dec(sch, skb); |
| @@ -1136,7 +1136,7 @@ static int fq_change(struct Qdisc *sch, struct nlattr *opt, · 1135 unmodified lines | |||
| 1136 | sch_tree_lock(sch); | 1136 | sch_tree_lock(sch); |
| 1137 | } | 1137 | } |
| 1138 | while (sch->q.qlen > sch->limit) { | 1138 | while (sch->q.qlen > sch->limit) { |
| 1139 | struct sk_buff *skb = fq_dequeue(sch); | 1139 | struct sk_buff *skb = qdisc_dequeue_internal(sch, false); |
| 1140 | 1140 | ||
| 1141 | if (!skb) | 1141 | if (!skb) |
| 1142 | break; | 1142 | break; |
| @@ -441,7 +441,7 @@ static int fq_codel_change(struct Qdisc *sch, struct nlattr *opt, · 440 unmodified lines | |||
| 441 | 441 | ||
| 442 | while (sch->q.qlen > sch->limit || | 442 | while (sch->q.qlen > sch->limit || |
| 443 | q->memory_usage > q->memory_limit) { | 443 | 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); |
| 445 | 445 | ||
| 446 | q->cstats.drop_len += qdisc_pkt_len(skb); | 446 | q->cstats.drop_len += qdisc_pkt_len(skb); |
| 447 | rtnl_kfree_skbs(skb, skb); | 447 | rtnl_kfree_skbs(skb, skb); |
| @@ -366,7 +366,7 @@ static int fq_pie_change(struct Qdisc *sch, struct nlattr *opt, · 365 unmodified lines | |||
| 366 | 366 | ||
| 367 | /* Drop excess packets if new limit is lower */ | 367 | /* Drop excess packets if new limit is lower */ |
| 368 | while (sch->q.qlen > sch->limit) { | 368 | 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); |
| 370 | 370 | ||
| 371 | len_dropped += qdisc_pkt_len(skb); | 371 | len_dropped += qdisc_pkt_len(skb); |
| 372 | num_dropped += 1; | 372 | num_dropped += 1; |
| @@ -564,7 +564,7 @@ static int hhf_change(struct Qdisc *sch, struct nlattr *opt, · 563 unmodified lines | |||
| 564 | qlen = sch->q.qlen; | 564 | qlen = sch->q.qlen; |
| 565 | prev_backlog = sch->qstats.backlog; | 565 | prev_backlog = sch->qstats.backlog; |
| 566 | while (sch->q.qlen > sch->limit) { | 566 | while (sch->q.qlen > sch->limit) { |
| 567 | struct sk_buff *skb = hhf_dequeue(sch); | 567 | struct sk_buff *skb = qdisc_dequeue_internal(sch, false); |
| 568 | 568 | ||
| 569 | rtnl_kfree_skbs(skb, skb); | 569 | rtnl_kfree_skbs(skb, skb); |
| 570 | } | 570 | } |
| @@ -195,7 +195,7 @@ static int pie_change(struct Qdisc *sch, struct nlattr *opt, · 194 unmodified lines | |||
| 195 | /* Drop excess packets if new limit is lower */ | 195 | /* Drop excess packets if new limit is lower */ |
| 196 | qlen = sch->q.qlen; | 196 | qlen = sch->q.qlen; |
| 197 | while (sch->q.qlen > sch->limit) { | 197 | 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); |
| 199 | 199 | ||
| 200 | dropped += qdisc_pkt_len(skb); | 200 | dropped += qdisc_pkt_len(skb); |
| 201 | qdisc_qstats_backlog_dec(sch, skb); | 201 | qdisc_qstats_backlog_dec(sch, skb); |
| @@ -396,7 +396,6 @@ static int tls_strp_read_copy(struct tls_strparser *strp, bool qshort) · 395 unmodified lines | |||
| 396 | return 0; | 396 | return 0; |
| 397 | 397 | ||
| 398 | shinfo = skb_shinfo(strp->anchor); | 398 | shinfo = skb_shinfo(strp->anchor); |
| 399 | shinfo->frag_list = NULL; | ||
| 400 | 399 | ||
| 401 | /* If we don't know the length go max plus page for cipher overhead */ | 400 | /* If we don't know the length go max plus page for cipher overhead */ |
| 402 | need_spc = strp->stm.full_len ?: TLS_MAX_PAYLOAD_SIZE + PAGE_SIZE; | 401 | 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 | |||
| 412 | page, 0, 0); | 411 | page, 0, 0); |
| 413 | } | 412 | } |
| 414 | 413 | ||
| 414 | shinfo->frag_list = NULL; | ||
| 415 | |||
| 415 | strp->copy_mode = 1; | 416 | strp->copy_mode = 1; |
| 416 | strp->stm.offset = 0; | 417 | strp->stm.offset = 0; |
| 417 | 418 | ||
| @@ -338,16 +338,24 @@ def main(): · 337 unmodified lines | |||
| 338 | print('Capabilities:') | 338 | print('Capabilities:') |
| 339 | [print(f'\t{v}') for v in bits_to_dict(tsinfo['timestamping'])] | 339 | [print(f'\t{v}') for v in bits_to_dict(tsinfo['timestamping'])] |
| 340 | 340 | ||
| 341 | print(f'PTP Hardware Clock: {tsinfo["phc-index"]}') | 341 | print(f'PTP Hardware Clock: {tsinfo.get("phc-index", "none")}') |
| 342 | 342 | ||
| 343 | print('Hardware Transmit Timestamp Modes:') | 343 | if 'tx-types' in tsinfo: |
| 344 | [print(f'\t{v}') for v in bits_to_dict(tsinfo['tx-types'])] | 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') | ||
| 345 | 354 | ||
| 346 | print('Hardware Receive Filter Modes:') | 355 | if 'stats' in tsinfo and tsinfo['stats']: |
| 347 | [print(f'\t{v}') for v in bits_to_dict(tsinfo['rx-filters'])] | 356 | print('Statistics:') |
| 357 | [print(f'\t{k}: {v}') for k, v in tsinfo['stats'].items()] | ||
| 348 | 358 | ||
| 349 | print('Statistics:') | ||
| 350 | [print(f'\t{k}: {v}') for k, v in tsinfo['stats'].items()] | ||
| 351 | return | 359 | return |
| 352 | 360 | ||
| 353 | print(f'Settings for {args.device}:') | 361 | print(f'Settings for {args.device}:') |
| @@ -1143,10 +1143,9 @@ class Family(SpecFamily): · 1142 unmodified lines | |||
| 1143 | self.pure_nested_structs[nested].request = True | 1143 | self.pure_nested_structs[nested].request = True |
| 1144 | if attr in rs_members['reply']: | 1144 | if attr in rs_members['reply']: |
| 1145 | self.pure_nested_structs[nested].reply = True | 1145 | self.pure_nested_structs[nested].reply = True |
| 1146 | 1146 | if spec.is_multi_val(): | |
| 1147 | if spec.is_multi_val(): | 1147 | child = self.pure_nested_structs.get(nested) |
| 1148 | child = self.pure_nested_structs.get(nested) | 1148 | child.in_multi_val = True |
| 1149 | child.in_multi_val = True | ||
| 1150 | 1149 | ||
| 1151 | self._sort_pure_types() | 1150 | self._sort_pure_types() |
| 1152 | 1151 | ||
| @@ -431,6 +431,22 @@ static int parse_address(const char *str, int port, struct sockaddr_in6 *sin6) · 430 unmodified lines | |||
| 431 | return 0; | 431 | return 0; |
| 432 | } | 432 | } |
| 433 | 433 | ||
| 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 | |||
| 434 | int do_server(struct memory_buffer *mem) | 450 | int do_server(struct memory_buffer *mem) |
| 435 | { | 451 | { |
| 436 | char ctrl_data[sizeof(int) * 20000]; | 452 | char ctrl_data[sizeof(int) * 20000]; |
| @@ -448,7 +464,6 @@ int do_server(struct memory_buffer *mem) · 11 unmodified lines | |||
| 448 | char buffer[256]; | 464 | char buffer[256]; |
| 449 | int socket_fd; | 465 | int socket_fd; |
| 450 | int client_fd; | 466 | int client_fd; |
| 451 | size_t i = 0; | ||
| 452 | int ret; | 467 | int ret; |
| 453 | 468 | ||
| 454 | ret = parse_address(server_ip, atoi(port), &server_sin); | 469 | ret = parse_address(server_ip, atoi(port), &server_sin); |
| @@ -471,16 +486,7 @@ int do_server(struct memory_buffer *mem) · 16 unmodified lines | |||
| 471 | 486 | ||
| 472 | sleep(1); | 487 | sleep(1); |
| 473 | 488 | ||
| 474 | queues = malloc(sizeof(*queues) * num_queues); | 489 | if (bind_rx_queue(ifindex, mem->fd, create_queues(), num_queues, &ys)) |
| 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)) | ||
| 484 | error(1, 0, "Failed to bind\n"); | 490 | error(1, 0, "Failed to bind\n"); |
| 485 | 491 | ||
| 486 | tmp_mem = malloc(mem->size); | 492 | tmp_mem = malloc(mem->size); |
| @@ -545,7 +551,6 @@ int do_server(struct memory_buffer *mem) · 58 unmodified lines | |||
| 545 | goto cleanup; | 551 | goto cleanup; |
| 546 | } | 552 | } |
| 547 | 553 | ||
| 548 | i++; | ||
| 549 | for (cm = CMSG_FIRSTHDR(&msg); cm; cm = CMSG_NXTHDR(&msg, cm)) { | 554 | for (cm = CMSG_FIRSTHDR(&msg); cm; cm = CMSG_NXTHDR(&msg, cm)) { |
| 550 | if (cm->cmsg_level != SOL_SOCKET || | 555 | if (cm->cmsg_level != SOL_SOCKET || |
| 551 | (cm->cmsg_type != SCM_DEVMEM_DMABUF && | 556 | (cm->cmsg_type != SCM_DEVMEM_DMABUF && |
| @@ -630,10 +635,8 @@ cleanup: · 78 unmodified lines | |||
| 630 | 635 | ||
| 631 | void run_devmem_tests(void) | 636 | void run_devmem_tests(void) |
| 632 | { | 637 | { |
| 633 | struct netdev_queue_id *queues; | ||
| 634 | struct memory_buffer *mem; | 638 | struct memory_buffer *mem; |
| 635 | struct ynl_sock *ys; | 639 | struct ynl_sock *ys; |
| 636 | size_t i = 0; | ||
| 637 | 640 | ||
| 638 | mem = provider->alloc(getpagesize() * NUM_PAGES); | 641 | mem = provider->alloc(getpagesize() * NUM_PAGES); |
| 639 | 642 | ||
| @@ -641,38 +644,24 @@ void run_devmem_tests(void) · 1 unmodified line | |||
| 641 | if (configure_rss()) | 644 | if (configure_rss()) |
| 642 | error(1, 0, "rss error\n"); | 645 | error(1, 0, "rss error\n"); |
| 643 | 646 | ||
| 644 | queues = calloc(num_queues, sizeof(*queues)); | ||
| 645 | |||
| 646 | if (configure_headersplit(1)) | 647 | if (configure_headersplit(1)) |
| 647 | error(1, 0, "Failed to configure header split\n"); | 648 | error(1, 0, "Failed to configure header split\n"); |
| 648 | 649 | ||
| 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)) | ||
| 650 | error(1, 0, "Binding empty queues array should have failed\n"); | 653 | error(1, 0, "Binding empty queues array should have failed\n"); |
| 651 | 654 | ||
| 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 | |||
| 659 | if (configure_headersplit(0)) | 655 | if (configure_headersplit(0)) |
| 660 | error(1, 0, "Failed to configure header split\n"); | 656 | error(1, 0, "Failed to configure header split\n"); |
| 661 | 657 | ||
| 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)) |
| 663 | error(1, 0, "Configure dmabuf with header split off should have failed\n"); | 659 | error(1, 0, "Configure dmabuf with header split off should have failed\n"); |
| 664 | 660 | ||
| 665 | if (configure_headersplit(1)) | 661 | if (configure_headersplit(1)) |
| 666 | error(1, 0, "Failed to configure header split\n"); | 662 | error(1, 0, "Failed to configure header split\n"); |
| 667 | 663 | ||
| 668 | for (i = 0; i < num_queues; i++) { | 664 | if (bind_rx_queue(ifindex, mem->fd, create_queues(), num_queues, &ys)) |
| 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)) | ||
| 676 | error(1, 0, "Failed to bind\n"); | 665 | error(1, 0, "Failed to bind\n"); |
| 677 | 666 | ||
| 678 | /* Deactivating a bound queue should not be legal */ | 667 | /* Deactivating a bound queue should not be legal */ |
| @@ -189,5 +189,29 @@ · 188 unmodified lines | |||
| 189 | "teardown": [ | 189 | "teardown": [ |
| 190 | "$TC qdisc del dev $DUMMY handle 1: root" | 190 | "$TC qdisc del dev $DUMMY handle 1: root" |
| 191 | ] | 191 | ] |
| 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"] | ||
| 192 | } | 216 | } |
| 193 | ] | 217 | ] |
| @@ -377,5 +377,27 @@ · 376 unmodified lines | |||
| 377 | "teardown": [ | 377 | "teardown": [ |
| 378 | "$TC qdisc del dev $DUMMY handle 1: root" | 378 | "$TC qdisc del dev $DUMMY handle 1: root" |
| 379 | ] | 379 | ] |
| 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"] | ||
| 380 | } | 402 | } |
| 381 | ] | 403 | ] |
| @@ -294,5 +294,27 @@ · 293 unmodified lines | |||
| 294 | "teardown": [ | 294 | "teardown": [ |
| 295 | "$TC qdisc del dev $DUMMY handle 1: root" | 295 | "$TC qdisc del dev $DUMMY handle 1: root" |
| 296 | ] | 296 | ] |
| 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"] | ||
| 297 | } | 319 | } |
| 298 | ] | 320 | ] |
| @@ -18,5 +18,27 @@ · 17 unmodified lines | |||
| 18 | "matchCount": "1", | 18 | "matchCount": "1", |
| 19 | "teardown": [ | 19 | "teardown": [ |
| 20 | ] | 20 | ] |
| 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"] | ||
| 21 | } | 43 | } |
| 22 | ] | 44 | ] |
| @@ -188,5 +188,27 @@ · 187 unmodified lines | |||
| 188 | "teardown": [ | 188 | "teardown": [ |
| 189 | "$TC qdisc del dev $DUMMY handle 1: root" | 189 | "$TC qdisc del dev $DUMMY handle 1: root" |
| 190 | ] | 190 | ] |
| 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"] | ||
| 191 | } | 213 | } |
| 192 | ] | 214 | ] |
| @@ -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 | ] | ||
| @@ -1264,21 +1264,25 @@ static void test_unsent_bytes_client(const struct test_opts *opts, int type) · 1263 unmodified lines | |||
| 1264 | send_buf(fd, buf, sizeof(buf), 0, sizeof(buf)); | 1264 | send_buf(fd, buf, sizeof(buf), 0, sizeof(buf)); |
| 1265 | control_expectln("RECEIVED"); | 1265 | control_expectln("RECEIVED"); |
| 1266 | 1266 | ||
| 1267 | ret = ioctl(fd, SIOCOUTQ, &sock_bytes_unsent); | 1267 | /* SIOCOUTQ isn't guaranteed to instantly track sent data. Even though |
| 1268 | if (ret < 0) { | 1268 | * the "RECEIVED" message means that the other side has received the |
| 1269 | if (errno == EOPNOTSUPP) { | 1269 | * data, there can be a delay in our kernel before updating the "unsent |
| 1270 | fprintf(stderr, "Test skipped, SIOCOUTQ not supported.\n"); | 1270 | * bytes" counter. Repeat SIOCOUTQ until it returns 0. |
| 1271 | } else { | 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 | } | ||
| 1272 | perror("ioctl"); | 1280 | perror("ioctl"); |
| 1273 | exit(EXIT_FAILURE); | 1281 | exit(EXIT_FAILURE); |
| 1274 | } | 1282 | } |
| 1275 | } else if (ret == 0 && sock_bytes_unsent != 0) { | 1283 | timeout_check("SIOCOUTQ"); |
| 1276 | fprintf(stderr, | 1284 | } while (sock_bytes_unsent != 0); |
| 1277 | "Unexpected 'SIOCOUTQ' value, expected 0, got %i\n", | 1285 | timeout_end(); |
| 1278 | sock_bytes_unsent); | ||
| 1279 | exit(EXIT_FAILURE); | ||
| 1280 | } | ||
| 1281 | |||
| 1282 | close(fd); | 1286 | close(fd); |
| 1283 | } | 1287 | } |
| 1284 | 1288 | ||