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

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

Pull networking fixes from Paolo Abeni:
"Including fixes from WiFi, bluetooth and netfilter.

No known new regressions outstanding.

Current release - regressions:

- wifi: mt76: do not increase mcu skb refcount if retry is not
supported

Current release - new code bugs:

- wifi:
- rtw88: fix the RX aggregation in USB 3 mode
- mac80211: fix memory corruption bug in struct ieee80211_chanctx

Previous releases - regressions:

- sched:
- stop qdisc_tree_reduce_backlog on TC_H_ROOT
- sch_api: fix xa_insert() error path in tcf_block_get_ext()

- wifi:
- revert "wifi: iwlwifi: remove retry loops in start"
- cfg80211: clear wdev->cqm_config pointer on free

- netfilter: fix potential crash in nf_send_reset6()

- ip_tunnel: fix suspicious RCU usage warning in ip_tunnel_find()

- bluetooth: fix null-ptr-deref in hci_read_supported_codecs

- eth: mlxsw: add missing verification before pushing Tx header

- eth: hns3: fixed hclge_fetch_pf_reg accesses bar space out of
bounds issue

Previous releases - always broken:

- wifi: mac80211: do not pass a stopped vif to the driver in
.get_txpower

- netfilter: sanitize offset and length before calling skb_checksum()

- core:
- fix crash when config small gso_max_size/gso_ipv4_max_size
- skip offload for NETIF_F_IPV6_CSUM if ipv6 header contains extension

- mptcp: protect sched with rcu_read_lock

- eth: ice: fix crash on probe for DPLL enabled E810 LOM

- eth: macsec: fix use-after-free while sending the offloading packet

- eth: stmmac: fix unbalanced DMA map/unmap for non-paged SKB data

- eth: hns3: fix kernel crash when 1588 is sent on HIP08 devices

- eth: mtk_wed: fix path of MT7988 WO firmware"

* tag 'net-6.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (70 commits)
net: hns3: fix kernel crash when 1588 is sent on HIP08 devices
net: hns3: fixed hclge_fetch_pf_reg accesses bar space out of bounds issue
net: hns3: initialize reset_timer before hclgevf_misc_irq_init()
net: hns3: don't auto enable misc vector
net: hns3: Resolved the issue that the debugfs query result is inconsistent.
net: hns3: fix missing features due to dev->features configuration too early
net: hns3: fixed reset failure issues caused by the incorrect reset type
net: hns3: add sync command to sync io-pgtable
net: hns3: default enable tx bounce buffer when smmu enabled
netfilter: nft_payload: sanitize offset and length before calling skb_checksum()
net: ethernet: mtk_wed: fix path of MT7988 WO firmware
selftests: forwarding: Add IPv6 GRE remote change tests
mlxsw: spectrum_ipip: Fix memory leak when changing remote IPv6 address
mlxsw: pci: Sync Rx buffers for device
mlxsw: pci: Sync Rx buffers for CPU
mlxsw: spectrum_ptp: Add missing verification before pushing Tx header
net: skip offload for NETIF_F_IPV6_CSUM if ipv6 header contains extension
Bluetooth: hci: fix null-ptr-deref in hci_read_supported_codecs
netfilter: nf_reject_ipv6: fix potential crash in nf_send_reset6()
netfilter: Fix use-after-free in get_info()
...

