Skip to content

Commit c215dae

Browse files
committed
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 10GbE Intel Wired LAN Driver Updates 2018-01-09 This series contains updates to ixgbe and ixgbevf only. Emil fixes an issue with "wake on LAN"(WoL) where we need to ensure we enable the reception of multicast packets so that WoL works for IPv6 magic packets. Cleaned up code no longer needed with the update to adaptive ITR. Paul update the driver to advertise the highest capable link speed when a module gets inserted. Also extended the displaying of firmware version to include the iSCSI and OEM block in the EEPROM to better identify firmware versions/images. Tonghao Zhang cleans up a code comment that no longer applies since InterruptThrottleRate has been removed from the driver. Alex fixes SR-IOV and MACVLAN offload interaction, where the MACVLAN offload was incorrectly configuring several filters with the wrong pool value which resulted in MACLVAN interfaces not being able to receive traffic that had to pass over the physical interface. Fixed transmit hangs and dropped receive frames when the number of VFs changed. Added support for RSS on MACVLAN pools for X550 devices. Fixed up the MACVLAN limitations so we can now support 63 offloaded devices. Cleaned up MACVLAN code that is no longer needed with the recent changes and fixes. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 61ad640 + 68ae742 commit c215dae

File tree

10 files changed

+298
-177
lines changed

10 files changed

