Summary of changes since 0.26.1 * general driver changes * Use the `__stringify` macro instead of using `#` directly in FM10K_STAT_FIELDS. * Use array_size() when allocating temporary rings for setting the ring size. This prevents possiblye integer overflow that could result in a successful allocation of a small amount, rather than a failed allocation asking for INT_MAX memory. * Remove the ndo_poll_controller support entirely, even for older kernels. This WILL break support for netconsole on very old kernels. * Update the MODULE_LICENSE macro to explicitly indicate "GPL v2", instead of "GPL", clarifying that the code is only released under GPL v2, not "any version of the GPL". * Fix some minor white space differences between this out-of-tree driver and the code we submit to the upstream kernel. * Only re-enable interrupts if napi_complete_done returns true. This reduces CPU utilization when a high interrupt rate is set, because interrupts will not be re-enabled if the driver is about to be polled again. * Do not call pci_cleanup_aer_uncorrect_error_status on new kernels which correctly run error recovery callbacks for all affected drivers. For older kernels, we keep the call so that we still clear the error in case the kernel did not do it for us. * If the kernel supports .reset_prepate and .reset_done, do not also implement the older .reset_notify. This ensures that only one of the reset handler implementations is implemented at a time. * Use struct_size() when allocating the q_vector struct/array, preventing integer overflow. If the ring_count is very large, this will result in a likely failed allocation of INT_MAX, instead of a successful allocation that is far too small and results in a buffer overrun. * Check that the workqueue is actually allocated by alloc_workqueue, preventing a NULL pointer dereference and panic if alloc_workqueue fails. * use netdev_xmit_more() on kernels which support it, instead of trying to access the skb->xmit_more pointer that has been removed. * Pass the netdev pointer to eth_get_headlen on newer kernels which require it. * Remove an unnecessary mmiowb() in fm10k_mask_aer_comp_abort. * For newer kernels which already guarantee I/O ordering for spin locks, remove an unnecessary mmiowb(). For older kernels, we retain the mmiowb() in the hotpath because the wmb() does not guarantee I/O ordering for all platforms. Note that the associated spin lock we depend upon for this to work properly is outside the driver in the networking stack code. * reduce the scope of several local variables, fixing style issues detected by the cppcheck utility. * Cast the page_addr to a `u8 *` pointer before incrementing it. This avoids invoking undefined behavior on incrementing a void pointer. * Remove some unnecessary assignments for local variables which are never read before being assigned. * Explicitly return 0 on the success path for fm10k_handle_resume. * Replace the UNREFERENCED_XPARAMETER macro with the `__always_unused` kernel macro, following conventional Linux style. * Remove reference to NON_Q_VECTORS for builds which do not enable the uio support, avoiding cppcheck warnings about ternary branches which have the same value. * Use dev_get_drvdata on the device pointer instead of calling pci_get_drvdata along with a to_pci_dev call. * Use skb accessor functions to get the skb fragment sizes, supporting new kernels which have replaced the skb_frag_t implementation internals. * Remove unnecessary check for the debugfs_create_dir call. Although the function may not work it is expected that drivers do not change logic based on this, and do not treat it as an error. * Add comments to the IFLA_VF_MAX conditional `#endif` making it easier to associate the correct `#if` with its endif. * Add support for ndo_get_vf_stats, reporting the statistics of the VFs for a given PF. * Remove an unnecessary check for non-NULL before calling dev_kfree_skb, which already checks for NULL. * Use usleep_range instead of usec_delay in all source files * Add missing field initializers to the FM10K_TLV macros * replace UNREFERENCED_XPARAMETER macros with `__always_unused` * Reduce the scope of several local variables, resolving cppcheck style warnings. * Fix the fm10k_get_fault_pf function so that it reports the correct fault address, by properly bitwise OR'ing the low and high registers together. * Remove several unnecessary variable initializers for local variables which are immediately assigned before being read. * Add an array of queue stats to the fm10k_vf_info structure, allowing the PF to track statistics for its VFs. * kernel compatibility improvements * Implement wrapper for ethtool_link_ksettings_del_link_mode * Remove AF_XDP_SUPPORT flag for kernels older than v4.18 * Change HAVE_TCF_EXTS_TO_LIST and add HAVE_TCF_EXTS_FOR_EACH_ACTION * Introduce HAVE_NETPOLL_CONTROLLER define * Define WAKE_FILTER if it doesn't exist * Add definition for SIZE_MAX if it's not available * Add overflow check support for kernels <4.18 * Undefine TC flower support on RHEL7.3 for CPK ice driver * Use BIT() macro throughout kcompat.h for bit definitions * Add CONFIG_RFS_ACCEL to `_COMPAT_CONFIG_KEEP_FLAGS` * Implement skb_get_hash_raw for kernels that define rxhash * Add CONFIG_XDP_SOCKETS kernel flag in kernels >v4.18 * Add HAVE_TCF_BLOCK_CB_REGISTER_EXTACK for RHEL 8.0 * Add NO_NETDEV_BPF_PROG_ATTACHED for RHEL 8.0 * Add HAVE_NETDEV_SB_DEV flag * Fix missing pci func for Ubuntu 14.04 * Add new napi_complete_done with return value * Fix kernel version for skb_get_hash_raw() * Tcp_ip6_spec backported to union ethtool_flow_union in RHEL7.3 * Add HAVE_XDP_SOCK define to kcompat * Enable DDP upload only for modern kernels * Add flag for new parameter to ndo_bridge_setlink * Backport tc_cls_can_offload_and_chain0 function * Fix compat for pci_ari_enabled() * Add flag to wrap pci_cleanup_aer_uncorrect_error_status() * Add support for SLES 15 SP1 Beta1 kernels * Rename is_signed_type in kcompat_overflow.h * Remove unnecessary check against SLE 12 SP4 * Fix HAVE_NDO_SETUP_TC_REMOVE_TC_TO_NETDEV for SLES12sp4 * Add flags for AF_XDP compatibility * Fix definition of HAVE_PCI_ERR_HANDLER_RESET_NOTIFY * Add flags for NAPI_STATE_IN_BUSY_POLL * Backport param_set_ullong for RHEL7.5+ * Add missing backport define for SLE 15 SP1 Beta1 * Add new HAVE_DMA_ALLOC_COHERENT_ZEROES_MEM * Add flag for ndo_fdb_add added in 5.1 kernel * Add list_last_entry() * Define HAVE_TCF_EXTS_FOR_EACH_ACTION for RHEL8.0/SLES15sp1 * Add HAVE_NDO_FDB_ADD_NLATTR flag * Drop extern keyword for function prototypes * Add support for TC_SETUP_MQPRIO in SLES 15 * Add support for TC_SETUP_MQPRIO in SLES12SP4 * Add support for TC_SETUP_MQPRIO in SLES15 kernel 4.12.14-25.25 * Add support for TC_SETUP_MQPRIO in SLES12 kernel 4.12.14-95.x * Add `__diag` macro for controlling GCC diagnostics * Silence -Wformat-nonliteral warning from `do_trace_printk` * Cleanup/fix defines wrapped with ifdef `ETHTOOL_GLINKSETTINGS` * Fix kcompat for tc_cls_flower_offload support * Make SLES15 kernel 4.12.14-25.16 detectable as SLES15 * Add flag for XDP_QUERY_XSK_UMEM removed in kernel 5.1 * Add support for new flow offload flow_rule and flow_match * Add flag for new flow rule infrastructure for 5.1+ * Strip VIRTCHNL_EXT_FEATURES by default * Add macro `__must_be_array` in kernel < 2.6.22 * Remove macro implementation for static analyzer * Add netdev_xmit_more() macro for pre-5.2 kernels * Update kernel versions used to detect SLES15 * Undefine HAVE_XDP_UMEM_PROPS for kernel builds * Add flag for checking if kernel supports PTP_SYS_OFFSET_EXTENDED * Support netdev parameter for eth_get_headlen * Mark RHEL 7.4+ as having tc flower encapsulation support * Add support for backport cls u32 offloads * Add strip/keep flag to remove use of mmiowb() where needed * Add support for `bitmap_[z]alloc` and bitmap_free * Fixed cls u32 compilation error for sles15sp1 and rhel8 * Define time_is_before_jiffies64(a) when needed * Add a flag to detect tc flower encapsulation support * Define netdev_xmit_more to (0) for old kernels * Backport firmware_request_nowarn() introduced in 4.18 and SLES15sp1 * Add time_in_range64() macro for kernels older than 3.11 * Add NETIF_F_GSO_UDP_L4 to `_COMPAT_NETIF_KEEP_FLAGS` * Fix backport of ptp_system_timestamp on RHEL 7.7+ * Fix backport of ptp_system_timestamp on RHEL 8.0 * Verify netdev type of VxLAN and Geneve devices * Add flag to detect tc indirect block notifications support * Add a flag for the new xsk_umem_consume_tx prototype * Correct #ifdefs for backport of ptp_system_timestamp * Fix definition of XSK_UMEM_RETURNS_XDP_DESC * Note that RHEL 7.6 and SLES 15.1 support tc_setup_cb_t * Move where we define HAVE_TCF_BLOCK * Add support for flow_block_cb_setup_simple * Add VIRTCHNL_IPSEC to COMMON_STRIP_FLAGS * Backport additional changes for new flow block API in 5.3 * Backport firmware_request_nowarn() and request_firmware_direct() * Add ktime_get_ts64 and ktime_get_real_ts64 * Backport ktime_get_real_ns and friends * Backport `ktime_get_(real)_ts64` on RHEL 6.8 to 6.10 * Added IS_ETHER_ADDR_EQUAL as strip flag * Add offset accessor functions for skb_frag_t * Backport HAVE_NDO_FDB_ADD_EXTACK for RHEL 8.1 * Correct check for HAVE_PTP_SYS_OFFSET_EXTENDED_IOCTL on RHEL 8.1 * Define HAVE_NDO_BRIDGE_SETLINK_EXTACK for RHEL 8.1+ * RHEL 8.1 kcompat fixes for other drivers * Backport pci_wait_for_pending_transaction() * Backport removed fallback from ndo_select_queue * Re-define `__flow_indr_block_cb_[un]register()` * Add compat for ifla_vf_stats changes * Add CONFIG_MFD_CORE to kernel keep flags * Account for changing num params in dev_open * Add flag for detecting TC_SETUP_CLSU32 * Fix backport of ptp_system_timestamp for RHEL 8.1 * Add flag for ndo_xsk_wakeup support * Add back-port of bitmap_from_u64() * Do not replace dev_consume_skb_any on RHEL 7.2 * Backport dev_consume_skb_irq for old kernels * Check skb pointer in dev_kfree_skb functions