+964 -249
+3 -2
Documentation/networking/packet_mmap.rst
··· 16 16 17 17 Howto can be found at: 18 18 19 - https://sites.google.com/site/packetmmap/ 19 + https://web.archive.org/web/20220404160947/https://sites.google.com/site/packetmmap/ 20 20 21 21 Please send your comments to 22 22 - Ulisses Alonso Camaró <uaca@i.hate.spam.alumni.uv.es> ··· 166 166 /* bind socket to eth0 */ 167 167 bind(this->socket, (struct sockaddr *)&my_addr, sizeof(struct sockaddr_ll)); 168 168 169 - A complete tutorial is available at: https://sites.google.com/site/packetmmap/ 169 + A complete tutorial is available at: 170 + https://web.archive.org/web/20220404160947/https://sites.google.com/site/packetmmap/ 170 171 171 172 By default, the user should put data at:: 172 173
+3 -1
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
··· 1293 1293 1294 1294 /* save the buffer addr until the last read operation */ 1295 1295 *save_buf = read_buf; 1296 + } 1296 1297 1297 - /* get data ready for the first time to read */ 1298 + /* get data ready for the first time to read */ 1299 + if (!*ppos) { 1298 1300 ret = hns3_dbg_read_cmd(dbg_data, hns3_dbg_cmd[index].cmd, 1299 1301 read_buf, hns3_dbg_cmd[index].buf_len); 1300 1302 if (ret)
+58 -1
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
··· 11 11 #include <linux/irq.h> 12 12 #include <linux/ip.h> 13 13 #include <linux/ipv6.h> 14 + #include <linux/iommu.h> 14 15 #include <linux/module.h> 15 16 #include <linux/pci.h> 16 17 #include <linux/skbuff.h> ··· 380 379 381 380 #define HNS3_INVALID_PTYPE \ 382 381 ARRAY_SIZE(hns3_rx_ptype_tbl) 382 + 383 + static void hns3_dma_map_sync(struct device *dev, unsigned long iova) 384 + { 385 + struct iommu_domain *domain = iommu_get_domain_for_dev(dev); 386 + struct iommu_iotlb_gather iotlb_gather; 387 + size_t granule; 388 + 389 + if (!domain || !iommu_is_dma_domain(domain)) 390 + return; 391 + 392 + granule = 1 << __ffs(domain->pgsize_bitmap); 393 + iova = ALIGN_DOWN(iova, granule); 394 + iotlb_gather.start = iova; 395 + iotlb_gather.end = iova + granule - 1; 396 + iotlb_gather.pgsize = granule; 397 + 398 + iommu_iotlb_sync(domain, &iotlb_gather); 399 + } 383 400 384 401 static irqreturn_t hns3_irq_handle(int irq, void *vector) 385 402 { ··· 1051 1032 static void hns3_init_tx_spare_buffer(struct hns3_enet_ring *ring) 1052 1033 { 1053 1034 u32 alloc_size = ring->tqp->handle->kinfo.tx_spare_buf_size; 1035 + struct net_device *netdev = ring_to_netdev(ring); 1036 + struct hns3_nic_priv *priv = netdev_priv(netdev); 1054 1037 struct hns3_tx_spare *tx_spare; 1055 1038 struct page *page; 1056 1039 dma_addr_t dma; ··· 1094 1073 tx_spare->buf = page_address(page); 1095 1074 tx_spare->len = PAGE_SIZE << order; 1096 1075 ring->tx_spare = tx_spare; 1076 + ring->tx_copybreak = priv->tx_copybreak; 1097 1077 return; 1098 1078 1099 1079 dma_mapping_error: ··· 1746 1724 unsigned int type) 1747 1725 { 1748 1726 struct hns3_desc_cb *desc_cb = &ring->desc_cb[ring->next_to_use]; 1727 + struct hnae3_handle *handle = ring->tqp->handle; 1749 1728 struct device *dev = ring_to_dev(ring); 1729 + struct hnae3_ae_dev *ae_dev; 1750 1730 unsigned int size; 1751 1731 dma_addr_t dma; 1752 1732 ··· 1779 1755 hns3_ring_stats_update(ring, sw_err_cnt); 1780 1756 return -ENOMEM; 1781 1757 } 1758 + 1759 + /* Add a SYNC command to sync io-pgtale to avoid errors in pgtable 1760 + * prefetch 1761 + */ 1762 + ae_dev = hns3_get_ae_dev(handle); 1763 + if (ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V3) 1764 + hns3_dma_map_sync(dev, dma); 1782 1765 1783 1766 desc_cb->priv = priv; 1784 1767 desc_cb->length = size; ··· 2483 2452 return ret; 2484 2453 } 2485 2454 2486 - netdev->features = features; 2487 2455 return 0; 2488 2456 } 2489 2457 ··· 4898 4868 devm_kfree(&pdev->dev, priv->tqp_vector); 4899 4869 } 4900 4870 4871 + static void hns3_update_tx_spare_buf_config(struct hns3_nic_priv *priv) 4872 + { 4873 + #define HNS3_MIN_SPARE_BUF_SIZE (2 * 1024 * 1024) 4874 + #define HNS3_MAX_PACKET_SIZE (64 * 1024) 4875 + 4876 + struct iommu_domain *domain = iommu_get_domain_for_dev(priv->dev); 4877 + struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(priv->ae_handle); 4878 + struct hnae3_handle *handle = priv->ae_handle; 4879 + 4880 + if (ae_dev->dev_version < HNAE3_DEVICE_VERSION_V3) 4881 + return; 4882 + 4883 + if (!(domain && iommu_is_dma_domain(domain))) 4884 + return; 4885 + 4886 + priv->min_tx_copybreak = HNS3_MAX_PACKET_SIZE; 4887 + priv->min_tx_spare_buf_size = HNS3_MIN_SPARE_BUF_SIZE; 4888 + 4889 + if (priv->tx_copybreak < priv->min_tx_copybreak) 4890 + priv->tx_copybreak = priv->min_tx_copybreak; 4891 + if (handle->kinfo.tx_spare_buf_size < priv->min_tx_spare_buf_size) 4892 + handle->kinfo.tx_spare_buf_size = priv->min_tx_spare_buf_size; 4893 + } 4894 + 4901 4895 static void hns3_ring_get_cfg(struct hnae3_queue *q, struct hns3_nic_priv *priv, 4902 4896 unsigned int ring_type) 4903 4897 { ··· 5155 5101 int i, j; 5156 5102 int ret; 5157 5103 5104 + hns3_update_tx_spare_buf_config(priv); 5158 5105 for (i = 0; i < ring_num; i++) { 5159 5106 ret = hns3_alloc_ring_memory(&priv->ring[i]); 5160 5107 if (ret) { ··· 5360 5305 priv->ae_handle = handle; 5361 5306 priv->tx_timeout_count = 0; 5362 5307 priv->max_non_tso_bd_num = ae_dev->dev_specs.max_non_tso_bd_num; 5308 + priv->min_tx_copybreak = 0; 5309 + priv->min_tx_spare_buf_size = 0; 5363 5310 set_bit(HNS3_NIC_STATE_DOWN, &priv->state); 5364 5311 5365 5312 handle->msg_enable = netif_msg_init(debug, DEFAULT_MSG_LEVEL);
+2
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
··· 596 596 struct hns3_enet_coalesce rx_coal; 597 597 u32 tx_copybreak; 598 598 u32 rx_copybreak; 599 + u32 min_tx_copybreak; 600 + u32 min_tx_spare_buf_size; 599 601 }; 600 602 601 603 union l3_hdr_info {
+33
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
··· 1933 1933 return ret; 1934 1934 } 1935 1935 1936 + static int hns3_check_tx_copybreak(struct net_device *netdev, u32 copybreak) 1937 + { 1938 + struct hns3_nic_priv *priv = netdev_priv(netdev); 1939 + 1940 + if (copybreak < priv->min_tx_copybreak) { 1941 + netdev_err(netdev, "tx copybreak %u should be no less than %u!\n", 1942 + copybreak, priv->min_tx_copybreak); 1943 + return -EINVAL; 1944 + } 1945 + return 0; 1946 + } 1947 + 1948 + static int hns3_check_tx_spare_buf_size(struct net_device *netdev, u32 buf_size) 1949 + { 1950 + struct hns3_nic_priv *priv = netdev_priv(netdev); 1951 + 1952 + if (buf_size < priv->min_tx_spare_buf_size) { 1953 + netdev_err(netdev, 1954 + "tx spare buf size %u should be no less than %u!\n", 1955 + buf_size, priv->min_tx_spare_buf_size); 1956 + return -EINVAL; 1957 + } 1958 + return 0; 1959 + } 1960 + 1936 1961 static int hns3_set_tunable(struct net_device *netdev, 1937 1962 const struct ethtool_tunable *tuna, 1938 1963 const void *data) ··· 1974 1949 1975 1950 switch (tuna->id) { 1976 1951 case ETHTOOL_TX_COPYBREAK: 1952 + ret = hns3_check_tx_copybreak(netdev, *(u32 *)data); 1953 + if (ret) 1954 + return ret; 1955 + 1977 1956 priv->tx_copybreak = *(u32 *)data; 1978 1957 1979 1958 for (i = 0; i < h->kinfo.num_tqps; i++) ··· 1992 1963 1993 1964 break; 1994 1965 case ETHTOOL_TX_COPYBREAK_BUF_SIZE: 1966 + ret = hns3_check_tx_spare_buf_size(netdev, *(u32 *)data); 1967 + if (ret) 1968 + return ret; 1969 + 1995 1970 old_tx_spare_buf_size = h->kinfo.tx_spare_buf_size; 1996 1971 new_tx_spare_buf_size = *(u32 *)data; 1997 1972 netdev_info(netdev, "request to set tx spare buf size from %u to %u\n",
+36 -9
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
··· 6 6 #include <linux/etherdevice.h> 7 7 #include <linux/init.h> 8 8 #include <linux/interrupt.h> 9 + #include <linux/irq.h> 9 10 #include <linux/kernel.h> 10 11 #include <linux/module.h> 11 12 #include <linux/netdevice.h> ··· 3585 3584 return ret; 3586 3585 } 3587 3586 3587 + static void hclge_set_reset_pending(struct hclge_dev *hdev, 3588 + enum hnae3_reset_type reset_type) 3589 + { 3590 + /* When an incorrect reset type is executed, the get_reset_level 3591 + * function generates the HNAE3_NONE_RESET flag. As a result, this 3592 + * type do not need to pending. 3593 + */ 3594 + if (reset_type != HNAE3_NONE_RESET) 3595 + set_bit(reset_type, &hdev->reset_pending); 3596 + } 3597 + 3588 3598 static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval) 3589 3599 { 3590 3600 u32 cmdq_src_reg, msix_src_reg, hw_err_src_reg; ··· 3616 3604 */ 3617 3605 if (BIT(HCLGE_VECTOR0_IMPRESET_INT_B) & msix_src_reg) { 3618 3606 dev_info(&hdev->pdev->dev, "IMP reset interrupt\n"); 3619 - set_bit(HNAE3_IMP_RESET, &hdev->reset_pending); 3607 + hclge_set_reset_pending(hdev, HNAE3_IMP_RESET); 3620 3608 set_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state); 3621 3609 *clearval = BIT(HCLGE_VECTOR0_IMPRESET_INT_B); 3622 3610 hdev->rst_stats.imp_rst_cnt++; ··· 3626 3614 if (BIT(HCLGE_VECTOR0_GLOBALRESET_INT_B) & msix_src_reg) { 3627 3615 dev_info(&hdev->pdev->dev, "global reset interrupt\n"); 3628 3616 set_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state); 3629 - set_bit(HNAE3_GLOBAL_RESET, &hdev->reset_pending); 3617 + hclge_set_reset_pending(hdev, HNAE3_GLOBAL_RESET); 3630 3618 *clearval = BIT(HCLGE_VECTOR0_GLOBALRESET_INT_B); 3631 3619 hdev->rst_stats.global_rst_cnt++; 3632 3620 return HCLGE_VECTOR0_EVENT_RST; ··· 3781 3769 snprintf(hdev->misc_vector.name, HNAE3_INT_NAME_LEN, "%s-misc-%s", 3782 3770 HCLGE_NAME, pci_name(hdev->pdev)); 3783 3771 ret = request_irq(hdev->misc_vector.vector_irq, hclge_misc_irq_handle, 3784 - 0, hdev->misc_vector.name, hdev); 3772 + IRQ_NOAUTOEN, hdev->misc_vector.name, hdev); 3785 3773 if (ret) { 3786 3774 hclge_free_vector(hdev, 0); 3787 3775 dev_err(&hdev->pdev->dev, "request misc irq(%d) fail\n", ··· 4074 4062 case HNAE3_FUNC_RESET: 4075 4063 dev_info(&pdev->dev, "PF reset requested\n"); 4076 4064 /* schedule again to check later */ 4077 - set_bit(HNAE3_FUNC_RESET, &hdev->reset_pending); 4065 + hclge_set_reset_pending(hdev, HNAE3_FUNC_RESET); 4078 4066 hclge_reset_task_schedule(hdev); 4079 4067 break; 4080 4068 default: ··· 4107 4095 rst_level = HNAE3_FLR_RESET; 4108 4096 clear_bit(HNAE3_FLR_RESET, addr); 4109 4097 } 4098 + 4099 + clear_bit(HNAE3_NONE_RESET, addr); 4110 4100 4111 4101 if (hdev->reset_type != HNAE3_NONE_RESET && 4112 4102 rst_level < hdev->reset_type) ··· 4251 4237 return false; 4252 4238 } else if (hdev->rst_stats.reset_fail_cnt < MAX_RESET_FAIL_CNT) { 4253 4239 hdev->rst_stats.reset_fail_cnt++; 4254 - set_bit(hdev->reset_type, &hdev->reset_pending); 4240 + hclge_set_reset_pending(hdev, hdev->reset_type); 4255 4241 dev_info(&hdev->pdev->dev, 4256 4242 "re-schedule reset task(%u)\n", 4257 4243 hdev->rst_stats.reset_fail_cnt); ··· 4494 4480 static void hclge_set_def_reset_request(struct hnae3_ae_dev *ae_dev, 4495 4481 enum hnae3_reset_type rst_type) 4496 4482 { 4483 + #define HCLGE_SUPPORT_RESET_TYPE \ 4484 + (BIT(HNAE3_FLR_RESET) | BIT(HNAE3_FUNC_RESET) | \ 4485 + BIT(HNAE3_GLOBAL_RESET) | BIT(HNAE3_IMP_RESET)) 4486 + 4497 4487 struct hclge_dev *hdev = ae_dev->priv; 4488 + 4489 + if (!(BIT(rst_type) & HCLGE_SUPPORT_RESET_TYPE)) { 4490 + /* To prevent reset triggered by hclge_reset_event */ 4491 + set_bit(HNAE3_NONE_RESET, &hdev->default_reset_request); 4492 + dev_warn(&hdev->pdev->dev, "unsupported reset type %d\n", 4493 + rst_type); 4494 + return; 4495 + } 4498 4496 4499 4497 set_bit(rst_type, &hdev->default_reset_request); 4500 4498 } ··· 11917 11891 11918 11892 hclge_init_rxd_adv_layout(hdev); 11919 11893 11920 - /* Enable MISC vector(vector0) */ 11921 - hclge_enable_vector(&hdev->misc_vector, true); 11922 - 11923 11894 ret = hclge_init_wol(hdev); 11924 11895 if (ret) 11925 11896 dev_warn(&pdev->dev, ··· 11928 11905 11929 11906 hclge_state_init(hdev); 11930 11907 hdev->last_reset_time = jiffies; 11908 + 11909 + /* Enable MISC vector(vector0) */ 11910 + enable_irq(hdev->misc_vector.vector_irq); 11911 + hclge_enable_vector(&hdev->misc_vector, true); 11931 11912 11932 11913 dev_info(&hdev->pdev->dev, "%s driver initialization finished.\n", 11933 11914 HCLGE_DRIVER_NAME); ··· 12338 12311 12339 12312 /* Disable MISC vector(vector0) */ 12340 12313 hclge_enable_vector(&hdev->misc_vector, false); 12341 - synchronize_irq(hdev->misc_vector.vector_irq); 12314 + disable_irq(hdev->misc_vector.vector_irq); 12342 12315 12343 12316 /* Disable all hw interrupts */ 12344 12317 hclge_config_mac_tnl_int(hdev, false);
+3
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c
··· 58 58 struct hclge_dev *hdev = vport->back; 59 59 struct hclge_ptp *ptp = hdev->ptp; 60 60 61 + if (!ptp) 62 + return false; 63 + 61 64 if (!test_bit(HCLGE_PTP_FLAG_TX_EN, &ptp->flags) || 62 65 test_and_set_bit(HCLGE_STATE_PTP_TX_HANDLING, &hdev->state)) { 63 66 ptp->tx_skipped++;
+5 -4
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_regs.c
··· 510 510 static int hclge_fetch_pf_reg(struct hclge_dev *hdev, void *data, 511 511 struct hnae3_knic_private_info *kinfo) 512 512 { 513 - #define HCLGE_RING_REG_OFFSET 0x200 514 513 #define HCLGE_RING_INT_REG_OFFSET 0x4 515 514 515 + struct hnae3_queue *tqp; 516 516 int i, j, reg_num; 517 517 int data_num_sum; 518 518 u32 *reg = data; ··· 533 533 reg_num = ARRAY_SIZE(ring_reg_addr_list); 534 534 for (j = 0; j < kinfo->num_tqps; j++) { 535 535 reg += hclge_reg_get_tlv(HCLGE_REG_TAG_RING, reg_num, reg); 536 + tqp = kinfo->tqp[j]; 536 537 for (i = 0; i < reg_num; i++) 537 - *reg++ = hclge_read_dev(&hdev->hw, 538 - ring_reg_addr_list[i] + 539 - HCLGE_RING_REG_OFFSET * j); 538 + *reg++ = readl_relaxed(tqp->io_base - 539 + HCLGE_TQP_REG_OFFSET + 540 + ring_reg_addr_list[i]); 540 541 } 541 542 data_num_sum += (reg_num + HCLGE_REG_TLV_SPACE) * kinfo->num_tqps; 542 543
+33 -7
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
··· 1395 1395 return ret; 1396 1396 } 1397 1397 1398 + static void hclgevf_set_reset_pending(struct hclgevf_dev *hdev, 1399 + enum hnae3_reset_type reset_type) 1400 + { 1401 + /* When an incorrect reset type is executed, the get_reset_level 1402 + * function generates the HNAE3_NONE_RESET flag. As a result, this 1403 + * type do not need to pending. 1404 + */ 1405 + if (reset_type != HNAE3_NONE_RESET) 1406 + set_bit(reset_type, &hdev->reset_pending); 1407 + } 1408 + 1398 1409 static int hclgevf_reset_wait(struct hclgevf_dev *hdev) 1399 1410 { 1400 1411 #define HCLGEVF_RESET_WAIT_US 20000 ··· 1555 1544 hdev->rst_stats.rst_fail_cnt); 1556 1545 1557 1546 if (hdev->rst_stats.rst_fail_cnt < HCLGEVF_RESET_MAX_FAIL_CNT) 1558 - set_bit(hdev->reset_type, &hdev->reset_pending); 1547 + hclgevf_set_reset_pending(hdev, hdev->reset_type); 1559 1548 1560 1549 if (hclgevf_is_reset_pending(hdev)) { 1561 1550 set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); ··· 1675 1664 clear_bit(HNAE3_FLR_RESET, addr); 1676 1665 } 1677 1666 1667 + clear_bit(HNAE3_NONE_RESET, addr); 1668 + 1678 1669 return rst_level; 1679 1670 } 1680 1671 ··· 1686 1673 struct hnae3_ae_dev *ae_dev = pci_get_drvdata(pdev); 1687 1674 struct hclgevf_dev *hdev = ae_dev->priv; 1688 1675 1689 - dev_info(&hdev->pdev->dev, "received reset request from VF enet\n"); 1690 - 1691 1676 if (hdev->default_reset_request) 1692 1677 hdev->reset_level = 1693 1678 hclgevf_get_reset_level(&hdev->default_reset_request); 1694 1679 else 1695 1680 hdev->reset_level = HNAE3_VF_FUNC_RESET; 1681 + 1682 + dev_info(&hdev->pdev->dev, "received reset request from VF enet, reset level is %d\n", 1683 + hdev->reset_level); 1696 1684 1697 1685 /* reset of this VF requested */ 1698 1686 set_bit(HCLGEVF_RESET_REQUESTED, &hdev->reset_state); ··· 1705 1691 static void hclgevf_set_def_reset_request(struct hnae3_ae_dev *ae_dev, 1706 1692 enum hnae3_reset_type rst_type) 1707 1693 { 1694 + #define HCLGEVF_SUPPORT_RESET_TYPE \ 1695 + (BIT(HNAE3_VF_RESET) | BIT(HNAE3_VF_FUNC_RESET) | \ 1696 + BIT(HNAE3_VF_PF_FUNC_RESET) | BIT(HNAE3_VF_FULL_RESET) | \ 1697 + BIT(HNAE3_FLR_RESET) | BIT(HNAE3_VF_EXP_RESET)) 1698 + 1708 1699 struct hclgevf_dev *hdev = ae_dev->priv; 1709 1700 1701 + if (!(BIT(rst_type) & HCLGEVF_SUPPORT_RESET_TYPE)) { 1702 + /* To prevent reset triggered by hclge_reset_event */ 1703 + set_bit(HNAE3_NONE_RESET, &hdev->default_reset_request); 1704 + dev_info(&hdev->pdev->dev, "unsupported reset type %d\n", 1705 + rst_type); 1706 + return; 1707 + } 1710 1708 set_bit(rst_type, &hdev->default_reset_request); 1711 1709 } 1712 1710 ··· 1875 1849 */ 1876 1850 if (hdev->reset_attempts > HCLGEVF_MAX_RESET_ATTEMPTS_CNT) { 1877 1851 /* prepare for full reset of stack + pcie interface */ 1878 - set_bit(HNAE3_VF_FULL_RESET, &hdev->reset_pending); 1852 + hclgevf_set_reset_pending(hdev, HNAE3_VF_FULL_RESET); 1879 1853 1880 1854 /* "defer" schedule the reset task again */ 1881 1855 set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); 1882 1856 } else { 1883 1857 hdev->reset_attempts++; 1884 1858 1885 - set_bit(hdev->reset_level, &hdev->reset_pending); 1859 + hclgevf_set_reset_pending(hdev, hdev->reset_level); 1886 1860 set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); 1887 1861 } 1888 1862 hclgevf_reset_task_schedule(hdev); ··· 2005 1979 rst_ing_reg = hclgevf_read_dev(&hdev->hw, HCLGEVF_RST_ING); 2006 1980 dev_info(&hdev->pdev->dev, 2007 1981 "receive reset interrupt 0x%x!\n", rst_ing_reg); 2008 - set_bit(HNAE3_VF_RESET, &hdev->reset_pending); 1982 + hclgevf_set_reset_pending(hdev, HNAE3_VF_RESET); 2009 1983 set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); 2010 1984 set_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state); 2011 1985 *clearval = ~(1U << HCLGEVF_VECTOR0_RST_INT_B); ··· 2315 2289 clear_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state); 2316 2290 2317 2291 INIT_DELAYED_WORK(&hdev->service_task, hclgevf_service_task); 2292 + timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0); 2318 2293 2319 2294 mutex_init(&hdev->mbx_resp.mbx_mutex); 2320 2295 sema_init(&hdev->reset_sem, 1); ··· 3015 2988 HCLGEVF_DRIVER_NAME); 3016 2989 3017 2990 hclgevf_task_schedule(hdev, round_jiffies_relative(HZ)); 3018 - timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0); 3019 2991 3020 2992 return 0; 3021 2993
+5 -4
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_regs.c
··· 123 123 void hclgevf_get_regs(struct hnae3_handle *handle, u32 *version, 124 124 void *data) 125 125 { 126 - #define HCLGEVF_RING_REG_OFFSET 0x200 127 126 #define HCLGEVF_RING_INT_REG_OFFSET 0x4 128 127 129 128 struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); 129 + struct hnae3_queue *tqp; 130 130 int i, j, reg_um; 131 131 u32 *reg = data; 132 132 ··· 147 147 reg_um = ARRAY_SIZE(ring_reg_addr_list); 148 148 for (j = 0; j < hdev->num_tqps; j++) { 149 149 reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_RING, reg_um, reg); 150 + tqp = &hdev->htqp[j].q; 150 151 for (i = 0; i < reg_um; i++) 151 - *reg++ = hclgevf_read_dev(&hdev->hw, 152 - ring_reg_addr_list[i] + 153 - HCLGEVF_RING_REG_OFFSET * j); 152 + *reg++ = readl_relaxed(tqp->io_base - 153 + HCLGEVF_TQP_REG_OFFSET + 154 + ring_reg_addr_list[i]); 154 155 } 155 156 156 157 reg_um = ARRAY_SIZE(tqp_intr_reg_addr_list);
+70
drivers/net/ethernet/intel/ice/ice_dpll.c
··· 10 10 #define ICE_DPLL_PIN_IDX_INVALID 0xff 11 11 #define ICE_DPLL_RCLK_NUM_PER_PF 1 12 12 #define ICE_DPLL_PIN_ESYNC_PULSE_HIGH_PERCENT 25 13 + #define ICE_DPLL_PIN_GEN_RCLK_FREQ 1953125 13 14 14 15 /** 15 16 * enum ice_dpll_pin_type - enumerate ice pin types: ··· 2065 2064 } 2066 2065 2067 2066 /** 2067 + * ice_dpll_init_info_pins_generic - initializes generic pins info 2068 + * @pf: board private structure 2069 + * @input: if input pins initialized 2070 + * 2071 + * Init information for generic pins, cache them in PF's pins structures. 2072 + * 2073 + * Return: 2074 + * * 0 - success 2075 + * * negative - init failure reason 2076 + */ 2077 + static int ice_dpll_init_info_pins_generic(struct ice_pf *pf, bool input) 2078 + { 2079 + struct ice_dpll *de = &pf->dplls.eec, *dp = &pf->dplls.pps; 2080 + static const char labels[][sizeof("99")] = { 2081 + "0", "1", "2", "3", "4", "5", "6", "7", "8", 2082 + "9", "10", "11", "12", "13", "14", "15" }; 2083 + u32 cap = DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE; 2084 + enum ice_dpll_pin_type pin_type; 2085 + int i, pin_num, ret = -EINVAL; 2086 + struct ice_dpll_pin *pins; 2087 + u32 phase_adj_max; 2088 + 2089 + if (input) { 2090 + pin_num = pf->dplls.num_inputs; 2091 + pins = pf->dplls.inputs; 2092 + phase_adj_max = pf->dplls.input_phase_adj_max; 2093 + pin_type = ICE_DPLL_PIN_TYPE_INPUT; 2094 + cap |= DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE; 2095 + } else { 2096 + pin_num = pf->dplls.num_outputs; 2097 + pins = pf->dplls.outputs; 2098 + phase_adj_max = pf->dplls.output_phase_adj_max; 2099 + pin_type = ICE_DPLL_PIN_TYPE_OUTPUT; 2100 + } 2101 + if (pin_num > ARRAY_SIZE(labels)) 2102 + return ret; 2103 + 2104 + for (i = 0; i < pin_num; i++) { 2105 + pins[i].idx = i; 2106 + pins[i].prop.board_label = labels[i]; 2107 + pins[i].prop.phase_range.min = phase_adj_max; 2108 + pins[i].prop.phase_range.max = -phase_adj_max; 2109 + pins[i].prop.capabilities = cap; 2110 + pins[i].pf = pf; 2111 + ret = ice_dpll_pin_state_update(pf, &pins[i], pin_type, NULL); 2112 + if (ret) 2113 + break; 2114 + if (input && pins[i].freq == ICE_DPLL_PIN_GEN_RCLK_FREQ) 2115 + pins[i].prop.type = DPLL_PIN_TYPE_MUX; 2116 + else 2117 + pins[i].prop.type = DPLL_PIN_TYPE_EXT; 2118 + if (!input) 2119 + continue; 2120 + ret = ice_aq_get_cgu_ref_prio(&pf->hw, de->dpll_idx, i, 2121 + &de->input_prio[i]); 2122 + if (ret) 2123 + break; 2124 + ret = ice_aq_get_cgu_ref_prio(&pf->hw, dp->dpll_idx, i, 2125 + &dp->input_prio[i]); 2126 + if (ret) 2127 + break; 2128 + } 2129 + 2130 + return ret; 2131 + } 2132 + 2133 + /** 2068 2134 * ice_dpll_init_info_direct_pins - initializes direct pins info 2069 2135 * @pf: board private structure 2070 2136 * @pin_type: type of pins being initialized ··· 2169 2101 default: 2170 2102 return -EINVAL; 2171 2103 } 2104 + if (num_pins != ice_cgu_get_num_pins(hw, input)) 2105 + return ice_dpll_init_info_pins_generic(pf, input); 2172 2106 2173 2107 for (i = 0; i < num_pins; i++) { 2174 2108 caps = 0;
+19 -2
drivers/net/ethernet/intel/ice/ice_ptp_hw.c
··· 34 34 ARRAY_SIZE(ice_cgu_pin_freq_common), ice_cgu_pin_freq_common }, 35 35 { "GNSS-1PPS", ZL_REF4P, DPLL_PIN_TYPE_GNSS, 36 36 ARRAY_SIZE(ice_cgu_pin_freq_1_hz), ice_cgu_pin_freq_1_hz }, 37 - { "OCXO", ZL_REF4N, DPLL_PIN_TYPE_INT_OSCILLATOR, 0, }, 38 37 }; 39 38 40 39 static const struct ice_cgu_pin_desc ice_e810t_qsfp_cgu_inputs[] = { ··· 51 52 ARRAY_SIZE(ice_cgu_pin_freq_common), ice_cgu_pin_freq_common }, 52 53 { "GNSS-1PPS", ZL_REF4P, DPLL_PIN_TYPE_GNSS, 53 54 ARRAY_SIZE(ice_cgu_pin_freq_1_hz), ice_cgu_pin_freq_1_hz }, 54 - { "OCXO", ZL_REF4N, DPLL_PIN_TYPE_INT_OSCILLATOR, }, 55 55 }; 56 56 57 57 static const struct ice_cgu_pin_desc ice_e810t_sfp_cgu_outputs[] = { ··· 5960 5962 } 5961 5963 5962 5964 return t; 5965 + } 5966 + 5967 + /** 5968 + * ice_cgu_get_num_pins - get pin description array size 5969 + * @hw: pointer to the hw struct 5970 + * @input: if request is done against input or output pins 5971 + * 5972 + * Return: size of pin description array for given hw. 5973 + */ 5974 + int ice_cgu_get_num_pins(struct ice_hw *hw, bool input) 5975 + { 5976 + const struct ice_cgu_pin_desc *t; 5977 + int size; 5978 + 5979 + t = ice_cgu_get_pin_desc(hw, input, &size); 5980 + if (t) 5981 + return size; 5982 + 5983 + return 0; 5963 5984 } 5964 5985 5965 5986 /**
+1
drivers/net/ethernet/intel/ice/ice_ptp_hw.h
··· 404 404 int ice_write_sma_ctrl_e810t(struct ice_hw *hw, u8 data); 405 405 int ice_read_pca9575_reg_e810t(struct ice_hw *hw, u8 offset, u8 *data); 406 406 bool ice_is_pca9575_present(struct ice_hw *hw); 407 + int ice_cgu_get_num_pins(struct ice_hw *hw, bool input); 407 408 enum dpll_pin_type ice_cgu_get_pin_type(struct ice_hw *hw, u8 pin, bool input); 408 409 struct dpll_pin_frequency * 409 410 ice_cgu_get_pin_freq_supp(struct ice_hw *hw, u8 pin, bool input, u8 *num);
+1 -1
drivers/net/ethernet/intel/igb/igb_main.c
··· 907 907 int i, err = 0, vector = 0, free_vector = 0; 908 908 909 909 err = request_irq(adapter->msix_entries[vector].vector, 910 - igb_msix_other, 0, netdev->name, adapter); 910 + igb_msix_other, IRQF_NO_THREAD, netdev->name, adapter); 911 911 if (err) 912 912 goto err_out; 913 913
+2 -2
drivers/net/ethernet/mediatek/mtk_wed_wo.h
··· 91 91 #define MT7981_FIRMWARE_WO "mediatek/mt7981_wo.bin" 92 92 #define MT7986_FIRMWARE_WO0 "mediatek/mt7986_wo_0.bin" 93 93 #define MT7986_FIRMWARE_WO1 "mediatek/mt7986_wo_1.bin" 94 - #define MT7988_FIRMWARE_WO0 "mediatek/mt7988_wo_0.bin" 95 - #define MT7988_FIRMWARE_WO1 "mediatek/mt7988_wo_1.bin" 94 + #define MT7988_FIRMWARE_WO0 "mediatek/mt7988/mt7988_wo_0.bin" 95 + #define MT7988_FIRMWARE_WO1 "mediatek/mt7988/mt7988_wo_1.bin" 96 96 97 97 #define MTK_WO_MCU_CFG_LS_BASE 0 98 98 #define MTK_WO_MCU_CFG_LS_HW_VER_ADDR (MTK_WO_MCU_CFG_LS_BASE + 0x000)
+17 -8
drivers/net/ethernet/mellanox/mlxsw/pci.c
··· 389 389 dma_unmap_single(&pdev->dev, mapaddr, frag_len, direction); 390 390 } 391 391 392 - static struct sk_buff *mlxsw_pci_rdq_build_skb(struct page *pages[], 392 + static struct sk_buff *mlxsw_pci_rdq_build_skb(struct mlxsw_pci_queue *q, 393 + struct page *pages[], 393 394 u16 byte_count) 394 395 { 396 + struct mlxsw_pci_queue *cq = q->u.rdq.cq; 395 397 unsigned int linear_data_size; 398 + struct page_pool *page_pool; 396 399 struct sk_buff *skb; 397 400 int page_index = 0; 398 401 bool linear_only; 399 402 void *data; 403 + 404 + linear_only = byte_count + MLXSW_PCI_RX_BUF_SW_OVERHEAD <= PAGE_SIZE; 405 + linear_data_size = linear_only ? byte_count : 406 + PAGE_SIZE - 407 + MLXSW_PCI_RX_BUF_SW_OVERHEAD; 408 + 409 + page_pool = cq->u.cq.page_pool; 410 + page_pool_dma_sync_for_cpu(page_pool, pages[page_index], 411 + MLXSW_PCI_SKB_HEADROOM, linear_data_size); 400 412 401 413 data = page_address(pages[page_index]); 402 414 net_prefetch(data); ··· 416 404 skb = napi_build_skb(data, PAGE_SIZE); 417 405 if (unlikely(!skb)) 418 406 return ERR_PTR(-ENOMEM); 419 - 420 - linear_only = byte_count + MLXSW_PCI_RX_BUF_SW_OVERHEAD <= PAGE_SIZE; 421 - linear_data_size = linear_only ? byte_count : 422 - PAGE_SIZE - 423 - MLXSW_PCI_RX_BUF_SW_OVERHEAD; 424 407 425 408 skb_reserve(skb, MLXSW_PCI_SKB_HEADROOM); 426 409 skb_put(skb, linear_data_size); ··· 432 425 433 426 page = pages[page_index]; 434 427 frag_size = min(byte_count, PAGE_SIZE); 428 + page_pool_dma_sync_for_cpu(page_pool, page, 0, frag_size); 435 429 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, 436 430 page, 0, frag_size, PAGE_SIZE); 437 431 byte_count -= frag_size; ··· 768 760 if (err) 769 761 goto out; 770 762 771 - skb = mlxsw_pci_rdq_build_skb(pages, byte_count); 763 + skb = mlxsw_pci_rdq_build_skb(q, pages, byte_count); 772 764 if (IS_ERR(skb)) { 773 765 dev_err_ratelimited(&pdev->dev, "Failed to build skb for RDQ\n"); 774 766 mlxsw_pci_rdq_pages_recycle(q, pages, num_sg_entries); ··· 996 988 if (cq_type != MLXSW_PCI_CQ_RDQ) 997 989 return 0; 998 990 999 - pp_params.flags = PP_FLAG_DMA_MAP; 991 + pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV; 1000 992 pp_params.pool_size = MLXSW_PCI_WQE_COUNT * mlxsw_pci->num_sg_entries; 1001 993 pp_params.nid = dev_to_node(&mlxsw_pci->pdev->dev); 1002 994 pp_params.dev = &mlxsw_pci->pdev->dev; 1003 995 pp_params.napi = &q->u.cq.napi; 1004 996 pp_params.dma_dir = DMA_FROM_DEVICE; 997 + pp_params.max_len = PAGE_SIZE; 1005 998 1006 999 page_pool = page_pool_create(&pp_params); 1007 1000 if (IS_ERR(page_pool))
+24 -2
drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c
··· 481 481 struct mlxsw_sp_ipip_entry *ipip_entry, 482 482 struct netlink_ext_ack *extack) 483 483 { 484 + u32 new_kvdl_index, old_kvdl_index = ipip_entry->dip_kvdl_index; 485 + struct in6_addr old_addr6 = ipip_entry->parms.daddr.addr6; 484 486 struct mlxsw_sp_ipip_parms new_parms; 487 + int err; 485 488 486 489 new_parms = mlxsw_sp_ipip_netdev_parms_init_gre6(ipip_entry->ol_dev); 487 - return mlxsw_sp_ipip_ol_netdev_change_gre(mlxsw_sp, ipip_entry, 488 - &new_parms, extack); 490 + 491 + err = mlxsw_sp_ipv6_addr_kvdl_index_get(mlxsw_sp, 492 + &new_parms.daddr.addr6, 493 + &new_kvdl_index); 494 + if (err) 495 + return err; 496 + ipip_entry->dip_kvdl_index = new_kvdl_index; 497 + 498 + err = mlxsw_sp_ipip_ol_netdev_change_gre(mlxsw_sp, ipip_entry, 499 + &new_parms, extack); 500 + if (err) 501 + goto err_change_gre; 502 + 503 + mlxsw_sp_ipv6_addr_put(mlxsw_sp, &old_addr6); 504 + 505 + return 0; 506 + 507 + err_change_gre: 508 + ipip_entry->dip_kvdl_index = old_kvdl_index; 509 + mlxsw_sp_ipv6_addr_put(mlxsw_sp, &new_parms.daddr.addr6); 510 + return err; 489 511 } 490 512 491 513 static int
+7
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
··· 16 16 #include "spectrum.h" 17 17 #include "spectrum_ptp.h" 18 18 #include "core.h" 19 + #include "txheader.h" 19 20 20 21 #define MLXSW_SP1_PTP_CLOCK_CYCLES_SHIFT 29 21 22 #define MLXSW_SP1_PTP_CLOCK_FREQ_KHZ 156257 /* 6.4nSec */ ··· 1685 1684 struct sk_buff *skb, 1686 1685 const struct mlxsw_tx_info *tx_info) 1687 1686 { 1687 + if (skb_cow_head(skb, MLXSW_TXHDR_LEN)) { 1688 + this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped); 1689 + dev_kfree_skb_any(skb); 1690 + return -ENOMEM; 1691 + } 1692 + 1688 1693 mlxsw_sp_txhdr_construct(skb, tx_info); 1689 1694 return 0; 1690 1695 }
+8
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
··· 203 203 readl(ioaddr + DMA_CHAN_TX_CONTROL(dwmac4_addrs, channel)); 204 204 reg_space[DMA_CHAN_RX_CONTROL(default_addrs, channel) / 4] = 205 205 readl(ioaddr + DMA_CHAN_RX_CONTROL(dwmac4_addrs, channel)); 206 + reg_space[DMA_CHAN_TX_BASE_ADDR_HI(default_addrs, channel) / 4] = 207 + readl(ioaddr + DMA_CHAN_TX_BASE_ADDR_HI(dwmac4_addrs, channel)); 206 208 reg_space[DMA_CHAN_TX_BASE_ADDR(default_addrs, channel) / 4] = 207 209 readl(ioaddr + DMA_CHAN_TX_BASE_ADDR(dwmac4_addrs, channel)); 210 + reg_space[DMA_CHAN_RX_BASE_ADDR_HI(default_addrs, channel) / 4] = 211 + readl(ioaddr + DMA_CHAN_RX_BASE_ADDR_HI(dwmac4_addrs, channel)); 208 212 reg_space[DMA_CHAN_RX_BASE_ADDR(default_addrs, channel) / 4] = 209 213 readl(ioaddr + DMA_CHAN_RX_BASE_ADDR(dwmac4_addrs, channel)); 210 214 reg_space[DMA_CHAN_TX_END_ADDR(default_addrs, channel) / 4] = ··· 229 225 readl(ioaddr + DMA_CHAN_CUR_TX_DESC(dwmac4_addrs, channel)); 230 226 reg_space[DMA_CHAN_CUR_RX_DESC(default_addrs, channel) / 4] = 231 227 readl(ioaddr + DMA_CHAN_CUR_RX_DESC(dwmac4_addrs, channel)); 228 + reg_space[DMA_CHAN_CUR_TX_BUF_ADDR_HI(default_addrs, channel) / 4] = 229 + readl(ioaddr + DMA_CHAN_CUR_TX_BUF_ADDR_HI(dwmac4_addrs, channel)); 232 230 reg_space[DMA_CHAN_CUR_TX_BUF_ADDR(default_addrs, channel) / 4] = 233 231 readl(ioaddr + DMA_CHAN_CUR_TX_BUF_ADDR(dwmac4_addrs, channel)); 232 + reg_space[DMA_CHAN_CUR_RX_BUF_ADDR_HI(default_addrs, channel) / 4] = 233 + readl(ioaddr + DMA_CHAN_CUR_RX_BUF_ADDR_HI(dwmac4_addrs, channel)); 234 234 reg_space[DMA_CHAN_CUR_RX_BUF_ADDR(default_addrs, channel) / 4] = 235 235 readl(ioaddr + DMA_CHAN_CUR_RX_BUF_ADDR(dwmac4_addrs, channel)); 236 236 reg_space[DMA_CHAN_STATUS(default_addrs, channel) / 4] =
+2
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h
··· 127 127 #define DMA_CHAN_SLOT_CTRL_STATUS(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x3c) 128 128 #define DMA_CHAN_CUR_TX_DESC(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x44) 129 129 #define DMA_CHAN_CUR_RX_DESC(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x4c) 130 + #define DMA_CHAN_CUR_TX_BUF_ADDR_HI(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x50) 130 131 #define DMA_CHAN_CUR_TX_BUF_ADDR(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x54) 132 + #define DMA_CHAN_CUR_RX_BUF_ADDR_HI(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x58) 131 133 #define DMA_CHAN_CUR_RX_BUF_ADDR(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x5c) 132 134 #define DMA_CHAN_STATUS(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x60) 133 135
+17 -5
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 4304 4304 if (dma_mapping_error(priv->device, des)) 4305 4305 goto dma_map_err; 4306 4306 4307 - tx_q->tx_skbuff_dma[first_entry].buf = des; 4308 - tx_q->tx_skbuff_dma[first_entry].len = skb_headlen(skb); 4309 - tx_q->tx_skbuff_dma[first_entry].map_as_page = false; 4310 - tx_q->tx_skbuff_dma[first_entry].buf_type = STMMAC_TXBUF_T_SKB; 4311 - 4312 4307 if (priv->dma_cap.addr64 <= 32) { 4313 4308 first->des0 = cpu_to_le32(des); 4314 4309 ··· 4321 4326 } 4322 4327 4323 4328 stmmac_tso_allocator(priv, des, tmp_pay_len, (nfrags == 0), queue); 4329 + 4330 + /* In case two or more DMA transmit descriptors are allocated for this 4331 + * non-paged SKB data, the DMA buffer address should be saved to 4332 + * tx_q->tx_skbuff_dma[].buf corresponding to the last descriptor, 4333 + * and leave the other tx_q->tx_skbuff_dma[].buf as NULL to guarantee 4334 + * that stmmac_tx_clean() does not unmap the entire DMA buffer too early 4335 + * since the tail areas of the DMA buffer can be accessed by DMA engine 4336 + * sooner or later. 4337 + * By saving the DMA buffer address to tx_q->tx_skbuff_dma[].buf 4338 + * corresponding to the last descriptor, stmmac_tx_clean() will unmap 4339 + * this DMA buffer right after the DMA engine completely finishes the 4340 + * full buffer transmission. 4341 + */ 4342 + tx_q->tx_skbuff_dma[tx_q->cur_tx].buf = des; 4343 + tx_q->tx_skbuff_dma[tx_q->cur_tx].len = skb_headlen(skb); 4344 + tx_q->tx_skbuff_dma[tx_q->cur_tx].map_as_page = false; 4345 + tx_q->tx_skbuff_dma[tx_q->cur_tx].buf_type = STMMAC_TXBUF_T_SKB; 4324 4346 4325 4347 /* Prepare fragments */ 4326 4348 for (i = 0; i < nfrags; i++) {
+13 -9
drivers/net/gtp.c
··· 1702 1702 return -EINVAL; 1703 1703 1704 1704 if (data[IFLA_GTP_FD0]) { 1705 - u32 fd0 = nla_get_u32(data[IFLA_GTP_FD0]); 1705 + int fd0 = nla_get_u32(data[IFLA_GTP_FD0]); 1706 1706 1707 - sk0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp); 1708 - if (IS_ERR(sk0)) 1709 - return PTR_ERR(sk0); 1707 + if (fd0 >= 0) { 1708 + sk0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp); 1709 + if (IS_ERR(sk0)) 1710 + return PTR_ERR(sk0); 1711 + } 1710 1712 } 1711 1713 1712 1714 if (data[IFLA_GTP_FD1]) { 1713 - u32 fd1 = nla_get_u32(data[IFLA_GTP_FD1]); 1715 + int fd1 = nla_get_u32(data[IFLA_GTP_FD1]); 1714 1716 1715 - sk1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp); 1716 - if (IS_ERR(sk1u)) { 1717 - gtp_encap_disable_sock(sk0); 1718 - return PTR_ERR(sk1u); 1717 + if (fd1 >= 0) { 1718 + sk1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp); 1719 + if (IS_ERR(sk1u)) { 1720 + gtp_encap_disable_sock(sk0); 1721 + return PTR_ERR(sk1u); 1722 + } 1719 1723 } 1720 1724 } 1721 1725
+1 -2
drivers/net/macsec.c
··· 3798 3798 { 3799 3799 struct macsec_dev *macsec = macsec_priv(dev); 3800 3800 3801 - if (macsec->secy.tx_sc.md_dst) 3802 - metadata_dst_free(macsec->secy.tx_sc.md_dst); 3801 + dst_release(&macsec->secy.tx_sc.md_dst->dst); 3803 3802 free_percpu(macsec->stats); 3804 3803 free_percpu(macsec->secy.tx_sc.stats); 3805 3804
+3
drivers/net/mctp/mctp-i2c.c
··· 588 588 if (len > MCTP_I2C_MAXMTU) 589 589 return -EMSGSIZE; 590 590 591 + if (!daddr || !saddr) 592 + return -EINVAL; 593 + 591 594 lldst = *((u8 *)daddr); 592 595 llsrc = *((u8 *)saddr); 593 596
+3 -1
drivers/net/netdevsim/fib.c
··· 1377 1377 1378 1378 if (pos != 0) 1379 1379 return -EINVAL; 1380 - if (size > sizeof(buf)) 1380 + if (size > sizeof(buf) - 1) 1381 1381 return -EINVAL; 1382 1382 if (copy_from_user(buf, user_buf, size)) 1383 1383 return -EFAULT; 1384 + buf[size] = 0; 1385 + 1384 1386 if (sscanf(buf, "%u %hu", &nhid, &bucket_index) != 2) 1385 1387 return -EINVAL; 1386 1388
+1
drivers/net/usb/qmi_wwan.c
··· 1076 1076 USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7), 1077 1077 .driver_info = (unsigned long)&qmi_wwan_info, 1078 1078 }, 1079 + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0122)}, /* Quectel RG650V */ 1079 1080 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ 1080 1081 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */ 1081 1082 {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */
+1
drivers/net/usb/r8152.c
··· 10069 10069 { USB_DEVICE(VENDOR_ID_LENOVO, 0x3062) }, 10070 10070 { USB_DEVICE(VENDOR_ID_LENOVO, 0x3069) }, 10071 10071 { USB_DEVICE(VENDOR_ID_LENOVO, 0x3082) }, 10072 + { USB_DEVICE(VENDOR_ID_LENOVO, 0x3098) }, 10072 10073 { USB_DEVICE(VENDOR_ID_LENOVO, 0x7205) }, 10073 10074 { USB_DEVICE(VENDOR_ID_LENOVO, 0x720c) }, 10074 10075 { USB_DEVICE(VENDOR_ID_LENOVO, 0x7214) },
+6 -1
drivers/net/wireless/ath/ath10k/wmi-tlv.c
··· 3043 3043 struct sk_buff *msdu) 3044 3044 { 3045 3045 struct ath10k_skb_cb *cb = ATH10K_SKB_CB(msdu); 3046 + struct ath10k_mgmt_tx_pkt_addr *pkt_addr; 3046 3047 struct ath10k_wmi *wmi = &ar->wmi; 3047 3048 3048 - idr_remove(&wmi->mgmt_pending_tx, cb->msdu_id); 3049 + spin_lock_bh(&ar->data_lock); 3050 + pkt_addr = idr_remove(&wmi->mgmt_pending_tx, cb->msdu_id); 3051 + spin_unlock_bh(&ar->data_lock); 3052 + 3053 + kfree(pkt_addr); 3049 3054 3050 3055 return 0; 3051 3056 }
+2
drivers/net/wireless/ath/ath10k/wmi.c
··· 2441 2441 dma_unmap_single(ar->dev, pkt_addr->paddr, 2442 2442 msdu->len, DMA_TO_DEVICE); 2443 2443 info = IEEE80211_SKB_CB(msdu); 2444 + kfree(pkt_addr); 2444 2445 2445 2446 if (param->status) { 2446 2447 info->flags &= ~IEEE80211_TX_STAT_ACK; ··· 9613 9612 dma_unmap_single(ar->dev, pkt_addr->paddr, 9614 9613 msdu->len, DMA_TO_DEVICE); 9615 9614 ieee80211_free_txskb(ar->hw, msdu); 9615 + kfree(pkt_addr); 9616 9616 9617 9617 return 0; 9618 9618 }
+5 -2
drivers/net/wireless/ath/ath11k/dp_rx.c
··· 5291 5291 hal_status == HAL_TLV_STATUS_PPDU_DONE) { 5292 5292 rx_mon_stats->status_ppdu_done++; 5293 5293 pmon->mon_ppdu_status = DP_PPDU_STATUS_DONE; 5294 - ath11k_dp_rx_mon_dest_process(ar, mac_id, budget, napi); 5295 - pmon->mon_ppdu_status = DP_PPDU_STATUS_START; 5294 + if (!ab->hw_params.full_monitor_mode) { 5295 + ath11k_dp_rx_mon_dest_process(ar, mac_id, 5296 + budget, napi); 5297 + pmon->mon_ppdu_status = DP_PPDU_STATUS_START; 5298 + } 5296 5299 } 5297 5300 5298 5301 if (ppdu_info->peer_id == HAL_INVALID_PEERID ||
+1 -1
drivers/net/wireless/ath/wil6210/txrx.c
··· 306 306 struct sk_buff *skb) 307 307 { 308 308 struct wil6210_rtap { 309 - struct ieee80211_radiotap_header rthdr; 309 + struct ieee80211_radiotap_header_fixed rthdr; 310 310 /* fields should be in the order of bits in rthdr.it_present */ 311 311 /* flags */ 312 312 u8 flags;
+1
drivers/net/wireless/broadcom/brcm80211/Kconfig
··· 27 27 config BRCM_TRACING 28 28 bool "Broadcom device tracing" 29 29 depends on BRCMSMAC || BRCMFMAC 30 + depends on TRACING 30 31 help 31 32 If you say Y here, the Broadcom wireless drivers will register 32 33 with ftrace to dump event information into the trace ringbuffer.
+1 -1
drivers/net/wireless/intel/ipw2x00/ipw2100.c
··· 2518 2518 * to build this manually element by element, we can write it much 2519 2519 * more efficiently than we can parse it. ORDER MATTERS HERE */ 2520 2520 struct ipw_rt_hdr { 2521 - struct ieee80211_radiotap_header rt_hdr; 2521 + struct ieee80211_radiotap_header_fixed rt_hdr; 2522 2522 s8 rt_dbmsignal; /* signal in dbM, kluged to signed */ 2523 2523 } *ipw_rt; 2524 2524
+1 -1
drivers/net/wireless/intel/ipw2x00/ipw2200.h
··· 1143 1143 * structure is provided regardless of any bits unset. 1144 1144 */ 1145 1145 struct ipw_rt_hdr { 1146 - struct ieee80211_radiotap_header rt_hdr; 1146 + struct ieee80211_radiotap_header_fixed rt_hdr; 1147 1147 u64 rt_tsf; /* TSF */ /* XXX */ 1148 1148 u8 rt_flags; /* radiotap packet flags */ 1149 1149 u8 rt_rate; /* rate in 500kb/s */
+14 -1
drivers/net/wireless/intel/iwlegacy/common.c
··· 3122 3122 struct il_cmd_meta *out_meta; 3123 3123 dma_addr_t phys_addr; 3124 3124 unsigned long flags; 3125 + u8 *out_payload; 3125 3126 u32 idx; 3126 3127 u16 fix_size; 3127 3128 ··· 3158 3157 out_cmd = txq->cmd[idx]; 3159 3158 out_meta = &txq->meta[idx]; 3160 3159 3160 + /* The payload is in the same place in regular and huge 3161 + * command buffers, but we need to let the compiler know when 3162 + * we're using a larger payload buffer to avoid "field- 3163 + * spanning write" warnings at run-time for huge commands. 3164 + */ 3165 + if (cmd->flags & CMD_SIZE_HUGE) 3166 + out_payload = ((struct il_device_cmd_huge *)out_cmd)->cmd.payload; 3167 + else 3168 + out_payload = out_cmd->cmd.payload; 3169 + 3161 3170 if (WARN_ON(out_meta->flags & CMD_MAPPED)) { 3162 3171 spin_unlock_irqrestore(&il->hcmd_lock, flags); 3163 3172 return -ENOSPC; ··· 3181 3170 out_meta->callback = cmd->callback; 3182 3171 3183 3172 out_cmd->hdr.cmd = cmd->id; 3184 - memcpy(&out_cmd->cmd.payload, cmd->data, cmd->len); 3173 + memcpy(out_payload, cmd->data, cmd->len); 3185 3174 3186 3175 /* At this point, the out_cmd now has all of the incoming cmd 3187 3176 * information */ ··· 4973 4962 */ 4974 4963 pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00); 4975 4964 4965 + _il_wr(il, CSR_INT, 0xffffffff); 4966 + _il_wr(il, CSR_FH_INT_STATUS, 0xffffffff); 4976 4967 il_enable_interrupts(il); 4977 4968 4978 4969 if (!(_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW))
+12
drivers/net/wireless/intel/iwlegacy/common.h
··· 560 560 561 561 #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct il_device_cmd)) 562 562 563 + /** 564 + * struct il_device_cmd_huge 565 + * 566 + * For use when sending huge commands. 567 + */ 568 + struct il_device_cmd_huge { 569 + struct il_cmd_header hdr; /* uCode API */ 570 + union { 571 + u8 payload[IL_MAX_CMD_SIZE - sizeof(struct il_cmd_header)]; 572 + } __packed cmd; 573 + } __packed; 574 + 563 575 struct il_host_cmd { 564 576 const void *data; 565 577 unsigned long reply_page;
+58 -38
drivers/net/wireless/intel/iwlwifi/fw/acpi.c
··· 429 429 return ret; 430 430 } 431 431 432 - static int iwl_acpi_sar_set_profile(union acpi_object *table, 433 - struct iwl_sar_profile *profile, 434 - bool enabled, u8 num_chains, 435 - u8 num_sub_bands) 432 + static int 433 + iwl_acpi_parse_chains_table(union acpi_object *table, 434 + struct iwl_sar_profile_chain *chains, 435 + u8 num_chains, u8 num_sub_bands) 436 436 { 437 - int i, j, idx = 0; 438 - 439 - /* 440 - * The table from ACPI is flat, but we store it in a 441 - * structured array. 442 - */ 443 - for (i = 0; i < BIOS_SAR_MAX_CHAINS_PER_PROFILE; i++) { 444 - for (j = 0; j < BIOS_SAR_MAX_SUB_BANDS_NUM; j++) { 437 + for (u8 chain = 0; chain < num_chains; chain++) { 438 + for (u8 subband = 0; subband < BIOS_SAR_MAX_SUB_BANDS_NUM; 439 + subband++) { 445 440 /* if we don't have the values, use the default */ 446 - if (i >= num_chains || j >= num_sub_bands) { 447 - profile->chains[i].subbands[j] = 0; 441 + if (subband >= num_sub_bands) { 442 + chains[chain].subbands[subband] = 0; 443 + } else if (table->type != ACPI_TYPE_INTEGER || 444 + table->integer.value > U8_MAX) { 445 + return -EINVAL; 448 446 } else { 449 - if (table[idx].type != ACPI_TYPE_INTEGER || 450 - table[idx].integer.value > U8_MAX) 451 - return -EINVAL; 452 - 453 - profile->chains[i].subbands[j] = 454 - table[idx].integer.value; 455 - 456 - idx++; 447 + chains[chain].subbands[subband] = 448 + table->integer.value; 449 + table++; 457 450 } 458 451 } 459 452 } 460 - 461 - /* Only if all values were valid can the profile be enabled */ 462 - profile->enabled = enabled; 463 453 464 454 return 0; 465 455 } ··· 533 543 /* The profile from WRDS is officially profile 1, but goes 534 544 * into sar_profiles[0] (because we don't have a profile 0). 535 545 */ 536 - ret = iwl_acpi_sar_set_profile(table, &fwrt->sar_profiles[0], 537 - flags & IWL_SAR_ENABLE_MSK, 538 - num_chains, num_sub_bands); 546 + ret = iwl_acpi_parse_chains_table(table, fwrt->sar_profiles[0].chains, 547 + num_chains, num_sub_bands); 548 + if (!ret && flags & IWL_SAR_ENABLE_MSK) 549 + fwrt->sar_profiles[0].enabled = true; 550 + 539 551 out_free: 540 552 kfree(data); 541 553 return ret; ··· 549 557 bool enabled; 550 558 int i, n_profiles, tbl_rev, pos; 551 559 int ret = 0; 552 - u8 num_chains, num_sub_bands; 560 + u8 num_sub_bands; 553 561 554 562 data = iwl_acpi_get_object(fwrt->dev, ACPI_EWRD_METHOD); 555 563 if (IS_ERR(data)) ··· 565 573 goto out_free; 566 574 } 567 575 568 - num_chains = ACPI_SAR_NUM_CHAINS_REV2; 569 576 num_sub_bands = ACPI_SAR_NUM_SUB_BANDS_REV2; 570 577 571 578 goto read_table; ··· 580 589 goto out_free; 581 590 } 582 591 583 - num_chains = ACPI_SAR_NUM_CHAINS_REV1; 584 592 num_sub_bands = ACPI_SAR_NUM_SUB_BANDS_REV1; 585 593 586 594 goto read_table; ··· 595 605 goto out_free; 596 606 } 597 607 598 - num_chains = ACPI_SAR_NUM_CHAINS_REV0; 599 608 num_sub_bands = ACPI_SAR_NUM_SUB_BANDS_REV0; 600 609 601 610 goto read_table; ··· 626 637 /* the tables start at element 3 */ 627 638 pos = 3; 628 639 640 + BUILD_BUG_ON(ACPI_SAR_NUM_CHAINS_REV0 != ACPI_SAR_NUM_CHAINS_REV1); 641 + BUILD_BUG_ON(ACPI_SAR_NUM_CHAINS_REV2 != 2 * ACPI_SAR_NUM_CHAINS_REV0); 642 + 643 + /* parse non-cdb chains for all profiles */ 629 644 for (i = 0; i < n_profiles; i++) { 630 645 union acpi_object *table = &wifi_pkg->package.elements[pos]; 646 + 631 647 /* The EWRD profiles officially go from 2 to 4, but we 632 648 * save them in sar_profiles[1-3] (because we don't 633 649 * have profile 0). So in the array we start from 1. 634 650 */ 635 - ret = iwl_acpi_sar_set_profile(table, 636 - &fwrt->sar_profiles[i + 1], 637 - enabled, num_chains, 638 - num_sub_bands); 651 + ret = iwl_acpi_parse_chains_table(table, 652 + fwrt->sar_profiles[i + 1].chains, 653 + ACPI_SAR_NUM_CHAINS_REV0, 654 + num_sub_bands); 639 655 if (ret < 0) 640 - break; 656 + goto out_free; 641 657 642 658 /* go to the next table */ 643 - pos += num_chains * num_sub_bands; 659 + pos += ACPI_SAR_NUM_CHAINS_REV0 * num_sub_bands; 644 660 } 661 + 662 + /* non-cdb table revisions */ 663 + if (tbl_rev < 2) 664 + goto set_enabled; 665 + 666 + /* parse cdb chains for all profiles */ 667 + for (i = 0; i < n_profiles; i++) { 668 + struct iwl_sar_profile_chain *chains; 669 + union acpi_object *table; 670 + 671 + table = &wifi_pkg->package.elements[pos]; 672 + chains = &fwrt->sar_profiles[i + 1].chains[ACPI_SAR_NUM_CHAINS_REV0]; 673 + ret = iwl_acpi_parse_chains_table(table, 674 + chains, 675 + ACPI_SAR_NUM_CHAINS_REV0, 676 + num_sub_bands); 677 + if (ret < 0) 678 + goto out_free; 679 + 680 + /* go to the next table */ 681 + pos += ACPI_SAR_NUM_CHAINS_REV0 * num_sub_bands; 682 + } 683 + 684 + set_enabled: 685 + for (i = 0; i < n_profiles; i++) 686 + fwrt->sar_profiles[i + 1].enabled = enabled; 645 687 646 688 out_free: 647 689 kfree(data);
+3 -1
drivers/net/wireless/intel/iwlwifi/fw/init.c
··· 39 39 } 40 40 IWL_EXPORT_SYMBOL(iwl_fw_runtime_init); 41 41 42 + /* Assumes the appropriate lock is held by the caller */ 42 43 void iwl_fw_runtime_suspend(struct iwl_fw_runtime *fwrt) 43 44 { 44 45 iwl_fw_suspend_timestamp(fwrt); 45 - iwl_dbg_tlv_time_point(fwrt, IWL_FW_INI_TIME_POINT_HOST_D3_START, NULL); 46 + iwl_dbg_tlv_time_point_sync(fwrt, IWL_FW_INI_TIME_POINT_HOST_D3_START, 47 + NULL); 46 48 } 47 49 IWL_EXPORT_SYMBOL(iwl_fw_runtime_suspend); 48 50
+22 -12
drivers/net/wireless/intel/iwlwifi/iwl-drv.c
··· 1413 1413 const struct iwl_op_mode_ops *ops = op->ops; 1414 1414 struct dentry *dbgfs_dir = NULL; 1415 1415 struct iwl_op_mode *op_mode = NULL; 1416 + int retry, max_retry = !!iwlwifi_mod_params.fw_restart * IWL_MAX_INIT_RETRY; 1416 1417 1417 1418 /* also protects start/stop from racing against each other */ 1418 1419 lockdep_assert_held(&iwlwifi_opmode_table_mtx); 1419 1420 1420 - #ifdef CONFIG_IWLWIFI_DEBUGFS 1421 - drv->dbgfs_op_mode = debugfs_create_dir(op->name, 1422 - drv->dbgfs_drv); 1423 - dbgfs_dir = drv->dbgfs_op_mode; 1424 - #endif 1425 - 1426 - op_mode = ops->start(drv->trans, drv->trans->cfg, 1427 - &drv->fw, dbgfs_dir); 1428 - if (op_mode) 1429 - return op_mode; 1421 + for (retry = 0; retry <= max_retry; retry++) { 1430 1422 1431 1423 #ifdef CONFIG_IWLWIFI_DEBUGFS 1432 - debugfs_remove_recursive(drv->dbgfs_op_mode); 1433 - drv->dbgfs_op_mode = NULL; 1424 + drv->dbgfs_op_mode = debugfs_create_dir(op->name, 1425 + drv->dbgfs_drv); 1426 + dbgfs_dir = drv->dbgfs_op_mode; 1434 1427 #endif 1428 + 1429 + op_mode = ops->start(drv->trans, drv->trans->cfg, 1430 + &drv->fw, dbgfs_dir); 1431 + 1432 + if (op_mode) 1433 + return op_mode; 1434 + 1435 + if (test_bit(STATUS_TRANS_DEAD, &drv->trans->status)) 1436 + break; 1437 + 1438 + IWL_ERR(drv, "retry init count %d\n", retry); 1439 + 1440 + #ifdef CONFIG_IWLWIFI_DEBUGFS 1441 + debugfs_remove_recursive(drv->dbgfs_op_mode); 1442 + drv->dbgfs_op_mode = NULL; 1443 + #endif 1444 + } 1435 1445 1436 1446 return NULL; 1437 1447 }
+3
drivers/net/wireless/intel/iwlwifi/iwl-drv.h
··· 98 98 #define VISIBLE_IF_IWLWIFI_KUNIT static 99 99 #endif 100 100 101 + /* max retry for init flow */ 102 + #define IWL_MAX_INIT_RETRY 2 103 + 101 104 #define FW_NAME_PRE_BUFSIZE 64 102 105 struct iwl_trans; 103 106 const char *iwl_drv_get_fwname_pre(struct iwl_trans *trans, char *buf);
+2
drivers/net/wireless/intel/iwlwifi/mvm/d3.c
··· 1398 1398 1399 1399 iwl_mvm_pause_tcm(mvm, true); 1400 1400 1401 + mutex_lock(&mvm->mutex); 1401 1402 iwl_fw_runtime_suspend(&mvm->fwrt); 1403 + mutex_unlock(&mvm->mutex); 1402 1404 1403 1405 return __iwl_mvm_suspend(hw, wowlan, false); 1404 1406 }
+4 -6
drivers/net/wireless/intel/iwlwifi/mvm/fw.c
··· 1307 1307 void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags) 1308 1308 { 1309 1309 u32 error_log_size = mvm->fw->ucode_capa.error_log_size; 1310 + u32 status = 0; 1310 1311 int ret; 1311 - u32 resp; 1312 1312 1313 1313 struct iwl_fw_error_recovery_cmd recovery_cmd = { 1314 1314 .flags = cpu_to_le32(flags), ··· 1316 1316 }; 1317 1317 struct iwl_host_cmd host_cmd = { 1318 1318 .id = WIDE_ID(SYSTEM_GROUP, FW_ERROR_RECOVERY_CMD), 1319 - .flags = CMD_WANT_SKB, 1320 1319 .data = {&recovery_cmd, }, 1321 1320 .len = {sizeof(recovery_cmd), }, 1322 1321 }; ··· 1335 1336 recovery_cmd.buf_size = cpu_to_le32(error_log_size); 1336 1337 } 1337 1338 1338 - ret = iwl_mvm_send_cmd(mvm, &host_cmd); 1339 + ret = iwl_mvm_send_cmd_status(mvm, &host_cmd, &status); 1339 1340 kfree(mvm->error_recovery_buf); 1340 1341 mvm->error_recovery_buf = NULL; 1341 1342 ··· 1346 1347 1347 1348 /* skb respond is only relevant in ERROR_RECOVERY_UPDATE_DB */ 1348 1349 if (flags & ERROR_RECOVERY_UPDATE_DB) { 1349 - resp = le32_to_cpu(*(__le32 *)host_cmd.resp_pkt->data); 1350 - if (resp) { 1350 + if (status) { 1351 1351 IWL_ERR(mvm, 1352 1352 "Failed to send recovery cmd blob was invalid %d\n", 1353 - resp); 1353 + status); 1354 1354 1355 1355 ieee80211_iterate_interfaces(mvm->hw, 0, 1356 1356 iwl_mvm_disconnect_iterator,
+10 -2
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
··· 1293 1293 { 1294 1294 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 1295 1295 int ret; 1296 + int retry, max_retry = 0; 1296 1297 1297 1298 mutex_lock(&mvm->mutex); 1298 1299 1299 1300 /* we are starting the mac not in error flow, and restart is enabled */ 1300 1301 if (!test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status) && 1301 1302 iwlwifi_mod_params.fw_restart) { 1303 + max_retry = IWL_MAX_INIT_RETRY; 1302 1304 /* 1303 1305 * This will prevent mac80211 recovery flows to trigger during 1304 1306 * init failures ··· 1308 1306 set_bit(IWL_MVM_STATUS_STARTING, &mvm->status); 1309 1307 } 1310 1308 1311 - ret = __iwl_mvm_mac_start(mvm); 1309 + for (retry = 0; retry <= max_retry; retry++) { 1310 + ret = __iwl_mvm_mac_start(mvm); 1311 + if (!ret) 1312 + break; 1313 + 1314 + IWL_ERR(mvm, "mac start retry %d\n", retry); 1315 + } 1312 1316 clear_bit(IWL_MVM_STATUS_STARTING, &mvm->status); 1313 1317 1314 1318 mutex_unlock(&mvm->mutex); ··· 1978 1970 mvm->p2p_device_vif = NULL; 1979 1971 } 1980 1972 1981 - iwl_mvm_unset_link_mapping(mvm, vif, &vif->bss_conf); 1982 1973 iwl_mvm_mac_ctxt_remove(mvm, vif); 1983 1974 1984 1975 RCU_INIT_POINTER(mvm->vif_id_to_mac[mvmvif->id], NULL); ··· 1986 1979 mvm->monitor_on = false; 1987 1980 1988 1981 out: 1982 + iwl_mvm_unset_link_mapping(mvm, vif, &vif->bss_conf); 1989 1983 if (vif->type == NL80211_IFTYPE_AP || 1990 1984 vif->type == NL80211_IFTYPE_ADHOC) { 1991 1985 iwl_mvm_dealloc_int_sta(mvm, &mvmvif->deflink.mcast_sta);
+23 -11
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
··· 41 41 /* reset deflink MLO parameters */ 42 42 mvmvif->deflink.fw_link_id = IWL_MVM_FW_LINK_ID_INVALID; 43 43 mvmvif->deflink.active = 0; 44 - /* the first link always points to the default one */ 45 - mvmvif->link[0] = &mvmvif->deflink; 46 44 47 45 ret = iwl_mvm_mld_mac_ctxt_add(mvm, vif); 48 46 if (ret) ··· 58 60 IEEE80211_VIF_SUPPORTS_CQM_RSSI; 59 61 } 60 62 61 - ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf); 62 - if (ret) 63 - goto out_free_bf; 63 + /* We want link[0] to point to the default link, unless we have MLO and 64 + * in this case this will be modified later by .change_vif_links() 65 + * If we are in the restart flow with an MLD connection, we will wait 66 + * to .change_vif_links() to setup the links. 67 + */ 68 + if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) || 69 + !ieee80211_vif_is_mld(vif)) { 70 + mvmvif->link[0] = &mvmvif->deflink; 71 + 72 + ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf); 73 + if (ret) 74 + goto out_free_bf; 75 + } 64 76 65 77 /* Save a pointer to p2p device vif, so it can later be used to 66 78 * update the p2p device MAC when a GO is started/stopped ··· 358 350 rcu_read_unlock(); 359 351 } 360 352 361 - if (vif->type == NL80211_IFTYPE_STATION) 362 - iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif, 363 - link_conf, 364 - false); 365 - 366 353 /* then activate */ 367 354 ret = iwl_mvm_link_changed(mvm, vif, link_conf, 368 355 LINK_CONTEXT_MODIFY_ACTIVE | ··· 365 362 true); 366 363 if (ret) 367 364 goto out; 365 + 366 + if (vif->type == NL80211_IFTYPE_STATION) 367 + iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif, 368 + link_conf, 369 + false); 368 370 369 371 /* 370 372 * Power state must be updated before quotas, ··· 1202 1194 1203 1195 mutex_lock(&mvm->mutex); 1204 1196 1205 - if (old_links == 0) { 1197 + /* If we're in RESTART flow, the default link wasn't added in 1198 + * drv_add_interface(), and link[0] doesn't point to it. 1199 + */ 1200 + if (old_links == 0 && !test_bit(IWL_MVM_STATUS_IN_HW_RESTART, 1201 + &mvm->status)) { 1206 1202 err = iwl_mvm_disable_link(mvm, vif, &vif->bss_conf); 1207 1203 if (err) 1208 1204 goto out_err;
+3 -3
drivers/net/wireless/intel/iwlwifi/mvm/scan.c
··· 1774 1774 &cp->channel_config[ch_cnt]; 1775 1775 1776 1776 u32 s_ssid_bitmap = 0, bssid_bitmap = 0, flags = 0; 1777 - u8 j, k, n_s_ssids = 0, n_bssids = 0; 1777 + u8 k, n_s_ssids = 0, n_bssids = 0; 1778 1778 u8 max_s_ssids, max_bssids; 1779 1779 bool force_passive = false, found = false, allow_passive = true, 1780 1780 unsolicited_probe_on_chan = false, psc_no_listen = false; ··· 1799 1799 cfg->v5.iter_count = 1; 1800 1800 cfg->v5.iter_interval = 0; 1801 1801 1802 - for (j = 0; j < params->n_6ghz_params; j++) { 1802 + for (u32 j = 0; j < params->n_6ghz_params; j++) { 1803 1803 s8 tmp_psd_20; 1804 1804 1805 1805 if (!(scan_6ghz_params[j].channel_idx == i)) ··· 1873 1873 * SSID. 1874 1874 * TODO: improve this logic 1875 1875 */ 1876 - for (j = 0; j < params->n_6ghz_params; j++) { 1876 + for (u32 j = 0; j < params->n_6ghz_params; j++) { 1877 1877 if (!(scan_6ghz_params[j].channel_idx == i)) 1878 1878 continue; 1879 1879
+2 -2
drivers/net/wireless/marvell/libertas/radiotap.h
··· 2 2 #include <net/ieee80211_radiotap.h> 3 3 4 4 struct tx_radiotap_hdr { 5 - struct ieee80211_radiotap_header hdr; 5 + struct ieee80211_radiotap_header_fixed hdr; 6 6 u8 rate; 7 7 u8 txpower; 8 8 u8 rts_retries; ··· 31 31 #define IEEE80211_FC_DSTODS 0x0300 32 32 33 33 struct rx_radiotap_hdr { 34 - struct ieee80211_radiotap_header hdr; 34 + struct ieee80211_radiotap_header_fixed hdr; 35 35 u8 flags; 36 36 u8 rate; 37 37 u8 antsignal;
+5 -2
drivers/net/wireless/mediatek/mt76/mcu.c
··· 84 84 mutex_lock(&dev->mcu.mutex); 85 85 86 86 if (dev->mcu_ops->mcu_skb_prepare_msg) { 87 + orig_skb = skb; 87 88 ret = dev->mcu_ops->mcu_skb_prepare_msg(dev, skb, cmd, &seq); 88 89 if (ret < 0) 89 90 goto out; 90 91 } 91 92 92 93 retry: 93 - orig_skb = skb_get(skb); 94 + /* orig skb might be needed for retry, mcu_skb_send_msg consumes it */ 95 + if (orig_skb) 96 + skb_get(orig_skb); 94 97 ret = dev->mcu_ops->mcu_skb_send_msg(dev, skb, cmd, &seq); 95 98 if (ret < 0) 96 99 goto out; ··· 108 105 do { 109 106 skb = mt76_mcu_get_response(dev, expires); 110 107 if (!skb && !test_bit(MT76_MCU_RESET, &dev->phy.state) && 111 - retry++ < dev->mcu_ops->max_retry) { 108 + orig_skb && retry++ < dev->mcu_ops->max_retry) { 112 109 dev_err(dev->dev, "Retry message %08x (seq %d)\n", 113 110 cmd, seq); 114 111 skb = orig_skb;
+2 -2
drivers/net/wireless/microchip/wilc1000/mon.c
··· 7 7 #include "cfg80211.h" 8 8 9 9 struct wilc_wfi_radiotap_hdr { 10 - struct ieee80211_radiotap_header hdr; 10 + struct ieee80211_radiotap_header_fixed hdr; 11 11 u8 rate; 12 12 } __packed; 13 13 14 14 struct wilc_wfi_radiotap_cb_hdr { 15 - struct ieee80211_radiotap_header hdr; 15 + struct ieee80211_radiotap_header_fixed hdr; 16 16 u8 rate; 17 17 u8 dump; 18 18 u16 tx_flags;
-1
drivers/net/wireless/realtek/rtlwifi/rtl8192du/sw.c
··· 352 352 {RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x8194, rtl92du_hal_cfg)}, 353 353 {RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x8111, rtl92du_hal_cfg)}, 354 354 {RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x0193, rtl92du_hal_cfg)}, 355 - {RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x8171, rtl92du_hal_cfg)}, 356 355 {RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0xe194, rtl92du_hal_cfg)}, 357 356 {RTL_USB_DEVICE(0x2019, 0xab2c, rtl92du_hal_cfg)}, 358 357 {RTL_USB_DEVICE(0x2019, 0xab2d, rtl92du_hal_cfg)},
-1
drivers/net/wireless/realtek/rtw88/usb.c
··· 771 771 u8 size, timeout; 772 772 u16 val16; 773 773 774 - rtw_write32_set(rtwdev, REG_RXDMA_AGG_PG_TH, BIT_EN_PRE_CALC); 775 774 rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN); 776 775 rtw_write8_clr(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7)); 777 776
+2
drivers/net/wireless/realtek/rtw89/coex.c
··· 6445 6445 6446 6446 /* todo DBCC related event */ 6447 6447 rtw89_debug(rtwdev, RTW89_DBG_BTC, "[BTC] wl_info phy_now=%d\n", phy_now); 6448 + rtw89_debug(rtwdev, RTW89_DBG_BTC, 6449 + "[BTC] rlink cnt_2g=%d cnt_5g=%d\n", cnt_2g, cnt_5g); 6448 6450 6449 6451 if (wl_rinfo->dbcc_en != rtwdev->dbcc_en) { 6450 6452 wl_rinfo->dbcc_chg = 1;
+41 -7
drivers/net/wireless/realtek/rtw89/pci.c
··· 3026 3026 pci_disable_device(pdev); 3027 3027 } 3028 3028 3029 - static void rtw89_pci_cfg_dac(struct rtw89_dev *rtwdev) 3029 + static bool rtw89_pci_chip_is_manual_dac(struct rtw89_dev *rtwdev) 3030 3030 { 3031 - struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv; 3032 3031 const struct rtw89_chip_info *chip = rtwdev->chip; 3033 - 3034 - if (!rtwpci->enable_dac) 3035 - return; 3036 3032 3037 3033 switch (chip->chip_id) { 3038 3034 case RTL8852A: 3039 3035 case RTL8852B: 3040 3036 case RTL8851B: 3041 3037 case RTL8852BT: 3042 - break; 3038 + return true; 3043 3039 default: 3044 - return; 3040 + return false; 3045 3041 } 3042 + } 3043 + 3044 + static bool rtw89_pci_is_dac_compatible_bridge(struct rtw89_dev *rtwdev) 3045 + { 3046 + struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv; 3047 + struct pci_dev *bridge = pci_upstream_bridge(rtwpci->pdev); 3048 + 3049 + if (!rtw89_pci_chip_is_manual_dac(rtwdev)) 3050 + return true; 3051 + 3052 + if (!bridge) 3053 + return false; 3054 + 3055 + switch (bridge->vendor) { 3056 + case PCI_VENDOR_ID_INTEL: 3057 + return true; 3058 + case PCI_VENDOR_ID_ASMEDIA: 3059 + if (bridge->device == 0x2806) 3060 + return true; 3061 + break; 3062 + } 3063 + 3064 + return false; 3065 + } 3066 + 3067 + static void rtw89_pci_cfg_dac(struct rtw89_dev *rtwdev) 3068 + { 3069 + struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv; 3070 + 3071 + if (!rtwpci->enable_dac) 3072 + return; 3073 + 3074 + if (!rtw89_pci_chip_is_manual_dac(rtwdev)) 3075 + return; 3046 3076 3047 3077 rtw89_pci_config_byte_set(rtwdev, RTW89_PCIE_L1_CTRL, RTW89_PCIE_BIT_EN_64BITS); 3048 3078 } ··· 3091 3061 goto err; 3092 3062 } 3093 3063 3064 + if (!rtw89_pci_is_dac_compatible_bridge(rtwdev)) 3065 + goto no_dac; 3066 + 3094 3067 ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(36)); 3095 3068 if (!ret) { 3096 3069 rtwpci->enable_dac = true; ··· 3106 3073 goto err_release_regions; 3107 3074 } 3108 3075 } 3076 + no_dac: 3109 3077 3110 3078 resource_len = pci_resource_len(pdev, bar_id); 3111 3079 rtwpci->mmap = pci_iomap(pdev, bar_id, resource_len);
+2 -2
drivers/net/wireless/virtual/mac80211_hwsim.c
··· 763 763 }; 764 764 765 765 struct hwsim_radiotap_hdr { 766 - struct ieee80211_radiotap_header hdr; 766 + struct ieee80211_radiotap_header_fixed hdr; 767 767 __le64 rt_tsft; 768 768 u8 rt_flags; 769 769 u8 rt_rate; ··· 772 772 } __packed; 773 773 774 774 struct hwsim_radiotap_ack_hdr { 775 - struct ieee80211_radiotap_header hdr; 775 + struct ieee80211_radiotap_header_fixed hdr; 776 776 u8 rt_flags; 777 777 u8 pad; 778 778 __le16 rt_channel;
+44
include/net/cfg80211.h
··· 6130 6130 struct wiphy_delayed_work *dwork); 6131 6131 6132 6132 /** 6133 + * wiphy_delayed_work_pending - Find out whether a wiphy delayable 6134 + * work item is currently pending. 6135 + * 6136 + * @wiphy: the wiphy, for debug purposes 6137 + * @dwork: the delayed work in question 6138 + * 6139 + * Return: true if timer is pending, false otherwise 6140 + * 6141 + * How wiphy_delayed_work_queue() works is by setting a timer which 6142 + * when it expires calls wiphy_work_queue() to queue the wiphy work. 6143 + * Because wiphy_delayed_work_queue() uses mod_timer(), if it is 6144 + * called twice and the second call happens before the first call 6145 + * deadline, the work will rescheduled for the second deadline and 6146 + * won't run before that. 6147 + * 6148 + * wiphy_delayed_work_pending() can be used to detect if calling 6149 + * wiphy_work_delayed_work_queue() would start a new work schedule 6150 + * or delayed a previous one. As seen below it cannot be used to 6151 + * detect precisely if the work has finished to execute nor if it 6152 + * is currently executing. 6153 + * 6154 + * CPU0 CPU1 6155 + * wiphy_delayed_work_queue(wk) 6156 + * mod_timer(wk->timer) 6157 + * wiphy_delayed_work_pending(wk) -> true 6158 + * 6159 + * [...] 6160 + * expire_timers(wk->timer) 6161 + * detach_timer(wk->timer) 6162 + * wiphy_delayed_work_pending(wk) -> false 6163 + * wk->timer->function() | 6164 + * wiphy_work_queue(wk) | delayed work pending 6165 + * list_add_tail() | returns false but 6166 + * queue_work(cfg80211_wiphy_work) | wk->func() has not 6167 + * | been run yet 6168 + * [...] | 6169 + * cfg80211_wiphy_work() | 6170 + * wk->func() V 6171 + * 6172 + */ 6173 + bool wiphy_delayed_work_pending(struct wiphy *wiphy, 6174 + struct wiphy_delayed_work *dwork); 6175 + 6176 + /** 6133 6177 * enum ieee80211_ap_reg_power - regulatory power for an Access Point 6134 6178 * 6135 6179 * @IEEE80211_REG_UNSET_AP: Access Point has no regulatory power mode
+21 -16
include/net/ieee80211_radiotap.h
··· 24 24 * struct ieee80211_radiotap_header - base radiotap header 25 25 */ 26 26 struct ieee80211_radiotap_header { 27 - /** 28 - * @it_version: radiotap version, always 0 29 - */ 30 - uint8_t it_version; 27 + __struct_group(ieee80211_radiotap_header_fixed, hdr, __packed, 28 + /** 29 + * @it_version: radiotap version, always 0 30 + */ 31 + uint8_t it_version; 31 32 32 - /** 33 - * @it_pad: padding (or alignment) 34 - */ 35 - uint8_t it_pad; 33 + /** 34 + * @it_pad: padding (or alignment) 35 + */ 36 + uint8_t it_pad; 36 37 37 - /** 38 - * @it_len: overall radiotap header length 39 - */ 40 - __le16 it_len; 38 + /** 39 + * @it_len: overall radiotap header length 40 + */ 41 + __le16 it_len; 41 42 42 - /** 43 - * @it_present: (first) present word 44 - */ 45 - __le32 it_present; 43 + /** 44 + * @it_present: (first) present word 45 + */ 46 + __le32 it_present; 47 + ); 46 48 47 49 /** 48 50 * @it_optional: all remaining presence bitmaps 49 51 */ 50 52 __le32 it_optional[]; 51 53 } __packed; 54 + 55 + static_assert(offsetof(struct ieee80211_radiotap_header, it_optional) == sizeof(struct ieee80211_radiotap_header_fixed), 56 + "struct member likely outside of __struct_group()"); 52 57 53 58 /* version is always 0 */ 54 59 #define PKTHDR_RADIOTAP_VERSION 0
+1 -1
include/net/ip_tunnels.h
··· 354 354 memset(fl4, 0, sizeof(*fl4)); 355 355 356 356 if (oif) { 357 - fl4->flowi4_l3mdev = l3mdev_master_upper_ifindex_by_index_rcu(net, oif); 357 + fl4->flowi4_l3mdev = l3mdev_master_upper_ifindex_by_index(net, oif); 358 358 /* Legacy VRF/l3mdev use case */ 359 359 fl4->flowi4_oif = fl4->flowi4_l3mdev ? 0 : oif; 360 360 }
+11 -7
net/bluetooth/hci_sync.c
··· 206 206 return ERR_PTR(err); 207 207 } 208 208 209 + /* If command return a status event skb will be set to NULL as there are 210 + * no parameters. 211 + */ 212 + if (!skb) 213 + return ERR_PTR(-ENODATA); 214 + 209 215 return skb; 210 216 } 211 217 EXPORT_SYMBOL(__hci_cmd_sync_sk); ··· 261 255 u8 status; 262 256 263 257 skb = __hci_cmd_sync_sk(hdev, opcode, plen, param, event, timeout, sk); 258 + 259 + /* If command return a status event, skb will be set to -ENODATA */ 260 + if (skb == ERR_PTR(-ENODATA)) 261 + return 0; 262 + 264 263 if (IS_ERR(skb)) { 265 264 if (!event) 266 265 bt_dev_err(hdev, "Opcode 0x%4.4x failed: %ld", opcode, 267 266 PTR_ERR(skb)); 268 267 return PTR_ERR(skb); 269 268 } 270 - 271 - /* If command return a status event skb will be set to NULL as there are 272 - * no parameters, in case of failure IS_ERR(skb) would have be set to 273 - * the actual error would be found with PTR_ERR(skb). 274 - */ 275 - if (!skb) 276 - return 0; 277 269 278 270 status = skb->data[0]; 279 271
+4
net/core/dev.c
··· 3639 3639 return 0; 3640 3640 3641 3641 if (features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)) { 3642 + if (vlan_get_protocol(skb) == htons(ETH_P_IPV6) && 3643 + skb_network_header_len(skb) != sizeof(struct ipv6hdr)) 3644 + goto sw_checksum; 3642 3645 switch (skb->csum_offset) { 3643 3646 case offsetof(struct tcphdr, check): 3644 3647 case offsetof(struct udphdr, check): ··· 3649 3646 } 3650 3647 } 3651 3648 3649 + sw_checksum: 3652 3650 return skb_checksum_help(skb); 3653 3651 } 3654 3652 EXPORT_SYMBOL(skb_csum_hwoffload_help);
+2 -2
net/core/rtnetlink.c
··· 2032 2032 [IFLA_NUM_TX_QUEUES] = { .type = NLA_U32 }, 2033 2033 [IFLA_NUM_RX_QUEUES] = { .type = NLA_U32 }, 2034 2034 [IFLA_GSO_MAX_SEGS] = { .type = NLA_U32 }, 2035 - [IFLA_GSO_MAX_SIZE] = { .type = NLA_U32 }, 2035 + [IFLA_GSO_MAX_SIZE] = NLA_POLICY_MIN(NLA_U32, MAX_TCP_HEADER + 1), 2036 2036 [IFLA_PHYS_PORT_ID] = { .type = NLA_BINARY, .len = MAX_PHYS_ITEM_ID_LEN }, 2037 2037 [IFLA_CARRIER_CHANGES] = { .type = NLA_U32 }, /* ignored */ 2038 2038 [IFLA_PHYS_SWITCH_ID] = { .type = NLA_BINARY, .len = MAX_PHYS_ITEM_ID_LEN }, ··· 2057 2057 [IFLA_TSO_MAX_SIZE] = { .type = NLA_REJECT }, 2058 2058 [IFLA_TSO_MAX_SEGS] = { .type = NLA_REJECT }, 2059 2059 [IFLA_ALLMULTI] = { .type = NLA_REJECT }, 2060 - [IFLA_GSO_IPV4_MAX_SIZE] = { .type = NLA_U32 }, 2060 + [IFLA_GSO_IPV4_MAX_SIZE] = NLA_POLICY_MIN(NLA_U32, MAX_TCP_HEADER + 1), 2061 2061 [IFLA_GRO_IPV4_MAX_SIZE] = { .type = NLA_U32 }, 2062 2062 }; 2063 2063
+1 -1
net/ipv4/ip_tunnel.c
··· 218 218 219 219 ip_tunnel_flags_copy(flags, parms->i_flags); 220 220 221 - hlist_for_each_entry_rcu(t, head, hash_node) { 221 + hlist_for_each_entry_rcu(t, head, hash_node, lockdep_rtnl_is_held()) { 222 222 if (local == t->parms.iph.saddr && 223 223 remote == t->parms.iph.daddr && 224 224 link == READ_ONCE(t->parms.link) &&
+7 -8
net/ipv6/netfilter/nf_reject_ipv6.c
··· 268 268 void nf_send_reset6(struct net *net, struct sock *sk, struct sk_buff *oldskb, 269 269 int hook) 270 270 { 271 - struct sk_buff *nskb; 272 - struct tcphdr _otcph; 273 - const struct tcphdr *otcph; 274 - unsigned int otcplen, hh_len; 275 271 const struct ipv6hdr *oip6h = ipv6_hdr(oldskb); 276 272 struct dst_entry *dst = NULL; 273 + const struct tcphdr *otcph; 274 + struct sk_buff *nskb; 275 + struct tcphdr _otcph; 276 + unsigned int otcplen; 277 277 struct flowi6 fl6; 278 278 279 279 if ((!(ipv6_addr_type(&oip6h->saddr) & IPV6_ADDR_UNICAST)) || ··· 312 312 if (IS_ERR(dst)) 313 313 return; 314 314 315 - hh_len = (dst->dev->hard_header_len + 15)&~15; 316 - nskb = alloc_skb(hh_len + 15 + dst->header_len + sizeof(struct ipv6hdr) 317 - + sizeof(struct tcphdr) + dst->trailer_len, 315 + nskb = alloc_skb(LL_MAX_HEADER + sizeof(struct ipv6hdr) + 316 + sizeof(struct tcphdr) + dst->trailer_len, 318 317 GFP_ATOMIC); 319 318 320 319 if (!nskb) { ··· 326 327 327 328 nskb->mark = fl6.flowi6_mark; 328 329 329 - skb_reserve(nskb, hh_len + dst->header_len); 330 + skb_reserve(nskb, LL_MAX_HEADER); 330 331 nf_reject_ip6hdr_put(nskb, oldskb, IPPROTO_TCP, ip6_dst_hoplimit(dst)); 331 332 nf_reject_ip6_tcphdr_put(nskb, oldskb, otcph, otcplen); 332 333
+1 -1
net/mac80211/Kconfig
··· 96 96 97 97 config MAC80211_MESSAGE_TRACING 98 98 bool "Trace all mac80211 debug messages" 99 - depends on MAC80211 99 + depends on MAC80211 && TRACING 100 100 help 101 101 Select this option to have mac80211 register the 102 102 mac80211_msg trace subsystem with tracepoints to
+16 -9
net/mac80211/cfg.c
··· 3046 3046 enum nl80211_tx_power_setting txp_type = type; 3047 3047 bool update_txp_type = false; 3048 3048 bool has_monitor = false; 3049 + int old_power = local->user_power_level; 3049 3050 3050 3051 lockdep_assert_wiphy(local->hw.wiphy); 3051 3052 ··· 3129 3128 } 3130 3129 } 3131 3130 3131 + if (local->emulate_chanctx && 3132 + (old_power != local->user_power_level)) 3133 + ieee80211_hw_conf_chan(local); 3134 + 3132 3135 return 0; 3133 3136 } 3134 3137 ··· 3143 3138 struct ieee80211_local *local = wiphy_priv(wiphy); 3144 3139 struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 3145 3140 3146 - if (local->ops->get_txpower) 3141 + if (local->ops->get_txpower && 3142 + (sdata->flags & IEEE80211_SDATA_IN_DRIVER)) 3147 3143 return drv_get_txpower(local, sdata, dbm); 3148 3144 3149 3145 if (local->emulate_chanctx) ··· 4832 4826 ieee80211_color_change_finalize(link); 4833 4827 } 4834 4828 4835 - void ieee80211_color_collision_detection_work(struct work_struct *work) 4829 + void ieee80211_color_collision_detection_work(struct wiphy *wiphy, 4830 + struct wiphy_work *work) 4836 4831 { 4837 - struct delayed_work *delayed_work = to_delayed_work(work); 4838 4832 struct ieee80211_link_data *link = 4839 - container_of(delayed_work, struct ieee80211_link_data, 4840 - color_collision_detect_work); 4833 + container_of(work, struct ieee80211_link_data, 4834 + color_collision_detect_work.work); 4841 4835 struct ieee80211_sub_if_data *sdata = link->sdata; 4842 4836 4843 4837 cfg80211_obss_color_collision_notify(sdata->dev, link->color_bitmap, ··· 4890 4884 return; 4891 4885 } 4892 4886 4893 - if (delayed_work_pending(&link->color_collision_detect_work)) { 4887 + if (wiphy_delayed_work_pending(sdata->local->hw.wiphy, 4888 + &link->color_collision_detect_work)) { 4894 4889 rcu_read_unlock(); 4895 4890 return; 4896 4891 } ··· 4900 4893 /* queue the color collision detection event every 500 ms in order to 4901 4894 * avoid sending too much netlink messages to userspace. 4902 4895 */ 4903 - ieee80211_queue_delayed_work(&sdata->local->hw, 4904 - &link->color_collision_detect_work, 4905 - msecs_to_jiffies(500)); 4896 + wiphy_delayed_work_queue(sdata->local->hw.wiphy, 4897 + &link->color_collision_detect_work, 4898 + msecs_to_jiffies(500)); 4906 4899 4907 4900 rcu_read_unlock(); 4908 4901 }
+6 -4
net/mac80211/ieee80211_i.h
··· 892 892 /* temporary data for search algorithm etc. */ 893 893 struct ieee80211_chan_req req; 894 894 895 - struct ieee80211_chanctx_conf conf; 896 - 897 895 bool radar_detected; 896 + 897 + /* MUST be last - ends in a flexible-array member. */ 898 + struct ieee80211_chanctx_conf conf; 898 899 }; 899 900 900 901 struct mac80211_qos_map { ··· 1054 1053 } csa; 1055 1054 1056 1055 struct wiphy_work color_change_finalize_work; 1057 - struct delayed_work color_collision_detect_work; 1056 + struct wiphy_delayed_work color_collision_detect_work; 1058 1057 u64 color_bitmap; 1059 1058 1060 1059 /* context reservation -- protected with wiphy mutex */ ··· 2006 2005 /* color change handling */ 2007 2006 void ieee80211_color_change_finalize_work(struct wiphy *wiphy, 2008 2007 struct wiphy_work *work); 2009 - void ieee80211_color_collision_detection_work(struct work_struct *work); 2008 + void ieee80211_color_collision_detection_work(struct wiphy *wiphy, 2009 + struct wiphy_work *work); 2010 2010 2011 2011 /* interface handling */ 2012 2012 #define MAC80211_SUPPORTED_FEATURES_TX (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \
+25 -17
net/mac80211/key.c
··· 987 987 } 988 988 } 989 989 990 + static void 991 + ieee80211_key_iter(struct ieee80211_hw *hw, 992 + struct ieee80211_vif *vif, 993 + struct ieee80211_key *key, 994 + void (*iter)(struct ieee80211_hw *hw, 995 + struct ieee80211_vif *vif, 996 + struct ieee80211_sta *sta, 997 + struct ieee80211_key_conf *key, 998 + void *data), 999 + void *iter_data) 1000 + { 1001 + /* skip keys of station in removal process */ 1002 + if (key->sta && key->sta->removed) 1003 + return; 1004 + if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) 1005 + return; 1006 + iter(hw, vif, key->sta ? &key->sta->sta : NULL, 1007 + &key->conf, iter_data); 1008 + } 1009 + 990 1010 void ieee80211_iter_keys(struct ieee80211_hw *hw, 991 1011 struct ieee80211_vif *vif, 992 1012 void (*iter)(struct ieee80211_hw *hw, ··· 1025 1005 if (vif) { 1026 1006 sdata = vif_to_sdata(vif); 1027 1007 list_for_each_entry_safe(key, tmp, &sdata->key_list, list) 1028 - iter(hw, &sdata->vif, 1029 - key->sta ? &key->sta->sta : NULL, 1030 - &key->conf, iter_data); 1008 + ieee80211_key_iter(hw, vif, key, iter, iter_data); 1031 1009 } else { 1032 1010 list_for_each_entry(sdata, &local->interfaces, list) 1033 1011 list_for_each_entry_safe(key, tmp, 1034 1012 &sdata->key_list, list) 1035 - iter(hw, &sdata->vif, 1036 - key->sta ? &key->sta->sta : NULL, 1037 - &key->conf, iter_data); 1013 + ieee80211_key_iter(hw, &sdata->vif, key, 1014 + iter, iter_data); 1038 1015 } 1039 1016 } 1040 1017 EXPORT_SYMBOL(ieee80211_iter_keys); ··· 1048 1031 { 1049 1032 struct ieee80211_key *key; 1050 1033 1051 - list_for_each_entry_rcu(key, &sdata->key_list, list) { 1052 - /* skip keys of station in removal process */ 1053 - if (key->sta && key->sta->removed) 1054 - continue; 1055 - if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) 1056 - continue; 1057 - 1058 - iter(hw, &sdata->vif, 1059 - key->sta ? &key->sta->sta : NULL, 1060 - &key->conf, iter_data); 1061 - } 1034 + list_for_each_entry_rcu(key, &sdata->key_list, list) 1035 + ieee80211_key_iter(hw, &sdata->vif, key, iter, iter_data); 1062 1036 } 1063 1037 1064 1038 void ieee80211_iter_keys_rcu(struct ieee80211_hw *hw,
+4 -3
net/mac80211/link.c
··· 41 41 ieee80211_csa_finalize_work); 42 42 wiphy_work_init(&link->color_change_finalize_work, 43 43 ieee80211_color_change_finalize_work); 44 - INIT_DELAYED_WORK(&link->color_collision_detect_work, 45 - ieee80211_color_collision_detection_work); 44 + wiphy_delayed_work_init(&link->color_collision_detect_work, 45 + ieee80211_color_collision_detection_work); 46 46 INIT_LIST_HEAD(&link->assigned_chanctx_list); 47 47 INIT_LIST_HEAD(&link->reserved_chanctx_list); 48 48 wiphy_delayed_work_init(&link->dfs_cac_timer_work, ··· 72 72 if (link->sdata->vif.type == NL80211_IFTYPE_STATION) 73 73 ieee80211_mgd_stop_link(link); 74 74 75 - cancel_delayed_work_sync(&link->color_collision_detect_work); 75 + wiphy_delayed_work_cancel(link->sdata->local->hw.wiphy, 76 + &link->color_collision_detect_work); 76 77 wiphy_work_cancel(link->sdata->local->hw.wiphy, 77 78 &link->color_change_finalize_work); 78 79 wiphy_work_cancel(link->sdata->local->hw.wiphy,
+2
net/mac80211/main.c
··· 167 167 } 168 168 169 169 power = ieee80211_chandef_max_power(&chandef); 170 + if (local->user_power_level != IEEE80211_UNSET_POWER_LEVEL) 171 + power = min(local->user_power_level, power); 170 172 171 173 rcu_read_lock(); 172 174 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
+2
net/mptcp/protocol.c
··· 2864 2864 if (unlikely(!net->mib.mptcp_statistics) && !mptcp_mib_alloc(net)) 2865 2865 return -ENOMEM; 2866 2866 2867 + rcu_read_lock(); 2867 2868 ret = mptcp_init_sched(mptcp_sk(sk), 2868 2869 mptcp_sched_find(mptcp_get_scheduler(net))); 2870 + rcu_read_unlock(); 2869 2871 if (ret) 2870 2872 return ret; 2871 2873
+3
net/netfilter/nft_payload.c
··· 904 904 ((priv->base != NFT_PAYLOAD_TRANSPORT_HEADER && 905 905 priv->base != NFT_PAYLOAD_INNER_HEADER) || 906 906 skb->ip_summed != CHECKSUM_PARTIAL)) { 907 + if (offset + priv->len > skb->len) 908 + goto err; 909 + 907 910 fsum = skb_checksum(skb, offset, priv->len, 0); 908 911 tsum = csum_partial(src, priv->len, 0); 909 912
+1 -1
net/netfilter/x_tables.c
··· 1269 1269 1270 1270 /* and once again: */ 1271 1271 list_for_each_entry(t, &xt_net->tables[af], list) 1272 - if (strcmp(t->name, name) == 0) 1272 + if (strcmp(t->name, name) == 0 && owner == t->me) 1273 1273 return t; 1274 1274 1275 1275 module_put(owner);
+1
net/sched/cls_api.c
··· 1518 1518 return 0; 1519 1519 1520 1520 err_dev_insert: 1521 + tcf_block_offload_unbind(block, q, ei); 1521 1522 err_block_offload_bind: 1522 1523 tcf_chain0_head_change_cb_del(block, ei); 1523 1524 err_chain0_head_change_cb_add:
+1 -1
net/sched/sch_api.c
··· 791 791 drops = max_t(int, n, 0); 792 792 rcu_read_lock(); 793 793 while ((parentid = sch->parent)) { 794 - if (TC_H_MAJ(parentid) == TC_H_MAJ(TC_H_INGRESS)) 794 + if (parentid == TC_H_ROOT) 795 795 break; 796 796 797 797 if (sch->flags & TCQ_F_NOPARENT)
+8
net/wireless/core.c
··· 1236 1236 /* deleted from the list, so can't be found from nl80211 any more */ 1237 1237 cqm_config = rcu_access_pointer(wdev->cqm_config); 1238 1238 kfree_rcu(cqm_config, rcu_head); 1239 + RCU_INIT_POINTER(wdev->cqm_config, NULL); 1239 1240 1240 1241 /* 1241 1242 * Ensure that all events have been processed and ··· 1704 1703 wiphy_work_flush(wiphy, &dwork->work); 1705 1704 } 1706 1705 EXPORT_SYMBOL_GPL(wiphy_delayed_work_flush); 1706 + 1707 + bool wiphy_delayed_work_pending(struct wiphy *wiphy, 1708 + struct wiphy_delayed_work *dwork) 1709 + { 1710 + return timer_pending(&dwork->timer); 1711 + } 1712 + EXPORT_SYMBOL_GPL(wiphy_delayed_work_pending); 1707 1713 1708 1714 static int __init cfg80211_init(void) 1709 1715 {
+4
net/wireless/scan.c
··· 3050 3050 freq = ieee80211_channel_to_freq_khz(ap_info->channel, band); 3051 3051 data.channel = ieee80211_get_channel_khz(wiphy, freq); 3052 3052 3053 + /* Skip if RNR element specifies an unsupported channel */ 3054 + if (!data.channel) 3055 + continue; 3056 + 3053 3057 /* Skip if BSS entry generated from MBSSID or DIRECT source 3054 3058 * frame data available already. 3055 3059 */
+14
tools/testing/selftests/net/forwarding/ip6gre_flat.sh
··· 8 8 ALL_TESTS=" 9 9 gre_flat 10 10 gre_mtu_change 11 + gre_flat_remote_change 11 12 " 12 13 13 14 NUM_NETIFS=6 ··· 43 42 gre_mtu_change() 44 43 { 45 44 test_mtu_change 45 + } 46 + 47 + gre_flat_remote_change() 48 + { 49 + flat_remote_change 50 + 51 + test_traffic_ip4ip6 "GRE flat IPv4-in-IPv6 (new remote)" 52 + test_traffic_ip6ip6 "GRE flat IPv6-in-IPv6 (new remote)" 53 + 54 + flat_remote_restore 55 + 56 + test_traffic_ip4ip6 "GRE flat IPv4-in-IPv6 (old remote)" 57 + test_traffic_ip6ip6 "GRE flat IPv6-in-IPv6 (old remote)" 46 58 } 47 59 48 60 cleanup()
+14
tools/testing/selftests/net/forwarding/ip6gre_flat_key.sh
··· 8 8 ALL_TESTS=" 9 9 gre_flat 10 10 gre_mtu_change 11 + gre_flat_remote_change 11 12 " 12 13 13 14 NUM_NETIFS=6 ··· 43 42 gre_mtu_change() 44 43 { 45 44 test_mtu_change 45 + } 46 + 47 + gre_flat_remote_change() 48 + { 49 + flat_remote_change 50 + 51 + test_traffic_ip4ip6 "GRE flat IPv4-in-IPv6 with key (new remote)" 52 + test_traffic_ip6ip6 "GRE flat IPv6-in-IPv6 with key (new remote)" 53 + 54 + flat_remote_restore 55 + 56 + test_traffic_ip4ip6 "GRE flat IPv4-in-IPv6 with key (old remote)" 57 + test_traffic_ip6ip6 "GRE flat IPv6-in-IPv6 with key (old remote)" 46 58 } 47 59 48 60 cleanup()
+14
tools/testing/selftests/net/forwarding/ip6gre_flat_keys.sh
··· 8 8 ALL_TESTS=" 9 9 gre_flat 10 10 gre_mtu_change 11 + gre_flat_remote_change 11 12 " 12 13 13 14 NUM_NETIFS=6 ··· 43 42 gre_mtu_change() 44 43 { 45 44 test_mtu_change gre 45 + } 46 + 47 + gre_flat_remote_change() 48 + { 49 + flat_remote_change 50 + 51 + test_traffic_ip4ip6 "GRE flat IPv4-in-IPv6 with ikey/okey (new remote)" 52 + test_traffic_ip6ip6 "GRE flat IPv6-in-IPv6 with ikey/okey (new remote)" 53 + 54 + flat_remote_restore 55 + 56 + test_traffic_ip4ip6 "GRE flat IPv4-in-IPv6 with ikey/okey (old remote)" 57 + test_traffic_ip6ip6 "GRE flat IPv6-in-IPv6 with ikey/okey (old remote)" 46 58 } 47 59 48 60 cleanup()
+14
tools/testing/selftests/net/forwarding/ip6gre_hier.sh
··· 8 8 ALL_TESTS=" 9 9 gre_hier 10 10 gre_mtu_change 11 + gre_hier_remote_change 11 12 " 12 13 13 14 NUM_NETIFS=6 ··· 43 42 gre_mtu_change() 44 43 { 45 44 test_mtu_change gre 45 + } 46 + 47 + gre_hier_remote_change() 48 + { 49 + hier_remote_change 50 + 51 + test_traffic_ip4ip6 "GRE hierarchical IPv4-in-IPv6 (new remote)" 52 + test_traffic_ip6ip6 "GRE hierarchical IPv6-in-IPv6 (new remote)" 53 + 54 + hier_remote_restore 55 + 56 + test_traffic_ip4ip6 "GRE hierarchical IPv4-in-IPv6 (old remote)" 57 + test_traffic_ip6ip6 "GRE hierarchical IPv6-in-IPv6 (old remote)" 46 58 } 47 59 48 60 cleanup()
+14
tools/testing/selftests/net/forwarding/ip6gre_hier_key.sh
··· 8 8 ALL_TESTS=" 9 9 gre_hier 10 10 gre_mtu_change 11 + gre_hier_remote_change 11 12 " 12 13 13 14 NUM_NETIFS=6 ··· 43 42 gre_mtu_change() 44 43 { 45 44 test_mtu_change gre 45 + } 46 + 47 + gre_hier_remote_change() 48 + { 49 + hier_remote_change 50 + 51 + test_traffic_ip4ip6 "GRE hierarchical IPv4-in-IPv6 with key (new remote)" 52 + test_traffic_ip6ip6 "GRE hierarchical IPv6-in-IPv6 with key (new remote)" 53 + 54 + hier_remote_restore 55 + 56 + test_traffic_ip4ip6 "GRE hierarchical IPv4-in-IPv6 with key (old remote)" 57 + test_traffic_ip6ip6 "GRE hierarchical IPv6-in-IPv6 with key (old remote)" 46 58 } 47 59 48 60 cleanup()
+14
tools/testing/selftests/net/forwarding/ip6gre_hier_keys.sh
··· 8 8 ALL_TESTS=" 9 9 gre_hier 10 10 gre_mtu_change 11 + gre_hier_remote_change 11 12 " 12 13 13 14 NUM_NETIFS=6 ··· 43 42 gre_mtu_change() 44 43 { 45 44 test_mtu_change gre 45 + } 46 + 47 + gre_hier_remote_change() 48 + { 49 + hier_remote_change 50 + 51 + test_traffic_ip4ip6 "GRE hierarchical IPv4-in-IPv6 with ikey/okey (new remote)" 52 + test_traffic_ip6ip6 "GRE hierarchical IPv6-in-IPv6 with ikey/okey (new remote)" 53 + 54 + hier_remote_restore 55 + 56 + test_traffic_ip4ip6 "GRE hierarchical IPv4-in-IPv6 with ikey/okey (old remote)" 57 + test_traffic_ip6ip6 "GRE hierarchical IPv6-in-IPv6 with ikey/okey (old remote)" 46 58 } 47 59 48 60 cleanup()
+80
tools/testing/selftests/net/forwarding/ip6gre_lib.sh
··· 436 436 check_err $? 437 437 log_test "ping GRE IPv6, packet size 1800 after MTU change" 438 438 } 439 + 440 + topo_flat_remote_change() 441 + { 442 + local old1=$1; shift 443 + local new1=$1; shift 444 + local old2=$1; shift 445 + local new2=$1; shift 446 + 447 + ip link set dev g1a type ip6gre local $new1 remote $new2 448 + __addr_add_del g1a add "$new1/128" 449 + __addr_add_del g1a del "$old1/128" 450 + ip -6 route add $new2/128 via 2001:db8:10::2 451 + ip -6 route del $old2/128 452 + 453 + ip link set dev g2a type ip6gre local $new2 remote $new1 454 + __addr_add_del g2a add "$new2/128" 455 + __addr_add_del g2a del "$old2/128" 456 + ip -6 route add vrf v$ol2 $new1/128 via 2001:db8:10::1 457 + ip -6 route del vrf v$ol2 $old1/128 458 + } 459 + 460 + flat_remote_change() 461 + { 462 + local old1=2001:db8:3::1 463 + local new1=2001:db8:3::10 464 + local old2=2001:db8:3::2 465 + local new2=2001:db8:3::20 466 + 467 + topo_flat_remote_change $old1 $new1 $old2 $new2 468 + } 469 + 470 + flat_remote_restore() 471 + { 472 + local old1=2001:db8:3::10 473 + local new1=2001:db8:3::1 474 + local old2=2001:db8:3::20 475 + local new2=2001:db8:3::2 476 + 477 + topo_flat_remote_change $old1 $new1 $old2 $new2 478 + } 479 + 480 + topo_hier_remote_change() 481 + { 482 + local old1=$1; shift 483 + local new1=$1; shift 484 + local old2=$1; shift 485 + local new2=$1; shift 486 + 487 + __addr_add_del dummy1 del "$old1/64" 488 + __addr_add_del dummy1 add "$new1/64" 489 + ip link set dev g1a type ip6gre local $new1 remote $new2 490 + ip -6 route add vrf v$ul1 $new2/128 via 2001:db8:10::2 491 + ip -6 route del vrf v$ul1 $old2/128 492 + 493 + __addr_add_del dummy2 del "$old2/64" 494 + __addr_add_del dummy2 add "$new2/64" 495 + ip link set dev g2a type ip6gre local $new2 remote $new1 496 + ip -6 route add vrf v$ul2 $new1/128 via 2001:db8:10::1 497 + ip -6 route del vrf v$ul2 $old1/128 498 + } 499 + 500 + hier_remote_change() 501 + { 502 + local old1=2001:db8:3::1 503 + local new1=2001:db8:3::10 504 + local old2=2001:db8:3::2 505 + local new2=2001:db8:3::20 506 + 507 + topo_hier_remote_change $old1 $new1 $old2 $new2 508 + } 509 + 510 + hier_remote_restore() 511 + { 512 + local old1=2001:db8:3::10 513 + local new1=2001:db8:3::1 514 + local old2=2001:db8:3::20 515 + local new2=2001:db8:3::2 516 + 517 + topo_hier_remote_change $old1 $new1 $old2 $new2 518 + }
+9
tools/testing/selftests/net/mptcp/mptcp_connect.sh
··· 259 259 mptcp_lib_ns_init disabled_ns 260 260 261 261 print_larger_title "New MPTCP socket can be blocked via sysctl" 262 + 263 + # mainly to cover more code 264 + if ! ip netns exec ${disabled_ns} sysctl net.mptcp >/dev/null; then 265 + mptcp_lib_pr_fail "not able to list net.mptcp sysctl knobs" 266 + mptcp_lib_result_fail "not able to list net.mptcp sysctl knobs" 267 + ret=${KSFT_FAIL} 268 + return 1 269 + fi 270 + 262 271 # net.mptcp.enabled should be enabled by default 263 272 if [ "$(ip netns exec ${disabled_ns} sysctl net.mptcp.enabled | awk '{ print $3 }')" -ne 1 ]; then 264 273 mptcp_lib_pr_fail "net.mptcp.enabled sysctl is not 1 by default"
+3 -3
tools/testing/selftests/net/netfilter/conntrack_dump_flush.c
··· 98 98 char buf[MNL_SOCKET_BUFFER_SIZE]; 99 99 struct nlmsghdr *rplnlh; 100 100 unsigned int portid; 101 - int err, ret; 101 + int ret; 102 102 103 103 portid = mnl_socket_get_portid(sock); 104 104 ··· 217 217 struct nfgenmsg *nfh; 218 218 struct nlattr *nest; 219 219 unsigned int portid; 220 - int err, ret; 220 + int ret; 221 221 222 222 portid = mnl_socket_get_portid(sock); 223 223 ··· 264 264 struct nfgenmsg *nfh; 265 265 struct nlattr *nest; 266 266 unsigned int portid; 267 - int err, ret; 267 + int ret; 268 268 269 269 portid = mnl_socket_get_portid(sock); 270 270
+21 -18
tools/testing/selftests/net/netfilter/nft_flowtable.sh
··· 71 71 lmtu=1500 72 72 rmtu=2000 73 73 74 + filesize=$((2 * 1024 * 1024)) 75 + 74 76 usage(){ 75 77 echo "nft_flowtable.sh [OPTIONS]" 76 78 echo ··· 83 81 exit 1 84 82 } 85 83 86 - while getopts "o:l:r:" o 84 + while getopts "o:l:r:s:" o 87 85 do 88 86 case $o in 89 87 o) omtu=$OPTARG;; 90 88 l) lmtu=$OPTARG;; 91 89 r) rmtu=$OPTARG;; 90 + s) filesize=$OPTARG;; 92 91 *) usage;; 93 92 esac 94 93 done ··· 220 217 221 218 make_file() 222 219 { 223 - name=$1 220 + name="$1" 221 + sz="$2" 224 222 225 - SIZE=$((RANDOM % (1024 * 128))) 226 - SIZE=$((SIZE + (1024 * 8))) 227 - TSIZE=$((SIZE * 1024)) 228 - 229 - dd if=/dev/urandom of="$name" bs=1024 count=$SIZE 2> /dev/null 230 - 231 - SIZE=$((RANDOM % 1024)) 232 - SIZE=$((SIZE + 128)) 233 - TSIZE=$((TSIZE + SIZE)) 234 - dd if=/dev/urandom conf=notrunc of="$name" bs=1 count=$SIZE 2> /dev/null 223 + head -c "$sz" < /dev/urandom > "$name" 235 224 } 236 225 237 226 check_counters() ··· 241 246 local fs 242 247 fs=$(du -sb "$nsin") 243 248 local max_orig=${fs%%/*} 244 - local max_repl=$((max_orig/4)) 249 + local max_repl=$((max_orig)) 245 250 246 251 # flowtable fastpath should bypass normal routing one, i.e. the counters in forward hook 247 252 # should always be lower than the size of the transmitted file (max_orig). 248 253 if [ "$orig_cnt" -gt "$max_orig" ];then 249 - echo "FAIL: $what: original counter $orig_cnt exceeds expected value $max_orig" 1>&2 254 + echo "FAIL: $what: original counter $orig_cnt exceeds expected value $max_orig, reply counter $repl_cnt" 1>&2 250 255 ret=1 251 256 ok=0 252 257 fi 253 258 254 259 if [ "$repl_cnt" -gt $max_repl ];then 255 - echo "FAIL: $what: reply counter $repl_cnt exceeds expected value $max_repl" 1>&2 260 + echo "FAIL: $what: reply counter $repl_cnt exceeds expected value $max_repl, original counter $orig_cnt" 1>&2 256 261 ret=1 257 262 ok=0 258 263 fi ··· 450 455 return $lret 451 456 } 452 457 453 - make_file "$nsin" 458 + make_file "$nsin" "$filesize" 454 459 455 460 # First test: 456 461 # No PMTU discovery, nsr1 is expected to fragment packets from ns1 to ns2 as needed. ··· 659 664 l=$(((RANDOM%mtu) + low)) 660 665 r=$(((RANDOM%mtu) + low)) 661 666 662 - echo "re-run with random mtus: -o $o -l $l -r $r" 663 - $0 -o "$o" -l "$l" -r "$r" 667 + MINSIZE=$((2 * 1000 * 1000)) 668 + MAXSIZE=$((64 * 1000 * 1000)) 669 + 670 + filesize=$(((RANDOM * RANDOM) % MAXSIZE)) 671 + if [ "$filesize" -lt "$MINSIZE" ]; then 672 + filesize=$((filesize+MINSIZE)) 673 + fi 674 + 675 + echo "re-run with random mtus and file size: -o $o -l $l -r $r -s $filesize" 676 + $0 -o "$o" -l "$l" -r "$r" -s "$filesize" 664 677 fi 665 678 666 679 exit $ret