Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull networking fixes from Jakub Kicinski:
Including fixes from bluetooth and wireless.

Current release - new code bugs:

- ptp: expose raw cycles only for clocks with free-running counter

- bonding: fix null-deref in actor_port_prio setting

- mdio: ERR_PTR-check regmap pointer returned by
device_node_to_regmap()

- eth: libie: depend on DEBUG_FS when building LIBIE_FWLOG

Previous releases - regressions:

- virtio_net: fix perf regression due to bad alignment of
virtio_net_hdr_v1_hash

- Revert "wifi: ath10k: avoid unnecessary wait for service ready
message" caused regressions for QCA988x and QCA9984

- Revert "wifi: ath12k: Fix missing station power save configuration"
caused regressions for WCN7850

- eth: bnxt_en: shutdown FW DMA in bnxt_shutdown(), fix memory
corruptions after kexec

Previous releases - always broken:

- virtio-net: fix received packet length check for big packets

- sctp: fix races in socket diag handling

- wifi: add an hrtimer-based delayed work item to avoid low
granularity of timers set relatively far in the future, and use it
where it matters (e.g. when performing AP-scheduled channel switch)

- eth: mlx5e:
- correctly propagate error in case of module EEPROM read failure
- fix HW-GRO on systems with PAGE_SIZE == 64kB

- dsa: b53: fixes for tagging, link configuration / RMII, FDB,
multicast

- phy: lan8842: implement latest errata"

* tag 'net-6.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (63 commits)
selftests/vsock: avoid false-positives when checking dmesg
net: bridge: fix MST static key usage
net: bridge: fix use-after-free due to MST port state bypass
lan966x: Fix sleeping in atomic context
bonding: fix NULL pointer dereference in actor_port_prio setting
net: dsa: microchip: Fix reserved multicast address table programming
net: wan: framer: pef2256: Switch to devm_mfd_add_devices()
net: libwx: fix device bus LAN ID
net/mlx5e: SHAMPO, Fix header formulas for higher MTUs and 64K pages
net/mlx5e: SHAMPO, Fix skb size check for 64K pages
net/mlx5e: SHAMPO, Fix header mapping for 64K pages
net: ti: icssg-prueth: Fix fdb hash size configuration
net/mlx5e: Fix return value in case of module EEPROM read error
net: gro_cells: Reduce lock scope in gro_cell_poll
libie: depend on DEBUG_FS when building LIBIE_FWLOG
wifi: mac80211_hwsim: Limit destroy_on_close radio removal to netgroup
netpoll: Fix deadlock in memory allocation under spinlock
net: ethernet: ti: netcp: Standardize knav_dma_open_channel to return NULL on error
virtio-net: fix received length check in big packets
bnxt_en: Fix warning in bnxt_dl_reload_down()
...

