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

Configure Feed

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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from David Miller:

1) Fix non-blocking connect() in x25, from Martin Schiller.

2) Fix spurious decryption errors in kTLS, from Jakub Kicinski.

3) Netfilter use-after-free in mtype_destroy(), from Cong Wang.

4) Limit size of TSO packets properly in lan78xx driver, from Eric
Dumazet.

5) r8152 probe needs an endpoint sanity check, from Johan Hovold.

6) Prevent looping in tcp_bpf_unhash() during sockmap/tls free, from
John Fastabend.

7) hns3 needs short frames padded on transmit, from Yunsheng Lin.

8) Fix netfilter ICMP header corruption, from Eyal Birger.

9) Fix soft lockup when low on memory in hns3, from Yonglong Liu.

10) Fix NTUPLE firmware command failures in bnxt_en, from Michael Chan.

11) Fix memory leak in act_ctinfo, from Eric Dumazet.

* git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (91 commits)
cxgb4: reject overlapped queues in TC-MQPRIO offload
cxgb4: fix Tx multi channel port rate limit
net: sched: act_ctinfo: fix memory leak
bnxt_en: Do not treat DSN (Digital Serial Number) read failure as fatal.
bnxt_en: Fix ipv6 RFS filter matching logic.
bnxt_en: Fix NTUPLE firmware command failures.
net: systemport: Fixed queue mapping in internal ring map
net: dsa: bcm_sf2: Configure IMP port for 2Gb/sec
net: dsa: sja1105: Don't error out on disabled ports with no phy-mode
net: phy: dp83867: Set FORCE_LINK_GOOD to default after reset
net: hns: fix soft lockup when there is not enough memory
net: avoid updating qdisc_xmit_lock_key in netdev_update_lockdep_key()
net/sched: act_ife: initalize ife->metalist earlier
netfilter: nat: fix ICMP header corruption on ICMP errors
net: wan: lapbether.c: Use built-in RCU list checking
netfilter: nf_tables: fix flowtable list del corruption
netfilter: nf_tables: fix memory leak in nf_tables_parse_netdev_hooks()
netfilter: nf_tables: remove WARN and add NLA_STRING upper limits
netfilter: nft_tunnel: ERSPAN_VERSION must not be null
netfilter: nft_tunnel: fix null-attribute check
...

