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

Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2018-10-31

This series contains a various collection of fixes.

Miroslav Lichvar from Red Hat or should I say IBM now? Updates the PHC
timecounter interval for igb so that it gets updated at least once
every 550 seconds.

Ngai-Mint provides a fix for fm10k to prevent a soft lockup or system
crash by adding a new condition to determine if the SM mailbox is in the
correct state before proceeding.

Jake provides several fm10k fixes, first one marks complier aborts as
non-fatal since on some platforms trigger machine check errors when the
compile aborts. Added missing device ids to the in-kernel driver. Due
to the recent fixes, bumped the driver version.

I (Jeff Kirsher) fixed a XFRM_ALGO dependency for both ixgbe and
ixgbevf. This fix was based on the original work from Arnd Bergmann,
which only fixed ixgbe.

Mitch provides a fix for i40e/avf to update the status codes, which
resolves an issue between a mis-match between i40e and the iavf driver,
which also supports the ice LAN driver.

Radoslaw fixes the ixgbe where the driver is logging a message about
spoofed packets detected when the VF is re-started with a different MAC
address.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+85 -41
+18
drivers/net/ethernet/intel/Kconfig
··· 200 200 201 201 If unsure, say N. 202 202 203 + config IXGBE_IPSEC 204 + bool "IPSec XFRM cryptography-offload acceleration" 205 + depends on IXGBE 206 + depends on XFRM_OFFLOAD 207 + default y 208 + select XFRM_ALGO 209 + ---help--- 210 + Enable support for IPSec offload in ixgbe.ko 211 + 203 212 config IXGBEVF 204 213 tristate "Intel(R) 10GbE PCI Express Virtual Function Ethernet support" 205 214 depends on PCI_MSI ··· 225 216 To compile this driver as a module, choose M here. The module 226 217 will be called ixgbevf. MSI-X interrupt support is required 227 218 for this driver to work correctly. 219 + 220 + config IXGBEVF_IPSEC 221 + bool "IPSec XFRM cryptography-offload acceleration" 222 + depends on IXGBEVF 223 + depends on XFRM_OFFLOAD 224 + default y 225 + select XFRM_ALGO 226 + ---help--- 227 + Enable support for IPSec offload in ixgbevf.ko 228 228 229 229 config I40E 230 230 tristate "Intel(R) Ethernet Controller XL710 Family support"
+30 -21
drivers/net/ethernet/intel/fm10k/fm10k_iov.c
··· 244 244 } 245 245 246 246 /* guarantee we have free space in the SM mailbox */ 247 - if (!hw->mbx.ops.tx_ready(&hw->mbx, FM10K_VFMBX_MSG_MTU)) { 247 + if (hw->mbx.state == FM10K_STATE_OPEN && 248 + !hw->mbx.ops.tx_ready(&hw->mbx, FM10K_VFMBX_MSG_MTU)) { 248 249 /* keep track of how many times this occurs */ 249 250 interface->hw_sm_mbx_full++; 250 251 ··· 303 302 } 304 303 } 305 304 305 + static void fm10k_mask_aer_comp_abort(struct pci_dev *pdev) 306 + { 307 + u32 err_mask; 308 + int pos; 309 + 310 + pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR); 311 + if (!pos) 312 + return; 313 + 314 + /* Mask the completion abort bit in the ERR_UNCOR_MASK register, 315 + * preventing the device from reporting these errors to the upstream 316 + * PCIe root device. This avoids bringing down platforms which upgrade 317 + * non-fatal completer aborts into machine check exceptions. Completer 318 + * aborts can occur whenever a VF reads a queue it doesn't own. 319 + */ 320 + pci_read_config_dword(pdev, pos + PCI_ERR_UNCOR_MASK, &err_mask); 321 + err_mask |= PCI_ERR_UNC_COMP_ABORT; 322 + pci_write_config_dword(pdev, pos + PCI_ERR_UNCOR_MASK, err_mask); 323 + 324 + mmiowb(); 325 + } 326 + 306 327 int fm10k_iov_resume(struct pci_dev *pdev) 307 328 { 308 329 struct fm10k_intfc *interface = pci_get_drvdata(pdev); ··· 339 316 /* return error if iov_data is not already populated */ 340 317 if (!iov_data) 341 318 return -ENOMEM; 319 + 320 + /* Lower severity of completer abort error reporting as 321 + * the VFs can trigger this any time they read a queue 322 + * that they don't own. 323 + */ 324 + fm10k_mask_aer_comp_abort(pdev); 342 325 343 326 /* allocate hardware resources for the VFs */ 344 327 hw->iov.ops.assign_resources(hw, num_vfs, num_vfs); ··· 489 460 fm10k_iov_free_data(pdev); 490 461 } 491 462 492 - static void fm10k_disable_aer_comp_abort(struct pci_dev *pdev) 493 - { 494 - u32 err_sev; 495 - int pos; 496 - 497 - pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR); 498 - if (!pos) 499 - return; 500 - 501 - pci_read_config_dword(pdev, pos + PCI_ERR_UNCOR_SEVER, &err_sev); 502 - err_sev &= ~PCI_ERR_UNC_COMP_ABORT; 503 - pci_write_config_dword(pdev, pos + PCI_ERR_UNCOR_SEVER, err_sev); 504 - } 505 - 506 463 int fm10k_iov_configure(struct pci_dev *pdev, int num_vfs) 507 464 { 508 465 int current_vfs = pci_num_vf(pdev); ··· 510 495 511 496 /* allocate VFs if not already allocated */ 512 497 if (num_vfs && num_vfs != current_vfs) { 513 - /* Disable completer abort error reporting as 514 - * the VFs can trigger this any time they read a queue 515 - * that they don't own. 516 - */ 517 - fm10k_disable_aer_comp_abort(pdev); 518 - 519 498 err = pci_enable_sriov(pdev, num_vfs); 520 499 if (err) { 521 500 dev_err(&pdev->dev,
+1 -1
drivers/net/ethernet/intel/fm10k/fm10k_main.c
··· 11 11 12 12 #include "fm10k.h" 13 13 14 - #define DRV_VERSION "0.23.4-k" 14 + #define DRV_VERSION "0.26.1-k" 15 15 #define DRV_SUMMARY "Intel(R) Ethernet Switch Host Interface Driver" 16 16 const char fm10k_driver_version[] = DRV_VERSION; 17 17 char fm10k_driver_name[] = "fm10k";
+2
drivers/net/ethernet/intel/fm10k/fm10k_pci.c
··· 23 23 */ 24 24 static const struct pci_device_id fm10k_pci_tbl[] = { 25 25 { PCI_VDEVICE(INTEL, FM10K_DEV_ID_PF), fm10k_device_pf }, 26 + { PCI_VDEVICE(INTEL, FM10K_DEV_ID_SDI_FM10420_QDA2), fm10k_device_pf }, 27 + { PCI_VDEVICE(INTEL, FM10K_DEV_ID_SDI_FM10420_DA2), fm10k_device_pf }, 26 28 { PCI_VDEVICE(INTEL, FM10K_DEV_ID_VF), fm10k_device_vf }, 27 29 /* required last entry */ 28 30 { 0, }
+2
drivers/net/ethernet/intel/fm10k/fm10k_type.h
··· 15 15 16 16 #define FM10K_DEV_ID_PF 0x15A4 17 17 #define FM10K_DEV_ID_VF 0x15A5 18 + #define FM10K_DEV_ID_SDI_FM10420_QDA2 0x15D0 19 + #define FM10K_DEV_ID_SDI_FM10420_DA2 0x15D5 18 20 19 21 #define FM10K_MAX_QUEUES 256 20 22 #define FM10K_MAX_QUEUES_PF 128
+1 -1
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
··· 3674 3674 dev_err(&pf->pdev->dev, "Invalid message from VF %d, opcode %d, len %d\n", 3675 3675 local_vf_id, v_opcode, msglen); 3676 3676 switch (ret) { 3677 - case VIRTCHNL_ERR_PARAM: 3677 + case VIRTCHNL_STATUS_ERR_PARAM: 3678 3678 return -EPERM; 3679 3679 default: 3680 3680 return -EINVAL;
+7 -1
drivers/net/ethernet/intel/igb/igb_ptp.c
··· 51 51 * 52 52 * The 40 bit 82580 SYSTIM overflows every 53 53 * 2^40 * 10^-9 / 60 = 18.3 minutes. 54 + * 55 + * SYSTIM is converted to real time using a timecounter. As 56 + * timecounter_cyc2time() allows old timestamps, the timecounter 57 + * needs to be updated at least once per half of the SYSTIM interval. 58 + * Scheduling of delayed work is not very accurate, so we aim for 8 59 + * minutes to be sure the actual interval is shorter than 9.16 minutes. 54 60 */ 55 61 56 - #define IGB_SYSTIM_OVERFLOW_PERIOD (HZ * 60 * 9) 62 + #define IGB_SYSTIM_OVERFLOW_PERIOD (HZ * 60 * 8) 57 63 #define IGB_PTP_TX_TIMEOUT (HZ * 15) 58 64 #define INCPERIOD_82576 BIT(E1000_TIMINCA_16NS_SHIFT) 59 65 #define INCVALUE_82576_MASK GENMASK(E1000_TIMINCA_16NS_SHIFT - 1, 0)
+1 -1
drivers/net/ethernet/intel/ixgbe/Makefile
··· 17 17 ixgbe-$(CONFIG_IXGBE_HWMON) += ixgbe_sysfs.o 18 18 ixgbe-$(CONFIG_DEBUG_FS) += ixgbe_debugfs.o 19 19 ixgbe-$(CONFIG_FCOE:m=y) += ixgbe_fcoe.o 20 - ixgbe-$(CONFIG_XFRM_OFFLOAD) += ixgbe_ipsec.o 20 + ixgbe-$(CONFIG_IXGBE_IPSEC) += ixgbe_ipsec.o
+4 -4
drivers/net/ethernet/intel/ixgbe/ixgbe.h
··· 769 769 #define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */ 770 770 u32 *rss_key; 771 771 772 - #ifdef CONFIG_XFRM_OFFLOAD 772 + #ifdef CONFIG_IXGBE_IPSEC 773 773 struct ixgbe_ipsec *ipsec; 774 - #endif /* CONFIG_XFRM_OFFLOAD */ 774 + #endif /* CONFIG_IXGBE_IPSEC */ 775 775 776 776 /* AF_XDP zero-copy */ 777 777 struct xdp_umem **xsk_umems; ··· 1008 1008 void ixgbe_store_reta(struct ixgbe_adapter *adapter); 1009 1009 s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg, 1010 1010 u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm); 1011 - #ifdef CONFIG_XFRM_OFFLOAD 1011 + #ifdef CONFIG_IXGBE_IPSEC 1012 1012 void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter); 1013 1013 void ixgbe_stop_ipsec_offload(struct ixgbe_adapter *adapter); 1014 1014 void ixgbe_ipsec_restore(struct ixgbe_adapter *adapter); ··· 1036 1036 u32 *mbuf, u32 vf) { return -EACCES; } 1037 1037 static inline int ixgbe_ipsec_vf_del_sa(struct ixgbe_adapter *adapter, 1038 1038 u32 *mbuf, u32 vf) { return -EACCES; } 1039 - #endif /* CONFIG_XFRM_OFFLOAD */ 1039 + #endif /* CONFIG_IXGBE_IPSEC */ 1040 1040 #endif /* _IXGBE_H_ */
+3 -3
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
··· 8694 8694 8695 8695 #endif /* IXGBE_FCOE */ 8696 8696 8697 - #ifdef CONFIG_XFRM_OFFLOAD 8697 + #ifdef CONFIG_IXGBE_IPSEC 8698 8698 if (skb->sp && !ixgbe_ipsec_tx(tx_ring, first, &ipsec_tx)) 8699 8699 goto out_drop; 8700 8700 #endif ··· 10190 10190 * the TSO, so it's the exception. 10191 10191 */ 10192 10192 if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID)) { 10193 - #ifdef CONFIG_XFRM_OFFLOAD 10193 + #ifdef CONFIG_IXGBE_IPSEC 10194 10194 if (!skb->sp) 10195 10195 #endif 10196 10196 features &= ~NETIF_F_TSO; ··· 10883 10883 if (hw->mac.type >= ixgbe_mac_82599EB) 10884 10884 netdev->features |= NETIF_F_SCTP_CRC; 10885 10885 10886 - #ifdef CONFIG_XFRM_OFFLOAD 10886 + #ifdef CONFIG_IXGBE_IPSEC 10887 10887 #define IXGBE_ESP_FEATURES (NETIF_F_HW_ESP | \ 10888 10888 NETIF_F_HW_ESP_TX_CSUM | \ 10889 10889 NETIF_F_GSO_ESP)
+3 -1
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
··· 722 722 ixgbe_set_vmvir(adapter, vfinfo->pf_vlan, 723 723 adapter->default_up, vf); 724 724 725 - if (vfinfo->spoofchk_enabled) 725 + if (vfinfo->spoofchk_enabled) { 726 726 hw->mac.ops.set_vlan_anti_spoofing(hw, true, vf); 727 + hw->mac.ops.set_mac_anti_spoofing(hw, true, vf); 728 + } 727 729 } 728 730 729 731 /* reset multicast table array for vf */
+1 -1
drivers/net/ethernet/intel/ixgbevf/Makefile
··· 10 10 mbx.o \ 11 11 ethtool.o \ 12 12 ixgbevf_main.o 13 - ixgbevf-$(CONFIG_XFRM_OFFLOAD) += ipsec.o 13 + ixgbevf-$(CONFIG_IXGBEVF_IPSEC) += ipsec.o 14 14
+2 -2
drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
··· 459 459 460 460 extern void ixgbevf_write_eitr(struct ixgbevf_q_vector *q_vector); 461 461 462 - #ifdef CONFIG_XFRM_OFFLOAD 462 + #ifdef CONFIG_IXGBEVF_IPSEC 463 463 void ixgbevf_init_ipsec_offload(struct ixgbevf_adapter *adapter); 464 464 void ixgbevf_stop_ipsec_offload(struct ixgbevf_adapter *adapter); 465 465 void ixgbevf_ipsec_restore(struct ixgbevf_adapter *adapter); ··· 482 482 struct ixgbevf_tx_buffer *first, 483 483 struct ixgbevf_ipsec_tx_data *itd) 484 484 { return 0; } 485 - #endif /* CONFIG_XFRM_OFFLOAD */ 485 + #endif /* CONFIG_IXGBEVF_IPSEC */ 486 486 487 487 void ixgbe_napi_add_all(struct ixgbevf_adapter *adapter); 488 488 void ixgbe_napi_del_all(struct ixgbevf_adapter *adapter);
+1 -1
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
··· 4150 4150 first->tx_flags = tx_flags; 4151 4151 first->protocol = vlan_get_protocol(skb); 4152 4152 4153 - #ifdef CONFIG_XFRM_OFFLOAD 4153 + #ifdef CONFIG_IXGBEVF_IPSEC 4154 4154 if (skb->sp && !ixgbevf_ipsec_tx(tx_ring, first, &ipsec_tx)) 4155 4155 goto out_drop; 4156 4156 #endif
+9 -3
include/linux/avf/virtchnl.h
··· 62 62 /* Error Codes */ 63 63 enum virtchnl_status_code { 64 64 VIRTCHNL_STATUS_SUCCESS = 0, 65 - VIRTCHNL_ERR_PARAM = -5, 65 + VIRTCHNL_STATUS_ERR_PARAM = -5, 66 + VIRTCHNL_STATUS_ERR_NO_MEMORY = -18, 66 67 VIRTCHNL_STATUS_ERR_OPCODE_MISMATCH = -38, 67 68 VIRTCHNL_STATUS_ERR_CQP_COMPL_ERROR = -39, 68 69 VIRTCHNL_STATUS_ERR_INVALID_VF_ID = -40, 69 - VIRTCHNL_STATUS_NOT_SUPPORTED = -64, 70 + VIRTCHNL_STATUS_ERR_ADMIN_QUEUE_ERROR = -53, 71 + VIRTCHNL_STATUS_ERR_NOT_SUPPORTED = -64, 70 72 }; 73 + 74 + /* Backward compatibility */ 75 + #define VIRTCHNL_ERR_PARAM VIRTCHNL_STATUS_ERR_PARAM 76 + #define VIRTCHNL_STATUS_NOT_SUPPORTED VIRTCHNL_STATUS_ERR_NOT_SUPPORTED 71 77 72 78 #define VIRTCHNL_LINK_SPEED_100MB_SHIFT 0x1 73 79 #define VIRTCHNL_LINK_SPEED_1000MB_SHIFT 0x2 ··· 837 831 case VIRTCHNL_OP_EVENT: 838 832 case VIRTCHNL_OP_UNKNOWN: 839 833 default: 840 - return VIRTCHNL_ERR_PARAM; 834 + return VIRTCHNL_STATUS_ERR_PARAM; 841 835 } 842 836 /* few more checks */ 843 837 if (err_msg_format || valid_len != msglen)
-1
net/xfrm/Kconfig
··· 8 8 9 9 config XFRM_OFFLOAD 10 10 bool 11 - depends on XFRM 12 11 13 12 config XFRM_ALGO 14 13 tristate