+877 -334
+1
MAINTAINERS
··· 4818 4818 F: drivers/net/dsa/bcm_sf2* 4819 4819 F: include/linux/dsa/brcm.h 4820 4820 F: include/linux/platform_data/b53.h 4821 + F: net/dsa/tag_brcm.c 4821 4822 4822 4823 BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE 4823 4824 M: Florian Fainelli <florian.fainelli@broadcom.com>
+3 -1
drivers/bluetooth/btrtl.c
··· 625 625 len += entry->len; 626 626 } 627 627 628 - if (!len) 628 + if (!len) { 629 + kvfree(ptr); 629 630 return -EPERM; 631 + } 630 632 631 633 *_buf = ptr; 632 634 return len;
+13 -5
drivers/isdn/hardware/mISDN/hfcsusb.c
··· 1904 1904 mISDN_freebchannel(&hw->bch[1]); 1905 1905 mISDN_freebchannel(&hw->bch[0]); 1906 1906 mISDN_freedchannel(&hw->dch); 1907 - kfree(hw); 1908 1907 return err; 1909 1908 } 1910 1909 1911 1910 static int 1912 1911 hfcsusb_probe(struct usb_interface *intf, const struct usb_device_id *id) 1913 1912 { 1913 + int err; 1914 1914 struct hfcsusb *hw; 1915 1915 struct usb_device *dev = interface_to_usbdev(intf); 1916 1916 struct usb_host_interface *iface = intf->cur_altsetting; ··· 2101 2101 if (!hw->ctrl_urb) { 2102 2102 pr_warn("%s: No memory for control urb\n", 2103 2103 driver_info->vend_name); 2104 - kfree(hw); 2105 - return -ENOMEM; 2104 + err = -ENOMEM; 2105 + goto err_free_hw; 2106 2106 } 2107 2107 2108 2108 pr_info("%s: %s: detected \"%s\" (%s, if=%d alt=%d)\n", 2109 2109 hw->name, __func__, driver_info->vend_name, 2110 2110 conf_str[small_match], ifnum, alt_used); 2111 2111 2112 - if (setup_instance(hw, dev->dev.parent)) 2113 - return -EIO; 2112 + if (setup_instance(hw, dev->dev.parent)) { 2113 + err = -EIO; 2114 + goto err_free_urb; 2115 + } 2114 2116 2115 2117 hw->intf = intf; 2116 2118 usb_set_intfdata(hw->intf, hw); 2117 2119 return 0; 2120 + 2121 + err_free_urb: 2122 + usb_free_urb(hw->ctrl_urb); 2123 + err_free_hw: 2124 + kfree(hw); 2125 + return err; 2118 2126 } 2119 2127 2120 2128 /* function called when an active device is removed */
+1 -8
drivers/net/bonding/bond_options.c
··· 225 225 { NULL, -1, 0}, 226 226 }; 227 227 228 - static const struct bond_opt_value bond_actor_port_prio_tbl[] = { 229 - { "minval", 0, BOND_VALFLAG_MIN}, 230 - { "maxval", 65535, BOND_VALFLAG_MAX}, 231 - { "default", 255, BOND_VALFLAG_DEFAULT}, 232 - { NULL, -1, 0}, 233 - }; 234 - 235 228 static const struct bond_opt_value bond_ad_user_port_key_tbl[] = { 236 229 { "minval", 0, BOND_VALFLAG_MIN | BOND_VALFLAG_DEFAULT}, 237 230 { "maxval", 1023, BOND_VALFLAG_MAX}, ··· 490 497 .id = BOND_OPT_ACTOR_PORT_PRIO, 491 498 .name = "actor_port_prio", 492 499 .unsuppmodes = BOND_MODE_ALL_EX(BIT(BOND_MODE_8023AD)), 493 - .values = bond_actor_port_prio_tbl, 500 + .flags = BOND_OPTFLAG_RAWVAL, 494 501 .set = bond_option_actor_port_prio_set, 495 502 }, 496 503 [BOND_OPT_AD_ACTOR_SYSTEM] = {
+29 -7
drivers/net/dsa/b53/b53_common.c
··· 371 371 * frames should be flooded or not. 372 372 */ 373 373 b53_read8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, &mgmt); 374 - mgmt |= B53_UC_FWD_EN | B53_MC_FWD_EN | B53_IPMC_FWD_EN; 374 + mgmt |= B53_UC_FWD_EN | B53_MC_FWD_EN | B53_IP_MC; 375 375 b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt); 376 376 } else { 377 377 b53_read8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, &mgmt); 378 - mgmt |= B53_IP_MCAST_25; 378 + mgmt |= B53_IP_MC; 379 379 b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt); 380 380 } 381 381 } ··· 1372 1372 else 1373 1373 reg &= ~PORT_OVERRIDE_FULL_DUPLEX; 1374 1374 1375 + reg &= ~(0x3 << GMII_PO_SPEED_S); 1376 + if (is5301x(dev) || is58xx(dev)) 1377 + reg &= ~PORT_OVERRIDE_SPEED_2000M; 1378 + 1375 1379 switch (speed) { 1376 1380 case 2000: 1377 1381 reg |= PORT_OVERRIDE_SPEED_2000M; ··· 1393 1389 dev_err(dev->dev, "unknown speed: %d\n", speed); 1394 1390 return; 1395 1391 } 1392 + 1393 + if (is5325(dev)) 1394 + reg &= ~PORT_OVERRIDE_LP_FLOW_25; 1395 + else 1396 + reg &= ~(PORT_OVERRIDE_RX_FLOW | PORT_OVERRIDE_TX_FLOW); 1396 1397 1397 1398 if (rx_pause) { 1398 1399 if (is5325(dev)) ··· 1602 1593 struct b53_device *dev = dp->ds->priv; 1603 1594 int port = dp->index; 1604 1595 1605 - if (mode == MLO_AN_PHY) 1596 + if (mode == MLO_AN_PHY) { 1597 + if (is63xx(dev) && in_range(port, B53_63XX_RGMII0, 4)) 1598 + b53_force_link(dev, port, false); 1606 1599 return; 1600 + } 1607 1601 1608 1602 if (mode == MLO_AN_FIXED) { 1609 1603 b53_force_link(dev, port, false); ··· 1634 1622 if (mode == MLO_AN_PHY) { 1635 1623 /* Re-negotiate EEE if it was enabled already */ 1636 1624 p->eee_enabled = b53_eee_init(ds, port, phydev); 1625 + 1626 + if (is63xx(dev) && in_range(port, B53_63XX_RGMII0, 4)) { 1627 + b53_force_port_config(dev, port, speed, duplex, 1628 + tx_pause, rx_pause); 1629 + b53_force_link(dev, port, true); 1630 + } 1631 + 1637 1632 return; 1638 1633 } 1639 1634 ··· 2037 2018 do { 2038 2019 b53_read8(dev, B53_ARLIO_PAGE, offset, &reg); 2039 2020 if (!(reg & ARL_SRCH_STDN)) 2040 - return 0; 2021 + return -ENOENT; 2041 2022 2042 2023 if (reg & ARL_SRCH_VLID) 2043 2024 return 0; ··· 2087 2068 int b53_fdb_dump(struct dsa_switch *ds, int port, 2088 2069 dsa_fdb_dump_cb_t *cb, void *data) 2089 2070 { 2071 + unsigned int count = 0, results_per_hit = 1; 2090 2072 struct b53_device *priv = ds->priv; 2091 2073 struct b53_arl_entry results[2]; 2092 - unsigned int count = 0; 2093 2074 u8 offset; 2094 2075 int ret; 2095 2076 u8 reg; 2077 + 2078 + if (priv->num_arl_bins > 2) 2079 + results_per_hit = 2; 2096 2080 2097 2081 mutex_lock(&priv->arl_mutex); 2098 2082 ··· 2118 2096 if (ret) 2119 2097 break; 2120 2098 2121 - if (priv->num_arl_bins > 2) { 2099 + if (results_per_hit == 2) { 2122 2100 b53_arl_search_rd(priv, 1, &results[1]); 2123 2101 ret = b53_fdb_copy(port, &results[1], cb, data); 2124 2102 if (ret) ··· 2128 2106 break; 2129 2107 } 2130 2108 2131 - } while (count++ < b53_max_arl_entries(priv) / 2); 2109 + } while (count++ < b53_max_arl_entries(priv) / results_per_hit); 2132 2110 2133 2111 mutex_unlock(&priv->arl_mutex); 2134 2112
+1 -2
drivers/net/dsa/b53/b53_regs.h
··· 111 111 112 112 /* IP Multicast control (8 bit) */ 113 113 #define B53_IP_MULTICAST_CTRL 0x21 114 - #define B53_IP_MCAST_25 BIT(0) 115 - #define B53_IPMC_FWD_EN BIT(1) 114 + #define B53_IP_MC BIT(0) 116 115 #define B53_UC_FWD_EN BIT(6) 117 116 #define B53_MC_FWD_EN BIT(7) 118 117
+84 -14
drivers/net/dsa/microchip/ksz9477.c
··· 1355 1355 } 1356 1356 } 1357 1357 1358 + #define RESV_MCAST_CNT 8 1359 + 1360 + static u8 reserved_mcast_map[RESV_MCAST_CNT] = { 0, 1, 3, 16, 32, 33, 2, 17 }; 1361 + 1358 1362 int ksz9477_enable_stp_addr(struct ksz_device *dev) 1359 1363 { 1364 + u8 i, ports, update; 1360 1365 const u32 *masks; 1366 + bool override; 1361 1367 u32 data; 1362 1368 int ret; 1363 1369 ··· 1372 1366 /* Enable Reserved multicast table */ 1373 1367 ksz_cfg(dev, REG_SW_LUE_CTRL_0, SW_RESV_MCAST_ENABLE, true); 1374 1368 1375 - /* Set the Override bit for forwarding BPDU packet to CPU */ 1376 - ret = ksz_write32(dev, REG_SW_ALU_VAL_B, 1377 - ALU_V_OVERRIDE | BIT(dev->cpu_port)); 1378 - if (ret < 0) 1379 - return ret; 1369 + /* The reserved multicast address table has 8 entries. Each entry has 1370 + * a default value of which port to forward. It is assumed the host 1371 + * port is the last port in most of the switches, but that is not the 1372 + * case for KSZ9477 or maybe KSZ9897. For LAN937X family the default 1373 + * port is port 5, the first RGMII port. It is okay for LAN9370, a 1374 + * 5-port switch, but may not be correct for the other 8-port 1375 + * versions. It is necessary to update the whole table to forward to 1376 + * the right ports. 1377 + * Furthermore PTP messages can use a reserved multicast address and 1378 + * the host will not receive them if this table is not correct. 1379 + */ 1380 + for (i = 0; i < RESV_MCAST_CNT; i++) { 1381 + data = reserved_mcast_map[i] << 1382 + dev->info->shifts[ALU_STAT_INDEX]; 1383 + data |= ALU_STAT_START | 1384 + masks[ALU_STAT_DIRECT] | 1385 + masks[ALU_RESV_MCAST_ADDR] | 1386 + masks[ALU_STAT_READ]; 1387 + ret = ksz_write32(dev, REG_SW_ALU_STAT_CTRL__4, data); 1388 + if (ret < 0) 1389 + return ret; 1380 1390 1381 - data = ALU_STAT_START | ALU_RESV_MCAST_ADDR | masks[ALU_STAT_WRITE]; 1391 + /* wait to be finished */ 1392 + ret = ksz9477_wait_alu_sta_ready(dev); 1393 + if (ret < 0) 1394 + return ret; 1382 1395 1383 - ret = ksz_write32(dev, REG_SW_ALU_STAT_CTRL__4, data); 1384 - if (ret < 0) 1385 - return ret; 1396 + ret = ksz_read32(dev, REG_SW_ALU_VAL_B, &data); 1397 + if (ret < 0) 1398 + return ret; 1386 1399 1387 - /* wait to be finished */ 1388 - ret = ksz9477_wait_alu_sta_ready(dev); 1389 - if (ret < 0) { 1390 - dev_err(dev->dev, "Failed to update Reserved Multicast table\n"); 1391 - return ret; 1400 + override = false; 1401 + ports = data & dev->port_mask; 1402 + switch (i) { 1403 + case 0: 1404 + case 6: 1405 + /* Change the host port. */ 1406 + update = BIT(dev->cpu_port); 1407 + override = true; 1408 + break; 1409 + case 2: 1410 + /* Change the host port. */ 1411 + update = BIT(dev->cpu_port); 1412 + break; 1413 + case 4: 1414 + case 5: 1415 + case 7: 1416 + /* Skip the host port. */ 1417 + update = dev->port_mask & ~BIT(dev->cpu_port); 1418 + break; 1419 + default: 1420 + update = ports; 1421 + break; 1422 + } 1423 + if (update != ports || override) { 1424 + data &= ~dev->port_mask; 1425 + data |= update; 1426 + /* Set Override bit to receive frame even when port is 1427 + * closed. 1428 + */ 1429 + if (override) 1430 + data |= ALU_V_OVERRIDE; 1431 + ret = ksz_write32(dev, REG_SW_ALU_VAL_B, data); 1432 + if (ret < 0) 1433 + return ret; 1434 + 1435 + data = reserved_mcast_map[i] << 1436 + dev->info->shifts[ALU_STAT_INDEX]; 1437 + data |= ALU_STAT_START | 1438 + masks[ALU_STAT_DIRECT] | 1439 + masks[ALU_RESV_MCAST_ADDR] | 1440 + masks[ALU_STAT_WRITE]; 1441 + ret = ksz_write32(dev, REG_SW_ALU_STAT_CTRL__4, data); 1442 + if (ret < 0) 1443 + return ret; 1444 + 1445 + /* wait to be finished */ 1446 + ret = ksz9477_wait_alu_sta_ready(dev); 1447 + if (ret < 0) 1448 + return ret; 1449 + } 1392 1450 } 1393 1451 1394 1452 return 0;
+1 -2
drivers/net/dsa/microchip/ksz9477_reg.h
··· 2 2 /* 3 3 * Microchip KSZ9477 register definitions 4 4 * 5 - * Copyright (C) 2017-2024 Microchip Technology Inc. 5 + * Copyright (C) 2017-2025 Microchip Technology Inc. 6 6 */ 7 7 8 8 #ifndef __KSZ9477_REGS_H ··· 397 397 398 398 #define ALU_RESV_MCAST_INDEX_M (BIT(6) - 1) 399 399 #define ALU_STAT_START BIT(7) 400 - #define ALU_RESV_MCAST_ADDR BIT(1) 401 400 402 401 #define REG_SW_ALU_VAL_A 0x0420 403 402
+4
drivers/net/dsa/microchip/ksz_common.c
··· 808 808 static const u32 ksz9477_masks[] = { 809 809 [ALU_STAT_WRITE] = 0, 810 810 [ALU_STAT_READ] = 1, 811 + [ALU_STAT_DIRECT] = 0, 812 + [ALU_RESV_MCAST_ADDR] = BIT(1), 811 813 [P_MII_TX_FLOW_CTRL] = BIT(5), 812 814 [P_MII_RX_FLOW_CTRL] = BIT(3), 813 815 }; ··· 837 835 static const u32 lan937x_masks[] = { 838 836 [ALU_STAT_WRITE] = 1, 839 837 [ALU_STAT_READ] = 2, 838 + [ALU_STAT_DIRECT] = BIT(3), 839 + [ALU_RESV_MCAST_ADDR] = BIT(2), 840 840 [P_MII_TX_FLOW_CTRL] = BIT(5), 841 841 [P_MII_RX_FLOW_CTRL] = BIT(3), 842 842 };
+2
drivers/net/dsa/microchip/ksz_common.h
··· 294 294 DYNAMIC_MAC_TABLE_TIMESTAMP, 295 295 ALU_STAT_WRITE, 296 296 ALU_STAT_READ, 297 + ALU_STAT_DIRECT, 298 + ALU_RESV_MCAST_ADDR, 297 299 P_MII_TX_FLOW_CTRL, 298 300 P_MII_RX_FLOW_CTRL, 299 301 };
+5 -1
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 12439 12439 return -ENODEV; 12440 12440 } 12441 12441 12442 - static void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset) 12442 + void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset) 12443 12443 { 12444 12444 struct bnxt_hw_resc *hw_resc = &bp->hw_resc; 12445 12445 ··· 16892 16892 if (netif_running(dev)) 16893 16893 netif_close(dev); 16894 16894 16895 + if (bnxt_hwrm_func_drv_unrgtr(bp)) { 16896 + pcie_flr(pdev); 16897 + goto shutdown_exit; 16898 + } 16895 16899 bnxt_ptp_clear(bp); 16896 16900 bnxt_clear_int_mode(bp); 16897 16901 pci_disable_device(pdev);
+2 -1
drivers/net/ethernet/broadcom/bnxt/bnxt.h
··· 2149 2149 static inline void bnxt_bs_trace_check_wrap(struct bnxt_bs_trace_info *bs_trace, 2150 2150 u32 offset) 2151 2151 { 2152 - if (!bs_trace->wrapped && 2152 + if (!bs_trace->wrapped && bs_trace->magic_byte && 2153 2153 *bs_trace->magic_byte != BNXT_TRACE_BUF_MAGIC_BYTE) 2154 2154 bs_trace->wrapped = 1; 2155 2155 bs_trace->last_offset = offset; ··· 2941 2941 int bnxt_update_link(struct bnxt *bp, bool chng_link_state); 2942 2942 int bnxt_hwrm_set_pause(struct bnxt *); 2943 2943 int bnxt_hwrm_set_link_setting(struct bnxt *, bool, bool); 2944 + void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset); 2944 2945 int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset); 2945 2946 int bnxt_hwrm_alloc_wol_fltr(struct bnxt *bp); 2946 2947 int bnxt_hwrm_free_wol_fltr(struct bnxt *bp);
+3 -2
drivers/net/ethernet/broadcom/bnxt/bnxt_coredump.c
··· 333 333 u32 offset = 0; 334 334 int rc = 0; 335 335 336 + record->max_entries = cpu_to_le32(ctxm->max_entries); 337 + record->entry_size = cpu_to_le32(ctxm->entry_size); 338 + 336 339 rc = bnxt_dbg_hwrm_log_buffer_flush(bp, type, 0, &offset); 337 340 if (rc) 338 341 return; 339 342 340 343 bnxt_bs_trace_check_wrap(bs_trace, offset); 341 - record->max_entries = cpu_to_le32(ctxm->max_entries); 342 - record->entry_size = cpu_to_le32(ctxm->entry_size); 343 344 record->offset = cpu_to_le32(bs_trace->last_offset); 344 345 record->wrapped = bs_trace->wrapped; 345 346 }
+1 -1
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
··· 461 461 rtnl_unlock(); 462 462 break; 463 463 } 464 - bnxt_cancel_reservations(bp, false); 464 + bnxt_clear_reservations(bp, false); 465 465 bnxt_free_ctx_mem(bp, false); 466 466 break; 467 467 }
+2 -2
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
··· 1051 1051 if (ptp->ptp_clock) { 1052 1052 ptp_clock_unregister(ptp->ptp_clock); 1053 1053 ptp->ptp_clock = NULL; 1054 - kfree(ptp->ptp_info.pin_config); 1055 - ptp->ptp_info.pin_config = NULL; 1056 1054 } 1055 + kfree(ptp->ptp_info.pin_config); 1056 + ptp->ptp_info.pin_config = NULL; 1057 1057 } 1058 1058 1059 1059 int bnxt_ptp_init(struct bnxt *bp)
+15
drivers/net/ethernet/google/gve/gve_ptp.c
··· 26 26 return 0; 27 27 } 28 28 29 + static int gve_ptp_gettimex64(struct ptp_clock_info *info, 30 + struct timespec64 *ts, 31 + struct ptp_system_timestamp *sts) 32 + { 33 + return -EOPNOTSUPP; 34 + } 35 + 36 + static int gve_ptp_settime64(struct ptp_clock_info *info, 37 + const struct timespec64 *ts) 38 + { 39 + return -EOPNOTSUPP; 40 + } 41 + 29 42 static long gve_ptp_do_aux_work(struct ptp_clock_info *info) 30 43 { 31 44 const struct gve_ptp *ptp = container_of(info, struct gve_ptp, info); ··· 60 47 static const struct ptp_clock_info gve_ptp_caps = { 61 48 .owner = THIS_MODULE, 62 49 .name = "gve clock", 50 + .gettimex64 = gve_ptp_gettimex64, 51 + .settime64 = gve_ptp_settime64, 63 52 .do_aux_work = gve_ptp_do_aux_work, 64 53 }; 65 54
+2 -2
drivers/net/ethernet/intel/Kconfig
··· 146 146 tristate "Intel(R) 10GbE PCI Express adapters support" 147 147 depends on PCI 148 148 depends on PTP_1588_CLOCK_OPTIONAL 149 - select LIBIE_FWLOG 149 + select LIBIE_FWLOG if DEBUG_FS 150 150 select MDIO 151 151 select NET_DEVLINK 152 152 select PLDMFW ··· 298 298 select DIMLIB 299 299 select LIBIE 300 300 select LIBIE_ADMINQ 301 - select LIBIE_FWLOG 301 + select LIBIE_FWLOG if DEBUG_FS 302 302 select NET_DEVLINK 303 303 select PACKING 304 304 select PLDMFW
-2
drivers/net/ethernet/intel/ixgbe/ixgbe.h
··· 821 821 #ifdef CONFIG_IXGBE_HWMON 822 822 struct hwmon_buff *ixgbe_hwmon_buff; 823 823 #endif /* CONFIG_IXGBE_HWMON */ 824 - #ifdef CONFIG_DEBUG_FS 825 824 struct dentry *ixgbe_dbg_adapter; 826 - #endif /*CONFIG_DEBUG_FS*/ 827 825 828 826 u8 default_up; 829 827 /* Bitmask indicating in use pools */
+2 -4
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
··· 1516 1516 pool->xdp_cnt = numptrs; 1517 1517 pool->xdp = devm_kcalloc(pfvf->dev, 1518 1518 numptrs, sizeof(struct xdp_buff *), GFP_KERNEL); 1519 - if (IS_ERR(pool->xdp)) { 1520 - netdev_err(pfvf->netdev, "Creation of xsk pool failed\n"); 1521 - return PTR_ERR(pool->xdp); 1522 - } 1519 + if (!pool->xdp) 1520 + return -ENOMEM; 1523 1521 } 1524 1522 1525 1523 return 0;
+3
drivers/net/ethernet/mellanox/mlx5/core/en.h
··· 634 634 struct mlx5e_shampo_hd { 635 635 struct mlx5e_frag_page *pages; 636 636 u32 hd_per_wq; 637 + u32 hd_per_page; 637 638 u16 hd_per_wqe; 639 + u8 log_hd_per_page; 640 + u8 log_hd_entry_size; 638 641 unsigned long *bitmap; 639 642 u16 pi; 640 643 u16 ci;
+1 -3
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
··· 2125 2125 if (!size_read) 2126 2126 return i; 2127 2127 2128 - if (size_read == -EINVAL) 2129 - return -EINVAL; 2130 2128 if (size_read < 0) { 2131 2129 NL_SET_ERR_MSG_FMT_MOD( 2132 2130 extack, 2133 2131 "Query module eeprom by page failed, read %u bytes, err %d", 2134 2132 i, size_read); 2135 - return i; 2133 + return size_read; 2136 2134 } 2137 2135 2138 2136 i += size_read;
+19 -5
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 791 791 int node) 792 792 { 793 793 void *wqc = MLX5_ADDR_OF(rqc, rqp->rqc, wq); 794 + u8 log_hd_per_page, log_hd_entry_size; 795 + u16 hd_per_wq, hd_per_wqe; 794 796 u32 hd_pool_size; 795 - u16 hd_per_wq; 796 797 int wq_size; 797 798 int err; 798 799 ··· 816 815 if (err) 817 816 goto err_umr_mkey; 818 817 819 - rq->mpwqe.shampo->hd_per_wqe = 820 - mlx5e_shampo_hd_per_wqe(mdev, params, rqp); 818 + hd_per_wqe = mlx5e_shampo_hd_per_wqe(mdev, params, rqp); 821 819 wq_size = BIT(MLX5_GET(wq, wqc, log_wq_sz)); 822 - hd_pool_size = (rq->mpwqe.shampo->hd_per_wqe * wq_size) / 823 - MLX5E_SHAMPO_WQ_HEADER_PER_PAGE; 820 + 821 + BUILD_BUG_ON(MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE > PAGE_SHIFT); 822 + if (hd_per_wqe >= MLX5E_SHAMPO_WQ_HEADER_PER_PAGE) { 823 + log_hd_per_page = MLX5E_SHAMPO_LOG_WQ_HEADER_PER_PAGE; 824 + log_hd_entry_size = MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE; 825 + } else { 826 + log_hd_per_page = order_base_2(hd_per_wqe); 827 + log_hd_entry_size = order_base_2(PAGE_SIZE / hd_per_wqe); 828 + } 829 + 830 + rq->mpwqe.shampo->hd_per_wqe = hd_per_wqe; 831 + rq->mpwqe.shampo->hd_per_page = BIT(log_hd_per_page); 832 + rq->mpwqe.shampo->log_hd_per_page = log_hd_per_page; 833 + rq->mpwqe.shampo->log_hd_entry_size = log_hd_entry_size; 834 + 835 + hd_pool_size = (hd_per_wqe * wq_size) >> log_hd_per_page; 824 836 825 837 if (netif_rxq_has_unreadable_mp(rq->netdev, rq->ix)) { 826 838 /* Separate page pool for shampo headers */
+39 -33
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
··· 648 648 umr_wqe->hdr.uctrl.mkey_mask = cpu_to_be64(MLX5_MKEY_MASK_FREE); 649 649 } 650 650 651 - static struct mlx5e_frag_page *mlx5e_shampo_hd_to_frag_page(struct mlx5e_rq *rq, int header_index) 651 + static struct mlx5e_frag_page *mlx5e_shampo_hd_to_frag_page(struct mlx5e_rq *rq, 652 + int header_index) 652 653 { 653 - BUILD_BUG_ON(MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE > PAGE_SHIFT); 654 + struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; 654 655 655 - return &rq->mpwqe.shampo->pages[header_index >> MLX5E_SHAMPO_LOG_WQ_HEADER_PER_PAGE]; 656 + return &shampo->pages[header_index >> shampo->log_hd_per_page]; 656 657 } 657 658 658 - static u64 mlx5e_shampo_hd_offset(int header_index) 659 + static u64 mlx5e_shampo_hd_offset(struct mlx5e_rq *rq, int header_index) 659 660 { 660 - return (header_index & (MLX5E_SHAMPO_WQ_HEADER_PER_PAGE - 1)) << 661 - MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE; 661 + struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; 662 + u32 hd_per_page = shampo->hd_per_page; 663 + 664 + return (header_index & (hd_per_page - 1)) << shampo->log_hd_entry_size; 662 665 } 663 666 664 667 static void mlx5e_free_rx_shampo_hd_entry(struct mlx5e_rq *rq, u16 header_index); ··· 674 671 u16 pi, header_offset, err, wqe_bbs; 675 672 u32 lkey = rq->mdev->mlx5e_res.hw_objs.mkey; 676 673 struct mlx5e_umr_wqe *umr_wqe; 677 - int headroom, i = 0; 674 + int headroom, i; 678 675 679 676 headroom = rq->buff.headroom; 680 677 wqe_bbs = MLX5E_KSM_UMR_WQEBBS(ksm_entries); ··· 682 679 umr_wqe = mlx5_wq_cyc_get_wqe(&sq->wq, pi); 683 680 build_ksm_umr(sq, umr_wqe, shampo->mkey_be, index, ksm_entries); 684 681 685 - WARN_ON_ONCE(ksm_entries & (MLX5E_SHAMPO_WQ_HEADER_PER_PAGE - 1)); 686 - while (i < ksm_entries) { 687 - struct mlx5e_frag_page *frag_page = mlx5e_shampo_hd_to_frag_page(rq, index); 682 + for (i = 0; i < ksm_entries; i++, index++) { 683 + struct mlx5e_frag_page *frag_page; 688 684 u64 addr; 689 685 690 - err = mlx5e_page_alloc_fragmented(rq->hd_page_pool, frag_page); 691 - if (unlikely(err)) 692 - goto err_unmap; 686 + frag_page = mlx5e_shampo_hd_to_frag_page(rq, index); 687 + header_offset = mlx5e_shampo_hd_offset(rq, index); 688 + if (!header_offset) { 689 + err = mlx5e_page_alloc_fragmented(rq->hd_page_pool, 690 + frag_page); 691 + if (err) 692 + goto err_unmap; 693 + } 693 694 694 695 addr = page_pool_get_dma_addr_netmem(frag_page->netmem); 695 - 696 - for (int j = 0; j < MLX5E_SHAMPO_WQ_HEADER_PER_PAGE; j++) { 697 - header_offset = mlx5e_shampo_hd_offset(index++); 698 - 699 - umr_wqe->inline_ksms[i++] = (struct mlx5_ksm) { 700 - .key = cpu_to_be32(lkey), 701 - .va = cpu_to_be64(addr + header_offset + headroom), 702 - }; 703 - } 696 + umr_wqe->inline_ksms[i] = (struct mlx5_ksm) { 697 + .key = cpu_to_be32(lkey), 698 + .va = cpu_to_be64(addr + header_offset + headroom), 699 + }; 704 700 } 705 701 706 702 sq->db.wqe_info[pi] = (struct mlx5e_icosq_wqe_info) { ··· 715 713 return 0; 716 714 717 715 err_unmap: 718 - while (--i) { 716 + while (--i >= 0) { 719 717 --index; 720 - header_offset = mlx5e_shampo_hd_offset(index); 718 + header_offset = mlx5e_shampo_hd_offset(rq, index); 721 719 if (!header_offset) { 722 720 struct mlx5e_frag_page *frag_page = mlx5e_shampo_hd_to_frag_page(rq, index); 723 721 ··· 737 735 struct mlx5e_icosq *sq = rq->icosq; 738 736 int i, err, max_ksm_entries, len; 739 737 740 - max_ksm_entries = ALIGN_DOWN(MLX5E_MAX_KSM_PER_WQE(rq->mdev), 741 - MLX5E_SHAMPO_WQ_HEADER_PER_PAGE); 738 + max_ksm_entries = MLX5E_MAX_KSM_PER_WQE(rq->mdev); 742 739 ksm_entries = bitmap_find_window(shampo->bitmap, 743 740 shampo->hd_per_wqe, 744 741 shampo->hd_per_wq, shampo->pi); 745 - ksm_entries = ALIGN_DOWN(ksm_entries, MLX5E_SHAMPO_WQ_HEADER_PER_PAGE); 742 + ksm_entries = ALIGN_DOWN(ksm_entries, shampo->hd_per_page); 746 743 if (!ksm_entries) 747 744 return 0; 748 745 ··· 859 858 { 860 859 struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; 861 860 862 - if (((header_index + 1) & (MLX5E_SHAMPO_WQ_HEADER_PER_PAGE - 1)) == 0) { 861 + if (((header_index + 1) & (shampo->hd_per_page - 1)) == 0) { 863 862 struct mlx5e_frag_page *frag_page = mlx5e_shampo_hd_to_frag_page(rq, header_index); 864 863 865 864 mlx5e_page_release_fragmented(rq->hd_page_pool, frag_page); ··· 1226 1225 static void *mlx5e_shampo_get_packet_hd(struct mlx5e_rq *rq, u16 header_index) 1227 1226 { 1228 1227 struct mlx5e_frag_page *frag_page = mlx5e_shampo_hd_to_frag_page(rq, header_index); 1229 - u16 head_offset = mlx5e_shampo_hd_offset(header_index) + rq->buff.headroom; 1228 + u16 head_offset = mlx5e_shampo_hd_offset(rq, header_index); 1229 + void *addr = netmem_address(frag_page->netmem); 1230 1230 1231 - return netmem_address(frag_page->netmem) + head_offset; 1231 + return addr + head_offset + rq->buff.headroom; 1232 1232 } 1233 1233 1234 1234 static void mlx5e_shampo_update_ipv4_udp_hdr(struct mlx5e_rq *rq, struct iphdr *ipv4) ··· 2269 2267 struct mlx5_cqe64 *cqe, u16 header_index) 2270 2268 { 2271 2269 struct mlx5e_frag_page *frag_page = mlx5e_shampo_hd_to_frag_page(rq, header_index); 2272 - u16 head_offset = mlx5e_shampo_hd_offset(header_index); 2270 + u16 head_offset = mlx5e_shampo_hd_offset(rq, header_index); 2271 + struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; 2273 2272 u16 head_size = cqe->shampo.header_size; 2274 2273 u16 rx_headroom = rq->buff.headroom; 2275 2274 struct sk_buff *skb = NULL; ··· 2286 2283 data = hdr + rx_headroom; 2287 2284 frag_size = MLX5_SKB_FRAG_SZ(rx_headroom + head_size); 2288 2285 2289 - if (likely(frag_size <= BIT(MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE))) { 2286 + if (likely(frag_size <= BIT(shampo->log_hd_entry_size))) { 2290 2287 /* build SKB around header */ 2291 2288 dma_sync_single_range_for_cpu(rq->pdev, dma_addr, 0, frag_size, rq->buff.map_dir); 2292 2289 net_prefetchw(hdr); ··· 2359 2356 { 2360 2357 int nr_frags = skb_shinfo(skb)->nr_frags; 2361 2358 2362 - return PAGE_SIZE * nr_frags + data_bcnt <= GRO_LEGACY_MAX_SIZE; 2359 + if (PAGE_SIZE >= GRO_LEGACY_MAX_SIZE) 2360 + return skb->len + data_bcnt <= GRO_LEGACY_MAX_SIZE; 2361 + else 2362 + return PAGE_SIZE * nr_frags + data_bcnt <= GRO_LEGACY_MAX_SIZE; 2363 2363 } 2364 2364 2365 2365 static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
+9 -9
drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
··· 294 294 { 295 295 int i, j; 296 296 297 - mutex_lock(&lan966x->stats_lock); 297 + spin_lock(&lan966x->stats_lock); 298 298 299 299 for (i = 0; i < lan966x->num_phys_ports; i++) { 300 300 uint idx = i * lan966x->num_stats; ··· 310 310 } 311 311 } 312 312 313 - mutex_unlock(&lan966x->stats_lock); 313 + spin_unlock(&lan966x->stats_lock); 314 314 } 315 315 316 316 static int lan966x_get_sset_count(struct net_device *dev, int sset) ··· 365 365 366 366 idx = port->chip_port * lan966x->num_stats; 367 367 368 - mutex_lock(&lan966x->stats_lock); 368 + spin_lock(&lan966x->stats_lock); 369 369 370 370 mac_stats->FramesTransmittedOK = 371 371 lan966x->stats[idx + SYS_COUNT_TX_UC] + ··· 416 416 lan966x->stats[idx + SYS_COUNT_RX_LONG] + 417 417 lan966x->stats[idx + SYS_COUNT_RX_PMAC_LONG]; 418 418 419 - mutex_unlock(&lan966x->stats_lock); 419 + spin_unlock(&lan966x->stats_lock); 420 420 } 421 421 422 422 static const struct ethtool_rmon_hist_range lan966x_rmon_ranges[] = { ··· 442 442 443 443 idx = port->chip_port * lan966x->num_stats; 444 444 445 - mutex_lock(&lan966x->stats_lock); 445 + spin_lock(&lan966x->stats_lock); 446 446 447 447 rmon_stats->undersize_pkts = 448 448 lan966x->stats[idx + SYS_COUNT_RX_SHORT] + ··· 500 500 lan966x->stats[idx + SYS_COUNT_TX_SZ_1024_1526] + 501 501 lan966x->stats[idx + SYS_COUNT_TX_PMAC_SZ_1024_1526]; 502 502 503 - mutex_unlock(&lan966x->stats_lock); 503 + spin_unlock(&lan966x->stats_lock); 504 504 505 505 *ranges = lan966x_rmon_ranges; 506 506 } ··· 603 603 604 604 idx = port->chip_port * lan966x->num_stats; 605 605 606 - mutex_lock(&lan966x->stats_lock); 606 + spin_lock(&lan966x->stats_lock); 607 607 608 608 stats->rx_bytes = lan966x->stats[idx + SYS_COUNT_RX_OCT] + 609 609 lan966x->stats[idx + SYS_COUNT_RX_PMAC_OCT]; ··· 685 685 686 686 stats->collisions = lan966x->stats[idx + SYS_COUNT_TX_COL]; 687 687 688 - mutex_unlock(&lan966x->stats_lock); 688 + spin_unlock(&lan966x->stats_lock); 689 689 } 690 690 691 691 int lan966x_stats_init(struct lan966x *lan966x) ··· 701 701 return -ENOMEM; 702 702 703 703 /* Init stats worker */ 704 - mutex_init(&lan966x->stats_lock); 704 + spin_lock_init(&lan966x->stats_lock); 705 705 snprintf(queue_name, sizeof(queue_name), "%s-stats", 706 706 dev_name(lan966x->dev)); 707 707 lan966x->stats_queue = create_singlethread_workqueue(queue_name);
-2
drivers/net/ethernet/microchip/lan966x/lan966x_main.c
··· 1261 1261 1262 1262 cancel_delayed_work_sync(&lan966x->stats_work); 1263 1263 destroy_workqueue(lan966x->stats_queue); 1264 - mutex_destroy(&lan966x->stats_lock); 1265 1264 1266 1265 debugfs_remove_recursive(lan966x->debugfs_root); 1267 1266 ··· 1278 1279 1279 1280 cancel_delayed_work_sync(&lan966x->stats_work); 1280 1281 destroy_workqueue(lan966x->stats_queue); 1281 - mutex_destroy(&lan966x->stats_lock); 1282 1282 1283 1283 lan966x_mac_purge_entries(lan966x); 1284 1284 lan966x_mdb_deinit(lan966x);
+2 -2
drivers/net/ethernet/microchip/lan966x/lan966x_main.h
··· 295 295 const struct lan966x_stat_layout *stats_layout; 296 296 u32 num_stats; 297 297 298 - /* workqueue for reading stats */ 299 - struct mutex stats_lock; 298 + /* lock for reading stats */ 299 + spinlock_t stats_lock; 300 300 u64 *stats; 301 301 struct delayed_work stats_work; 302 302 struct workqueue_struct *stats_queue;
+4 -4
drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c
··· 403 403 u32 counter; 404 404 405 405 id = id & 0xff; /* counter limit */ 406 - mutex_lock(&lan966x->stats_lock); 406 + spin_lock(&lan966x->stats_lock); 407 407 lan_wr(SYS_STAT_CFG_STAT_VIEW_SET(id), lan966x, SYS_STAT_CFG); 408 408 counter = lan_rd(lan966x, SYS_CNT(LAN966X_STAT_ESDX_GRN_PKTS)) + 409 409 lan_rd(lan966x, SYS_CNT(LAN966X_STAT_ESDX_YEL_PKTS)); 410 - mutex_unlock(&lan966x->stats_lock); 410 + spin_unlock(&lan966x->stats_lock); 411 411 if (counter) 412 412 admin->cache.counter = counter; 413 413 } ··· 417 417 { 418 418 id = id & 0xff; /* counter limit */ 419 419 420 - mutex_lock(&lan966x->stats_lock); 420 + spin_lock(&lan966x->stats_lock); 421 421 lan_wr(SYS_STAT_CFG_STAT_VIEW_SET(id), lan966x, SYS_STAT_CFG); 422 422 lan_wr(0, lan966x, SYS_CNT(LAN966X_STAT_ESDX_GRN_BYTES)); 423 423 lan_wr(admin->cache.counter, lan966x, 424 424 SYS_CNT(LAN966X_STAT_ESDX_GRN_PKTS)); 425 425 lan_wr(0, lan966x, SYS_CNT(LAN966X_STAT_ESDX_YEL_BYTES)); 426 426 lan_wr(0, lan966x, SYS_CNT(LAN966X_STAT_ESDX_YEL_PKTS)); 427 - mutex_unlock(&lan966x->stats_lock); 427 + spin_unlock(&lan966x->stats_lock); 428 428 } 429 429 430 430 static void lan966x_vcap_cache_write(struct net_device *dev,
+17 -17
drivers/net/ethernet/pensando/ionic/ionic_txrx.c
··· 29 29 30 30 static inline void ionic_txq_post(struct ionic_queue *q, bool ring_dbell) 31 31 { 32 + /* Ensure TX descriptor writes reach memory before NIC reads them. 33 + * Prevents device from fetching stale descriptors. 34 + */ 35 + dma_wmb(); 32 36 ionic_q_post(q, ring_dbell); 33 37 } 34 38 ··· 1448 1444 bool encap; 1449 1445 int err; 1450 1446 1451 - desc_info = &q->tx_info[q->head_idx]; 1452 - 1453 - if (unlikely(ionic_tx_map_skb(q, skb, desc_info))) 1454 - return -EIO; 1455 - 1456 - len = skb->len; 1457 - mss = skb_shinfo(skb)->gso_size; 1458 - outer_csum = (skb_shinfo(skb)->gso_type & (SKB_GSO_GRE | 1459 - SKB_GSO_GRE_CSUM | 1460 - SKB_GSO_IPXIP4 | 1461 - SKB_GSO_IPXIP6 | 1462 - SKB_GSO_UDP_TUNNEL | 1463 - SKB_GSO_UDP_TUNNEL_CSUM)); 1464 1447 has_vlan = !!skb_vlan_tag_present(skb); 1465 1448 vlan_tci = skb_vlan_tag_get(skb); 1466 1449 encap = skb->encapsulation; ··· 1461 1470 err = ionic_tx_tcp_inner_pseudo_csum(skb); 1462 1471 else 1463 1472 err = ionic_tx_tcp_pseudo_csum(skb); 1464 - if (unlikely(err)) { 1465 - /* clean up mapping from ionic_tx_map_skb */ 1466 - ionic_tx_desc_unmap_bufs(q, desc_info); 1473 + if (unlikely(err)) 1467 1474 return err; 1468 - } 1469 1475 1476 + desc_info = &q->tx_info[q->head_idx]; 1477 + if (unlikely(ionic_tx_map_skb(q, skb, desc_info))) 1478 + return -EIO; 1479 + 1480 + len = skb->len; 1481 + mss = skb_shinfo(skb)->gso_size; 1482 + outer_csum = (skb_shinfo(skb)->gso_type & (SKB_GSO_GRE | 1483 + SKB_GSO_GRE_CSUM | 1484 + SKB_GSO_IPXIP4 | 1485 + SKB_GSO_IPXIP6 | 1486 + SKB_GSO_UDP_TUNNEL | 1487 + SKB_GSO_UDP_TUNNEL_CSUM)); 1470 1488 if (encap) 1471 1489 hdrlen = skb_inner_tcp_all_headers(skb); 1472 1490 else
+3
drivers/net/ethernet/spacemit/k1_emac.c
··· 1441 1441 struct emac_priv *priv = netdev_priv(dev); 1442 1442 u8 fc = 0; 1443 1443 1444 + if (!netif_running(dev)) 1445 + return -ENETDOWN; 1446 + 1444 1447 priv->flow_control_autoneg = pause->autoneg; 1445 1448 1446 1449 if (pause->autoneg) {
+7
drivers/net/ethernet/ti/icssg/icssg_config.c
··· 66 66 #define FDB_GEN_CFG1 0x60 67 67 #define SMEM_VLAN_OFFSET 8 68 68 #define SMEM_VLAN_OFFSET_MASK GENMASK(25, 8) 69 + #define FDB_HASH_SIZE_MASK GENMASK(6, 3) 70 + #define FDB_HASH_SIZE_SHIFT 3 71 + #define FDB_HASH_SIZE 3 69 72 70 73 #define FDB_GEN_CFG2 0x64 71 74 #define FDB_VLAN_EN BIT(6) ··· 466 463 /* Set VLAN TABLE address base */ 467 464 regmap_update_bits(prueth->miig_rt, FDB_GEN_CFG1, SMEM_VLAN_OFFSET_MASK, 468 465 addr << SMEM_VLAN_OFFSET); 466 + regmap_update_bits(prueth->miig_rt, FDB_GEN_CFG1, FDB_HASH_SIZE_MASK, 467 + FDB_HASH_SIZE << FDB_HASH_SIZE_SHIFT); 469 468 /* Set enable VLAN aware mode, and FDBs for all PRUs */ 470 469 regmap_write(prueth->miig_rt, FDB_GEN_CFG2, (FDB_PRU0_EN | FDB_PRU1_EN | FDB_HOST_EN)); 471 470 prueth->vlan_tbl = (struct prueth_vlan_tbl __force *)(prueth->shram.va + ··· 489 484 /* Set VLAN TABLE address base */ 490 485 regmap_update_bits(prueth->miig_rt, FDB_GEN_CFG1, SMEM_VLAN_OFFSET_MASK, 491 486 addr << SMEM_VLAN_OFFSET); 487 + regmap_update_bits(prueth->miig_rt, FDB_GEN_CFG1, FDB_HASH_SIZE_MASK, 488 + FDB_HASH_SIZE << FDB_HASH_SIZE_SHIFT); 492 489 /* Set enable VLAN aware mode, and FDBs for all PRUs */ 493 490 regmap_write(prueth->miig_rt, FDB_GEN_CFG2, FDB_EN_ALL); 494 491 prueth->vlan_tbl = (struct prueth_vlan_tbl __force *)(prueth->shram.va +
+5 -5
drivers/net/ethernet/ti/netcp_core.c
··· 1338 1338 1339 1339 tx_pipe->dma_channel = knav_dma_open_channel(dev, 1340 1340 tx_pipe->dma_chan_name, &config); 1341 - if (IS_ERR(tx_pipe->dma_channel)) { 1341 + if (!tx_pipe->dma_channel) { 1342 1342 dev_err(dev, "failed opening tx chan(%s)\n", 1343 1343 tx_pipe->dma_chan_name); 1344 - ret = PTR_ERR(tx_pipe->dma_channel); 1344 + ret = -EINVAL; 1345 1345 goto err; 1346 1346 } 1347 1347 ··· 1359 1359 return 0; 1360 1360 1361 1361 err: 1362 - if (!IS_ERR_OR_NULL(tx_pipe->dma_channel)) 1362 + if (tx_pipe->dma_channel) 1363 1363 knav_dma_close_channel(tx_pipe->dma_channel); 1364 1364 tx_pipe->dma_channel = NULL; 1365 1365 return ret; ··· 1678 1678 1679 1679 netcp->rx_channel = knav_dma_open_channel(netcp->netcp_device->device, 1680 1680 netcp->dma_chan_name, &config); 1681 - if (IS_ERR(netcp->rx_channel)) { 1681 + if (!netcp->rx_channel) { 1682 1682 dev_err(netcp->ndev_dev, "failed opening rx chan(%s\n", 1683 1683 netcp->dma_chan_name); 1684 - ret = PTR_ERR(netcp->rx_channel); 1684 + ret = -EINVAL; 1685 1685 goto fail; 1686 1686 } 1687 1687
+2 -1
drivers/net/ethernet/wangxun/libwx/wx_hw.c
··· 2427 2427 wx->oem_svid = pdev->subsystem_vendor; 2428 2428 wx->oem_ssid = pdev->subsystem_device; 2429 2429 wx->bus.device = PCI_SLOT(pdev->devfn); 2430 - wx->bus.func = PCI_FUNC(pdev->devfn); 2430 + wx->bus.func = FIELD_GET(WX_CFG_PORT_ST_LANID, 2431 + rd32(wx, WX_CFG_PORT_ST)); 2431 2432 2432 2433 if (wx->oem_svid == PCI_VENDOR_ID_WANGXUN || 2433 2434 pdev->is_virtfn) {
+2 -2
drivers/net/ethernet/wangxun/libwx/wx_type.h
··· 97 97 #define WX_CFG_PORT_CTL_DRV_LOAD BIT(3) 98 98 #define WX_CFG_PORT_CTL_QINQ BIT(2) 99 99 #define WX_CFG_PORT_CTL_D_VLAN BIT(0) /* double vlan*/ 100 + #define WX_CFG_PORT_ST 0x14404 101 + #define WX_CFG_PORT_ST_LANID GENMASK(9, 8) 100 102 #define WX_CFG_TAG_TPID(_i) (0x14430 + ((_i) * 4)) 101 103 #define WX_CFG_PORT_CTL_NUM_VT_MASK GENMASK(13, 12) /* number of TVs */ 102 104 ··· 558 556 /* Tx Descriptors needed, worst case */ 559 557 #define TXD_USE_COUNT(S) DIV_ROUND_UP((S), WX_MAX_DATA_PER_TXD) 560 558 #define DESC_NEEDED (MAX_SKB_FRAGS + 4) 561 - 562 - #define WX_CFG_PORT_ST 0x14404 563 559 564 560 /******************* Receive Descriptor bit definitions **********************/ 565 561 #define WX_RXD_STAT_DD BIT(0) /* Done */
+2
drivers/net/mdio/mdio-airoha.c
··· 219 219 priv = bus->priv; 220 220 priv->base_addr = addr; 221 221 priv->regmap = device_node_to_regmap(dev->parent->of_node); 222 + if (IS_ERR(priv->regmap)) 223 + return PTR_ERR(priv->regmap); 222 224 223 225 priv->clk = devm_clk_get_enabled(dev, NULL); 224 226 if (IS_ERR(priv->clk))
+10
drivers/net/netconsole.c
··· 936 936 if (count > MAX_EXTRADATA_VALUE_LEN) 937 937 return -EMSGSIZE; 938 938 939 + mutex_lock(&netconsole_subsys.su_mutex); 939 940 mutex_lock(&dynamic_netconsole_mutex); 940 941 941 942 ret = strscpy(udm->value, buf, sizeof(udm->value)); ··· 950 949 ret = count; 951 950 out_unlock: 952 951 mutex_unlock(&dynamic_netconsole_mutex); 952 + mutex_unlock(&netconsole_subsys.su_mutex); 953 953 return ret; 954 954 } 955 955 ··· 976 974 if (ret) 977 975 return ret; 978 976 977 + mutex_lock(&netconsole_subsys.su_mutex); 979 978 mutex_lock(&dynamic_netconsole_mutex); 980 979 curr = !!(nt->sysdata_fields & SYSDATA_MSGID); 981 980 if (msgid_enabled == curr) ··· 997 994 ret = strnlen(buf, count); 998 995 unlock: 999 996 mutex_unlock(&dynamic_netconsole_mutex); 997 + mutex_unlock(&netconsole_subsys.su_mutex); 1000 998 return ret; 1001 999 } 1002 1000 ··· 1012 1008 if (ret) 1013 1009 return ret; 1014 1010 1011 + mutex_lock(&netconsole_subsys.su_mutex); 1015 1012 mutex_lock(&dynamic_netconsole_mutex); 1016 1013 curr = !!(nt->sysdata_fields & SYSDATA_RELEASE); 1017 1014 if (release_enabled == curr) ··· 1033 1028 ret = strnlen(buf, count); 1034 1029 unlock: 1035 1030 mutex_unlock(&dynamic_netconsole_mutex); 1031 + mutex_unlock(&netconsole_subsys.su_mutex); 1036 1032 return ret; 1037 1033 } 1038 1034 ··· 1048 1042 if (ret) 1049 1043 return ret; 1050 1044 1045 + mutex_lock(&netconsole_subsys.su_mutex); 1051 1046 mutex_lock(&dynamic_netconsole_mutex); 1052 1047 curr = !!(nt->sysdata_fields & SYSDATA_TASKNAME); 1053 1048 if (taskname_enabled == curr) ··· 1069 1062 ret = strnlen(buf, count); 1070 1063 unlock: 1071 1064 mutex_unlock(&dynamic_netconsole_mutex); 1065 + mutex_unlock(&netconsole_subsys.su_mutex); 1072 1066 return ret; 1073 1067 } 1074 1068 ··· 1085 1077 if (ret) 1086 1078 return ret; 1087 1079 1080 + mutex_lock(&netconsole_subsys.su_mutex); 1088 1081 mutex_lock(&dynamic_netconsole_mutex); 1089 1082 curr = !!(nt->sysdata_fields & SYSDATA_CPU_NR); 1090 1083 if (cpu_nr_enabled == curr) ··· 1114 1105 ret = strnlen(buf, count); 1115 1106 unlock: 1116 1107 mutex_unlock(&dynamic_netconsole_mutex); 1108 + mutex_unlock(&netconsole_subsys.su_mutex); 1117 1109 return ret; 1118 1110 } 1119 1111
+163
drivers/net/phy/micrel.c
··· 466 466 u16 rev; 467 467 }; 468 468 469 + struct lanphy_reg_data { 470 + int page; 471 + u16 addr; 472 + u16 val; 473 + }; 474 + 469 475 static const struct kszphy_type lan8814_type = { 470 476 .led_mode_reg = ~LAN8814_LED_CTRL_1, 471 477 .cable_diag_reg = LAN8814_CABLE_DIAG, ··· 2842 2836 #define LAN8814_PAGE_PCS_DIGITAL 2 2843 2837 2844 2838 /** 2839 + * LAN8814_PAGE_EEE - Selects Extended Page 3. 2840 + * 2841 + * This page contains EEE registers 2842 + */ 2843 + #define LAN8814_PAGE_EEE 3 2844 + 2845 + /** 2845 2846 * LAN8814_PAGE_COMMON_REGS - Selects Extended Page 4. 2846 2847 * 2847 2848 * This page contains device-common registers that affect the entire chip. ··· 2865 2852 * rate adaptation FIFOs, and the per-port 1588 TSU block. 2866 2853 */ 2867 2854 #define LAN8814_PAGE_PORT_REGS 5 2855 + 2856 + /** 2857 + * LAN8814_PAGE_POWER_REGS - Selects Extended Page 28. 2858 + * 2859 + * This page contains analog control registers and power mode registers. 2860 + */ 2861 + #define LAN8814_PAGE_POWER_REGS 28 2868 2862 2869 2863 /** 2870 2864 * LAN8814_PAGE_SYSTEM_CTRL - Selects Extended Page 31. ··· 5904 5884 return 0; 5905 5885 } 5906 5886 5887 + #define LAN8814_POWER_MGMT_MODE_3_ANEG_MDI 0x13 5888 + #define LAN8814_POWER_MGMT_MODE_4_ANEG_MDIX 0x14 5889 + #define LAN8814_POWER_MGMT_MODE_5_10BT_MDI 0x15 5890 + #define LAN8814_POWER_MGMT_MODE_6_10BT_MDIX 0x16 5891 + #define LAN8814_POWER_MGMT_MODE_7_100BT_TRAIN 0x17 5892 + #define LAN8814_POWER_MGMT_MODE_8_100BT_MDI 0x18 5893 + #define LAN8814_POWER_MGMT_MODE_9_100BT_EEE_MDI_TX 0x19 5894 + #define LAN8814_POWER_MGMT_MODE_10_100BT_EEE_MDI_RX 0x1a 5895 + #define LAN8814_POWER_MGMT_MODE_11_100BT_MDIX 0x1b 5896 + #define LAN8814_POWER_MGMT_MODE_12_100BT_EEE_MDIX_TX 0x1c 5897 + #define LAN8814_POWER_MGMT_MODE_13_100BT_EEE_MDIX_RX 0x1d 5898 + #define LAN8814_POWER_MGMT_MODE_14_100BTX_EEE_TX_RX 0x1e 5899 + 5900 + #define LAN8814_POWER_MGMT_DLLPD_D BIT(0) 5901 + #define LAN8814_POWER_MGMT_ADCPD_D BIT(1) 5902 + #define LAN8814_POWER_MGMT_PGAPD_D BIT(2) 5903 + #define LAN8814_POWER_MGMT_TXPD_D BIT(3) 5904 + #define LAN8814_POWER_MGMT_DLLPD_C BIT(4) 5905 + #define LAN8814_POWER_MGMT_ADCPD_C BIT(5) 5906 + #define LAN8814_POWER_MGMT_PGAPD_C BIT(6) 5907 + #define LAN8814_POWER_MGMT_TXPD_C BIT(7) 5908 + #define LAN8814_POWER_MGMT_DLLPD_B BIT(8) 5909 + #define LAN8814_POWER_MGMT_ADCPD_B BIT(9) 5910 + #define LAN8814_POWER_MGMT_PGAPD_B BIT(10) 5911 + #define LAN8814_POWER_MGMT_TXPD_B BIT(11) 5912 + #define LAN8814_POWER_MGMT_DLLPD_A BIT(12) 5913 + #define LAN8814_POWER_MGMT_ADCPD_A BIT(13) 5914 + #define LAN8814_POWER_MGMT_PGAPD_A BIT(14) 5915 + #define LAN8814_POWER_MGMT_TXPD_A BIT(15) 5916 + 5917 + #define LAN8814_POWER_MGMT_C_D (LAN8814_POWER_MGMT_DLLPD_D | \ 5918 + LAN8814_POWER_MGMT_ADCPD_D | \ 5919 + LAN8814_POWER_MGMT_PGAPD_D | \ 5920 + LAN8814_POWER_MGMT_DLLPD_C | \ 5921 + LAN8814_POWER_MGMT_ADCPD_C | \ 5922 + LAN8814_POWER_MGMT_PGAPD_C) 5923 + 5924 + #define LAN8814_POWER_MGMT_B_C_D (LAN8814_POWER_MGMT_C_D | \ 5925 + LAN8814_POWER_MGMT_DLLPD_B | \ 5926 + LAN8814_POWER_MGMT_ADCPD_B | \ 5927 + LAN8814_POWER_MGMT_PGAPD_B) 5928 + 5929 + #define LAN8814_POWER_MGMT_VAL1 (LAN8814_POWER_MGMT_C_D | \ 5930 + LAN8814_POWER_MGMT_ADCPD_B | \ 5931 + LAN8814_POWER_MGMT_PGAPD_B | \ 5932 + LAN8814_POWER_MGMT_ADCPD_A | \ 5933 + LAN8814_POWER_MGMT_PGAPD_A) 5934 + 5935 + #define LAN8814_POWER_MGMT_VAL2 LAN8814_POWER_MGMT_C_D 5936 + 5937 + #define LAN8814_POWER_MGMT_VAL3 (LAN8814_POWER_MGMT_C_D | \ 5938 + LAN8814_POWER_MGMT_DLLPD_B | \ 5939 + LAN8814_POWER_MGMT_ADCPD_B | \ 5940 + LAN8814_POWER_MGMT_PGAPD_A) 5941 + 5942 + #define LAN8814_POWER_MGMT_VAL4 (LAN8814_POWER_MGMT_B_C_D | \ 5943 + LAN8814_POWER_MGMT_ADCPD_A | \ 5944 + LAN8814_POWER_MGMT_PGAPD_A) 5945 + 5946 + #define LAN8814_POWER_MGMT_VAL5 LAN8814_POWER_MGMT_B_C_D 5947 + 5948 + #define LAN8814_EEE_WAKE_TX_TIMER 0x0e 5949 + #define LAN8814_EEE_WAKE_TX_TIMER_MAX_VAL 0x1f 5950 + 5951 + static const struct lanphy_reg_data short_center_tap_errata[] = { 5952 + { LAN8814_PAGE_POWER_REGS, 5953 + LAN8814_POWER_MGMT_MODE_3_ANEG_MDI, 5954 + LAN8814_POWER_MGMT_VAL1 }, 5955 + { LAN8814_PAGE_POWER_REGS, 5956 + LAN8814_POWER_MGMT_MODE_4_ANEG_MDIX, 5957 + LAN8814_POWER_MGMT_VAL1 }, 5958 + { LAN8814_PAGE_POWER_REGS, 5959 + LAN8814_POWER_MGMT_MODE_5_10BT_MDI, 5960 + LAN8814_POWER_MGMT_VAL1 }, 5961 + { LAN8814_PAGE_POWER_REGS, 5962 + LAN8814_POWER_MGMT_MODE_6_10BT_MDIX, 5963 + LAN8814_POWER_MGMT_VAL1 }, 5964 + { LAN8814_PAGE_POWER_REGS, 5965 + LAN8814_POWER_MGMT_MODE_7_100BT_TRAIN, 5966 + LAN8814_POWER_MGMT_VAL2 }, 5967 + { LAN8814_PAGE_POWER_REGS, 5968 + LAN8814_POWER_MGMT_MODE_8_100BT_MDI, 5969 + LAN8814_POWER_MGMT_VAL3 }, 5970 + { LAN8814_PAGE_POWER_REGS, 5971 + LAN8814_POWER_MGMT_MODE_9_100BT_EEE_MDI_TX, 5972 + LAN8814_POWER_MGMT_VAL3 }, 5973 + { LAN8814_PAGE_POWER_REGS, 5974 + LAN8814_POWER_MGMT_MODE_10_100BT_EEE_MDI_RX, 5975 + LAN8814_POWER_MGMT_VAL4 }, 5976 + { LAN8814_PAGE_POWER_REGS, 5977 + LAN8814_POWER_MGMT_MODE_11_100BT_MDIX, 5978 + LAN8814_POWER_MGMT_VAL5 }, 5979 + { LAN8814_PAGE_POWER_REGS, 5980 + LAN8814_POWER_MGMT_MODE_12_100BT_EEE_MDIX_TX, 5981 + LAN8814_POWER_MGMT_VAL5 }, 5982 + { LAN8814_PAGE_POWER_REGS, 5983 + LAN8814_POWER_MGMT_MODE_13_100BT_EEE_MDIX_RX, 5984 + LAN8814_POWER_MGMT_VAL4 }, 5985 + { LAN8814_PAGE_POWER_REGS, 5986 + LAN8814_POWER_MGMT_MODE_14_100BTX_EEE_TX_RX, 5987 + LAN8814_POWER_MGMT_VAL4 }, 5988 + }; 5989 + 5990 + static const struct lanphy_reg_data waketx_timer_errata[] = { 5991 + { LAN8814_PAGE_EEE, 5992 + LAN8814_EEE_WAKE_TX_TIMER, 5993 + LAN8814_EEE_WAKE_TX_TIMER_MAX_VAL }, 5994 + }; 5995 + 5996 + static int lanphy_write_reg_data(struct phy_device *phydev, 5997 + const struct lanphy_reg_data *data, 5998 + size_t num) 5999 + { 6000 + int ret = 0; 6001 + 6002 + while (num--) { 6003 + ret = lanphy_write_page_reg(phydev, data->page, data->addr, 6004 + data->val); 6005 + if (ret) 6006 + break; 6007 + } 6008 + 6009 + return ret; 6010 + } 6011 + 6012 + static int lan8842_erratas(struct phy_device *phydev) 6013 + { 6014 + int ret; 6015 + 6016 + ret = lanphy_write_reg_data(phydev, short_center_tap_errata, 6017 + ARRAY_SIZE(short_center_tap_errata)); 6018 + if (ret) 6019 + return ret; 6020 + 6021 + return lanphy_write_reg_data(phydev, waketx_timer_errata, 6022 + ARRAY_SIZE(waketx_timer_errata)); 6023 + } 6024 + 5907 6025 static int lan8842_config_init(struct phy_device *phydev) 5908 6026 { 5909 6027 int ret; ··· 6051 5893 LAN8814_QSGMII_SOFT_RESET, 6052 5894 LAN8814_QSGMII_SOFT_RESET_BIT, 6053 5895 LAN8814_QSGMII_SOFT_RESET_BIT); 5896 + if (ret < 0) 5897 + return ret; 5898 + 5899 + /* Apply the erratas for this device */ 5900 + ret = lan8842_erratas(phydev); 6054 5901 if (ret < 0) 6055 5902 return ret; 6056 5903
+6
drivers/net/usb/qmi_wwan.c
··· 192 192 if (!skbn) 193 193 return 0; 194 194 195 + /* Raw IP packets don't have a MAC header, but other subsystems 196 + * (like xfrm) may still access MAC header offsets, so they must 197 + * be initialized. 198 + */ 199 + skb_reset_mac_header(skbn); 200 + 195 201 switch (skb->data[offset + qmimux_hdr_sz] & 0xf0) { 196 202 case 0x40: 197 203 skbn->protocol = htons(ETH_P_IP);
+25 -15
drivers/net/virtio_net.c
··· 910 910 goto ok; 911 911 } 912 912 913 - /* 914 - * Verify that we can indeed put this data into a skb. 915 - * This is here to handle cases when the device erroneously 916 - * tries to receive more than is possible. This is usually 917 - * the case of a broken device. 918 - */ 919 - if (unlikely(len > MAX_SKB_FRAGS * PAGE_SIZE)) { 920 - net_dbg_ratelimited("%s: too much data\n", skb->dev->name); 921 - dev_kfree_skb(skb); 922 - return NULL; 923 - } 924 913 BUG_ON(offset >= PAGE_SIZE); 925 914 while (len) { 926 915 unsigned int frag_size = min((unsigned)PAGE_SIZE - offset, len); ··· 2101 2112 struct virtnet_rq_stats *stats) 2102 2113 { 2103 2114 struct page *page = buf; 2104 - struct sk_buff *skb = 2105 - page_to_skb(vi, rq, page, 0, len, PAGE_SIZE, 0); 2115 + struct sk_buff *skb; 2106 2116 2117 + /* Make sure that len does not exceed the size allocated in 2118 + * add_recvbuf_big. 2119 + */ 2120 + if (unlikely(len > (vi->big_packets_num_skbfrags + 1) * PAGE_SIZE)) { 2121 + pr_debug("%s: rx error: len %u exceeds allocated size %lu\n", 2122 + dev->name, len, 2123 + (vi->big_packets_num_skbfrags + 1) * PAGE_SIZE); 2124 + goto err; 2125 + } 2126 + 2127 + skb = page_to_skb(vi, rq, page, 0, len, PAGE_SIZE, 0); 2107 2128 u64_stats_add(&stats->bytes, len - vi->hdr_len); 2108 2129 if (unlikely(!skb)) 2109 2130 goto err; ··· 2538 2539 return NULL; 2539 2540 } 2540 2541 2542 + static inline u32 2543 + virtio_net_hash_value(const struct virtio_net_hdr_v1_hash *hdr_hash) 2544 + { 2545 + return __le16_to_cpu(hdr_hash->hash_value_lo) | 2546 + (__le16_to_cpu(hdr_hash->hash_value_hi) << 16); 2547 + } 2548 + 2541 2549 static void virtio_skb_set_hash(const struct virtio_net_hdr_v1_hash *hdr_hash, 2542 2550 struct sk_buff *skb) 2543 2551 { ··· 2571 2565 default: 2572 2566 rss_hash_type = PKT_HASH_TYPE_NONE; 2573 2567 } 2574 - skb_set_hash(skb, __le32_to_cpu(hdr_hash->hash_value), rss_hash_type); 2568 + skb_set_hash(skb, virtio_net_hash_value(hdr_hash), rss_hash_type); 2575 2569 } 2576 2570 2577 2571 static void virtnet_receive_done(struct virtnet_info *vi, struct receive_queue *rq, ··· 3316 3310 bool can_push; 3317 3311 3318 3312 pr_debug("%s: xmit %p %pM\n", vi->dev->name, skb, dest); 3313 + 3314 + /* Make sure it's safe to cast between formats */ 3315 + BUILD_BUG_ON(__alignof__(*hdr) != __alignof__(hdr->hash_hdr)); 3316 + BUILD_BUG_ON(__alignof__(*hdr) != __alignof__(hdr->hash_hdr.hdr)); 3319 3317 3320 3318 can_push = vi->any_header_sg && 3321 3319 !((unsigned long)skb->data & (__alignof__(*hdr) - 1)) && ··· 6760 6750 hash_report = VIRTIO_NET_HASH_REPORT_NONE; 6761 6751 6762 6752 *rss_type = virtnet_xdp_rss_type[hash_report]; 6763 - *hash = __le32_to_cpu(hdr_hash->hash_value); 6753 + *hash = virtio_net_hash_value(hdr_hash); 6764 6754 return 0; 6765 6755 } 6766 6756
+4 -3
drivers/net/wan/framer/pef2256/pef2256.c
··· 648 648 audio_devs[i].id = i; 649 649 } 650 650 651 - ret = mfd_add_devices(pef2256->dev, 0, audio_devs, count, NULL, 0, NULL); 651 + ret = devm_mfd_add_devices(pef2256->dev, 0, audio_devs, count, 652 + NULL, 0, NULL); 652 653 kfree(audio_devs); 653 654 return ret; 654 655 } ··· 823 822 824 823 platform_set_drvdata(pdev, pef2256); 825 824 826 - ret = mfd_add_devices(pef2256->dev, 0, pef2256_devs, 827 - ARRAY_SIZE(pef2256_devs), NULL, 0, NULL); 825 + ret = devm_mfd_add_devices(pef2256->dev, 0, pef2256_devs, 826 + ARRAY_SIZE(pef2256_devs), NULL, 0, NULL); 828 827 if (ret) { 829 828 dev_err(pef2256->dev, "add devices failed (%d)\n", ret); 830 829 return ret;
+20 -19
drivers/net/wireless/ath/ath10k/wmi.c
··· 1764 1764 1765 1765 int ath10k_wmi_wait_for_service_ready(struct ath10k *ar) 1766 1766 { 1767 - unsigned long timeout = jiffies + WMI_SERVICE_READY_TIMEOUT_HZ; 1768 1767 unsigned long time_left, i; 1769 1768 1770 - /* Sometimes the PCI HIF doesn't receive interrupt 1771 - * for the service ready message even if the buffer 1772 - * was completed. PCIe sniffer shows that it's 1773 - * because the corresponding CE ring doesn't fires 1774 - * it. Workaround here by polling CE rings. Since 1775 - * the message could arrive at any time, continue 1776 - * polling until timeout. 1777 - */ 1778 - do { 1769 + time_left = wait_for_completion_timeout(&ar->wmi.service_ready, 1770 + WMI_SERVICE_READY_TIMEOUT_HZ); 1771 + if (!time_left) { 1772 + /* Sometimes the PCI HIF doesn't receive interrupt 1773 + * for the service ready message even if the buffer 1774 + * was completed. PCIe sniffer shows that it's 1775 + * because the corresponding CE ring doesn't fires 1776 + * it. Workaround here by polling CE rings once. 1777 + */ 1778 + ath10k_warn(ar, "failed to receive service ready completion, polling..\n"); 1779 + 1779 1780 for (i = 0; i < CE_COUNT; i++) 1780 1781 ath10k_hif_send_complete_check(ar, i, 1); 1781 1782 1782 - /* The 100 ms granularity is a tradeoff considering scheduler 1783 - * overhead and response latency 1784 - */ 1785 1783 time_left = wait_for_completion_timeout(&ar->wmi.service_ready, 1786 - msecs_to_jiffies(100)); 1787 - if (time_left) 1788 - return 0; 1789 - } while (time_before(jiffies, timeout)); 1784 + WMI_SERVICE_READY_TIMEOUT_HZ); 1785 + if (!time_left) { 1786 + ath10k_warn(ar, "polling timed out\n"); 1787 + return -ETIMEDOUT; 1788 + } 1790 1789 1791 - ath10k_warn(ar, "failed to receive service ready completion\n"); 1792 - return -ETIMEDOUT; 1790 + ath10k_warn(ar, "service ready completion received, continuing normally\n"); 1791 + } 1792 + 1793 + return 0; 1793 1794 } 1794 1795 1795 1796 int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar)
+55 -67
drivers/net/wireless/ath/ath12k/mac.c
··· 4064 4064 return ret; 4065 4065 } 4066 4066 4067 - static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif) 4068 - { 4069 - struct ath12k *ar = arvif->ar; 4070 - struct ieee80211_vif *vif = arvif->ahvif->vif; 4071 - struct ieee80211_conf *conf = &ath12k_ar_to_hw(ar)->conf; 4072 - enum wmi_sta_powersave_param param; 4073 - struct ieee80211_bss_conf *info; 4074 - enum wmi_sta_ps_mode psmode; 4075 - int ret; 4076 - int timeout; 4077 - bool enable_ps; 4078 - 4079 - lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); 4080 - 4081 - if (vif->type != NL80211_IFTYPE_STATION) 4082 - return; 4083 - 4084 - enable_ps = arvif->ahvif->ps; 4085 - if (enable_ps) { 4086 - psmode = WMI_STA_PS_MODE_ENABLED; 4087 - param = WMI_STA_PS_PARAM_INACTIVITY_TIME; 4088 - 4089 - timeout = conf->dynamic_ps_timeout; 4090 - if (timeout == 0) { 4091 - info = ath12k_mac_get_link_bss_conf(arvif); 4092 - if (!info) { 4093 - ath12k_warn(ar->ab, "unable to access bss link conf in setup ps for vif %pM link %u\n", 4094 - vif->addr, arvif->link_id); 4095 - return; 4096 - } 4097 - 4098 - /* firmware doesn't like 0 */ 4099 - timeout = ieee80211_tu_to_usec(info->beacon_int) / 1000; 4100 - } 4101 - 4102 - ret = ath12k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, 4103 - timeout); 4104 - if (ret) { 4105 - ath12k_warn(ar->ab, "failed to set inactivity time for vdev %d: %i\n", 4106 - arvif->vdev_id, ret); 4107 - return; 4108 - } 4109 - } else { 4110 - psmode = WMI_STA_PS_MODE_DISABLED; 4111 - } 4112 - 4113 - ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %d psmode %s\n", 4114 - arvif->vdev_id, psmode ? "enable" : "disable"); 4115 - 4116 - ret = ath12k_wmi_pdev_set_ps_mode(ar, arvif->vdev_id, psmode); 4117 - if (ret) 4118 - ath12k_warn(ar->ab, "failed to set sta power save mode %d for vdev %d: %d\n", 4119 - psmode, arvif->vdev_id, ret); 4120 - } 4121 - 4122 4067 static void ath12k_mac_op_vif_cfg_changed(struct ieee80211_hw *hw, 4123 4068 struct ieee80211_vif *vif, 4124 4069 u64 changed) 4125 4070 { 4126 4071 struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif); 4127 4072 unsigned long links = ahvif->links_map; 4128 - struct ieee80211_vif_cfg *vif_cfg; 4129 4073 struct ieee80211_bss_conf *info; 4130 4074 struct ath12k_link_vif *arvif; 4131 4075 struct ieee80211_sta *sta; ··· 4133 4189 } 4134 4190 } 4135 4191 } 4192 + } 4136 4193 4137 - if (changed & BSS_CHANGED_PS) { 4138 - links = ahvif->links_map; 4139 - vif_cfg = &vif->cfg; 4194 + static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif) 4195 + { 4196 + struct ath12k *ar = arvif->ar; 4197 + struct ieee80211_vif *vif = arvif->ahvif->vif; 4198 + struct ieee80211_conf *conf = &ath12k_ar_to_hw(ar)->conf; 4199 + enum wmi_sta_powersave_param param; 4200 + struct ieee80211_bss_conf *info; 4201 + enum wmi_sta_ps_mode psmode; 4202 + int ret; 4203 + int timeout; 4204 + bool enable_ps; 4140 4205 4141 - for_each_set_bit(link_id, &links, IEEE80211_MLD_MAX_NUM_LINKS) { 4142 - arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]); 4143 - if (!arvif || !arvif->ar) 4144 - continue; 4206 + lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); 4145 4207 4146 - ar = arvif->ar; 4208 + if (vif->type != NL80211_IFTYPE_STATION) 4209 + return; 4147 4210 4148 - if (ar->ab->hw_params->supports_sta_ps) { 4149 - ahvif->ps = vif_cfg->ps; 4150 - ath12k_mac_vif_setup_ps(arvif); 4211 + enable_ps = arvif->ahvif->ps; 4212 + if (enable_ps) { 4213 + psmode = WMI_STA_PS_MODE_ENABLED; 4214 + param = WMI_STA_PS_PARAM_INACTIVITY_TIME; 4215 + 4216 + timeout = conf->dynamic_ps_timeout; 4217 + if (timeout == 0) { 4218 + info = ath12k_mac_get_link_bss_conf(arvif); 4219 + if (!info) { 4220 + ath12k_warn(ar->ab, "unable to access bss link conf in setup ps for vif %pM link %u\n", 4221 + vif->addr, arvif->link_id); 4222 + return; 4151 4223 } 4224 + 4225 + /* firmware doesn't like 0 */ 4226 + timeout = ieee80211_tu_to_usec(info->beacon_int) / 1000; 4152 4227 } 4228 + 4229 + ret = ath12k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, 4230 + timeout); 4231 + if (ret) { 4232 + ath12k_warn(ar->ab, "failed to set inactivity time for vdev %d: %i\n", 4233 + arvif->vdev_id, ret); 4234 + return; 4235 + } 4236 + } else { 4237 + psmode = WMI_STA_PS_MODE_DISABLED; 4153 4238 } 4239 + 4240 + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %d psmode %s\n", 4241 + arvif->vdev_id, psmode ? "enable" : "disable"); 4242 + 4243 + ret = ath12k_wmi_pdev_set_ps_mode(ar, arvif->vdev_id, psmode); 4244 + if (ret) 4245 + ath12k_warn(ar->ab, "failed to set sta power save mode %d for vdev %d: %d\n", 4246 + psmode, arvif->vdev_id, ret); 4154 4247 } 4155 4248 4156 4249 static bool ath12k_mac_supports_tpc(struct ath12k *ar, struct ath12k_vif *ahvif, ··· 4209 4228 { 4210 4229 struct ath12k_vif *ahvif = arvif->ahvif; 4211 4230 struct ieee80211_vif *vif = ath12k_ahvif_to_vif(ahvif); 4231 + struct ieee80211_vif_cfg *vif_cfg = &vif->cfg; 4212 4232 struct cfg80211_chan_def def; 4213 4233 u32 param_id, param_value; 4214 4234 enum nl80211_band band; ··· 4496 4514 } 4497 4515 4498 4516 ath12k_mac_fils_discovery(arvif, info); 4517 + 4518 + if (changed & BSS_CHANGED_PS && 4519 + ar->ab->hw_params->supports_sta_ps) { 4520 + ahvif->ps = vif_cfg->ps; 4521 + ath12k_mac_vif_setup_ps(arvif); 4522 + } 4499 4523 } 4500 4524 4501 4525 static struct ath12k_vif_cache *ath12k_ahvif_get_link_cache(struct ath12k_vif *ahvif,
+4 -3
drivers/net/wireless/virtual/mac80211_hwsim.c
··· 6698 6698 .n_mcgrps = ARRAY_SIZE(hwsim_mcgrps), 6699 6699 }; 6700 6700 6701 - static void remove_user_radios(u32 portid) 6701 + static void remove_user_radios(u32 portid, int netgroup) 6702 6702 { 6703 6703 struct mac80211_hwsim_data *entry, *tmp; 6704 6704 LIST_HEAD(list); 6705 6705 6706 6706 spin_lock_bh(&hwsim_radio_lock); 6707 6707 list_for_each_entry_safe(entry, tmp, &hwsim_radios, list) { 6708 - if (entry->destroy_on_close && entry->portid == portid) { 6708 + if (entry->destroy_on_close && entry->portid == portid && 6709 + entry->netgroup == netgroup) { 6709 6710 list_move(&entry->list, &list); 6710 6711 rhashtable_remove_fast(&hwsim_radios_rht, &entry->rht, 6711 6712 hwsim_rht_params); ··· 6731 6730 if (state != NETLINK_URELEASE) 6732 6731 return NOTIFY_DONE; 6733 6732 6734 - remove_user_radios(notify->portid); 6733 + remove_user_radios(notify->portid, hwsim_net_get_netgroup(notify->net)); 6735 6734 6736 6735 if (notify->portid == hwsim_net_get_wmediumd(notify->net)) { 6737 6736 printk(KERN_INFO "mac80211_hwsim: wmediumd released netlink"
+1
drivers/net/wireless/zydas/zd1211rw/zd_usb.c
··· 791 791 if (urbs) { 792 792 for (i = 0; i < RX_URBS_COUNT; i++) 793 793 free_rx_urb(urbs[i]); 794 + kfree(urbs); 794 795 } 795 796 return r; 796 797 }
+4
drivers/ptp/ptp_chardev.c
··· 561 561 return ptp_mask_en_single(pccontext->private_clkdata, argptr); 562 562 563 563 case PTP_SYS_OFFSET_PRECISE_CYCLES: 564 + if (!ptp->has_cycles) 565 + return -EOPNOTSUPP; 564 566 return ptp_sys_offset_precise(ptp, argptr, 565 567 ptp->info->getcrosscycles); 566 568 567 569 case PTP_SYS_OFFSET_EXTENDED_CYCLES: 570 + if (!ptp->has_cycles) 571 + return -EOPNOTSUPP; 568 572 return ptp_sys_offset_extended(ptp, argptr, 569 573 ptp->info->getcyclesx64); 570 574 default:
+7 -7
drivers/soc/ti/knav_dma.c
··· 402 402 * @name: slave channel name 403 403 * @config: dma configuration parameters 404 404 * 405 - * Returns pointer to appropriate DMA channel on success or error. 405 + * Return: Pointer to appropriate DMA channel on success or NULL on error. 406 406 */ 407 407 void *knav_dma_open_channel(struct device *dev, const char *name, 408 408 struct knav_dma_cfg *config) ··· 414 414 415 415 if (!kdev) { 416 416 pr_err("keystone-navigator-dma driver not registered\n"); 417 - return (void *)-EINVAL; 417 + return NULL; 418 418 } 419 419 420 420 chan_num = of_channel_match_helper(dev->of_node, name, &instance); 421 421 if (chan_num < 0) { 422 422 dev_err(kdev->dev, "No DMA instance with name %s\n", name); 423 - return (void *)-EINVAL; 423 + return NULL; 424 424 } 425 425 426 426 dev_dbg(kdev->dev, "initializing %s channel %d from DMA %s\n", ··· 431 431 if (config->direction != DMA_MEM_TO_DEV && 432 432 config->direction != DMA_DEV_TO_MEM) { 433 433 dev_err(kdev->dev, "bad direction\n"); 434 - return (void *)-EINVAL; 434 + return NULL; 435 435 } 436 436 437 437 /* Look for correct dma instance */ ··· 443 443 } 444 444 if (!dma) { 445 445 dev_err(kdev->dev, "No DMA instance with name %s\n", instance); 446 - return (void *)-EINVAL; 446 + return NULL; 447 447 } 448 448 449 449 /* Look for correct dma channel from dma instance */ ··· 463 463 if (!chan) { 464 464 dev_err(kdev->dev, "channel %d is not in DMA %s\n", 465 465 chan_num, instance); 466 - return (void *)-EINVAL; 466 + return NULL; 467 467 } 468 468 469 469 if (atomic_read(&chan->ref_count) >= 1) { 470 470 if (!check_config(chan, config)) { 471 471 dev_err(kdev->dev, "channel %d config miss-match\n", 472 472 chan_num); 473 - return (void *)-EINVAL; 473 + return NULL; 474 474 } 475 475 } 476 476
+12
include/linux/net/intel/libie/fwlog.h
··· 78 78 ); 79 79 }; 80 80 81 + #if IS_ENABLED(CONFIG_LIBIE_FWLOG) 81 82 int libie_fwlog_init(struct libie_fwlog *fwlog, struct libie_fwlog_api *api); 82 83 void libie_fwlog_deinit(struct libie_fwlog *fwlog); 83 84 void libie_fwlog_reregister(struct libie_fwlog *fwlog); 84 85 void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf, u16 len); 86 + #else 87 + static inline int libie_fwlog_init(struct libie_fwlog *fwlog, 88 + struct libie_fwlog_api *api) 89 + { 90 + return -EOPNOTSUPP; 91 + } 92 + static inline void libie_fwlog_deinit(struct libie_fwlog *fwlog) { } 93 + static inline void libie_fwlog_reregister(struct libie_fwlog *fwlog) { } 94 + static inline void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf, 95 + u16 len) { } 96 + #endif /* CONFIG_LIBIE_FWLOG */ 85 97 #endif /* _LIBIE_FWLOG_H_ */
+2 -1
include/linux/virtio_net.h
··· 401 401 if (!tnl_hdr_negotiated) 402 402 return -EINVAL; 403 403 404 - vhdr->hash_hdr.hash_value = 0; 404 + vhdr->hash_hdr.hash_value_lo = 0; 405 + vhdr->hash_hdr.hash_value_hi = 0; 405 406 vhdr->hash_hdr.hash_report = 0; 406 407 vhdr->hash_hdr.padding = 0; 407 408
+1 -1
include/net/bluetooth/mgmt.h
··· 780 780 __u8 ad_type; 781 781 __u8 offset; 782 782 __u8 length; 783 - __u8 value[31]; 783 + __u8 value[HCI_MAX_AD_LENGTH]; 784 784 } __packed; 785 785 786 786 #define MGMT_OP_ADD_ADV_PATTERNS_MONITOR 0x0052
+78
include/net/cfg80211.h
··· 6435 6435 * after wiphy_lock() was called. Therefore, wiphy_cancel_work() can 6436 6436 * use just cancel_work() instead of cancel_work_sync(), it requires 6437 6437 * being in a section protected by wiphy_lock(). 6438 + * 6439 + * Note that these are scheduled with a timer where the accuracy 6440 + * becomes less the longer in the future the scheduled timer is. Use 6441 + * wiphy_hrtimer_work_queue() if the timer must be not be late by more 6442 + * than approximately 10 percent. 6438 6443 */ 6439 6444 void wiphy_delayed_work_queue(struct wiphy *wiphy, 6440 6445 struct wiphy_delayed_work *dwork, ··· 6510 6505 */ 6511 6506 bool wiphy_delayed_work_pending(struct wiphy *wiphy, 6512 6507 struct wiphy_delayed_work *dwork); 6508 + 6509 + struct wiphy_hrtimer_work { 6510 + struct wiphy_work work; 6511 + struct wiphy *wiphy; 6512 + struct hrtimer timer; 6513 + }; 6514 + 6515 + enum hrtimer_restart wiphy_hrtimer_work_timer(struct hrtimer *t); 6516 + 6517 + static inline void wiphy_hrtimer_work_init(struct wiphy_hrtimer_work *hrwork, 6518 + wiphy_work_func_t func) 6519 + { 6520 + hrtimer_setup(&hrwork->timer, wiphy_hrtimer_work_timer, 6521 + CLOCK_BOOTTIME, HRTIMER_MODE_REL); 6522 + wiphy_work_init(&hrwork->work, func); 6523 + } 6524 + 6525 + /** 6526 + * wiphy_hrtimer_work_queue - queue hrtimer work for the wiphy 6527 + * @wiphy: the wiphy to queue for 6528 + * @hrwork: the high resolution timer worker 6529 + * @delay: the delay given as a ktime_t 6530 + * 6531 + * Please refer to wiphy_delayed_work_queue(). The difference is that 6532 + * the hrtimer work uses a high resolution timer for scheduling. This 6533 + * may be needed if timeouts might be scheduled further in the future 6534 + * and the accuracy of the normal timer is not sufficient. 6535 + * 6536 + * Expect a delay of a few milliseconds as the timer is scheduled 6537 + * with some slack and some more time may pass between queueing the 6538 + * work and its start. 6539 + */ 6540 + void wiphy_hrtimer_work_queue(struct wiphy *wiphy, 6541 + struct wiphy_hrtimer_work *hrwork, 6542 + ktime_t delay); 6543 + 6544 + /** 6545 + * wiphy_hrtimer_work_cancel - cancel previously queued hrtimer work 6546 + * @wiphy: the wiphy, for debug purposes 6547 + * @hrtimer: the hrtimer work to cancel 6548 + * 6549 + * Cancel the work *without* waiting for it, this assumes being 6550 + * called under the wiphy mutex acquired by wiphy_lock(). 6551 + */ 6552 + void wiphy_hrtimer_work_cancel(struct wiphy *wiphy, 6553 + struct wiphy_hrtimer_work *hrtimer); 6554 + 6555 + /** 6556 + * wiphy_hrtimer_work_flush - flush previously queued hrtimer work 6557 + * @wiphy: the wiphy, for debug purposes 6558 + * @hrwork: the hrtimer work to flush 6559 + * 6560 + * Flush the work (i.e. run it if pending). This must be called 6561 + * under the wiphy mutex acquired by wiphy_lock(). 6562 + */ 6563 + void wiphy_hrtimer_work_flush(struct wiphy *wiphy, 6564 + struct wiphy_hrtimer_work *hrwork); 6565 + 6566 + /** 6567 + * wiphy_hrtimer_work_pending - Find out whether a wiphy hrtimer 6568 + * work item is currently pending. 6569 + * 6570 + * @wiphy: the wiphy, for debug purposes 6571 + * @hrwork: the hrtimer work in question 6572 + * 6573 + * Return: true if timer is pending, false otherwise 6574 + * 6575 + * Please refer to the wiphy_delayed_work_pending() documentation as 6576 + * this is the equivalent function for hrtimer based delayed work 6577 + * items. 6578 + */ 6579 + bool wiphy_hrtimer_work_pending(struct wiphy *wiphy, 6580 + struct wiphy_hrtimer_work *hrwork); 6513 6581 6514 6582 /** 6515 6583 * enum ieee80211_ap_reg_power - regulatory power for an Access Point
+2 -1
include/uapi/linux/virtio_net.h
··· 193 193 194 194 struct virtio_net_hdr_v1_hash { 195 195 struct virtio_net_hdr_v1 hdr; 196 - __le32 hash_value; 196 + __le16 hash_value_lo; 197 + __le16 hash_value_hi; 197 198 #define VIRTIO_NET_HASH_REPORT_NONE 0 198 199 #define VIRTIO_NET_HASH_REPORT_IPv4 1 199 200 #define VIRTIO_NET_HASH_REPORT_TCPv4 2
+2
net/8021q/vlan.c
··· 193 193 vlan_group_set_device(grp, vlan->vlan_proto, vlan_id, dev); 194 194 grp->nr_vlan_devs++; 195 195 196 + netdev_update_features(dev); 197 + 196 198 return 0; 197 199 198 200 out_unregister_netdev:
+7
net/bluetooth/hci_event.c
··· 4218 4218 } 4219 4219 4220 4220 if (i == ARRAY_SIZE(hci_cc_table)) { 4221 + if (!skb->len) { 4222 + bt_dev_err(hdev, "Unexpected cc 0x%4.4x with no status", 4223 + *opcode); 4224 + *status = HCI_ERROR_UNSPECIFIED; 4225 + return; 4226 + } 4227 + 4221 4228 /* Unknown opcode, assume byte 0 contains the status, so 4222 4229 * that e.g. __hci_cmd_sync() properly returns errors 4223 4230 * for vendor specific commands send by HCI drivers.
+3 -3
net/bluetooth/mgmt.c
··· 5395 5395 for (i = 0; i < pattern_count; i++) { 5396 5396 offset = patterns[i].offset; 5397 5397 length = patterns[i].length; 5398 - if (offset >= HCI_MAX_EXT_AD_LENGTH || 5399 - length > HCI_MAX_EXT_AD_LENGTH || 5400 - (offset + length) > HCI_MAX_EXT_AD_LENGTH) 5398 + if (offset >= HCI_MAX_AD_LENGTH || 5399 + length > HCI_MAX_AD_LENGTH || 5400 + (offset + length) > HCI_MAX_AD_LENGTH) 5401 5401 return MGMT_STATUS_INVALID_PARAMS; 5402 5402 5403 5403 p = kmalloc(sizeof(*p), GFP_KERNEL);
+1 -1
net/bridge/br_forward.c
··· 25 25 26 26 vg = nbp_vlan_group_rcu(p); 27 27 return ((p->flags & BR_HAIRPIN_MODE) || skb->dev != p->dev) && 28 - (br_mst_is_enabled(p->br) || p->state == BR_STATE_FORWARDING) && 28 + (br_mst_is_enabled(p) || p->state == BR_STATE_FORWARDING) && 29 29 br_allowed_egress(vg, skb) && nbp_switchdev_allowed_egress(p, skb) && 30 30 !br_skb_isolated(p, skb); 31 31 }
+1
net/bridge/br_if.c
··· 386 386 del_nbp(p); 387 387 } 388 388 389 + br_mst_uninit(br); 389 390 br_recalculate_neigh_suppress_enabled(br); 390 391 391 392 br_fdb_delete_by_port(br, NULL, 0, 1);
+2 -2
net/bridge/br_input.c
··· 94 94 95 95 br = p->br; 96 96 97 - if (br_mst_is_enabled(br)) { 97 + if (br_mst_is_enabled(p)) { 98 98 state = BR_STATE_FORWARDING; 99 99 } else { 100 100 if (p->state == BR_STATE_DISABLED) { ··· 429 429 return RX_HANDLER_PASS; 430 430 431 431 forward: 432 - if (br_mst_is_enabled(p->br)) 432 + if (br_mst_is_enabled(p)) 433 433 goto defer_stp_filtering; 434 434 435 435 switch (p->state) {
+8 -2
net/bridge/br_mst.c
··· 22 22 } 23 23 EXPORT_SYMBOL_GPL(br_mst_enabled); 24 24 25 + void br_mst_uninit(struct net_bridge *br) 26 + { 27 + if (br_opt_get(br, BROPT_MST_ENABLED)) 28 + static_branch_dec(&br_mst_used); 29 + } 30 + 25 31 int br_mst_get_info(const struct net_device *dev, u16 msti, unsigned long *vids) 26 32 { 27 33 const struct net_bridge_vlan_group *vg; ··· 231 225 return err; 232 226 233 227 if (on) 234 - static_branch_enable(&br_mst_used); 228 + static_branch_inc(&br_mst_used); 235 229 else 236 - static_branch_disable(&br_mst_used); 230 + static_branch_dec(&br_mst_used); 237 231 238 232 br_opt_toggle(br, BROPT_MST_ENABLED, on); 239 233 return 0;
+10 -3
net/bridge/br_private.h
··· 1935 1935 /* br_mst.c */ 1936 1936 #ifdef CONFIG_BRIDGE_VLAN_FILTERING 1937 1937 DECLARE_STATIC_KEY_FALSE(br_mst_used); 1938 - static inline bool br_mst_is_enabled(struct net_bridge *br) 1938 + static inline bool br_mst_is_enabled(const struct net_bridge_port *p) 1939 1939 { 1940 + /* check the port's vlan group to avoid racing with port deletion */ 1940 1941 return static_branch_unlikely(&br_mst_used) && 1941 - br_opt_get(br, BROPT_MST_ENABLED); 1942 + br_opt_get(p->br, BROPT_MST_ENABLED) && 1943 + rcu_access_pointer(p->vlgrp); 1942 1944 } 1943 1945 1944 1946 int br_mst_set_state(struct net_bridge_port *p, u16 msti, u8 state, ··· 1954 1952 const struct net_bridge_vlan_group *vg); 1955 1953 int br_mst_process(struct net_bridge_port *p, const struct nlattr *mst_attr, 1956 1954 struct netlink_ext_ack *extack); 1955 + void br_mst_uninit(struct net_bridge *br); 1957 1956 #else 1958 - static inline bool br_mst_is_enabled(struct net_bridge *br) 1957 + static inline bool br_mst_is_enabled(const struct net_bridge_port *p) 1959 1958 { 1960 1959 return false; 1961 1960 } ··· 1989 1986 struct netlink_ext_ack *extack) 1990 1987 { 1991 1988 return -EOPNOTSUPP; 1989 + } 1990 + 1991 + static inline void br_mst_uninit(struct net_bridge *br) 1992 + { 1992 1993 } 1993 1994 #endif 1994 1995
+2 -2
net/core/gro_cells.c
··· 60 60 struct sk_buff *skb; 61 61 int work_done = 0; 62 62 63 - __local_lock_nested_bh(&cell->bh_lock); 64 63 while (work_done < budget) { 64 + __local_lock_nested_bh(&cell->bh_lock); 65 65 skb = __skb_dequeue(&cell->napi_skbs); 66 + __local_unlock_nested_bh(&cell->bh_lock); 66 67 if (!skb) 67 68 break; 68 69 napi_gro_receive(napi, skb); ··· 72 71 73 72 if (work_done < budget) 74 73 napi_complete_done(napi, work_done); 75 - __local_unlock_nested_bh(&cell->bh_lock); 76 74 return work_done; 77 75 } 78 76
+2 -5
net/core/netpoll.c
··· 228 228 { 229 229 struct sk_buff_head *skb_pool; 230 230 struct sk_buff *skb; 231 - unsigned long flags; 232 231 233 232 skb_pool = &np->skb_pool; 234 233 235 - spin_lock_irqsave(&skb_pool->lock, flags); 236 - while (skb_pool->qlen < MAX_SKBS) { 234 + while (READ_ONCE(skb_pool->qlen) < MAX_SKBS) { 237 235 skb = alloc_skb(MAX_SKB_SIZE, GFP_ATOMIC); 238 236 if (!skb) 239 237 break; 240 238 241 - __skb_queue_tail(skb_pool, skb); 239 + skb_queue_tail(skb_pool, skb); 242 240 } 243 - spin_unlock_irqrestore(&skb_pool->lock, flags); 244 241 } 245 242 246 243 static void zap_completion_queue(void)
+8 -2
net/dsa/tag_brcm.c
··· 224 224 { 225 225 int len = BRCM_LEG_TAG_LEN; 226 226 int source_port; 227 + __be16 *proto; 227 228 u8 *brcm_tag; 228 229 229 230 if (unlikely(!pskb_may_pull(skb, BRCM_LEG_TAG_LEN + VLAN_HLEN))) 230 231 return NULL; 231 232 232 233 brcm_tag = dsa_etype_header_pos_rx(skb); 234 + proto = (__be16 *)(brcm_tag + BRCM_LEG_TAG_LEN); 233 235 234 236 source_port = brcm_tag[5] & BRCM_LEG_PORT_ID; 235 237 ··· 239 237 if (!skb->dev) 240 238 return NULL; 241 239 242 - /* VLAN tag is added by BCM63xx internal switch */ 243 - if (netdev_uses_dsa(skb->dev)) 240 + /* The internal switch in BCM63XX SoCs always tags on egress on the CPU 241 + * port. We use VID 0 internally for untagged traffic, so strip the tag 242 + * if the TCI field is all 0, and keep it otherwise to also retain 243 + * e.g. 802.1p tagged packets. 244 + */ 245 + if (proto[0] == htons(ETH_P_8021Q) && proto[1] == 0) 244 246 len += VLAN_HLEN; 245 247 246 248 /* Remove Broadcom tag and update checksum */
+1 -1
net/mac80211/chan.c
··· 1290 1290 &link->csa.finalize_work); 1291 1291 break; 1292 1292 case NL80211_IFTYPE_STATION: 1293 - wiphy_delayed_work_queue(sdata->local->hw.wiphy, 1293 + wiphy_hrtimer_work_queue(sdata->local->hw.wiphy, 1294 1294 &link->u.mgd.csa.switch_work, 0); 1295 1295 break; 1296 1296 case NL80211_IFTYPE_UNSPECIFIED:
+4 -4
net/mac80211/ieee80211_i.h
··· 612 612 u8 *assoc_req_ies; 613 613 size_t assoc_req_ies_len; 614 614 615 - struct wiphy_delayed_work ml_reconf_work; 615 + struct wiphy_hrtimer_work ml_reconf_work; 616 616 u16 removed_links; 617 617 618 618 /* TID-to-link mapping support */ 619 - struct wiphy_delayed_work ttlm_work; 619 + struct wiphy_hrtimer_work ttlm_work; 620 620 struct ieee80211_adv_ttlm_info ttlm_info; 621 621 struct wiphy_work teardown_ttlm_work; 622 622 ··· 1017 1017 bool operating_11g_mode; 1018 1018 1019 1019 struct { 1020 - struct wiphy_delayed_work switch_work; 1020 + struct wiphy_hrtimer_work switch_work; 1021 1021 struct cfg80211_chan_def ap_chandef; 1022 1022 struct ieee80211_parsed_tpe tpe; 1023 - unsigned long time; 1023 + ktime_t time; 1024 1024 bool waiting_bcn; 1025 1025 bool ignored_same_chan; 1026 1026 bool blocked_tx;
+2 -2
net/mac80211/link.c
··· 472 472 * from there. 473 473 */ 474 474 if (link->conf->csa_active) 475 - wiphy_delayed_work_queue(local->hw.wiphy, 475 + wiphy_hrtimer_work_queue(local->hw.wiphy, 476 476 &link->u.mgd.csa.switch_work, 477 477 link->u.mgd.csa.time - 478 - jiffies); 478 + ktime_get_boottime()); 479 479 } 480 480 481 481 for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) {
+26 -26
net/mac80211/mlme.c
··· 45 45 #define IEEE80211_ASSOC_TIMEOUT_SHORT (HZ / 10) 46 46 #define IEEE80211_ASSOC_MAX_TRIES 3 47 47 48 - #define IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS msecs_to_jiffies(100) 48 + #define IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS (100 * USEC_PER_MSEC) 49 49 #define IEEE80211_ADV_TTLM_ST_UNDERFLOW 0xff00 50 50 51 51 #define IEEE80211_NEG_TTLM_REQ_TIMEOUT (HZ / 5) ··· 2594 2594 return; 2595 2595 } 2596 2596 2597 - wiphy_delayed_work_queue(sdata->local->hw.wiphy, 2597 + wiphy_hrtimer_work_queue(sdata->local->hw.wiphy, 2598 2598 &link->u.mgd.csa.switch_work, 0); 2599 2599 } 2600 2600 ··· 2753 2753 .timestamp = timestamp, 2754 2754 .device_timestamp = device_timestamp, 2755 2755 }; 2756 - unsigned long now; 2756 + u32 csa_time_tu; 2757 + ktime_t now; 2757 2758 int res; 2758 2759 2759 2760 lockdep_assert_wiphy(local->hw.wiphy); ··· 2984 2983 csa_ie.mode); 2985 2984 2986 2985 /* we may have to handle timeout for deactivated link in software */ 2987 - now = jiffies; 2988 - link->u.mgd.csa.time = now + 2989 - TU_TO_JIFFIES((max_t(int, csa_ie.count, 1) - 1) * 2990 - link->conf->beacon_int); 2986 + now = ktime_get_boottime(); 2987 + csa_time_tu = (max_t(int, csa_ie.count, 1) - 1) * link->conf->beacon_int; 2988 + link->u.mgd.csa.time = now + us_to_ktime(ieee80211_tu_to_usec(csa_time_tu)); 2991 2989 2992 2990 if (ieee80211_vif_link_active(&sdata->vif, link->link_id) && 2993 2991 local->ops->channel_switch) { ··· 3001 3001 } 3002 3002 3003 3003 /* channel switch handled in software */ 3004 - wiphy_delayed_work_queue(local->hw.wiphy, 3004 + wiphy_hrtimer_work_queue(local->hw.wiphy, 3005 3005 &link->u.mgd.csa.switch_work, 3006 3006 link->u.mgd.csa.time - now); 3007 3007 return; ··· 4242 4242 4243 4243 memset(&sdata->u.mgd.ttlm_info, 0, 4244 4244 sizeof(sdata->u.mgd.ttlm_info)); 4245 - wiphy_delayed_work_cancel(sdata->local->hw.wiphy, &ifmgd->ttlm_work); 4245 + wiphy_hrtimer_work_cancel(sdata->local->hw.wiphy, &ifmgd->ttlm_work); 4246 4246 4247 4247 memset(&sdata->vif.neg_ttlm, 0, sizeof(sdata->vif.neg_ttlm)); 4248 4248 wiphy_delayed_work_cancel(sdata->local->hw.wiphy, 4249 4249 &ifmgd->neg_ttlm_timeout_work); 4250 4250 4251 4251 sdata->u.mgd.removed_links = 0; 4252 - wiphy_delayed_work_cancel(sdata->local->hw.wiphy, 4252 + wiphy_hrtimer_work_cancel(sdata->local->hw.wiphy, 4253 4253 &sdata->u.mgd.ml_reconf_work); 4254 4254 4255 4255 wiphy_work_cancel(sdata->local->hw.wiphy, ··· 6876 6876 /* In case the removal was cancelled, abort it */ 6877 6877 if (sdata->u.mgd.removed_links) { 6878 6878 sdata->u.mgd.removed_links = 0; 6879 - wiphy_delayed_work_cancel(sdata->local->hw.wiphy, 6879 + wiphy_hrtimer_work_cancel(sdata->local->hw.wiphy, 6880 6880 &sdata->u.mgd.ml_reconf_work); 6881 6881 } 6882 6882 return; ··· 6906 6906 } 6907 6907 6908 6908 sdata->u.mgd.removed_links = removed_links; 6909 - wiphy_delayed_work_queue(sdata->local->hw.wiphy, 6909 + wiphy_hrtimer_work_queue(sdata->local->hw.wiphy, 6910 6910 &sdata->u.mgd.ml_reconf_work, 6911 - TU_TO_JIFFIES(delay)); 6911 + us_to_ktime(ieee80211_tu_to_usec(delay))); 6912 6912 } 6913 6913 6914 6914 static int ieee80211_ttlm_set_links(struct ieee80211_sub_if_data *sdata, ··· 7095 7095 /* if a planned TID-to-link mapping was cancelled - 7096 7096 * abort it 7097 7097 */ 7098 - wiphy_delayed_work_cancel(sdata->local->hw.wiphy, 7098 + wiphy_hrtimer_work_cancel(sdata->local->hw.wiphy, 7099 7099 &sdata->u.mgd.ttlm_work); 7100 7100 } else if (sdata->u.mgd.ttlm_info.active) { 7101 7101 /* if no TID-to-link element, set to default mapping in ··· 7130 7130 7131 7131 if (ttlm_info.switch_time) { 7132 7132 u16 beacon_ts_tu, st_tu, delay; 7133 - u32 delay_jiffies; 7133 + u64 delay_usec; 7134 7134 u64 mask; 7135 7135 7136 7136 /* The t2l map switch time is indicated with a partial ··· 7152 7152 if (delay > IEEE80211_ADV_TTLM_ST_UNDERFLOW) 7153 7153 return; 7154 7154 7155 - delay_jiffies = TU_TO_JIFFIES(delay); 7155 + delay_usec = ieee80211_tu_to_usec(delay); 7156 7156 7157 7157 /* Link switching can take time, so schedule it 7158 7158 * 100ms before to be ready on time 7159 7159 */ 7160 - if (delay_jiffies > IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS) 7161 - delay_jiffies -= 7160 + if (delay_usec > IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS) 7161 + delay_usec -= 7162 7162 IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS; 7163 7163 else 7164 - delay_jiffies = 0; 7164 + delay_usec = 0; 7165 7165 7166 7166 sdata->u.mgd.ttlm_info = ttlm_info; 7167 - wiphy_delayed_work_cancel(sdata->local->hw.wiphy, 7167 + wiphy_hrtimer_work_cancel(sdata->local->hw.wiphy, 7168 7168 &sdata->u.mgd.ttlm_work); 7169 - wiphy_delayed_work_queue(sdata->local->hw.wiphy, 7169 + wiphy_hrtimer_work_queue(sdata->local->hw.wiphy, 7170 7170 &sdata->u.mgd.ttlm_work, 7171 - delay_jiffies); 7171 + us_to_ktime(delay_usec)); 7172 7172 return; 7173 7173 } 7174 7174 } ··· 8793 8793 ieee80211_csa_connection_drop_work); 8794 8794 wiphy_delayed_work_init(&ifmgd->tdls_peer_del_work, 8795 8795 ieee80211_tdls_peer_del_work); 8796 - wiphy_delayed_work_init(&ifmgd->ml_reconf_work, 8796 + wiphy_hrtimer_work_init(&ifmgd->ml_reconf_work, 8797 8797 ieee80211_ml_reconf_work); 8798 8798 wiphy_delayed_work_init(&ifmgd->reconf.wk, 8799 8799 ieee80211_ml_sta_reconf_timeout); ··· 8802 8802 timer_setup(&ifmgd->conn_mon_timer, ieee80211_sta_conn_mon_timer, 0); 8803 8803 wiphy_delayed_work_init(&ifmgd->tx_tspec_wk, 8804 8804 ieee80211_sta_handle_tspec_ac_params_wk); 8805 - wiphy_delayed_work_init(&ifmgd->ttlm_work, 8805 + wiphy_hrtimer_work_init(&ifmgd->ttlm_work, 8806 8806 ieee80211_tid_to_link_map_work); 8807 8807 wiphy_delayed_work_init(&ifmgd->neg_ttlm_timeout_work, 8808 8808 ieee80211_neg_ttlm_timeout_work); ··· 8849 8849 else 8850 8850 link->u.mgd.req_smps = IEEE80211_SMPS_OFF; 8851 8851 8852 - wiphy_delayed_work_init(&link->u.mgd.csa.switch_work, 8852 + wiphy_hrtimer_work_init(&link->u.mgd.csa.switch_work, 8853 8853 ieee80211_csa_switch_work); 8854 8854 8855 8855 ieee80211_clear_tpe(&link->conf->tpe); ··· 10064 10064 &link->u.mgd.request_smps_work); 10065 10065 wiphy_work_cancel(link->sdata->local->hw.wiphy, 10066 10066 &link->u.mgd.recalc_smps); 10067 - wiphy_delayed_work_cancel(link->sdata->local->hw.wiphy, 10067 + wiphy_hrtimer_work_cancel(link->sdata->local->hw.wiphy, 10068 10068 &link->u.mgd.csa.switch_work); 10069 10069 } 10070 10070
+17 -6
net/sctp/diag.c
··· 73 73 struct nlattr *attr; 74 74 void *info = NULL; 75 75 76 + rcu_read_lock(); 76 77 list_for_each_entry_rcu(laddr, address_list, list) 77 78 addrcnt++; 79 + rcu_read_unlock(); 78 80 79 81 attr = nla_reserve(skb, INET_DIAG_LOCALS, addrlen * addrcnt); 80 82 if (!attr) 81 83 return -EMSGSIZE; 82 84 83 85 info = nla_data(attr); 86 + rcu_read_lock(); 84 87 list_for_each_entry_rcu(laddr, address_list, list) { 85 88 memcpy(info, &laddr->a, sizeof(laddr->a)); 86 89 memset(info + sizeof(laddr->a), 0, addrlen - sizeof(laddr->a)); 87 90 info += addrlen; 91 + 92 + if (!--addrcnt) 93 + break; 88 94 } 95 + rcu_read_unlock(); 89 96 90 97 return 0; 91 98 } ··· 230 223 bool net_admin; 231 224 }; 232 225 233 - static size_t inet_assoc_attr_size(struct sctp_association *asoc) 226 + static size_t inet_assoc_attr_size(struct sock *sk, 227 + struct sctp_association *asoc) 234 228 { 235 229 int addrlen = sizeof(struct sockaddr_storage); 236 230 int addrcnt = 0; 237 231 struct sctp_sockaddr_entry *laddr; 238 232 239 233 list_for_each_entry_rcu(laddr, &asoc->base.bind_addr.address_list, 240 - list) 234 + list, lockdep_sock_is_held(sk)) 241 235 addrcnt++; 242 236 243 237 return nla_total_size(sizeof(struct sctp_info)) ··· 264 256 if (err) 265 257 return err; 266 258 267 - rep = nlmsg_new(inet_assoc_attr_size(assoc), GFP_KERNEL); 268 - if (!rep) 269 - return -ENOMEM; 270 - 271 259 lock_sock(sk); 260 + 261 + rep = nlmsg_new(inet_assoc_attr_size(sk, assoc), GFP_KERNEL); 262 + if (!rep) { 263 + release_sock(sk); 264 + return -ENOMEM; 265 + } 266 + 272 267 if (ep != assoc->ep) { 273 268 err = -EAGAIN; 274 269 goto out;
+6 -15
net/sctp/transport.c
··· 37 37 /* 1st Level Abstractions. */ 38 38 39 39 /* Initialize a new transport from provided memory. */ 40 - static struct sctp_transport *sctp_transport_init(struct net *net, 41 - struct sctp_transport *peer, 42 - const union sctp_addr *addr, 43 - gfp_t gfp) 40 + static void sctp_transport_init(struct net *net, 41 + struct sctp_transport *peer, 42 + const union sctp_addr *addr, 43 + gfp_t gfp) 44 44 { 45 45 /* Copy in the address. */ 46 46 peer->af_specific = sctp_get_af_specific(addr->sa.sa_family); ··· 83 83 get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce)); 84 84 85 85 refcount_set(&peer->refcnt, 1); 86 - 87 - return peer; 88 86 } 89 87 90 88 /* Allocate and initialize a new transport. */ ··· 94 96 95 97 transport = kzalloc(sizeof(*transport), gfp); 96 98 if (!transport) 97 - goto fail; 99 + return NULL; 98 100 99 - if (!sctp_transport_init(net, transport, addr, gfp)) 100 - goto fail_init; 101 + sctp_transport_init(net, transport, addr, gfp); 101 102 102 103 SCTP_DBG_OBJCNT_INC(transport); 103 104 104 105 return transport; 105 - 106 - fail_init: 107 - kfree(transport); 108 - 109 - fail: 110 - return NULL; 111 106 } 112 107 113 108 /* This transport is no longer needed. Free up if possible, or
+56
net/wireless/core.c
··· 1787 1787 } 1788 1788 EXPORT_SYMBOL_GPL(wiphy_delayed_work_pending); 1789 1789 1790 + enum hrtimer_restart wiphy_hrtimer_work_timer(struct hrtimer *t) 1791 + { 1792 + struct wiphy_hrtimer_work *hrwork = 1793 + container_of(t, struct wiphy_hrtimer_work, timer); 1794 + 1795 + wiphy_work_queue(hrwork->wiphy, &hrwork->work); 1796 + 1797 + return HRTIMER_NORESTART; 1798 + } 1799 + EXPORT_SYMBOL_GPL(wiphy_hrtimer_work_timer); 1800 + 1801 + void wiphy_hrtimer_work_queue(struct wiphy *wiphy, 1802 + struct wiphy_hrtimer_work *hrwork, 1803 + ktime_t delay) 1804 + { 1805 + trace_wiphy_hrtimer_work_queue(wiphy, &hrwork->work, delay); 1806 + 1807 + if (!delay) { 1808 + hrtimer_cancel(&hrwork->timer); 1809 + wiphy_work_queue(wiphy, &hrwork->work); 1810 + return; 1811 + } 1812 + 1813 + hrwork->wiphy = wiphy; 1814 + hrtimer_start_range_ns(&hrwork->timer, delay, 1815 + 1000 * NSEC_PER_USEC, HRTIMER_MODE_REL); 1816 + } 1817 + EXPORT_SYMBOL_GPL(wiphy_hrtimer_work_queue); 1818 + 1819 + void wiphy_hrtimer_work_cancel(struct wiphy *wiphy, 1820 + struct wiphy_hrtimer_work *hrwork) 1821 + { 1822 + lockdep_assert_held(&wiphy->mtx); 1823 + 1824 + hrtimer_cancel(&hrwork->timer); 1825 + wiphy_work_cancel(wiphy, &hrwork->work); 1826 + } 1827 + EXPORT_SYMBOL_GPL(wiphy_hrtimer_work_cancel); 1828 + 1829 + void wiphy_hrtimer_work_flush(struct wiphy *wiphy, 1830 + struct wiphy_hrtimer_work *hrwork) 1831 + { 1832 + lockdep_assert_held(&wiphy->mtx); 1833 + 1834 + hrtimer_cancel(&hrwork->timer); 1835 + wiphy_work_flush(wiphy, &hrwork->work); 1836 + } 1837 + EXPORT_SYMBOL_GPL(wiphy_hrtimer_work_flush); 1838 + 1839 + bool wiphy_hrtimer_work_pending(struct wiphy *wiphy, 1840 + struct wiphy_hrtimer_work *hrwork) 1841 + { 1842 + return hrtimer_is_queued(&hrwork->timer); 1843 + } 1844 + EXPORT_SYMBOL_GPL(wiphy_hrtimer_work_pending); 1845 + 1790 1846 static int __init cfg80211_init(void) 1791 1847 { 1792 1848 int err;
+21
net/wireless/trace.h
··· 304 304 __entry->delay) 305 305 ); 306 306 307 + TRACE_EVENT(wiphy_hrtimer_work_queue, 308 + TP_PROTO(struct wiphy *wiphy, struct wiphy_work *work, 309 + ktime_t delay), 310 + TP_ARGS(wiphy, work, delay), 311 + TP_STRUCT__entry( 312 + WIPHY_ENTRY 313 + __field(void *, instance) 314 + __field(void *, func) 315 + __field(ktime_t, delay) 316 + ), 317 + TP_fast_assign( 318 + WIPHY_ASSIGN; 319 + __entry->instance = work; 320 + __entry->func = work->func; 321 + __entry->delay = delay; 322 + ), 323 + TP_printk(WIPHY_PR_FMT " instance=%p func=%pS delay=%llu", 324 + WIPHY_PR_ARG, __entry->instance, __entry->func, 325 + __entry->delay) 326 + ); 327 + 307 328 TRACE_EVENT(wiphy_work_worker_start, 308 329 TP_PROTO(struct wiphy *wiphy), 309 330 TP_ARGS(wiphy),
+4
tools/testing/selftests/drivers/net/netdevsim/Makefile
··· 20 20 udp_tunnel_nic.sh \ 21 21 # end of TEST_PROGS 22 22 23 + TEST_FILES := \ 24 + ethtool-common.sh 25 + # end of TEST_FILES 26 + 23 27 include ../../../lib.mk
+10 -2
tools/testing/selftests/net/gro.c
··· 754 754 static char exthdr_pck[sizeof(buf) + MIN_EXTHDR_SIZE]; 755 755 756 756 create_packet(buf, 0, 0, PAYLOAD_LEN, 0); 757 - add_ipv6_exthdr(buf, exthdr_pck, IPPROTO_HOPOPTS, ext_data1); 757 + add_ipv6_exthdr(buf, exthdr_pck, IPPROTO_DSTOPTS, ext_data1); 758 758 write_packet(fd, exthdr_pck, total_hdr_len + PAYLOAD_LEN + MIN_EXTHDR_SIZE, daddr); 759 759 760 760 create_packet(buf, PAYLOAD_LEN * 1, 0, PAYLOAD_LEN, 0); 761 - add_ipv6_exthdr(buf, exthdr_pck, IPPROTO_HOPOPTS, ext_data2); 761 + add_ipv6_exthdr(buf, exthdr_pck, IPPROTO_DSTOPTS, ext_data2); 762 762 write_packet(fd, exthdr_pck, total_hdr_len + PAYLOAD_LEN + MIN_EXTHDR_SIZE, daddr); 763 763 } 764 764 ··· 989 989 990 990 static void gro_sender(void) 991 991 { 992 + const int fin_delay_us = 100 * 1000; 992 993 static char fin_pkt[MAX_HDR_LEN]; 993 994 struct sockaddr_ll daddr = {}; 994 995 int txfd = -1; ··· 1033 1032 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); 1034 1033 } else if (strcmp(testname, "tcp") == 0) { 1035 1034 send_changed_checksum(txfd, &daddr); 1035 + /* Adding sleep before sending FIN so that it is not 1036 + * received prior to other packets. 1037 + */ 1038 + usleep(fin_delay_us); 1036 1039 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); 1037 1040 1038 1041 send_changed_seq(txfd, &daddr); 1042 + usleep(fin_delay_us); 1039 1043 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); 1040 1044 1041 1045 send_changed_ts(txfd, &daddr); 1046 + usleep(fin_delay_us); 1042 1047 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); 1043 1048 1044 1049 send_diff_opt(txfd, &daddr); 1050 + usleep(fin_delay_us); 1045 1051 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); 1046 1052 } else if (strcmp(testname, "ip") == 0) { 1047 1053 send_changed_ECN(txfd, &daddr);
+4 -4
tools/testing/selftests/vsock/vmtest.sh
··· 389 389 local rc 390 390 391 391 host_oops_cnt_before=$(dmesg | grep -c -i 'Oops') 392 - host_warn_cnt_before=$(dmesg --level=warn | wc -l) 392 + host_warn_cnt_before=$(dmesg --level=warn | grep -c -i 'vsock') 393 393 vm_oops_cnt_before=$(vm_ssh -- dmesg | grep -c -i 'Oops') 394 - vm_warn_cnt_before=$(vm_ssh -- dmesg --level=warn | wc -l) 394 + vm_warn_cnt_before=$(vm_ssh -- dmesg --level=warn | grep -c -i 'vsock') 395 395 396 396 name=$(echo "${1}" | awk '{ print $1 }') 397 397 eval test_"${name}" ··· 403 403 rc=$KSFT_FAIL 404 404 fi 405 405 406 - host_warn_cnt_after=$(dmesg --level=warn | wc -l) 406 + host_warn_cnt_after=$(dmesg --level=warn | grep -c -i 'vsock') 407 407 if [[ ${host_warn_cnt_after} -gt ${host_warn_cnt_before} ]]; then 408 408 echo "FAIL: kernel warning detected on host" | log_host "${name}" 409 409 rc=$KSFT_FAIL ··· 415 415 rc=$KSFT_FAIL 416 416 fi 417 417 418 - vm_warn_cnt_after=$(vm_ssh -- dmesg --level=warn | wc -l) 418 + vm_warn_cnt_after=$(vm_ssh -- dmesg --level=warn | grep -c -i 'vsock') 419 419 if [[ ${vm_warn_cnt_after} -gt ${vm_warn_cnt_before} ]]; then 420 420 echo "FAIL: kernel warning detected on vm" | log_host "${name}" 421 421 rc=$KSFT_FAIL