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) Fix stack allocation in s390 BPF JIT, from Michael Holzheu.

2) Disable LRO on openvswitch paths, from Jiri Benc.

3) UDP early demux doesn't handle multicast group membership properly,
fix from Shawn Bohrer.

4) Fix TX queue hang due to incorrect handling of mixed sized fragments
and linearlization in i40e driver, from Anjali Singhai Jain.

5) Cannot use disable_irq() in timer handler of AMD xgbe driver, from
Thomas Lendacky.

6) b2net driver improperly assumes pci_alloc_consistent() gives zero'd
out memory, use dma_zalloc_coherent(). From Sriharsha Basavapatna.

7) Fix use-after-free in MPLS and ipv6, from Robert Shearman.

8) Missing neif_napi_del() calls in cleanup paths of b44 driver, from
Hauke Mehrtens.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
net: replace last open coded skb_orphan_frags with function call
net: bcmgenet: power on MII block for all MII modes
ipv6: Fix protocol resubmission
ipv6: fix possible use after free of dev stats
b44: call netif_napi_del()
bridge: disable softirqs around br_fdb_update to avoid lockup
Revert "bridge: use _bh spinlock variant for br_fdb_update to avoid lockup"
mpls: fix possible use after free of device
be2net: Replace dma/pci_alloc_coherent() calls with dma_zalloc_coherent()
bridge: use _bh spinlock variant for br_fdb_update to avoid lockup
amd-xgbe: Use disable_irq_nosync from within timer function
rhashtable: add missing import <linux/export.h>
i40e: Make sure to be in VEB mode if SRIOV is enabled at probe
i40e: start up in VEPA mode by default
i40e/i40evf: Fix mixed size frags and linearization
ipv4/udp: Verify multicast group is ours in upd_v4_early_demux()
openvswitch: disable LRO
s390/bpf: fix bpf frame pointer setup
s390/bpf: fix stack allocation

