Pull networking fixes from David Miller: 1) Fix TCP checksum offload handling in iwlwifi driver, from Emmanuel Grumbach. 2) In ksz DSA tagging code, free SKB if skb_put_padto() fails. From Vivien Didelot. 3) Fix two regressions with bonding on wireless, from Andreas Born. 4) Fix build when busypoll is disabled, from Daniel Borkmann. 5) Fix copy_linear_skb() wrt. SO_PEEK_OFF, from Eric Dumazet. 6) Set SKB cached route properly in inet_rtm_getroute(), from Florian Westphal. 7) Fix PCI-E relaxed ordering handling in cxgb4 driver, from Ding Tianhong. 8) Fix module refcnt leak in ULP code, from Sabrina Dubroca. 9) Fix use of GFP_KERNEL in atomic contexts in AF_KEY code, from Eric Dumazet. 10) Need to purge socket write queue in dccp_destroy_sock(), also from Eric Dumazet. 11) Make bpf_trace_printk() work properly on 32-bit architectures, from Daniel Borkmann. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (47 commits) bpf: fix bpf_trace_printk on 32 bit archs PCI: fix oops when try to find Root Port for a PCI device sfc: don't try and read ef10 data on non-ef10 NIC net_sched: remove warning from qdisc_hash_add net_sched/sfq: update hierarchical backlog when drop packet net_sched: reset pointers to tcf blocks in classful qdiscs' destructors ipv4: fix NULL dereference in free_fib_info_rcu() net: Fix a typo in comment about sock flags. ipv6: fix NULL dereference in ip6_route_dev_notify() tcp: fix possible deadlock in TCP stack vs BPF filter dccp: purge write queue in dccp_destroy_sock() udp: fix linear skb reception with PEEK_OFF ipv6: release rt6->rt6i_idev properly during ifdown af_key: do not use GFP_KERNEL in atomic contexts tcp: ulp: avoid module refcnt leak in tcp_set_ulp net/cxgb4vf: Use new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag net/cxgb4: Use new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag PCI: Disable Relaxed Ordering Attributes for AMD A1100 PCI: Disable Relaxed Ordering for some Intel processors PCI: Disable PCIe Relaxed Ordering if unsupported ...
Unified · Split
| @@ -26,7 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | |
| 27 | 27 | #define FSM_TIMER_DEBUG 0 |
| 28 | 28 | |
| 29 | −void | |
| 29 | +int | |
| 30 | 30 | mISDN_FsmNew(struct Fsm *fsm, |
| 31 | 31 | struct FsmNode *fnlist, int fncount) |
| 32 | 32 | { |
| @@ -34,6 +34,8 @@ mISDN_FsmNew(struct Fsm *fsm, · 1 unmodified line | ||
| 34 | 34 | |
| 35 | 35 | fsm->jumpmatrix = kzalloc(sizeof(FSMFNPTR) * fsm->state_count * |
| 36 | 36 | fsm->event_count, GFP_KERNEL); |
| 37 | + if (fsm->jumpmatrix == NULL) | |
| 38 | + return -ENOMEM; | |
| 37 | 39 | |
| 38 | 40 | for (i = 0; i < fncount; i++) |
| 39 | 41 | if ((fnlist[i].state >= fsm->state_count) || |
| @@ -45,6 +47,7 @@ mISDN_FsmNew(struct Fsm *fsm, · 5 unmodified lines | ||
| 45 | 47 | } else |
| 46 | 48 | fsm->jumpmatrix[fsm->state_count * fnlist[i].event + |
| 47 | 49 | fnlist[i].state] = (FSMFNPTR) fnlist[i].routine; |
| 50 | + return 0; | |
| 48 | 51 | } |
| 49 | 52 | EXPORT_SYMBOL(mISDN_FsmNew); |
| 50 | 53 | |
| @@ -55,7 +55,7 @@ struct FsmTimer { · 54 unmodified lines | ||
| 55 | 55 | void *arg; |
| 56 | 56 | }; |
| 57 | 57 | |
| 58 | −extern void mISDN_FsmNew(struct Fsm *, struct FsmNode *, int); | |
| 58 | +extern int mISDN_FsmNew(struct Fsm *, struct FsmNode *, int); | |
| 59 | 59 | extern void mISDN_FsmFree(struct Fsm *); |
| 60 | 60 | extern int mISDN_FsmEvent(struct FsmInst *, int , void *); |
| 61 | 61 | extern void mISDN_FsmChangeState(struct FsmInst *, int); |
| @@ -414,8 +414,7 @@ l1_init(u_int *deb) · 413 unmodified lines | ||
| 414 | 414 | l1fsm_s.event_count = L1_EVENT_COUNT; |
| 415 | 415 | l1fsm_s.strEvent = strL1Event; |
| 416 | 416 | l1fsm_s.strState = strL1SState; |
| 417 | − mISDN_FsmNew(&l1fsm_s, L1SFnList, ARRAY_SIZE(L1SFnList)); | |
| 418 | − return 0; | |
| 417 | + return mISDN_FsmNew(&l1fsm_s, L1SFnList, ARRAY_SIZE(L1SFnList)); | |
| 419 | 418 | } |
| 420 | 419 | |
| 421 | 420 | void |
| @@ -2247,15 +2247,26 @@ static struct Bprotocol X75SLP = { · 2246 unmodified lines | ||
| 2247 | 2247 | int |
| 2248 | 2248 | Isdnl2_Init(u_int *deb) |
| 2249 | 2249 | { |
| 2250 | + int res; | |
| 2250 | 2251 | debug = deb; |
| 2251 | 2252 | mISDN_register_Bprotocol(&X75SLP); |
| 2252 | 2253 | l2fsm.state_count = L2_STATE_COUNT; |
| 2253 | 2254 | l2fsm.event_count = L2_EVENT_COUNT; |
| 2254 | 2255 | l2fsm.strEvent = strL2Event; |
| 2255 | 2256 | l2fsm.strState = strL2State; |
| 2256 | − mISDN_FsmNew(&l2fsm, L2FnList, ARRAY_SIZE(L2FnList)); | |
| 2257 | − TEIInit(deb); | |
| 2257 | + res = mISDN_FsmNew(&l2fsm, L2FnList, ARRAY_SIZE(L2FnList)); | |
| 2258 | + if (res) | |
| 2259 | + goto error; | |
| 2260 | + res = TEIInit(deb); | |
| 2261 | + if (res) | |
| 2262 | + goto error_fsm; | |
| 2258 | 2263 | return 0; |
| 2264 | + | |
| 2265 | +error_fsm: | |
| 2266 | + mISDN_FsmFree(&l2fsm); | |
| 2267 | +error: | |
| 2268 | + mISDN_unregister_Bprotocol(&X75SLP); | |
| 2269 | + return res; | |
| 2259 | 2270 | } |
| 2260 | 2271 | |
| 2261 | 2272 | void |
| @@ -1387,23 +1387,37 @@ create_teimanager(struct mISDNdevice *dev) · 1386 unmodified lines | ||
| 1387 | 1387 | |
| 1388 | 1388 | int TEIInit(u_int *deb) |
| 1389 | 1389 | { |
| 1390 | + int res; | |
| 1390 | 1391 | debug = deb; |
| 1391 | 1392 | teifsmu.state_count = TEI_STATE_COUNT; |
| 1392 | 1393 | teifsmu.event_count = TEI_EVENT_COUNT; |
| 1393 | 1394 | teifsmu.strEvent = strTeiEvent; |
| 1394 | 1395 | teifsmu.strState = strTeiState; |
| 1395 | − mISDN_FsmNew(&teifsmu, TeiFnListUser, ARRAY_SIZE(TeiFnListUser)); | |
| 1396 | + res = mISDN_FsmNew(&teifsmu, TeiFnListUser, ARRAY_SIZE(TeiFnListUser)); | |
| 1397 | + if (res) | |
| 1398 | + goto error; | |
| 1396 | 1399 | teifsmn.state_count = TEI_STATE_COUNT; |
| 1397 | 1400 | teifsmn.event_count = TEI_EVENT_COUNT; |
| 1398 | 1401 | teifsmn.strEvent = strTeiEvent; |
| 1399 | 1402 | teifsmn.strState = strTeiState; |
| 1400 | − mISDN_FsmNew(&teifsmn, TeiFnListNet, ARRAY_SIZE(TeiFnListNet)); | |
| 1403 | + res = mISDN_FsmNew(&teifsmn, TeiFnListNet, ARRAY_SIZE(TeiFnListNet)); | |
| 1404 | + if (res) | |
| 1405 | + goto error_smn; | |
| 1401 | 1406 | deactfsm.state_count = DEACT_STATE_COUNT; |
| 1402 | 1407 | deactfsm.event_count = DEACT_EVENT_COUNT; |
| 1403 | 1408 | deactfsm.strEvent = strDeactEvent; |
| 1404 | 1409 | deactfsm.strState = strDeactState; |
| 1405 | − mISDN_FsmNew(&deactfsm, DeactFnList, ARRAY_SIZE(DeactFnList)); | |
| 1410 | + res = mISDN_FsmNew(&deactfsm, DeactFnList, ARRAY_SIZE(DeactFnList)); | |
| 1411 | + if (res) | |
| 1412 | + goto error_deact; | |
| 1406 | 1413 | return 0; |
| 1414 | + | |
| 1415 | +error_deact: | |
| 1416 | + mISDN_FsmFree(&teifsmn); | |
| 1417 | +error_smn: | |
| 1418 | + mISDN_FsmFree(&teifsmu); | |
| 1419 | +error: | |
| 1420 | + return res; | |
| 1407 | 1421 | } |
| 1408 | 1422 | |
| 1409 | 1423 | void TEIFree(void) |
| @@ -1569,7 +1569,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) · 1568 unmodified lines | ||
| 1569 | 1569 | new_slave->delay = 0; |
| 1570 | 1570 | new_slave->link_failure_count = 0; |
| 1571 | 1571 | |
| 1572 | − if (bond_update_speed_duplex(new_slave)) | |
| 1572 | + if (bond_update_speed_duplex(new_slave) && | |
| 1573 | + bond_needs_speed_duplex(bond)) | |
| 1573 | 1574 | new_slave->link = BOND_LINK_DOWN; |
| 1574 | 1575 | |
| 1575 | 1576 | new_slave->last_rx = jiffies - |
| @@ -2140,11 +2141,13 @@ static void bond_miimon_commit(struct bonding *bond) · 564 unmodified lines | ||
| 2140 | 2141 | continue; |
| 2141 | 2142 | |
| 2142 | 2143 | case BOND_LINK_UP: |
| 2143 | − if (bond_update_speed_duplex(slave)) { | |
| 2144 | + if (bond_update_speed_duplex(slave) && | |
| 2145 | + bond_needs_speed_duplex(bond)) { | |
| 2144 | 2146 | slave->link = BOND_LINK_DOWN; |
| 2145 | − netdev_warn(bond->dev, | |
| 2146 | − "failed to get link speed/duplex for %s\n", | |
| 2147 | − slave->dev->name); | |
| 2147 | + if (net_ratelimit()) | |
| 2148 | + netdev_warn(bond->dev, | |
| 2149 | + "failed to get link speed/duplex for %s\n", | |
| 2150 | + slave->dev->name); | |
| 2148 | 2151 | continue; |
| 2149 | 2152 | } |
| 2150 | 2153 | bond_set_slave_link_state(slave, BOND_LINK_UP, |
| @@ -529,6 +529,7 @@ enum { /* adapter flags */ · 528 unmodified lines | ||
| 529 | 529 | USING_SOFT_PARAMS = (1 << 6), |
| 530 | 530 | MASTER_PF = (1 << 7), |
| 531 | 531 | FW_OFLD_CONN = (1 << 9), |
| 532 | + ROOT_NO_RELAXED_ORDERING = (1 << 10), | |
| 532 | 533 | }; |
| 533 | 534 | |
| 534 | 535 | enum { |
| @@ -4654,11 +4654,6 @@ static void print_port_info(const struct net_device *dev) · 4653 unmodified lines | ||
| 4654 | 4654 | dev->name, adap->params.vpd.id, adap->name, buf); |
| 4655 | 4655 | } |
| 4656 | 4656 | |
| 4657 | −static void enable_pcie_relaxed_ordering(struct pci_dev *dev) | |
| 4658 | −{ | |
| 4659 | − pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_RELAX_EN); | |
| 4660 | −} | |
| 4661 | − | |
| 4662 | 4657 | /* |
| 4663 | 4658 | * Free the following resources: |
| 4664 | 4659 | * - memory used for tables |
| @@ -4908,7 +4903,6 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 243 unmodified lines | ||
| 4908 | 4903 | } |
| 4909 | 4904 | |
| 4910 | 4905 | pci_enable_pcie_error_reporting(pdev); |
| 4911 | − enable_pcie_relaxed_ordering(pdev); | |
| 4912 | 4906 | pci_set_master(pdev); |
| 4913 | 4907 | pci_save_state(pdev); |
| 4914 | 4908 | |
| @@ -4947,6 +4941,23 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 32 unmodified lines | ||
| 4947 | 4941 | adapter->msg_enable = DFLT_MSG_ENABLE; |
| 4948 | 4942 | memset(adapter->chan_map, 0xff, sizeof(adapter->chan_map)); |
| 4949 | 4943 | |
| 4944 | + /* If possible, we use PCIe Relaxed Ordering Attribute to deliver | |
| 4945 | + * Ingress Packet Data to Free List Buffers in order to allow for | |
| 4946 | + * chipset performance optimizations between the Root Complex and | |
| 4947 | + * Memory Controllers. (Messages to the associated Ingress Queue | |
| 4948 | + * notifying new Packet Placement in the Free Lists Buffers will be | |
| 4949 | + * send without the Relaxed Ordering Attribute thus guaranteeing that | |
| 4950 | + * all preceding PCIe Transaction Layer Packets will be processed | |
| 4951 | + * first.) But some Root Complexes have various issues with Upstream | |
| 4952 | + * Transaction Layer Packets with the Relaxed Ordering Attribute set. | |
| 4953 | + * The PCIe devices which under the Root Complexes will be cleared the | |
| 4954 | + * Relaxed Ordering bit in the configuration space, So we check our | |
| 4955 | + * PCIe configuration space to see if it's flagged with advice against | |
| 4956 | + * using Relaxed Ordering. | |
| 4957 | + */ | |
| 4958 | + if (!pcie_relaxed_ordering_enabled(pdev)) | |
| 4959 | + adapter->flags |= ROOT_NO_RELAXED_ORDERING; | |
| 4960 | + | |
| 4950 | 4961 | spin_lock_init(&adapter->stats_lock); |
| 4951 | 4962 | spin_lock_init(&adapter->tid_release_lock); |
| 4952 | 4963 | spin_lock_init(&adapter->win0_lock); |
| @@ -2719,6 +2719,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, · 2718 unmodified lines | ||
| 2719 | 2719 | struct fw_iq_cmd c; |
| 2720 | 2720 | struct sge *s = &adap->sge; |
| 2721 | 2721 | struct port_info *pi = netdev_priv(dev); |
| 2722 | + int relaxed = !(adap->flags & ROOT_NO_RELAXED_ORDERING); | |
| 2722 | 2723 | |
| 2723 | 2724 | /* Size needs to be multiple of 16, including status entry. */ |
| 2724 | 2725 | iq->size = roundup(iq->size, 16); |
| @@ -2772,8 +2773,8 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, · 47 unmodified lines | ||
| 2772 | 2773 | |
| 2773 | 2774 | flsz = fl->size / 8 + s->stat_len / sizeof(struct tx_desc); |
| 2774 | 2775 | c.iqns_to_fl0congen |= htonl(FW_IQ_CMD_FL0PACKEN_F | |
| 2775 | − FW_IQ_CMD_FL0FETCHRO_F | | |
| 2776 | − FW_IQ_CMD_FL0DATARO_F | | |
| 2776 | + FW_IQ_CMD_FL0FETCHRO_V(relaxed) | | |
| 2777 | + FW_IQ_CMD_FL0DATARO_V(relaxed) | | |
| 2777 | 2778 | FW_IQ_CMD_FL0PADEN_F); |
| 2778 | 2779 | if (cong >= 0) |
| 2779 | 2780 | c.iqns_to_fl0congen |= |
| @@ -408,6 +408,7 @@ enum { /* adapter flags */ · 407 unmodified lines | ||
| 408 | 408 | USING_MSI = (1UL << 1), |
| 409 | 409 | USING_MSIX = (1UL << 2), |
| 410 | 410 | QUEUES_BOUND = (1UL << 3), |
| 411 | + ROOT_NO_RELAXED_ORDERING = (1UL << 4), | |
| 411 | 412 | }; |
| 412 | 413 | |
| 413 | 414 | /* |
| @@ -2888,6 +2888,24 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev, · 2887 unmodified lines | ||
| 2888 | 2888 | */ |
| 2889 | 2889 | adapter->name = pci_name(pdev); |
| 2890 | 2890 | adapter->msg_enable = DFLT_MSG_ENABLE; |
| 2891 | + | |
| 2892 | + /* If possible, we use PCIe Relaxed Ordering Attribute to deliver | |
| 2893 | + * Ingress Packet Data to Free List Buffers in order to allow for | |
| 2894 | + * chipset performance optimizations between the Root Complex and | |
| 2895 | + * Memory Controllers. (Messages to the associated Ingress Queue | |
| 2896 | + * notifying new Packet Placement in the Free Lists Buffers will be | |
| 2897 | + * send without the Relaxed Ordering Attribute thus guaranteeing that | |
| 2898 | + * all preceding PCIe Transaction Layer Packets will be processed | |
| 2899 | + * first.) But some Root Complexes have various issues with Upstream | |
| 2900 | + * Transaction Layer Packets with the Relaxed Ordering Attribute set. | |
| 2901 | + * The PCIe devices which under the Root Complexes will be cleared the | |
| 2902 | + * Relaxed Ordering bit in the configuration space, So we check our | |
| 2903 | + * PCIe configuration space to see if it's flagged with advice against | |
| 2904 | + * using Relaxed Ordering. | |
| 2905 | + */ | |
| 2906 | + if (!pcie_relaxed_ordering_enabled(pdev)) | |
| 2907 | + adapter->flags |= ROOT_NO_RELAXED_ORDERING; | |
| 2908 | + | |
| 2891 | 2909 | err = adap_init0(adapter); |
| 2892 | 2910 | if (err) |
| 2893 | 2911 | goto err_unmap_bar; |
| @@ -2205,6 +2205,7 @@ int t4vf_sge_alloc_rxq(struct adapter *adapter, struct sge_rspq *rspq, · 2204 unmodified lines | ||
| 2205 | 2205 | struct port_info *pi = netdev_priv(dev); |
| 2206 | 2206 | struct fw_iq_cmd cmd, rpl; |
| 2207 | 2207 | int ret, iqandst, flsz = 0; |
| 2208 | + int relaxed = !(adapter->flags & ROOT_NO_RELAXED_ORDERING); | |
| 2208 | 2209 | |
| 2209 | 2210 | /* |
| 2210 | 2211 | * If we're using MSI interrupts and we're not initializing the |
| @@ -2300,6 +2301,8 @@ int t4vf_sge_alloc_rxq(struct adapter *adapter, struct sge_rspq *rspq, · 89 unmodified lines | ||
| 2300 | 2301 | cpu_to_be32( |
| 2301 | 2302 | FW_IQ_CMD_FL0HOSTFCMODE_V(SGE_HOSTFCMODE_NONE) | |
| 2302 | 2303 | FW_IQ_CMD_FL0PACKEN_F | |
| 2304 | + FW_IQ_CMD_FL0FETCHRO_V(relaxed) | | |
| 2305 | + FW_IQ_CMD_FL0DATARO_V(relaxed) | | |
| 2303 | 2306 | FW_IQ_CMD_FL0PADEN_F); |
| 2304 | 2307 | |
| 2305 | 2308 | /* In T6, for egress queue type FL there is internal overhead |
| @@ -115,14 +115,10 @@ nfp_flower_cmsg_portmod_rx(struct nfp_app *app, struct sk_buff *skb) · 114 unmodified lines | ||
| 115 | 115 | return; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | − if (link) { | |
| 118 | + if (link) | |
| 119 | 119 | netif_carrier_on(netdev); |
| 120 | − rtnl_lock(); | |
| 121 | − dev_set_mtu(netdev, be16_to_cpu(msg->mtu)); | |
| 122 | − rtnl_unlock(); | |
| 123 | − } else { | |
| 120 | + else | |
| 124 | 121 | netif_carrier_off(netdev); |
| 125 | − } | |
| 126 | 122 | rcu_read_unlock(); |
| 127 | 123 | } |
| 128 | 124 | |
| @@ -938,7 +938,6 @@ enum efx_stats_action { · 937 unmodified lines | ||
| 938 | 938 | static int efx_mcdi_mac_stats(struct efx_nic *efx, |
| 939 | 939 | enum efx_stats_action action, int clear) |
| 940 | 940 | { |
| 941 | − struct efx_ef10_nic_data *nic_data = efx->nic_data; | |
| 942 | 941 | MCDI_DECLARE_BUF(inbuf, MC_CMD_MAC_STATS_IN_LEN); |
| 943 | 942 | int rc; |
| 944 | 943 | int change = action == EFX_STATS_PULL ? 0 : 1; |
| @@ -960,7 +959,12 @@ static int efx_mcdi_mac_stats(struct efx_nic *efx, · 15 unmodified lines | ||
| 960 | 959 | MAC_STATS_IN_PERIODIC_NOEVENT, 1, |
| 961 | 960 | MAC_STATS_IN_PERIOD_MS, period); |
| 962 | 961 | MCDI_SET_DWORD(inbuf, MAC_STATS_IN_DMA_LEN, dma_len); |
| 963 | − MCDI_SET_DWORD(inbuf, MAC_STATS_IN_PORT_ID, nic_data->vport_id); | |
| 962 | + | |
| 963 | + if (efx_nic_rev(efx) >= EFX_REV_HUNT_A0) { | |
| 964 | + struct efx_ef10_nic_data *nic_data = efx->nic_data; | |
| 965 | + | |
| 966 | + MCDI_SET_DWORD(inbuf, MAC_STATS_IN_PORT_ID, nic_data->vport_id); | |
| 967 | + } | |
| 964 | 968 | |
| 965 | 969 | rc = efx_mcdi_rpc_quiet(efx, MC_CMD_MAC_STATS, inbuf, sizeof(inbuf), |
| 966 | 970 | NULL, 0, NULL); |
| @@ -204,6 +204,7 @@ int stmmac_mdio_register(struct net_device *ndev) · 203 unmodified lines | ||
| 204 | 204 | struct stmmac_priv *priv = netdev_priv(ndev); |
| 205 | 205 | struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data; |
| 206 | 206 | struct device_node *mdio_node = priv->plat->mdio_node; |
| 207 | + struct device *dev = ndev->dev.parent; | |
| 207 | 208 | int addr, found; |
| 208 | 209 | |
| 209 | 210 | if (!mdio_bus_data) |
| @@ -237,7 +238,7 @@ int stmmac_mdio_register(struct net_device *ndev) · 27 unmodified lines | ||
| 237 | 238 | else |
| 238 | 239 | err = mdiobus_register(new_bus); |
| 239 | 240 | if (err != 0) { |
| 240 | − netdev_err(ndev, "Cannot register the MDIO bus\n"); | |
| 241 | + dev_err(dev, "Cannot register the MDIO bus\n"); | |
| 241 | 242 | goto bus_register_fail; |
| 242 | 243 | } |
| 243 | 244 | |
| @@ -285,14 +286,12 @@ int stmmac_mdio_register(struct net_device *ndev) · 41 unmodified lines | ||
| 285 | 286 | irq_str = irq_num; |
| 286 | 287 | break; |
| 287 | 288 | } |
| 288 | − netdev_info(ndev, "PHY ID %08x at %d IRQ %s (%s)%s\n", | |
| 289 | − phydev->phy_id, addr, irq_str, phydev_name(phydev), | |
| 290 | − act ? " active" : ""); | |
| 289 | + phy_attached_info(phydev); | |
| 291 | 290 | found = 1; |
| 292 | 291 | } |
| 293 | 292 | |
| 294 | 293 | if (!found && !mdio_node) { |
| 295 | − netdev_warn(ndev, "No PHY found\n"); | |
| 294 | + dev_warn(dev, "No PHY found\n"); | |
| 296 | 295 | mdiobus_unregister(new_bus); |
| 297 | 296 | mdiobus_free(new_bus); |
| 298 | 297 | return -ENODEV; |
| @@ -159,8 +159,10 @@ void brcmf_feat_attach(struct brcmf_pub *drvr) · 158 unmodified lines | ||
| 159 | 159 | |
| 160 | 160 | brcmf_feat_firmware_capabilities(ifp); |
| 161 | 161 | memset(&gscan_cfg, 0, sizeof(gscan_cfg)); |
| 162 | − brcmf_feat_iovar_data_set(ifp, BRCMF_FEAT_GSCAN, "pfn_gscan_cfg", | |
| 163 | − &gscan_cfg, sizeof(gscan_cfg)); | |
| 162 | + if (drvr->bus_if->chip != BRCM_CC_43430_CHIP_ID) | |
| 163 | + brcmf_feat_iovar_data_set(ifp, BRCMF_FEAT_GSCAN, | |
| 164 | + "pfn_gscan_cfg", | |
| 165 | + &gscan_cfg, sizeof(gscan_cfg)); | |
| 164 | 166 | brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_PNO, "pfn"); |
| 165 | 167 | if (drvr->bus_if->wowl_supported) |
| 166 | 168 | brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); |
| @@ -154,7 +154,7 @@ static const struct iwl_tt_params iwl9000_tt_params = { · 153 unmodified lines | ||
| 154 | 154 | const struct iwl_cfg iwl9160_2ac_cfg = { |
| 155 | 155 | .name = "Intel(R) Dual Band Wireless AC 9160", |
| 156 | 156 | .fw_name_pre = IWL9260A_FW_PRE, |
| 157 | − .fw_name_pre_next_step = IWL9260B_FW_PRE, | |
| 157 | + .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE, | |
| 158 | 158 | IWL_DEVICE_9000, |
| 159 | 159 | .ht_params = &iwl9000_ht_params, |
| 160 | 160 | .nvm_ver = IWL9000_NVM_VERSION, |
| @@ -165,7 +165,7 @@ const struct iwl_cfg iwl9160_2ac_cfg = { · 4 unmodified lines | ||
| 165 | 165 | const struct iwl_cfg iwl9260_2ac_cfg = { |
| 166 | 166 | .name = "Intel(R) Dual Band Wireless AC 9260", |
| 167 | 167 | .fw_name_pre = IWL9260A_FW_PRE, |
| 168 | − .fw_name_pre_next_step = IWL9260B_FW_PRE, | |
| 168 | + .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE, | |
| 169 | 169 | IWL_DEVICE_9000, |
| 170 | 170 | .ht_params = &iwl9000_ht_params, |
| 171 | 171 | .nvm_ver = IWL9000_NVM_VERSION, |
| @@ -176,7 +176,7 @@ const struct iwl_cfg iwl9260_2ac_cfg = { · 4 unmodified lines | ||
| 176 | 176 | const struct iwl_cfg iwl9270_2ac_cfg = { |
| 177 | 177 | .name = "Intel(R) Dual Band Wireless AC 9270", |
| 178 | 178 | .fw_name_pre = IWL9260A_FW_PRE, |
| 179 | − .fw_name_pre_next_step = IWL9260B_FW_PRE, | |
| 179 | + .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE, | |
| 180 | 180 | IWL_DEVICE_9000, |
| 181 | 181 | .ht_params = &iwl9000_ht_params, |
| 182 | 182 | .nvm_ver = IWL9000_NVM_VERSION, |
| @@ -186,8 +186,8 @@ const struct iwl_cfg iwl9270_2ac_cfg = { · 3 unmodified lines | ||
| 186 | 186 | |
| 187 | 187 | const struct iwl_cfg iwl9460_2ac_cfg = { |
| 188 | 188 | .name = "Intel(R) Dual Band Wireless AC 9460", |
| 189 | − .fw_name_pre = IWL9000_FW_PRE, | |
| 190 | − .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, | |
| 189 | + .fw_name_pre = IWL9260A_FW_PRE, | |
| 190 | + .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE, | |
| 191 | 191 | IWL_DEVICE_9000, |
| 192 | 192 | .ht_params = &iwl9000_ht_params, |
| 193 | 193 | .nvm_ver = IWL9000_NVM_VERSION, |
| @@ -198,8 +198,8 @@ const struct iwl_cfg iwl9460_2ac_cfg = { · 4 unmodified lines | ||
| 198 | 198 | |
| 199 | 199 | const struct iwl_cfg iwl9560_2ac_cfg = { |
| 200 | 200 | .name = "Intel(R) Dual Band Wireless AC 9560", |
| 201 | − .fw_name_pre = IWL9000_FW_PRE, | |
| 202 | − .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, | |
| 201 | + .fw_name_pre = IWL9260A_FW_PRE, | |
| 202 | + .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE, | |
| 203 | 203 | IWL_DEVICE_9000, |
| 204 | 204 | .ht_params = &iwl9000_ht_params, |
| 205 | 205 | .nvm_ver = IWL9000_NVM_VERSION, |
| @@ -328,6 +328,7 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t; · 327 unmodified lines | ||
| 328 | 328 | * @IWL_UCODE_TLV_CAPA_TX_POWER_ACK: reduced TX power API has larger |
| 329 | 329 | * command size (command version 4) that supports toggling ACK TX |
| 330 | 330 | * power reduction. |
| 331 | + * @IWL_UCODE_TLV_CAPA_MLME_OFFLOAD: supports MLME offload | |
| 331 | 332 | * |
| 332 | 333 | * @NUM_IWL_UCODE_TLV_CAPA: number of bits used |
| 333 | 334 | */ |
| @@ -373,6 +374,7 @@ enum iwl_ucode_tlv_capa { · 39 unmodified lines | ||
| 373 | 374 | IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG = (__force iwl_ucode_tlv_capa_t)80, |
| 374 | 375 | IWL_UCODE_TLV_CAPA_LQM_SUPPORT = (__force iwl_ucode_tlv_capa_t)81, |
| 375 | 376 | IWL_UCODE_TLV_CAPA_TX_POWER_ACK = (__force iwl_ucode_tlv_capa_t)84, |
| 377 | + IWL_UCODE_TLV_CAPA_MLME_OFFLOAD = (__force iwl_ucode_tlv_capa_t)96, | |
| 376 | 378 | |
| 377 | 379 | NUM_IWL_UCODE_TLV_CAPA |
| 378 | 380 | #ifdef __CHECKER__ |
| @@ -276,10 +276,10 @@ struct iwl_pwr_tx_backoff { · 275 unmodified lines | ||
| 276 | 276 | * @fw_name_pre: Firmware filename prefix. The api version and extension |
| 277 | 277 | * (.ucode) will be added to filename before loading from disk. The |
| 278 | 278 | * filename is constructed as fw_name_pre<api>.ucode. |
| 279 | − * @fw_name_pre_next_step: same as @fw_name_pre, only for next step | |
| 279 | + * @fw_name_pre_b_or_c_step: same as @fw_name_pre, only for b or c steps | |
| 280 | 280 | * (if supported) |
| 281 | − * @fw_name_pre_rf_next_step: same as @fw_name_pre_next_step, only for rf next | |
| 282 | − * step. Supported only in integrated solutions. | |
| 281 | + * @fw_name_pre_rf_next_step: same as @fw_name_pre_b_or_c_step, only for rf | |
| 282 | + * next step. Supported only in integrated solutions. | |
| 283 | 283 | * @ucode_api_max: Highest version of uCode API supported by driver. |
| 284 | 284 | * @ucode_api_min: Lowest version of uCode API supported by driver. |
| 285 | 285 | * @max_inst_size: The maximal length of the fw inst section |
| @@ -330,7 +330,7 @@ struct iwl_cfg { · 44 unmodified lines | ||
| 330 | 330 | /* params specific to an individual device within a device family */ |
| 331 | 331 | const char *name; |
| 332 | 332 | const char *fw_name_pre; |
| 333 | − const char *fw_name_pre_next_step; | |
| 333 | + const char *fw_name_pre_b_or_c_step; | |
| 334 | 334 | const char *fw_name_pre_rf_next_step; |
| 335 | 335 | /* params not likely to change within a device family */ |
| 336 | 336 | const struct iwl_base_params *base_params; |
| @@ -216,8 +216,9 @@ static int iwl_request_firmware(struct iwl_drv *drv, bool first) · 215 unmodified lines | ||
| 216 | 216 | const char *fw_pre_name; |
| 217 | 217 | |
| 218 | 218 | if (drv->trans->cfg->device_family == IWL_DEVICE_FAMILY_9000 && |
| 219 | − CSR_HW_REV_STEP(drv->trans->hw_rev) == SILICON_B_STEP) | |
| 220 | − fw_pre_name = cfg->fw_name_pre_next_step; | |
| 219 | + (CSR_HW_REV_STEP(drv->trans->hw_rev) == SILICON_B_STEP || | |
| 220 | + CSR_HW_REV_STEP(drv->trans->hw_rev) == SILICON_C_STEP)) | |
| 221 | + fw_pre_name = cfg->fw_name_pre_b_or_c_step; | |
| 221 | 222 | else if (drv->trans->cfg->integrated && |
| 222 | 223 | CSR_HW_RFID_STEP(drv->trans->hw_rf_id) == SILICON_B_STEP && |
| 223 | 224 | cfg->fw_name_pre_rf_next_step) |
| @@ -785,7 +785,8 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, · 784 unmodified lines | ||
| 785 | 785 | int num_of_ch, __le32 *channels, u16 fw_mcc) |
| 786 | 786 | { |
| 787 | 787 | int ch_idx; |
| 788 | − u16 ch_flags, prev_ch_flags = 0; | |
| 788 | + u16 ch_flags; | |
| 789 | + u32 reg_rule_flags, prev_reg_rule_flags = 0; | |
| 789 | 790 | const u8 *nvm_chan = cfg->ext_nvm ? |
| 790 | 791 | iwl_ext_nvm_channels : iwl_nvm_channels; |
| 791 | 792 | struct ieee80211_regdomain *regd; |
| @@ -834,8 +835,11 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, · 42 unmodified lines | ||
| 834 | 835 | continue; |
| 835 | 836 | } |
| 836 | 837 | |
| 838 | + reg_rule_flags = iwl_nvm_get_regdom_bw_flags(nvm_chan, ch_idx, | |
| 839 | + ch_flags, cfg); | |
| 840 | + | |
| 837 | 841 | /* we can't continue the same rule */ |
| 838 | − if (ch_idx == 0 || prev_ch_flags != ch_flags || | |
| 842 | + if (ch_idx == 0 || prev_reg_rule_flags != reg_rule_flags || | |
| 839 | 843 | center_freq - prev_center_freq > 20) { |
| 840 | 844 | valid_rules++; |
| 841 | 845 | new_rule = true; |
| @@ -854,18 +858,17 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, · 12 unmodified lines | ||
| 854 | 858 | rule->power_rule.max_eirp = |
| 855 | 859 | DBM_TO_MBM(IWL_DEFAULT_MAX_TX_POWER); |
| 856 | 860 | |
| 857 | − rule->flags = iwl_nvm_get_regdom_bw_flags(nvm_chan, ch_idx, | |
| 858 | − ch_flags, cfg); | |
| 861 | + rule->flags = reg_rule_flags; | |
| 859 | 862 | |
| 860 | 863 | /* rely on auto-calculation to merge BW of contiguous chans */ |
| 861 | 864 | rule->flags |= NL80211_RRF_AUTO_BW; |
| 862 | 865 | rule->freq_range.max_bandwidth_khz = 0; |
| 863 | 866 | |
| 864 | − prev_ch_flags = ch_flags; | |
| 865 | 867 | prev_center_freq = center_freq; |
| 868 | + prev_reg_rule_flags = reg_rule_flags; | |
| 866 | 869 | |
| 867 | 870 | IWL_DEBUG_DEV(dev, IWL_DL_LAR, |
| 868 | − "Ch. %d [%sGHz] %s%s%s%s%s%s%s%s%s(0x%02x): Ad-Hoc %ssupported\n", | |
| 871 | + "Ch. %d [%sGHz] %s%s%s%s%s%s%s%s%s(0x%02x) reg_flags 0x%x: %s\n", | |
| 869 | 872 | center_freq, |
| 870 | 873 | band == NL80211_BAND_5GHZ ? "5.2" : "2.4", |
| 871 | 874 | CHECK_AND_PRINT_I(VALID), |
| @@ -877,10 +880,10 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, · 5 unmodified lines | ||
| 877 | 880 | CHECK_AND_PRINT_I(160MHZ), |
| 878 | 881 | CHECK_AND_PRINT_I(INDOOR_ONLY), |
| 879 | 882 | CHECK_AND_PRINT_I(GO_CONCURRENT), |
| 880 | − ch_flags, | |
| 883 | + ch_flags, reg_rule_flags, | |
| 881 | 884 | ((ch_flags & NVM_CHANNEL_ACTIVE) && |
| 882 | 885 | !(ch_flags & NVM_CHANNEL_RADAR)) |
| 883 | − ? "" : "not "); | |
| 886 | + ? "Ad-Hoc" : ""); | |
| 884 | 887 | } |
| 885 | 888 | |
| 886 | 889 | regd->n_reg_rules = valid_rules; |
| @@ -1275,8 +1275,10 @@ static int iwl_mvm_sar_get_wgds_table(struct iwl_mvm *mvm) · 1274 unmodified lines | ||
| 1275 | 1275 | |
| 1276 | 1276 | entry = &wifi_pkg->package.elements[idx++]; |
| 1277 | 1277 | if ((entry->type != ACPI_TYPE_INTEGER) || |
| 1278 | − (entry->integer.value > U8_MAX)) | |
| 1279 | − return -EINVAL; | |
| 1278 | + (entry->integer.value > U8_MAX)) { | |
| 1279 | + ret = -EINVAL; | |
| 1280 | + goto out_free; | |
| 1281 | + } | |
| 1280 | 1282 | |
| 1281 | 1283 | mvm->geo_profiles[i].values[j] = entry->integer.value; |
| 1282 | 1284 | } |
| @@ -2597,8 +2597,18 @@ static void iwl_mvm_purge_deferred_tx_frames(struct iwl_mvm *mvm, · 2596 unmodified lines | ||
| 2597 | 2597 | spin_lock_bh(&mvm_sta->lock); |
| 2598 | 2598 | for (i = 0; i <= IWL_MAX_TID_COUNT; i++) { |
| 2599 | 2599 | tid_data = &mvm_sta->tid_data[i]; |
| 2600 | − while ((skb = __skb_dequeue(&tid_data->deferred_tx_frames))) | |
| 2600 | + | |
| 2601 | + while ((skb = __skb_dequeue(&tid_data->deferred_tx_frames))) { | |
| 2602 | + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | |
| 2603 | + | |
| 2604 | + /* | |
| 2605 | + * The first deferred frame should've stopped the MAC | |
| 2606 | + * queues, so we should never get a second deferred | |
| 2607 | + * frame for the RA/TID. | |
| 2608 | + */ | |
| 2609 | + iwl_mvm_start_mac_queues(mvm, info->hw_queue); | |
| 2601 | 2610 | ieee80211_free_txskb(mvm->hw, skb); |
| 2611 | + } | |
| 2602 | 2612 | } |
| 2603 | 2613 | spin_unlock_bh(&mvm_sta->lock); |
| 2604 | 2614 | } |
| @@ -1291,7 +1291,7 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta, · 1290 unmodified lines | ||
| 1291 | 1291 | * first index into rate scale table. |
| 1292 | 1292 | */ |
| 1293 | 1293 | if (info->flags & IEEE80211_TX_STAT_AMPDU) { |
| 1294 | − rs_collect_tpc_data(mvm, lq_sta, curr_tbl, lq_rate.index, | |
| 1294 | + rs_collect_tpc_data(mvm, lq_sta, curr_tbl, tx_resp_rate.index, | |
| 1295 | 1295 | info->status.ampdu_len, |
| 1296 | 1296 | info->status.ampdu_ack_len, |
| 1297 | 1297 | reduced_txp); |
| @@ -1312,7 +1312,7 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta, · 14 unmodified lines | ||
| 1312 | 1312 | if (info->status.ampdu_ack_len == 0) |
| 1313 | 1313 | info->status.ampdu_len = 1; |
| 1314 | 1314 | |
| 1315 | − rs_collect_tlc_data(mvm, lq_sta, curr_tbl, lq_rate.index, | |
| 1315 | + rs_collect_tlc_data(mvm, lq_sta, curr_tbl, tx_resp_rate.index, | |
| 1316 | 1316 | info->status.ampdu_len, |
| 1317 | 1317 | info->status.ampdu_ack_len); |
| 1318 | 1318 | |
| @@ -1348,11 +1348,11 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta, · 29 unmodified lines | ||
| 1348 | 1348 | continue; |
| 1349 | 1349 | |
| 1350 | 1350 | rs_collect_tpc_data(mvm, lq_sta, tmp_tbl, |
| 1351 | − lq_rate.index, 1, | |
| 1351 | + tx_resp_rate.index, 1, | |
| 1352 | 1352 | i < retries ? 0 : legacy_success, |
| 1353 | 1353 | reduced_txp); |
| 1354 | 1354 | rs_collect_tlc_data(mvm, lq_sta, tmp_tbl, |
| 1355 | − lq_rate.index, 1, | |
| 1355 | + tx_resp_rate.index, 1, | |
| 1356 | 1356 | i < retries ? 0 : legacy_success); |
| 1357 | 1357 | } |
| 1358 | 1358 | |
| @@ -636,9 +636,9 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 635 unmodified lines | ||
| 636 | 636 | |
| 637 | 637 | baid_data = rcu_dereference(mvm->baid_map[baid]); |
| 638 | 638 | if (!baid_data) { |
| 639 | − WARN(!(reorder & IWL_RX_MPDU_REORDER_BA_OLD_SN), | |
| 640 | − "Received baid %d, but no data exists for this BAID\n", | |
| 641 | − baid); | |
| 639 | + IWL_DEBUG_RX(mvm, | |
| 640 | + "Got valid BAID but no baid allocated, bypass the re-ordering buffer. Baid %d reorder 0x%x\n", | |
| 641 | + baid, reorder); | |
| 642 | 642 | return false; |
| 643 | 643 | } |
| 644 | 644 | |
| @@ -759,7 +759,9 @@ static void iwl_mvm_agg_rx_received(struct iwl_mvm *mvm, · 114 unmodified lines | ||
| 759 | 759 | |
| 760 | 760 | data = rcu_dereference(mvm->baid_map[baid]); |
| 761 | 761 | if (!data) { |
| 762 | − WARN_ON(!(reorder_data & IWL_RX_MPDU_REORDER_BA_OLD_SN)); | |
| 762 | + IWL_DEBUG_RX(mvm, | |
| 763 | + "Got valid BAID but no baid allocated, bypass the re-ordering buffer. Baid %d reorder 0x%x\n", | |
| 764 | + baid, reorder_data); | |
| 763 | 765 | goto out; |
| 764 | 766 | } |
| 765 | 767 | |
| @@ -121,7 +121,8 @@ int iwl_mvm_sta_send_to_fw(struct iwl_mvm *mvm, struct ieee80211_sta *sta, · 120 unmodified lines | ||
| 121 | 121 | .mac_id_n_color = cpu_to_le32(mvm_sta->mac_id_n_color), |
| 122 | 122 | .add_modify = update ? 1 : 0, |
| 123 | 123 | .station_flags_msk = cpu_to_le32(STA_FLG_FAT_EN_MSK | |
| 124 | − STA_FLG_MIMO_EN_MSK), | |
| 124 | + STA_FLG_MIMO_EN_MSK | | |
| 125 | + STA_FLG_RTS_MIMO_PROT), | |
| 125 | 126 | .tid_disable_tx = cpu_to_le16(mvm_sta->tid_disable_agg), |
| 126 | 127 | }; |
| 127 | 128 | int ret; |
| @@ -290,8 +291,8 @@ static void iwl_mvm_rx_agg_session_expired(unsigned long data) · 162 unmodified lines | ||
| 290 | 291 | goto unlock; |
| 291 | 292 | |
| 292 | 293 | mvm_sta = iwl_mvm_sta_from_mac80211(sta); |
| 293 | − ieee80211_stop_rx_ba_session_offl(mvm_sta->vif, | |
| 294 | − sta->addr, ba_data->tid); | |
| 294 | + ieee80211_rx_ba_timer_expired(mvm_sta->vif, | |
| 295 | + sta->addr, ba_data->tid); | |
| 295 | 296 | unlock: |
| 296 | 297 | rcu_read_unlock(); |
| 297 | 298 | } |
| @@ -185,8 +185,14 @@ static u16 iwl_mvm_tx_csum(struct iwl_mvm *mvm, struct sk_buff *skb, · 184 unmodified lines | ||
| 185 | 185 | else |
| 186 | 186 | udp_hdr(skb)->check = 0; |
| 187 | 187 | |
| 188 | − /* mac header len should include IV, size is in words */ | |
| 189 | − if (info->control.hw_key) | |
| 188 | + /* | |
| 189 | + * mac header len should include IV, size is in words unless | |
| 190 | + * the IV is added by the firmware like in WEP. | |
| 191 | + * In new Tx API, the IV is always added by the firmware. | |
| 192 | + */ | |
| 193 | + if (!iwl_mvm_has_new_tx_api(mvm) && info->control.hw_key && | |
| 194 | + info->control.hw_key->cipher != WLAN_CIPHER_SUITE_WEP40 && | |
| 195 | + info->control.hw_key->cipher != WLAN_CIPHER_SUITE_WEP104) | |
| 190 | 196 | mh_len += info->control.hw_key->iv_len; |
| 191 | 197 | mh_len /= 2; |
| 192 | 198 | offload_assist |= mh_len << TX_CMD_OFFLD_MH_SIZE; |
| @@ -1815,6 +1821,8 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) · 1622 unmodified lines | ||
| 1815 | 1821 | struct iwl_mvm_tid_data *tid_data; |
| 1816 | 1822 | struct iwl_mvm_sta *mvmsta; |
| 1817 | 1823 | |
| 1824 | + ba_info.flags = IEEE80211_TX_STAT_AMPDU; | |
| 1825 | + | |
| 1818 | 1826 | if (iwl_mvm_has_new_tx_api(mvm)) { |
| 1819 | 1827 | struct iwl_mvm_compressed_ba_notif *ba_res = |
| 1820 | 1828 | (void *)pkt->data; |
| @@ -510,9 +510,17 @@ static const struct pci_device_id iwl_hw_card_ids[] = { · 509 unmodified lines | ||
| 510 | 510 | |
| 511 | 511 | /* 9000 Series */ |
| 512 | 512 | {IWL_PCI_DEVICE(0x271B, 0x0010, iwl9160_2ac_cfg)}, |
| 513 | + {IWL_PCI_DEVICE(0x271B, 0x0014, iwl9160_2ac_cfg)}, | |
| 514 | + {IWL_PCI_DEVICE(0x271B, 0x0210, iwl9160_2ac_cfg)}, | |
| 513 | 515 | {IWL_PCI_DEVICE(0x2526, 0x0000, iwl9260_2ac_cfg)}, |
| 514 | 516 | {IWL_PCI_DEVICE(0x2526, 0x0010, iwl9260_2ac_cfg)}, |
| 517 | + {IWL_PCI_DEVICE(0x2526, 0x0014, iwl9260_2ac_cfg)}, | |
| 518 | + {IWL_PCI_DEVICE(0x2526, 0xA014, iwl9260_2ac_cfg)}, | |
| 519 | + {IWL_PCI_DEVICE(0x2526, 0x4010, iwl9260_2ac_cfg)}, | |
| 520 | + {IWL_PCI_DEVICE(0x2526, 0x0210, iwl9260_2ac_cfg)}, | |
| 521 | + {IWL_PCI_DEVICE(0x2526, 0x0214, iwl9260_2ac_cfg)}, | |
| 515 | 522 | {IWL_PCI_DEVICE(0x2526, 0x1410, iwl9270_2ac_cfg)}, |
| 523 | + {IWL_PCI_DEVICE(0x2526, 0x1610, iwl9270_2ac_cfg)}, | |
| 516 | 524 | {IWL_PCI_DEVICE(0x9DF0, 0x0A10, iwl9460_2ac_cfg)}, |
| 517 | 525 | {IWL_PCI_DEVICE(0x9DF0, 0x0010, iwl9460_2ac_cfg)}, |
| 518 | 526 | {IWL_PCI_DEVICE(0x9DF0, 0x0210, iwl9460_2ac_cfg)}, |
| @@ -527,10 +535,22 @@ static const struct pci_device_id iwl_hw_card_ids[] = { · 8 unmodified lines | ||
| 527 | 535 | {IWL_PCI_DEVICE(0x9DF0, 0x2A10, iwl9460_2ac_cfg)}, |
| 528 | 536 | {IWL_PCI_DEVICE(0x30DC, 0x0060, iwl9460_2ac_cfg)}, |
| 529 | 537 | {IWL_PCI_DEVICE(0x2526, 0x0060, iwl9460_2ac_cfg)}, |
| 538 | + {IWL_PCI_DEVICE(0x2526, 0x0260, iwl9460_2ac_cfg)}, | |
| 539 | + {IWL_PCI_DEVICE(0x2526, 0x0064, iwl9460_2ac_cfg)}, | |
| 540 | + {IWL_PCI_DEVICE(0x2526, 0x00A4, iwl9460_2ac_cfg)}, | |
| 541 | + {IWL_PCI_DEVICE(0x2526, 0x40A4, iwl9460_2ac_cfg)}, | |
| 542 | + {IWL_PCI_DEVICE(0x2526, 0x02A4, iwl9460_2ac_cfg)}, | |
| 543 | + {IWL_PCI_DEVICE(0x2526, 0x00A0, iwl9460_2ac_cfg)}, | |
| 544 | + {IWL_PCI_DEVICE(0x2526, 0x02A0, iwl9460_2ac_cfg)}, | |
| 530 | 545 | {IWL_PCI_DEVICE(0x9DF0, 0x0060, iwl9460_2ac_cfg)}, |
| 531 | 546 | {IWL_PCI_DEVICE(0xA370, 0x0060, iwl9460_2ac_cfg)}, |
| 532 | 547 | {IWL_PCI_DEVICE(0x31DC, 0x0060, iwl9460_2ac_cfg)}, |
| 533 | 548 | {IWL_PCI_DEVICE(0x2526, 0x0030, iwl9560_2ac_cfg)}, |
| 549 | + {IWL_PCI_DEVICE(0x2526, 0x4030, iwl9560_2ac_cfg)}, | |
| 550 | + {IWL_PCI_DEVICE(0x2526, 0x0230, iwl9560_2ac_cfg)}, | |
| 551 | + {IWL_PCI_DEVICE(0x2526, 0x0234, iwl9560_2ac_cfg)}, | |
| 552 | + {IWL_PCI_DEVICE(0x2526, 0x0238, iwl9560_2ac_cfg)}, | |
| 553 | + {IWL_PCI_DEVICE(0x2526, 0x023C, iwl9560_2ac_cfg)}, | |
| 534 | 554 | {IWL_PCI_DEVICE(0x9DF0, 0x0030, iwl9560_2ac_cfg)}, |
| 535 | 555 | {IWL_PCI_DEVICE(0xA370, 0x0030, iwl9560_2ac_cfg)}, |
| 536 | 556 | {IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_cfg)}, |
| @@ -522,10 +522,11 @@ struct pci_dev *pci_find_pcie_root_port(struct pci_dev *dev) · 521 unmodified lines | ||
| 522 | 522 | bridge = pci_upstream_bridge(bridge); |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | − if (pci_pcie_type(highest_pcie_bridge) != PCI_EXP_TYPE_ROOT_PORT) | |
| 526 | − return NULL; | |
| 525 | + if (highest_pcie_bridge && | |
| 526 | + pci_pcie_type(highest_pcie_bridge) == PCI_EXP_TYPE_ROOT_PORT) | |
| 527 | + return highest_pcie_bridge; | |
| 527 | 528 | |
| 528 | − return highest_pcie_bridge; | |
| 529 | + return NULL; | |
| 529 | 530 | } |
| 530 | 531 | EXPORT_SYMBOL(pci_find_pcie_root_port); |
| 531 | 532 | |
| @@ -1762,6 +1762,48 @@ static void pci_configure_extended_tags(struct pci_dev *dev) · 1761 unmodified lines | ||
| 1762 | 1762 | PCI_EXP_DEVCTL_EXT_TAG); |
| 1763 | 1763 | } |
| 1764 | 1764 | |
| 1765 | +/** | |
| 1766 | + * pcie_relaxed_ordering_enabled - Probe for PCIe relaxed ordering enable | |
| 1767 | + * @dev: PCI device to query | |
| 1768 | + * | |
| 1769 | + * Returns true if the device has enabled relaxed ordering attribute. | |
| 1770 | + */ | |
| 1771 | +bool pcie_relaxed_ordering_enabled(struct pci_dev *dev) | |
| 1772 | +{ | |
| 1773 | + u16 v; | |
| 1774 | + | |
| 1775 | + pcie_capability_read_word(dev, PCI_EXP_DEVCTL, &v); | |
| 1776 | + | |
| 1777 | + return !!(v & PCI_EXP_DEVCTL_RELAX_EN); | |
| 1778 | +} | |
| 1779 | +EXPORT_SYMBOL(pcie_relaxed_ordering_enabled); | |
| 1780 | + | |
| 1781 | +static void pci_configure_relaxed_ordering(struct pci_dev *dev) | |
| 1782 | +{ | |
| 1783 | + struct pci_dev *root; | |
| 1784 | + | |
| 1785 | + /* PCI_EXP_DEVICE_RELAX_EN is RsvdP in VFs */ | |
| 1786 | + if (dev->is_virtfn) | |
| 1787 | + return; | |
| 1788 | + | |
| 1789 | + if (!pcie_relaxed_ordering_enabled(dev)) | |
| 1790 | + return; | |
| 1791 | + | |
| 1792 | + /* | |
| 1793 | + * For now, we only deal with Relaxed Ordering issues with Root | |
| 1794 | + * Ports. Peer-to-Peer DMA is another can of worms. | |
| 1795 | + */ | |
| 1796 | + root = pci_find_pcie_root_port(dev); | |
| 1797 | + if (!root) | |
| 1798 | + return; | |
| 1799 | + | |
| 1800 | + if (root->dev_flags & PCI_DEV_FLAGS_NO_RELAXED_ORDERING) { | |
| 1801 | + pcie_capability_clear_word(dev, PCI_EXP_DEVCTL, | |
| 1802 | + PCI_EXP_DEVCTL_RELAX_EN); | |
| 1803 | + dev_info(&dev->dev, "Disable Relaxed Ordering because the Root Port didn't support it\n"); | |
| 1804 | + } | |
| 1805 | +} | |
| 1806 | + | |
| 1765 | 1807 | static void pci_configure_device(struct pci_dev *dev) |
| 1766 | 1808 | { |
| 1767 | 1809 | struct hotplug_params hpp; |
| @@ -1769,6 +1811,7 @@ static void pci_configure_device(struct pci_dev *dev) · 1 unmodified line | ||
| 1769 | 1811 | |
| 1770 | 1812 | pci_configure_mps(dev); |
| 1771 | 1813 | pci_configure_extended_tags(dev); |
| 1814 | + pci_configure_relaxed_ordering(dev); | |
| 1772 | 1815 | |
| 1773 | 1816 | memset(&hpp, 0, sizeof(hpp)); |
| 1774 | 1817 | ret = pci_get_hp_params(dev, &hpp); |
| @@ -4015,6 +4015,95 @@ DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6868, PCI_CLASS_NOT_DEFINED, 8, · 4014 unmodified lines | ||
| 4015 | 4015 | DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6869, PCI_CLASS_NOT_DEFINED, 8, |
| 4016 | 4016 | quirk_tw686x_class); |
| 4017 | 4017 | |
| 4018 | +/* | |
| 4019 | + * Some devices have problems with Transaction Layer Packets with the Relaxed | |
| 4020 | + * Ordering Attribute set. Such devices should mark themselves and other | |
| 4021 | + * Device Drivers should check before sending TLPs with RO set. | |
| 4022 | + */ | |
| 4023 | +static void quirk_relaxedordering_disable(struct pci_dev *dev) | |
| 4024 | +{ | |
| 4025 | + dev->dev_flags |= PCI_DEV_FLAGS_NO_RELAXED_ORDERING; | |
| 4026 | + dev_info(&dev->dev, "Disable Relaxed Ordering Attributes to avoid PCIe Completion erratum\n"); | |
| 4027 | +} | |
| 4028 | + | |
| 4029 | +/* | |
| 4030 | + * Intel Xeon processors based on Broadwell/Haswell microarchitecture Root | |
| 4031 | + * Complex has a Flow Control Credit issue which can cause performance | |
| 4032 | + * problems with Upstream Transaction Layer Packets with Relaxed Ordering set. | |
| 4033 | + */ | |
| 4034 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f01, PCI_CLASS_NOT_DEFINED, 8, | |
| 4035 | + quirk_relaxedordering_disable); | |
| 4036 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f02, PCI_CLASS_NOT_DEFINED, 8, | |
| 4037 | + quirk_relaxedordering_disable); | |
| 4038 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f03, PCI_CLASS_NOT_DEFINED, 8, | |
| 4039 | + quirk_relaxedordering_disable); | |
| 4040 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f04, PCI_CLASS_NOT_DEFINED, 8, | |
| 4041 | + quirk_relaxedordering_disable); | |
| 4042 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f05, PCI_CLASS_NOT_DEFINED, 8, | |
| 4043 | + quirk_relaxedordering_disable); | |
| 4044 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f06, PCI_CLASS_NOT_DEFINED, 8, | |
| 4045 | + quirk_relaxedordering_disable); | |
| 4046 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f07, PCI_CLASS_NOT_DEFINED, 8, | |
| 4047 | + quirk_relaxedordering_disable); | |
| 4048 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f08, PCI_CLASS_NOT_DEFINED, 8, | |
| 4049 | + quirk_relaxedordering_disable); | |
| 4050 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f09, PCI_CLASS_NOT_DEFINED, 8, | |
| 4051 | + quirk_relaxedordering_disable); | |
| 4052 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f0a, PCI_CLASS_NOT_DEFINED, 8, | |
| 4053 | + quirk_relaxedordering_disable); | |
| 4054 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f0b, PCI_CLASS_NOT_DEFINED, 8, | |
| 4055 | + quirk_relaxedordering_disable); | |
| 4056 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f0c, PCI_CLASS_NOT_DEFINED, 8, | |
| 4057 | + quirk_relaxedordering_disable); | |
| 4058 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f0d, PCI_CLASS_NOT_DEFINED, 8, | |
| 4059 | + quirk_relaxedordering_disable); | |
| 4060 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f0e, PCI_CLASS_NOT_DEFINED, 8, | |
| 4061 | + quirk_relaxedordering_disable); | |
| 4062 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f01, PCI_CLASS_NOT_DEFINED, 8, | |
| 4063 | + quirk_relaxedordering_disable); | |
| 4064 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f02, PCI_CLASS_NOT_DEFINED, 8, | |
| 4065 | + quirk_relaxedordering_disable); | |
| 4066 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f03, PCI_CLASS_NOT_DEFINED, 8, | |
| 4067 | + quirk_relaxedordering_disable); | |
| 4068 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f04, PCI_CLASS_NOT_DEFINED, 8, | |
| 4069 | + quirk_relaxedordering_disable); | |
| 4070 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f05, PCI_CLASS_NOT_DEFINED, 8, | |
| 4071 | + quirk_relaxedordering_disable); | |
| 4072 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f06, PCI_CLASS_NOT_DEFINED, 8, | |
| 4073 | + quirk_relaxedordering_disable); | |
| 4074 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f07, PCI_CLASS_NOT_DEFINED, 8, | |
| 4075 | + quirk_relaxedordering_disable); | |
| 4076 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f08, PCI_CLASS_NOT_DEFINED, 8, | |
| 4077 | + quirk_relaxedordering_disable); | |
| 4078 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f09, PCI_CLASS_NOT_DEFINED, 8, | |
| 4079 | + quirk_relaxedordering_disable); | |
| 4080 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f0a, PCI_CLASS_NOT_DEFINED, 8, | |
| 4081 | + quirk_relaxedordering_disable); | |
| 4082 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f0b, PCI_CLASS_NOT_DEFINED, 8, | |
| 4083 | + quirk_relaxedordering_disable); | |
| 4084 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f0c, PCI_CLASS_NOT_DEFINED, 8, | |
| 4085 | + quirk_relaxedordering_disable); | |
| 4086 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f0d, PCI_CLASS_NOT_DEFINED, 8, | |
| 4087 | + quirk_relaxedordering_disable); | |
| 4088 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x2f0e, PCI_CLASS_NOT_DEFINED, 8, | |
| 4089 | + quirk_relaxedordering_disable); | |
| 4090 | + | |
| 4091 | +/* | |
| 4092 | + * The AMD ARM A1100 (AKA "SEATTLE") SoC has a bug in its PCIe Root Complex | |
| 4093 | + * where Upstream Transaction Layer Packets with the Relaxed Ordering | |
| 4094 | + * Attribute clear are allowed to bypass earlier TLPs with Relaxed Ordering | |
| 4095 | + * set. This is a violation of the PCIe 3.0 Transaction Ordering Rules | |
| 4096 | + * outlined in Section 2.4.1 (PCI Express(r) Base Specification Revision 3.0 | |
| 4097 | + * November 10, 2010). As a result, on this platform we can't use Relaxed | |
| 4098 | + * Ordering for Upstream TLPs. | |
| 4099 | + */ | |
| 4100 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_AMD, 0x1a00, PCI_CLASS_NOT_DEFINED, 8, | |
| 4101 | + quirk_relaxedordering_disable); | |
| 4102 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_AMD, 0x1a01, PCI_CLASS_NOT_DEFINED, 8, | |
| 4103 | + quirk_relaxedordering_disable); | |
| 4104 | +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_AMD, 0x1a02, PCI_CLASS_NOT_DEFINED, 8, | |
| 4105 | + quirk_relaxedordering_disable); | |
| 4106 | + | |
| 4018 | 4107 | /* |
| 4019 | 4108 | * Per PCIe r3.0, sec 2.2.9, "Completion headers must supply the same |
| 4020 | 4109 | * values for the Attribute as were supplied in the header of the |
| @@ -37,7 +37,7 @@ struct net; · 36 unmodified lines | ||
| 37 | 37 | |
| 38 | 38 | /* Historically, SOCKWQ_ASYNC_NOSPACE & SOCKWQ_ASYNC_WAITDATA were located |
| 39 | 39 | * in sock->flags, but moved into sk->sk_wq->flags to be RCU protected. |
| 40 | − * Eventually all flags will be in sk->sk_wq_flags. | |
| 40 | + * Eventually all flags will be in sk->sk_wq->flags. | |
| 41 | 41 | */ |
| 42 | 42 | #define SOCKWQ_ASYNC_NOSPACE 0 |
| 43 | 43 | #define SOCKWQ_ASYNC_WAITDATA 1 |
| @@ -188,6 +188,8 @@ enum pci_dev_flags { · 187 unmodified lines | ||
| 188 | 188 | * the direct_complete optimization. |
| 189 | 189 | */ |
| 190 | 190 | PCI_DEV_FLAGS_NEEDS_RESUME = (__force pci_dev_flags_t) (1 << 11), |
| 191 | + /* Don't use Relaxed Ordering for TLPs directed at this device */ | |
| 192 | + PCI_DEV_FLAGS_NO_RELAXED_ORDERING = (__force pci_dev_flags_t) (1 << 12), | |
| 191 | 193 | }; |
| 192 | 194 | |
| 193 | 195 | enum pci_irq_reroute_variant { |
| @@ -1126,6 +1128,7 @@ bool pci_check_pme_status(struct pci_dev *dev); · 932 unmodified lines | ||
| 1126 | 1128 | void pci_pme_wakeup_bus(struct pci_bus *bus); |
| 1127 | 1129 | void pci_d3cold_enable(struct pci_dev *dev); |
| 1128 | 1130 | void pci_d3cold_disable(struct pci_dev *dev); |
| 1131 | +bool pcie_relaxed_ordering_enabled(struct pci_dev *dev); | |
| 1129 | 1132 | |
| 1130 | 1133 | /* PCI Virtual Channel */ |
| 1131 | 1134 | int pci_save_vc_state(struct pci_dev *dev); |
| @@ -336,6 +336,16 @@ static inline void in6_dev_put(struct inet6_dev *idev) · 335 unmodified lines | ||
| 336 | 336 | in6_dev_finish_destroy(idev); |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | +static inline void in6_dev_put_clear(struct inet6_dev **pidev) | |
| 340 | +{ | |
| 341 | + struct inet6_dev *idev = *pidev; | |
| 342 | + | |
| 343 | + if (idev) { | |
| 344 | + in6_dev_put(idev); | |
| 345 | + *pidev = NULL; | |
| 346 | + } | |
| 347 | +} | |
| 348 | + | |
| 339 | 349 | static inline void __in6_dev_put(struct inet6_dev *idev) |
| 340 | 350 | { |
| 341 | 351 | refcount_dec(&idev->refcnt); |
| @@ -277,6 +277,11 @@ static inline bool bond_is_lb(const struct bonding *bond) · 276 unmodified lines | ||
| 277 | 277 | BOND_MODE(bond) == BOND_MODE_ALB; |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | +static inline bool bond_needs_speed_duplex(const struct bonding *bond) | |
| 281 | +{ | |
| 282 | + return BOND_MODE(bond) == BOND_MODE_8023AD || bond_is_lb(bond); | |
| 283 | +} | |
| 284 | + | |
| 280 | 285 | static inline bool bond_is_nondyn_tlb(const struct bonding *bond) |
| 281 | 286 | { |
| 282 | 287 | return (BOND_MODE(bond) == BOND_MODE_TLB) && |
| @@ -29,18 +29,18 @@ · 28 unmodified lines | ||
| 29 | 29 | #include <linux/sched/signal.h> |
| 30 | 30 | #include <net/ip.h> |
| 31 | 31 | |
| 32 | −#ifdef CONFIG_NET_RX_BUSY_POLL | |
| 33 | − | |
| 34 | −struct napi_struct; | |
| 35 | −extern unsigned int sysctl_net_busy_read __read_mostly; | |
| 36 | −extern unsigned int sysctl_net_busy_poll __read_mostly; | |
| 37 | − | |
| 38 | 32 | /* 0 - Reserved to indicate value not set |
| 39 | 33 | * 1..NR_CPUS - Reserved for sender_cpu |
| 40 | 34 | * NR_CPUS+1..~0 - Region available for NAPI IDs |
| 41 | 35 | */ |
| 42 | 36 | #define MIN_NAPI_ID ((unsigned int)(NR_CPUS + 1)) |
| 43 | 37 | |
| 38 | +#ifdef CONFIG_NET_RX_BUSY_POLL | |
| 39 | + | |
| 40 | +struct napi_struct; | |
| 41 | +extern unsigned int sysctl_net_busy_read __read_mostly; | |
| 42 | +extern unsigned int sysctl_net_busy_poll __read_mostly; | |
| 43 | + | |
| 44 | 44 | static inline bool net_busy_loop_on(void) |
| 45 | 45 | { |
| 46 | 46 | return sysctl_net_busy_poll; |
| @@ -5499,6 +5499,21 @@ static inline void ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif, · 5498 unmodified lines | ||
| 5499 | 5499 | ieee80211_manage_rx_ba_offl(vif, addr, tid + IEEE80211_NUM_TIDS); |
| 5500 | 5500 | } |
| 5501 | 5501 | |
| 5502 | +/** | |
| 5503 | + * ieee80211_rx_ba_timer_expired - stop a Rx BA session due to timeout | |
| 5504 | + * | |
| 5505 | + * Some device drivers do not offload AddBa/DelBa negotiation, but handle rx | |
| 5506 | + * buffer reording internally, and therefore also handle the session timer. | |
| 5507 | + * | |
| 5508 | + * Trigger the timeout flow, which sends a DelBa. | |
| 5509 | + * | |
| 5510 | + * @vif: &struct ieee80211_vif pointer from the add_interface callback | |
| 5511 | + * @addr: station mac address | |
| 5512 | + * @tid: the rx tid | |
| 5513 | + */ | |
| 5514 | +void ieee80211_rx_ba_timer_expired(struct ieee80211_vif *vif, | |
| 5515 | + const u8 *addr, unsigned int tid); | |
| 5516 | + | |
| 5502 | 5517 | /* Rate control API */ |
| 5503 | 5518 | |
| 5504 | 5519 | /** |
| @@ -366,12 +366,13 @@ static inline bool udp_skb_is_linear(struct sk_buff *skb) · 365 unmodified lines | ||
| 366 | 366 | static inline int copy_linear_skb(struct sk_buff *skb, int len, int off, |
| 367 | 367 | struct iov_iter *to) |
| 368 | 368 | { |
| 369 | − int n, copy = len - off; | |
| 369 | + int n; | |
| 370 | 370 | |
| 371 | − n = copy_to_iter(skb->data + off, copy, to); | |
| 372 | − if (n == copy) | |
| 371 | + n = copy_to_iter(skb->data + off, len, to); | |
| 372 | + if (n == len) | |
| 373 | 373 | return 0; |
| 374 | 374 | |
| 375 | + iov_iter_revert(to, n); | |
| 375 | 376 | return -EFAULT; |
| 376 | 377 | } |
| 377 | 378 | |
| @@ -204,10 +204,36 @@ BPF_CALL_5(bpf_trace_printk, char *, fmt, u32, fmt_size, u64, arg1, · 203 unmodified lines | ||
| 204 | 204 | fmt_cnt++; |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | − return __trace_printk(1/* fake ip will not be printed */, fmt, | |
| 208 | − mod[0] == 2 ? arg1 : mod[0] == 1 ? (long) arg1 : (u32) arg1, | |
| 209 | − mod[1] == 2 ? arg2 : mod[1] == 1 ? (long) arg2 : (u32) arg2, | |
| 210 | − mod[2] == 2 ? arg3 : mod[2] == 1 ? (long) arg3 : (u32) arg3); | |
| 207 | +/* Horrid workaround for getting va_list handling working with different | |
| 208 | + * argument type combinations generically for 32 and 64 bit archs. | |
| 209 | + */ | |
| 210 | +#define __BPF_TP_EMIT() __BPF_ARG3_TP() | |
| 211 | +#define __BPF_TP(...) \ | |
| 212 | + __trace_printk(1 /* Fake ip will not be printed. */, \ | |
| 213 | + fmt, ##__VA_ARGS__) | |
| 214 | + | |
| 215 | +#define __BPF_ARG1_TP(...) \ | |
| 216 | + ((mod[0] == 2 || (mod[0] == 1 && __BITS_PER_LONG == 64)) \ | |
| 217 | + ? __BPF_TP(arg1, ##__VA_ARGS__) \ | |
| 218 | + : ((mod[0] == 1 || (mod[0] == 0 && __BITS_PER_LONG == 32)) \ | |
| 219 | + ? __BPF_TP((long)arg1, ##__VA_ARGS__) \ | |
| 220 | + : __BPF_TP((u32)arg1, ##__VA_ARGS__))) | |
| 221 | + | |
| 222 | +#define __BPF_ARG2_TP(...) \ | |
| 223 | + ((mod[1] == 2 || (mod[1] == 1 && __BITS_PER_LONG == 64)) \ | |
| 224 | + ? __BPF_ARG1_TP(arg2, ##__VA_ARGS__) \ | |
| 225 | + : ((mod[1] == 1 || (mod[1] == 0 && __BITS_PER_LONG == 32)) \ | |
| 226 | + ? __BPF_ARG1_TP((long)arg2, ##__VA_ARGS__) \ | |
| 227 | + : __BPF_ARG1_TP((u32)arg2, ##__VA_ARGS__))) | |
| 228 | + | |
| 229 | +#define __BPF_ARG3_TP(...) \ | |
| 230 | + ((mod[2] == 2 || (mod[2] == 1 && __BITS_PER_LONG == 64)) \ | |
| 231 | + ? __BPF_ARG2_TP(arg3, ##__VA_ARGS__) \ | |
| 232 | + : ((mod[2] == 1 || (mod[2] == 0 && __BITS_PER_LONG == 32)) \ | |
| 233 | + ? __BPF_ARG2_TP((long)arg3, ##__VA_ARGS__) \ | |
| 234 | + : __BPF_ARG2_TP((u32)arg3, ##__VA_ARGS__))) | |
| 235 | + | |
| 236 | + return __BPF_TP_EMIT(); | |
| 211 | 237 | } |
| 212 | 238 | |
| 213 | 239 | static const struct bpf_func_proto bpf_trace_printk_proto = { |
| @@ -3505,6 +3505,7 @@ static u32 bpf_convert_ctx_access(enum bpf_access_type type, · 3504 unmodified lines | ||
| 3505 | 3505 | bpf_target_off(struct sk_buff, tc_index, 2, |
| 3506 | 3506 | target_size)); |
| 3507 | 3507 | #else |
| 3508 | + *target_size = 2; | |
| 3508 | 3509 | if (type == BPF_WRITE) |
| 3509 | 3510 | *insn++ = BPF_MOV64_REG(si->dst_reg, si->dst_reg); |
| 3510 | 3511 | else |
| @@ -3520,6 +3521,7 @@ static u32 bpf_convert_ctx_access(enum bpf_access_type type, · 9 unmodified lines | ||
| 3520 | 3521 | *insn++ = BPF_JMP_IMM(BPF_JGE, si->dst_reg, MIN_NAPI_ID, 1); |
| 3521 | 3522 | *insn++ = BPF_MOV64_IMM(si->dst_reg, 0); |
| 3522 | 3523 | #else |
| 3524 | + *target_size = 4; | |
| 3523 | 3525 | *insn++ = BPF_MOV64_IMM(si->dst_reg, 0); |
| 3524 | 3526 | #endif |
| 3525 | 3527 | break; |
| @@ -201,10 +201,7 @@ void dccp_destroy_sock(struct sock *sk) · 200 unmodified lines | ||
| 201 | 201 | { |
| 202 | 202 | struct dccp_sock *dp = dccp_sk(sk); |
| 203 | 203 | |
| 204 | − /* | |
| 205 | − * DCCP doesn't use sk_write_queue, just sk_send_head | |
| 206 | − * for retransmissions | |
| 207 | − */ | |
| 204 | + __skb_queue_purge(&sk->sk_write_queue); | |
| 208 | 205 | if (sk->sk_send_head != NULL) { |
| 209 | 206 | kfree_skb(sk->sk_send_head); |
| 210 | 207 | sk->sk_send_head = NULL; |
| @@ -42,6 +42,9 @@ static struct sk_buff *ksz_xmit(struct sk_buff *skb, struct net_device *dev) · 41 unmodified lines | ||
| 42 | 42 | padlen = (skb->len >= ETH_ZLEN) ? 0 : ETH_ZLEN - skb->len; |
| 43 | 43 | |
| 44 | 44 | if (skb_tailroom(skb) >= padlen + KSZ_INGRESS_TAG_LEN) { |
| 45 | + if (skb_put_padto(skb, skb->len + padlen)) | |
| 46 | + return NULL; | |
| 47 | + | |
| 45 | 48 | nskb = skb; |
| 46 | 49 | } else { |
| 47 | 50 | nskb = alloc_skb(NET_IP_ALIGN + skb->len + |
| @@ -56,13 +59,15 @@ static struct sk_buff *ksz_xmit(struct sk_buff *skb, struct net_device *dev) · 8 unmodified lines | ||
| 56 | 59 | skb_set_transport_header(nskb, |
| 57 | 60 | skb_transport_header(skb) - skb->head); |
| 58 | 61 | skb_copy_and_csum_dev(skb, skb_put(nskb, skb->len)); |
| 62 | + | |
| 63 | + if (skb_put_padto(nskb, nskb->len + padlen)) { | |
| 64 | + kfree_skb(nskb); | |
| 65 | + return NULL; | |
| 66 | + } | |
| 67 | + | |
| 59 | 68 | kfree_skb(skb); |
| 60 | 69 | } |
| 61 | 70 | |
| 62 | − /* skb is freed when it fails */ | |
| 63 | − if (skb_put_padto(nskb, nskb->len + padlen)) | |
| 64 | − return NULL; | |
| 65 | − | |
| 66 | 71 | tag = skb_put(nskb, KSZ_INGRESS_TAG_LEN); |
| 67 | 72 | tag[0] = 0; |
| 68 | 73 | tag[1] = 1 << p->dp->index; /* destination port */ |
| @@ -1083,15 +1083,17 @@ struct fib_info *fib_create_info(struct fib_config *cfg, · 1082 unmodified lines | ||
| 1083 | 1083 | fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL); |
| 1084 | 1084 | if (!fi) |
| 1085 | 1085 | goto failure; |
| 1086 | − fib_info_cnt++; | |
| 1087 | 1086 | if (cfg->fc_mx) { |
| 1088 | 1087 | fi->fib_metrics = kzalloc(sizeof(*fi->fib_metrics), GFP_KERNEL); |
| 1089 | − if (!fi->fib_metrics) | |
| 1090 | − goto failure; | |
| 1088 | + if (unlikely(!fi->fib_metrics)) { | |
| 1089 | + kfree(fi); | |
| 1090 | + return ERR_PTR(err); | |
| 1091 | + } | |
| 1091 | 1092 | atomic_set(&fi->fib_metrics->refcnt, 1); |
| 1092 | − } else | |
| 1093 | + } else { | |
| 1093 | 1094 | fi->fib_metrics = (struct dst_metrics *)&dst_default_metrics; |
| 1094 | − | |
| 1095 | + } | |
| 1096 | + fib_info_cnt++; | |
| 1095 | 1097 | fi->fib_net = net; |
| 1096 | 1098 | fi->fib_protocol = cfg->fc_protocol; |
| 1097 | 1099 | fi->fib_scope = cfg->fc_scope; |
| @@ -2750,12 +2750,13 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, · 2749 unmodified lines | ||
| 2750 | 2750 | err = 0; |
| 2751 | 2751 | if (IS_ERR(rt)) |
| 2752 | 2752 | err = PTR_ERR(rt); |
| 2753 | + else | |
| 2754 | + skb_dst_set(skb, &rt->dst); | |
| 2753 | 2755 | } |
| 2754 | 2756 | |
| 2755 | 2757 | if (err) |
| 2756 | 2758 | goto errout_free; |
| 2757 | 2759 | |
| 2758 | − skb_dst_set(skb, &rt->dst); | |
| 2759 | 2760 | if (rtm->rtm_flags & RTM_F_NOTIFY) |
| 2760 | 2761 | rt->rt_flags |= RTCF_NOTIFY; |
| 2761 | 2762 | |
| @@ -1722,6 +1722,8 @@ process: · 1721 unmodified lines | ||
| 1722 | 1722 | */ |
| 1723 | 1723 | sock_hold(sk); |
| 1724 | 1724 | refcounted = true; |
| 1725 | + if (tcp_filter(sk, skb)) | |
| 1726 | + goto discard_and_relse; | |
| 1725 | 1727 | nsk = tcp_check_req(sk, skb, req, false); |
| 1726 | 1728 | if (!nsk) { |
| 1727 | 1729 | reqsk_put(req); |
| @@ -1729,8 +1731,6 @@ process: · 1 unmodified line | ||
| 1729 | 1731 | } |
| 1730 | 1732 | if (nsk == sk) { |
| 1731 | 1733 | reqsk_put(req); |
| 1732 | − } else if (tcp_filter(sk, skb)) { | |
| 1733 | − goto discard_and_relse; | |
| 1734 | 1734 | } else if (tcp_child_process(sk, nsk, skb)) { |
| 1735 | 1735 | tcp_v4_send_reset(nsk, skb); |
| 1736 | 1736 | goto discard_and_relse; |
| @@ -122,14 +122,14 @@ int tcp_set_ulp(struct sock *sk, const char *name) · 121 unmodified lines | ||
| 122 | 122 | |
| 123 | 123 | ulp_ops = __tcp_ulp_find_autoload(name); |
| 124 | 124 | if (!ulp_ops) |
| 125 | − err = -ENOENT; | |
| 126 | − else | |
| 127 | − err = ulp_ops->init(sk); | |
| 125 | + return -ENOENT; | |
| 128 | 126 | |
| 129 | − if (err) | |
| 130 | − goto out; | |
| 127 | + err = ulp_ops->init(sk); | |
| 128 | + if (err) { | |
| 129 | + module_put(ulp_ops->owner); | |
| 130 | + return err; | |
| 131 | + } | |
| 131 | 132 | |
| 132 | 133 | icsk->icsk_ulp_ops = ulp_ops; |
| 133 | − out: | |
| 134 | − return err; | |
| 134 | + return 0; | |
| 135 | 135 | } |
| @@ -417,14 +417,11 @@ static void ip6_dst_ifdown(struct dst_entry *dst, struct net_device *dev, · 416 unmodified lines | ||
| 417 | 417 | struct net_device *loopback_dev = |
| 418 | 418 | dev_net(dev)->loopback_dev; |
| 419 | 419 | |
| 420 | − if (dev != loopback_dev) { | |
| 421 | − if (idev && idev->dev == dev) { | |
| 422 | − struct inet6_dev *loopback_idev = | |
| 423 | − in6_dev_get(loopback_dev); | |
| 424 | − if (loopback_idev) { | |
| 425 | − rt->rt6i_idev = loopback_idev; | |
| 426 | − in6_dev_put(idev); | |
| 427 | − } | |
| 420 | + if (idev && idev->dev != loopback_dev) { | |
| 421 | + struct inet6_dev *loopback_idev = in6_dev_get(loopback_dev); | |
| 422 | + if (loopback_idev) { | |
| 423 | + rt->rt6i_idev = loopback_idev; | |
| 424 | + in6_dev_put(idev); | |
| 428 | 425 | } |
| 429 | 426 | } |
| 430 | 427 | } |
| @@ -3724,10 +3721,10 @@ static int ip6_route_dev_notify(struct notifier_block *this, · 3293 unmodified lines | ||
| 3724 | 3721 | /* NETDEV_UNREGISTER could be fired for multiple times by |
| 3725 | 3722 | * netdev_wait_allrefs(). Make sure we only call this once. |
| 3726 | 3723 | */ |
| 3727 | − in6_dev_put(net->ipv6.ip6_null_entry->rt6i_idev); | |
| 3724 | + in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); | |
| 3728 | 3725 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES |
| 3729 | − in6_dev_put(net->ipv6.ip6_prohibit_entry->rt6i_idev); | |
| 3730 | − in6_dev_put(net->ipv6.ip6_blk_hole_entry->rt6i_idev); | |
| 3726 | + in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); | |
| 3727 | + in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); | |
| 3731 | 3728 | #endif |
| 3732 | 3729 | } |
| 3733 | 3730 | |
| @@ -1456,6 +1456,8 @@ process: · 1455 unmodified lines | ||
| 1456 | 1456 | } |
| 1457 | 1457 | sock_hold(sk); |
| 1458 | 1458 | refcounted = true; |
| 1459 | + if (tcp_filter(sk, skb)) | |
| 1460 | + goto discard_and_relse; | |
| 1459 | 1461 | nsk = tcp_check_req(sk, skb, req, false); |
| 1460 | 1462 | if (!nsk) { |
| 1461 | 1463 | reqsk_put(req); |
| @@ -1464,8 +1466,6 @@ process: · 2 unmodified lines | ||
| 1464 | 1466 | if (nsk == sk) { |
| 1465 | 1467 | reqsk_put(req); |
| 1466 | 1468 | tcp_v6_restore_cb(skb); |
| 1467 | − } else if (tcp_filter(sk, skb)) { | |
| 1468 | − goto discard_and_relse; | |
| 1469 | 1469 | } else if (tcp_child_process(sk, nsk, skb)) { |
| 1470 | 1470 | tcp_v6_send_reset(nsk, skb); |
| 1471 | 1471 | goto discard_and_relse; |
| @@ -228,7 +228,7 @@ static int pfkey_broadcast_one(struct sk_buff *skb, struct sk_buff **skb2, · 227 unmodified lines | ||
| 228 | 228 | #define BROADCAST_ONE 1 |
| 229 | 229 | #define BROADCAST_REGISTERED 2 |
| 230 | 230 | #define BROADCAST_PROMISC_ONLY 4 |
| 231 | −static int pfkey_broadcast(struct sk_buff *skb, | |
| 231 | +static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation, | |
| 232 | 232 | int broadcast_flags, struct sock *one_sk, |
| 233 | 233 | struct net *net) |
| 234 | 234 | { |
| @@ -278,7 +278,7 @@ static int pfkey_broadcast(struct sk_buff *skb, · 43 unmodified lines | ||
| 278 | 278 | rcu_read_unlock(); |
| 279 | 279 | |
| 280 | 280 | if (one_sk != NULL) |
| 281 | − err = pfkey_broadcast_one(skb, &skb2, GFP_KERNEL, one_sk); | |
| 281 | + err = pfkey_broadcast_one(skb, &skb2, allocation, one_sk); | |
| 282 | 282 | |
| 283 | 283 | kfree_skb(skb2); |
| 284 | 284 | kfree_skb(skb); |
| @@ -311,7 +311,7 @@ static int pfkey_do_dump(struct pfkey_sock *pfk) · 26 unmodified lines | ||
| 311 | 311 | hdr = (struct sadb_msg *) pfk->dump.skb->data; |
| 312 | 312 | hdr->sadb_msg_seq = 0; |
| 313 | 313 | hdr->sadb_msg_errno = rc; |
| 314 | − pfkey_broadcast(pfk->dump.skb, BROADCAST_ONE, | |
| 314 | + pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE, | |
| 315 | 315 | &pfk->sk, sock_net(&pfk->sk)); |
| 316 | 316 | pfk->dump.skb = NULL; |
| 317 | 317 | } |
| @@ -355,7 +355,7 @@ static int pfkey_error(const struct sadb_msg *orig, int err, struct sock *sk) · 37 unmodified lines | ||
| 355 | 355 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / |
| 356 | 356 | sizeof(uint64_t)); |
| 357 | 357 | |
| 358 | − pfkey_broadcast(skb, BROADCAST_ONE, sk, sock_net(sk)); | |
| 358 | + pfkey_broadcast(skb, GFP_KERNEL, BROADCAST_ONE, sk, sock_net(sk)); | |
| 359 | 359 | |
| 360 | 360 | return 0; |
| 361 | 361 | } |
| @@ -1389,7 +1389,7 @@ static int pfkey_getspi(struct sock *sk, struct sk_buff *skb, const struct sadb_ · 1027 unmodified lines | ||
| 1389 | 1389 | |
| 1390 | 1390 | xfrm_state_put(x); |
| 1391 | 1391 | |
| 1392 | − pfkey_broadcast(resp_skb, BROADCAST_ONE, sk, net); | |
| 1392 | + pfkey_broadcast(resp_skb, GFP_KERNEL, BROADCAST_ONE, sk, net); | |
| 1393 | 1393 | |
| 1394 | 1394 | return 0; |
| 1395 | 1395 | } |
| @@ -1476,7 +1476,7 @@ static int key_notify_sa(struct xfrm_state *x, const struct km_event *c) · 80 unmodified lines | ||
| 1476 | 1476 | hdr->sadb_msg_seq = c->seq; |
| 1477 | 1477 | hdr->sadb_msg_pid = c->portid; |
| 1478 | 1478 | |
| 1479 | − pfkey_broadcast(skb, BROADCAST_ALL, NULL, xs_net(x)); | |
| 1479 | + pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xs_net(x)); | |
| 1480 | 1480 | |
| 1481 | 1481 | return 0; |
| 1482 | 1482 | } |
| @@ -1589,7 +1589,7 @@ static int pfkey_get(struct sock *sk, struct sk_buff *skb, const struct sadb_msg · 106 unmodified lines | ||
| 1589 | 1589 | out_hdr->sadb_msg_reserved = 0; |
| 1590 | 1590 | out_hdr->sadb_msg_seq = hdr->sadb_msg_seq; |
| 1591 | 1591 | out_hdr->sadb_msg_pid = hdr->sadb_msg_pid; |
| 1592 | − pfkey_broadcast(out_skb, BROADCAST_ONE, sk, sock_net(sk)); | |
| 1592 | + pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ONE, sk, sock_net(sk)); | |
| 1593 | 1593 | |
| 1594 | 1594 | return 0; |
| 1595 | 1595 | } |
| @@ -1694,8 +1694,8 @@ static int pfkey_register(struct sock *sk, struct sk_buff *skb, const struct sad · 98 unmodified lines | ||
| 1694 | 1694 | return -ENOBUFS; |
| 1695 | 1695 | } |
| 1696 | 1696 | |
| 1697 | − pfkey_broadcast(supp_skb, BROADCAST_REGISTERED, sk, sock_net(sk)); | |
| 1698 | − | |
| 1697 | + pfkey_broadcast(supp_skb, GFP_KERNEL, BROADCAST_REGISTERED, sk, | |
| 1698 | + sock_net(sk)); | |
| 1699 | 1699 | return 0; |
| 1700 | 1700 | } |
| 1701 | 1701 | |
| @@ -1712,7 +1712,8 @@ static int unicast_flush_resp(struct sock *sk, const struct sadb_msg *ihdr) · 10 unmodified lines | ||
| 1712 | 1712 | hdr->sadb_msg_errno = (uint8_t) 0; |
| 1713 | 1713 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); |
| 1714 | 1714 | |
| 1715 | − return pfkey_broadcast(skb, BROADCAST_ONE, sk, sock_net(sk)); | |
| 1715 | + return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ONE, sk, | |
| 1716 | + sock_net(sk)); | |
| 1716 | 1717 | } |
| 1717 | 1718 | |
| 1718 | 1719 | static int key_notify_sa_flush(const struct km_event *c) |
| @@ -1733,7 +1734,7 @@ static int key_notify_sa_flush(const struct km_event *c) · 14 unmodified lines | ||
| 1733 | 1734 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); |
| 1734 | 1735 | hdr->sadb_msg_reserved = 0; |
| 1735 | 1736 | |
| 1736 | − pfkey_broadcast(skb, BROADCAST_ALL, NULL, c->net); | |
| 1737 | + pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net); | |
| 1737 | 1738 | |
| 1738 | 1739 | return 0; |
| 1739 | 1740 | } |
| @@ -1790,7 +1791,7 @@ static int dump_sa(struct xfrm_state *x, int count, void *ptr) · 50 unmodified lines | ||
| 1790 | 1791 | out_hdr->sadb_msg_pid = pfk->dump.msg_portid; |
| 1791 | 1792 | |
| 1792 | 1793 | if (pfk->dump.skb) |
| 1793 | − pfkey_broadcast(pfk->dump.skb, BROADCAST_ONE, | |
| 1794 | + pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE, | |
| 1794 | 1795 | &pfk->sk, sock_net(&pfk->sk)); |
| 1795 | 1796 | pfk->dump.skb = out_skb; |
| 1796 | 1797 | |
| @@ -1878,7 +1879,7 @@ static int pfkey_promisc(struct sock *sk, struct sk_buff *skb, const struct sadb · 81 unmodified lines | ||
| 1878 | 1879 | new_hdr->sadb_msg_errno = 0; |
| 1879 | 1880 | } |
| 1880 | 1881 | |
| 1881 | − pfkey_broadcast(skb, BROADCAST_ALL, NULL, sock_net(sk)); | |
| 1882 | + pfkey_broadcast(skb, GFP_KERNEL, BROADCAST_ALL, NULL, sock_net(sk)); | |
| 1882 | 1883 | return 0; |
| 1883 | 1884 | } |
| 1884 | 1885 | |
| @@ -2206,7 +2207,7 @@ static int key_notify_policy(struct xfrm_policy *xp, int dir, const struct km_ev · 321 unmodified lines | ||
| 2206 | 2207 | out_hdr->sadb_msg_errno = 0; |
| 2207 | 2208 | out_hdr->sadb_msg_seq = c->seq; |
| 2208 | 2209 | out_hdr->sadb_msg_pid = c->portid; |
| 2209 | − pfkey_broadcast(out_skb, BROADCAST_ALL, NULL, xp_net(xp)); | |
| 2210 | + pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xp_net(xp)); | |
| 2210 | 2211 | return 0; |
| 2211 | 2212 | |
| 2212 | 2213 | } |
| @@ -2426,7 +2427,7 @@ static int key_pol_get_resp(struct sock *sk, struct xfrm_policy *xp, const struc · 213 unmodified lines | ||
| 2426 | 2427 | out_hdr->sadb_msg_errno = 0; |
| 2427 | 2428 | out_hdr->sadb_msg_seq = hdr->sadb_msg_seq; |
| 2428 | 2429 | out_hdr->sadb_msg_pid = hdr->sadb_msg_pid; |
| 2429 | − pfkey_broadcast(out_skb, BROADCAST_ONE, sk, xp_net(xp)); | |
| 2430 | + pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ONE, sk, xp_net(xp)); | |
| 2430 | 2431 | err = 0; |
| 2431 | 2432 | |
| 2432 | 2433 | out: |
| @@ -2682,7 +2683,7 @@ static int dump_sp(struct xfrm_policy *xp, int dir, int count, void *ptr) · 249 unmodified lines | ||
| 2682 | 2683 | out_hdr->sadb_msg_pid = pfk->dump.msg_portid; |
| 2683 | 2684 | |
| 2684 | 2685 | if (pfk->dump.skb) |
| 2685 | − pfkey_broadcast(pfk->dump.skb, BROADCAST_ONE, | |
| 2686 | + pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE, | |
| 2686 | 2687 | &pfk->sk, sock_net(&pfk->sk)); |
| 2687 | 2688 | pfk->dump.skb = out_skb; |
| 2688 | 2689 | |
| @@ -2739,7 +2740,7 @@ static int key_notify_policy_flush(const struct km_event *c) · 50 unmodified lines | ||
| 2739 | 2740 | hdr->sadb_msg_satype = SADB_SATYPE_UNSPEC; |
| 2740 | 2741 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); |
| 2741 | 2742 | hdr->sadb_msg_reserved = 0; |
| 2742 | − pfkey_broadcast(skb_out, BROADCAST_ALL, NULL, c->net); | |
| 2743 | + pfkey_broadcast(skb_out, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net); | |
| 2743 | 2744 | return 0; |
| 2744 | 2745 | |
| 2745 | 2746 | } |
| @@ -2803,7 +2804,7 @@ static int pfkey_process(struct sock *sk, struct sk_buff *skb, const struct sadb · 57 unmodified lines | ||
| 2803 | 2804 | void *ext_hdrs[SADB_EXT_MAX]; |
| 2804 | 2805 | int err; |
| 2805 | 2806 | |
| 2806 | − pfkey_broadcast(skb_clone(skb, GFP_KERNEL), | |
| 2807 | + pfkey_broadcast(skb_clone(skb, GFP_KERNEL), GFP_KERNEL, | |
| 2807 | 2808 | BROADCAST_PROMISC_ONLY, NULL, sock_net(sk)); |
| 2808 | 2809 | |
| 2809 | 2810 | memset(ext_hdrs, 0, sizeof(ext_hdrs)); |
| @@ -3024,7 +3025,8 @@ static int key_notify_sa_expire(struct xfrm_state *x, const struct km_event *c) · 214 unmodified lines | ||
| 3024 | 3025 | out_hdr->sadb_msg_seq = 0; |
| 3025 | 3026 | out_hdr->sadb_msg_pid = 0; |
| 3026 | 3027 | |
| 3027 | − pfkey_broadcast(out_skb, BROADCAST_REGISTERED, NULL, xs_net(x)); | |
| 3028 | + pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_REGISTERED, NULL, | |
| 3029 | + xs_net(x)); | |
| 3028 | 3030 | return 0; |
| 3029 | 3031 | } |
| 3030 | 3032 | |
| @@ -3212,7 +3214,8 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct · 181 unmodified lines | ||
| 3212 | 3214 | xfrm_ctx->ctx_len); |
| 3213 | 3215 | } |
| 3214 | 3216 | |
| 3215 | − return pfkey_broadcast(skb, BROADCAST_REGISTERED, NULL, xs_net(x)); | |
| 3217 | + return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_REGISTERED, NULL, | |
| 3218 | + xs_net(x)); | |
| 3216 | 3219 | } |
| 3217 | 3220 | |
| 3218 | 3221 | static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt, |
| @@ -3408,7 +3411,8 @@ static int pfkey_send_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, · 189 unmodified lines | ||
| 3408 | 3411 | n_port->sadb_x_nat_t_port_port = sport; |
| 3409 | 3412 | n_port->sadb_x_nat_t_port_reserved = 0; |
| 3410 | 3413 | |
| 3411 | − return pfkey_broadcast(skb, BROADCAST_REGISTERED, NULL, xs_net(x)); | |
| 3414 | + return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_REGISTERED, NULL, | |
| 3415 | + xs_net(x)); | |
| 3412 | 3416 | } |
| 3413 | 3417 | |
| 3414 | 3418 | #ifdef CONFIG_NET_KEY_MIGRATE |
| @@ -3599,7 +3603,7 @@ static int pfkey_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, · 184 unmodified lines | ||
| 3599 | 3603 | } |
| 3600 | 3604 | |
| 3601 | 3605 | /* broadcast migrate message to sockets */ |
| 3602 | − pfkey_broadcast(skb, BROADCAST_ALL, NULL, &init_net); | |
| 3606 | + pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, &init_net); | |
| 3603 | 3607 | |
| 3604 | 3608 | return 0; |
| 3605 | 3609 | |
| @@ -7,7 +7,7 @@ · 6 unmodified lines | ||
| 7 | 7 | * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> |
| 8 | 8 | * Copyright 2007, Michael Wu <flamingice@sourmilk.net> |
| 9 | 9 | * Copyright 2007-2010, Intel Corporation |
| 10 | − * Copyright(c) 2015 Intel Deutschland GmbH | |
| 10 | + * Copyright(c) 2015-2017 Intel Deutschland GmbH | |
| 11 | 11 | * |
| 12 | 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | 13 | * it under the terms of the GNU General Public License version 2 as |
| @@ -466,3 +466,23 @@ void ieee80211_manage_rx_ba_offl(struct ieee80211_vif *vif, · 452 unmodified lines | ||
| 466 | 466 | rcu_read_unlock(); |
| 467 | 467 | } |
| 468 | 468 | EXPORT_SYMBOL(ieee80211_manage_rx_ba_offl); |
| 469 | + | |
| 470 | +void ieee80211_rx_ba_timer_expired(struct ieee80211_vif *vif, | |
| 471 | + const u8 *addr, unsigned int tid) | |
| 472 | +{ | |
| 473 | + struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); | |
| 474 | + struct ieee80211_local *local = sdata->local; | |
| 475 | + struct sta_info *sta; | |
| 476 | + | |
| 477 | + rcu_read_lock(); | |
| 478 | + sta = sta_info_get_bss(sdata, addr); | |
| 479 | + if (!sta) | |
| 480 | + goto unlock; | |
| 481 | + | |
| 482 | + set_bit(tid, sta->ampdu_mlme.tid_rx_timer_expired); | |
| 483 | + ieee80211_queue_work(&local->hw, &sta->ampdu_mlme.work); | |
| 484 | + | |
| 485 | + unlock: | |
| 486 | + rcu_read_unlock(); | |
| 487 | +} | |
| 488 | +EXPORT_SYMBOL(ieee80211_rx_ba_timer_expired); | |
| @@ -286,9 +286,6 @@ static struct Qdisc *qdisc_match_from_root(struct Qdisc *root, u32 handle) · 285 unmodified lines | ||
| 286 | 286 | void qdisc_hash_add(struct Qdisc *q, bool invisible) |
| 287 | 287 | { |
| 288 | 288 | if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS)) { |
| 289 | − struct Qdisc *root = qdisc_dev(q)->qdisc; | |
| 290 | − | |
| 291 | − WARN_ON_ONCE(root == &noop_qdisc); | |
| 292 | 289 | ASSERT_RTNL(); |
| 293 | 290 | hash_add_rcu(qdisc_dev(q)->qdisc_hash, &q->hash, q->handle); |
| 294 | 291 | if (invisible) |
| @@ -572,8 +572,10 @@ static void atm_tc_destroy(struct Qdisc *sch) · 571 unmodified lines | ||
| 572 | 572 | struct atm_flow_data *flow, *tmp; |
| 573 | 573 | |
| 574 | 574 | pr_debug("atm_tc_destroy(sch %p,[qdisc %p])\n", sch, p); |
| 575 | − list_for_each_entry(flow, &p->flows, list) | |
| 575 | + list_for_each_entry(flow, &p->flows, list) { | |
| 576 | 576 | tcf_block_put(flow->block); |
| 577 | + flow->block = NULL; | |
| 578 | + } | |
| 577 | 579 | |
| 578 | 580 | list_for_each_entry_safe(flow, tmp, &p->flows, list) { |
| 579 | 581 | if (flow->ref > 1) |
| @@ -1431,8 +1431,10 @@ static void cbq_destroy(struct Qdisc *sch) · 1430 unmodified lines | ||
| 1431 | 1431 | * be bound to classes which have been destroyed already. --TGR '04 |
| 1432 | 1432 | */ |
| 1433 | 1433 | for (h = 0; h < q->clhash.hashsize; h++) { |
| 1434 | − hlist_for_each_entry(cl, &q->clhash.hash[h], common.hnode) | |
| 1434 | + hlist_for_each_entry(cl, &q->clhash.hash[h], common.hnode) { | |
| 1435 | 1435 | tcf_block_put(cl->block); |
| 1436 | + cl->block = NULL; | |
| 1437 | + } | |
| 1436 | 1438 | } |
| 1437 | 1439 | for (h = 0; h < q->clhash.hashsize; h++) { |
| 1438 | 1440 | hlist_for_each_entry_safe(cl, next, &q->clhash.hash[h], |
| @@ -1428,6 +1428,10 @@ hfsc_init_qdisc(struct Qdisc *sch, struct nlattr *opt) · 1427 unmodified lines | ||
| 1428 | 1428 | return err; |
| 1429 | 1429 | q->eligible = RB_ROOT; |
| 1430 | 1430 | |
| 1431 | + err = tcf_block_get(&q->root.block, &q->root.filter_list); | |
| 1432 | + if (err) | |
| 1433 | + goto err_tcf; | |
| 1434 | + | |
| 1431 | 1435 | q->root.cl_common.classid = sch->handle; |
| 1432 | 1436 | q->root.refcnt = 1; |
| 1433 | 1437 | q->root.sched = q; |
| @@ -1447,6 +1451,10 @@ hfsc_init_qdisc(struct Qdisc *sch, struct nlattr *opt) · 13 unmodified lines | ||
| 1447 | 1451 | qdisc_watchdog_init(&q->watchdog, sch); |
| 1448 | 1452 | |
| 1449 | 1453 | return 0; |
| 1454 | + | |
| 1455 | +err_tcf: | |
| 1456 | + qdisc_class_hash_destroy(&q->clhash); | |
| 1457 | + return err; | |
| 1450 | 1458 | } |
| 1451 | 1459 | |
| 1452 | 1460 | static int |
| @@ -1522,8 +1530,10 @@ hfsc_destroy_qdisc(struct Qdisc *sch) · 69 unmodified lines | ||
| 1522 | 1530 | unsigned int i; |
| 1523 | 1531 | |
| 1524 | 1532 | for (i = 0; i < q->clhash.hashsize; i++) { |
| 1525 | − hlist_for_each_entry(cl, &q->clhash.hash[i], cl_common.hnode) | |
| 1533 | + hlist_for_each_entry(cl, &q->clhash.hash[i], cl_common.hnode) { | |
| 1526 | 1534 | tcf_block_put(cl->block); |
| 1535 | + cl->block = NULL; | |
| 1536 | + } | |
| 1527 | 1537 | } |
| 1528 | 1538 | for (i = 0; i < q->clhash.hashsize; i++) { |
| 1529 | 1539 | hlist_for_each_entry_safe(cl, next, &q->clhash.hash[i], |
| @@ -1258,8 +1258,10 @@ static void htb_destroy(struct Qdisc *sch) · 1257 unmodified lines | ||
| 1258 | 1258 | tcf_block_put(q->block); |
| 1259 | 1259 | |
| 1260 | 1260 | for (i = 0; i < q->clhash.hashsize; i++) { |
| 1261 | − hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) | |
| 1261 | + hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { | |
| 1262 | 1262 | tcf_block_put(cl->block); |
| 1263 | + cl->block = NULL; | |
| 1264 | + } | |
| 1263 | 1265 | } |
| 1264 | 1266 | for (i = 0; i < q->clhash.hashsize; i++) { |
| 1265 | 1267 | hlist_for_each_entry_safe(cl, next, &q->clhash.hash[i], |
| @@ -437,6 +437,7 @@ congestion_drop: · 436 unmodified lines | ||
| 437 | 437 | qdisc_drop(head, sch, to_free); |
| 438 | 438 | |
| 439 | 439 | slot_queue_add(slot, skb); |
| 440 | + qdisc_tree_reduce_backlog(sch, 0, delta); | |
| 440 | 441 | return NET_XMIT_CN; |
| 441 | 442 | } |
| 442 | 443 | |
| @@ -468,8 +469,10 @@ enqueue: · 25 unmodified lines | ||
| 468 | 469 | /* Return Congestion Notification only if we dropped a packet |
| 469 | 470 | * from this flow. |
| 470 | 471 | */ |
| 471 | − if (qlen != slot->qlen) | |
| 472 | + if (qlen != slot->qlen) { | |
| 473 | + qdisc_tree_reduce_backlog(sch, 0, dropped - qdisc_pkt_len(skb)); | |
| 472 | 474 | return NET_XMIT_CN; |
| 475 | + } | |
| 473 | 476 | |
| 474 | 477 | /* As we dropped a packet, better let upper stack know this */ |
| 475 | 478 | qdisc_tree_reduce_backlog(sch, 1, dropped); |
| @@ -596,7 +596,7 @@ static int tipc_l2_rcv_msg(struct sk_buff *skb, struct net_device *dev, · 595 unmodified lines | ||
| 596 | 596 | rcu_read_lock(); |
| 597 | 597 | b = rcu_dereference_rtnl(dev->tipc_ptr); |
| 598 | 598 | if (likely(b && test_bit(0, &b->up) && |
| 599 | − (skb->pkt_type <= PACKET_BROADCAST))) { | |
| 599 | + (skb->pkt_type <= PACKET_MULTICAST))) { | |
| 600 | 600 | skb->next = NULL; |
| 601 | 601 | tipc_rcv(dev_net(dev), skb, b); |
| 602 | 602 | rcu_read_unlock(); |
| @@ -513,6 +513,7 @@ bool tipc_msg_reverse(u32 own_node, struct sk_buff **skb, int err) · 512 unmodified lines | ||
| 513 | 513 | |
| 514 | 514 | /* Now reverse the concerned fields */ |
| 515 | 515 | msg_set_errcode(hdr, err); |
| 516 | + msg_set_non_seq(hdr, 0); | |
| 516 | 517 | msg_set_origport(hdr, msg_destport(&ohdr)); |
| 517 | 518 | msg_set_destport(hdr, msg_origport(&ohdr)); |
| 518 | 519 | msg_set_destnode(hdr, msg_prevnode(&ohdr)); |