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/davem/net

Pull networking fixes from David Miller:

1) Account for extra headroom in ath9k driver, from Felix Fietkau.

2) Fix OOPS in pppoe driver due to incorrect socket state transition,
from Guillaume Nault.

3) Kill memory leak in amd-xgbe debugfx, from Geliang Tang.

4) Power management fixes for iwlwifi, from Johannes Berg.

5) Fix races in reqsk_queue_unlink(), from Eric Dumazet.

6) Fix dst_entry usage in ARP replies, from Jiri Benc.

7) Cure OOPSes with SO_GET_FILTER, from Daniel Borkmann.

8) Missing allocation failure check in amd-xgbe, from Tom Lendacky.

9) Various resource allocation/freeing cures in DSA< from Neil
Armstrong.

10) A series of bug fixes in the openvswitch conntrack support, from
Joe Stringer.

11) Fix two cases (BPF and act_mirred) where we have to clean the sender
cpu stored in the SKB before transmitting. From WANG Cong and
Alexei Starovoitov.

12) Disable VLAN filtering in promiscuous mode in mlx5 driver, from
Achiad Shochat.

13) Older bnx2x chips cannot do 4-tuple UDP hashing, so prevent this
configuration via ethtool. From Yuval Mintz.

14) Don't call rt6_uncached_list_flush_dev() from rt6_ifdown() when
'dev' is NULL, from Eric Biederman.

15) Prevent stalled link synchronization in tipc, from Jon Paul Maloy.

16) kcalloc() gstrings ethtool buffer before having driver fill it in,
in order to prevent kernel memory leaking. From Joe Perches.

17) Fix mixxing rt6_info initialization for blackhole routes, from
Martin KaFai Lau.

18) Kill VLAN regression in via-rhine, from Andrej Ota.

19) Missing pfmemalloc check in sk_add_backlog(), from Eric Dumazet.

20) Fix spurious MSG_TRUNC signalling in netlink dumps, from Ronen Arad.

21) Scrube SKBs when pushing them between namespaces in openvswitch,
from Joe Stringer.

22) bcmgenet enables link interrupts too early, fix from Florian
Fainelli.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (92 commits)
net: bcmgenet: Fix early link interrupt enabling
tunnels: Don't require remote endpoint or ID during creation.
openvswitch: Scrub skb between namespaces
xen-netback: correctly check failed allocation
net: asix: add support for the Billionton GUSB2AM-1G-B USB adapter
netlink: Trim skb to alloc size to avoid MSG_TRUNC
net: add pfmemalloc check in sk_add_backlog()
via-rhine: fix VLAN receive handling regression.
ipv6: Initialize rt6_info properly in ip6_blackhole_route()
ipv6: Move common init code for rt6_info to a new function rt6_info_init()
Bluetooth: Fix initializing conn_params in scan phase
Bluetooth: Fix conn_params list update in hci_connect_le_scan_cleanup
Bluetooth: Fix remove_device behavior for explicit connects
Bluetooth: Fix LE reconnection logic
Bluetooth: Fix reference counting for LE-scan based connections
Bluetooth: Fix double scan updates
mlxsw: core: Fix race condition in __mlxsw_emad_transmit
tipc: move fragment importance field to new header position
ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings
tipc: eliminate risk of stalled link synchronization
...