+773 -377
+1
.mailmap
··· 99 99 Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@google.com> 100 100 Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@motorola.com> 101 101 Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk.kim@samsung.com> 102 + Jakub Kicinski <kuba@kernel.org> <jakub.kicinski@netronome.com> 102 103 James Bottomley <jejb@mulgrave.(none)> 103 104 James Bottomley <jejb@titanic.il.steeleye.com> 104 105 James E Wilson <wilson@specifix.com>
+1 -1
Documentation/admin-guide/devices.txt
··· 319 319 182 = /dev/perfctr Performance-monitoring counters 320 320 183 = /dev/hwrng Generic random number generator 321 321 184 = /dev/cpu/microcode CPU microcode update interface 322 - 186 = /dev/atomicps Atomic shapshot of process state data 322 + 186 = /dev/atomicps Atomic snapshot of process state data 323 323 187 = /dev/irnet IrNET device 324 324 188 = /dev/smbusbios SMBus BIOS 325 325 189 = /dev/ussp_ctl User space serial port control
+1 -1
Documentation/media/v4l-drivers/meye.rst
··· 95 95 96 96 Besides the video4linux interface, the driver has a private interface 97 97 for accessing the Motion Eye extended parameters (camera sharpness, 98 - agc, video framerate), the shapshot and the MJPEG capture facilities. 98 + agc, video framerate), the snapshot and the MJPEG capture facilities. 99 99 100 100 This interface consists of several ioctls (prototypes and structures 101 101 can be found in include/linux/meye.h):
+5 -5
MAINTAINERS
··· 3150 3150 F: arch/mips/net/ 3151 3151 3152 3152 BPF JIT for NFP NICs 3153 - M: Jakub Kicinski <jakub.kicinski@netronome.com> 3153 + M: Jakub Kicinski <kuba@kernel.org> 3154 3154 L: netdev@vger.kernel.org 3155 3155 L: bpf@vger.kernel.org 3156 3156 S: Supported ··· 11431 11431 F: net/netrom/ 11432 11432 11433 11433 NETRONOME ETHERNET DRIVERS 11434 - M: Jakub Kicinski <jakub.kicinski@netronome.com> 11434 + M: Jakub Kicinski <kuba@kernel.org> 11435 11435 L: oss-drivers@netronome.com 11436 11436 S: Maintained 11437 11437 F: drivers/net/ethernet/netronome/ ··· 11591 11591 M: Aviad Yehezkel <aviadye@mellanox.com> 11592 11592 M: John Fastabend <john.fastabend@gmail.com> 11593 11593 M: Daniel Borkmann <daniel@iogearbox.net> 11594 - M: Jakub Kicinski <jakub.kicinski@netronome.com> 11594 + M: Jakub Kicinski <kuba@kernel.org> 11595 11595 L: netdev@vger.kernel.org 11596 11596 S: Maintained 11597 11597 F: net/tls/* ··· 11603 11603 Q: http://patchwork.kernel.org/project/linux-wireless/list/ 11604 11604 11605 11605 NETDEVSIM 11606 - M: Jakub Kicinski <jakub.kicinski@netronome.com> 11606 + M: Jakub Kicinski <kuba@kernel.org> 11607 11607 S: Maintained 11608 11608 F: drivers/net/netdevsim/* 11609 11609 ··· 18042 18042 M: Alexei Starovoitov <ast@kernel.org> 18043 18043 M: Daniel Borkmann <daniel@iogearbox.net> 18044 18044 M: David S. Miller <davem@davemloft.net> 18045 - M: Jakub Kicinski <jakub.kicinski@netronome.com> 18045 + M: Jakub Kicinski <kuba@kernel.org> 18046 18046 M: Jesper Dangaard Brouer <hawk@kernel.org> 18047 18047 M: John Fastabend <john.fastabend@gmail.com> 18048 18048 L: netdev@vger.kernel.org
+1 -1
drivers/net/dsa/bcm_sf2.c
··· 68 68 69 69 /* Force link status for IMP port */ 70 70 reg = core_readl(priv, offset); 71 - reg |= (MII_SW_OR | LINK_STS); 71 + reg |= (MII_SW_OR | LINK_STS | GMII_SPEED_UP_2G); 72 72 core_writel(priv, reg, offset); 73 73 74 74 /* Enable Broadcast, Multicast, Unicast forwarding to IMP port */
+1 -1
drivers/net/dsa/sja1105/sja1105_main.c
··· 582 582 struct device *dev = &priv->spidev->dev; 583 583 struct device_node *child; 584 584 585 - for_each_child_of_node(ports_node, child) { 585 + for_each_available_child_of_node(ports_node, child) { 586 586 struct device_node *phy_node; 587 587 phy_interface_t phy_mode; 588 588 u32 index;
+4 -3
drivers/net/ethernet/broadcom/bcmsysport.c
··· 2323 2323 ring->switch_queue = qp; 2324 2324 ring->switch_port = port; 2325 2325 ring->inspect = true; 2326 - priv->ring_map[q + port * num_tx_queues] = ring; 2326 + priv->ring_map[qp + port * num_tx_queues] = ring; 2327 2327 qp++; 2328 2328 } 2329 2329 ··· 2338 2338 struct net_device *slave_dev; 2339 2339 unsigned int num_tx_queues; 2340 2340 struct net_device *dev; 2341 - unsigned int q, port; 2341 + unsigned int q, qp, port; 2342 2342 2343 2343 priv = container_of(nb, struct bcm_sysport_priv, dsa_notifier); 2344 2344 if (priv->netdev != info->master) ··· 2364 2364 continue; 2365 2365 2366 2366 ring->inspect = false; 2367 - priv->ring_map[q + port * num_tx_queues] = NULL; 2367 + qp = ring->switch_queue; 2368 + priv->ring_map[qp + port * num_tx_queues] = NULL; 2368 2369 } 2369 2370 2370 2371 return 0;
+20 -9
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 11065 11065 struct flow_keys *keys1 = &f1->fkeys; 11066 11066 struct flow_keys *keys2 = &f2->fkeys; 11067 11067 11068 - if (keys1->addrs.v4addrs.src == keys2->addrs.v4addrs.src && 11069 - keys1->addrs.v4addrs.dst == keys2->addrs.v4addrs.dst && 11070 - keys1->ports.ports == keys2->ports.ports && 11071 - keys1->basic.ip_proto == keys2->basic.ip_proto && 11072 - keys1->basic.n_proto == keys2->basic.n_proto && 11068 + if (keys1->basic.n_proto != keys2->basic.n_proto || 11069 + keys1->basic.ip_proto != keys2->basic.ip_proto) 11070 + return false; 11071 + 11072 + if (keys1->basic.n_proto == htons(ETH_P_IP)) { 11073 + if (keys1->addrs.v4addrs.src != keys2->addrs.v4addrs.src || 11074 + keys1->addrs.v4addrs.dst != keys2->addrs.v4addrs.dst) 11075 + return false; 11076 + } else { 11077 + if (memcmp(&keys1->addrs.v6addrs.src, &keys2->addrs.v6addrs.src, 11078 + sizeof(keys1->addrs.v6addrs.src)) || 11079 + memcmp(&keys1->addrs.v6addrs.dst, &keys2->addrs.v6addrs.dst, 11080 + sizeof(keys1->addrs.v6addrs.dst))) 11081 + return false; 11082 + } 11083 + 11084 + if (keys1->ports.ports == keys2->ports.ports && 11073 11085 keys1->control.flags == keys2->control.flags && 11074 11086 ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) && 11075 11087 ether_addr_equal(f1->dst_mac_addr, f2->dst_mac_addr)) ··· 11373 11361 return -EOPNOTSUPP; 11374 11362 11375 11363 /* The PF and it's VF-reps only support the switchdev framework */ 11376 - if (!BNXT_PF(bp)) 11364 + if (!BNXT_PF(bp) || !(bp->flags & BNXT_FLAG_DSN_VALID)) 11377 11365 return -EOPNOTSUPP; 11378 11366 11379 11367 ppid->id_len = sizeof(bp->switch_id); ··· 11746 11734 put_unaligned_le32(dw, &dsn[0]); 11747 11735 pci_read_config_dword(pdev, pos + 4, &dw); 11748 11736 put_unaligned_le32(dw, &dsn[4]); 11737 + bp->flags |= BNXT_FLAG_DSN_VALID; 11749 11738 return 0; 11750 11739 } 11751 11740 ··· 11858 11845 11859 11846 if (BNXT_PF(bp)) { 11860 11847 /* Read the adapter's DSN to use as the eswitch switch_id */ 11861 - rc = bnxt_pcie_dsn_get(bp, bp->switch_id); 11862 - if (rc) 11863 - goto init_err_pci_clean; 11848 + bnxt_pcie_dsn_get(bp, bp->switch_id); 11864 11849 } 11865 11850 11866 11851 /* MTU range: 60 - FW defined max */
+1 -3
drivers/net/ethernet/broadcom/bnxt/bnxt.h
··· 1532 1532 #define BNXT_FLAG_NO_AGG_RINGS 0x20000 1533 1533 #define BNXT_FLAG_RX_PAGE_MODE 0x40000 1534 1534 #define BNXT_FLAG_MULTI_HOST 0x100000 1535 + #define BNXT_FLAG_DSN_VALID 0x200000 1535 1536 #define BNXT_FLAG_DOUBLE_DB 0x400000 1536 1537 #define BNXT_FLAG_CHIP_NITRO_A0 0x1000000 1537 1538 #define BNXT_FLAG_DIM 0x2000000 ··· 1937 1936 case HWRM_CFA_ENCAP_RECORD_FREE: 1938 1937 case HWRM_CFA_DECAP_FILTER_ALLOC: 1939 1938 case HWRM_CFA_DECAP_FILTER_FREE: 1940 - case HWRM_CFA_NTUPLE_FILTER_ALLOC: 1941 - case HWRM_CFA_NTUPLE_FILTER_FREE: 1942 - case HWRM_CFA_NTUPLE_FILTER_CFG: 1943 1939 case HWRM_CFA_EM_FLOW_ALLOC: 1944 1940 case HWRM_CFA_EM_FLOW_FREE: 1945 1941 case HWRM_CFA_EM_FLOW_CFG:
+3
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
··· 398 398 struct net_device *dev; 399 399 int rc, i; 400 400 401 + if (!(bp->flags & BNXT_FLAG_DSN_VALID)) 402 + return -ENODEV; 403 + 401 404 bp->vf_reps = kcalloc(num_vfs, sizeof(vf_rep), GFP_KERNEL); 402 405 if (!bp->vf_reps) 403 406 return -ENOMEM;
+17 -13
drivers/net/ethernet/cadence/macb_main.c
··· 611 611 .mac_link_up = macb_mac_link_up, 612 612 }; 613 613 614 + static bool macb_phy_handle_exists(struct device_node *dn) 615 + { 616 + dn = of_parse_phandle(dn, "phy-handle", 0); 617 + of_node_put(dn); 618 + return dn != NULL; 619 + } 620 + 614 621 static int macb_phylink_connect(struct macb *bp) 615 622 { 623 + struct device_node *dn = bp->pdev->dev.of_node; 616 624 struct net_device *dev = bp->dev; 617 625 struct phy_device *phydev; 618 626 int ret; 619 627 620 - if (bp->pdev->dev.of_node && 621 - of_parse_phandle(bp->pdev->dev.of_node, "phy-handle", 0)) { 622 - ret = phylink_of_phy_connect(bp->phylink, bp->pdev->dev.of_node, 623 - 0); 624 - if (ret) { 625 - netdev_err(dev, "Could not attach PHY (%d)\n", ret); 626 - return ret; 627 - } 628 - } else { 628 + if (dn) 629 + ret = phylink_of_phy_connect(bp->phylink, dn, 0); 630 + 631 + if (!dn || (ret && !macb_phy_handle_exists(dn))) { 629 632 phydev = phy_find_first(bp->mii_bus); 630 633 if (!phydev) { 631 634 netdev_err(dev, "no PHY found\n"); ··· 637 634 638 635 /* attach the mac to the phy */ 639 636 ret = phylink_connect_phy(bp->phylink, phydev); 640 - if (ret) { 641 - netdev_err(dev, "Could not attach to PHY (%d)\n", ret); 642 - return ret; 643 - } 637 + } 638 + 639 + if (ret) { 640 + netdev_err(dev, "Could not attach PHY (%d)\n", ret); 641 + return ret; 644 642 } 645 643 646 644 phylink_start(bp->phylink);
+11 -3
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
··· 3135 3135 { 3136 3136 struct port_info *pi = netdev_priv(dev); 3137 3137 struct adapter *adap = pi->adapter; 3138 + struct ch_sched_queue qe = { 0 }; 3139 + struct ch_sched_params p = { 0 }; 3138 3140 struct sched_class *e; 3139 - struct ch_sched_params p; 3140 - struct ch_sched_queue qe; 3141 3141 u32 req_rate; 3142 3142 int err = 0; 3143 3143 ··· 3152 3152 "Failed to rate limit on queue %d. Link Down?\n", 3153 3153 index); 3154 3154 return -EINVAL; 3155 + } 3156 + 3157 + qe.queue = index; 3158 + e = cxgb4_sched_queue_lookup(dev, &qe); 3159 + if (e && e->info.u.params.level != SCHED_CLASS_LEVEL_CL_RL) { 3160 + dev_err(adap->pdev_dev, 3161 + "Queue %u already bound to class %u of type: %u\n", 3162 + index, e->idx, e->info.u.params.level); 3163 + return -EBUSY; 3155 3164 } 3156 3165 3157 3166 /* Convert from Mbps to Kbps */ ··· 3192 3183 return 0; 3193 3184 3194 3185 /* Fetch any available unused or matching scheduling class */ 3195 - memset(&p, 0, sizeof(p)); 3196 3186 p.type = SCHED_CLASS_TYPE_PACKET; 3197 3187 p.u.params.level = SCHED_CLASS_LEVEL_CL_RL; 3198 3188 p.u.params.mode = SCHED_CLASS_MODE_CLASS;
+67
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c
··· 15 15 struct flow_action *actions = &cls->rule->action; 16 16 struct port_info *pi = netdev2pinfo(dev); 17 17 struct flow_action_entry *entry; 18 + struct ch_sched_queue qe; 19 + struct sched_class *e; 18 20 u64 max_link_rate; 19 21 u32 i, speed; 20 22 int ret; ··· 62 60 } 63 61 } 64 62 63 + for (i = 0; i < pi->nqsets; i++) { 64 + memset(&qe, 0, sizeof(qe)); 65 + qe.queue = i; 66 + 67 + e = cxgb4_sched_queue_lookup(dev, &qe); 68 + if (e && e->info.u.params.level != SCHED_CLASS_LEVEL_CH_RL) { 69 + NL_SET_ERR_MSG_MOD(extack, 70 + "Some queues are already bound to different class"); 71 + return -EBUSY; 72 + } 73 + } 74 + 65 75 return 0; 76 + } 77 + 78 + static int cxgb4_matchall_tc_bind_queues(struct net_device *dev, u32 tc) 79 + { 80 + struct port_info *pi = netdev2pinfo(dev); 81 + struct ch_sched_queue qe; 82 + int ret; 83 + u32 i; 84 + 85 + for (i = 0; i < pi->nqsets; i++) { 86 + qe.queue = i; 87 + qe.class = tc; 88 + ret = cxgb4_sched_class_bind(dev, &qe, SCHED_QUEUE); 89 + if (ret) 90 + goto out_free; 91 + } 92 + 93 + return 0; 94 + 95 + out_free: 96 + while (i--) { 97 + qe.queue = i; 98 + qe.class = SCHED_CLS_NONE; 99 + cxgb4_sched_class_unbind(dev, &qe, SCHED_QUEUE); 100 + } 101 + 102 + return ret; 103 + } 104 + 105 + static void cxgb4_matchall_tc_unbind_queues(struct net_device *dev) 106 + { 107 + struct port_info *pi = netdev2pinfo(dev); 108 + struct ch_sched_queue qe; 109 + u32 i; 110 + 111 + for (i = 0; i < pi->nqsets; i++) { 112 + qe.queue = i; 113 + qe.class = SCHED_CLS_NONE; 114 + cxgb4_sched_class_unbind(dev, &qe, SCHED_QUEUE); 115 + } 66 116 } 67 117 68 118 static int cxgb4_matchall_alloc_tc(struct net_device *dev, ··· 137 83 struct adapter *adap = netdev2adap(dev); 138 84 struct flow_action_entry *entry; 139 85 struct sched_class *e; 86 + int ret; 140 87 u32 i; 141 88 142 89 tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id]; ··· 156 101 return -ENOMEM; 157 102 } 158 103 104 + ret = cxgb4_matchall_tc_bind_queues(dev, e->idx); 105 + if (ret) { 106 + NL_SET_ERR_MSG_MOD(extack, 107 + "Could not bind queues to traffic class"); 108 + goto out_free; 109 + } 110 + 159 111 tc_port_matchall->egress.hwtc = e->idx; 160 112 tc_port_matchall->egress.cookie = cls->cookie; 161 113 tc_port_matchall->egress.state = CXGB4_MATCHALL_STATE_ENABLED; 162 114 return 0; 115 + 116 + out_free: 117 + cxgb4_sched_class_free(dev, e->idx); 118 + return ret; 163 119 } 164 120 165 121 static void cxgb4_matchall_free_tc(struct net_device *dev) ··· 180 114 struct adapter *adap = netdev2adap(dev); 181 115 182 116 tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id]; 117 + cxgb4_matchall_tc_unbind_queues(dev); 183 118 cxgb4_sched_class_free(dev, tc_port_matchall->egress.hwtc); 184 119 185 120 tc_port_matchall->egress.hwtc = SCHED_CLS_NONE;
+27 -1
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c
··· 12 12 struct port_info *pi = netdev2pinfo(dev); 13 13 struct adapter *adap = netdev2adap(dev); 14 14 u32 speed, qcount = 0, qoffset = 0; 15 + u32 start_a, start_b, end_a, end_b; 15 16 int ret; 16 - u8 i; 17 + u8 i, j; 17 18 18 19 if (!mqprio->qopt.num_tc) 19 20 return 0; ··· 47 46 for (i = 0; i < mqprio->qopt.num_tc; i++) { 48 47 qoffset = max_t(u16, mqprio->qopt.offset[i], qoffset); 49 48 qcount += mqprio->qopt.count[i]; 49 + 50 + start_a = mqprio->qopt.offset[i]; 51 + end_a = start_a + mqprio->qopt.count[i] - 1; 52 + for (j = i + 1; j < mqprio->qopt.num_tc; j++) { 53 + start_b = mqprio->qopt.offset[j]; 54 + end_b = start_b + mqprio->qopt.count[j] - 1; 55 + 56 + /* If queue count is 0, then the traffic 57 + * belonging to this class will not use 58 + * ETHOFLD queues. So, no need to validate 59 + * further. 60 + */ 61 + if (!mqprio->qopt.count[i]) 62 + break; 63 + 64 + if (!mqprio->qopt.count[j]) 65 + continue; 66 + 67 + if (max_t(u32, start_a, start_b) <= 68 + min_t(u32, end_a, end_b)) { 69 + netdev_err(dev, 70 + "Queues can't overlap across tc\n"); 71 + return -EINVAL; 72 + } 73 + } 50 74 51 75 /* Convert byte per second to bits per second */ 52 76 min_rate += (mqprio->min_rate[i] * 8);
+16
drivers/net/ethernet/chelsio/cxgb4/sched.c
··· 165 165 return found; 166 166 } 167 167 168 + struct sched_class *cxgb4_sched_queue_lookup(struct net_device *dev, 169 + struct ch_sched_queue *p) 170 + { 171 + struct port_info *pi = netdev2pinfo(dev); 172 + struct sched_queue_entry *qe = NULL; 173 + struct adapter *adap = pi->adapter; 174 + struct sge_eth_txq *txq; 175 + 176 + if (p->queue < 0 || p->queue >= pi->nqsets) 177 + return NULL; 178 + 179 + txq = &adap->sge.ethtxq[pi->first_qset + p->queue]; 180 + qe = t4_sched_entry_lookup(pi, SCHED_QUEUE, txq->q.cntxt_id); 181 + return qe ? &pi->sched_tbl->tab[qe->param.class] : NULL; 182 + } 183 + 168 184 static int t4_sched_queue_unbind(struct port_info *pi, struct ch_sched_queue *p) 169 185 { 170 186 struct sched_queue_entry *qe = NULL;
+2
drivers/net/ethernet/chelsio/cxgb4/sched.h
··· 103 103 return true; 104 104 } 105 105 106 + struct sched_class *cxgb4_sched_queue_lookup(struct net_device *dev, 107 + struct ch_sched_queue *p); 106 108 int cxgb4_sched_class_bind(struct net_device *dev, void *arg, 107 109 enum sched_bind_type type); 108 110 int cxgb4_sched_class_unbind(struct net_device *dev, void *arg,
+1 -3
drivers/net/ethernet/hisilicon/hns/hns_enet.c
··· 565 565 skb = *out_skb = napi_alloc_skb(&ring_data->napi, 566 566 HNS_RX_HEAD_SIZE); 567 567 if (unlikely(!skb)) { 568 - netdev_err(ndev, "alloc rx skb fail\n"); 569 568 ring->stats.sw_err_cnt++; 570 569 return -ENOMEM; 571 570 } ··· 1055 1056 container_of(napi, struct hns_nic_ring_data, napi); 1056 1057 struct hnae_ring *ring = ring_data->ring; 1057 1058 1058 - try_again: 1059 1059 clean_complete += ring_data->poll_one( 1060 1060 ring_data, budget - clean_complete, 1061 1061 ring_data->ex_process); ··· 1064 1066 napi_complete(napi); 1065 1067 ring->q->handle->dev->ops->toggle_ring_irq(ring, 0); 1066 1068 } else { 1067 - goto try_again; 1069 + return budget; 1068 1070 } 1069 1071 } 1070 1072
+6
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
··· 54 54 #define HNS3_INNER_VLAN_TAG 1 55 55 #define HNS3_OUTER_VLAN_TAG 2 56 56 57 + #define HNS3_MIN_TX_LEN 33U 58 + 57 59 /* hns3_pci_tbl - PCI Device ID Table 58 60 * 59 61 * Last entry must be all 0s ··· 1406 1404 struct sk_buff *frag_skb; 1407 1405 int bd_num = 0; 1408 1406 int ret; 1407 + 1408 + /* Hardware can only handle short frames above 32 bytes */ 1409 + if (skb_put_padto(skb, HNS3_MIN_TX_LEN)) 1410 + return NETDEV_TX_OK; 1409 1411 1410 1412 /* Prefetch the data used later */ 1411 1413 prefetch(skb->data);
+2 -3
drivers/net/ethernet/intel/e1000e/e1000.h
··· 185 185 186 186 /* board specific private data structure */ 187 187 struct e1000_adapter { 188 + struct timer_list watchdog_timer; 188 189 struct timer_list phy_info_timer; 189 190 struct timer_list blink_timer; 190 191 191 192 struct work_struct reset_task; 192 - struct delayed_work watchdog_task; 193 - 194 - struct workqueue_struct *e1000_workqueue; 193 + struct work_struct watchdog_task; 195 194 196 195 const struct e1000_info *ei; 197 196
+25 -29
drivers/net/ethernet/intel/e1000e/netdev.c
··· 1780 1780 } 1781 1781 /* guard against interrupt when we're going down */ 1782 1782 if (!test_bit(__E1000_DOWN, &adapter->state)) 1783 - mod_delayed_work(adapter->e1000_workqueue, 1784 - &adapter->watchdog_task, HZ); 1783 + mod_timer(&adapter->watchdog_timer, jiffies + 1); 1785 1784 } 1786 1785 1787 1786 /* Reset on uncorrectable ECC error */ ··· 1860 1861 } 1861 1862 /* guard against interrupt when we're going down */ 1862 1863 if (!test_bit(__E1000_DOWN, &adapter->state)) 1863 - mod_delayed_work(adapter->e1000_workqueue, 1864 - &adapter->watchdog_task, HZ); 1864 + mod_timer(&adapter->watchdog_timer, jiffies + 1); 1865 1865 } 1866 1866 1867 1867 /* Reset on uncorrectable ECC error */ ··· 1905 1907 hw->mac.get_link_status = true; 1906 1908 /* guard against interrupt when we're going down */ 1907 1909 if (!test_bit(__E1000_DOWN, &adapter->state)) 1908 - mod_delayed_work(adapter->e1000_workqueue, 1909 - &adapter->watchdog_task, HZ); 1910 + mod_timer(&adapter->watchdog_timer, jiffies + 1); 1910 1911 } 1911 1912 1912 1913 if (!test_bit(__E1000_DOWN, &adapter->state)) ··· 4281 4284 4282 4285 napi_synchronize(&adapter->napi); 4283 4286 4287 + del_timer_sync(&adapter->watchdog_timer); 4284 4288 del_timer_sync(&adapter->phy_info_timer); 4285 4289 4286 4290 spin_lock(&adapter->stats64_lock); ··· 5153 5155 } 5154 5156 } 5155 5157 5158 + /** 5159 + * e1000_watchdog - Timer Call-back 5160 + * @data: pointer to adapter cast into an unsigned long 5161 + **/ 5162 + static void e1000_watchdog(struct timer_list *t) 5163 + { 5164 + struct e1000_adapter *adapter = from_timer(adapter, t, watchdog_timer); 5165 + 5166 + /* Do the rest outside of interrupt context */ 5167 + schedule_work(&adapter->watchdog_task); 5168 + 5169 + /* TODO: make this use queue_delayed_work() */ 5170 + } 5171 + 5156 5172 static void e1000_watchdog_task(struct work_struct *work) 5157 5173 { 5158 5174 struct e1000_adapter *adapter = container_of(work, 5159 5175 struct e1000_adapter, 5160 - watchdog_task.work); 5176 + watchdog_task); 5161 5177 struct net_device *netdev = adapter->netdev; 5162 5178 struct e1000_mac_info *mac = &adapter->hw.mac; 5163 5179 struct e1000_phy_info *phy = &adapter->hw.phy; ··· 5419 5407 5420 5408 /* Reset the timer */ 5421 5409 if (!test_bit(__E1000_DOWN, &adapter->state)) 5422 - queue_delayed_work(adapter->e1000_workqueue, 5423 - &adapter->watchdog_task, 5424 - round_jiffies(2 * HZ)); 5410 + mod_timer(&adapter->watchdog_timer, 5411 + round_jiffies(jiffies + 2 * HZ)); 5425 5412 } 5426 5413 5427 5414 #define E1000_TX_FLAGS_CSUM 0x00000001 ··· 7460 7449 goto err_eeprom; 7461 7450 } 7462 7451 7463 - adapter->e1000_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, 7464 - e1000e_driver_name); 7465 - 7466 - if (!adapter->e1000_workqueue) { 7467 - err = -ENOMEM; 7468 - goto err_workqueue; 7469 - } 7470 - 7471 - INIT_DELAYED_WORK(&adapter->watchdog_task, e1000_watchdog_task); 7472 - queue_delayed_work(adapter->e1000_workqueue, &adapter->watchdog_task, 7473 - 0); 7474 - 7452 + timer_setup(&adapter->watchdog_timer, e1000_watchdog, 0); 7475 7453 timer_setup(&adapter->phy_info_timer, e1000_update_phy_info, 0); 7476 7454 7477 7455 INIT_WORK(&adapter->reset_task, e1000_reset_task); 7456 + INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task); 7478 7457 INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround); 7479 7458 INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task); 7480 7459 INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang); ··· 7558 7557 return 0; 7559 7558 7560 7559 err_register: 7561 - flush_workqueue(adapter->e1000_workqueue); 7562 - destroy_workqueue(adapter->e1000_workqueue); 7563 - err_workqueue: 7564 7560 if (!(adapter->flags & FLAG_HAS_AMT)) 7565 7561 e1000e_release_hw_control(adapter); 7566 7562 err_eeprom: ··· 7602 7604 * from being rescheduled. 7603 7605 */ 7604 7606 set_bit(__E1000_DOWN, &adapter->state); 7607 + del_timer_sync(&adapter->watchdog_timer); 7605 7608 del_timer_sync(&adapter->phy_info_timer); 7606 7609 7607 7610 cancel_work_sync(&adapter->reset_task); 7611 + cancel_work_sync(&adapter->watchdog_task); 7608 7612 cancel_work_sync(&adapter->downshift_task); 7609 7613 cancel_work_sync(&adapter->update_phy_task); 7610 7614 cancel_work_sync(&adapter->print_hang_task); 7611 - 7612 - cancel_delayed_work(&adapter->watchdog_task); 7613 - flush_workqueue(adapter->e1000_workqueue); 7614 - destroy_workqueue(adapter->e1000_workqueue); 7615 7615 7616 7616 if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) { 7617 7617 cancel_work_sync(&adapter->tx_hwtstamp_work);
+5
drivers/net/ethernet/intel/i40e/i40e_adminq.c
··· 536 536 (aq->api_maj_ver == 1 && 537 537 aq->api_min_ver >= I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722)) 538 538 hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE; 539 + 540 + if (aq->api_maj_ver > 1 || 541 + (aq->api_maj_ver == 1 && 542 + aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_X722)) 543 + hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; 539 544 /* fall through */ 540 545 default: 541 546 break;
+18 -4
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
··· 2322 2322 } 2323 2323 2324 2324 /** 2325 + * i40e_vc_validate_vqs_bitmaps - validate Rx/Tx queue bitmaps from VIRTHCHNL 2326 + * @vqs: virtchnl_queue_select structure containing bitmaps to validate 2327 + * 2328 + * Returns true if validation was successful, else false. 2329 + */ 2330 + static bool i40e_vc_validate_vqs_bitmaps(struct virtchnl_queue_select *vqs) 2331 + { 2332 + if ((!vqs->rx_queues && !vqs->tx_queues) || 2333 + vqs->rx_queues >= BIT(I40E_MAX_VF_QUEUES) || 2334 + vqs->tx_queues >= BIT(I40E_MAX_VF_QUEUES)) 2335 + return false; 2336 + 2337 + return true; 2338 + } 2339 + 2340 + /** 2325 2341 * i40e_vc_enable_queues_msg 2326 2342 * @vf: pointer to the VF info 2327 2343 * @msg: pointer to the msg buffer ··· 2362 2346 goto error_param; 2363 2347 } 2364 2348 2365 - if ((0 == vqs->rx_queues) && (0 == vqs->tx_queues)) { 2349 + if (i40e_vc_validate_vqs_bitmaps(vqs)) { 2366 2350 aq_ret = I40E_ERR_PARAM; 2367 2351 goto error_param; 2368 2352 } ··· 2424 2408 goto error_param; 2425 2409 } 2426 2410 2427 - if ((vqs->rx_queues == 0 && vqs->tx_queues == 0) || 2428 - vqs->rx_queues > I40E_MAX_VF_QUEUES || 2429 - vqs->tx_queues > I40E_MAX_VF_QUEUES) { 2411 + if (i40e_vc_validate_vqs_bitmaps(vqs)) { 2430 2412 aq_ret = I40E_ERR_PARAM; 2431 2413 goto error_param; 2432 2414 }
+2
drivers/net/ethernet/intel/iavf/iavf.h
··· 415 415 void iavf_disable_channels(struct iavf_adapter *adapter); 416 416 void iavf_add_cloud_filter(struct iavf_adapter *adapter); 417 417 void iavf_del_cloud_filter(struct iavf_adapter *adapter); 418 + struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter, 419 + const u8 *macaddr); 418 420 #endif /* _IAVF_H_ */
+13 -4
drivers/net/ethernet/intel/iavf/iavf_main.c
··· 743 743 * 744 744 * Returns ptr to the filter object or NULL when no memory available. 745 745 **/ 746 - static struct 747 - iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter, 748 - const u8 *macaddr) 746 + struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter, 747 + const u8 *macaddr) 749 748 { 750 749 struct iavf_mac_filter *f; 751 750 ··· 2064 2065 struct virtchnl_vf_resource *vfres = adapter->vf_res; 2065 2066 struct net_device *netdev = adapter->netdev; 2066 2067 struct iavf_hw *hw = &adapter->hw; 2068 + struct iavf_mac_filter *f, *ftmp; 2067 2069 struct iavf_vlan_filter *vlf; 2068 2070 struct iavf_cloud_filter *cf; 2069 - struct iavf_mac_filter *f; 2070 2071 u32 reg_val; 2071 2072 int i = 0, err; 2072 2073 bool running; ··· 2180 2181 2181 2182 spin_lock_bh(&adapter->mac_vlan_list_lock); 2182 2183 2184 + /* Delete filter for the current MAC address, it could have 2185 + * been changed by the PF via administratively set MAC. 2186 + * Will be re-added via VIRTCHNL_OP_GET_VF_RESOURCES. 2187 + */ 2188 + list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) { 2189 + if (ether_addr_equal(f->macaddr, adapter->hw.mac.addr)) { 2190 + list_del(&f->list); 2191 + kfree(f); 2192 + } 2193 + } 2183 2194 /* re-add all MAC filters */ 2184 2195 list_for_each_entry(f, &adapter->mac_filter_list, list) { 2185 2196 f->add = true;
+3
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
··· 1359 1359 ether_addr_copy(netdev->perm_addr, 1360 1360 adapter->hw.mac.addr); 1361 1361 } 1362 + spin_lock_bh(&adapter->mac_vlan_list_lock); 1363 + iavf_add_filter(adapter, adapter->hw.mac.addr); 1364 + spin_unlock_bh(&adapter->mac_vlan_list_lock); 1362 1365 iavf_process_config(adapter); 1363 1366 } 1364 1367 break;
+2 -6
drivers/net/ethernet/intel/igb/e1000_82575.c
··· 530 530 dev_spec->module_plugged = true; 531 531 if (eth_flags->e1000_base_lx || eth_flags->e1000_base_sx) { 532 532 hw->phy.media_type = e1000_media_type_internal_serdes; 533 - } else if (eth_flags->e100_base_fx) { 533 + } else if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) { 534 534 dev_spec->sgmii_active = true; 535 535 hw->phy.media_type = e1000_media_type_internal_serdes; 536 536 } else if (eth_flags->e1000_base_t) { ··· 657 657 break; 658 658 } 659 659 660 - /* do not change link mode for 100BaseFX */ 661 - if (dev_spec->eth_flags.e100_base_fx) 662 - break; 663 - 664 660 /* change current link mode setting */ 665 661 ctrl_ext &= ~E1000_CTRL_EXT_LINK_MODE_MASK; 666 662 667 - if (hw->phy.media_type == e1000_media_type_copper) 663 + if (dev_spec->sgmii_active) 668 664 ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_SGMII; 669 665 else 670 666 ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES;
+1 -1
drivers/net/ethernet/intel/igb/igb_ethtool.c
··· 181 181 advertising &= ~ADVERTISED_1000baseKX_Full; 182 182 } 183 183 } 184 - if (eth_flags->e100_base_fx) { 184 + if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) { 185 185 supported |= SUPPORTED_100baseT_Full; 186 186 advertising |= ADVERTISED_100baseT_Full; 187 187 }
+27 -10
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
··· 5239 5239 struct ixgbe_hw *hw = &adapter->hw; 5240 5240 struct hlist_node *node2; 5241 5241 struct ixgbe_fdir_filter *filter; 5242 - u64 action; 5242 + u8 queue; 5243 5243 5244 5244 spin_lock(&adapter->fdir_perfect_lock); 5245 5245 ··· 5248 5248 5249 5249 hlist_for_each_entry_safe(filter, node2, 5250 5250 &adapter->fdir_filter_list, fdir_node) { 5251 - action = filter->action; 5252 - if (action != IXGBE_FDIR_DROP_QUEUE && action != 0) 5253 - action = 5254 - (action >> ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF) - 1; 5251 + if (filter->action == IXGBE_FDIR_DROP_QUEUE) { 5252 + queue = IXGBE_FDIR_DROP_QUEUE; 5253 + } else { 5254 + u32 ring = ethtool_get_flow_spec_ring(filter->action); 5255 + u8 vf = ethtool_get_flow_spec_ring_vf(filter->action); 5256 + 5257 + if (!vf && (ring >= adapter->num_rx_queues)) { 5258 + e_err(drv, "FDIR restore failed without VF, ring: %u\n", 5259 + ring); 5260 + continue; 5261 + } else if (vf && 5262 + ((vf > adapter->num_vfs) || 5263 + ring >= adapter->num_rx_queues_per_pool)) { 5264 + e_err(drv, "FDIR restore failed with VF, vf: %hhu, ring: %u\n", 5265 + vf, ring); 5266 + continue; 5267 + } 5268 + 5269 + /* Map the ring onto the absolute queue index */ 5270 + if (!vf) 5271 + queue = adapter->rx_ring[ring]->reg_idx; 5272 + else 5273 + queue = ((vf - 1) * 5274 + adapter->num_rx_queues_per_pool) + ring; 5275 + } 5255 5276 5256 5277 ixgbe_fdir_write_perfect_filter_82599(hw, 5257 - &filter->filter, 5258 - filter->sw_idx, 5259 - (action == IXGBE_FDIR_DROP_QUEUE) ? 5260 - IXGBE_FDIR_DROP_QUEUE : 5261 - adapter->rx_ring[action]->reg_idx); 5278 + &filter->filter, filter->sw_idx, queue); 5262 5279 } 5263 5280 5264 5281 spin_unlock(&adapter->fdir_perfect_lock);
-5
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
··· 2081 2081 struct ixgbe_hw *hw = &adapter->hw; 2082 2082 int count = 0; 2083 2083 2084 - if ((netdev_uc_count(netdev)) > 10) { 2085 - pr_err("Too many unicast filters - No Space\n"); 2086 - return -ENOSPC; 2087 - } 2088 - 2089 2084 if (!netdev_uc_empty(netdev)) { 2090 2085 struct netdev_hw_addr *ha; 2091 2086
+10 -9
drivers/net/ethernet/marvell/mvneta.c
··· 2081 2081 mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, 2082 2082 struct bpf_prog *prog, struct xdp_buff *xdp) 2083 2083 { 2084 - u32 ret, act = bpf_prog_run_xdp(prog, xdp); 2084 + unsigned int len; 2085 + u32 ret, act; 2086 + 2087 + len = xdp->data_end - xdp->data_hard_start - pp->rx_offset_correction; 2088 + act = bpf_prog_run_xdp(prog, xdp); 2085 2089 2086 2090 switch (act) { 2087 2091 case XDP_PASS: ··· 2098 2094 if (err) { 2099 2095 ret = MVNETA_XDP_DROPPED; 2100 2096 __page_pool_put_page(rxq->page_pool, 2101 - virt_to_head_page(xdp->data), 2102 - xdp->data_end - xdp->data_hard_start, 2103 - true); 2097 + virt_to_head_page(xdp->data), 2098 + len, true); 2104 2099 } else { 2105 2100 ret = MVNETA_XDP_REDIR; 2106 2101 } ··· 2109 2106 ret = mvneta_xdp_xmit_back(pp, xdp); 2110 2107 if (ret != MVNETA_XDP_TX) 2111 2108 __page_pool_put_page(rxq->page_pool, 2112 - virt_to_head_page(xdp->data), 2113 - xdp->data_end - xdp->data_hard_start, 2114 - true); 2109 + virt_to_head_page(xdp->data), 2110 + len, true); 2115 2111 break; 2116 2112 default: 2117 2113 bpf_warn_invalid_xdp_action(act); ··· 2121 2119 case XDP_DROP: 2122 2120 __page_pool_put_page(rxq->page_pool, 2123 2121 virt_to_head_page(xdp->data), 2124 - xdp->data_end - xdp->data_hard_start, 2125 - true); 2122 + len, true); 2126 2123 ret = MVNETA_XDP_DROPPED; 2127 2124 break; 2128 2125 }
+1 -1
drivers/net/ethernet/mellanox/mlx4/crdump.c
··· 182 182 crdump_enable_crspace_access(dev, cr_space); 183 183 184 184 /* Get the available snapshot ID for the dumps */ 185 - id = devlink_region_shapshot_id_get(devlink); 185 + id = devlink_region_snapshot_id_get(devlink); 186 186 187 187 /* Try to capture dumps */ 188 188 mlx4_crdump_collect_crspace(dev, cr_space, id);
+41 -13
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
··· 860 860 u64 len; 861 861 int err; 862 862 863 + if (skb_cow_head(skb, MLXSW_TXHDR_LEN)) { 864 + this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped); 865 + dev_kfree_skb_any(skb); 866 + return NETDEV_TX_OK; 867 + } 868 + 863 869 memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb)); 864 870 865 871 if (mlxsw_core_skb_transmit_busy(mlxsw_sp->core, &tx_info)) 866 872 return NETDEV_TX_BUSY; 867 - 868 - if (unlikely(skb_headroom(skb) < MLXSW_TXHDR_LEN)) { 869 - struct sk_buff *skb_orig = skb; 870 - 871 - skb = skb_realloc_headroom(skb, MLXSW_TXHDR_LEN); 872 - if (!skb) { 873 - this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped); 874 - dev_kfree_skb_any(skb_orig); 875 - return NETDEV_TX_OK; 876 - } 877 - dev_consume_skb_any(skb_orig); 878 - } 879 873 880 874 if (eth_skb_pad(skb)) { 881 875 this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped); ··· 1209 1215 periodic_hw_stats.update_dw.work); 1210 1216 1211 1217 if (!netif_carrier_ok(mlxsw_sp_port->dev)) 1218 + /* Note: mlxsw_sp_port_down_wipe_counters() clears the cache as 1219 + * necessary when port goes down. 1220 + */ 1212 1221 goto out; 1213 1222 1214 1223 mlxsw_sp_port_get_hw_stats(mlxsw_sp_port->dev, ··· 4321 4324 return 0; 4322 4325 } 4323 4326 4327 + static void 4328 + mlxsw_sp_port_down_wipe_counters(struct mlxsw_sp_port *mlxsw_sp_port) 4329 + { 4330 + int i; 4331 + 4332 + for (i = 0; i < TC_MAX_QUEUE; i++) 4333 + mlxsw_sp_port->periodic_hw_stats.xstats.backlog[i] = 0; 4334 + } 4335 + 4324 4336 static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg, 4325 4337 char *pude_pl, void *priv) 4326 4338 { ··· 4351 4345 } else { 4352 4346 netdev_info(mlxsw_sp_port->dev, "link down\n"); 4353 4347 netif_carrier_off(mlxsw_sp_port->dev); 4348 + mlxsw_sp_port_down_wipe_counters(mlxsw_sp_port); 4354 4349 } 4355 4350 } 4356 4351 ··· 5139 5132 return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack); 5140 5133 } 5141 5134 5135 + static int mlxsw_sp3_init(struct mlxsw_core *mlxsw_core, 5136 + const struct mlxsw_bus_info *mlxsw_bus_info, 5137 + struct netlink_ext_ack *extack) 5138 + { 5139 + struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); 5140 + 5141 + mlxsw_sp->kvdl_ops = &mlxsw_sp2_kvdl_ops; 5142 + mlxsw_sp->afa_ops = &mlxsw_sp2_act_afa_ops; 5143 + mlxsw_sp->afk_ops = &mlxsw_sp2_afk_ops; 5144 + mlxsw_sp->mr_tcam_ops = &mlxsw_sp2_mr_tcam_ops; 5145 + mlxsw_sp->acl_tcam_ops = &mlxsw_sp2_acl_tcam_ops; 5146 + mlxsw_sp->nve_ops_arr = mlxsw_sp2_nve_ops_arr; 5147 + mlxsw_sp->mac_mask = mlxsw_sp2_mac_mask; 5148 + mlxsw_sp->rif_ops_arr = mlxsw_sp2_rif_ops_arr; 5149 + mlxsw_sp->sb_vals = &mlxsw_sp2_sb_vals; 5150 + mlxsw_sp->port_type_speed_ops = &mlxsw_sp2_port_type_speed_ops; 5151 + mlxsw_sp->ptp_ops = &mlxsw_sp2_ptp_ops; 5152 + 5153 + return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack); 5154 + } 5155 + 5142 5156 static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core) 5143 5157 { 5144 5158 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); ··· 5662 5634 static struct mlxsw_driver mlxsw_sp3_driver = { 5663 5635 .kind = mlxsw_sp3_driver_name, 5664 5636 .priv_size = sizeof(struct mlxsw_sp), 5665 - .init = mlxsw_sp2_init, 5637 + .init = mlxsw_sp3_init, 5666 5638 .fini = mlxsw_sp_fini, 5667 5639 .basic_trap_groups_set = mlxsw_sp_basic_trap_groups_set, 5668 5640 .port_split = mlxsw_sp_port_split,
+23 -7
drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
··· 195 195 return -EOPNOTSUPP; 196 196 } 197 197 198 + static u64 199 + mlxsw_sp_xstats_backlog(struct mlxsw_sp_port_xstats *xstats, int tclass_num) 200 + { 201 + return xstats->backlog[tclass_num] + 202 + xstats->backlog[tclass_num + 8]; 203 + } 204 + 205 + static u64 206 + mlxsw_sp_xstats_tail_drop(struct mlxsw_sp_port_xstats *xstats, int tclass_num) 207 + { 208 + return xstats->tail_drop[tclass_num] + 209 + xstats->tail_drop[tclass_num + 8]; 210 + } 211 + 198 212 static void 199 213 mlxsw_sp_qdisc_bstats_per_priority_get(struct mlxsw_sp_port_xstats *xstats, 200 214 u8 prio_bitmap, u64 *tx_packets, ··· 283 269 &stats_base->tx_bytes); 284 270 red_base->prob_mark = xstats->ecn; 285 271 red_base->prob_drop = xstats->wred_drop[tclass_num]; 286 - red_base->pdrop = xstats->tail_drop[tclass_num]; 272 + red_base->pdrop = mlxsw_sp_xstats_tail_drop(xstats, tclass_num); 287 273 288 274 stats_base->overlimits = red_base->prob_drop + red_base->prob_mark; 289 275 stats_base->drops = red_base->prob_drop + red_base->pdrop; ··· 384 370 385 371 early_drops = xstats->wred_drop[tclass_num] - xstats_base->prob_drop; 386 372 marks = xstats->ecn - xstats_base->prob_mark; 387 - pdrops = xstats->tail_drop[tclass_num] - xstats_base->pdrop; 373 + pdrops = mlxsw_sp_xstats_tail_drop(xstats, tclass_num) - 374 + xstats_base->pdrop; 388 375 389 376 res->pdrop += pdrops; 390 377 res->prob_drop += early_drops; ··· 418 403 419 404 overlimits = xstats->wred_drop[tclass_num] + xstats->ecn - 420 405 stats_base->overlimits; 421 - drops = xstats->wred_drop[tclass_num] + xstats->tail_drop[tclass_num] - 406 + drops = xstats->wred_drop[tclass_num] + 407 + mlxsw_sp_xstats_tail_drop(xstats, tclass_num) - 422 408 stats_base->drops; 423 - backlog = xstats->backlog[tclass_num]; 409 + backlog = mlxsw_sp_xstats_backlog(xstats, tclass_num); 424 410 425 411 _bstats_update(stats_ptr->bstats, tx_bytes, tx_packets); 426 412 stats_ptr->qstats->overlimits += overlimits; ··· 592 576 tx_packets = stats->tx_packets - stats_base->tx_packets; 593 577 594 578 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { 595 - drops += xstats->tail_drop[i]; 579 + drops += mlxsw_sp_xstats_tail_drop(xstats, i); 596 580 drops += xstats->wred_drop[i]; 597 - backlog += xstats->backlog[i]; 581 + backlog += mlxsw_sp_xstats_backlog(xstats, i); 598 582 } 599 583 drops = drops - stats_base->drops; 600 584 ··· 630 614 631 615 stats_base->drops = 0; 632 616 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { 633 - stats_base->drops += xstats->tail_drop[i]; 617 + stats_base->drops += mlxsw_sp_xstats_tail_drop(xstats, i); 634 618 stats_base->drops += xstats->wred_drop[i]; 635 619 } 636 620
+6 -11
drivers/net/ethernet/mellanox/mlxsw/switchx2.c
··· 299 299 u64 len; 300 300 int err; 301 301 302 + if (skb_cow_head(skb, MLXSW_TXHDR_LEN)) { 303 + this_cpu_inc(mlxsw_sx_port->pcpu_stats->tx_dropped); 304 + dev_kfree_skb_any(skb); 305 + return NETDEV_TX_OK; 306 + } 307 + 302 308 memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb)); 303 309 304 310 if (mlxsw_core_skb_transmit_busy(mlxsw_sx->core, &tx_info)) 305 311 return NETDEV_TX_BUSY; 306 312 307 - if (unlikely(skb_headroom(skb) < MLXSW_TXHDR_LEN)) { 308 - struct sk_buff *skb_orig = skb; 309 - 310 - skb = skb_realloc_headroom(skb, MLXSW_TXHDR_LEN); 311 - if (!skb) { 312 - this_cpu_inc(mlxsw_sx_port->pcpu_stats->tx_dropped); 313 - dev_kfree_skb_any(skb_orig); 314 - return NETDEV_TX_OK; 315 - } 316 - dev_consume_skb_any(skb_orig); 317 - } 318 313 mlxsw_sx_txhdr_construct(skb, &tx_info); 319 314 /* TX header is consumed by HW on the way so we shouldn't count its 320 315 * bytes as being sent.
+21 -17
drivers/net/ethernet/renesas/sh_eth.c
··· 2204 2204 if (cd->tsu) { 2205 2205 add_tsu_reg(ARSTR); 2206 2206 add_tsu_reg(TSU_CTRST); 2207 - add_tsu_reg(TSU_FWEN0); 2208 - add_tsu_reg(TSU_FWEN1); 2209 - add_tsu_reg(TSU_FCM); 2210 - add_tsu_reg(TSU_BSYSL0); 2211 - add_tsu_reg(TSU_BSYSL1); 2212 - add_tsu_reg(TSU_PRISL0); 2213 - add_tsu_reg(TSU_PRISL1); 2214 - add_tsu_reg(TSU_FWSL0); 2215 - add_tsu_reg(TSU_FWSL1); 2207 + if (cd->dual_port) { 2208 + add_tsu_reg(TSU_FWEN0); 2209 + add_tsu_reg(TSU_FWEN1); 2210 + add_tsu_reg(TSU_FCM); 2211 + add_tsu_reg(TSU_BSYSL0); 2212 + add_tsu_reg(TSU_BSYSL1); 2213 + add_tsu_reg(TSU_PRISL0); 2214 + add_tsu_reg(TSU_PRISL1); 2215 + add_tsu_reg(TSU_FWSL0); 2216 + add_tsu_reg(TSU_FWSL1); 2217 + } 2216 2218 add_tsu_reg(TSU_FWSLC); 2217 - add_tsu_reg(TSU_QTAGM0); 2218 - add_tsu_reg(TSU_QTAGM1); 2219 - add_tsu_reg(TSU_FWSR); 2220 - add_tsu_reg(TSU_FWINMK); 2221 - add_tsu_reg(TSU_ADQT0); 2222 - add_tsu_reg(TSU_ADQT1); 2223 - add_tsu_reg(TSU_VTAG0); 2224 - add_tsu_reg(TSU_VTAG1); 2219 + if (cd->dual_port) { 2220 + add_tsu_reg(TSU_QTAGM0); 2221 + add_tsu_reg(TSU_QTAGM1); 2222 + add_tsu_reg(TSU_FWSR); 2223 + add_tsu_reg(TSU_FWINMK); 2224 + add_tsu_reg(TSU_ADQT0); 2225 + add_tsu_reg(TSU_ADQT1); 2226 + add_tsu_reg(TSU_VTAG0); 2227 + add_tsu_reg(TSU_VTAG1); 2228 + } 2225 2229 add_tsu_reg(TSU_ADSBSY); 2226 2230 add_tsu_reg(TSU_TEN); 2227 2231 add_tsu_reg(TSU_POST1);
+13 -7
drivers/net/ethernet/socionext/sni_ave.c
··· 424 424 phy_ethtool_get_wol(ndev->phydev, wol); 425 425 } 426 426 427 + static int __ave_ethtool_set_wol(struct net_device *ndev, 428 + struct ethtool_wolinfo *wol) 429 + { 430 + if (!ndev->phydev || 431 + (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))) 432 + return -EOPNOTSUPP; 433 + 434 + return phy_ethtool_set_wol(ndev->phydev, wol); 435 + } 436 + 427 437 static int ave_ethtool_set_wol(struct net_device *ndev, 428 438 struct ethtool_wolinfo *wol) 429 439 { 430 440 int ret; 431 441 432 - if (!ndev->phydev || 433 - (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))) 434 - return -EOPNOTSUPP; 435 - 436 - ret = phy_ethtool_set_wol(ndev->phydev, wol); 442 + ret = __ave_ethtool_set_wol(ndev, wol); 437 443 if (!ret) 438 444 device_set_wakeup_enable(&ndev->dev, !!wol->wolopts); 439 445 ··· 1222 1216 1223 1217 /* set wol initial state disabled */ 1224 1218 wol.wolopts = 0; 1225 - ave_ethtool_set_wol(ndev, &wol); 1219 + __ave_ethtool_set_wol(ndev, &wol); 1226 1220 1227 1221 if (!phy_interface_is_rgmii(phydev)) 1228 1222 phy_set_max_speed(phydev, SPEED_100); ··· 1774 1768 1775 1769 ave_ethtool_get_wol(ndev, &wol); 1776 1770 wol.wolopts = priv->wolopts; 1777 - ave_ethtool_set_wol(ndev, &wol); 1771 + __ave_ethtool_set_wol(ndev, &wol); 1778 1772 1779 1773 if (ndev->phydev) { 1780 1774 ret = phy_resume(ndev->phydev);
+36 -16
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
··· 80 80 if (attr->max_size && (attr->max_size > size)) 81 81 size = attr->max_size; 82 82 83 - skb = netdev_alloc_skb_ip_align(priv->dev, size); 83 + skb = netdev_alloc_skb(priv->dev, size); 84 84 if (!skb) 85 85 return NULL; 86 86 ··· 244 244 struct net_device *orig_ndev) 245 245 { 246 246 struct stmmac_test_priv *tpriv = pt->af_packet_priv; 247 + unsigned char *src = tpriv->packet->src; 248 + unsigned char *dst = tpriv->packet->dst; 247 249 struct stmmachdr *shdr; 248 250 struct ethhdr *ehdr; 249 251 struct udphdr *uhdr; ··· 262 260 goto out; 263 261 264 262 ehdr = (struct ethhdr *)skb_mac_header(skb); 265 - if (tpriv->packet->dst) { 266 - if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst)) 263 + if (dst) { 264 + if (!ether_addr_equal_unaligned(ehdr->h_dest, dst)) 267 265 goto out; 268 266 } 269 267 if (tpriv->packet->sarc) { 270 - if (!ether_addr_equal(ehdr->h_source, ehdr->h_dest)) 268 + if (!ether_addr_equal_unaligned(ehdr->h_source, ehdr->h_dest)) 271 269 goto out; 272 - } else if (tpriv->packet->src) { 273 - if (!ether_addr_equal(ehdr->h_source, tpriv->packet->src)) 270 + } else if (src) { 271 + if (!ether_addr_equal_unaligned(ehdr->h_source, src)) 274 272 goto out; 275 273 } 276 274 ··· 716 714 struct ethhdr *ehdr; 717 715 718 716 ehdr = (struct ethhdr *)skb_mac_header(skb); 719 - if (!ether_addr_equal(ehdr->h_source, orig_ndev->dev_addr)) 717 + if (!ether_addr_equal_unaligned(ehdr->h_source, orig_ndev->dev_addr)) 720 718 goto out; 721 719 if (ehdr->h_proto != htons(ETH_P_PAUSE)) 722 720 goto out; ··· 853 851 if (tpriv->vlan_id) { 854 852 if (skb->vlan_proto != htons(proto)) 855 853 goto out; 856 - if (skb->vlan_tci != tpriv->vlan_id) 854 + if (skb->vlan_tci != tpriv->vlan_id) { 855 + /* Means filter did not work. */ 856 + tpriv->ok = false; 857 + complete(&tpriv->comp); 857 858 goto out; 859 + } 858 860 } 859 861 860 862 ehdr = (struct ethhdr *)skb_mac_header(skb); 861 - if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst)) 863 + if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->dst)) 862 864 goto out; 863 865 864 866 ihdr = ip_hdr(skb); ··· 971 965 { 972 966 int ret, prev_cap = priv->dma_cap.vlhash; 973 967 968 + if (!(priv->dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) 969 + return -EOPNOTSUPP; 970 + 974 971 priv->dma_cap.vlhash = 0; 975 972 ret = __stmmac_test_vlanfilt(priv); 976 973 priv->dma_cap.vlhash = prev_cap; ··· 1065 1056 static int stmmac_test_dvlanfilt_perfect(struct stmmac_priv *priv) 1066 1057 { 1067 1058 int ret, prev_cap = priv->dma_cap.vlhash; 1059 + 1060 + if (!(priv->dev->features & NETIF_F_HW_VLAN_STAG_FILTER)) 1061 + return -EOPNOTSUPP; 1068 1062 1069 1063 priv->dma_cap.vlhash = 0; 1070 1064 ret = __stmmac_test_dvlanfilt(priv); ··· 1335 1323 struct stmmac_packet_attrs attr = { }; 1336 1324 struct flow_dissector *dissector; 1337 1325 struct flow_cls_offload *cls; 1326 + int ret, old_enable = 0; 1338 1327 struct flow_rule *rule; 1339 - int ret; 1340 1328 1341 1329 if (!tc_can_offload(priv->dev)) 1342 1330 return -EOPNOTSUPP; 1343 1331 if (!priv->dma_cap.l3l4fnum) 1344 1332 return -EOPNOTSUPP; 1345 - if (priv->rss.enable) 1333 + if (priv->rss.enable) { 1334 + old_enable = priv->rss.enable; 1335 + priv->rss.enable = false; 1346 1336 stmmac_rss_configure(priv, priv->hw, NULL, 1347 1337 priv->plat->rx_queues_to_use); 1338 + } 1348 1339 1349 1340 dissector = kzalloc(sizeof(*dissector), GFP_KERNEL); 1350 1341 if (!dissector) { ··· 1414 1399 cleanup_dissector: 1415 1400 kfree(dissector); 1416 1401 cleanup_rss: 1417 - if (priv->rss.enable) { 1402 + if (old_enable) { 1403 + priv->rss.enable = old_enable; 1418 1404 stmmac_rss_configure(priv, priv->hw, &priv->rss, 1419 1405 priv->plat->rx_queues_to_use); 1420 1406 } ··· 1460 1444 struct stmmac_packet_attrs attr = { }; 1461 1445 struct flow_dissector *dissector; 1462 1446 struct flow_cls_offload *cls; 1447 + int ret, old_enable = 0; 1463 1448 struct flow_rule *rule; 1464 - int ret; 1465 1449 1466 1450 if (!tc_can_offload(priv->dev)) 1467 1451 return -EOPNOTSUPP; 1468 1452 if (!priv->dma_cap.l3l4fnum) 1469 1453 return -EOPNOTSUPP; 1470 - if (priv->rss.enable) 1454 + if (priv->rss.enable) { 1455 + old_enable = priv->rss.enable; 1456 + priv->rss.enable = false; 1471 1457 stmmac_rss_configure(priv, priv->hw, NULL, 1472 1458 priv->plat->rx_queues_to_use); 1459 + } 1473 1460 1474 1461 dissector = kzalloc(sizeof(*dissector), GFP_KERNEL); 1475 1462 if (!dissector) { ··· 1544 1525 cleanup_dissector: 1545 1526 kfree(dissector); 1546 1527 cleanup_rss: 1547 - if (priv->rss.enable) { 1528 + if (old_enable) { 1529 + priv->rss.enable = old_enable; 1548 1530 stmmac_rss_configure(priv, priv->hw, &priv->rss, 1549 1531 priv->plat->rx_queues_to_use); 1550 1532 } ··· 1598 1578 struct arphdr *ahdr; 1599 1579 1600 1580 ehdr = (struct ethhdr *)skb_mac_header(skb); 1601 - if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->src)) 1581 + if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->src)) 1602 1582 goto out; 1603 1583 1604 1584 ahdr = arp_hdr(skb);
+4
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
··· 577 577 { 578 578 int ret = 0; 579 579 580 + /* When RSS is enabled, the filtering will be bypassed */ 581 + if (priv->rss.enable) 582 + return -EBUSY; 583 + 580 584 switch (cls->command) { 581 585 case FLOW_CLS_REPLACE: 582 586 ret = tc_add_flow(priv, cls);
-2
drivers/net/hyperv/rndis_filter.c
··· 1443 1443 /* Halt and release the rndis device */ 1444 1444 rndis_filter_halt_device(net_dev, rndis_dev); 1445 1445 1446 - net_dev->extension = NULL; 1447 - 1448 1446 netvsc_device_remove(dev); 1449 1447 } 1450 1448
+3 -2
drivers/net/macvlan.c
··· 259 259 struct net_device *src, 260 260 enum macvlan_mode mode) 261 261 { 262 - const struct ethhdr *eth = skb_eth_hdr(skb); 262 + const struct ethhdr *eth = eth_hdr(skb); 263 263 const struct macvlan_dev *vlan; 264 264 struct sk_buff *nskb; 265 265 unsigned int i; ··· 513 513 const struct macvlan_dev *dest; 514 514 515 515 if (vlan->mode == MACVLAN_MODE_BRIDGE) { 516 - const struct ethhdr *eth = (void *)skb->data; 516 + const struct ethhdr *eth = skb_eth_hdr(skb); 517 517 518 518 /* send to other bridge ports directly */ 519 519 if (is_multicast_ether_addr(eth->h_dest)) { 520 + skb_reset_mac_header(skb); 520 521 macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE); 521 522 goto xmit_world; 522 523 }
+1 -1
drivers/net/netdevsim/dev.c
··· 53 53 54 54 get_random_bytes(dummy_data, NSIM_DEV_DUMMY_REGION_SIZE); 55 55 56 - id = devlink_region_shapshot_id_get(priv_to_devlink(nsim_dev)); 56 + id = devlink_region_snapshot_id_get(priv_to_devlink(nsim_dev)); 57 57 err = devlink_region_snapshot_create(nsim_dev->dummy_region, 58 58 dummy_data, id, kfree); 59 59 if (err) {
+4 -4
drivers/net/phy/Kconfig
··· 340 340 Currently supports dm9161e and dm9131 341 341 342 342 config DP83822_PHY 343 - tristate "Texas Instruments DP83822 PHY" 343 + tristate "Texas Instruments DP83822/825 PHYs" 344 344 ---help--- 345 - Supports the DP83822 PHY. 345 + Supports the DP83822 and DP83825I PHYs. 346 346 347 347 config DP83TC811_PHY 348 - tristate "Texas Instruments DP83TC822 PHY" 348 + tristate "Texas Instruments DP83TC811 PHY" 349 349 ---help--- 350 - Supports the DP83TC822 PHY. 350 + Supports the DP83TC811 PHY. 351 351 352 352 config DP83848_PHY 353 353 tristate "Texas Instruments DP83848 PHY"
+7 -1
drivers/net/phy/dp83867.c
··· 97 97 #define DP83867_PHYCR_FIFO_DEPTH_MAX 0x03 98 98 #define DP83867_PHYCR_FIFO_DEPTH_MASK GENMASK(15, 14) 99 99 #define DP83867_PHYCR_RESERVED_MASK BIT(11) 100 + #define DP83867_PHYCR_FORCE_LINK_GOOD BIT(10) 100 101 101 102 /* RGMIIDCTL bits */ 102 103 #define DP83867_RGMII_TX_CLK_DELAY_MAX 0xf ··· 600 599 601 600 usleep_range(10, 20); 602 601 603 - return 0; 602 + /* After reset FORCE_LINK_GOOD bit is set. Although the 603 + * default value should be unset. Disable FORCE_LINK_GOOD 604 + * for the phy to work properly. 605 + */ 606 + return phy_modify(phydev, MII_DP83867_PHYCTRL, 607 + DP83867_PHYCR_FORCE_LINK_GOOD, 0); 604 608 } 605 609 606 610 static struct phy_driver dp83867_driver[] = {
+1
drivers/net/usb/lan78xx.c
··· 3750 3750 3751 3751 /* MTU range: 68 - 9000 */ 3752 3752 netdev->max_mtu = MAX_SINGLE_PACKET_SIZE; 3753 + netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER); 3753 3754 3754 3755 dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0; 3755 3756 dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1;
+1
drivers/net/usb/qmi_wwan.c
··· 1062 1062 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ 1063 1063 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */ 1064 1064 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ 1065 + {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */ 1065 1066 1066 1067 /* 3. Combined interface devices matching on interface number */ 1067 1068 {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
+3
drivers/net/usb/r8152.c
··· 6597 6597 return -ENODEV; 6598 6598 } 6599 6599 6600 + if (intf->cur_altsetting->desc.bNumEndpoints < 3) 6601 + return -ENODEV; 6602 + 6600 6603 usb_reset_device(udev); 6601 6604 netdev = alloc_etherdev(sizeof(struct r8152)); 6602 6605 if (!netdev) {
+1 -1
drivers/net/wan/fsl_ucc_hdlc.c
··· 73 73 }, 74 74 }; 75 75 76 - static struct ucc_tdm_info utdm_info[MAX_HDLC_NUM]; 76 + static struct ucc_tdm_info utdm_info[UCC_MAX_NUM]; 77 77 78 78 static int uhdlc_init(struct ucc_hdlc_private *priv) 79 79 {
+1 -1
drivers/net/wan/lapbether.c
··· 64 64 { 65 65 struct lapbethdev *lapbeth; 66 66 67 - list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node) { 67 + list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node, lockdep_rtnl_is_held()) { 68 68 if (lapbeth->ethdev == dev) 69 69 return lapbeth; 70 70 }
+1 -1
drivers/nfc/pn533/usb.c
··· 391 391 cmd, sizeof(cmd), false); 392 392 393 393 rc = usb_bulk_msg(phy->udev, phy->out_urb->pipe, buffer, sizeof(cmd), 394 - &transferred, 0); 394 + &transferred, 5000); 395 395 kfree(buffer); 396 396 if (rc || (transferred != sizeof(cmd))) { 397 397 nfc_err(&phy->udev->dev,
+2 -2
drivers/ptp/ptp_clock.c
··· 170 170 { 171 171 struct ptp_clock *ptp = container_of(dev, struct ptp_clock, dev); 172 172 173 + ptp_cleanup_pin_groups(ptp); 173 174 mutex_destroy(&ptp->tsevq_mux); 174 175 mutex_destroy(&ptp->pincfg_mux); 175 176 ida_simple_remove(&ptp_clocks_map, ptp->index); ··· 303 302 if (ptp->pps_source) 304 303 pps_unregister_source(ptp->pps_source); 305 304 306 - ptp_cleanup_pin_groups(ptp); 307 - 308 305 posix_clock_unregister(&ptp->clock); 306 + 309 307 return 0; 310 308 } 311 309 EXPORT_SYMBOL(ptp_clock_unregister);
+9 -4
include/linux/skmsg.h
··· 358 358 static inline void sk_psock_restore_proto(struct sock *sk, 359 359 struct sk_psock *psock) 360 360 { 361 - sk->sk_write_space = psock->saved_write_space; 361 + sk->sk_prot->unhash = psock->saved_unhash; 362 362 363 363 if (psock->sk_proto) { 364 364 struct inet_connection_sock *icsk = inet_csk(sk); 365 365 bool has_ulp = !!icsk->icsk_ulp_data; 366 366 367 - if (has_ulp) 368 - tcp_update_ulp(sk, psock->sk_proto); 369 - else 367 + if (has_ulp) { 368 + tcp_update_ulp(sk, psock->sk_proto, 369 + psock->saved_write_space); 370 + } else { 370 371 sk->sk_prot = psock->sk_proto; 372 + sk->sk_write_space = psock->saved_write_space; 373 + } 371 374 psock->sk_proto = NULL; 375 + } else { 376 + sk->sk_write_space = psock->saved_write_space; 372 377 } 373 378 } 374 379
+1 -1
include/linux/tnum.h
··· 30 30 /* Shift (rsh) a tnum right (by a fixed shift) */ 31 31 struct tnum tnum_rshift(struct tnum a, u8 shift); 32 32 /* Shift (arsh) a tnum right (by a fixed min_shift) */ 33 - struct tnum tnum_arshift(struct tnum a, u8 min_shift); 33 + struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness); 34 34 /* Add two tnums, return @a + @b */ 35 35 struct tnum tnum_add(struct tnum a, struct tnum b); 36 36 /* Subtract two tnums, return @a - @b */
+5
include/net/cfg80211.h
··· 3548 3548 * 3549 3549 * @start_radar_detection: Start radar detection in the driver. 3550 3550 * 3551 + * @end_cac: End running CAC, probably because a related CAC 3552 + * was finished on another phy. 3553 + * 3551 3554 * @update_ft_ies: Provide updated Fast BSS Transition information to the 3552 3555 * driver. If the SME is in the driver/firmware, this information can be 3553 3556 * used in building Authentication and Reassociation Request frames. ··· 3877 3874 struct net_device *dev, 3878 3875 struct cfg80211_chan_def *chandef, 3879 3876 u32 cac_time_ms); 3877 + void (*end_cac)(struct wiphy *wiphy, 3878 + struct net_device *dev); 3880 3879 int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev, 3881 3880 struct cfg80211_update_ft_ies_params *ftie); 3882 3881 int (*crit_proto_start)(struct wiphy *wiphy,
+1 -1
include/net/devlink.h
··· 938 938 u32 region_max_snapshots, 939 939 u64 region_size); 940 940 void devlink_region_destroy(struct devlink_region *region); 941 - u32 devlink_region_shapshot_id_get(struct devlink *devlink); 941 + u32 devlink_region_snapshot_id_get(struct devlink *devlink); 942 942 int devlink_region_snapshot_create(struct devlink_region *region, 943 943 u8 *data, u32 snapshot_id, 944 944 devlink_snapshot_data_dest_t *data_destructor);
+4 -2
include/net/tcp.h
··· 2147 2147 /* initialize ulp */ 2148 2148 int (*init)(struct sock *sk); 2149 2149 /* update ulp */ 2150 - void (*update)(struct sock *sk, struct proto *p); 2150 + void (*update)(struct sock *sk, struct proto *p, 2151 + void (*write_space)(struct sock *sk)); 2151 2152 /* cleanup ulp */ 2152 2153 void (*release)(struct sock *sk); 2153 2154 /* diagnostic */ ··· 2163 2162 int tcp_set_ulp(struct sock *sk, const char *name); 2164 2163 void tcp_get_available_ulp(char *buf, size_t len); 2165 2164 void tcp_cleanup_ulp(struct sock *sk); 2166 - void tcp_update_ulp(struct sock *sk, struct proto *p); 2165 + void tcp_update_ulp(struct sock *sk, struct proto *p, 2166 + void (*write_space)(struct sock *sk)); 2167 2167 2168 2168 #define MODULE_ALIAS_TCP_ULP(name) \ 2169 2169 __MODULE_INFO(alias, alias_userspace, name); \
+7 -2
kernel/bpf/tnum.c
··· 44 44 return TNUM(a.value >> shift, a.mask >> shift); 45 45 } 46 46 47 - struct tnum tnum_arshift(struct tnum a, u8 min_shift) 47 + struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness) 48 48 { 49 49 /* if a.value is negative, arithmetic shifting by minimum shift 50 50 * will have larger negative offset compared to more shifting. 51 51 * If a.value is nonnegative, arithmetic shifting by minimum shift 52 52 * will have larger positive offset compare to more shifting. 53 53 */ 54 - return TNUM((s64)a.value >> min_shift, (s64)a.mask >> min_shift); 54 + if (insn_bitness == 32) 55 + return TNUM((u32)(((s32)a.value) >> min_shift), 56 + (u32)(((s32)a.mask) >> min_shift)); 57 + else 58 + return TNUM((s64)a.value >> min_shift, 59 + (s64)a.mask >> min_shift); 55 60 } 56 61 57 62 struct tnum tnum_add(struct tnum a, struct tnum b)
+10 -3
kernel/bpf/verifier.c
··· 5049 5049 /* Upon reaching here, src_known is true and 5050 5050 * umax_val is equal to umin_val. 5051 5051 */ 5052 - dst_reg->smin_value >>= umin_val; 5053 - dst_reg->smax_value >>= umin_val; 5054 - dst_reg->var_off = tnum_arshift(dst_reg->var_off, umin_val); 5052 + if (insn_bitness == 32) { 5053 + dst_reg->smin_value = (u32)(((s32)dst_reg->smin_value) >> umin_val); 5054 + dst_reg->smax_value = (u32)(((s32)dst_reg->smax_value) >> umin_val); 5055 + } else { 5056 + dst_reg->smin_value >>= umin_val; 5057 + dst_reg->smax_value >>= umin_val; 5058 + } 5059 + 5060 + dst_reg->var_off = tnum_arshift(dst_reg->var_off, umin_val, 5061 + insn_bitness); 5055 5062 5056 5063 /* blow away the dst_reg umin_value/umax_value and rely on 5057 5064 * dst_reg var_off to refine the result.
+3 -1
net/batman-adv/distributed-arp-table.c
··· 285 285 u32 hash = 0; 286 286 const struct batadv_dat_entry *dat = data; 287 287 const unsigned char *key; 288 + __be16 vid; 288 289 u32 i; 289 290 290 291 key = (const unsigned char *)&dat->ip; ··· 295 294 hash ^= (hash >> 6); 296 295 } 297 296 298 - key = (const unsigned char *)&dat->vid; 297 + vid = htons(dat->vid); 298 + key = (__force const unsigned char *)&vid; 299 299 for (i = 0; i < sizeof(dat->vid); i++) { 300 300 hash += key[i]; 301 301 hash += (hash << 10);
-12
net/core/dev.c
··· 9177 9177 9178 9178 void netdev_update_lockdep_key(struct net_device *dev) 9179 9179 { 9180 - struct netdev_queue *queue; 9181 - int i; 9182 - 9183 - lockdep_unregister_key(&dev->qdisc_xmit_lock_key); 9184 9180 lockdep_unregister_key(&dev->addr_list_lock_key); 9185 - 9186 - lockdep_register_key(&dev->qdisc_xmit_lock_key); 9187 9181 lockdep_register_key(&dev->addr_list_lock_key); 9188 9182 9189 9183 lockdep_set_class(&dev->addr_list_lock, &dev->addr_list_lock_key); 9190 - for (i = 0; i < dev->num_tx_queues; i++) { 9191 - queue = netdev_get_tx_queue(dev, i); 9192 - 9193 - lockdep_set_class(&queue->_xmit_lock, 9194 - &dev->qdisc_xmit_lock_key); 9195 - } 9196 9184 } 9197 9185 EXPORT_SYMBOL(netdev_update_lockdep_key); 9198 9186
+4 -4
net/core/devlink.c
··· 6406 6406 devlink_port->attrs.flavour != DEVLINK_PORT_FLAVOUR_DSA; 6407 6407 } 6408 6408 6409 - #define DEVLINK_PORT_TYPE_WARN_TIMEOUT (HZ * 30) 6409 + #define DEVLINK_PORT_TYPE_WARN_TIMEOUT (HZ * 3600) 6410 6410 6411 6411 static void devlink_port_type_warn_schedule(struct devlink_port *devlink_port) 6412 6412 { ··· 7563 7563 EXPORT_SYMBOL_GPL(devlink_region_destroy); 7564 7564 7565 7565 /** 7566 - * devlink_region_shapshot_id_get - get snapshot ID 7566 + * devlink_region_snapshot_id_get - get snapshot ID 7567 7567 * 7568 7568 * This callback should be called when adding a new snapshot, 7569 7569 * Driver should use the same id for multiple snapshots taken ··· 7571 7571 * 7572 7572 * @devlink: devlink 7573 7573 */ 7574 - u32 devlink_region_shapshot_id_get(struct devlink *devlink) 7574 + u32 devlink_region_snapshot_id_get(struct devlink *devlink) 7575 7575 { 7576 7576 u32 id; 7577 7577 ··· 7581 7581 7582 7582 return id; 7583 7583 } 7584 - EXPORT_SYMBOL_GPL(devlink_region_shapshot_id_get); 7584 + EXPORT_SYMBOL_GPL(devlink_region_snapshot_id_get); 7585 7585 7586 7586 /** 7587 7587 * devlink_region_snapshot_create - create a new snapshot
+10 -10
net/core/filter.c
··· 2231 2231 /* First find the starting scatterlist element */ 2232 2232 i = msg->sg.start; 2233 2233 do { 2234 + offset += len; 2234 2235 len = sk_msg_elem(msg, i)->length; 2235 2236 if (start < offset + len) 2236 2237 break; 2237 - offset += len; 2238 2238 sk_msg_iter_var_next(i); 2239 2239 } while (i != msg->sg.end); 2240 2240 ··· 2346 2346 u32, len, u64, flags) 2347 2347 { 2348 2348 struct scatterlist sge, nsge, nnsge, rsge = {0}, *psge; 2349 - u32 new, i = 0, l, space, copy = 0, offset = 0; 2349 + u32 new, i = 0, l = 0, space, copy = 0, offset = 0; 2350 2350 u8 *raw, *to, *from; 2351 2351 struct page *page; 2352 2352 ··· 2356 2356 /* First find the starting scatterlist element */ 2357 2357 i = msg->sg.start; 2358 2358 do { 2359 + offset += l; 2359 2360 l = sk_msg_elem(msg, i)->length; 2360 2361 2361 2362 if (start < offset + l) 2362 2363 break; 2363 - offset += l; 2364 2364 sk_msg_iter_var_next(i); 2365 2365 } while (i != msg->sg.end); 2366 2366 ··· 2415 2415 2416 2416 sk_msg_iter_var_next(i); 2417 2417 sg_unmark_end(psge); 2418 + sg_unmark_end(&rsge); 2418 2419 sk_msg_iter_next(msg, end); 2419 2420 } 2420 2421 ··· 2507 2506 BPF_CALL_4(bpf_msg_pop_data, struct sk_msg *, msg, u32, start, 2508 2507 u32, len, u64, flags) 2509 2508 { 2510 - u32 i = 0, l, space, offset = 0; 2509 + u32 i = 0, l = 0, space, offset = 0; 2511 2510 u64 last = start + len; 2512 2511 int pop; 2513 2512 ··· 2517 2516 /* First find the starting scatterlist element */ 2518 2517 i = msg->sg.start; 2519 2518 do { 2519 + offset += l; 2520 2520 l = sk_msg_elem(msg, i)->length; 2521 2521 2522 2522 if (start < offset + l) 2523 2523 break; 2524 - offset += l; 2525 2524 sk_msg_iter_var_next(i); 2526 2525 } while (i != msg->sg.end); 2527 2526 ··· 5319 5318 if (sk) { 5320 5319 sk = sk_to_full_sk(sk); 5321 5320 if (!sk_fullsock(sk)) { 5322 - if (!sock_flag(sk, SOCK_RCU_FREE)) 5323 - sock_gen_put(sk); 5321 + sock_gen_put(sk); 5324 5322 return NULL; 5325 5323 } 5326 5324 } ··· 5356 5356 if (sk) { 5357 5357 sk = sk_to_full_sk(sk); 5358 5358 if (!sk_fullsock(sk)) { 5359 - if (!sock_flag(sk, SOCK_RCU_FREE)) 5360 - sock_gen_put(sk); 5359 + sock_gen_put(sk); 5361 5360 return NULL; 5362 5361 } 5363 5362 } ··· 5423 5424 5424 5425 BPF_CALL_1(bpf_sk_release, struct sock *, sk) 5425 5426 { 5426 - if (!sock_flag(sk, SOCK_RCU_FREE)) 5427 + /* Only full sockets have sk->sk_flags. */ 5428 + if (!sk_fullsock(sk) || !sock_flag(sk, SOCK_RCU_FREE)) 5427 5429 sock_gen_put(sk); 5428 5430 return 0; 5429 5431 }
+2
net/core/skmsg.c
··· 594 594 595 595 void sk_psock_drop(struct sock *sk, struct sk_psock *psock) 596 596 { 597 + sock_owned_by_me(sk); 598 + 597 599 sk_psock_cork_free(psock); 598 600 sk_psock_zap_ingress(psock); 599 601
+6 -1
net/core/sock_map.c
··· 241 241 struct sock *sk; 242 242 243 243 sk = xchg(psk, NULL); 244 - if (sk) 244 + if (sk) { 245 + lock_sock(sk); 245 246 sock_map_unref(sk, psk); 247 + release_sock(sk); 248 + } 246 249 } 247 250 raw_spin_unlock_bh(&stab->lock); 248 251 rcu_read_unlock(); ··· 865 862 raw_spin_lock_bh(&bucket->lock); 866 863 hlist_for_each_entry_safe(elem, node, &bucket->head, node) { 867 864 hlist_del_rcu(&elem->node); 865 + lock_sock(elem->sk); 868 866 sock_map_unref(elem->sk, elem); 867 + release_sock(elem->sk); 869 868 } 870 869 raw_spin_unlock_bh(&bucket->lock); 871 870 }
+1 -1
net/dsa/tag_gswip.c
··· 104 104 } 105 105 106 106 static const struct dsa_device_ops gswip_netdev_ops = { 107 - .name = "gwsip", 107 + .name = "gswip", 108 108 .proto = DSA_TAG_PROTO_GSWIP, 109 109 .xmit = gswip_tag_xmit, 110 110 .rcv = gswip_tag_rcv,
-3
net/dsa/tag_qca.c
··· 33 33 struct dsa_port *dp = dsa_slave_to_port(dev); 34 34 u16 *phdr, hdr; 35 35 36 - dev->stats.tx_packets++; 37 - dev->stats.tx_bytes += skb->len; 38 - 39 36 if (skb_cow_head(skb, 0) < 0) 40 37 return NULL; 41 38
+6
net/ipv4/fib_trie.c
··· 2193 2193 int count = cb->args[2]; 2194 2194 t_key key = cb->args[3]; 2195 2195 2196 + /* First time here, count and key are both always 0. Count > 0 2197 + * and key == 0 means the dump has wrapped around and we are done. 2198 + */ 2199 + if (count && !key) 2200 + return skb->len; 2201 + 2196 2202 while ((l = leaf_walk_rcu(&tp, key)) != NULL) { 2197 2203 int err; 2198 2204
+10 -9
net/ipv4/netfilter/arp_tables.c
··· 496 496 return 0; 497 497 } 498 498 499 - static inline void cleanup_entry(struct arpt_entry *e) 499 + static void cleanup_entry(struct arpt_entry *e, struct net *net) 500 500 { 501 501 struct xt_tgdtor_param par; 502 502 struct xt_entry_target *t; 503 503 504 504 t = arpt_get_target(e); 505 + par.net = net; 505 506 par.target = t->u.kernel.target; 506 507 par.targinfo = t->data; 507 508 par.family = NFPROTO_ARP; ··· 585 584 xt_entry_foreach(iter, entry0, newinfo->size) { 586 585 if (i-- == 0) 587 586 break; 588 - cleanup_entry(iter); 587 + cleanup_entry(iter, net); 589 588 } 590 589 return ret; 591 590 } ··· 928 927 /* Decrease module usage counts and free resource */ 929 928 loc_cpu_old_entry = oldinfo->entries; 930 929 xt_entry_foreach(iter, loc_cpu_old_entry, oldinfo->size) 931 - cleanup_entry(iter); 930 + cleanup_entry(iter, net); 932 931 933 932 xt_free_table_info(oldinfo); 934 933 if (copy_to_user(counters_ptr, counters, ··· 991 990 992 991 free_newinfo_untrans: 993 992 xt_entry_foreach(iter, loc_cpu_entry, newinfo->size) 994 - cleanup_entry(iter); 993 + cleanup_entry(iter, net); 995 994 free_newinfo: 996 995 xt_free_table_info(newinfo); 997 996 return ret; ··· 1288 1287 1289 1288 free_newinfo_untrans: 1290 1289 xt_entry_foreach(iter, loc_cpu_entry, newinfo->size) 1291 - cleanup_entry(iter); 1290 + cleanup_entry(iter, net); 1292 1291 free_newinfo: 1293 1292 xt_free_table_info(newinfo); 1294 1293 return ret; ··· 1515 1514 return ret; 1516 1515 } 1517 1516 1518 - static void __arpt_unregister_table(struct xt_table *table) 1517 + static void __arpt_unregister_table(struct net *net, struct xt_table *table) 1519 1518 { 1520 1519 struct xt_table_info *private; 1521 1520 void *loc_cpu_entry; ··· 1527 1526 /* Decrease module usage counts and free resources */ 1528 1527 loc_cpu_entry = private->entries; 1529 1528 xt_entry_foreach(iter, loc_cpu_entry, private->size) 1530 - cleanup_entry(iter); 1529 + cleanup_entry(iter, net); 1531 1530 if (private->number > private->initial_entries) 1532 1531 module_put(table_owner); 1533 1532 xt_free_table_info(private); ··· 1567 1566 1568 1567 ret = nf_register_net_hooks(net, ops, hweight32(table->valid_hooks)); 1569 1568 if (ret != 0) { 1570 - __arpt_unregister_table(new_table); 1569 + __arpt_unregister_table(net, new_table); 1571 1570 *res = NULL; 1572 1571 } 1573 1572 ··· 1582 1581 const struct nf_hook_ops *ops) 1583 1582 { 1584 1583 nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks)); 1585 - __arpt_unregister_table(table); 1584 + __arpt_unregister_table(net, table); 1586 1585 } 1587 1586 1588 1587 /* The built-in targets: standard (NULL) and error. */
+7 -10
net/ipv4/tcp_bpf.c
··· 121 121 struct sk_psock *psock; 122 122 int copied, ret; 123 123 124 - if (unlikely(flags & MSG_ERRQUEUE)) 125 - return inet_recv_error(sk, msg, len, addr_len); 126 - if (!skb_queue_empty(&sk->sk_receive_queue)) 127 - return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len); 128 - 129 124 psock = sk_psock_get(sk); 130 125 if (unlikely(!psock)) 126 + return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len); 127 + if (unlikely(flags & MSG_ERRQUEUE)) 128 + return inet_recv_error(sk, msg, len, addr_len); 129 + if (!skb_queue_empty(&sk->sk_receive_queue) && 130 + sk_psock_queue_empty(psock)) 131 131 return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len); 132 132 lock_sock(sk); 133 133 msg_bytes_ready: ··· 139 139 timeo = sock_rcvtimeo(sk, nonblock); 140 140 data = tcp_bpf_wait_data(sk, psock, flags, timeo, &err); 141 141 if (data) { 142 - if (skb_queue_empty(&sk->sk_receive_queue)) 142 + if (!sk_psock_queue_empty(psock)) 143 143 goto msg_bytes_ready; 144 144 release_sock(sk); 145 145 sk_psock_put(sk, psock); ··· 315 315 */ 316 316 delta = msg->sg.size; 317 317 psock->eval = sk_psock_msg_verdict(sk, psock, msg); 318 - if (msg->sg.size < delta) 319 - delta -= msg->sg.size; 320 - else 321 - delta = 0; 318 + delta -= msg->sg.size; 322 319 } 323 320 324 321 if (msg->cork_bytes &&
+4 -3
net/ipv4/tcp_input.c
··· 915 915 /* This must be called before lost_out is incremented */ 916 916 static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb) 917 917 { 918 - if (!tp->retransmit_skb_hint || 919 - before(TCP_SKB_CB(skb)->seq, 920 - TCP_SKB_CB(tp->retransmit_skb_hint)->seq)) 918 + if ((!tp->retransmit_skb_hint && tp->retrans_out >= tp->lost_out) || 919 + (tp->retransmit_skb_hint && 920 + before(TCP_SKB_CB(skb)->seq, 921 + TCP_SKB_CB(tp->retransmit_skb_hint)->seq))) 921 922 tp->retransmit_skb_hint = skb; 922 923 } 923 924
+4 -2
net/ipv4/tcp_ulp.c
··· 99 99 rcu_read_unlock(); 100 100 } 101 101 102 - void tcp_update_ulp(struct sock *sk, struct proto *proto) 102 + void tcp_update_ulp(struct sock *sk, struct proto *proto, 103 + void (*write_space)(struct sock *sk)) 103 104 { 104 105 struct inet_connection_sock *icsk = inet_csk(sk); 105 106 106 107 if (!icsk->icsk_ulp_ops) { 108 + sk->sk_write_space = write_space; 107 109 sk->sk_prot = proto; 108 110 return; 109 111 } 110 112 111 113 if (icsk->icsk_ulp_ops->update) 112 - icsk->icsk_ulp_ops->update(sk, proto); 114 + icsk->icsk_ulp_ops->update(sk, proto, write_space); 113 115 } 114 116 115 117 void tcp_cleanup_ulp(struct sock *sk)
+23
net/mac80211/cfg.c
··· 2954 2954 return err; 2955 2955 } 2956 2956 2957 + static void ieee80211_end_cac(struct wiphy *wiphy, 2958 + struct net_device *dev) 2959 + { 2960 + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 2961 + struct ieee80211_local *local = sdata->local; 2962 + 2963 + mutex_lock(&local->mtx); 2964 + list_for_each_entry(sdata, &local->interfaces, list) { 2965 + /* it might be waiting for the local->mtx, but then 2966 + * by the time it gets it, sdata->wdev.cac_started 2967 + * will no longer be true 2968 + */ 2969 + cancel_delayed_work(&sdata->dfs_cac_timer_work); 2970 + 2971 + if (sdata->wdev.cac_started) { 2972 + ieee80211_vif_release_channel(sdata); 2973 + sdata->wdev.cac_started = false; 2974 + } 2975 + } 2976 + mutex_unlock(&local->mtx); 2977 + } 2978 + 2957 2979 static struct cfg80211_beacon_data * 2958 2980 cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon) 2959 2981 { ··· 4045 4023 #endif 4046 4024 .get_channel = ieee80211_cfg_get_channel, 4047 4025 .start_radar_detection = ieee80211_start_radar_detection, 4026 + .end_cac = ieee80211_end_cac, 4048 4027 .channel_switch = ieee80211_channel_switch, 4049 4028 .set_qos_map = ieee80211_set_qos_map, 4050 4029 .set_ap_chanwidth = ieee80211_set_ap_chanwidth,
+3
net/mac80211/mesh_hwmp.c
··· 328 328 unsigned long fail_avg = 329 329 ewma_mesh_fail_avg_read(&sta->mesh->fail_avg); 330 330 331 + if (sta->mesh->plink_state != NL80211_PLINK_ESTAB) 332 + return MAX_METRIC; 333 + 331 334 /* Try to get rate based on HW/SW RC algorithm. 332 335 * Rate is returned in units of Kbps, correct this 333 336 * to comply with airtime calculation units
+15 -3
net/mac80211/tkip.c
··· 263 263 if ((keyid >> 6) != key->conf.keyidx) 264 264 return TKIP_DECRYPT_INVALID_KEYIDX; 265 265 266 - if (rx_ctx->ctx.state != TKIP_STATE_NOT_INIT && 267 - (iv32 < rx_ctx->iv32 || 268 - (iv32 == rx_ctx->iv32 && iv16 <= rx_ctx->iv16))) 266 + /* Reject replays if the received TSC is smaller than or equal to the 267 + * last received value in a valid message, but with an exception for 268 + * the case where a new key has been set and no valid frame using that 269 + * key has yet received and the local RSC was initialized to 0. This 270 + * exception allows the very first frame sent by the transmitter to be 271 + * accepted even if that transmitter were to use TSC 0 (IEEE 802.11 272 + * described TSC to be initialized to 1 whenever a new key is taken into 273 + * use). 274 + */ 275 + if (iv32 < rx_ctx->iv32 || 276 + (iv32 == rx_ctx->iv32 && 277 + (iv16 < rx_ctx->iv16 || 278 + (iv16 == rx_ctx->iv16 && 279 + (rx_ctx->iv32 || rx_ctx->iv16 || 280 + rx_ctx->ctx.state != TKIP_STATE_NOT_INIT))))) 269 281 return TKIP_DECRYPT_REPLAY; 270 282 271 283 if (only_iv) {
+1 -1
net/netfilter/ipset/ip_set_bitmap_gen.h
··· 60 60 if (SET_WITH_TIMEOUT(set)) 61 61 del_timer_sync(&map->gc); 62 62 63 - ip_set_free(map->members); 64 63 if (set->dsize && set->extensions & IPSET_EXT_DESTROY) 65 64 mtype_ext_cleanup(set); 65 + ip_set_free(map->members); 66 66 ip_set_free(map); 67 67 68 68 set->data = NULL;
+13
net/netfilter/nf_nat_proto.c
··· 233 233 return false; 234 234 235 235 hdr = (struct icmphdr *)(skb->data + hdroff); 236 + switch (hdr->type) { 237 + case ICMP_ECHO: 238 + case ICMP_ECHOREPLY: 239 + case ICMP_TIMESTAMP: 240 + case ICMP_TIMESTAMPREPLY: 241 + case ICMP_INFO_REQUEST: 242 + case ICMP_INFO_REPLY: 243 + case ICMP_ADDRESS: 244 + case ICMP_ADDRESSREPLY: 245 + break; 246 + default: 247 + return true; 248 + } 236 249 inet_proto_csum_replace2(&hdr->checksum, skb, 237 250 hdr->un.echo.id, tuple->src.u.icmp.id, false); 238 251 hdr->un.echo.id = tuple->src.u.icmp.id;
+26 -13
net/netfilter/nf_tables_api.c
··· 22 22 #include <net/net_namespace.h> 23 23 #include <net/sock.h> 24 24 25 + #define NFT_MODULE_AUTOLOAD_LIMIT (MODULE_NAME_LEN - sizeof("nft-expr-255-")) 26 + 25 27 static LIST_HEAD(nf_tables_expressions); 26 28 static LIST_HEAD(nf_tables_objects); 27 29 static LIST_HEAD(nf_tables_flowtables); ··· 566 564 } 567 565 568 566 /* 569 - * Loading a module requires dropping mutex that guards the 570 - * transaction. 571 - * We first need to abort any pending transactions as once 572 - * mutex is unlocked a different client could start a new 573 - * transaction. It must not see any 'future generation' 574 - * changes * as these changes will never happen. 567 + * Loading a module requires dropping mutex that guards the transaction. 568 + * A different client might race to start a new transaction meanwhile. Zap the 569 + * list of pending transaction and then restore it once the mutex is grabbed 570 + * again. Users of this function return EAGAIN which implicitly triggers the 571 + * transaction abort path to clean up the list of pending transactions. 575 572 */ 576 573 #ifdef CONFIG_MODULES 577 - static int __nf_tables_abort(struct net *net); 578 - 579 574 static void nft_request_module(struct net *net, const char *fmt, ...) 580 575 { 581 576 char module_name[MODULE_NAME_LEN]; 577 + LIST_HEAD(commit_list); 582 578 va_list args; 583 579 int ret; 584 580 585 - __nf_tables_abort(net); 581 + list_splice_init(&net->nft.commit_list, &commit_list); 586 582 587 583 va_start(args, fmt); 588 584 ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args); 589 585 va_end(args); 590 - if (WARN(ret >= MODULE_NAME_LEN, "truncated: '%s' (len %d)", module_name, ret)) 586 + if (ret >= MODULE_NAME_LEN) 591 587 return; 592 588 593 589 mutex_unlock(&net->nft.commit_mutex); 594 590 request_module("%s", module_name); 595 591 mutex_lock(&net->nft.commit_mutex); 592 + 593 + WARN_ON_ONCE(!list_empty(&net->nft.commit_list)); 594 + list_splice(&commit_list, &net->nft.commit_list); 596 595 } 597 596 #endif 598 597 ··· 1048 1045 } 1049 1046 1050 1047 list_for_each_entry_safe(flowtable, nft, &ctx->table->flowtables, list) { 1048 + if (!nft_is_active_next(ctx->net, flowtable)) 1049 + continue; 1050 + 1051 1051 err = nft_delflowtable(ctx, flowtable); 1052 1052 if (err < 0) 1053 1053 goto out; 1054 1054 } 1055 1055 1056 1056 list_for_each_entry_safe(obj, ne, &ctx->table->objects, list) { 1057 + if (!nft_is_active_next(ctx->net, obj)) 1058 + continue; 1059 + 1057 1060 err = nft_delobj(ctx, obj); 1058 1061 if (err < 0) 1059 1062 goto out; ··· 1250 1241 .len = NFT_CHAIN_MAXNAMELEN - 1 }, 1251 1242 [NFTA_CHAIN_HOOK] = { .type = NLA_NESTED }, 1252 1243 [NFTA_CHAIN_POLICY] = { .type = NLA_U32 }, 1253 - [NFTA_CHAIN_TYPE] = { .type = NLA_STRING }, 1244 + [NFTA_CHAIN_TYPE] = { .type = NLA_STRING, 1245 + .len = NFT_MODULE_AUTOLOAD_LIMIT }, 1254 1246 [NFTA_CHAIN_COUNTERS] = { .type = NLA_NESTED }, 1255 1247 [NFTA_CHAIN_FLAGS] = { .type = NLA_U32 }, 1256 1248 }; ··· 1686 1676 goto err_hook; 1687 1677 } 1688 1678 if (nft_hook_list_find(hook_list, hook)) { 1679 + kfree(hook); 1689 1680 err = -EEXIST; 1690 1681 goto err_hook; 1691 1682 } ··· 2366 2355 } 2367 2356 2368 2357 static const struct nla_policy nft_expr_policy[NFTA_EXPR_MAX + 1] = { 2369 - [NFTA_EXPR_NAME] = { .type = NLA_STRING }, 2358 + [NFTA_EXPR_NAME] = { .type = NLA_STRING, 2359 + .len = NFT_MODULE_AUTOLOAD_LIMIT }, 2370 2360 [NFTA_EXPR_DATA] = { .type = NLA_NESTED }, 2371 2361 }; 2372 2362 ··· 4210 4198 [NFTA_SET_ELEM_USERDATA] = { .type = NLA_BINARY, 4211 4199 .len = NFT_USERDATA_MAXLEN }, 4212 4200 [NFTA_SET_ELEM_EXPR] = { .type = NLA_NESTED }, 4213 - [NFTA_SET_ELEM_OBJREF] = { .type = NLA_STRING }, 4201 + [NFTA_SET_ELEM_OBJREF] = { .type = NLA_STRING, 4202 + .len = NFT_OBJ_MAXNAMELEN - 1 }, 4214 4203 }; 4215 4204 4216 4205 static const struct nla_policy nft_set_elem_list_policy[NFTA_SET_ELEM_LIST_MAX + 1] = {
+4 -1
net/netfilter/nft_tunnel.c
··· 76 76 struct nft_tunnel *priv = nft_expr_priv(expr); 77 77 u32 len; 78 78 79 - if (!tb[NFTA_TUNNEL_KEY] && 79 + if (!tb[NFTA_TUNNEL_KEY] || 80 80 !tb[NFTA_TUNNEL_DREG]) 81 81 return -EINVAL; 82 82 ··· 265 265 NULL); 266 266 if (err < 0) 267 267 return err; 268 + 269 + if (!tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION]) 270 + return -EINVAL; 268 271 269 272 version = ntohl(nla_get_be32(tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION])); 270 273 switch (version) {
+11
net/sched/act_ctinfo.c
··· 360 360 return tcf_idr_search(tn, a, index); 361 361 } 362 362 363 + static void tcf_ctinfo_cleanup(struct tc_action *a) 364 + { 365 + struct tcf_ctinfo *ci = to_ctinfo(a); 366 + struct tcf_ctinfo_params *cp; 367 + 368 + cp = rcu_dereference_protected(ci->params, 1); 369 + if (cp) 370 + kfree_rcu(cp, rcu); 371 + } 372 + 363 373 static struct tc_action_ops act_ctinfo_ops = { 364 374 .kind = "ctinfo", 365 375 .id = TCA_ID_CTINFO, ··· 377 367 .act = tcf_ctinfo_act, 378 368 .dump = tcf_ctinfo_dump, 379 369 .init = tcf_ctinfo_init, 370 + .cleanup= tcf_ctinfo_cleanup, 380 371 .walk = tcf_ctinfo_walker, 381 372 .lookup = tcf_ctinfo_search, 382 373 .size = sizeof(struct tcf_ctinfo),
+3 -4
net/sched/act_ife.c
··· 537 537 } 538 538 539 539 ife = to_ife(*a); 540 + if (ret == ACT_P_CREATED) 541 + INIT_LIST_HEAD(&ife->metalist); 542 + 540 543 err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack); 541 544 if (err < 0) 542 545 goto release_idr; ··· 568 565 569 566 p->eth_type = ife_type; 570 567 } 571 - 572 - 573 - if (ret == ACT_P_CREATED) 574 - INIT_LIST_HEAD(&ife->metalist); 575 568 576 569 if (tb[TCA_IFE_METALST]) { 577 570 err = nla_parse_nested_deprecated(tb2, IFE_META_MAX,
+7 -3
net/tls/tls_main.c
··· 732 732 return rc; 733 733 } 734 734 735 - static void tls_update(struct sock *sk, struct proto *p) 735 + static void tls_update(struct sock *sk, struct proto *p, 736 + void (*write_space)(struct sock *sk)) 736 737 { 737 738 struct tls_context *ctx; 738 739 739 740 ctx = tls_get_ctx(sk); 740 - if (likely(ctx)) 741 + if (likely(ctx)) { 742 + ctx->sk_write_space = write_space; 741 743 ctx->sk_proto = p; 742 - else 744 + } else { 743 745 sk->sk_prot = p; 746 + sk->sk_write_space = write_space; 747 + } 744 748 } 745 749 746 750 static int tls_get_info(const struct sock *sk, struct sk_buff *skb)
+32 -9
net/tls/tls_sw.c
··· 256 256 return ret; 257 257 258 258 ret = crypto_wait_req(ret, &ctx->async_wait); 259 - } else if (ret == -EBADMSG) { 260 - TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR); 261 259 } 262 260 263 261 if (async) ··· 680 682 681 683 split_point = msg_pl->apply_bytes; 682 684 split = split_point && split_point < msg_pl->sg.size; 685 + if (unlikely((!split && 686 + msg_pl->sg.size + 687 + prot->overhead_size > msg_en->sg.size) || 688 + (split && 689 + split_point + 690 + prot->overhead_size > msg_en->sg.size))) { 691 + split = true; 692 + split_point = msg_en->sg.size; 693 + } 683 694 if (split) { 684 695 rc = tls_split_open_record(sk, rec, &tmp, msg_pl, msg_en, 685 696 split_point, prot->overhead_size, 686 697 &orig_end); 687 698 if (rc < 0) 688 699 return rc; 700 + /* This can happen if above tls_split_open_record allocates 701 + * a single large encryption buffer instead of two smaller 702 + * ones. In this case adjust pointers and continue without 703 + * split. 704 + */ 705 + if (!msg_pl->sg.size) { 706 + tls_merge_open_record(sk, rec, tmp, orig_end); 707 + msg_pl = &rec->msg_plaintext; 708 + msg_en = &rec->msg_encrypted; 709 + split = false; 710 + } 689 711 sk_msg_trim(sk, msg_en, msg_pl->sg.size + 690 712 prot->overhead_size); 691 713 } ··· 725 707 &rec->sg_content_type); 726 708 } else { 727 709 sg_mark_end(sk_msg_elem(msg_pl, i)); 710 + } 711 + 712 + if (msg_pl->sg.end < msg_pl->sg.start) { 713 + sg_chain(&msg_pl->sg.data[msg_pl->sg.start], 714 + MAX_SKB_FRAGS - msg_pl->sg.start + 1, 715 + msg_pl->sg.data); 728 716 } 729 717 730 718 i = msg_pl->sg.start; ··· 796 772 psock = sk_psock_get(sk); 797 773 if (!psock || !policy) { 798 774 err = tls_push_record(sk, flags, record_type); 799 - if (err) { 775 + if (err && err != -EINPROGRESS) { 800 776 *copied -= sk_msg_free(sk, msg); 801 777 tls_free_open_rec(sk); 802 778 } ··· 807 783 if (psock->eval == __SK_NONE) { 808 784 delta = msg->sg.size; 809 785 psock->eval = sk_psock_msg_verdict(sk, psock, msg); 810 - if (delta < msg->sg.size) 811 - delta -= msg->sg.size; 812 - else 813 - delta = 0; 786 + delta -= msg->sg.size; 814 787 } 815 788 if (msg->cork_bytes && msg->cork_bytes > msg->sg.size && 816 789 !enospc && !full_record) { ··· 822 801 switch (psock->eval) { 823 802 case __SK_PASS: 824 803 err = tls_push_record(sk, flags, record_type); 825 - if (err < 0) { 804 + if (err && err != -EINPROGRESS) { 826 805 *copied -= sk_msg_free(sk, msg); 827 806 tls_free_open_rec(sk); 828 807 goto out_err; ··· 1536 1515 if (err == -EINPROGRESS) 1537 1516 tls_advance_record_sn(sk, prot, 1538 1517 &tls_ctx->rx); 1539 - 1518 + else if (err == -EBADMSG) 1519 + TLS_INC_STATS(sock_net(sk), 1520 + LINUX_MIB_TLSDECRYPTERROR); 1540 1521 return err; 1541 1522 } 1542 1523 } else {
+6 -59
net/vmw_vsock/hyperv_transport.c
··· 138 138 **************************************************************************** 139 139 * The only valid Service GUIDs, from the perspectives of both the host and * 140 140 * Linux VM, that can be connected by the other end, must conform to this * 141 - * format: <port>-facb-11e6-bd58-64006a7986d3, and the "port" must be in * 142 - * this range [0, 0x7FFFFFFF]. * 141 + * format: <port>-facb-11e6-bd58-64006a7986d3. * 143 142 **************************************************************************** 144 143 * 145 144 * When we write apps on the host to connect(), the GUID ServiceID is used. 146 145 * When we write apps in Linux VM to connect(), we only need to specify the 147 146 * port and the driver will form the GUID and use that to request the host. 148 147 * 149 - * From the perspective of Linux VM: 150 - * 1. the local ephemeral port (i.e. the local auto-bound port when we call 151 - * connect() without explicit bind()) is generated by __vsock_bind_stream(), 152 - * and the range is [1024, 0xFFFFFFFF). 153 - * 2. the remote ephemeral port (i.e. the auto-generated remote port for 154 - * a connect request initiated by the host's connect()) is generated by 155 - * hvs_remote_addr_init() and the range is [0x80000000, 0xFFFFFFFF). 156 148 */ 157 - 158 - #define MAX_LISTEN_PORT ((u32)0x7FFFFFFF) 159 - #define MAX_VM_LISTEN_PORT MAX_LISTEN_PORT 160 - #define MAX_HOST_LISTEN_PORT MAX_LISTEN_PORT 161 - #define MIN_HOST_EPHEMERAL_PORT (MAX_HOST_LISTEN_PORT + 1) 162 149 163 150 /* 00000000-facb-11e6-bd58-64006a7986d3 */ 164 151 static const guid_t srv_id_template = ··· 169 182 unsigned int port = get_port_by_srv_id(svr_id); 170 183 171 184 vsock_addr_init(addr, VMADDR_CID_ANY, port); 172 - } 173 - 174 - static void hvs_remote_addr_init(struct sockaddr_vm *remote, 175 - struct sockaddr_vm *local) 176 - { 177 - static u32 host_ephemeral_port = MIN_HOST_EPHEMERAL_PORT; 178 - struct sock *sk; 179 - 180 - /* Remote peer is always the host */ 181 - vsock_addr_init(remote, VMADDR_CID_HOST, VMADDR_PORT_ANY); 182 - 183 - while (1) { 184 - /* Wrap around ? */ 185 - if (host_ephemeral_port < MIN_HOST_EPHEMERAL_PORT || 186 - host_ephemeral_port == VMADDR_PORT_ANY) 187 - host_ephemeral_port = MIN_HOST_EPHEMERAL_PORT; 188 - 189 - remote->svm_port = host_ephemeral_port++; 190 - 191 - sk = vsock_find_connected_socket(remote, local); 192 - if (!sk) { 193 - /* Found an available ephemeral port */ 194 - return; 195 - } 196 - 197 - /* Release refcnt got in vsock_find_connected_socket */ 198 - sock_put(sk); 199 - } 200 185 } 201 186 202 187 static void hvs_set_channel_pending_send_size(struct vmbus_channel *chan) ··· 300 341 if_type = &chan->offermsg.offer.if_type; 301 342 if_instance = &chan->offermsg.offer.if_instance; 302 343 conn_from_host = chan->offermsg.offer.u.pipe.user_def[0]; 303 - 304 - /* The host or the VM should only listen on a port in 305 - * [0, MAX_LISTEN_PORT] 306 - */ 307 - if (!is_valid_srv_id(if_type) || 308 - get_port_by_srv_id(if_type) > MAX_LISTEN_PORT) 344 + if (!is_valid_srv_id(if_type)) 309 345 return; 310 346 311 347 hvs_addr_init(&addr, conn_from_host ? if_type : if_instance); ··· 325 371 vnew = vsock_sk(new); 326 372 327 373 hvs_addr_init(&vnew->local_addr, if_type); 328 - hvs_remote_addr_init(&vnew->remote_addr, &vnew->local_addr); 329 374 375 + /* Remote peer is always the host */ 376 + vsock_addr_init(&vnew->remote_addr, 377 + VMADDR_CID_HOST, VMADDR_PORT_ANY); 378 + vnew->remote_addr.svm_port = get_port_by_srv_id(if_instance); 330 379 ret = vsock_assign_transport(vnew, vsock_sk(sk)); 331 380 /* Transport assigned (looking at remote_addr) must be the 332 381 * same where we received the request. ··· 723 766 724 767 static bool hvs_stream_allow(u32 cid, u32 port) 725 768 { 726 - /* The host's port range [MIN_HOST_EPHEMERAL_PORT, 0xFFFFFFFF) is 727 - * reserved as ephemeral ports, which are used as the host's ports 728 - * when the host initiates connections. 729 - * 730 - * Perform this check in the guest so an immediate error is produced 731 - * instead of a timeout. 732 - */ 733 - if (port > MAX_HOST_LISTEN_PORT) 734 - return false; 735 - 736 769 if (cid == VMADDR_CID_HOST) 737 770 return true; 738 771
+3
net/wireless/nl80211.c
··· 10843 10843 if (err) 10844 10844 return err; 10845 10845 10846 + cfg80211_sinfo_release_content(&sinfo); 10846 10847 if (sinfo.filled & BIT_ULL(NL80211_STA_INFO_BEACON_SIGNAL_AVG)) 10847 10848 wdev->cqm_config->last_rssi_event_value = 10848 10849 (s8) sinfo.rx_beacon_signal_avg; ··· 13796 13795 err = rdev_get_station(rdev, dev, dest, &sinfo); 13797 13796 if (err) 13798 13797 return err; 13798 + 13799 + cfg80211_sinfo_release_content(&sinfo); 13799 13800 13800 13801 return rdev_probe_mesh_link(rdev, dev, dest, buf, len); 13801 13802 }
+14
net/wireless/rdev-ops.h
··· 538 538 rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed) 539 539 { 540 540 int ret; 541 + 542 + if (!rdev->ops->set_wiphy_params) 543 + return -EOPNOTSUPP; 544 + 541 545 trace_rdev_set_wiphy_params(&rdev->wiphy, changed); 542 546 ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); 543 547 trace_rdev_return_int(&rdev->wiphy, ret); ··· 1169 1165 chandef, cac_time_ms); 1170 1166 trace_rdev_return_int(&rdev->wiphy, ret); 1171 1167 return ret; 1168 + } 1169 + 1170 + static inline void 1171 + rdev_end_cac(struct cfg80211_registered_device *rdev, 1172 + struct net_device *dev) 1173 + { 1174 + trace_rdev_end_cac(&rdev->wiphy, dev); 1175 + if (rdev->ops->end_cac) 1176 + rdev->ops->end_cac(&rdev->wiphy, dev); 1177 + trace_rdev_return_void(&rdev->wiphy); 1172 1178 } 1173 1179 1174 1180 static inline int
+32 -4
net/wireless/reg.c
··· 2261 2261 2262 2262 static void handle_channel_custom(struct wiphy *wiphy, 2263 2263 struct ieee80211_channel *chan, 2264 - const struct ieee80211_regdomain *regd) 2264 + const struct ieee80211_regdomain *regd, 2265 + u32 min_bw) 2265 2266 { 2266 2267 u32 bw_flags = 0; 2267 2268 const struct ieee80211_reg_rule *reg_rule = NULL; 2268 2269 const struct ieee80211_power_rule *power_rule = NULL; 2269 2270 u32 bw; 2270 2271 2271 - for (bw = MHZ_TO_KHZ(20); bw >= MHZ_TO_KHZ(5); bw = bw / 2) { 2272 + for (bw = MHZ_TO_KHZ(20); bw >= min_bw; bw = bw / 2) { 2272 2273 reg_rule = freq_reg_info_regd(MHZ_TO_KHZ(chan->center_freq), 2273 2274 regd, bw); 2274 2275 if (!IS_ERR(reg_rule)) ··· 2325 2324 if (!sband) 2326 2325 return; 2327 2326 2327 + /* 2328 + * We currently assume that you always want at least 20 MHz, 2329 + * otherwise channel 12 might get enabled if this rule is 2330 + * compatible to US, which permits 2402 - 2472 MHz. 2331 + */ 2328 2332 for (i = 0; i < sband->n_channels; i++) 2329 - handle_channel_custom(wiphy, &sband->channels[i], regd); 2333 + handle_channel_custom(wiphy, &sband->channels[i], regd, 2334 + MHZ_TO_KHZ(20)); 2330 2335 } 2331 2336 2332 2337 /* Used by drivers prior to wiphy registration */ ··· 3892 3885 } 3893 3886 EXPORT_SYMBOL(regulatory_pre_cac_allowed); 3894 3887 3888 + static void cfg80211_check_and_end_cac(struct cfg80211_registered_device *rdev) 3889 + { 3890 + struct wireless_dev *wdev; 3891 + /* If we finished CAC or received radar, we should end any 3892 + * CAC running on the same channels. 3893 + * the check !cfg80211_chandef_dfs_usable contain 2 options: 3894 + * either all channels are available - those the CAC_FINISHED 3895 + * event has effected another wdev state, or there is a channel 3896 + * in unavailable state in wdev chandef - those the RADAR_DETECTED 3897 + * event has effected another wdev state. 3898 + * In both cases we should end the CAC on the wdev. 3899 + */ 3900 + list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { 3901 + if (wdev->cac_started && 3902 + !cfg80211_chandef_dfs_usable(&rdev->wiphy, &wdev->chandef)) 3903 + rdev_end_cac(rdev, wdev->netdev); 3904 + } 3905 + } 3906 + 3895 3907 void regulatory_propagate_dfs_state(struct wiphy *wiphy, 3896 3908 struct cfg80211_chan_def *chandef, 3897 3909 enum nl80211_dfs_state dfs_state, ··· 3937 3911 cfg80211_set_dfs_state(&rdev->wiphy, chandef, dfs_state); 3938 3912 3939 3913 if (event == NL80211_RADAR_DETECTED || 3940 - event == NL80211_RADAR_CAC_FINISHED) 3914 + event == NL80211_RADAR_CAC_FINISHED) { 3941 3915 cfg80211_sched_dfs_chan_update(rdev); 3916 + cfg80211_check_and_end_cac(rdev); 3917 + } 3942 3918 3943 3919 nl80211_radar_notify(rdev, chandef, event, NULL, GFP_KERNEL); 3944 3920 }
+3 -3
net/wireless/sme.c
··· 1307 1307 if (wdev->conn_owner_nlportid) { 1308 1308 switch (wdev->iftype) { 1309 1309 case NL80211_IFTYPE_ADHOC: 1310 - cfg80211_leave_ibss(rdev, wdev->netdev, false); 1310 + __cfg80211_leave_ibss(rdev, wdev->netdev, false); 1311 1311 break; 1312 1312 case NL80211_IFTYPE_AP: 1313 1313 case NL80211_IFTYPE_P2P_GO: 1314 - cfg80211_stop_ap(rdev, wdev->netdev, false); 1314 + __cfg80211_stop_ap(rdev, wdev->netdev, false); 1315 1315 break; 1316 1316 case NL80211_IFTYPE_MESH_POINT: 1317 - cfg80211_leave_mesh(rdev, wdev->netdev); 1317 + __cfg80211_leave_mesh(rdev, wdev->netdev); 1318 1318 break; 1319 1319 case NL80211_IFTYPE_STATION: 1320 1320 case NL80211_IFTYPE_P2P_CLIENT:
+5
net/wireless/trace.h
··· 646 646 TP_ARGS(wiphy, netdev) 647 647 ); 648 648 649 + DEFINE_EVENT(wiphy_netdev_evt, rdev_end_cac, 650 + TP_PROTO(struct wiphy *wiphy, struct net_device *netdev), 651 + TP_ARGS(wiphy, netdev) 652 + ); 653 + 649 654 DECLARE_EVENT_CLASS(station_add_change, 650 655 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac, 651 656 struct station_parameters *params),
+1 -1
net/wireless/util.c
··· 564 564 struct skb_shared_info *sh = skb_shinfo(skb); 565 565 int page_offset; 566 566 567 - page_ref_inc(page); 567 + get_page(page); 568 568 page_offset = ptr - page_address(page); 569 569 skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size); 570 570 }
+2 -1
net/wireless/wext-core.c
··· 657 657 return NULL; 658 658 } 659 659 660 - static int iw_handler_get_iwstats(struct net_device * dev, 660 + /* noinline to avoid a bogus warning with -O3 */ 661 + static noinline int iw_handler_get_iwstats(struct net_device * dev, 661 662 struct iw_request_info * info, 662 663 union iwreq_data * wrqu, 663 664 char * extra)
+5 -1
net/x25/af_x25.c
··· 766 766 if (sk->sk_state == TCP_ESTABLISHED) 767 767 goto out; 768 768 769 + rc = -EALREADY; /* Do nothing if call is already in progress */ 770 + if (sk->sk_state == TCP_SYN_SENT) 771 + goto out; 772 + 769 773 sk->sk_state = TCP_CLOSE; 770 774 sock->state = SS_UNCONNECTED; 771 775 ··· 816 812 /* Now the loop */ 817 813 rc = -EINPROGRESS; 818 814 if (sk->sk_state != TCP_ESTABLISHED && (flags & O_NONBLOCK)) 819 - goto out_put_neigh; 815 + goto out; 820 816 821 817 rc = x25_wait_for_connection_establishment(sk); 822 818 if (rc)
+1 -1
tools/bpf/bpftool/btf_dumper.c
··· 26 26 bool is_plain_text) 27 27 { 28 28 if (is_plain_text) 29 - jsonw_printf(jw, "%p", data); 29 + jsonw_printf(jw, "%p", *(void **)data); 30 30 else 31 31 jsonw_printf(jw, "%lu", *(unsigned long *)data); 32 32 }
+6 -2
tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh
··· 232 232 stop_traffic 233 233 local ucth1=${uc_rate[1]} 234 234 235 - start_traffic $h1 own bc bc 235 + start_traffic $h1 192.0.2.65 bc bc 236 236 237 237 local d0=$(date +%s) 238 238 local t0=$(ethtool_stats_get $h3 rx_octets_prio_0) ··· 254 254 ret = 100 * ($ucth1 - $ucth2) / $ucth1 255 255 if (ret > 0) { ret } else { 0 } 256 256 ") 257 - check_err $(bc <<< "$deg > 25") 257 + 258 + # Minimum shaper of 200Mbps on MC TCs should cause about 20% of 259 + # degradation on 1Gbps link. 260 + check_err $(bc <<< "$deg < 15") "Minimum shaper not in effect" 261 + check_err $(bc <<< "$deg > 25") "MC traffic degrades UC performance too much" 258 262 259 263 local interval=$((d1 - d0)) 260 264 local mc_ir=$(rate $u0 $u1 $interval)