aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
AgeCommit message (Collapse)AuthorFilesLines
2019-09-05net/mlx5e: Use ipv6_stub to avoid dependency with ipv6 being a moduleSaeed Mahameed3-12/+14
mlx5 is dependent on IPv6 tristate since we use ipv6's nd_tbl directly, alternatively we can use ipv6_stub->nd_tbl and remove the dependency. Reported-by: Walter Harms <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Reviewed-by: Vlad Buslov <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2019-09-05net/mlx5: Kconfig: Fix MLX5_CORE dependency with PCI_HYPERV_INTERFACEMao Wenan1-0/+1
When MLX5_CORE=y and PCI_HYPERV_INTERFACE=m, below errors are found: drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function `mlx5e_nic_enable': en_main.c:(.text+0xb649): undefined reference to `mlx5e_hv_vhca_stats_create' drivers/net/ethernet/mellanox/mlx5/core/en_main.o: In function `mlx5e_nic_disable': en_main.c:(.text+0xb8c4): undefined reference to `mlx5e_hv_vhca_stats_destroy' Fix this by making MLX5_CORE imply PCI_HYPERV_INTERFACE. Fixes: cef35af34d6d ("net/mlx5e: Add mlx5e HV VHCA stats agent") Signed-off-by: Mao Wenan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2019-09-05net/mlx5e: Fix static checker warning of potential pointer math issueEran Ben Elisha1-5/+4
Cited patch have an issue in WARN_ON_ONCE check, with wrong address ranges are compared. Fix that by changing pointer types from u64* to void*. This will also make code simpler to read. In addition mlx5e_hv_vhca_fill_ring_stats can get void pointer, so remove the unnecessary casting when calling it. Found by static checker: drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c:41 mlx5e_hv_vhca_fill_stats() warn: potential pointer math issue ('buf' is a u64 pointer) Fixes: cef35af34d6d ("net/mlx5e: Add mlx5e HV VHCA stats agent") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Eran Ben Elisha <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2019-09-05ice: Rework around device/function capabilitiesAnirudh Venkataramanan1-20/+20
ice_parse_caps is printing capabilities in a different way when compared to the variable names. This makes it difficult to search for the right strings in the debug logs. So this patch updates the print strings to be exactly the same as the fields' name in the structure. Signed-off-by: Anirudh Venkataramanan <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: change default number of receive descriptorsJesse Brandeburg1-17/+2
The driver should start out with a reasonable number of descriptors that can prevent drops due to a CPU being in a power management state. Change the default number of descriptors to 2048. The user can always change the value at runtime. Transmit descriptor counts are not modified because they don't need to change due to the speed of the interface, or for power managed CPUs, but the code is simplified to a fixed value for the transmit default. Signed-off-by: Jesse Brandeburg <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: Minor refactor in queue managementAnirudh Venkataramanan4-39/+54
Remove q_left_tx and q_left_rx from the PF struct as these can be obtained by calling ice_get_avail_txq_count and ice_get_avail_rxq_count respectively. The function ice_determine_q_usage is only setting num_lan_tx and num_lan_rx in the PF structure, and these are later assigned to vsi->alloc_txq and vsi->alloc_rxq respectively. This is an unnecessary indirection, so remove ice_determine_q_usage and just assign values for vsi->alloc_txq and vsi->alloc_rxq in ice_vsi_set_num_qs and use these to set num_lan_tx and num_lan_rx respectively. Signed-off-by: Anirudh Venkataramanan <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: Allow for delayed LLDP MIB change registrationDave Ertman5-15/+51
Add an additional boolean parameter to the ice_init_dcb function. This boolean controls if the LLDP MIB change events are registered for. Also, add a new function defined ice_cfg_lldp_mib_change. The additional function is necessary to be able to register for LLDP MIB change events after calling ice_init_dcb. The net effect of these two changes is to allow a delayed registration for MIB change events so that the driver is not accepting events before it is ready for them. Signed-off-by: Dave Ertman <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: update Tx context structAshish Shah2-1/+3
Add internal usage flag, bit 91 as described in spec. Update width of internal queue state to 122 also as described in spec. Signed-off-by: Ashish Shah <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: Report VF link status with opcode to get resourcesAkeem G Abodunrin1-0/+1
This patch changes how and when the driver report link status, instead of waiting till the call to enable queues for VF, we should report link status earlier with opcode to get VF resources - So as to avoid reporting erroneous information, especially when queues have not been configured. In addition, we can also make a call to get and report link status change after when queue is enabled, at least to report netdev or PHY link status. This is in accordance to how link speed is being reported for PF... Signed-off-by: Akeem G Abodunrin <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: Check for DCB capability before initializing DCBAnirudh Venkataramanan2-10/+8
Check the ICE_FLAG_DCB_CAPABLE before calling ice_init_pf_dcb. Signed-off-by: Anirudh Venkataramanan <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: report link down for VF when PF's queues are not enabledLukasz Czapnik1-1/+4
This is port of a fix from i40e commit 2ad1274fa35a ("i40e: don't report link up for a VF who hasn't enabled queues") Older VF drivers do not respond well to receiving a link up notification before queues are enabled. This can cause their state machine to think that it is safe to send traffic. This results in a Tx hang on the VF. Record whether the PF has actually enabled queues for the VF. When reporting link status, always report link down if the queues aren't enabled. In this way, the VF driver will never receive a link up notification until after its queues are enabled. Signed-off-by: Lukasz Czapnik <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: Reliably reset VFsMitch Williams1-6/+10
When a PFR (or bigger reset) occurs, the device clears the VF_MBX_ARQLEN register for all VFs. But if a VFR is triggered by a VF, the device does NOT clear this register, and the VF driver will never see the reset. When this happens, the VF driver will eventually timeout and attempt recovery, and usually it will be successful. But this makes resets take a long time and there are occasional failures. We cannot just blithely clear this register on every reset; this has been shown to cause synchronization problems when a PFR is triggered with a large number of VFs. Fix this by clearing VF_MBX_ARQLEN when the reset source is not PFR. GlobR will trigger PFR, so this test catches that occurrence as well. Signed-off-by: Mitch Williams <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: change work limit to a constantJesse Brandeburg3-16/+3
The driver has supported a transmit work limit that was configurable from ethtool for a long time, but there are no good use cases for having it be a variable that can be changed at run time. In addition, this variable was noted to be causing performance overhead due to cache misses. Just remove the variable and let the code use a constant so that the functionality is maintained (a limit on the number of transmits that will be cleaned in any one call to the clean routines) without the cache miss. Removes code, removes a variable, removes testing surface. Yay. Signed-off-by: Jesse Brandeburg <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: small efficiency fixesJesse Brandeburg1-1/+3
Add a small bit of efficiency to the code by adding a prefetch of the port_info structure in order to help avoid a cache miss a little later on in execution. Also add an unlikely statement to a branch which generally will never happen in normal operation. Signed-off-by: Jesse Brandeburg <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: move code closer togetherJesse Brandeburg1-3/+3
This is a simple patch to move the assignment to a local variable closer to the site where the local variable is used. This can help readability and also maybe performance, although the performance enhancement is really dependent upon the compiler. No functional change. Signed-off-by: Jesse Brandeburg <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: clean up argumentsJesse Brandeburg1-22/+21
There are a couple of functions that don't need two arguments passed in when the second argument already had access to the pointer pointed to by the first. Remove the unnecessary arguments. Signed-off-by: Jesse Brandeburg <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: Check root pointer for validityAnirudh Venkataramanan1-1/+1
ice_sched_get_tc_node uses pi->root without checking for NULL. Add a check to prevent NULL pointer dereference. Signed-off-by: Anirudh Venkataramanan <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: Add ice_get_main_vsi to get PF/main VSIAnirudh Venkataramanan2-16/+10
There are multiple places where we currently use ice_find_vsi_by_type to get the PF (a.k.a. main) VSI. The PF VSI by definition is always the first element in the pf->vsi array (i.e. pf->vsi[0]). So instead add and use a new helper function ice_get_main_vsi, which just returns pf->vsi[0]. Signed-off-by: Anirudh Venkataramanan <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ice: Update fields in ice_vsi_set_num_qs when reconfiguringBrett Creeley1-1/+1
Currently when vsi->req_txqs or vsi->req_rxqs are set we don't correctly set the number of vsi->num_q_vectors. Fix this by setting the number of queue vectors based on the max between the vsi->alloc_txqs and vsi->alloc_rxqs. Signed-off-by: Brett Creeley <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2019-09-05ixgbe: fix xdp handle calculationsKevin Laatz1-3/+4
Currently, we don't add headroom to the handle in ixgbe_zca_free, ixgbe_alloc_buffer_slow_zc and ixgbe_alloc_buffer_zc. The addition of the headroom to the handle was removed in commit d8c3061e5edd ("ixgbe: modify driver for handling offsets"), which will break things when headroom isvnon-zero. This patch fixes this and uses xsk_umem_adjust_offset to add it appropritely based on the mode being run. Fixes: d8c3061e5edd ("ixgbe: modify driver for handling offsets") Reported-by: Bjorn Topel <[email protected]> Signed-off-by: Kevin Laatz <[email protected]> Acked-by: Björn Töpel <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
2019-09-05i40e: fix xdp handle calculationsKevin Laatz1-3/+4
Currently, we don't add headroom to the handle in i40e_zca_free, i40e_alloc_buffer_slow_zc and i40e_alloc_buffer_zc. The addition of the headroom to the handle was removed in commit 2f86c806a8a8 ("i40e: modify driver for handling offsets"), which will break things when headroom is non-zero. This patch fixes this and uses xsk_umem_adjust_offset to add it appropritely based on the mode being run. Fixes: 2f86c806a8a8 ("i40e: modify driver for handling offsets") Reported-by: Bjorn Topel <[email protected]> Signed-off-by: Kevin Laatz <[email protected]> Acked-by: Björn Töpel <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
2019-09-05net: hns: Move static keyword to the front of declarationKrzysztof Wilczynski1-1/+1
Move the static keyword to the front of declaration of g_dsaf_mode_match, and resolve the following compiler warning that can be seen when building with warnings enabled (W=1): drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:27:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration] Signed-off-by: Krzysztof Wilczynski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: qed: Move static keyword to the front of declarationKrzysztof Wilczynski1-1/+1
Move the static keyword to the front of declaration of iwarp_state_names, and resolve the following compiler warning that can be seen when building with warnings enabled (W=1): drivers/net/ethernet/qlogic/qed/qed_iwarp.c:385:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration] Also, resolve checkpatch.pl script warning: WARNING: static const char * array should probably be static const char * const Signed-off-by: Krzysztof Wilczynski <[email protected]> Acked-by: Michal Kalderon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05gianfar: use DT more consistently when selecting PHY connection typeArseny Solokha1-10/+9
Historically, gianfar only used phy-connection-type DT property when connected to PHY in the rgmii-id mode. It ignored the property otherwise, relying on the connection type auto-detection carried out by MAC and providing that reconstructed mode to of_phy_connect(). It also did not consider alternative phy-mode property at all. Make the driver properly query DT node for PHY connection type first and use an obtained value if it was specified there. Otherwise, if a particular DT relies on connection type auto-detection, fall back to reconstructing the value from MAC registers, as before. Signed-off-by: Arseny Solokha <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05gianfar: cleanup gianfar.hArseny Solokha1-38/+0
Remove now unused macro and structure definitions from gianfar.h that have accumulated there over time. Signed-off-by: Arseny Solokha <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05gianfar: make five functions staticArseny Solokha1-5/+6
Make functions that do not have callers outside the translation unit they are defined in static. Signed-off-by: Arseny Solokha <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05gianfar: remove forward declarationsArseny Solokha3-1408/+1347
Remove forward declarations of various static functions located in two driver implementation files and rearrange the corresponding definitions accordingly. This patch only introduces mechanical changes, namely it removes forward declarations and moves function definitions around; it does not change any functionality. Signed-off-by: Arseny Solokha <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: selftests: Add Jumbo Frame testsJose Abreu1-3/+62
Add a test to validate the Jumbo Frame support in stmmac in single channel and multichannel mode. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: xgmac: Enable RX Jumbo frame supportJose Abreu2-12/+2
We are already doing it by default in the TX path so we can also enable Jumbo Frame support in the RX path independently of MTU value. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: Correctly assing MAX MTU in XGMAC cores caseJose Abreu1-3/+3
Maximum MTU for XGMAC cores is 16k thus the check for presence of XGMAC shall be done first in order to assign correct value. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: xgmac: Correct RAVSEL field interpretationJose Abreu1-1/+1
RAVSEL means that only RX side is available for AVB features. As we use both TX and RX features we need to check if RAVSEL is selected and disable AVB if only RX side is available. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: ethtool: Let user configure TX coalesce without RIWTJose Abreu1-12/+9
When RX Watchdog is disabled its currently not possible to configure TX coalesce settings. Let user configure it anyway. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: Only consider RX error when HW Timestamping is not enabledJose Abreu1-1/+2
Only consider that we have an error when HW Timestamping is not enabled as this can give false positives due to the fact the RX Timestamping in XGMAC and GMAC cores comes from context descriptors. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: selftests: Implement the ARP Offload testJose Abreu1-0/+110
Implement a test for ARP Offload feature. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: xgmac: Implement ARP OffloadJose Abreu4-0/+22
Implement the ARP Offload feature in XGMAC cores. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: selftests: Add selftest for L3/L4 FiltersJose Abreu1-1/+285
Adds the selftests for L3 and L4 filters with DA/SA/DP/SP support. Changes from v1: - Reduce stack usage (kbuild test robot) Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: Implement L3/L4 Filters using TC FlowerJose Abreu8-2/+488
Implement filters for Layer 3 and Layer 4 using TC Flower API. Add the corresponding callbacks in XGMAC core. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: Do not return error code in TC InitializationJose Abreu1-1/+2
As we can still use the remaining TC callbacks, e.g. CBS. We should not fail in the initialization only because RX Parser is not available. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: xgmac: Add RBU handling in DMA interruptJose Abreu1-0/+4
Add the handling of Receive Buffer Unavailable interrupt in the DMA handler of XGMAC cores. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05net: stmmac: selftests: Return proper error code to userspaceJose Abreu1-11/+11
We can do better than just return 1 to userspace. Lets return a proper Linux error code. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05rocker: add missing init_net check in FIB notifierJiri Pirko1-0/+3
Take only FIB events that are happening in init_net into account. No other namespaces are supported. Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05ixgbe: Use kzfree() rather than its implementation.zhong jiang1-6/+3
Use kzfree() instead of memset() + kfree(). Signed-off-by: zhong jiang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05ionic: Add coalesce and other featuresShannon Nelson5-3/+166
Interrupt coalescing, tunable copybreak value, and tx timeout. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05ionic: Add RSS supportShannon Nelson3-0/+165
Add code to manipulate through ethtool the RSS configuration used by the NIC. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05ionic: Add driver statsShannon Nelson5-2/+480
Add in the detailed statistics for ethtool -S that the driver keeps as it processes packets. Display of the additional debug statistics can be enabled through the ethtool priv-flags feature. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05ionic: Add netdev-event handlingShannon Nelson2-0/+64
When the netdev gets a new name from userland, pass that name down to the NIC for internal tracking. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05ionic: Add Tx and Rx handlingShannon Nelson5-1/+1408
Add both the Tx and Rx queue setup and handling. The related stats display comes later. Instead of using the generic napi routines used by the slow-path commands, the Tx and Rx paths are simplified and inlined in one file in order to get better compiler optimizations. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05ionic: Add initial ethtool supportShannon Nelson6-1/+519
Add in the basic ethtool callbacks for device information and control. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05ionic: Add async link status check and basic statsShannon Nelson2-6/+111
Add code to handle the link status event, and wire up the basic netdev hardware stats. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-09-05ionic: Add Rx filter and rx_mode ndo supportShannon Nelson2-6/+423
Add the Rx filtering and rx_mode NDO callbacks. Also add the deferred work thread handling needed to manage the filter requests outside of the netif_addr_lock spinlock. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>