+666 -343
-1
MAINTAINERS
··· 6793 6793 6794 6794 MELLANOX ETHERNET DRIVER (mlx4_en) 6795 6795 M: Amir Vadai <amirv@mellanox.com> 6796 - M: Ido Shamay <idos@mellanox.com> 6797 6796 L: netdev@vger.kernel.org 6798 6797 S: Supported 6799 6798 W: http://www.mellanox.com
+1
arch/arm/net/bpf_jit_32.c
··· 614 614 case BPF_LD | BPF_B | BPF_IND: 615 615 load_order = 0; 616 616 load_ind: 617 + update_on_xread(ctx); 617 618 OP_IMM3(ARM_ADD, r_off, r_X, k, ctx); 618 619 goto load_common; 619 620 case BPF_LDX | BPF_IMM:
+1
drivers/net/can/sja1000/peak_pci.c
··· 87 87 {PEAK_PCI_VENDOR_ID, PEAK_PC_104P_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, 88 88 {PEAK_PCI_VENDOR_ID, PEAK_PCI_104E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, 89 89 {PEAK_PCI_VENDOR_ID, PEAK_CPCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, 90 + {PEAK_PCI_VENDOR_ID, PEAK_PCIE_OEM_ID, PCI_ANY_ID, PCI_ANY_ID,}, 90 91 #ifdef CONFIG_CAN_PEAK_PCIEC 91 92 {PEAK_PCI_VENDOR_ID, PEAK_PCIEC_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,}, 92 93 {PEAK_PCI_VENDOR_ID, PEAK_PCIEC34_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
+4
drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
··· 327 327 pdata->debugfs_xpcs_reg = 0; 328 328 329 329 buf = kasprintf(GFP_KERNEL, "amd-xgbe-%s", pdata->netdev->name); 330 + if (!buf) 331 + return; 332 + 330 333 pdata->xgbe_debugfs = debugfs_create_dir(buf, NULL); 331 334 if (!pdata->xgbe_debugfs) { 332 335 netdev_err(pdata->netdev, "debugfs_create_dir failed\n"); 336 + kfree(buf); 333 337 return; 334 338 } 335 339
+7
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
··· 3351 3351 udp_rss_requested = 0; 3352 3352 else 3353 3353 return -EINVAL; 3354 + 3355 + if (CHIP_IS_E1x(bp) && udp_rss_requested) { 3356 + DP(BNX2X_MSG_ETHTOOL, 3357 + "57710, 57711 boards don't support RSS according to UDP 4-tuple\n"); 3358 + return -EINVAL; 3359 + } 3360 + 3354 3361 if ((info->flow_type == UDP_V4_FLOW) && 3355 3362 (bp->rss_conf_obj.udp_rss_v4 != udp_rss_requested)) { 3356 3363 bp->rss_conf_obj.udp_rss_v4 = udp_rss_requested;
+23 -9
drivers/net/ethernet/broadcom/genet/bcmgenet.c
··· 1683 1683 bcmgenet_intrl2_1_writel(priv, 0, INTRL2_CPU_MASK_CLEAR); 1684 1684 } 1685 1685 1686 + static void bcmgenet_link_intr_enable(struct bcmgenet_priv *priv) 1687 + { 1688 + u32 int0_enable = 0; 1689 + 1690 + /* Monitor cable plug/unplugged event for internal PHY, external PHY 1691 + * and MoCA PHY 1692 + */ 1693 + if (priv->internal_phy) { 1694 + int0_enable |= UMAC_IRQ_LINK_EVENT; 1695 + } else if (priv->ext_phy) { 1696 + int0_enable |= UMAC_IRQ_LINK_EVENT; 1697 + } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { 1698 + if (priv->hw_params->flags & GENET_HAS_MOCA_LINK_DET) 1699 + int0_enable |= UMAC_IRQ_LINK_EVENT; 1700 + } 1701 + bcmgenet_intrl2_0_writel(priv, int0_enable, INTRL2_CPU_MASK_CLEAR); 1702 + } 1703 + 1686 1704 static int init_umac(struct bcmgenet_priv *priv) 1687 1705 { 1688 1706 struct device *kdev = &priv->pdev->dev; ··· 1741 1723 /* Enable Tx default queue 16 interrupts */ 1742 1724 int0_enable |= UMAC_IRQ_TXDMA_DONE; 1743 1725 1744 - /* Monitor cable plug/unplugged event for internal PHY */ 1745 - if (priv->internal_phy) { 1746 - int0_enable |= UMAC_IRQ_LINK_EVENT; 1747 - } else if (priv->ext_phy) { 1748 - int0_enable |= UMAC_IRQ_LINK_EVENT; 1749 - } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { 1750 - if (priv->hw_params->flags & GENET_HAS_MOCA_LINK_DET) 1751 - int0_enable |= UMAC_IRQ_LINK_EVENT; 1752 - 1726 + /* Configure backpressure vectors for MoCA */ 1727 + if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { 1753 1728 reg = bcmgenet_bp_mc_get(priv); 1754 1729 reg |= BIT(priv->hw_params->bp_in_en_shift); 1755 1730 ··· 2655 2644 umac_enable_set(priv, CMD_TX_EN | CMD_RX_EN, true); 2656 2645 2657 2646 netif_tx_start_all_queues(dev); 2647 + 2648 + /* Monitor link interrupts now */ 2649 + bcmgenet_link_intr_enable(priv); 2658 2650 2659 2651 phy_start(priv->phydev); 2660 2652 }
+1
drivers/net/ethernet/emulex/benet/be.h
··· 592 592 int be_get_temp_freq; 593 593 struct be_hwmon hwmon_info; 594 594 u8 pf_number; 595 + u8 pci_func_num; 595 596 struct rss_info rss_info; 596 597 /* Filters for packets that need to be sent to BMC */ 597 598 u32 bmc_filt_mask;
+24 -7
drivers/net/ethernet/emulex/benet/be_cmds.c
··· 851 851 return status; 852 852 853 853 dest_wrb = be_cmd_copy(adapter, wrb); 854 - if (!dest_wrb) 855 - return -EBUSY; 854 + if (!dest_wrb) { 855 + status = -EBUSY; 856 + goto unlock; 857 + } 856 858 857 859 if (use_mcc(adapter)) 858 860 status = be_mcc_notify_wait(adapter); ··· 864 862 if (!status) 865 863 memcpy(wrb, dest_wrb, sizeof(*wrb)); 866 864 865 + unlock: 867 866 be_cmd_unlock(adapter); 868 867 return status; 869 868 } ··· 1987 1984 be_if_cap_flags(adapter)); 1988 1985 } 1989 1986 flags &= be_if_cap_flags(adapter); 1987 + if (!flags) 1988 + return -ENOTSUPP; 1990 1989 1991 1990 return __be_cmd_rx_filter(adapter, flags, value); 1992 1991 } ··· 2892 2887 if (!status) { 2893 2888 attribs = attribs_cmd.va + sizeof(struct be_cmd_resp_hdr); 2894 2889 adapter->hba_port_num = attribs->hba_attribs.phy_port; 2890 + adapter->pci_func_num = attribs->pci_func_num; 2895 2891 serial_num = attribs->hba_attribs.controller_serial_number; 2896 2892 for (i = 0; i < CNTL_SERIAL_NUM_WORDS; i++) 2897 2893 adapter->serial_num[i] = le32_to_cpu(serial_num[i]) & ··· 3715 3709 status = -EINVAL; 3716 3710 goto err; 3717 3711 } 3718 - 3719 3712 adapter->pf_number = desc->pf_num; 3720 3713 be_copy_nic_desc(res, desc); 3721 3714 } ··· 3726 3721 return status; 3727 3722 } 3728 3723 3729 - /* Will use MBOX only if MCCQ has not been created */ 3724 + /* Will use MBOX only if MCCQ has not been created 3725 + * non-zero domain => a PF is querying this on behalf of a VF 3726 + * zero domain => a PF or a VF is querying this for itself 3727 + */ 3730 3728 int be_cmd_get_profile_config(struct be_adapter *adapter, 3731 3729 struct be_resources *res, u8 query, u8 domain) 3732 3730 { ··· 3756 3748 OPCODE_COMMON_GET_PROFILE_CONFIG, 3757 3749 cmd.size, &wrb, &cmd); 3758 3750 3759 - req->hdr.domain = domain; 3760 3751 if (!lancer_chip(adapter)) 3761 3752 req->hdr.version = 1; 3762 3753 req->type = ACTIVE_PROFILE_TYPE; 3754 + /* When a function is querying profile information relating to 3755 + * itself hdr.pf_number must be set to it's pci_func_num + 1 3756 + */ 3757 + req->hdr.domain = domain; 3758 + if (domain == 0) 3759 + req->hdr.pf_num = adapter->pci_func_num + 1; 3763 3760 3764 3761 /* When QUERY_MODIFIABLE_FIELDS_TYPE bit is set, cmd returns the 3765 3762 * descriptors with all bits set to "1" for the fields which can be ··· 3934 3921 vf_if_cap_flags &= ~(BE_IF_FLAGS_RSS | 3935 3922 BE_IF_FLAGS_DEFQ_RSS); 3936 3923 } 3937 - 3938 - nic_vft->cap_flags = cpu_to_le32(vf_if_cap_flags); 3939 3924 } else { 3940 3925 num_vf_qs = 1; 3941 3926 } 3942 3927 3928 + if (res_mod.vf_if_cap_flags & BE_IF_FLAGS_VLAN_PROMISCUOUS) { 3929 + nic_vft->flags |= BIT(IF_CAPS_FLAGS_VALID_SHIFT); 3930 + vf_if_cap_flags &= ~BE_IF_FLAGS_VLAN_PROMISCUOUS; 3931 + } 3932 + 3933 + nic_vft->cap_flags = cpu_to_le32(vf_if_cap_flags); 3943 3934 nic_vft->rq_count = cpu_to_le16(num_vf_qs); 3944 3935 nic_vft->txq_count = cpu_to_le16(num_vf_qs); 3945 3936 nic_vft->rssq_count = cpu_to_le16(num_vf_qs);
+8 -2
drivers/net/ethernet/emulex/benet/be_cmds.h
··· 289 289 u32 timeout; /* dword 1 */ 290 290 u32 request_length; /* dword 2 */ 291 291 u8 version; /* dword 3 */ 292 - u8 rsvd[3]; /* dword 3 */ 292 + u8 rsvd1; /* dword 3 */ 293 + u8 pf_num; /* dword 3 */ 294 + u8 rsvd2; /* dword 3 */ 293 295 }; 294 296 295 297 #define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */ ··· 1654 1652 1655 1653 struct mgmt_controller_attrib { 1656 1654 struct mgmt_hba_attribs hba_attribs; 1657 - u32 rsvd0[10]; 1655 + u32 rsvd0[2]; 1656 + u16 rsvd1; 1657 + u8 pci_func_num; 1658 + u8 rsvd2; 1659 + u32 rsvd3[7]; 1658 1660 } __packed; 1659 1661 1660 1662 struct be_cmd_req_cntl_attribs {
+19 -9
drivers/net/ethernet/emulex/benet/be_main.c
··· 1123 1123 struct sk_buff *skb, 1124 1124 struct be_wrb_params *wrb_params) 1125 1125 { 1126 - /* Lancer, SH-R ASICs have a bug wherein Packets that are 32 bytes or 1127 - * less may cause a transmit stall on that port. So the work-around is 1128 - * to pad short packets (<= 32 bytes) to a 36-byte length. 1126 + /* Lancer, SH and BE3 in SRIOV mode have a bug wherein 1127 + * packets that are 32b or less may cause a transmit stall 1128 + * on that port. The workaround is to pad such packets 1129 + * (len <= 32 bytes) to a minimum length of 36b. 1129 1130 */ 1130 - if (unlikely(!BEx_chip(adapter) && skb->len <= 32)) { 1131 + if (skb->len <= 32) { 1131 1132 if (skb_put_padto(skb, 36)) 1132 1133 return NULL; 1133 1134 } ··· 4206 4205 int status, level; 4207 4206 u16 profile_id; 4208 4207 4209 - status = be_cmd_get_cntl_attributes(adapter); 4210 - if (status) 4211 - return status; 4212 - 4213 4208 status = be_cmd_query_fw_cfg(adapter); 4214 4209 if (status) 4215 4210 return status; ··· 4403 4406 4404 4407 if (!lancer_chip(adapter)) 4405 4408 be_cmd_req_native_mode(adapter); 4409 + 4410 + /* Need to invoke this cmd first to get the PCI Function Number */ 4411 + status = be_cmd_get_cntl_attributes(adapter); 4412 + if (status) 4413 + return status; 4406 4414 4407 4415 if (!BE2_chip(adapter) && be_physfn(adapter)) 4408 4416 be_alloc_sriov_res(adapter); ··· 5001 4999 return false; 5002 5000 } 5003 5001 5004 - return (fhdr->asic_type_rev >= adapter->asic_rev); 5002 + /* In BE3 FW images the "asic_type_rev" field doesn't track the 5003 + * asic_rev of the chips it is compatible with. 5004 + * When asic_type_rev is 0 the image is compatible only with 5005 + * pre-BE3-R chips (asic_rev < 0x10) 5006 + */ 5007 + if (BEx_chip(adapter) && fhdr->asic_type_rev == 0) 5008 + return adapter->asic_rev < 0x10; 5009 + else 5010 + return (fhdr->asic_type_rev >= adapter->asic_rev); 5005 5011 } 5006 5012 5007 5013 static int be_fw_download(struct be_adapter *adapter, const struct firmware* fw)
+28 -6
drivers/net/ethernet/freescale/fsl_pq_mdio.c
··· 198 198 199 199 #if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE) 200 200 /* 201 + * Return the TBIPA address, starting from the address 202 + * of the mapped GFAR MDIO registers (struct gfar) 201 203 * This is mildly evil, but so is our hardware for doing this. 202 204 * Also, we have to cast back to struct gfar because of 203 205 * definition weirdness done in gianfar.h. 204 206 */ 205 - static uint32_t __iomem *get_gfar_tbipa(void __iomem *p) 207 + static uint32_t __iomem *get_gfar_tbipa_from_mdio(void __iomem *p) 206 208 { 207 209 struct gfar __iomem *enet_regs = p; 208 210 209 211 return &enet_regs->tbipa; 212 + } 213 + 214 + /* 215 + * Return the TBIPA address, starting from the address 216 + * of the mapped GFAR MII registers (gfar_mii_regs[] within struct gfar) 217 + */ 218 + static uint32_t __iomem *get_gfar_tbipa_from_mii(void __iomem *p) 219 + { 220 + return get_gfar_tbipa_from_mdio(container_of(p, struct gfar, gfar_mii_regs)); 210 221 } 211 222 212 223 /* ··· 231 220 232 221 #if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE) 233 222 /* 234 - * Return the TBIPAR address for a QE MDIO node 223 + * Return the TBIPAR address for a QE MDIO node, starting from the address 224 + * of the mapped MII registers (struct fsl_pq_mii) 235 225 */ 236 226 static uint32_t __iomem *get_ucc_tbipa(void __iomem *p) 237 227 { 238 - struct fsl_pq_mdio __iomem *mdio = p; 228 + struct fsl_pq_mdio __iomem *mdio = container_of(p, struct fsl_pq_mdio, mii); 239 229 240 230 return &mdio->utbipar; 241 231 } ··· 312 300 .compatible = "fsl,gianfar-tbi", 313 301 .data = &(struct fsl_pq_mdio_data) { 314 302 .mii_offset = 0, 315 - .get_tbipa = get_gfar_tbipa, 303 + .get_tbipa = get_gfar_tbipa_from_mii, 316 304 }, 317 305 }, 318 306 { 319 307 .compatible = "fsl,gianfar-mdio", 320 308 .data = &(struct fsl_pq_mdio_data) { 321 309 .mii_offset = 0, 322 - .get_tbipa = get_gfar_tbipa, 310 + .get_tbipa = get_gfar_tbipa_from_mii, 323 311 }, 324 312 }, 325 313 { ··· 327 315 .compatible = "gianfar", 328 316 .data = &(struct fsl_pq_mdio_data) { 329 317 .mii_offset = offsetof(struct fsl_pq_mdio, mii), 330 - .get_tbipa = get_gfar_tbipa, 318 + .get_tbipa = get_gfar_tbipa_from_mdio, 331 319 }, 332 320 }, 333 321 { ··· 456 444 } 457 445 458 446 tbipa = data->get_tbipa(priv->map); 447 + 448 + /* 449 + * Add consistency check to make sure TBI is contained 450 + * within the mapped range (not because we would get a 451 + * segfault, rather to catch bugs in computing TBI 452 + * address). Print error message but continue anyway. 453 + */ 454 + if ((void *)tbipa > priv->map + resource_size(&res) - 4) 455 + dev_err(&pdev->dev, "invalid register map (should be at least 0x%04x to contain TBI address)\n", 456 + ((void *)tbipa - priv->map) + 4); 459 457 460 458 iowrite32be(be32_to_cpup(prop), tbipa); 461 459 }
+2 -2
drivers/net/ethernet/intel/i40e/i40e_adminq.c
··· 386 386 387 387 hw->aq.asq.next_to_use = 0; 388 388 hw->aq.asq.next_to_clean = 0; 389 - hw->aq.asq.count = hw->aq.num_asq_entries; 390 389 391 390 /* allocate the ring memory */ 392 391 ret_code = i40e_alloc_adminq_asq_ring(hw); ··· 403 404 goto init_adminq_free_rings; 404 405 405 406 /* success! */ 407 + hw->aq.asq.count = hw->aq.num_asq_entries; 406 408 goto init_adminq_exit; 407 409 408 410 init_adminq_free_rings: ··· 445 445 446 446 hw->aq.arq.next_to_use = 0; 447 447 hw->aq.arq.next_to_clean = 0; 448 - hw->aq.arq.count = hw->aq.num_arq_entries; 449 448 450 449 /* allocate the ring memory */ 451 450 ret_code = i40e_alloc_adminq_arq_ring(hw); ··· 462 463 goto init_adminq_free_rings; 463 464 464 465 /* success! */ 466 + hw->aq.arq.count = hw->aq.num_arq_entries; 465 467 goto init_adminq_exit; 466 468 467 469 init_adminq_free_rings:
+2
drivers/net/ethernet/intel/i40e/i40e_main.c
··· 8389 8389 8390 8390 netdev->hw_enc_features |= NETIF_F_IP_CSUM | 8391 8391 NETIF_F_GSO_UDP_TUNNEL | 8392 + NETIF_F_GSO_GRE | 8392 8393 NETIF_F_TSO; 8393 8394 8394 8395 netdev->features = NETIF_F_SG | ··· 8397 8396 NETIF_F_SCTP_CSUM | 8398 8397 NETIF_F_HIGHDMA | 8399 8398 NETIF_F_GSO_UDP_TUNNEL | 8399 + NETIF_F_GSO_GRE | 8400 8400 NETIF_F_HW_VLAN_CTAG_TX | 8401 8401 NETIF_F_HW_VLAN_CTAG_RX | 8402 8402 NETIF_F_HW_VLAN_CTAG_FILTER |
+2 -2
drivers/net/ethernet/intel/i40evf/i40e_adminq.c
··· 373 373 374 374 hw->aq.asq.next_to_use = 0; 375 375 hw->aq.asq.next_to_clean = 0; 376 - hw->aq.asq.count = hw->aq.num_asq_entries; 377 376 378 377 /* allocate the ring memory */ 379 378 ret_code = i40e_alloc_adminq_asq_ring(hw); ··· 390 391 goto init_adminq_free_rings; 391 392 392 393 /* success! */ 394 + hw->aq.asq.count = hw->aq.num_asq_entries; 393 395 goto init_adminq_exit; 394 396 395 397 init_adminq_free_rings: ··· 432 432 433 433 hw->aq.arq.next_to_use = 0; 434 434 hw->aq.arq.next_to_clean = 0; 435 - hw->aq.arq.count = hw->aq.num_arq_entries; 436 435 437 436 /* allocate the ring memory */ 438 437 ret_code = i40e_alloc_adminq_arq_ring(hw); ··· 449 450 goto init_adminq_free_rings; 450 451 451 452 /* success! */ 453 + hw->aq.arq.count = hw->aq.num_arq_entries; 452 454 goto init_adminq_exit; 453 455 454 456 init_adminq_free_rings:
+4
drivers/net/ethernet/mellanox/mlx4/eq.c
··· 1364 1364 * and performing a NOP command 1365 1365 */ 1366 1366 for(i = 0; !err && (i < dev->caps.num_comp_vectors); ++i) { 1367 + /* Make sure request_irq was called */ 1368 + if (!priv->eq_table.eq[i].have_irq) 1369 + continue; 1370 + 1367 1371 /* Temporary use polling for command completions */ 1368 1372 mlx4_cmd_use_polling(dev); 1369 1373
+2 -8
drivers/net/ethernet/mellanox/mlx4/main.c
··· 2669 2669 2670 2670 if (msi_x) { 2671 2671 int nreq = dev->caps.num_ports * num_online_cpus() + 1; 2672 - bool shared_ports = false; 2673 2672 2674 2673 nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs, 2675 2674 nreq); 2676 - if (nreq > MAX_MSIX) { 2675 + if (nreq > MAX_MSIX) 2677 2676 nreq = MAX_MSIX; 2678 - shared_ports = true; 2679 - } 2680 2677 2681 2678 entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); 2682 2679 if (!entries) ··· 2696 2699 bitmap_zero(priv->eq_table.eq[MLX4_EQ_ASYNC].actv_ports.ports, 2697 2700 dev->caps.num_ports); 2698 2701 2699 - if (MLX4_IS_LEGACY_EQ_MODE(dev->caps)) 2700 - shared_ports = true; 2701 - 2702 2702 for (i = 0; i < dev->caps.num_comp_vectors + 1; i++) { 2703 2703 if (i == MLX4_EQ_ASYNC) 2704 2704 continue; ··· 2703 2709 priv->eq_table.eq[i].irq = 2704 2710 entries[i + 1 - !!(i > MLX4_EQ_ASYNC)].vector; 2705 2711 2706 - if (shared_ports) { 2712 + if (MLX4_IS_LEGACY_EQ_MODE(dev->caps)) { 2707 2713 bitmap_fill(priv->eq_table.eq[i].actv_ports.ports, 2708 2714 dev->caps.num_ports); 2709 2715 /* We don't set affinity hint when there
+14 -2
drivers/net/ethernet/mellanox/mlx5/core/en_flow_table.c
··· 598 598 return; 599 599 600 600 priv->vlan.filter_disabled = false; 601 + if (priv->netdev->flags & IFF_PROMISC) 602 + return; 601 603 mlx5e_del_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_VID, 0); 602 604 } 603 605 ··· 609 607 return; 610 608 611 609 priv->vlan.filter_disabled = true; 610 + if (priv->netdev->flags & IFF_PROMISC) 611 + return; 612 612 mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_VID, 0); 613 613 } 614 614 ··· 721 717 bool enable_broadcast = !ea->broadcast_enabled && broadcast_enabled; 722 718 bool disable_broadcast = ea->broadcast_enabled && !broadcast_enabled; 723 719 724 - if (enable_promisc) 720 + if (enable_promisc) { 725 721 mlx5e_add_eth_addr_rule(priv, &ea->promisc, MLX5E_PROMISC); 722 + if (!priv->vlan.filter_disabled) 723 + mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_VID, 724 + 0); 725 + } 726 726 if (enable_allmulti) 727 727 mlx5e_add_eth_addr_rule(priv, &ea->allmulti, MLX5E_ALLMULTI); 728 728 if (enable_broadcast) ··· 738 730 mlx5e_del_eth_addr_from_flow_table(priv, &ea->broadcast); 739 731 if (disable_allmulti) 740 732 mlx5e_del_eth_addr_from_flow_table(priv, &ea->allmulti); 741 - if (disable_promisc) 733 + if (disable_promisc) { 734 + if (!priv->vlan.filter_disabled) 735 + mlx5e_del_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_VID, 736 + 0); 742 737 mlx5e_del_eth_addr_from_flow_table(priv, &ea->promisc); 738 + } 743 739 744 740 ea->promisc_enabled = promisc_enabled; 745 741 ea->allmulti_enabled = allmulti_enabled;
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/port.c
··· 311 311 int err; 312 312 313 313 memset(in, 0, sizeof(in)); 314 - MLX5_SET(ptys_reg, in, local_port, local_port); 314 + MLX5_SET(pvlc_reg, in, local_port, local_port); 315 315 316 316 err = mlx5_core_access_reg(dev, in, sizeof(in), pvlc, 317 317 pvlc_size, MLX5_REG_PVLC, 0, 0);
+9 -4
drivers/net/ethernet/mellanox/mlxsw/core.c
··· 374 374 int err; 375 375 int ret; 376 376 377 + mlxsw_core->emad.trans_active = true; 378 + 377 379 err = mlxsw_core_skb_transmit(mlxsw_core->driver_priv, skb, tx_info); 378 380 if (err) { 379 381 dev_err(mlxsw_core->bus_info->dev, "Failed to transmit EMAD (tid=%llx)\n", 380 382 mlxsw_core->emad.tid); 381 383 dev_kfree_skb(skb); 382 - return err; 384 + goto trans_inactive_out; 383 385 } 384 386 385 - mlxsw_core->emad.trans_active = true; 386 387 ret = wait_event_timeout(mlxsw_core->emad.wait, 387 388 !(mlxsw_core->emad.trans_active), 388 389 msecs_to_jiffies(MLXSW_EMAD_TIMEOUT_MS)); 389 390 if (!ret) { 390 391 dev_warn(mlxsw_core->bus_info->dev, "EMAD timed-out (tid=%llx)\n", 391 392 mlxsw_core->emad.tid); 392 - mlxsw_core->emad.trans_active = false; 393 - return -EIO; 393 + err = -EIO; 394 + goto trans_inactive_out; 394 395 } 395 396 396 397 return 0; 398 + 399 + trans_inactive_out: 400 + mlxsw_core->emad.trans_active = false; 401 + return err; 397 402 } 398 403 399 404 static int mlxsw_emad_process_status(struct mlxsw_core *mlxsw_core,
+3 -1
drivers/net/ethernet/mellanox/mlxsw/item.h
··· 187 187 { 188 188 u16 max_index, be_index; 189 189 u16 offset; /* byte offset inside the array */ 190 + u8 in_byte_index; 190 191 191 192 BUG_ON(index && !item->element_size); 192 193 if (item->offset % sizeof(u32) != 0 || ··· 200 199 max_index = (item->size.bytes << 3) / item->element_size - 1; 201 200 be_index = max_index - index; 202 201 offset = be_index * item->element_size >> 3; 203 - *shift = index % (BITS_PER_BYTE / item->element_size) << 1; 202 + in_byte_index = index % (BITS_PER_BYTE / item->element_size); 203 + *shift = in_byte_index * item->element_size; 204 204 205 205 return item->offset + offset; 206 206 }
+4 -4
drivers/net/ethernet/mellanox/mlxsw/pci.c
··· 1582 1582 1583 1583 if (in_mbox) 1584 1584 memcpy(mlxsw_pci->cmd.in_mbox.buf, in_mbox, in_mbox_size); 1585 - mlxsw_pci_write32(mlxsw_pci, CIR_IN_PARAM_HI, in_mapaddr >> 32); 1586 - mlxsw_pci_write32(mlxsw_pci, CIR_IN_PARAM_LO, in_mapaddr); 1585 + mlxsw_pci_write32(mlxsw_pci, CIR_IN_PARAM_HI, upper_32_bits(in_mapaddr)); 1586 + mlxsw_pci_write32(mlxsw_pci, CIR_IN_PARAM_LO, lower_32_bits(in_mapaddr)); 1587 1587 1588 - mlxsw_pci_write32(mlxsw_pci, CIR_OUT_PARAM_HI, out_mapaddr >> 32); 1589 - mlxsw_pci_write32(mlxsw_pci, CIR_OUT_PARAM_LO, out_mapaddr); 1588 + mlxsw_pci_write32(mlxsw_pci, CIR_OUT_PARAM_HI, upper_32_bits(out_mapaddr)); 1589 + mlxsw_pci_write32(mlxsw_pci, CIR_OUT_PARAM_LO, lower_32_bits(out_mapaddr)); 1590 1590 1591 1591 mlxsw_pci_write32(mlxsw_pci, CIR_IN_MODIFIER, in_mod); 1592 1592 mlxsw_pci_write32(mlxsw_pci, CIR_TOKEN, 0);
+1 -1
drivers/net/ethernet/mellanox/mlxsw/switchx2.c
··· 1069 1069 return 0; 1070 1070 1071 1071 err_register_netdev: 1072 - err_port_admin_status_set: 1073 1072 err_port_mac_learning_mode_set: 1074 1073 err_port_stp_state_set: 1074 + err_port_admin_status_set: 1075 1075 err_port_mtu_set: 1076 1076 err_port_speed_set: 1077 1077 err_port_swid_set:
+6 -7
drivers/net/ethernet/nxp/lpc_eth.c
··· 476 476 mac[5] = tmp >> 8; 477 477 } 478 478 479 - static void __lpc_eth_clock_enable(struct netdata_local *pldat, 480 - bool enable) 479 + static void __lpc_eth_clock_enable(struct netdata_local *pldat, bool enable) 481 480 { 482 481 if (enable) 483 - clk_enable(pldat->clk); 482 + clk_prepare_enable(pldat->clk); 484 483 else 485 - clk_disable(pldat->clk); 484 + clk_disable_unprepare(pldat->clk); 486 485 } 487 486 488 487 static void __lpc_params_setup(struct netdata_local *pldat) ··· 1493 1494 err_out_iounmap: 1494 1495 iounmap(pldat->net_base); 1495 1496 err_out_disable_clocks: 1496 - clk_disable(pldat->clk); 1497 + clk_disable_unprepare(pldat->clk); 1497 1498 clk_put(pldat->clk); 1498 1499 err_out_free_dev: 1499 1500 free_netdev(ndev); ··· 1518 1519 iounmap(pldat->net_base); 1519 1520 mdiobus_unregister(pldat->mii_bus); 1520 1521 mdiobus_free(pldat->mii_bus); 1521 - clk_disable(pldat->clk); 1522 + clk_disable_unprepare(pldat->clk); 1522 1523 clk_put(pldat->clk); 1523 1524 free_netdev(ndev); 1524 1525 ··· 1539 1540 if (netif_running(ndev)) { 1540 1541 netif_device_detach(ndev); 1541 1542 __lpc_eth_shutdown(pldat); 1542 - clk_disable(pldat->clk); 1543 + clk_disable_unprepare(pldat->clk); 1543 1544 1544 1545 /* 1545 1546 * Reset again now clock is disable to be sure
+2 -1
drivers/net/ethernet/via/via-rhine.c
··· 2134 2134 } 2135 2135 2136 2136 skb_put(skb, pkt_len); 2137 - skb->protocol = eth_type_trans(skb, dev); 2138 2137 2139 2138 rhine_rx_vlan_tag(skb, desc, data_size); 2139 + 2140 + skb->protocol = eth_type_trans(skb, dev); 2140 2141 2141 2142 netif_receive_skb(skb); 2142 2143
+6 -6
drivers/net/geneve.c
··· 870 870 __be16 dst_port = htons(GENEVE_UDP_PORT); 871 871 __u8 ttl = 0, tos = 0; 872 872 bool metadata = false; 873 - __be32 rem_addr; 874 - __u32 vni; 873 + __be32 rem_addr = 0; 874 + __u32 vni = 0; 875 875 876 - if (!data[IFLA_GENEVE_ID] || !data[IFLA_GENEVE_REMOTE]) 877 - return -EINVAL; 876 + if (data[IFLA_GENEVE_ID]) 877 + vni = nla_get_u32(data[IFLA_GENEVE_ID]); 878 878 879 - vni = nla_get_u32(data[IFLA_GENEVE_ID]); 880 - rem_addr = nla_get_in_addr(data[IFLA_GENEVE_REMOTE]); 879 + if (data[IFLA_GENEVE_REMOTE]) 880 + rem_addr = nla_get_in_addr(data[IFLA_GENEVE_REMOTE]); 881 881 882 882 if (data[IFLA_GENEVE_TTL]) 883 883 ttl = nla_get_u8(data[IFLA_GENEVE_TTL]);
-2
drivers/net/phy/Kconfig
··· 168 168 busses. It is required by the Octeon and ThunderX ethernet device 169 169 drivers. 170 170 171 - If in doubt, say Y. 172 - 173 171 config MDIO_SUN4I 174 172 tristate "Allwinner sun4i MDIO interface support" 175 173 depends on ARCH_SUNXI
-1
drivers/net/ppp/pppoe.c
··· 313 313 if (po->pppoe_dev == dev && 314 314 sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND | PPPOX_ZOMBIE)) { 315 315 pppox_unbind_sock(sk); 316 - sk->sk_state = PPPOX_ZOMBIE; 317 316 sk->sk_state_change(sk); 318 317 po->pppoe_dev = NULL; 319 318 dev_put(dev);
+1
drivers/net/usb/Kconfig
··· 164 164 * Aten UC210T 165 165 * ASIX AX88172 166 166 * Billionton Systems, USB2AR 167 + * Billionton Systems, GUSB2AM-1G-B 167 168 * Buffalo LUA-U2-KTX 168 169 * Corega FEther USB2-TX 169 170 * D-Link DUB-E100
+3 -1
drivers/net/usb/asix_common.c
··· 91 91 } 92 92 rx->ax_skb = netdev_alloc_skb_ip_align(dev->net, 93 93 rx->size); 94 - if (!rx->ax_skb) 94 + if (!rx->ax_skb) { 95 + rx->size = 0; 95 96 return 0; 97 + } 96 98 } 97 99 98 100 if (rx->size > dev->net->mtu + ETH_HLEN + VLAN_HLEN) {
+4
drivers/net/usb/asix_devices.c
··· 959 959 USB_DEVICE (0x08dd, 0x90ff), 960 960 .driver_info = (unsigned long) &ax8817x_info, 961 961 }, { 962 + // Billionton Systems, GUSB2AM-1G-B 963 + USB_DEVICE(0x08dd, 0x0114), 964 + .driver_info = (unsigned long) &ax88178_info, 965 + }, { 962 966 // ATEN UC210T 963 967 USB_DEVICE (0x0557, 0x2009), 964 968 .driver_info = (unsigned long) &ax8817x_info,
+3 -4
drivers/net/vxlan.c
··· 2745 2745 struct vxlan_config conf; 2746 2746 int err; 2747 2747 2748 - if (!data[IFLA_VXLAN_ID]) 2749 - return -EINVAL; 2750 - 2751 2748 memset(&conf, 0, sizeof(conf)); 2752 - conf.vni = nla_get_u32(data[IFLA_VXLAN_ID]); 2749 + 2750 + if (data[IFLA_VXLAN_ID]) 2751 + conf.vni = nla_get_u32(data[IFLA_VXLAN_ID]); 2753 2752 2754 2753 if (data[IFLA_VXLAN_GROUP]) { 2755 2754 conf.remote_ip.sin.sin_addr.s_addr = nla_get_in_addr(data[IFLA_VXLAN_GROUP]);
+2 -2
drivers/net/wireless/ath/ath10k/hw.h
··· 337 337 #define TARGET_10X_MAX_FRAG_ENTRIES 0 338 338 339 339 /* 10.2 parameters */ 340 - #define TARGET_10_2_DMA_BURST_SIZE 1 340 + #define TARGET_10_2_DMA_BURST_SIZE 0 341 341 342 342 /* Target specific defines for WMI-TLV firmware */ 343 343 #define TARGET_TLV_NUM_VDEVS 4 ··· 391 391 392 392 #define TARGET_10_4_TX_DBG_LOG_SIZE 1024 393 393 #define TARGET_10_4_NUM_WDS_ENTRIES 32 394 - #define TARGET_10_4_DMA_BURST_SIZE 1 394 + #define TARGET_10_4_DMA_BURST_SIZE 0 395 395 #define TARGET_10_4_MAC_AGGR_DELIM 0 396 396 #define TARGET_10_4_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1 397 397 #define TARGET_10_4_VOW_CONFIG 0
+1
drivers/net/wireless/ath/ath9k/init.c
··· 880 880 hw->max_rate_tries = 10; 881 881 hw->sta_data_size = sizeof(struct ath_node); 882 882 hw->vif_data_size = sizeof(struct ath_vif); 883 + hw->extra_tx_headroom = 4; 883 884 884 885 hw->wiphy->available_antennas_rx = BIT(ah->caps.max_rxchains) - 1; 885 886 hw->wiphy->available_antennas_tx = BIT(ah->caps.max_txchains) - 1;
+1
drivers/net/wireless/b43/main.c
··· 120 120 #ifdef CONFIG_B43_BCMA 121 121 static const struct bcma_device_id b43_bcma_tbl[] = { 122 122 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x11, BCMA_ANY_CLASS), 123 + BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x15, BCMA_ANY_CLASS), 123 124 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x17, BCMA_ANY_CLASS), 124 125 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x18, BCMA_ANY_CLASS), 125 126 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x1C, BCMA_ANY_CLASS),
+1 -1
drivers/net/wireless/iwlwifi/dvm/lib.c
··· 1020 1020 u8 *pn = seq.ccmp.pn; 1021 1021 1022 1022 ieee80211_get_key_rx_seq(key, i, &seq); 1023 - aes_sc->pn = cpu_to_le64( 1023 + aes_sc[i].pn = cpu_to_le64( 1024 1024 (u64)pn[5] | 1025 1025 ((u64)pn[4] << 8) | 1026 1026 ((u64)pn[3] << 16) |
+1 -1
drivers/net/wireless/iwlwifi/iwl-7000.c
··· 348 348 }; 349 349 350 350 MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 351 - MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL3160_UCODE_API_OK)); 351 + MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 352 352 MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 353 353 MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
+11 -16
drivers/net/wireless/iwlwifi/mvm/d3.c
··· 274 274 break; 275 275 case WLAN_CIPHER_SUITE_CCMP: 276 276 if (sta) { 277 - u8 *pn = seq.ccmp.pn; 277 + u64 pn64; 278 278 279 279 aes_sc = data->rsc_tsc->all_tsc_rsc.aes.unicast_rsc; 280 280 aes_tx_sc = &data->rsc_tsc->all_tsc_rsc.aes.tsc; 281 281 282 - ieee80211_get_key_tx_seq(key, &seq); 283 - aes_tx_sc->pn = cpu_to_le64((u64)pn[5] | 284 - ((u64)pn[4] << 8) | 285 - ((u64)pn[3] << 16) | 286 - ((u64)pn[2] << 24) | 287 - ((u64)pn[1] << 32) | 288 - ((u64)pn[0] << 40)); 282 + pn64 = atomic64_read(&key->tx_pn); 283 + aes_tx_sc->pn = cpu_to_le64(pn64); 289 284 } else { 290 285 aes_sc = data->rsc_tsc->all_tsc_rsc.aes.multicast_rsc; 291 286 } ··· 293 298 u8 *pn = seq.ccmp.pn; 294 299 295 300 ieee80211_get_key_rx_seq(key, i, &seq); 296 - aes_sc->pn = cpu_to_le64((u64)pn[5] | 297 - ((u64)pn[4] << 8) | 298 - ((u64)pn[3] << 16) | 299 - ((u64)pn[2] << 24) | 300 - ((u64)pn[1] << 32) | 301 - ((u64)pn[0] << 40)); 301 + aes_sc[i].pn = cpu_to_le64((u64)pn[5] | 302 + ((u64)pn[4] << 8) | 303 + ((u64)pn[3] << 16) | 304 + ((u64)pn[2] << 24) | 305 + ((u64)pn[1] << 32) | 306 + ((u64)pn[0] << 40)); 302 307 } 303 308 data->use_rsc_tsc = true; 304 309 break; ··· 1448 1453 1449 1454 switch (key->cipher) { 1450 1455 case WLAN_CIPHER_SUITE_CCMP: 1451 - iwl_mvm_aes_sc_to_seq(&sc->aes.tsc, &seq); 1452 1456 iwl_mvm_set_aes_rx_seq(sc->aes.unicast_rsc, key); 1457 + atomic64_set(&key->tx_pn, le64_to_cpu(sc->aes.tsc.pn)); 1453 1458 break; 1454 1459 case WLAN_CIPHER_SUITE_TKIP: 1455 1460 iwl_mvm_tkip_sc_to_seq(&sc->tkip.tsc, &seq); 1456 1461 iwl_mvm_set_tkip_rx_seq(sc->tkip.unicast_rsc, key); 1462 + ieee80211_set_key_tx_seq(key, &seq); 1457 1463 break; 1458 1464 } 1459 - ieee80211_set_key_tx_seq(key, &seq); 1460 1465 1461 1466 /* that's it for this key */ 1462 1467 return;
+2 -2
drivers/net/wireless/iwlwifi/mvm/fw.c
··· 703 703 * abort after reading the nvm in case RF Kill is on, we will complete 704 704 * the init seq later when RF kill will switch to off 705 705 */ 706 - if (iwl_mvm_is_radio_killed(mvm)) { 706 + if (iwl_mvm_is_radio_hw_killed(mvm)) { 707 707 IWL_DEBUG_RF_KILL(mvm, 708 708 "jump over all phy activities due to RF kill\n"); 709 709 iwl_remove_notification(&mvm->notif_wait, &calib_wait); ··· 736 736 ret = iwl_wait_notification(&mvm->notif_wait, &calib_wait, 737 737 MVM_UCODE_CALIB_TIMEOUT); 738 738 739 - if (ret && iwl_mvm_is_radio_killed(mvm)) { 739 + if (ret && iwl_mvm_is_radio_hw_killed(mvm)) { 740 740 IWL_DEBUG_RF_KILL(mvm, "RFKILL while calibrating.\n"); 741 741 ret = 1; 742 742 }
+1
drivers/net/wireless/iwlwifi/mvm/mac80211.c
··· 2388 2388 iwl_mvm_remove_time_event(mvm, mvmvif, 2389 2389 &mvmvif->time_event_data); 2390 2390 RCU_INIT_POINTER(mvm->csa_vif, NULL); 2391 + mvmvif->csa_countdown = false; 2391 2392 } 2392 2393 2393 2394 if (rcu_access_pointer(mvm->csa_tx_blocked_vif) == vif) {
+5
drivers/net/wireless/iwlwifi/mvm/mvm.h
··· 860 860 test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status); 861 861 } 862 862 863 + static inline bool iwl_mvm_is_radio_hw_killed(struct iwl_mvm *mvm) 864 + { 865 + return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status); 866 + } 867 + 863 868 /* Must be called with rcu_read_lock() held and it can only be 864 869 * released when mvmsta is not needed anymore. 865 870 */
+1
drivers/net/wireless/iwlwifi/mvm/ops.c
··· 590 590 ieee80211_unregister_hw(mvm->hw); 591 591 iwl_mvm_leds_exit(mvm); 592 592 out_free: 593 + flush_delayed_work(&mvm->fw_dump_wk); 593 594 iwl_phy_db_free(mvm->phy_db); 594 595 kfree(mvm->scan_cmd); 595 596 if (!cfg->no_power_up_nic_in_init || !mvm->nvm_file_name)
+5
drivers/net/wireless/iwlwifi/pcie/drv.c
··· 414 414 {IWL_PCI_DEVICE(0x095A, 0x5590, iwl7265_2ac_cfg)}, 415 415 {IWL_PCI_DEVICE(0x095B, 0x5290, iwl7265_2ac_cfg)}, 416 416 {IWL_PCI_DEVICE(0x095A, 0x5490, iwl7265_2ac_cfg)}, 417 + {IWL_PCI_DEVICE(0x095A, 0x5F10, iwl7265_2ac_cfg)}, 418 + {IWL_PCI_DEVICE(0x095B, 0x5212, iwl7265_2ac_cfg)}, 419 + {IWL_PCI_DEVICE(0x095B, 0x520A, iwl7265_2ac_cfg)}, 420 + {IWL_PCI_DEVICE(0x095A, 0x9000, iwl7265_2ac_cfg)}, 421 + {IWL_PCI_DEVICE(0x095A, 0x9400, iwl7265_2ac_cfg)}, 417 422 418 423 /* 8000 Series */ 419 424 {IWL_PCI_DEVICE(0x24F3, 0x0010, iwl8260_2ac_cfg)},
+1
drivers/net/wireless/rt2x00/rt2800usb.c
··· 1114 1114 { USB_DEVICE(0x0db0, 0x871c) }, 1115 1115 { USB_DEVICE(0x0db0, 0x899a) }, 1116 1116 /* Ovislink */ 1117 + { USB_DEVICE(0x1b75, 0x3070) }, 1117 1118 { USB_DEVICE(0x1b75, 0x3071) }, 1118 1119 { USB_DEVICE(0x1b75, 0x3072) }, 1119 1120 { USB_DEVICE(0x1b75, 0xa200) },
+2
drivers/net/wireless/rtlwifi/pci.h
··· 247 247 /* MSI support */ 248 248 bool msi_support; 249 249 bool using_msi; 250 + /* interrupt clear before set */ 251 + bool int_clear; 250 252 }; 251 253 252 254 struct mp_adapter {
+17
drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
··· 2253 2253 } 2254 2254 } 2255 2255 2256 + static void rtl8821ae_clear_interrupt(struct ieee80211_hw *hw) 2257 + { 2258 + struct rtl_priv *rtlpriv = rtl_priv(hw); 2259 + u32 tmp = rtl_read_dword(rtlpriv, REG_HISR); 2260 + 2261 + rtl_write_dword(rtlpriv, REG_HISR, tmp); 2262 + 2263 + tmp = rtl_read_dword(rtlpriv, REG_HISRE); 2264 + rtl_write_dword(rtlpriv, REG_HISRE, tmp); 2265 + 2266 + tmp = rtl_read_dword(rtlpriv, REG_HSISR); 2267 + rtl_write_dword(rtlpriv, REG_HSISR, tmp); 2268 + } 2269 + 2256 2270 void rtl8821ae_enable_interrupt(struct ieee80211_hw *hw) 2257 2271 { 2258 2272 struct rtl_priv *rtlpriv = rtl_priv(hw); 2259 2273 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 2274 + 2275 + if (!rtlpci->int_clear) 2276 + rtl8821ae_clear_interrupt(hw);/*clear it here first*/ 2260 2277 2261 2278 rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] & 0xFFFFFFFF); 2262 2279 rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] & 0xFFFFFFFF);
+5
drivers/net/wireless/rtlwifi/rtl8821ae/sw.c
··· 96 96 97 97 rtl8821ae_bt_reg_init(hw); 98 98 rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support; 99 + rtlpci->int_clear = rtlpriv->cfg->mod_params->int_clear; 99 100 rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer(); 100 101 101 102 rtlpriv->dm.dm_initialgain_enable = 1; ··· 168 167 rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps; 169 168 rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps; 170 169 rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support; 170 + rtlpci->msi_support = rtlpriv->cfg->mod_params->int_clear; 171 171 if (rtlpriv->cfg->mod_params->disable_watchdog) 172 172 pr_info("watchdog disabled\n"); 173 173 rtlpriv->psc.reg_fwctrl_lps = 3; ··· 310 308 .swctrl_lps = false, 311 309 .fwctrl_lps = true, 312 310 .msi_support = true, 311 + .int_clear = true, 313 312 .debug = DBG_EMERG, 314 313 .disable_watchdog = 0, 315 314 }; ··· 440 437 module_param_named(msi, rtl8821ae_mod_params.msi_support, bool, 0444); 441 438 module_param_named(disable_watchdog, rtl8821ae_mod_params.disable_watchdog, 442 439 bool, 0444); 440 + module_param_named(int_clear, rtl8821ae_mod_params.int_clear, bool, 0444); 443 441 MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n"); 444 442 MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n"); 445 443 MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n"); ··· 448 444 MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 1)\n"); 449 445 MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); 450 446 MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n"); 447 + MODULE_PARM_DESC(int_clear, "Set to 1 to disable interrupt clear before set (default 0)\n"); 451 448 452 449 static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); 453 450
+3
drivers/net/wireless/rtlwifi/wifi.h
··· 2249 2249 2250 2250 /* default 0: 1 means disable */ 2251 2251 bool disable_watchdog; 2252 + 2253 + /* default 0: 1 means do not disable interrupts */ 2254 + bool int_clear; 2252 2255 }; 2253 2256 2254 2257 struct rtl_hal_usbint_cfg {
+6
drivers/net/xen-netback/xenbus.c
··· 788 788 /* Use the number of queues requested by the frontend */ 789 789 be->vif->queues = vzalloc(requested_num_queues * 790 790 sizeof(struct xenvif_queue)); 791 + if (!be->vif->queues) { 792 + xenbus_dev_fatal(dev, -ENOMEM, 793 + "allocating queues"); 794 + return; 795 + } 796 + 791 797 be->vif->num_queues = requested_num_queues; 792 798 be->vif->stalled_queues = requested_num_queues; 793 799
+1 -1
include/net/af_unix.h
··· 64 64 struct socket_wq peer_wq; 65 65 }; 66 66 67 - static inline struct unix_sock *unix_sk(struct sock *sk) 67 + static inline struct unix_sock *unix_sk(const struct sock *sk) 68 68 { 69 69 return (struct unix_sock *)sk; 70 70 }
+2 -2
include/net/inet_timewait_sock.h
··· 113 113 void __inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo, 114 114 bool rearm); 115 115 116 - static void inline inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo) 116 + static inline void inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo) 117 117 { 118 118 __inet_twsk_schedule(tw, timeo, false); 119 119 } 120 120 121 - static void inline inet_twsk_reschedule(struct inet_timewait_sock *tw, int timeo) 121 + static inline void inet_twsk_reschedule(struct inet_timewait_sock *tw, int timeo) 122 122 { 123 123 __inet_twsk_schedule(tw, timeo, true); 124 124 }
+8
include/net/sock.h
··· 828 828 if (sk_rcvqueues_full(sk, limit)) 829 829 return -ENOBUFS; 830 830 831 + /* 832 + * If the skb was allocated from pfmemalloc reserves, only 833 + * allow SOCK_MEMALLOC sockets to use it as this socket is 834 + * helping free memory 835 + */ 836 + if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC)) 837 + return -ENOMEM; 838 + 831 839 __sk_add_backlog(sk, skb); 832 840 sk->sk_backlog.len += skb->truesize; 833 841 return 0;
+15 -21
include/uapi/linux/openvswitch.h
··· 323 323 OVS_KEY_ATTR_MPLS, /* array of struct ovs_key_mpls. 324 324 * The implementation may restrict 325 325 * the accepted length of the array. */ 326 - OVS_KEY_ATTR_CT_STATE, /* u8 bitmask of OVS_CS_F_* */ 326 + OVS_KEY_ATTR_CT_STATE, /* u32 bitmask of OVS_CS_F_* */ 327 327 OVS_KEY_ATTR_CT_ZONE, /* u16 connection tracking zone. */ 328 328 OVS_KEY_ATTR_CT_MARK, /* u32 connection tracking mark */ 329 - OVS_KEY_ATTR_CT_LABEL, /* 16-octet connection tracking label */ 329 + OVS_KEY_ATTR_CT_LABELS, /* 16-octet connection tracking label */ 330 330 331 331 #ifdef __KERNEL__ 332 332 OVS_KEY_ATTR_TUNNEL_INFO, /* struct ip_tunnel_info */ ··· 439 439 __u8 nd_tll[ETH_ALEN]; 440 440 }; 441 441 442 - #define OVS_CT_LABEL_LEN 16 443 - struct ovs_key_ct_label { 444 - __u8 ct_label[OVS_CT_LABEL_LEN]; 442 + #define OVS_CT_LABELS_LEN 16 443 + struct ovs_key_ct_labels { 444 + __u8 ct_labels[OVS_CT_LABELS_LEN]; 445 445 }; 446 446 447 447 /* OVS_KEY_ATTR_CT_STATE flags */ ··· 449 449 #define OVS_CS_F_ESTABLISHED 0x02 /* Part of an existing connection. */ 450 450 #define OVS_CS_F_RELATED 0x04 /* Related to an established 451 451 * connection. */ 452 - #define OVS_CS_F_INVALID 0x20 /* Could not track connection. */ 453 - #define OVS_CS_F_REPLY_DIR 0x40 /* Flow is in the reply direction. */ 454 - #define OVS_CS_F_TRACKED 0x80 /* Conntrack has occurred. */ 452 + #define OVS_CS_F_REPLY_DIR 0x08 /* Flow is in the reply direction. */ 453 + #define OVS_CS_F_INVALID 0x10 /* Could not track connection. */ 454 + #define OVS_CS_F_TRACKED 0x20 /* Conntrack has occurred. */ 455 455 456 456 /** 457 457 * enum ovs_flow_attr - attributes for %OVS_FLOW_* commands. ··· 618 618 619 619 /** 620 620 * enum ovs_ct_attr - Attributes for %OVS_ACTION_ATTR_CT action. 621 - * @OVS_CT_ATTR_FLAGS: u32 connection tracking flags. 621 + * @OVS_CT_ATTR_COMMIT: If present, commits the connection to the conntrack 622 + * table. This allows future packets for the same connection to be identified 623 + * as 'established' or 'related'. 622 624 * @OVS_CT_ATTR_ZONE: u16 connection tracking zone. 623 625 * @OVS_CT_ATTR_MARK: u32 value followed by u32 mask. For each bit set in the 624 626 * mask, the corresponding bit in the value is copied to the connection 625 627 * tracking mark field in the connection. 626 - * @OVS_CT_ATTR_LABEL: %OVS_CT_LABEL_LEN value followed by %OVS_CT_LABEL_LEN 628 + * @OVS_CT_ATTR_LABEL: %OVS_CT_LABELS_LEN value followed by %OVS_CT_LABELS_LEN 627 629 * mask. For each bit set in the mask, the corresponding bit in the value is 628 630 * copied to the connection tracking label field in the connection. 629 631 * @OVS_CT_ATTR_HELPER: variable length string defining conntrack ALG. 630 632 */ 631 633 enum ovs_ct_attr { 632 634 OVS_CT_ATTR_UNSPEC, 633 - OVS_CT_ATTR_FLAGS, /* u8 bitmask of OVS_CT_F_*. */ 635 + OVS_CT_ATTR_COMMIT, /* No argument, commits connection. */ 634 636 OVS_CT_ATTR_ZONE, /* u16 zone id. */ 635 637 OVS_CT_ATTR_MARK, /* mark to associate with this connection. */ 636 - OVS_CT_ATTR_LABEL, /* label to associate with this connection. */ 638 + OVS_CT_ATTR_LABELS, /* labels to associate with this connection. */ 637 639 OVS_CT_ATTR_HELPER, /* netlink helper to assist detection of 638 640 related connections. */ 639 641 __OVS_CT_ATTR_MAX 640 642 }; 641 643 642 644 #define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1) 643 - 644 - /* 645 - * OVS_CT_ATTR_FLAGS flags - bitmask of %OVS_CT_F_* 646 - * @OVS_CT_F_COMMIT: Commits the flow to the conntrack table. This allows 647 - * future packets for the same connection to be identified as 'established' 648 - * or 'related'. 649 - */ 650 - #define OVS_CT_F_COMMIT 0x01 651 645 652 646 /** 653 647 * enum ovs_action_attr - Action types. ··· 699 705 * data immediately followed by a mask. 700 706 * The data must be zero for the unmasked 701 707 * bits. */ 702 - OVS_ACTION_ATTR_CT, /* One nested OVS_CT_ATTR_* . */ 708 + OVS_ACTION_ATTR_CT, /* Nested OVS_CT_ATTR_* . */ 703 709 704 710 __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted 705 711 * from userspace. */
+1 -1
include/uapi/linux/rtnetlink.h
··· 160 160 161 161 /* Macros to handle rtattributes */ 162 162 163 - #define RTA_ALIGNTO 4 163 + #define RTA_ALIGNTO 4U 164 164 #define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) ) 165 165 #define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \ 166 166 (rta)->rta_len >= sizeof(struct rtattr) && \
+71 -28
net/bluetooth/hci_conn.c
··· 91 91 * autoconnect action, remove them completely. If they are, just unmark 92 92 * them as waiting for connection, by clearing explicit_connect field. 93 93 */ 94 - if (params->auto_connect == HCI_AUTO_CONN_EXPLICIT) 94 + params->explicit_connect = false; 95 + 96 + list_del_init(&params->action); 97 + 98 + switch (params->auto_connect) { 99 + case HCI_AUTO_CONN_EXPLICIT: 95 100 hci_conn_params_del(conn->hdev, bdaddr, bdaddr_type); 96 - else 97 - params->explicit_connect = false; 101 + /* return instead of break to avoid duplicate scan update */ 102 + return; 103 + case HCI_AUTO_CONN_DIRECT: 104 + case HCI_AUTO_CONN_ALWAYS: 105 + list_add(&params->action, &conn->hdev->pend_le_conns); 106 + break; 107 + case HCI_AUTO_CONN_REPORT: 108 + list_add(&params->action, &conn->hdev->pend_le_reports); 109 + break; 110 + default: 111 + break; 112 + } 113 + 114 + hci_update_background_scan(conn->hdev); 115 + } 116 + 117 + static void hci_conn_cleanup(struct hci_conn *conn) 118 + { 119 + struct hci_dev *hdev = conn->hdev; 120 + 121 + if (test_bit(HCI_CONN_PARAM_REMOVAL_PEND, &conn->flags)) 122 + hci_conn_params_del(conn->hdev, &conn->dst, conn->dst_type); 123 + 124 + hci_chan_list_flush(conn); 125 + 126 + hci_conn_hash_del(hdev, conn); 127 + 128 + if (hdev->notify) 129 + hdev->notify(hdev, HCI_NOTIFY_CONN_DEL); 130 + 131 + hci_conn_del_sysfs(conn); 132 + 133 + debugfs_remove_recursive(conn->debugfs); 134 + 135 + hci_dev_put(hdev); 136 + 137 + hci_conn_put(conn); 98 138 } 99 139 100 140 /* This function requires the caller holds hdev->lock */ ··· 142 102 { 143 103 hci_connect_le_scan_cleanup(conn); 144 104 145 - hci_conn_hash_del(conn->hdev, conn); 146 - hci_update_background_scan(conn->hdev); 105 + /* We can't call hci_conn_del here since that would deadlock 106 + * with trying to call cancel_delayed_work_sync(&conn->disc_work). 107 + * Instead, call just hci_conn_cleanup() which contains the bare 108 + * minimum cleanup operations needed for a connection in this 109 + * state. 110 + */ 111 + hci_conn_cleanup(conn); 147 112 } 148 113 149 114 static void hci_acl_create_connection(struct hci_conn *conn) ··· 626 581 } 627 582 } 628 583 629 - hci_chan_list_flush(conn); 630 - 631 584 if (conn->amp_mgr) 632 585 amp_mgr_put(conn->amp_mgr); 633 586 634 - hci_conn_hash_del(hdev, conn); 635 - if (hdev->notify) 636 - hdev->notify(hdev, HCI_NOTIFY_CONN_DEL); 637 - 638 587 skb_queue_purge(&conn->data_q); 639 588 640 - hci_conn_del_sysfs(conn); 641 - 642 - debugfs_remove_recursive(conn->debugfs); 643 - 644 - if (test_bit(HCI_CONN_PARAM_REMOVAL_PEND, &conn->flags)) 645 - hci_conn_params_del(conn->hdev, &conn->dst, conn->dst_type); 646 - 647 - hci_dev_put(hdev); 648 - 649 - hci_conn_put(conn); 589 + /* Remove the connection from the list and cleanup its remaining 590 + * state. This is a separate function since for some cases like 591 + * BT_CONNECT_SCAN we *only* want the cleanup part without the 592 + * rest of hci_conn_del. 593 + */ 594 + hci_conn_cleanup(conn); 650 595 651 596 return 0; 652 597 } ··· 1008 973 if (is_connected(hdev, addr, addr_type)) 1009 974 return -EISCONN; 1010 975 1011 - params = hci_conn_params_add(hdev, addr, addr_type); 1012 - if (!params) 1013 - return -EIO; 976 + params = hci_conn_params_lookup(hdev, addr, addr_type); 977 + if (!params) { 978 + params = hci_conn_params_add(hdev, addr, addr_type); 979 + if (!params) 980 + return -ENOMEM; 1014 981 1015 - /* If we created new params, or existing params were marked as disabled, 1016 - * mark them to be used just once to connect. 1017 - */ 1018 - if (params->auto_connect == HCI_AUTO_CONN_DISABLED) { 982 + /* If we created new params, mark them to be deleted in 983 + * hci_connect_le_scan_cleanup. It's different case than 984 + * existing disabled params, those will stay after cleanup. 985 + */ 1019 986 params->auto_connect = HCI_AUTO_CONN_EXPLICIT; 987 + } 988 + 989 + /* We're trying to connect, so make sure params are at pend_le_conns */ 990 + if (params->auto_connect == HCI_AUTO_CONN_DISABLED || 991 + params->auto_connect == HCI_AUTO_CONN_REPORT || 992 + params->auto_connect == HCI_AUTO_CONN_EXPLICIT) { 1020 993 list_del_init(&params->action); 1021 994 list_add(&params->action, &hdev->pend_le_conns); 1022 995 }
-7
net/bluetooth/hci_core.c
··· 2861 2861 return param; 2862 2862 } 2863 2863 2864 - list_for_each_entry(param, &hdev->pend_le_reports, action) { 2865 - if (bacmp(&param->addr, addr) == 0 && 2866 - param->addr_type == addr_type && 2867 - param->explicit_connect) 2868 - return param; 2869 - } 2870 - 2871 2864 return NULL; 2872 2865 } 2873 2866
+8 -3
net/bluetooth/hci_event.c
··· 55 55 wake_up_bit(&hdev->flags, HCI_INQUIRY); 56 56 57 57 hci_dev_lock(hdev); 58 - hci_discovery_set_state(hdev, DISCOVERY_STOPPED); 58 + /* Set discovery state to stopped if we're not doing LE active 59 + * scanning. 60 + */ 61 + if (!hci_dev_test_flag(hdev, HCI_LE_SCAN) || 62 + hdev->le_scan_type != LE_SCAN_ACTIVE) 63 + hci_discovery_set_state(hdev, DISCOVERY_STOPPED); 59 64 hci_dev_unlock(hdev); 60 65 61 66 hci_conn_check_pending(hdev); ··· 4653 4648 /* If we're not connectable only connect devices that we have in 4654 4649 * our pend_le_conns list. 4655 4650 */ 4656 - params = hci_explicit_connect_lookup(hdev, addr, addr_type); 4657 - 4651 + params = hci_pend_le_action_lookup(&hdev->pend_le_conns, addr, 4652 + addr_type); 4658 4653 if (!params) 4659 4654 return NULL; 4660 4655
+20 -4
net/bluetooth/mgmt.c
··· 3545 3545 auth_type); 3546 3546 } else { 3547 3547 u8 addr_type; 3548 + struct hci_conn_params *p; 3548 3549 3549 3550 /* Convert from L2CAP channel address type to HCI address type 3550 3551 */ ··· 3563 3562 * If connection parameters already exist, then they 3564 3563 * will be kept and this function does nothing. 3565 3564 */ 3566 - hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type); 3565 + p = hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type); 3566 + 3567 + if (p->auto_connect == HCI_AUTO_CONN_EXPLICIT) 3568 + p->auto_connect = HCI_AUTO_CONN_DISABLED; 3567 3569 3568 3570 conn = hci_connect_le_scan(hdev, &cp->addr.bdaddr, 3569 3571 addr_type, sec_level, ··· 6121 6117 __hci_update_background_scan(req); 6122 6118 break; 6123 6119 case HCI_AUTO_CONN_REPORT: 6124 - list_add(&params->action, &hdev->pend_le_reports); 6120 + if (params->explicit_connect) 6121 + list_add(&params->action, &hdev->pend_le_conns); 6122 + else 6123 + list_add(&params->action, &hdev->pend_le_reports); 6125 6124 __hci_update_background_scan(req); 6126 6125 break; 6127 6126 case HCI_AUTO_CONN_DIRECT: 6128 6127 case HCI_AUTO_CONN_ALWAYS: 6129 6128 if (!is_connected(hdev, addr, addr_type)) { 6130 6129 list_add(&params->action, &hdev->pend_le_conns); 6131 - __hci_update_background_scan(req); 6130 + /* If we are in scan phase of connecting, we were 6131 + * already added to pend_le_conns and scanning. 6132 + */ 6133 + if (params->auto_connect != HCI_AUTO_CONN_EXPLICIT) 6134 + __hci_update_background_scan(req); 6132 6135 } 6133 6136 break; 6134 6137 } ··· 6390 6379 goto unlock; 6391 6380 } 6392 6381 6393 - if (params->auto_connect == HCI_AUTO_CONN_DISABLED) { 6382 + if (params->auto_connect == HCI_AUTO_CONN_DISABLED || 6383 + params->auto_connect == HCI_AUTO_CONN_EXPLICIT) { 6394 6384 err = cmd->cmd_complete(cmd, 6395 6385 MGMT_STATUS_INVALID_PARAMS); 6396 6386 mgmt_pending_remove(cmd); ··· 6427 6415 if (p->auto_connect == HCI_AUTO_CONN_DISABLED) 6428 6416 continue; 6429 6417 device_removed(sk, hdev, &p->addr, p->addr_type); 6418 + if (p->explicit_connect) { 6419 + p->auto_connect = HCI_AUTO_CONN_EXPLICIT; 6420 + continue; 6421 + } 6430 6422 list_del(&p->action); 6431 6423 list_del(&p->list); 6432 6424 kfree(p);
+1 -1
net/core/ethtool.c
··· 1284 1284 1285 1285 gstrings.len = ret; 1286 1286 1287 - data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER); 1287 + data = kcalloc(gstrings.len, ETH_GSTRING_LEN, GFP_USER); 1288 1288 if (!data) 1289 1289 return -ENOMEM; 1290 1290
+6 -1
net/core/filter.c
··· 1415 1415 return dev_forward_skb(dev, skb2); 1416 1416 1417 1417 skb2->dev = dev; 1418 + skb_sender_cpu_clear(skb2); 1418 1419 return dev_queue_xmit(skb2); 1419 1420 } 1420 1421 ··· 1855 1854 goto out; 1856 1855 1857 1856 /* We're copying the filter that has been originally attached, 1858 - * so no conversion/decode needed anymore. 1857 + * so no conversion/decode needed anymore. eBPF programs that 1858 + * have no original program cannot be dumped through this. 1859 1859 */ 1860 + ret = -EACCES; 1860 1861 fprog = filter->prog->orig_prog; 1862 + if (!fprog) 1863 + goto out; 1861 1864 1862 1865 ret = fprog->len; 1863 1866 if (!len)
+59 -11
net/dsa/dsa.c
··· 22 22 #include <linux/of_platform.h> 23 23 #include <linux/of_net.h> 24 24 #include <linux/sysfs.h> 25 + #include <linux/phy_fixed.h> 25 26 #include "dsa_priv.h" 26 27 27 28 char dsa_driver_version[] = "0.1"; ··· 306 305 if (ret < 0) 307 306 goto out; 308 307 309 - ds->slave_mii_bus = mdiobus_alloc(); 308 + ds->slave_mii_bus = devm_mdiobus_alloc(parent); 310 309 if (ds->slave_mii_bus == NULL) { 311 310 ret = -ENOMEM; 312 311 goto out; ··· 315 314 316 315 ret = mdiobus_register(ds->slave_mii_bus); 317 316 if (ret < 0) 318 - goto out_free; 317 + goto out; 319 318 320 319 321 320 /* ··· 368 367 369 368 return ret; 370 369 371 - out_free: 372 - mdiobus_free(ds->slave_mii_bus); 373 370 out: 374 - kfree(ds); 375 371 return ret; 376 372 } 377 373 ··· 398 400 /* 399 401 * Allocate and initialise switch state. 400 402 */ 401 - ds = kzalloc(sizeof(*ds) + drv->priv_size, GFP_KERNEL); 403 + ds = devm_kzalloc(parent, sizeof(*ds) + drv->priv_size, GFP_KERNEL); 402 404 if (ds == NULL) 403 405 return ERR_PTR(-ENOMEM); 404 406 ··· 418 420 419 421 static void dsa_switch_destroy(struct dsa_switch *ds) 420 422 { 423 + struct device_node *port_dn; 424 + struct phy_device *phydev; 425 + struct dsa_chip_data *cd = ds->pd; 426 + int port; 427 + 421 428 #ifdef CONFIG_NET_DSA_HWMON 422 429 if (ds->hwmon_dev) 423 430 hwmon_device_unregister(ds->hwmon_dev); 424 431 #endif 432 + 433 + /* Disable configuration of the CPU and DSA ports */ 434 + for (port = 0; port < DSA_MAX_PORTS; port++) { 435 + if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))) 436 + continue; 437 + 438 + port_dn = cd->port_dn[port]; 439 + if (of_phy_is_fixed_link(port_dn)) { 440 + phydev = of_phy_find_device(port_dn); 441 + if (phydev) { 442 + int addr = phydev->addr; 443 + 444 + phy_device_free(phydev); 445 + of_node_put(port_dn); 446 + fixed_phy_del(addr); 447 + } 448 + } 449 + } 450 + 451 + /* Destroy network devices for physical switch ports. */ 452 + for (port = 0; port < DSA_MAX_PORTS; port++) { 453 + if (!(ds->phys_port_mask & (1 << port))) 454 + continue; 455 + 456 + if (!ds->ports[port]) 457 + continue; 458 + 459 + unregister_netdev(ds->ports[port]); 460 + free_netdev(ds->ports[port]); 461 + } 462 + 463 + mdiobus_unregister(ds->slave_mii_bus); 425 464 } 426 465 427 466 #ifdef CONFIG_PM_SLEEP ··· 837 802 } 838 803 #endif 839 804 840 - static void dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev, 841 - struct device *parent, struct dsa_platform_data *pd) 805 + static int dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev, 806 + struct device *parent, struct dsa_platform_data *pd) 842 807 { 843 808 int i; 809 + unsigned configured = 0; 844 810 845 811 dst->pd = pd; 846 812 dst->master_netdev = dev; ··· 861 825 dst->ds[i] = ds; 862 826 if (ds->drv->poll_link != NULL) 863 827 dst->link_poll_needed = 1; 828 + 829 + ++configured; 864 830 } 831 + 832 + /* 833 + * If no switch was found, exit cleanly 834 + */ 835 + if (!configured) 836 + return -EPROBE_DEFER; 865 837 866 838 /* 867 839 * If we use a tagging format that doesn't have an ethertype ··· 887 843 dst->link_poll_timer.expires = round_jiffies(jiffies + HZ); 888 844 add_timer(&dst->link_poll_timer); 889 845 } 846 + 847 + return 0; 890 848 } 891 849 892 850 static int dsa_probe(struct platform_device *pdev) ··· 929 883 goto out; 930 884 } 931 885 932 - dst = kzalloc(sizeof(*dst), GFP_KERNEL); 886 + dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); 933 887 if (dst == NULL) { 934 888 dev_put(dev); 935 889 ret = -ENOMEM; ··· 938 892 939 893 platform_set_drvdata(pdev, dst); 940 894 941 - dsa_setup_dst(dst, dev, &pdev->dev, pd); 895 + ret = dsa_setup_dst(dst, dev, &pdev->dev, pd); 896 + if (ret) 897 + goto out; 942 898 943 899 return 0; 944 900 ··· 962 914 for (i = 0; i < dst->pd->nr_chips; i++) { 963 915 struct dsa_switch *ds = dst->ds[i]; 964 916 965 - if (ds != NULL) 917 + if (ds) 966 918 dsa_switch_destroy(ds); 967 919 } 968 920 }
+5 -3
net/ipv4/arp.c
··· 312 312 if (!skb) 313 313 return; 314 314 315 - skb_dst_set(skb, dst); 315 + skb_dst_set(skb, dst_clone(dst)); 316 316 arp_xmit(skb); 317 317 } 318 318 ··· 384 384 } 385 385 386 386 if (skb && !(dev->priv_flags & IFF_XMIT_DST_RELEASE)) 387 - dst = dst_clone(skb_dst(skb)); 387 + dst = skb_dst(skb); 388 388 arp_send_dst(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr, 389 389 dst_hw, dev->dev_addr, NULL, dst); 390 390 } ··· 811 811 } else { 812 812 pneigh_enqueue(&arp_tbl, 813 813 in_dev->arp_parms, skb); 814 - return 0; 814 + goto out_free_dst; 815 815 } 816 816 goto out; 817 817 } ··· 865 865 866 866 out: 867 867 consume_skb(skb); 868 + out_free_dst: 869 + dst_release(reply_dst); 868 870 return 0; 869 871 } 870 872
+10 -9
net/ipv4/inet_connection_sock.c
··· 577 577 static bool reqsk_queue_unlink(struct request_sock_queue *queue, 578 578 struct request_sock *req) 579 579 { 580 - struct listen_sock *lopt = queue->listen_opt; 581 580 struct request_sock **prev; 581 + struct listen_sock *lopt; 582 582 bool found = false; 583 583 584 584 spin_lock(&queue->syn_wait_lock); 585 - 586 - for (prev = &lopt->syn_table[req->rsk_hash]; *prev != NULL; 587 - prev = &(*prev)->dl_next) { 588 - if (*prev == req) { 589 - *prev = req->dl_next; 590 - found = true; 591 - break; 585 + lopt = queue->listen_opt; 586 + if (lopt) { 587 + for (prev = &lopt->syn_table[req->rsk_hash]; *prev != NULL; 588 + prev = &(*prev)->dl_next) { 589 + if (*prev == req) { 590 + *prev = req->dl_next; 591 + found = true; 592 + break; 593 + } 592 594 } 593 595 } 594 - 595 596 spin_unlock(&queue->syn_wait_lock); 596 597 if (timer_pending(&req->rsk_timer) && del_timer_sync(&req->rsk_timer)) 597 598 reqsk_put(req);
+2
net/ipv6/addrconf.c
··· 3119 3119 } 3120 3120 3121 3121 addrconf_addr_gen(idev, true); 3122 + if (dev->flags & IFF_POINTOPOINT) 3123 + addrconf_add_mroute(dev); 3122 3124 } 3123 3125 #endif 3124 3126
+3
net/ipv6/ip6_output.c
··· 376 376 if (skb->pkt_type != PACKET_HOST) 377 377 goto drop; 378 378 379 + if (unlikely(skb->sk)) 380 + goto drop; 381 + 379 382 if (skb_warn_if_lro(skb)) 380 383 goto drop; 381 384
+23 -26
net/ipv6/route.c
··· 142 142 struct net_device *loopback_dev = net->loopback_dev; 143 143 int cpu; 144 144 145 + if (dev == loopback_dev) 146 + return; 147 + 145 148 for_each_possible_cpu(cpu) { 146 149 struct uncached_list *ul = per_cpu_ptr(&rt6_uncached_list, cpu); 147 150 struct rt6_info *rt; ··· 154 151 struct inet6_dev *rt_idev = rt->rt6i_idev; 155 152 struct net_device *rt_dev = rt->dst.dev; 156 153 157 - if (rt_idev && (rt_idev->dev == dev || !dev) && 158 - rt_idev->dev != loopback_dev) { 154 + if (rt_idev->dev == dev) { 159 155 rt->rt6i_idev = in6_dev_get(loopback_dev); 160 156 in6_dev_put(rt_idev); 161 157 } 162 158 163 - if (rt_dev && (rt_dev == dev || !dev) && 164 - rt_dev != loopback_dev) { 159 + if (rt_dev == dev) { 165 160 rt->dst.dev = loopback_dev; 166 161 dev_hold(rt->dst.dev); 167 162 dev_put(rt_dev); ··· 248 247 { 249 248 } 250 249 251 - static u32 *ip6_rt_blackhole_cow_metrics(struct dst_entry *dst, 252 - unsigned long old) 253 - { 254 - return NULL; 255 - } 256 - 257 250 static struct dst_ops ip6_dst_blackhole_ops = { 258 251 .family = AF_INET6, 259 252 .destroy = ip6_dst_destroy, ··· 256 261 .default_advmss = ip6_default_advmss, 257 262 .update_pmtu = ip6_rt_blackhole_update_pmtu, 258 263 .redirect = ip6_rt_blackhole_redirect, 259 - .cow_metrics = ip6_rt_blackhole_cow_metrics, 264 + .cow_metrics = dst_cow_metrics_generic, 260 265 .neigh_lookup = ip6_neigh_lookup, 261 266 }; 262 267 ··· 313 318 314 319 #endif 315 320 321 + static void rt6_info_init(struct rt6_info *rt) 322 + { 323 + struct dst_entry *dst = &rt->dst; 324 + 325 + memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); 326 + INIT_LIST_HEAD(&rt->rt6i_siblings); 327 + INIT_LIST_HEAD(&rt->rt6i_uncached); 328 + } 329 + 316 330 /* allocate dst with ip6_dst_ops */ 317 331 static struct rt6_info *__ip6_dst_alloc(struct net *net, 318 332 struct net_device *dev, ··· 330 326 struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev, 331 327 0, DST_OBSOLETE_FORCE_CHK, flags); 332 328 333 - if (rt) { 334 - struct dst_entry *dst = &rt->dst; 329 + if (rt) 330 + rt6_info_init(rt); 335 331 336 - memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); 337 - INIT_LIST_HEAD(&rt->rt6i_siblings); 338 - INIT_LIST_HEAD(&rt->rt6i_uncached); 339 - } 340 332 return rt; 341 333 } 342 334 ··· 1213 1213 1214 1214 rt = dst_alloc(&ip6_dst_blackhole_ops, ort->dst.dev, 1, DST_OBSOLETE_NONE, 0); 1215 1215 if (rt) { 1216 + rt6_info_init(rt); 1217 + 1216 1218 new = &rt->dst; 1217 - 1218 - memset(new + 1, 0, sizeof(*rt) - sizeof(*new)); 1219 - 1220 1219 new->__use = 1; 1221 1220 new->input = dst_discard; 1222 1221 new->output = dst_discard_sk; 1223 1222 1224 - if (dst_metrics_read_only(&ort->dst)) 1225 - new->_metrics = ort->dst._metrics; 1226 - else 1227 - dst_copy_metrics(new, &ort->dst); 1223 + dst_copy_metrics(new, &ort->dst); 1228 1224 rt->rt6i_idev = ort->rt6i_idev; 1229 1225 if (rt->rt6i_idev) 1230 1226 in6_dev_hold(rt->rt6i_idev); 1231 1227 1232 1228 rt->rt6i_gateway = ort->rt6i_gateway; 1233 - rt->rt6i_flags = ort->rt6i_flags; 1229 + rt->rt6i_flags = ort->rt6i_flags & ~RTF_PCPU; 1234 1230 rt->rt6i_metric = 0; 1235 1231 1236 1232 memcpy(&rt->rt6i_dst, &ort->rt6i_dst, sizeof(struct rt6key)); ··· 2618 2622 2619 2623 fib6_clean_all(net, fib6_ifdown, &adn); 2620 2624 icmp6_clean_all(fib6_ifdown, &adn); 2621 - rt6_uncached_list_flush_dev(net, dev); 2625 + if (dev) 2626 + rt6_uncached_list_flush_dev(net, dev); 2622 2627 } 2623 2628 2624 2629 struct rt6_mtu_change_arg {
+1
net/ipv6/xfrm6_policy.c
··· 37 37 38 38 memset(&fl6, 0, sizeof(fl6)); 39 39 fl6.flowi6_oif = oif; 40 + fl6.flowi6_flags = FLOWI_FLAG_SKIP_NH_OIF; 40 41 memcpy(&fl6.daddr, daddr, sizeof(fl6.daddr)); 41 42 if (saddr) 42 43 memcpy(&fl6.saddr, saddr, sizeof(fl6.saddr));
+1 -1
net/mac80211/debugfs.c
··· 149 149 150 150 for (i = 0; i < NUM_IEEE80211_HW_FLAGS; i++) { 151 151 if (test_bit(i, local->hw.flags)) 152 - pos += scnprintf(pos, end - pos, "%s", 152 + pos += scnprintf(pos, end - pos, "%s\n", 153 153 hw_flag_names[i]); 154 154 } 155 155
+1
net/mac80211/status.c
··· 101 101 * when it wakes up for the next time. 102 102 */ 103 103 set_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT); 104 + ieee80211_clear_fast_xmit(sta); 104 105 105 106 /* 106 107 * This code races in the following way:
+5 -2
net/mac80211/tx.c
··· 1218 1218 1219 1219 if (!tx->sta) 1220 1220 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; 1221 - else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) 1221 + else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { 1222 1222 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; 1223 + ieee80211_check_fast_xmit(tx->sta); 1224 + } 1223 1225 1224 1226 info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT; 1225 1227 ··· 2453 2451 2454 2452 if (test_sta_flag(sta, WLAN_STA_PS_STA) || 2455 2453 test_sta_flag(sta, WLAN_STA_PS_DRIVER) || 2456 - test_sta_flag(sta, WLAN_STA_PS_DELIVER)) 2454 + test_sta_flag(sta, WLAN_STA_PS_DELIVER) || 2455 + test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT)) 2457 2456 goto out; 2458 2457 2459 2458 if (sdata->noack_map)
+22 -12
net/netlink/af_netlink.c
··· 2785 2785 struct sk_buff *skb = NULL; 2786 2786 struct nlmsghdr *nlh; 2787 2787 int len, err = -ENOBUFS; 2788 + int alloc_min_size; 2788 2789 int alloc_size; 2789 2790 2790 2791 mutex_lock(nlk->cb_mutex); ··· 2793 2792 err = -EINVAL; 2794 2793 goto errout_skb; 2795 2794 } 2796 - 2797 - cb = &nlk->cb; 2798 - alloc_size = max_t(int, cb->min_dump_alloc, NLMSG_GOODSIZE); 2799 2795 2800 2796 if (!netlink_rx_is_mmaped(sk) && 2801 2797 atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) ··· 2803 2805 * to reduce number of system calls on dump operations, if user 2804 2806 * ever provided a big enough buffer. 2805 2807 */ 2806 - if (alloc_size < nlk->max_recvmsg_len) { 2807 - skb = netlink_alloc_skb(sk, 2808 - nlk->max_recvmsg_len, 2809 - nlk->portid, 2808 + cb = &nlk->cb; 2809 + alloc_min_size = max_t(int, cb->min_dump_alloc, NLMSG_GOODSIZE); 2810 + 2811 + if (alloc_min_size < nlk->max_recvmsg_len) { 2812 + alloc_size = nlk->max_recvmsg_len; 2813 + skb = netlink_alloc_skb(sk, alloc_size, nlk->portid, 2810 2814 GFP_KERNEL | 2811 2815 __GFP_NOWARN | 2812 2816 __GFP_NORETRY); 2813 - /* available room should be exact amount to avoid MSG_TRUNC */ 2814 - if (skb) 2815 - skb_reserve(skb, skb_tailroom(skb) - 2816 - nlk->max_recvmsg_len); 2817 2817 } 2818 - if (!skb) 2818 + if (!skb) { 2819 + alloc_size = alloc_min_size; 2819 2820 skb = netlink_alloc_skb(sk, alloc_size, nlk->portid, 2820 2821 GFP_KERNEL); 2822 + } 2821 2823 if (!skb) 2822 2824 goto errout_skb; 2825 + 2826 + /* Trim skb to allocated size. User is expected to provide buffer as 2827 + * large as max(min_dump_alloc, 16KiB (mac_recvmsg_len capped at 2828 + * netlink_recvmsg())). dump will pack as many smaller messages as 2829 + * could fit within the allocated skb. skb is typically allocated 2830 + * with larger space than required (could be as much as near 2x the 2831 + * requested size with align to next power of 2 approach). Allowing 2832 + * dump to use the excess space makes it difficult for a user to have a 2833 + * reasonable static buffer based on the expected largest dump of a 2834 + * single netdev. The outcome is MSG_TRUNC error. 2835 + */ 2836 + skb_reserve(skb, skb_tailroom(skb) - alloc_size); 2823 2837 netlink_skb_set_owner_r(skb, sk); 2824 2838 2825 2839 len = cb->dump(skb, cb);
+14 -5
net/openvswitch/actions.c
··· 684 684 { 685 685 if (skb_network_offset(skb) > MAX_L2_LEN) { 686 686 OVS_NLERR(1, "L2 header too long to fragment"); 687 - return; 687 + goto err; 688 688 } 689 689 690 690 if (ethertype == htons(ETH_P_IP)) { ··· 708 708 struct rt6_info ovs_rt; 709 709 710 710 if (!v6ops) { 711 - kfree_skb(skb); 712 - return; 711 + goto err; 713 712 } 714 713 715 714 prepare_frag(vport, skb); ··· 727 728 WARN_ONCE(1, "Failed fragment ->%s: eth=%04x, MRU=%d, MTU=%d.", 728 729 ovs_vport_name(vport), ntohs(ethertype), mru, 729 730 vport->dev->mtu); 730 - kfree_skb(skb); 731 + goto err; 731 732 } 733 + 734 + return; 735 + err: 736 + kfree_skb(skb); 732 737 } 733 738 734 739 static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port, ··· 971 968 case OVS_KEY_ATTR_CT_STATE: 972 969 case OVS_KEY_ATTR_CT_ZONE: 973 970 case OVS_KEY_ATTR_CT_MARK: 974 - case OVS_KEY_ATTR_CT_LABEL: 971 + case OVS_KEY_ATTR_CT_LABELS: 975 972 err = -EINVAL; 976 973 break; 977 974 } ··· 1102 1099 break; 1103 1100 1104 1101 case OVS_ACTION_ATTR_CT: 1102 + if (!is_flow_key_valid(key)) { 1103 + err = ovs_flow_key_update(skb, key); 1104 + if (err) 1105 + return err; 1106 + } 1107 + 1105 1108 err = ovs_ct_execute(ovs_dp_get_net(dp), skb, key, 1106 1109 nla_data(a)); 1107 1110
+44 -45
net/openvswitch/conntrack.c
··· 37 37 }; 38 38 39 39 /* Metadata label for masked write to conntrack label. */ 40 - struct md_label { 41 - struct ovs_key_ct_label value; 42 - struct ovs_key_ct_label mask; 40 + struct md_labels { 41 + struct ovs_key_ct_labels value; 42 + struct ovs_key_ct_labels mask; 43 43 }; 44 44 45 45 /* Conntrack action context for execution. */ ··· 47 47 struct nf_conntrack_helper *helper; 48 48 struct nf_conntrack_zone zone; 49 49 struct nf_conn *ct; 50 - u32 flags; 50 + u8 commit : 1; 51 51 u16 family; 52 52 struct md_mark mark; 53 - struct md_label label; 53 + struct md_labels labels; 54 54 }; 55 55 56 56 static u16 key_to_nfproto(const struct sw_flow_key *key) ··· 109 109 #endif 110 110 } 111 111 112 - static void ovs_ct_get_label(const struct nf_conn *ct, 113 - struct ovs_key_ct_label *label) 112 + static void ovs_ct_get_labels(const struct nf_conn *ct, 113 + struct ovs_key_ct_labels *labels) 114 114 { 115 115 struct nf_conn_labels *cl = ct ? nf_ct_labels_find(ct) : NULL; 116 116 117 117 if (cl) { 118 118 size_t len = cl->words * sizeof(long); 119 119 120 - if (len > OVS_CT_LABEL_LEN) 121 - len = OVS_CT_LABEL_LEN; 122 - else if (len < OVS_CT_LABEL_LEN) 123 - memset(label, 0, OVS_CT_LABEL_LEN); 124 - memcpy(label, cl->bits, len); 120 + if (len > OVS_CT_LABELS_LEN) 121 + len = OVS_CT_LABELS_LEN; 122 + else if (len < OVS_CT_LABELS_LEN) 123 + memset(labels, 0, OVS_CT_LABELS_LEN); 124 + memcpy(labels, cl->bits, len); 125 125 } else { 126 - memset(label, 0, OVS_CT_LABEL_LEN); 126 + memset(labels, 0, OVS_CT_LABELS_LEN); 127 127 } 128 128 } 129 129 ··· 134 134 key->ct.state = state; 135 135 key->ct.zone = zone->id; 136 136 key->ct.mark = ovs_ct_get_mark(ct); 137 - ovs_ct_get_label(ct, &key->ct.label); 137 + ovs_ct_get_labels(ct, &key->ct.labels); 138 138 } 139 139 140 140 /* Update 'key' based on skb->nfct. If 'post_ct' is true, then OVS has ··· 167 167 168 168 int ovs_ct_put_key(const struct sw_flow_key *key, struct sk_buff *skb) 169 169 { 170 - if (nla_put_u8(skb, OVS_KEY_ATTR_CT_STATE, key->ct.state)) 170 + if (nla_put_u32(skb, OVS_KEY_ATTR_CT_STATE, key->ct.state)) 171 171 return -EMSGSIZE; 172 172 173 173 if (IS_ENABLED(CONFIG_NF_CONNTRACK_ZONES) && ··· 179 179 return -EMSGSIZE; 180 180 181 181 if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) && 182 - nla_put(skb, OVS_KEY_ATTR_CT_LABEL, sizeof(key->ct.label), 183 - &key->ct.label)) 182 + nla_put(skb, OVS_KEY_ATTR_CT_LABELS, sizeof(key->ct.labels), 183 + &key->ct.labels)) 184 184 return -EMSGSIZE; 185 185 186 186 return 0; ··· 213 213 #endif 214 214 } 215 215 216 - static int ovs_ct_set_label(struct sk_buff *skb, struct sw_flow_key *key, 217 - const struct ovs_key_ct_label *label, 218 - const struct ovs_key_ct_label *mask) 216 + static int ovs_ct_set_labels(struct sk_buff *skb, struct sw_flow_key *key, 217 + const struct ovs_key_ct_labels *labels, 218 + const struct ovs_key_ct_labels *mask) 219 219 { 220 220 enum ip_conntrack_info ctinfo; 221 221 struct nf_conn_labels *cl; ··· 235 235 nf_ct_labels_ext_add(ct); 236 236 cl = nf_ct_labels_find(ct); 237 237 } 238 - if (!cl || cl->words * sizeof(long) < OVS_CT_LABEL_LEN) 238 + if (!cl || cl->words * sizeof(long) < OVS_CT_LABELS_LEN) 239 239 return -ENOSPC; 240 240 241 - err = nf_connlabels_replace(ct, (u32 *)label, (u32 *)mask, 242 - OVS_CT_LABEL_LEN / sizeof(u32)); 241 + err = nf_connlabels_replace(ct, (u32 *)labels, (u32 *)mask, 242 + OVS_CT_LABELS_LEN / sizeof(u32)); 243 243 if (err) 244 244 return err; 245 245 246 - ovs_ct_get_label(ct, &key->ct.label); 246 + ovs_ct_get_labels(ct, &key->ct.labels); 247 247 return 0; 248 248 } 249 249 ··· 465 465 return 0; 466 466 } 467 467 468 - static bool label_nonzero(const struct ovs_key_ct_label *label) 468 + static bool labels_nonzero(const struct ovs_key_ct_labels *labels) 469 469 { 470 470 size_t i; 471 471 472 - for (i = 0; i < sizeof(*label); i++) 473 - if (label->ct_label[i]) 472 + for (i = 0; i < sizeof(*labels); i++) 473 + if (labels->ct_labels[i]) 474 474 return true; 475 475 476 476 return false; ··· 493 493 return err; 494 494 } 495 495 496 - if (info->flags & OVS_CT_F_COMMIT) 496 + if (info->commit) 497 497 err = ovs_ct_commit(net, key, info, skb); 498 498 else 499 499 err = ovs_ct_lookup(net, key, info, skb); ··· 506 506 if (err) 507 507 goto err; 508 508 } 509 - if (label_nonzero(&info->label.mask)) 510 - err = ovs_ct_set_label(skb, key, &info->label.value, 511 - &info->label.mask); 509 + if (labels_nonzero(&info->labels.mask)) 510 + err = ovs_ct_set_labels(skb, key, &info->labels.value, 511 + &info->labels.mask); 512 512 err: 513 513 skb_push(skb, nh_ofs); 514 514 return err; ··· 539 539 } 540 540 541 541 static const struct ovs_ct_len_tbl ovs_ct_attr_lens[OVS_CT_ATTR_MAX + 1] = { 542 - [OVS_CT_ATTR_FLAGS] = { .minlen = sizeof(u32), 543 - .maxlen = sizeof(u32) }, 542 + [OVS_CT_ATTR_COMMIT] = { .minlen = 0, .maxlen = 0 }, 544 543 [OVS_CT_ATTR_ZONE] = { .minlen = sizeof(u16), 545 544 .maxlen = sizeof(u16) }, 546 545 [OVS_CT_ATTR_MARK] = { .minlen = sizeof(struct md_mark), 547 546 .maxlen = sizeof(struct md_mark) }, 548 - [OVS_CT_ATTR_LABEL] = { .minlen = sizeof(struct md_label), 549 - .maxlen = sizeof(struct md_label) }, 547 + [OVS_CT_ATTR_LABELS] = { .minlen = sizeof(struct md_labels), 548 + .maxlen = sizeof(struct md_labels) }, 550 549 [OVS_CT_ATTR_HELPER] = { .minlen = 1, 551 550 .maxlen = NF_CT_HELPER_NAME_LEN } 552 551 }; ··· 575 576 } 576 577 577 578 switch (type) { 578 - case OVS_CT_ATTR_FLAGS: 579 - info->flags = nla_get_u32(a); 579 + case OVS_CT_ATTR_COMMIT: 580 + info->commit = true; 580 581 break; 581 582 #ifdef CONFIG_NF_CONNTRACK_ZONES 582 583 case OVS_CT_ATTR_ZONE: ··· 592 593 } 593 594 #endif 594 595 #ifdef CONFIG_NF_CONNTRACK_LABELS 595 - case OVS_CT_ATTR_LABEL: { 596 - struct md_label *label = nla_data(a); 596 + case OVS_CT_ATTR_LABELS: { 597 + struct md_labels *labels = nla_data(a); 597 598 598 - info->label = *label; 599 + info->labels = *labels; 599 600 break; 600 601 } 601 602 #endif ··· 632 633 attr == OVS_KEY_ATTR_CT_MARK) 633 634 return true; 634 635 if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) && 635 - attr == OVS_KEY_ATTR_CT_LABEL) { 636 + attr == OVS_KEY_ATTR_CT_LABELS) { 636 637 struct ovs_net *ovs_net = net_generic(net, ovs_net_id); 637 638 638 639 return ovs_net->xt_label; ··· 700 701 if (!start) 701 702 return -EMSGSIZE; 702 703 703 - if (nla_put_u32(skb, OVS_CT_ATTR_FLAGS, ct_info->flags)) 704 + if (ct_info->commit && nla_put_flag(skb, OVS_CT_ATTR_COMMIT)) 704 705 return -EMSGSIZE; 705 706 if (IS_ENABLED(CONFIG_NF_CONNTRACK_ZONES) && 706 707 nla_put_u16(skb, OVS_CT_ATTR_ZONE, ct_info->zone.id)) ··· 710 711 &ct_info->mark)) 711 712 return -EMSGSIZE; 712 713 if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) && 713 - nla_put(skb, OVS_CT_ATTR_LABEL, sizeof(ct_info->label), 714 - &ct_info->label)) 714 + nla_put(skb, OVS_CT_ATTR_LABELS, sizeof(ct_info->labels), 715 + &ct_info->labels)) 715 716 return -EMSGSIZE; 716 717 if (ct_info->helper) { 717 718 if (nla_put_string(skb, OVS_CT_ATTR_HELPER, ··· 736 737 737 738 void ovs_ct_init(struct net *net) 738 739 { 739 - unsigned int n_bits = sizeof(struct ovs_key_ct_label) * BITS_PER_BYTE; 740 + unsigned int n_bits = sizeof(struct ovs_key_ct_labels) * BITS_PER_BYTE; 740 741 struct ovs_net *ovs_net = net_generic(net, ovs_net_id); 741 742 742 743 if (nf_connlabels_get(net, n_bits)) {
+13 -1
net/openvswitch/conntrack.h
··· 34 34 void ovs_ct_fill_key(const struct sk_buff *skb, struct sw_flow_key *key); 35 35 int ovs_ct_put_key(const struct sw_flow_key *key, struct sk_buff *skb); 36 36 void ovs_ct_free_action(const struct nlattr *a); 37 + 38 + static inline bool ovs_ct_state_supported(u32 state) 39 + { 40 + return !(state & ~(OVS_CS_F_NEW | OVS_CS_F_ESTABLISHED | 41 + OVS_CS_F_RELATED | OVS_CS_F_REPLY_DIR | 42 + OVS_CS_F_INVALID | OVS_CS_F_TRACKED)); 43 + } 37 44 #else 38 45 #include <linux/errno.h> 39 46 ··· 49 42 static inline void ovs_ct_exit(struct net *net) { } 50 43 51 44 static inline bool ovs_ct_verify(struct net *net, int attr) 45 + { 46 + return false; 47 + } 48 + 49 + static inline bool ovs_ct_state_supported(u32 state) 52 50 { 53 51 return false; 54 52 } ··· 84 72 key->ct.state = 0; 85 73 key->ct.zone = 0; 86 74 key->ct.mark = 0; 87 - memset(&key->ct.label, 0, sizeof(key->ct.label)); 75 + memset(&key->ct.labels, 0, sizeof(key->ct.labels)); 88 76 } 89 77 90 78 static inline int ovs_ct_put_key(const struct sw_flow_key *key,
+1 -1
net/openvswitch/flow.h
··· 116 116 u16 zone; 117 117 u32 mark; 118 118 u8 state; 119 - struct ovs_key_ct_label label; 119 + struct ovs_key_ct_labels labels; 120 120 } ct; 121 121 122 122 } __aligned(BITS_PER_LONG/8); /* Ensure that we can do comparisons as longs. */
+18 -12
net/openvswitch/flow_netlink.c
··· 291 291 + nla_total_size(4) /* OVS_KEY_ATTR_SKB_MARK */ 292 292 + nla_total_size(4) /* OVS_KEY_ATTR_DP_HASH */ 293 293 + nla_total_size(4) /* OVS_KEY_ATTR_RECIRC_ID */ 294 - + nla_total_size(1) /* OVS_KEY_ATTR_CT_STATE */ 294 + + nla_total_size(4) /* OVS_KEY_ATTR_CT_STATE */ 295 295 + nla_total_size(2) /* OVS_KEY_ATTR_CT_ZONE */ 296 296 + nla_total_size(4) /* OVS_KEY_ATTR_CT_MARK */ 297 - + nla_total_size(16) /* OVS_KEY_ATTR_CT_LABEL */ 297 + + nla_total_size(16) /* OVS_KEY_ATTR_CT_LABELS */ 298 298 + nla_total_size(12) /* OVS_KEY_ATTR_ETHERNET */ 299 299 + nla_total_size(2) /* OVS_KEY_ATTR_ETHERTYPE */ 300 300 + nla_total_size(4) /* OVS_KEY_ATTR_VLAN */ ··· 349 349 [OVS_KEY_ATTR_TUNNEL] = { .len = OVS_ATTR_NESTED, 350 350 .next = ovs_tunnel_key_lens, }, 351 351 [OVS_KEY_ATTR_MPLS] = { .len = sizeof(struct ovs_key_mpls) }, 352 - [OVS_KEY_ATTR_CT_STATE] = { .len = sizeof(u8) }, 352 + [OVS_KEY_ATTR_CT_STATE] = { .len = sizeof(u32) }, 353 353 [OVS_KEY_ATTR_CT_ZONE] = { .len = sizeof(u16) }, 354 354 [OVS_KEY_ATTR_CT_MARK] = { .len = sizeof(u32) }, 355 - [OVS_KEY_ATTR_CT_LABEL] = { .len = sizeof(struct ovs_key_ct_label) }, 355 + [OVS_KEY_ATTR_CT_LABELS] = { .len = sizeof(struct ovs_key_ct_labels) }, 356 356 }; 357 357 358 358 static bool check_attr_len(unsigned int attr_len, unsigned int expected_len) ··· 814 814 815 815 if (*attrs & (1 << OVS_KEY_ATTR_CT_STATE) && 816 816 ovs_ct_verify(net, OVS_KEY_ATTR_CT_STATE)) { 817 - u8 ct_state = nla_get_u8(a[OVS_KEY_ATTR_CT_STATE]); 817 + u32 ct_state = nla_get_u32(a[OVS_KEY_ATTR_CT_STATE]); 818 + 819 + if (!is_mask && !ovs_ct_state_supported(ct_state)) { 820 + OVS_NLERR(log, "ct_state flags %08x unsupported", 821 + ct_state); 822 + return -EINVAL; 823 + } 818 824 819 825 SW_FLOW_KEY_PUT(match, ct.state, ct_state, is_mask); 820 826 *attrs &= ~(1ULL << OVS_KEY_ATTR_CT_STATE); ··· 839 833 SW_FLOW_KEY_PUT(match, ct.mark, mark, is_mask); 840 834 *attrs &= ~(1ULL << OVS_KEY_ATTR_CT_MARK); 841 835 } 842 - if (*attrs & (1 << OVS_KEY_ATTR_CT_LABEL) && 843 - ovs_ct_verify(net, OVS_KEY_ATTR_CT_LABEL)) { 844 - const struct ovs_key_ct_label *cl; 836 + if (*attrs & (1 << OVS_KEY_ATTR_CT_LABELS) && 837 + ovs_ct_verify(net, OVS_KEY_ATTR_CT_LABELS)) { 838 + const struct ovs_key_ct_labels *cl; 845 839 846 - cl = nla_data(a[OVS_KEY_ATTR_CT_LABEL]); 847 - SW_FLOW_KEY_MEMCPY(match, ct.label, cl->ct_label, 840 + cl = nla_data(a[OVS_KEY_ATTR_CT_LABELS]); 841 + SW_FLOW_KEY_MEMCPY(match, ct.labels, cl->ct_labels, 848 842 sizeof(*cl), is_mask); 849 - *attrs &= ~(1ULL << OVS_KEY_ATTR_CT_LABEL); 843 + *attrs &= ~(1ULL << OVS_KEY_ATTR_CT_LABELS); 850 844 } 851 845 return 0; 852 846 } ··· 1979 1973 case OVS_KEY_ATTR_PRIORITY: 1980 1974 case OVS_KEY_ATTR_SKB_MARK: 1981 1975 case OVS_KEY_ATTR_CT_MARK: 1982 - case OVS_KEY_ATTR_CT_LABEL: 1976 + case OVS_KEY_ATTR_CT_LABELS: 1983 1977 case OVS_KEY_ATTR_ETHERNET: 1984 1978 break; 1985 1979
+2 -1
net/openvswitch/flow_table.c
··· 93 93 94 94 /* Initialize the default stat node. */ 95 95 stats = kmem_cache_alloc_node(flow_stats_cache, 96 - GFP_KERNEL | __GFP_ZERO, 0); 96 + GFP_KERNEL | __GFP_ZERO, 97 + node_online(0) ? 0 : NUMA_NO_NODE); 97 98 if (!stats) 98 99 goto err; 99 100
+20 -27
net/openvswitch/vport.c
··· 280 280 */ 281 281 void ovs_vport_get_stats(struct vport *vport, struct ovs_vport_stats *stats) 282 282 { 283 - struct net_device *dev = vport->dev; 284 - int i; 283 + const struct rtnl_link_stats64 *dev_stats; 284 + struct rtnl_link_stats64 temp; 285 285 286 - memset(stats, 0, sizeof(*stats)); 287 - stats->rx_errors = dev->stats.rx_errors; 288 - stats->tx_errors = dev->stats.tx_errors; 289 - stats->tx_dropped = dev->stats.tx_dropped; 290 - stats->rx_dropped = dev->stats.rx_dropped; 286 + dev_stats = dev_get_stats(vport->dev, &temp); 287 + stats->rx_errors = dev_stats->rx_errors; 288 + stats->tx_errors = dev_stats->tx_errors; 289 + stats->tx_dropped = dev_stats->tx_dropped; 290 + stats->rx_dropped = dev_stats->rx_dropped; 291 291 292 - stats->rx_dropped += atomic_long_read(&dev->rx_dropped); 293 - stats->tx_dropped += atomic_long_read(&dev->tx_dropped); 294 - 295 - for_each_possible_cpu(i) { 296 - const struct pcpu_sw_netstats *percpu_stats; 297 - struct pcpu_sw_netstats local_stats; 298 - unsigned int start; 299 - 300 - percpu_stats = per_cpu_ptr(dev->tstats, i); 301 - 302 - do { 303 - start = u64_stats_fetch_begin_irq(&percpu_stats->syncp); 304 - local_stats = *percpu_stats; 305 - } while (u64_stats_fetch_retry_irq(&percpu_stats->syncp, start)); 306 - 307 - stats->rx_bytes += local_stats.rx_bytes; 308 - stats->rx_packets += local_stats.rx_packets; 309 - stats->tx_bytes += local_stats.tx_bytes; 310 - stats->tx_packets += local_stats.tx_packets; 311 - } 292 + stats->rx_bytes = dev_stats->rx_bytes; 293 + stats->rx_packets = dev_stats->rx_packets; 294 + stats->tx_bytes = dev_stats->tx_bytes; 295 + stats->tx_packets = dev_stats->tx_packets; 312 296 } 313 297 314 298 /** ··· 444 460 445 461 OVS_CB(skb)->input_vport = vport; 446 462 OVS_CB(skb)->mru = 0; 463 + if (unlikely(dev_net(skb->dev) != ovs_dp_get_net(vport->dp))) { 464 + u32 mark; 465 + 466 + mark = skb->mark; 467 + skb_scrub_packet(skb, true); 468 + skb->mark = mark; 469 + tun_info = NULL; 470 + } 471 + 447 472 /* Extract flow from 'skb' into 'key'. */ 448 473 error = ovs_flow_key_extract(tun_info, skb, &key); 449 474 if (unlikely(error)) {
+14 -4
net/sched/act_mirred.c
··· 31 31 32 32 #define MIRRED_TAB_MASK 7 33 33 static LIST_HEAD(mirred_list); 34 + static DEFINE_SPINLOCK(mirred_list_lock); 34 35 35 36 static void tcf_mirred_release(struct tc_action *a, int bind) 36 37 { 37 38 struct tcf_mirred *m = to_mirred(a); 38 39 struct net_device *dev = rcu_dereference_protected(m->tcfm_dev, 1); 39 40 41 + /* We could be called either in a RCU callback or with RTNL lock held. */ 42 + spin_lock_bh(&mirred_list_lock); 40 43 list_del(&m->tcfm_list); 44 + spin_unlock_bh(&mirred_list_lock); 41 45 if (dev) 42 46 dev_put(dev); 43 47 } ··· 107 103 } else { 108 104 if (bind) 109 105 return 0; 110 - if (!ovr) { 111 - tcf_hash_release(a, bind); 106 + 107 + tcf_hash_release(a, bind); 108 + if (!ovr) 112 109 return -EEXIST; 113 - } 114 110 } 115 111 m = to_mirred(a); 116 112 ··· 127 123 } 128 124 129 125 if (ret == ACT_P_CREATED) { 126 + spin_lock_bh(&mirred_list_lock); 130 127 list_add(&m->tcfm_list, &mirred_list); 128 + spin_unlock_bh(&mirred_list_lock); 131 129 tcf_hash_insert(a); 132 130 } 133 131 ··· 179 173 180 174 skb2->skb_iif = skb->dev->ifindex; 181 175 skb2->dev = dev; 176 + skb_sender_cpu_clear(skb2); 182 177 err = dev_queue_xmit(skb2); 183 178 184 179 if (err) { ··· 228 221 struct tcf_mirred *m; 229 222 230 223 ASSERT_RTNL(); 231 - if (event == NETDEV_UNREGISTER) 224 + if (event == NETDEV_UNREGISTER) { 225 + spin_lock_bh(&mirred_list_lock); 232 226 list_for_each_entry(m, &mirred_list, tcfm_list) { 233 227 if (rcu_access_pointer(m->tcfm_dev) == dev) { 234 228 dev_put(dev); ··· 239 231 RCU_INIT_POINTER(m->tcfm_dev, NULL); 240 232 } 241 233 } 234 + spin_unlock_bh(&mirred_list_lock); 235 + } 242 236 243 237 return NOTIFY_DONE; 244 238 }
+10 -1
net/sched/sch_hhf.c
··· 368 368 return bucket - q->buckets; 369 369 } 370 370 371 + static unsigned int hhf_qdisc_drop(struct Qdisc *sch) 372 + { 373 + unsigned int prev_backlog; 374 + 375 + prev_backlog = sch->qstats.backlog; 376 + hhf_drop(sch); 377 + return prev_backlog - sch->qstats.backlog; 378 + } 379 + 371 380 static int hhf_enqueue(struct sk_buff *skb, struct Qdisc *sch) 372 381 { 373 382 struct hhf_sched_data *q = qdisc_priv(sch); ··· 705 696 .enqueue = hhf_enqueue, 706 697 .dequeue = hhf_dequeue, 707 698 .peek = qdisc_peek_dequeued, 708 - .drop = hhf_drop, 699 + .drop = hhf_qdisc_drop, 709 700 .init = hhf_init, 710 701 .reset = hhf_reset, 711 702 .destroy = hhf_destroy,
+3
net/switchdev/switchdev.c
··· 16 16 #include <linux/notifier.h> 17 17 #include <linux/netdevice.h> 18 18 #include <linux/if_bridge.h> 19 + #include <linux/if_vlan.h> 19 20 #include <net/ip_fib.h> 20 21 #include <net/switchdev.h> 21 22 ··· 635 634 if (nla_len(attr) != sizeof(struct bridge_vlan_info)) 636 635 return -EINVAL; 637 636 vinfo = nla_data(attr); 637 + if (!vinfo->vid || vinfo->vid >= VLAN_VID_MASK) 638 + return -EINVAL; 638 639 vlan->flags = vinfo->flags; 639 640 if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) { 640 641 if (vlan->vid_begin)
+2 -2
net/tipc/msg.h
··· 357 357 if (likely((usr <= TIPC_CRITICAL_IMPORTANCE) && !msg_errcode(m))) 358 358 return usr; 359 359 if ((usr == MSG_FRAGMENTER) || (usr == MSG_BUNDLER)) 360 - return msg_bits(m, 5, 13, 0x7); 360 + return msg_bits(m, 9, 0, 0x7); 361 361 return TIPC_SYSTEM_IMPORTANCE; 362 362 } 363 363 ··· 366 366 int usr = msg_user(m); 367 367 368 368 if (likely((usr == MSG_FRAGMENTER) || (usr == MSG_BUNDLER))) 369 - msg_set_bits(m, 5, 13, 0x7, i); 369 + msg_set_bits(m, 9, 0, 0x7, i); 370 370 else if (i < TIPC_SYSTEM_IMPORTANCE) 371 371 msg_set_user(m, i); 372 372 else
+3 -3
net/tipc/node.c
··· 1116 1116 } 1117 1117 1118 1118 /* Ignore duplicate packets */ 1119 - if (less(oseqno, rcv_nxt)) 1119 + if ((usr != LINK_PROTOCOL) && less(oseqno, rcv_nxt)) 1120 1120 return true; 1121 1121 1122 1122 /* Initiate or update failover mode if applicable */ ··· 1146 1146 if (!pl || !tipc_link_is_up(pl)) 1147 1147 return true; 1148 1148 1149 - /* Initiate or update synch mode if applicable */ 1150 - if ((usr == TUNNEL_PROTOCOL) && (mtyp == SYNCH_MSG)) { 1149 + /* Initiate synch mode if applicable */ 1150 + if ((usr == TUNNEL_PROTOCOL) && (mtyp == SYNCH_MSG) && (oseqno == 1)) { 1151 1151 syncpt = iseqno + exp_pkts - 1; 1152 1152 if (!tipc_link_is_up(l)) { 1153 1153 tipc_link_fsm_evt(l, LINK_ESTABLISH_EVT);
+7 -5
net/unix/af_unix.c
··· 2064 2064 goto out; 2065 2065 } 2066 2066 2067 + if (flags & MSG_PEEK) 2068 + skip = sk_peek_offset(sk, flags); 2069 + else 2070 + skip = 0; 2071 + 2067 2072 do { 2068 2073 int chunk; 2069 2074 struct sk_buff *skb, *last; ··· 2117 2112 break; 2118 2113 } 2119 2114 2120 - skip = sk_peek_offset(sk, flags); 2121 2115 while (skip >= unix_skb_len(skb)) { 2122 2116 skip -= unix_skb_len(skb); 2123 2117 last = skb; ··· 2183 2179 if (UNIXCB(skb).fp) 2184 2180 scm.fp = scm_fp_dup(UNIXCB(skb).fp); 2185 2181 2186 - if (skip) { 2187 - sk_peek_offset_fwd(sk, chunk); 2188 - skip -= chunk; 2189 - } 2182 + sk_peek_offset_fwd(sk, chunk); 2190 2183 2191 2184 if (UNIXCB(skb).fp) 2192 2185 break; 2193 2186 2187 + skip = 0; 2194 2188 last = skb; 2195 2189 last_len = skb->len; 2196 2190 unix_state_lock(sk);