+298
-177
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ struct ixgbe_ring {
333333
struct net_device *netdev; /* netdev ring belongs to */
334334
struct bpf_prog *xdp_prog;
335335
struct device *dev; /* device for DMA mapping */
336-
struct ixgbe_fwd_adapter *l2_accel_priv;
337336
void *desc; /* descriptor ring memory */
338337
union {
339338
struct ixgbe_tx_buffer *tx_buffer_info;
@@ -397,8 +396,7 @@ enum ixgbe_ring_f_enum {
397396
#define MAX_XDP_QUEUES (IXGBE_MAX_FDIR_INDICES + 1)
398397
#define IXGBE_MAX_L2A_QUEUES 4
399398
#define IXGBE_BAD_L2A_QUEUE 3
400-
#define IXGBE_MAX_MACVLANS 31
401-
#define IXGBE_MAX_DCBMACVLANS 8
399+
#define IXGBE_MAX_MACVLANS 63
402400

403401
struct ixgbe_ring_feature {
404402
u16 limit; /* upper limit on feature indices */
@@ -723,8 +721,7 @@ struct ixgbe_adapter {
723721

724722
u16 bridge_mode;
725723

726-
u16 eeprom_verh;
727-
u16 eeprom_verl;
724+
char eeprom_id[NVM_VER_SIZE];
728725
u16 eeprom_cap;
729726

730727
u32 interrupt_event;
@@ -768,7 +765,8 @@ struct ixgbe_adapter {
768765
#endif /*CONFIG_DEBUG_FS*/
769766

770767
u8 default_up;
771-
unsigned long fwd_bitmask; /* Bitmask indicating in use pools */
768+
/* Bitmask indicating in use pools */
769+
DECLARE_BITMAP(fwd_bitmask, IXGBE_MAX_MACVLANS + 1);
772770

773771
#define IXGBE_MAX_LINK_HANDLE 10
774772
struct ixgbe_jump_table *jump_tables[IXGBE_MAX_LINK_HANDLE];

drivers/net/ethernet/intel/ixgbe/ixgbe_common.c

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4028,6 +4028,118 @@ s32 ixgbe_init_thermal_sensor_thresh_generic(struct ixgbe_hw *hw)
40284028
return 0;
40294029
}
40304030

4031+
/**
4032+
* ixgbe_get_orom_version - Return option ROM from EEPROM
4033+
*
4034+
* @hw: pointer to hardware structure
4035+
* @nvm_ver: pointer to output structure
4036+
*
4037+
* if valid option ROM version, nvm_ver->or_valid set to true
4038+
* else nvm_ver->or_valid is false.
4039+
**/
4040+
void ixgbe_get_orom_version(struct ixgbe_hw *hw,
4041+
struct ixgbe_nvm_version *nvm_ver)
4042+
{
4043+
u16 offset, eeprom_cfg_blkh, eeprom_cfg_blkl;
4044+
4045+
nvm_ver->or_valid = false;
4046+
/* Option Rom may or may not be present. Start with pointer */
4047+
hw->eeprom.ops.read(hw, NVM_OROM_OFFSET, &offset);
4048+
4049+
/* make sure offset is valid */
4050+
if (offset == 0x0 || offset == NVM_INVALID_PTR)
4051+
return;
4052+
4053+
hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_HI, &eeprom_cfg_blkh);
4054+
hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_LOW, &eeprom_cfg_blkl);
4055+
4056+
/* option rom exists and is valid */
4057+
if ((eeprom_cfg_blkl | eeprom_cfg_blkh) == 0x0 ||
4058+
eeprom_cfg_blkl == NVM_VER_INVALID ||
4059+
eeprom_cfg_blkh == NVM_VER_INVALID)
4060+
return;
4061+
4062+
nvm_ver->or_valid = true;
4063+
nvm_ver->or_major = eeprom_cfg_blkl >> NVM_OROM_SHIFT;
4064+
nvm_ver->or_build = (eeprom_cfg_blkl << NVM_OROM_SHIFT) |
4065+
(eeprom_cfg_blkh >> NVM_OROM_SHIFT);
4066+
nvm_ver->or_patch = eeprom_cfg_blkh & NVM_OROM_PATCH_MASK;
4067+
}
4068+
4069+
/**
4070+
* ixgbe_get_oem_prod_version Etrack ID from EEPROM
4071+
*
4072+
* @hw: pointer to hardware structure
4073+
* @nvm_ver: pointer to output structure
4074+
*
4075+
* if valid OEM product version, nvm_ver->oem_valid set to true
4076+
* else nvm_ver->oem_valid is false.
4077+
**/
4078+
void ixgbe_get_oem_prod_version(struct ixgbe_hw *hw,
4079+
struct ixgbe_nvm_version *nvm_ver)
4080+
{
4081+
u16 rel_num, prod_ver, mod_len, cap, offset;
4082+
4083+
nvm_ver->oem_valid = false;
4084+
hw->eeprom.ops.read(hw, NVM_OEM_PROD_VER_PTR, &offset);
4085+
4086+
/* Return is offset to OEM Product Version block is invalid */
4087+
if (offset == 0x0 && offset == NVM_INVALID_PTR)
4088+
return;
4089+
4090+
/* Read product version block */
4091+
hw->eeprom.ops.read(hw, offset, &mod_len);
4092+
hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_CAP_OFF, &cap);
4093+
4094+
/* Return if OEM product version block is invalid */
4095+
if (mod_len != NVM_OEM_PROD_VER_MOD_LEN ||
4096+
(cap & NVM_OEM_PROD_VER_CAP_MASK) != 0x0)
4097+
return;
4098+
4099+
hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_L, &prod_ver);
4100+
hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_H, &rel_num);
4101+
4102+
/* Return if version is invalid */
4103+
if ((rel_num | prod_ver) == 0x0 ||
4104+
rel_num == NVM_VER_INVALID || prod_ver == NVM_VER_INVALID)
4105+
return;
4106+
4107+
nvm_ver->oem_major = prod_ver >> NVM_VER_SHIFT;
4108+
nvm_ver->oem_minor = prod_ver & NVM_VER_MASK;
4109+
nvm_ver->oem_release = rel_num;
4110+
nvm_ver->oem_valid = true;
4111+
}
4112+
4113+
/**
4114+
* ixgbe_get_etk_id - Return Etrack ID from EEPROM
4115+
*
4116+
* @hw: pointer to hardware structure
4117+
* @nvm_ver: pointer to output structure
4118+
*
4119+
* word read errors will return 0xFFFF
4120+
**/
4121+
void ixgbe_get_etk_id(struct ixgbe_hw *hw,
4122+
struct ixgbe_nvm_version *nvm_ver)
4123+
{
4124+
u16 etk_id_l, etk_id_h;
4125+
4126+
if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_LOW, &etk_id_l))
4127+
etk_id_l = NVM_VER_INVALID;
4128+
if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_HI, &etk_id_h))
4129+
etk_id_h = NVM_VER_INVALID;
4130+
4131+
/* The word order for the version format is determined by high order
4132+
* word bit 15.
4133+
*/
4134+
if ((etk_id_h & NVM_ETK_VALID) == 0) {
4135+
nvm_ver->etk_id = etk_id_h;
4136+
nvm_ver->etk_id |= (etk_id_l << NVM_ETK_SHIFT);
4137+
} else {
4138+
nvm_ver->etk_id = etk_id_l;
4139+
nvm_ver->etk_id |= (etk_id_h << NVM_ETK_SHIFT);
4140+
}
4141+
}
4142+
40314143
void ixgbe_disable_rx_generic(struct ixgbe_hw *hw)
40324144
{
40334145
u32 rxctrl;

drivers/net/ethernet/intel/ixgbe/ixgbe_common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ extern const u32 ixgbe_mvals_8259X[IXGBE_MVALS_IDX_LIMIT];
139139

140140
s32 ixgbe_get_thermal_sensor_data_generic(struct ixgbe_hw *hw);
141141
s32 ixgbe_init_thermal_sensor_thresh_generic(struct ixgbe_hw *hw);
142+
void ixgbe_get_etk_id(struct ixgbe_hw *hw,
143+
struct ixgbe_nvm_version *nvm_ver);
144+
void ixgbe_get_oem_prod_version(struct ixgbe_hw *hw,
145+
struct ixgbe_nvm_version *nvm_ver);
146+
void ixgbe_get_orom_version(struct ixgbe_hw *hw,
147+
struct ixgbe_nvm_version *nvm_ver);
142148
void ixgbe_disable_rx_generic(struct ixgbe_hw *hw);
143149
void ixgbe_enable_rx_generic(struct ixgbe_hw *hw);
144150
s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,16 +1014,13 @@ static void ixgbe_get_drvinfo(struct net_device *netdev,
10141014
struct ethtool_drvinfo *drvinfo)
10151015
{
10161016
struct ixgbe_adapter *adapter = netdev_priv(netdev);
1017-
u32 nvm_track_id;
10181017

10191018
strlcpy(drvinfo->driver, ixgbe_driver_name, sizeof(drvinfo->driver));
10201019
strlcpy(drvinfo->version, ixgbe_driver_version,
10211020
sizeof(drvinfo->version));
10221021

1023-
nvm_track_id = (adapter->eeprom_verh << 16) |
1024-
adapter->eeprom_verl;
1025-
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "0x%08x",
1026-
nvm_track_id);
1022+
strlcpy(drvinfo->fw_version, adapter->eeprom_id,
1023+
sizeof(drvinfo->fw_version));
10271024

10281025
strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
10291026
sizeof(drvinfo->bus_info));

drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,11 +1034,8 @@ int ixgbe_fcoe_get_hbainfo(struct net_device *netdev,
10341034
ixgbe_driver_name,
10351035
ixgbe_driver_version);
10361036
/* Firmware Version */
1037-
snprintf(info->firmware_version,
1038-
sizeof(info->firmware_version),
1039-
"0x%08x",
1040-
(adapter->eeprom_verh << 16) |
1041-
adapter->eeprom_verl);
1037+
strlcpy(info->firmware_version, adapter->eeprom_id,
1038+
sizeof(info->firmware_version));
10421039

10431040
/* Model */
10441041
if (hw->mac.type == ixgbe_mac_82599EB) {

drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ static bool ixgbe_set_dcb_sriov_queues(struct ixgbe_adapter *adapter)
350350
if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED))
351351
return false;
352352

353+
/* limit VMDq instances on the PF by number of Tx queues */
354+
vmdq_i = min_t(u16, vmdq_i, MAX_TX_QUEUES / tcs);
355+
353356
/* Add starting offset to total pool count */
354357
vmdq_i += adapter->ring_feature[RING_F_VMDQ].offset;
355358

@@ -512,20 +515,22 @@ static bool ixgbe_set_sriov_queues(struct ixgbe_adapter *adapter)
512515
#ifdef IXGBE_FCOE
513516
u16 fcoe_i = 0;
514517
#endif
515-
bool pools = (find_first_zero_bit(&adapter->fwd_bitmask, 32) > 1);
516518

517519
/* only proceed if SR-IOV is enabled */
518520
if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED))
519521
return false;
520522

523+
/* limit l2fwd RSS based on total Tx queue limit */
524+
rss_i = min_t(u16, rss_i, MAX_TX_QUEUES / vmdq_i);
525+
521526
/* Add starting offset to total pool count */
522527
vmdq_i += adapter->ring_feature[RING_F_VMDQ].offset;
523528

524529
/* double check we are limited to maximum pools */
525530
vmdq_i = min_t(u16, IXGBE_MAX_VMDQ_INDICES, vmdq_i);
526531

527532
/* 64 pool mode with 2 queues per pool */
528-
if ((vmdq_i > 32) || (vmdq_i > 16 && pools)) {
533+
if (vmdq_i > 32) {
529534
vmdq_m = IXGBE_82599_VMDQ_2Q_MASK;
530535
rss_m = IXGBE_RSS_2Q_MASK;
531536
rss_i = min_t(u16, rss_i, 2);
@@ -701,7 +706,7 @@ static void ixgbe_set_num_queues(struct ixgbe_adapter *adapter)
701706
adapter->num_rx_queues = 1;
702707
adapter->num_tx_queues = 1;
703708
adapter->num_xdp_queues = 0;
704-
adapter->num_rx_pools = adapter->num_rx_queues;
709+
adapter->num_rx_pools = 1;
705710
adapter->num_rx_queues_per_pool = 1;
706711

707712
#ifdef CONFIG_IXGBE_DCB

0 commit comments

Comments
 (0)