+196 -115
+3 -1
arch/s390/net/bpf_jit.h
··· 48 48 * We get 160 bytes stack space from calling function, but only use 49 49 * 11 * 8 byte (old backchain + r15 - r6) for storing registers. 50 50 */ 51 - #define STK_OFF (MAX_BPF_STACK + 8 + 4 + 4 + (160 - 11 * 8)) 51 + #define STK_SPACE (MAX_BPF_STACK + 8 + 4 + 4 + 160) 52 + #define STK_160_UNUSED (160 - 11 * 8) 53 + #define STK_OFF (STK_SPACE - STK_160_UNUSED) 52 54 #define STK_OFF_TMP 160 /* Offset of tmp buffer on stack */ 53 55 #define STK_OFF_HLEN 168 /* Offset of SKB header length on stack */ 54 56
+7 -4
arch/s390/net/bpf_jit_comp.c
··· 384 384 } 385 385 /* Setup stack and backchain */ 386 386 if (jit->seen & SEEN_STACK) { 387 - /* lgr %bfp,%r15 (BPF frame pointer) */ 388 - EMIT4(0xb9040000, BPF_REG_FP, REG_15); 387 + if (jit->seen & SEEN_FUNC) 388 + /* lgr %w1,%r15 (backchain) */ 389 + EMIT4(0xb9040000, REG_W1, REG_15); 390 + /* la %bfp,STK_160_UNUSED(%r15) (BPF frame pointer) */ 391 + EMIT4_DISP(0x41000000, BPF_REG_FP, REG_15, STK_160_UNUSED); 389 392 /* aghi %r15,-STK_OFF */ 390 393 EMIT4_IMM(0xa70b0000, REG_15, -STK_OFF); 391 394 if (jit->seen & SEEN_FUNC) 392 - /* stg %bfp,152(%r15) (backchain) */ 393 - EMIT6_DISP_LH(0xe3000000, 0x0024, BPF_REG_FP, REG_0, 395 + /* stg %w1,152(%r15) (backchain) */ 396 + EMIT6_DISP_LH(0xe3000000, 0x0024, REG_W1, REG_0, 394 397 REG_15, 152); 395 398 } 396 399 /*
+1 -1
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
··· 423 423 if (napi_schedule_prep(napi)) { 424 424 /* Disable Tx and Rx interrupts */ 425 425 if (pdata->per_channel_irq) 426 - disable_irq(channel->dma_irq); 426 + disable_irq_nosync(channel->dma_irq); 427 427 else 428 428 xgbe_disable_rx_tx_ints(pdata); 429 429
+2
drivers/net/ethernet/broadcom/b44.c
··· 2464 2464 ssb_bus_may_powerdown(sdev->bus); 2465 2465 2466 2466 err_out_free_dev: 2467 + netif_napi_del(&bp->napi); 2467 2468 free_netdev(dev); 2468 2469 2469 2470 out: ··· 2481 2480 b44_unregister_phy_one(bp); 2482 2481 ssb_device_disable(sdev, 0); 2483 2482 ssb_bus_may_powerdown(sdev->bus); 2483 + netif_napi_del(&bp->napi); 2484 2484 free_netdev(dev); 2485 2485 ssb_pcihost_set_power_state(sdev, PCI_D3hot); 2486 2486 ssb_set_drvdata(sdev, NULL);
+9 -3
drivers/net/ethernet/broadcom/genet/bcmmii.c
··· 299 299 phy_name = "external RGMII (no delay)"; 300 300 else 301 301 phy_name = "external RGMII (TX delay)"; 302 - reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL); 303 - reg |= RGMII_MODE_EN | id_mode_dis; 304 - bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL); 305 302 bcmgenet_sys_writel(priv, 306 303 PORT_MODE_EXT_GPHY, SYS_PORT_CTRL); 307 304 break; 308 305 default: 309 306 dev_err(kdev, "unknown phy mode: %d\n", priv->phy_interface); 310 307 return -EINVAL; 308 + } 309 + 310 + /* This is an external PHY (xMII), so we need to enable the RGMII 311 + * block for the interface to work 312 + */ 313 + if (priv->ext_phy) { 314 + reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL); 315 + reg |= RGMII_MODE_EN | id_mode_dis; 316 + bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL); 311 317 } 312 318 313 319 if (init)
+50 -37
drivers/net/ethernet/emulex/benet/be_cmds.c
··· 1720 1720 total_size = buf_len; 1721 1721 1722 1722 get_fat_cmd.size = sizeof(struct be_cmd_req_get_fat) + 60*1024; 1723 - get_fat_cmd.va = pci_alloc_consistent(adapter->pdev, 1724 - get_fat_cmd.size, 1725 - &get_fat_cmd.dma); 1723 + get_fat_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, 1724 + get_fat_cmd.size, 1725 + &get_fat_cmd.dma, GFP_ATOMIC); 1726 1726 if (!get_fat_cmd.va) { 1727 1727 dev_err(&adapter->pdev->dev, 1728 1728 "Memory allocation failure while reading FAT data\n"); ··· 1767 1767 log_offset += buf_size; 1768 1768 } 1769 1769 err: 1770 - pci_free_consistent(adapter->pdev, get_fat_cmd.size, 1771 - get_fat_cmd.va, get_fat_cmd.dma); 1770 + dma_free_coherent(&adapter->pdev->dev, get_fat_cmd.size, 1771 + get_fat_cmd.va, get_fat_cmd.dma); 1772 1772 spin_unlock_bh(&adapter->mcc_lock); 1773 1773 return status; 1774 1774 } ··· 2215 2215 return -EINVAL; 2216 2216 2217 2217 cmd.size = sizeof(struct be_cmd_resp_port_type); 2218 - cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma); 2218 + cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma, 2219 + GFP_ATOMIC); 2219 2220 if (!cmd.va) { 2220 2221 dev_err(&adapter->pdev->dev, "Memory allocation failed\n"); 2221 2222 return -ENOMEM; 2222 2223 } 2223 - memset(cmd.va, 0, cmd.size); 2224 2224 2225 2225 spin_lock_bh(&adapter->mcc_lock); 2226 2226 ··· 2245 2245 } 2246 2246 err: 2247 2247 spin_unlock_bh(&adapter->mcc_lock); 2248 - pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma); 2248 + dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, cmd.dma); 2249 2249 return status; 2250 2250 } 2251 2251 ··· 2720 2720 goto err; 2721 2721 } 2722 2722 cmd.size = sizeof(struct be_cmd_req_get_phy_info); 2723 - cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma); 2723 + cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma, 2724 + GFP_ATOMIC); 2724 2725 if (!cmd.va) { 2725 2726 dev_err(&adapter->pdev->dev, "Memory alloc failure\n"); 2726 2727 status = -ENOMEM; ··· 2755 2754 BE_SUPPORTED_SPEED_1GBPS; 2756 2755 } 2757 2756 } 2758 - pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma); 2757 + dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, cmd.dma); 2759 2758 err: 2760 2759 spin_unlock_bh(&adapter->mcc_lock); 2761 2760 return status; ··· 2806 2805 2807 2806 memset(&attribs_cmd, 0, sizeof(struct be_dma_mem)); 2808 2807 attribs_cmd.size = sizeof(struct be_cmd_resp_cntl_attribs); 2809 - attribs_cmd.va = pci_alloc_consistent(adapter->pdev, attribs_cmd.size, 2810 - &attribs_cmd.dma); 2808 + attribs_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, 2809 + attribs_cmd.size, 2810 + &attribs_cmd.dma, GFP_ATOMIC); 2811 2811 if (!attribs_cmd.va) { 2812 2812 dev_err(&adapter->pdev->dev, "Memory allocation failure\n"); 2813 2813 status = -ENOMEM; ··· 2835 2833 err: 2836 2834 mutex_unlock(&adapter->mbox_lock); 2837 2835 if (attribs_cmd.va) 2838 - pci_free_consistent(adapter->pdev, attribs_cmd.size, 2839 - attribs_cmd.va, attribs_cmd.dma); 2836 + dma_free_coherent(&adapter->pdev->dev, attribs_cmd.size, 2837 + attribs_cmd.va, attribs_cmd.dma); 2840 2838 return status; 2841 2839 } 2842 2840 ··· 2974 2972 2975 2973 memset(&get_mac_list_cmd, 0, sizeof(struct be_dma_mem)); 2976 2974 get_mac_list_cmd.size = sizeof(struct be_cmd_resp_get_mac_list); 2977 - get_mac_list_cmd.va = pci_alloc_consistent(adapter->pdev, 2978 - get_mac_list_cmd.size, 2979 - &get_mac_list_cmd.dma); 2975 + get_mac_list_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, 2976 + get_mac_list_cmd.size, 2977 + &get_mac_list_cmd.dma, 2978 + GFP_ATOMIC); 2980 2979 2981 2980 if (!get_mac_list_cmd.va) { 2982 2981 dev_err(&adapter->pdev->dev, ··· 3050 3047 3051 3048 out: 3052 3049 spin_unlock_bh(&adapter->mcc_lock); 3053 - pci_free_consistent(adapter->pdev, get_mac_list_cmd.size, 3054 - get_mac_list_cmd.va, get_mac_list_cmd.dma); 3050 + dma_free_coherent(&adapter->pdev->dev, get_mac_list_cmd.size, 3051 + get_mac_list_cmd.va, get_mac_list_cmd.dma); 3055 3052 return status; 3056 3053 } 3057 3054 ··· 3104 3101 3105 3102 memset(&cmd, 0, sizeof(struct be_dma_mem)); 3106 3103 cmd.size = sizeof(struct be_cmd_req_set_mac_list); 3107 - cmd.va = dma_alloc_coherent(&adapter->pdev->dev, cmd.size, 3108 - &cmd.dma, GFP_KERNEL); 3104 + cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma, 3105 + GFP_KERNEL); 3109 3106 if (!cmd.va) 3110 3107 return -ENOMEM; 3111 3108 ··· 3294 3291 3295 3292 memset(&cmd, 0, sizeof(struct be_dma_mem)); 3296 3293 cmd.size = sizeof(struct be_cmd_resp_acpi_wol_magic_config_v1); 3297 - cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma); 3294 + cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma, 3295 + GFP_ATOMIC); 3298 3296 if (!cmd.va) { 3299 3297 dev_err(&adapter->pdev->dev, "Memory allocation failure\n"); 3300 3298 status = -ENOMEM; ··· 3330 3326 err: 3331 3327 mutex_unlock(&adapter->mbox_lock); 3332 3328 if (cmd.va) 3333 - pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma); 3329 + dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, 3330 + cmd.dma); 3334 3331 return status; 3335 3332 3336 3333 } ··· 3345 3340 3346 3341 memset(&extfat_cmd, 0, sizeof(struct be_dma_mem)); 3347 3342 extfat_cmd.size = sizeof(struct be_cmd_resp_get_ext_fat_caps); 3348 - extfat_cmd.va = pci_alloc_consistent(adapter->pdev, extfat_cmd.size, 3349 - &extfat_cmd.dma); 3343 + extfat_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, 3344 + extfat_cmd.size, &extfat_cmd.dma, 3345 + GFP_ATOMIC); 3350 3346 if (!extfat_cmd.va) 3351 3347 return -ENOMEM; 3352 3348 ··· 3369 3363 3370 3364 status = be_cmd_set_ext_fat_capabilites(adapter, &extfat_cmd, cfgs); 3371 3365 err: 3372 - pci_free_consistent(adapter->pdev, extfat_cmd.size, extfat_cmd.va, 3373 - extfat_cmd.dma); 3366 + dma_free_coherent(&adapter->pdev->dev, extfat_cmd.size, extfat_cmd.va, 3367 + extfat_cmd.dma); 3374 3368 return status; 3375 3369 } 3376 3370 ··· 3383 3377 3384 3378 memset(&extfat_cmd, 0, sizeof(struct be_dma_mem)); 3385 3379 extfat_cmd.size = sizeof(struct be_cmd_resp_get_ext_fat_caps); 3386 - extfat_cmd.va = pci_alloc_consistent(adapter->pdev, extfat_cmd.size, 3387 - &extfat_cmd.dma); 3380 + extfat_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, 3381 + extfat_cmd.size, &extfat_cmd.dma, 3382 + GFP_ATOMIC); 3388 3383 3389 3384 if (!extfat_cmd.va) { 3390 3385 dev_err(&adapter->pdev->dev, "%s: Memory allocation failure\n", ··· 3403 3396 level = cfgs->module[0].trace_lvl[j].dbg_lvl; 3404 3397 } 3405 3398 } 3406 - pci_free_consistent(adapter->pdev, extfat_cmd.size, extfat_cmd.va, 3407 - extfat_cmd.dma); 3399 + dma_free_coherent(&adapter->pdev->dev, extfat_cmd.size, extfat_cmd.va, 3400 + extfat_cmd.dma); 3408 3401 err: 3409 3402 return level; 3410 3403 } ··· 3602 3595 3603 3596 memset(&cmd, 0, sizeof(struct be_dma_mem)); 3604 3597 cmd.size = sizeof(struct be_cmd_resp_get_func_config); 3605 - cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma); 3598 + cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma, 3599 + GFP_ATOMIC); 3606 3600 if (!cmd.va) { 3607 3601 dev_err(&adapter->pdev->dev, "Memory alloc failure\n"); 3608 3602 status = -ENOMEM; ··· 3643 3635 err: 3644 3636 mutex_unlock(&adapter->mbox_lock); 3645 3637 if (cmd.va) 3646 - pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma); 3638 + dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, 3639 + cmd.dma); 3647 3640 return status; 3648 3641 } 3649 3642 ··· 3665 3656 3666 3657 memset(&cmd, 0, sizeof(struct be_dma_mem)); 3667 3658 cmd.size = sizeof(struct be_cmd_resp_get_profile_config); 3668 - cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma); 3659 + cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma, 3660 + GFP_ATOMIC); 3669 3661 if (!cmd.va) 3670 3662 return -ENOMEM; 3671 3663 ··· 3712 3702 res->vf_if_cap_flags = vf_res->cap_flags; 3713 3703 err: 3714 3704 if (cmd.va) 3715 - pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma); 3705 + dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, 3706 + cmd.dma); 3716 3707 return status; 3717 3708 } 3718 3709 ··· 3728 3717 3729 3718 memset(&cmd, 0, sizeof(struct be_dma_mem)); 3730 3719 cmd.size = sizeof(struct be_cmd_req_set_profile_config); 3731 - cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma); 3720 + cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma, 3721 + GFP_ATOMIC); 3732 3722 if (!cmd.va) 3733 3723 return -ENOMEM; 3734 3724 ··· 3745 3733 status = be_cmd_notify_wait(adapter, &wrb); 3746 3734 3747 3735 if (cmd.va) 3748 - pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma); 3736 + dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, 3737 + cmd.dma); 3749 3738 return status; 3750 3739 } 3751 3740
+10 -8
drivers/net/ethernet/emulex/benet/be_ethtool.c
··· 264 264 int status = 0; 265 265 266 266 read_cmd.size = LANCER_READ_FILE_CHUNK; 267 - read_cmd.va = pci_alloc_consistent(adapter->pdev, read_cmd.size, 268 - &read_cmd.dma); 267 + read_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, read_cmd.size, 268 + &read_cmd.dma, GFP_ATOMIC); 269 269 270 270 if (!read_cmd.va) { 271 271 dev_err(&adapter->pdev->dev, ··· 289 289 break; 290 290 } 291 291 } 292 - pci_free_consistent(adapter->pdev, read_cmd.size, read_cmd.va, 293 - read_cmd.dma); 292 + dma_free_coherent(&adapter->pdev->dev, read_cmd.size, read_cmd.va, 293 + read_cmd.dma); 294 294 295 295 return status; 296 296 } ··· 818 818 }; 819 819 820 820 ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test); 821 - ddrdma_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, ddrdma_cmd.size, 822 - &ddrdma_cmd.dma, GFP_KERNEL); 821 + ddrdma_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, 822 + ddrdma_cmd.size, &ddrdma_cmd.dma, 823 + GFP_KERNEL); 823 824 if (!ddrdma_cmd.va) 824 825 return -ENOMEM; 825 826 ··· 942 941 943 942 memset(&eeprom_cmd, 0, sizeof(struct be_dma_mem)); 944 943 eeprom_cmd.size = sizeof(struct be_cmd_req_seeprom_read); 945 - eeprom_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, eeprom_cmd.size, 946 - &eeprom_cmd.dma, GFP_KERNEL); 944 + eeprom_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, 945 + eeprom_cmd.size, &eeprom_cmd.dma, 946 + GFP_KERNEL); 947 947 948 948 if (!eeprom_cmd.va) 949 949 return -ENOMEM;
+7 -8
drivers/net/ethernet/emulex/benet/be_main.c
··· 4605 4605 4606 4606 flash_cmd.size = sizeof(struct lancer_cmd_req_write_object) 4607 4607 + LANCER_FW_DOWNLOAD_CHUNK; 4608 - flash_cmd.va = dma_alloc_coherent(dev, flash_cmd.size, 4609 - &flash_cmd.dma, GFP_KERNEL); 4608 + flash_cmd.va = dma_zalloc_coherent(dev, flash_cmd.size, 4609 + &flash_cmd.dma, GFP_KERNEL); 4610 4610 if (!flash_cmd.va) 4611 4611 return -ENOMEM; 4612 4612 ··· 4739 4739 } 4740 4740 4741 4741 flash_cmd.size = sizeof(struct be_cmd_write_flashrom); 4742 - flash_cmd.va = dma_alloc_coherent(dev, flash_cmd.size, &flash_cmd.dma, 4743 - GFP_KERNEL); 4742 + flash_cmd.va = dma_zalloc_coherent(dev, flash_cmd.size, &flash_cmd.dma, 4743 + GFP_KERNEL); 4744 4744 if (!flash_cmd.va) 4745 4745 return -ENOMEM; 4746 4746 ··· 5291 5291 int status = 0; 5292 5292 5293 5293 mbox_mem_alloc->size = sizeof(struct be_mcc_mailbox) + 16; 5294 - mbox_mem_alloc->va = dma_alloc_coherent(dev, mbox_mem_alloc->size, 5295 - &mbox_mem_alloc->dma, 5296 - GFP_KERNEL); 5294 + mbox_mem_alloc->va = dma_zalloc_coherent(dev, mbox_mem_alloc->size, 5295 + &mbox_mem_alloc->dma, 5296 + GFP_KERNEL); 5297 5297 if (!mbox_mem_alloc->va) 5298 5298 return -ENOMEM; 5299 5299 5300 5300 mbox_mem_align->size = sizeof(struct be_mcc_mailbox); 5301 5301 mbox_mem_align->va = PTR_ALIGN(mbox_mem_alloc->va, 16); 5302 5302 mbox_mem_align->dma = PTR_ALIGN(mbox_mem_alloc->dma, 16); 5303 - memset(mbox_mem_align->va, 0, sizeof(struct be_mcc_mailbox)); 5304 5303 5305 5304 rx_filter->size = sizeof(struct be_cmd_req_rx_filter); 5306 5305 rx_filter->va = dma_zalloc_coherent(dev, rx_filter->size,
+1
drivers/net/ethernet/intel/i40e/i40e.h
··· 317 317 #endif 318 318 #define I40E_FLAG_PORT_ID_VALID (u64)(1 << 28) 319 319 #define I40E_FLAG_DCB_CAPABLE (u64)(1 << 29) 320 + #define I40E_FLAG_VEB_MODE_ENABLED BIT_ULL(40) 320 321 321 322 /* tracks features that get auto disabled by errors */ 322 323 u64 auto_disable_flags;
+9
drivers/net/ethernet/intel/i40e/i40e_debugfs.c
··· 1021 1021 goto command_write_done; 1022 1022 } 1023 1023 1024 + /* By default we are in VEPA mode, if this is the first VF/VMDq 1025 + * VSI to be added switch to VEB mode. 1026 + */ 1027 + if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) { 1028 + pf->flags |= I40E_FLAG_VEB_MODE_ENABLED; 1029 + i40e_do_reset_safe(pf, 1030 + BIT_ULL(__I40E_PF_RESET_REQUESTED)); 1031 + } 1032 + 1024 1033 vsi = i40e_vsi_setup(pf, I40E_VSI_VMDQ2, vsi_seid, 0); 1025 1034 if (vsi) 1026 1035 dev_info(&pf->pdev->dev, "added VSI %d to relay %d\n",
+31 -4
drivers/net/ethernet/intel/i40e/i40e_main.c
··· 6097 6097 if (ret) 6098 6098 goto end_reconstitute; 6099 6099 6100 + if (pf->flags & I40E_FLAG_VEB_MODE_ENABLED) 6101 + veb->bridge_mode = BRIDGE_MODE_VEB; 6102 + else 6103 + veb->bridge_mode = BRIDGE_MODE_VEPA; 6100 6104 i40e_config_bridge_mode(veb); 6101 6105 6102 6106 /* create the remaining VSIs attached to this VEB */ ··· 8035 8031 } else if (mode != veb->bridge_mode) { 8036 8032 /* Existing HW bridge but different mode needs reset */ 8037 8033 veb->bridge_mode = mode; 8038 - i40e_do_reset(pf, (1 << __I40E_PF_RESET_REQUESTED)); 8034 + /* TODO: If no VFs or VMDq VSIs, disallow VEB mode */ 8035 + if (mode == BRIDGE_MODE_VEB) 8036 + pf->flags |= I40E_FLAG_VEB_MODE_ENABLED; 8037 + else 8038 + pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED; 8039 + i40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED)); 8039 8040 break; 8040 8041 } 8041 8042 } ··· 8352 8343 ctxt.uplink_seid = vsi->uplink_seid; 8353 8344 ctxt.connection_type = I40E_AQ_VSI_CONN_TYPE_NORMAL; 8354 8345 ctxt.flags = I40E_AQ_VSI_TYPE_PF; 8355 - if (i40e_is_vsi_uplink_mode_veb(vsi)) { 8346 + if ((pf->flags & I40E_FLAG_VEB_MODE_ENABLED) && 8347 + (i40e_is_vsi_uplink_mode_veb(vsi))) { 8356 8348 ctxt.info.valid_sections |= 8357 - cpu_to_le16(I40E_AQ_VSI_PROP_SWITCH_VALID); 8349 + cpu_to_le16(I40E_AQ_VSI_PROP_SWITCH_VALID); 8358 8350 ctxt.info.switch_id = 8359 - cpu_to_le16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB); 8351 + cpu_to_le16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB); 8360 8352 } 8361 8353 i40e_vsi_setup_queue_map(vsi, &ctxt, enabled_tc, true); 8362 8354 break; ··· 8755 8745 "%s: New VSI creation error, uplink seid of LAN VSI expected.\n", 8756 8746 __func__); 8757 8747 return NULL; 8748 + } 8749 + /* We come up by default in VEPA mode if SRIOV is not 8750 + * already enabled, in which case we can't force VEPA 8751 + * mode. 8752 + */ 8753 + if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) { 8754 + veb->bridge_mode = BRIDGE_MODE_VEPA; 8755 + pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED; 8758 8756 } 8759 8757 i40e_config_bridge_mode(veb); 8760 8758 } ··· 9874 9856 goto err_switch_setup; 9875 9857 } 9876 9858 9859 + #ifdef CONFIG_PCI_IOV 9860 + /* prep for VF support */ 9861 + if ((pf->flags & I40E_FLAG_SRIOV_ENABLED) && 9862 + (pf->flags & I40E_FLAG_MSIX_ENABLED) && 9863 + !test_bit(__I40E_BAD_EEPROM, &pf->state)) { 9864 + if (pci_num_vf(pdev)) 9865 + pf->flags |= I40E_FLAG_VEB_MODE_ENABLED; 9866 + } 9867 + #endif 9877 9868 err = i40e_setup_pf_switch(pf, false); 9878 9869 if (err) { 9879 9870 dev_info(&pdev->dev, "setup_pf_switch failed: %d\n", err);
+10 -15
drivers/net/ethernet/intel/i40e/i40e_txrx.c
··· 2410 2410 * i40e_chk_linearize - Check if there are more than 8 fragments per packet 2411 2411 * @skb: send buffer 2412 2412 * @tx_flags: collected send information 2413 - * @hdr_len: size of the packet header 2414 2413 * 2415 2414 * Note: Our HW can't scatter-gather more than 8 fragments to build 2416 2415 * a packet on the wire and so we need to figure out the cases where we 2417 2416 * need to linearize the skb. 2418 2417 **/ 2419 - static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags, 2420 - const u8 hdr_len) 2418 + static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags) 2421 2419 { 2422 2420 struct skb_frag_struct *frag; 2423 2421 bool linearize = false; ··· 2427 2429 gso_segs = skb_shinfo(skb)->gso_segs; 2428 2430 2429 2431 if (tx_flags & (I40E_TX_FLAGS_TSO | I40E_TX_FLAGS_FSO)) { 2430 - u16 j = 1; 2432 + u16 j = 0; 2431 2433 2432 2434 if (num_frags < (I40E_MAX_BUFFER_TXD)) 2433 2435 goto linearize_chk_done; ··· 2438 2440 goto linearize_chk_done; 2439 2441 } 2440 2442 frag = &skb_shinfo(skb)->frags[0]; 2441 - size = hdr_len; 2442 2443 /* we might still have more fragments per segment */ 2443 2444 do { 2444 2445 size += skb_frag_size(frag); 2445 2446 frag++; j++; 2447 + if ((size >= skb_shinfo(skb)->gso_size) && 2448 + (j < I40E_MAX_BUFFER_TXD)) { 2449 + size = (size % skb_shinfo(skb)->gso_size); 2450 + j = (size) ? 1 : 0; 2451 + } 2446 2452 if (j == I40E_MAX_BUFFER_TXD) { 2447 - if (size < skb_shinfo(skb)->gso_size) { 2448 - linearize = true; 2449 - break; 2450 - } 2451 - j = 1; 2452 - size -= skb_shinfo(skb)->gso_size; 2453 - if (size) 2454 - j++; 2455 - size += hdr_len; 2453 + linearize = true; 2454 + break; 2456 2455 } 2457 2456 num_frags--; 2458 2457 } while (num_frags); ··· 2719 2724 if (tsyn) 2720 2725 tx_flags |= I40E_TX_FLAGS_TSYN; 2721 2726 2722 - if (i40e_chk_linearize(skb, tx_flags, hdr_len)) 2727 + if (i40e_chk_linearize(skb, tx_flags)) 2723 2728 if (skb_linearize(skb)) 2724 2729 goto out_drop; 2725 2730
+9 -1
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
··· 1018 1018 { 1019 1019 struct i40e_pf *pf = pci_get_drvdata(pdev); 1020 1020 1021 - if (num_vfs) 1021 + if (num_vfs) { 1022 + if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) { 1023 + pf->flags |= I40E_FLAG_VEB_MODE_ENABLED; 1024 + i40e_do_reset_safe(pf, 1025 + BIT_ULL(__I40E_PF_RESET_REQUESTED)); 1026 + } 1022 1027 return i40e_pci_sriov_enable(pdev, num_vfs); 1028 + } 1023 1029 1024 1030 if (!pci_vfs_assigned(pf->pdev)) { 1025 1031 i40e_free_vfs(pf); 1032 + pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED; 1033 + i40e_do_reset_safe(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED)); 1026 1034 } else { 1027 1035 dev_warn(&pdev->dev, "Unable to free VFs because some are assigned to VMs.\n"); 1028 1036 return -EINVAL;
+10 -15
drivers/net/ethernet/intel/i40evf/i40e_txrx.c
··· 1619 1619 * i40e_chk_linearize - Check if there are more than 8 fragments per packet 1620 1620 * @skb: send buffer 1621 1621 * @tx_flags: collected send information 1622 - * @hdr_len: size of the packet header 1623 1622 * 1624 1623 * Note: Our HW can't scatter-gather more than 8 fragments to build 1625 1624 * a packet on the wire and so we need to figure out the cases where we 1626 1625 * need to linearize the skb. 1627 1626 **/ 1628 - static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags, 1629 - const u8 hdr_len) 1627 + static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags) 1630 1628 { 1631 1629 struct skb_frag_struct *frag; 1632 1630 bool linearize = false; ··· 1636 1638 gso_segs = skb_shinfo(skb)->gso_segs; 1637 1639 1638 1640 if (tx_flags & (I40E_TX_FLAGS_TSO | I40E_TX_FLAGS_FSO)) { 1639 - u16 j = 1; 1641 + u16 j = 0; 1640 1642 1641 1643 if (num_frags < (I40E_MAX_BUFFER_TXD)) 1642 1644 goto linearize_chk_done; ··· 1647 1649 goto linearize_chk_done; 1648 1650 } 1649 1651 frag = &skb_shinfo(skb)->frags[0]; 1650 - size = hdr_len; 1651 1652 /* we might still have more fragments per segment */ 1652 1653 do { 1653 1654 size += skb_frag_size(frag); 1654 1655 frag++; j++; 1656 + if ((size >= skb_shinfo(skb)->gso_size) && 1657 + (j < I40E_MAX_BUFFER_TXD)) { 1658 + size = (size % skb_shinfo(skb)->gso_size); 1659 + j = (size) ? 1 : 0; 1660 + } 1655 1661 if (j == I40E_MAX_BUFFER_TXD) { 1656 - if (size < skb_shinfo(skb)->gso_size) { 1657 - linearize = true; 1658 - break; 1659 - } 1660 - j = 1; 1661 - size -= skb_shinfo(skb)->gso_size; 1662 - if (size) 1663 - j++; 1664 - size += hdr_len; 1662 + linearize = true; 1663 + break; 1665 1664 } 1666 1665 num_frags--; 1667 1666 } while (num_frags); ··· 1945 1950 else if (tso) 1946 1951 tx_flags |= I40E_TX_FLAGS_TSO; 1947 1952 1948 - if (i40e_chk_linearize(skb, tx_flags, hdr_len)) 1953 + if (i40e_chk_linearize(skb, tx_flags)) 1949 1954 if (skb_linearize(skb)) 1950 1955 goto out_drop; 1951 1956
+1
lib/rhashtable.c
··· 26 26 #include <linux/random.h> 27 27 #include <linux/rhashtable.h> 28 28 #include <linux/err.h> 29 + #include <linux/export.h> 29 30 30 31 #define HASH_DEFAULT_SIZE 64UL 31 32 #define HASH_MIN_SIZE 4U
+2
net/bridge/br_fdb.c
··· 796 796 int err = 0; 797 797 798 798 if (ndm->ndm_flags & NTF_USE) { 799 + local_bh_disable(); 799 800 rcu_read_lock(); 800 801 br_fdb_update(p->br, p, addr, vid, true); 801 802 rcu_read_unlock(); 803 + local_bh_enable(); 802 804 } else { 803 805 spin_lock_bh(&p->br->hash_lock); 804 806 err = fdb_add_entry(p, addr, ndm->ndm_state,
+2 -9
net/core/dev.c
··· 1718 1718 1719 1719 int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb) 1720 1720 { 1721 - if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) { 1722 - if (skb_copy_ubufs(skb, GFP_ATOMIC)) { 1723 - atomic_long_inc(&dev->rx_dropped); 1724 - kfree_skb(skb); 1725 - return NET_RX_DROP; 1726 - } 1727 - } 1728 - 1729 - if (unlikely(!is_skb_forwardable(dev, skb))) { 1721 + if (skb_orphan_frags(skb, GFP_ATOMIC) || 1722 + unlikely(!is_skb_forwardable(dev, skb))) { 1730 1723 atomic_long_inc(&dev->rx_dropped); 1731 1724 kfree_skb(skb); 1732 1725 return NET_RX_DROP;
+15 -3
net/ipv4/udp.c
··· 90 90 #include <linux/socket.h> 91 91 #include <linux/sockios.h> 92 92 #include <linux/igmp.h> 93 + #include <linux/inetdevice.h> 93 94 #include <linux/in.h> 94 95 #include <linux/errno.h> 95 96 #include <linux/timer.h> ··· 1961 1960 struct sock *sk; 1962 1961 struct dst_entry *dst; 1963 1962 int dif = skb->dev->ifindex; 1963 + int ours; 1964 1964 1965 1965 /* validate the packet */ 1966 1966 if (!pskb_may_pull(skb, skb_transport_offset(skb) + sizeof(struct udphdr))) ··· 1971 1969 uh = udp_hdr(skb); 1972 1970 1973 1971 if (skb->pkt_type == PACKET_BROADCAST || 1974 - skb->pkt_type == PACKET_MULTICAST) 1972 + skb->pkt_type == PACKET_MULTICAST) { 1973 + struct in_device *in_dev = __in_dev_get_rcu(skb->dev); 1974 + 1975 + if (!in_dev) 1976 + return; 1977 + 1978 + ours = ip_check_mc_rcu(in_dev, iph->daddr, iph->saddr, 1979 + iph->protocol); 1980 + if (!ours) 1981 + return; 1975 1982 sk = __udp4_lib_mcast_demux_lookup(net, uh->dest, iph->daddr, 1976 1983 uh->source, iph->saddr, dif); 1977 - else if (skb->pkt_type == PACKET_HOST) 1984 + } else if (skb->pkt_type == PACKET_HOST) { 1978 1985 sk = __udp4_lib_demux_lookup(net, uh->dest, iph->daddr, 1979 1986 uh->source, iph->saddr, dif); 1980 - else 1987 + } else { 1981 1988 return; 1989 + } 1982 1990 1983 1991 if (!sk) 1984 1992 return;
+9 -2
net/ipv6/addrconf_core.c
··· 133 133 free_percpu(idev->stats.ipv6); 134 134 } 135 135 136 + static void in6_dev_finish_destroy_rcu(struct rcu_head *head) 137 + { 138 + struct inet6_dev *idev = container_of(head, struct inet6_dev, rcu); 139 + 140 + snmp6_free_dev(idev); 141 + kfree(idev); 142 + } 143 + 136 144 /* Nobody refers to this device, we may destroy it. */ 137 145 138 146 void in6_dev_finish_destroy(struct inet6_dev *idev) ··· 159 151 pr_warn("Freeing alive inet6 device %p\n", idev); 160 152 return; 161 153 } 162 - snmp6_free_dev(idev); 163 - kfree_rcu(idev, rcu); 154 + call_rcu(&idev->rcu, in6_dev_finish_destroy_rcu); 164 155 } 165 156 EXPORT_SYMBOL(in6_dev_finish_destroy);
+5 -3
net/ipv6/ip6_input.c
··· 212 212 */ 213 213 214 214 rcu_read_lock(); 215 - resubmit: 216 215 idev = ip6_dst_idev(skb_dst(skb)); 217 216 if (!pskb_pull(skb, skb_transport_offset(skb))) 218 217 goto discard; 219 218 nhoff = IP6CB(skb)->nhoff; 220 219 nexthdr = skb_network_header(skb)[nhoff]; 221 220 221 + resubmit: 222 222 raw = raw6_local_deliver(skb, nexthdr); 223 223 ipprot = rcu_dereference(inet6_protos[nexthdr]); 224 224 if (ipprot) { ··· 246 246 goto discard; 247 247 248 248 ret = ipprot->handler(skb); 249 - if (ret > 0) 249 + if (ret < 0) { 250 + nexthdr = -ret; 250 251 goto resubmit; 251 - else if (ret == 0) 252 + } else if (ret == 0) { 252 253 IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_INDELIVERS); 254 + } 253 255 } else { 254 256 if (!raw) { 255 257 if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
+1 -1
net/mpls/af_mpls.c
··· 541 541 542 542 RCU_INIT_POINTER(dev->mpls_ptr, NULL); 543 543 544 - kfree(mdev); 544 + kfree_rcu(mdev, rcu); 545 545 } 546 546 547 547 static int mpls_dev_notify(struct notifier_block *this, unsigned long event,
+1
net/mpls/internal.h
··· 16 16 int input_enabled; 17 17 18 18 struct ctl_table_header *sysctl; 19 + struct rcu_head rcu; 19 20 }; 20 21 21 22 struct sk_buff;
+1
net/openvswitch/vport-netdev.c
··· 125 125 if (err) 126 126 goto error_master_upper_dev_unlink; 127 127 128 + dev_disable_lro(netdev_vport->dev); 128 129 dev_set_promiscuity(netdev_vport->dev, 1); 129 130 netdev_vport->dev->priv_flags |= IFF_OVS_DATAPATH; 130 131 rtnl_unlock();