aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel
AgeCommit message (Collapse)AuthorFilesLines
2020-05-19igc: Refactor ethertype filtering codeAndre Guedes3-61/+103
The whole ethertype filtering code is implemented in igc_ethtool.c and mixes logic from ethtool and core parts. This patch refactors it so core logic is moved to igc_main.c, aligning the ethertype filtering code organization with the rest of the filtering code from the driver (MAC address and VLAN priority). Besides moving code to igc_main.c, this patch also does some minor improvements to the code. Below are some highlights. In case all filters are already in use and the user tries to add another filter, we return -ENOSPC instead of -EINVAL so a more meaningful error code is provided. This also aligns with the behavior implemented in MAC address filtering code. With this code refactoring, 'etype_bitmap' array in struct igc_adapter and 'etype_reg_index' in struct igc_nfc_filter are not needed anymore and are removed. Log messages are added to help debugging the ethertype filtering code. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-19igc: Fix MAX_ETYPE_FILTER valueAndre Guedes1-1/+1
The I225 controller has 8 ethertype filters, not 4. This patch fixes the MAX_ETYPE_FILTER macro accordingly. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-19igc: Remove ethertype filter in PTP codeAndre Guedes3-16/+1
The driver only supports hardware timestamping for all incoming traffic (HWTSTAMP_FILTER_ALL) which is enabled via Rx Time Sync Control (TSYNCRXCTL) register already. Therefore, the ethertype filter set in in igc_ptp_set_timestamp_mode() is useless so this patch removes it. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-19igc: Remove duplicated IGC_RXPBS macroAndre Guedes1-2/+0
This patch remove the IGC_RXPBS macro defined in line 233 since it is already defined in line 18 with the exactly same value. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-19igc: Refactor VLAN priority filtering codeAndre Guedes3-51/+68
The whole VLAN priority filtering code is implemented in igc_ethtool.c and mixes logic from ethtool and core parts. This patch refactors it so core logic is moved to igc_main.c, aligning the VLAN priority filtering code organization with the MAC address filtering code. This patch also takes the opportunity to add some log messages to ease debugging. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-19igc: Return -EOPNOTSUPP when VLAN mask doesn't matchAndre Guedes1-1/+2
The I225 controller supports Rx queue assignment based on VLAN priority only. Other Tag Control Information (TCI) are valid, but not supported by the driver. So this patch changes the returning code from igc_add_ ethtool_nfc_entry() to -EOPNOTSUPP in order to provide more meaningful information on why the function failed. It also adds a debug messages to give the user a hint about what went wrong with the NFC setup. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-19igc: Dump VLANPQF registerAndre Guedes1-0/+2
This patch adds the VLAN Priority Queue Filter Register (VLANPQF) to the list of registers dumped by igc_get_regs(). Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-19igc: Rename IGC_VLAPQF macroAndre Guedes3-16/+15
This patch renames the IGC_VLAPQF macro to IGC_VLANPQF as well as related macros so they match the register name and fields described in the data sheet. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-19igc: Clean up obsolete NVM definesSasha Neftin1-5/+0
Packet buffer allocation, reserved word and pointer guard not applicable for i225 parts. This patch comes to clean up these obsolete defines Signed-off-by: Sasha Neftin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-19igc: remove IGC_REMOVED functionVitaly Lifshits3-9/+1
igc driver has leftovers from the previous device that supported Virtualization. This can be found in the function IGC_REMOVED which became obsolete, and can be removed. Signed-off-by: Vitaly Lifshits <[email protected]> Acked-by: Sasha Neftin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-19igc: Remove PCIe Control registerSasha Neftin1-3/+0
GCR (PCIe Control) register not in use and should be removed This patch clean up this register Signed-off-by: Sasha Neftin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-18igc: Remove unneeded registerSasha Neftin1-1/+0
Flow control status register not applicable for i225 parts so clean up the unneeded define. Signed-off-by: Sasha Neftin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-18igc: Remove unneeded definitionSasha Neftin1-1/+0
PHY_FORCE_LIMIT definition not in use and could be removed i225 parts support auto negotiation mechanism Signed-off-by: Sasha Neftin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-18igc: Use netdev log helpers in igc_base.cAndre Guedes1-3/+3
This patch coverts one pr_debug() call to hw_dbg() in order to keep log output aligned with the rest of the driver. hw_dbg() is actually a macro defined in igc_hw.h that expands to netdev_dbg(). Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-18igc: Use netdev log helpers in igc_dump.cAndre Guedes1-55/+54
In igc_dump.c we print log messages using dev_* and pr_* helpers, generating inconsistent output with the rest of the driver. Since this is a network device driver, we should preferably use netdev_* helpers because they append the interface name to the message, helping making sense out of the logs. This patch converts all dev_* and pr_* calls to netdev_*. Quick note about igc_rings_dump(): This function is always called with valid adapter->netdev so there is not need to check it. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-18igc: Use netdev log helpers in igc_ptp.cAndre Guedes1-7/+5
In igc_ptp.c we print log messages using dev_* helpers, generating inconsistent output with the rest of the driver. Since this is a network device driver, we should preferably use netdev_* helpers because they append the interface name to the message, helping making sense out of the logs. This patch converts all dev_* calls to netdev_*. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-18igc: Use netdev log helpers in igc_ethtool.cAndre Guedes1-20/+21
In igc_ethtool.c we print log messages using dev_* helpers, generating inconsistent output with the rest of the driver. Since this is a network device driver, we should preferably use netdev_* helpers because they append the interface name to the message, helping making sense the of the logs. This patch converts all dev_* calls to netdev_*. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-18igc: add support to eeprom, registers and link self-testsVitaly Lifshits7-3/+285
Introduced igc_diag.c and igc_diag.h, these files have the diagnostics functionality of igc driver. For the time being these files are being used by ethtool self-test callbacks. Which mean that eeprom, registers and link self-tests for ethtool were implemented. Signed-off-by: Vitaly Lifshits <[email protected]> Reported-by: kbuild test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-18igc: Use netdev log helpers in igc_main.cAndre Guedes1-61/+50
In igc_main.c we print log messages using both dev_* and netdev_* helpers, generating inconsistent output. Since this is a network device driver, we should preferably use netdev_* helpers because they append the interface name to the message, helping making sense out of the logs. This patch converts all dev_* calls to netdev_*. There is only two exceptions: 1) calls wihtin igc_probe (net_device has not been registered yet) 2) calls in igc_init_module (module initialization). It also takes this opportunity to improve some messages. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-18igc: Add ECN support for TSOSasha Neftin1-0/+1
Align with other Intel drivers and add ECN support for TSO. Add NETIF_F_TSO_ECN flag Signed-off-by: Sasha Neftin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-05-14xdp: For Intel AF_XDP drivers add XDP frame_szJesper Dangaard Brouer3-0/+6
Intel drivers implement native AF_XDP zerocopy in separate C-files, that have its own invocation of bpf_prog_run_xdp(). The setup of xdp_buff is also handled in separately from normal code path. This patch update XDP frame_sz for AF_XDP zerocopy drivers i40e, ice and ixgbe, as the code changes needed are very similar. Introduce a helper function xsk_umem_xdp_frame_sz() for calculating frame size. Signed-off-by: Jesper Dangaard Brouer <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Björn Töpel <[email protected]> Cc: [email protected] Cc: Magnus Karlsson <[email protected]> Link: https://lore.kernel.org/bpf/158945347511.97035.8536753731329475655.stgit@firesoul
2020-05-14ice: Add XDP frame size to driverJesper Dangaard Brouer1-9/+25
This driver uses different memory models depending on PAGE_SIZE at compile time. For PAGE_SIZE 4K it uses page splitting, meaning for normal MTU frame size is 2048 bytes (and headroom 192 bytes). For larger MTUs the driver still use page splitting, by allocating order-1 pages (8192 bytes) for RX frames. For PAGE_SIZE larger than 4K, driver instead advance its rx_buffer->page_offset with the frame size "truesize". For XDP frame size calculations, this mean that in PAGE_SIZE larger than 4K mode the frame_sz change on a per packet basis. For the page split 4K PAGE_SIZE mode, xdp.frame_sz is more constant and can be updated once outside the main NAPI loop. The default setting in the driver uses build_skb(), which provides the necessary headroom and tailroom for XDP-redirect in RX-frame (in both modes). There is one complication, which is legacy-rx mode (configurable via ethtool priv-flags). There are zero headroom in this mode, which is a requirement for XDP-redirect to work. The conversion to xdp_frame (convert_to_xdp_frame) will detect this insufficient space, and xdp_do_redirect() call will fail. This is deemed acceptable, as it allows other XDP actions to still work in legacy-mode. In legacy-mode + larger PAGE_SIZE due to lacking tailroom, we also accept that xdp_adjust_tail shrink doesn't work. Signed-off-by: Jesper Dangaard Brouer <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: Jeff Kirsher <[email protected]> Cc: Alexander Duyck <[email protected]> Link: https://lore.kernel.org/bpf/158945347002.97035.328088795813704587.stgit@firesoul
2020-05-14i40e: Add XDP frame size to driverJesper Dangaard Brouer1-5/+25
This driver uses different memory models depending on PAGE_SIZE at compile time. For PAGE_SIZE 4K it uses page splitting, meaning for normal MTU frame size is 2048 bytes (and headroom 192 bytes). For larger MTUs the driver still use page splitting, by allocating order-1 pages (8192 bytes) for RX frames. For PAGE_SIZE larger than 4K, driver instead advance its rx_buffer->page_offset with the frame size "truesize". For XDP frame size calculations, this mean that in PAGE_SIZE larger than 4K mode the frame_sz change on a per packet basis. For the page split 4K PAGE_SIZE mode, xdp.frame_sz is more constant and can be updated once outside the main NAPI loop. The default setting in the driver uses build_skb(), which provides the necessary headroom and tailroom for XDP-redirect in RX-frame (in both modes). There is one complication, which is legacy-rx mode (configurable via ethtool priv-flags). There are zero headroom in this mode, which is a requirement for XDP-redirect to work. The conversion to xdp_frame (convert_to_xdp_frame) will detect this insufficient space, and xdp_do_redirect() call will fail. This is deemed acceptable, as it allows other XDP actions to still work in legacy-mode. In legacy-mode + larger PAGE_SIZE due to lacking tailroom, we also accept that xdp_adjust_tail shrink doesn't work. Signed-off-by: Jesper Dangaard Brouer <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: Jeff Kirsher <[email protected]> Cc: Alexander Duyck <[email protected]> Link: https://lore.kernel.org/bpf/158945346494.97035.12809400414566061815.stgit@firesoul
2020-05-14ixgbevf: Add XDP frame size to VF driverJesper Dangaard Brouer1-7/+27
This patch mirrors the changes to ixgbe in previous patch. This VF driver doesn't support XDP_REDIRECT, but correct tailroom is still necessary for BPF-helper xdp_adjust_tail. In legacy-mode + larger PAGE_SIZE, due to lacking tailroom, we accept that xdp_adjust_tail shrink doesn't work. Signed-off-by: Jesper Dangaard Brouer <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: Jeff Kirsher <[email protected]> Cc: Alexander Duyck <[email protected]> Link: https://lore.kernel.org/bpf/158945345984.97035.13518286183248025173.stgit@firesoul
2020-05-14ixgbe: Add XDP frame size to driverJesper Dangaard Brouer1-8/+26
This driver uses different memory models depending on PAGE_SIZE at compile time. For PAGE_SIZE 4K it uses page splitting, meaning for normal MTU frame size is 2048 bytes (and headroom 192 bytes). For larger MTUs the driver still use page splitting, by allocating order-1 pages (8192 bytes) for RX frames. For PAGE_SIZE larger than 4K, driver instead advance its rx_buffer->page_offset with the frame size "truesize". For XDP frame size calculations, this mean that in PAGE_SIZE larger than 4K mode the frame_sz change on a per packet basis. For the page split 4K PAGE_SIZE mode, xdp.frame_sz is more constant and can be updated once outside the main NAPI loop. The default setting in the driver uses build_skb(), which provides the necessary headroom and tailroom for XDP-redirect in RX-frame (in both modes). There is one complication, which is legacy-rx mode (configurable via ethtool priv-flags). There are zero headroom in this mode, which is a requirement for XDP-redirect to work. The conversion to xdp_frame (convert_to_xdp_frame) will detect this insufficient space, and xdp_do_redirect() call will fail. This is deemed acceptable, as it allows other XDP actions to still work in legacy-mode. In legacy-mode + larger PAGE_SIZE due to lacking tailroom, we also accept that xdp_adjust_tail shrink doesn't work. Signed-off-by: Jesper Dangaard Brouer <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: Jeff Kirsher <[email protected]> Cc: Alexander Duyck <[email protected]> Link: https://lore.kernel.org/bpf/158945345455.97035.14334355929030628741.stgit@firesoul
2020-05-14ixgbe: Fix XDP redirect on archs with PAGE_SIZE above 4KJesper Dangaard Brouer1-1/+2
The ixgbe driver have another memory model when compiled on archs with PAGE_SIZE above 4096 bytes. In this mode it doesn't split the page in two halves, but instead increment rx_buffer->page_offset by truesize of packet (which include headroom and tailroom for skb_shared_info). This is done correctly in ixgbe_build_skb(), but in ixgbe_rx_buffer_flip which is currently only called on XDP_TX and XDP_REDIRECT, it forgets to add the tailroom for skb_shared_info. This breaks XDP_REDIRECT, for veth and cpumap. Fix by adding size of skb_shared_info tailroom. Maintainers notice: This fix have been queued to Jeff. Fixes: 6453073987ba ("ixgbe: add initial support for xdp redirect") Signed-off-by: Jesper Dangaard Brouer <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Cc: Jeff Kirsher <[email protected]> Link: https://lore.kernel.org/bpf/158945344946.97035.17031588499266605743.stgit@firesoul
2020-05-02Merge back system-wide PM material for v5.8.Rafael J. Wysocki3-3/+3
2020-04-30ice: Fix error return code in ice_add_prof()Wei Yongjun1-1/+3
Fix to return a error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 31ad4e4ee1e4 ("ice: Allocate flow profile") Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-04-25Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netDavid S. Miller2-3/+3
Simple overlapping changes to linux/vermagic.h Signed-off-by: David S. Miller <[email protected]>
2020-04-24PM: sleep: core: Rename DPM_FLAG_NEVER_SKIPRafael J. Wysocki3-3/+3
Rename DPM_FLAG_NEVER_SKIP to DPM_FLAG_NO_DIRECT_COMPLETE which matches its purpose more closely. No functional impact. Suggested-by: Alan Stern <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> # for PCI parts Acked-by: Jeff Kirsher <[email protected]> Acked-by: Alan Stern <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Acked-by: Alex Deucher <[email protected]>
2020-04-21e1000: remove unneeded conversion to boolJason Yan1-1/+1
The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: drivers/net/ethernet/intel/e1000/e1000_main.c:1479:44-49: WARNING: conversion to bool not needed here Signed-off-by: Jason Yan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-04-21i40e: Remove unneeded conversion to boolJason Yan1-2/+2
The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: drivers/net/ethernet/intel/i40e/i40e_main.c:1614:52-57: WARNING: conversion to bool not needed here drivers/net/ethernet/intel/i40e/i40e_main.c:11439:52-57: WARNING: conversion to bool not needed here Signed-off-by: Jason Yan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-04-19igc: Add debug messages to MAC filter codeAndre Guedes1-2/+22
This patch adds log messages to functions related to the MAC address filtering code to ease debugging. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19igc: Refactor igc_del_mac_filter()Andre Guedes1-26/+19
This patch does a code refactoring in igc_del_mac_filter() so it uses the new helper igc_find_mac_filter() and improves the comment about the special handling when deleting the default filter. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19igc: Refactor igc_mac_entry_can_be_used()Andre Guedes1-33/+47
The helper igc_mac_entry_can_be_used() implementation is a bit convoluted since it does two different things: find a not-in-use slot in mac_table or find an in-use slot where the address and address type match. This patch does a code refactoring and break it up into two helper functions. With this patch we might traverse mac_table twice in some situations, but this is not harmful performance-wise (mac_table has only 16 entries and adding mac filters is not hot-path), and it improves igc_add_mac_ filter() readability considerably. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19igc: Remove igc_*_mac_steering_filter() wrappersAndre Guedes3-32/+16
With the previous two patches, igc_add_mac_steering_filter() and igc_del_mac_steering_filter() became a pointless wrapper of igc_add_mac_filter() and igc_del_mac_filter(). This patch removes these wrappers and update callers to call igc_add_mac_filter() and igc_del_mac_filter() directly. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19igc: Remove IGC_MAC_STATE_QUEUE_STEERINGAndre Guedes2-15/+20
The IGC_MAC_STATE_QUEUE_STEERING bit in mac_table[i].state is utilized to indicate that frames matching the filter are assigned to mac_table[i].queue. This bit is not strictly necessary since we can convey the same information as follows: queue == -1 means queue assignment is disabled, otherwise it is enabled. In addition to make the code simpler, this change fixes some awkward situations where we pass a complete misleading 'queue' value such as in igc_uc_sync(). So this patch removes IGC_MAC_STATE_QUEUE_STEERING and also takes the opportunity to improve the igc_add_mac_filter documentation. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19igc: Remove 'queue' check in igc_del_mac_filter()Andre Guedes1-14/+11
igc_add_mac_filter() doesn't allow us to have more than one entry with the same address and address type in adapter->mac_table so checking if 'queue' matches in igc_del_mac_filter() isn't necessary. This patch removes that check. This patch also takes the opportunity to improve the igc_del_mac_filter documentation and remove comment which is not applicable to this I225 controller. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19igc: Improve address check in igc_del_mac_filter()Andre Guedes1-1/+1
igc_add_mac_filter() doesn't allow filters with invalid MAC address to be added to adapter->mac_table so, in igc_del_mac_filter(), we can early return if MAC address is invalid. No need to traverse the table. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19igc: Refactor igc_rar_set_index()Andre Guedes1-31/+42
Current igc_rar_set_index() implementation is a bit convoluted so this patch does some code refactoring to improve it. The helper igc_rar_set_index() is about writing MAC filter settings into hardware registers. Logic such as address validation belongs to functions upper in the call chain such as igc_set_mac() and igc_add_mac_filter(). So this patch moves the is_valid_ether_addr() call to igc_add_mac_filter(). No need to touch igc_set_mac() since it already checks it. The variables 'rar_low' and 'rar_high' represent the value in registers RAL and RAH so we rename them to 'ral' and 'rah', respectively, to match the registers names. To make it explicit, filter settings are passed as arguments to the function instead of reading them from adapter->mac_table "under the hood". Also, the function was renamed to igc_set_mac_filter_hw to make it more clear what it does. Finally, the patch removes some wrfl() calls and comments not needed. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19igc: Fix igc_uc_unsync()Andre Guedes1-3/+1
In case igc_del_mac_filter() returns error, that error is masked since the functions always return 0 (success). This patch fixes igc_uc_unsync() so it returns whatever value igc_del_mac_filter() returns (0 on success, negative number on error). Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19igc: Change igc_add_mac_filter() returning valueAndre Guedes2-7/+2
In case of success, igc_add_mac_filter() returns the index in adapter->mac_table where the requested filter was added. This information, however, is not used by any caller of that function. In fact, callers have extra code just to handle this returning index as 0 (success). So this patch changes the function to return 0 on success instead, and cleans up the extra code. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19igc: Check unsupported flag in igc_add_mac_filter()Andre Guedes1-0/+2
The IGC_MAC_STATE_SRC_ADDR flags is not supported by igc_add_mac_ filter() so this patch adds a check for it and returns -ENOTSUPP in case it is set. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19igc: Remove duplicate code in MAC filtering logicAndre Guedes1-99/+13
This patch does a code refactoring in the MAC address filtering logic to get rid of some duplicate code. IGC driver has two functions to add MAC address filters that are pretty much the same: igc_add_mac_filter() and igc_add_mac_filter_flags(). The only difference is that the latter allows the callee to specify the 'flags' parameter while the former has it hard coded as zero. The same rationale applies to filter deletion counterparts. So this patch refactors igc_add_mac_filter() and igc_del_mac_filter() so they handle the 'flags' parameters, removes the _flags() functions, and fixes callees accordingly. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19e1000e: fix S0ix flows for cable connected caseVitaly Lifshits2-0/+57
Added a fix to S0ix entry and exit flows for TGP and above MAC types, to the case when the Ethernet cable is connected and the link is up. With that the system is able to reach SLP_S0 when going to freeze power state. Signed-off-by: Vitaly Lifshits <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-19igc: Add new device IDs for i225 partSasha Neftin3-0/+9
Add new device IDs for the next step of i225 Signed-off-by: Sasha Neftin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-17igc: Fix default MAC address filter overrideAndre Guedes1-0/+2
This patch fixes a bug when the user adds the first MAC address filter via ethtool NFC mechanism. When the first MAC address filter is added, it overwrites the default MAC address filter configured at RAL[0] and RAH[0]. As consequence, frames addressed to the interface MAC address are not sent to host anymore. This patch fixes the bug by calling igc_set_default_mac_filter() during adapter init so the position 0 of adapter->mac_table[] is assigned to the default MAC address. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-17igc: Remove dead code related to flower filterAndre Guedes2-4/+0
IGC driver has no support for tc-flower filters so this patch removes some leftover code, probably copied from IGB driver by mistake. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-17igc: Fix NFC queue redirection supportAndre Guedes2-4/+12
The support for ethtool Network Flow Classification (NFC) queue redirection based on destination MAC address is currently broken in IGC. For instance, if we add the following rule, matching frames aren't enqueued on the expected rx queue. $ ethtool -N IFNAME flow-type ether dst 3c:fd:fe:9e:7f:71 queue 2 The issue here is due to the fact that igc_rar_set_index() is missing code to enable the queue selection feature from Receive Address High (RAH) register. This patch adds the missing code and fixes the issue. Signed-off-by: Andre Guedes <[email protected]> Acked-by: Sasha Neftin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2020-04-17igc: Remove copper fiber switch controlSasha Neftin2-11/+0
i225 device support copper mode only PHY signal detect indication for copper fiber switch not applicable to i225 part Signed-off-by: Sasha Neftin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>