summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40e/i40e_common.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-11-01 10:58:10 -0400
committerDavid S. Miller <davem@davemloft.net>2016-11-01 10:58:10 -0400
commitc5870942fc20a879ba47e23d6a18a2d0b7b02c7c (patch)
treeb008512f6679b52e1c48854024029658db246714 /drivers/net/ethernet/intel/i40e/i40e_common.c
parentbd68a2a854ad5a85f0c8d0a9c8048ca3f6391efb (diff)
parent3aa7b74dbeedfb32406fec70cfd76d797209e8c9 (diff)
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 40GbE Intel Wired LAN Driver Updates 2016-10-31 This series contains updates to i40e and i40evf. Colin Ian King fixes a minor issue with dev_err message where a new line character was missing from the end of the message. Jake provides several most of the changes in the series, starting with dropping the is_vf and is_netdev fields in the i40e_mac_filter structure since they are not needed (along with the checks that used these fields). Reason being that we use separate VSI's for SRIOV VFs and for netdev VSIs, therefore a single VSI should only have one type of filter. Then simplifies our .set_rx_mode handler by using the kernel provided __dev_uc_sync and __dev_mc_sync functions for notification of add and deletion of filters. Refactored the i40e_put_mac_in_vlan() to resolve an issue where this function was arbitrarily modifying all filters to have the same VLAN, which is incorrect because it could be modifying active filters without putting them into the new state. Refactored the delete filter logic so that we can re-use the functionality, where appropriate, without having to search for the filter twice. Reduced the latency of operations related to searching for specific MAC filters by using a static hash table instead of a list. Reduced code duplication in the adminq command to add/delete for filters. Fixed an issue where TSYNVALID bit was not being checked as the true indicator of whether the packet has an associated timestamp. Cleaned up a second msleep() call by simply re-ordering the code so that the extra wait is no longer needed. Alan provides additional fix to the work Jake has been doing to resolve a bug where adding at least one VLAN and then removing all VLANs leaves the MAC filters for the VSI with an incorrect value for the VID which indicates the MAC filter's VLAN status. Alex adds a common method for finding a VSI by type. Also cleaned up the logic for coalescing RS bits, which was convoluted and larger than it needed to be. Mitch fixes an issue with the failure to add filters when the VF driver is reloaded by simply setting the number of filters to 0 when freeing VF resources. Maciej implements a I40E_NVMUPD_STATE_ERROR state for NVM update, so that the driver has the ability to return NVM image write failure. Filip removes unreachable code which was found using static analysis where "if" statements were never in a "true/false" state, so clean up unnecessary if statements. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/i40e/i40e_common.c')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_common.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index a47594603d69..98791ba57211 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -3313,8 +3313,10 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
/* partition id is 1-based, and functions are evenly spread
* across the ports as partitions
*/
- hw->partition_id = (hw->pf_id / hw->num_ports) + 1;
- hw->num_partitions = num_functions / hw->num_ports;
+ if (hw->num_ports != 0) {
+ hw->partition_id = (hw->pf_id / hw->num_ports) + 1;
+ hw->num_partitions = num_functions / hw->num_ports;
+ }
/* additional HW specific goodies that might
* someday be HW version specific