Skip to content

Commit 2490c65

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Jeff Kirsher says: ==================== This series contains updates to i40e only. Greg provides fixes for the NPAR transmit scheduler where the driver initialization caused the BW configurations to not take effect, so use a BW configuration read and write back to "kick" the transmit scheduler into action. Fixes the ethtool offline test, where we were not actually taking the device offline before doing the testing. Matt modifies the get and set LED functions so they ignore activity LEDs since we are required to blink the link LEDs only. Neerav provides a workaround for whenever a DCBX configuration is changed, where the firmware doe not set the operational status bit of the application TLV status as returned from the "Get CEE DCBX Oper Cfg" admin queue command. So remove the check for the operational and sync bits of the application TLV status until a firmware fix is provided. Shannon changes the driver to grab the NVM devstarter version and not the image version, since it is the more useful version and is what should be displayed. Moves the IRQ tracking setup and tear down into the same routines that do the IRQ setup and tear down. This keeps like activities together and allows us to track exactly the number of vectors reserved from the OS, which may be fewer than are available from the hardware. Jesse provides a fix to use a more portable sign extension by replacing 0xffff.... with ~(u64)0 or ~(u32)0. Also fixes XPS mask when resetting, where the driver would accidentally clear the XPS mask for all queues back to 0. This caused higher CPU utilization and had some other performance impacts for transmit tests. Cleans up some whitespace formatting. Catherine provides a fix where some firmware versions are incorrectly reporting a breakout cable as PHY type 0x3 when it should be 0x16 (I40E_PHY_TYPE_10GBASE_SFPP_CU). Adds the 10G and 40G AOC PHY types to the case statement in get_media_type and ethtool get_settings so that the correct information gets reported back to the user. Anjali provides IOREMAP changes for future device support, where we do not want to map the whole CSR space since some of it is mapped by other drivers with different mapping methods. Mitch changes the i40e driver to not "spam" the system log with messages about VF VSI when VFs are created and when they are reset to reduce user annoyance. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 4b5edb2 + d3866a0 commit 2490c65

16 files changed

+114
-66
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272

7373
#define I40E_MAX_NUM_DESCRIPTORS 4096
7474
#define I40E_MAX_REGISTER 0x800000
75+
#define I40E_MAX_CSR_SPACE (4 * 1024 * 1024 - 64 * 1024)
7576
#define I40E_DEFAULT_NUM_DESCRIPTORS 512
7677
#define I40E_REQ_DESCRIPTOR_MULTIPLE 32
7778
#define I40E_MIN_NUM_DESCRIPTORS 64

drivers/net/ethernet/intel/i40e/i40e_adminq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,8 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)
606606
goto init_adminq_free_arq;
607607

608608
/* get the NVM version info */
609-
i40e_read_nvm_word(hw, I40E_SR_NVM_IMAGE_VERSION, &hw->nvm.version);
609+
i40e_read_nvm_word(hw, I40E_SR_NVM_DEV_STARTER_VERSION,
610+
&hw->nvm.version);
610611
i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_LO, &eetrack_lo);
611612
i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi);
612613
hw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo;

drivers/net/ethernet/intel/i40e/i40e_common.c

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,6 @@ struct i40e_rx_ptype_decoded i40e_ptype_lookup[] = {
541541
I40E_PTT_UNUSED_ENTRY(255)
542542
};
543543

544-
545544
/**
546545
* i40e_init_shared_code - Initialize the shared code
547546
* @hw: pointer to hardware structure
@@ -834,6 +833,8 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
834833
case I40E_PHY_TYPE_10GBASE_CR1:
835834
case I40E_PHY_TYPE_40GBASE_CR4:
836835
case I40E_PHY_TYPE_10GBASE_SFPP_CU:
836+
case I40E_PHY_TYPE_40GBASE_AOC:
837+
case I40E_PHY_TYPE_10GBASE_AOC:
837838
media = I40E_MEDIA_TYPE_DA;
838839
break;
839840
case I40E_PHY_TYPE_1000BASE_KX:
@@ -1083,8 +1084,11 @@ static u32 i40e_led_is_mine(struct i40e_hw *hw, int idx)
10831084
return gpio_val;
10841085
}
10851086

1086-
#define I40E_LED0 22
1087+
#define I40E_COMBINED_ACTIVITY 0xA
1088+
#define I40E_FILTER_ACTIVITY 0xE
10871089
#define I40E_LINK_ACTIVITY 0xC
1090+
#define I40E_MAC_ACTIVITY 0xD
1091+
#define I40E_LED0 22
10881092

10891093
/**
10901094
* i40e_led_get - return current on/off mode
@@ -1097,6 +1101,7 @@ static u32 i40e_led_is_mine(struct i40e_hw *hw, int idx)
10971101
**/
10981102
u32 i40e_led_get(struct i40e_hw *hw)
10991103
{
1104+
u32 current_mode = 0;
11001105
u32 mode = 0;
11011106
int i;
11021107

@@ -1109,6 +1114,20 @@ u32 i40e_led_get(struct i40e_hw *hw)
11091114
if (!gpio_val)
11101115
continue;
11111116

1117+
/* ignore gpio LED src mode entries related to the activity
1118+
* LEDs
1119+
*/
1120+
current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK)
1121+
>> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT);
1122+
switch (current_mode) {
1123+
case I40E_COMBINED_ACTIVITY:
1124+
case I40E_FILTER_ACTIVITY:
1125+
case I40E_MAC_ACTIVITY:
1126+
continue;
1127+
default:
1128+
break;
1129+
}
1130+
11121131
mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >>
11131132
I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT;
11141133
break;
@@ -1128,6 +1147,7 @@ u32 i40e_led_get(struct i40e_hw *hw)
11281147
**/
11291148
void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
11301149
{
1150+
u32 current_mode = 0;
11311151
int i;
11321152

11331153
if (mode & 0xfffffff0)
@@ -1142,6 +1162,20 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
11421162
if (!gpio_val)
11431163
continue;
11441164

1165+
/* ignore gpio LED src mode entries related to the activity
1166+
* LEDs
1167+
*/
1168+
current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK)
1169+
>> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT);
1170+
switch (current_mode) {
1171+
case I40E_COMBINED_ACTIVITY:
1172+
case I40E_FILTER_ACTIVITY:
1173+
case I40E_MAC_ACTIVITY:
1174+
continue;
1175+
default:
1176+
break;
1177+
}
1178+
11451179
gpio_val &= ~I40E_GLGEN_GPIO_CTL_LED_MODE_MASK;
11461180
/* this & is a bit of paranoia, but serves as a range check */
11471181
gpio_val |= ((mode << I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT) &
@@ -1448,6 +1482,10 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
14481482
else
14491483
hw_link_info->lse_enable = false;
14501484

1485+
if ((hw->aq.fw_maj_ver < 4 || (hw->aq.fw_maj_ver == 4 &&
1486+
hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE)
1487+
hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU;
1488+
14511489
/* save link status information */
14521490
if (link)
14531491
*link = *hw_link_info;

drivers/net/ethernet/intel/i40e/i40e_dcb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ static void i40e_cee_to_dcb_v1_config(
459459
sync = (status & I40E_TLV_STATUS_SYNC) ? 1 : 0;
460460
oper = (status & I40E_TLV_STATUS_OPER) ? 1 : 0;
461461
/* Add APPs if Error is False and Oper/Sync is True */
462-
if (!err && sync && oper) {
462+
if (!err) {
463463
/* CEE operating configuration supports FCoE/iSCSI/FIP only */
464464
dcbcfg->numapps = I40E_CEE_OPER_MAX_APPS;
465465

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,
259259
break;
260260
case I40E_PHY_TYPE_XLAUI:
261261
case I40E_PHY_TYPE_XLPPI:
262+
case I40E_PHY_TYPE_40GBASE_AOC:
262263
ecmd->supported = SUPPORTED_40000baseCR4_Full;
263264
break;
264265
case I40E_PHY_TYPE_40GBASE_KR4:
@@ -328,6 +329,7 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,
328329
case I40E_PHY_TYPE_XFI:
329330
case I40E_PHY_TYPE_SFI:
330331
case I40E_PHY_TYPE_10GBASE_SFPP_CU:
332+
case I40E_PHY_TYPE_10GBASE_AOC:
331333
ecmd->supported = SUPPORTED_10000baseT_Full;
332334
break;
333335
case I40E_PHY_TYPE_SGMII:
@@ -1530,13 +1532,20 @@ static void i40e_diag_test(struct net_device *netdev,
15301532
struct ethtool_test *eth_test, u64 *data)
15311533
{
15321534
struct i40e_netdev_priv *np = netdev_priv(netdev);
1535+
bool if_running = netif_running(netdev);
15331536
struct i40e_pf *pf = np->vsi->back;
15341537

15351538
if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
15361539
/* Offline tests */
15371540
netif_info(pf, drv, netdev, "offline testing starting\n");
15381541

15391542
set_bit(__I40E_TESTING, &pf->state);
1543+
/* If the device is online then take it offline */
1544+
if (if_running)
1545+
/* indicate we're in test mode */
1546+
dev_close(netdev);
1547+
else
1548+
i40e_do_reset(pf, (1 << __I40E_PF_RESET_REQUESTED));
15401549

15411550
/* Link test performed before hardware reset
15421551
* so autoneg doesn't interfere with test result
@@ -1559,6 +1568,9 @@ static void i40e_diag_test(struct net_device *netdev,
15591568

15601569
clear_bit(__I40E_TESTING, &pf->state);
15611570
i40e_do_reset(pf, (1 << __I40E_PF_RESET_REQUESTED));
1571+
1572+
if (if_running)
1573+
dev_open(netdev);
15621574
} else {
15631575
/* Online tests */
15641576
netif_info(pf, drv, netdev, "online testing starting\n");
@@ -2368,7 +2380,7 @@ static int i40e_set_channels(struct net_device *dev,
23682380
*
23692381
* Returns a u32 bitmap of flags.
23702382
**/
2371-
u32 i40e_get_priv_flags(struct net_device *dev)
2383+
static u32 i40e_get_priv_flags(struct net_device *dev)
23722384
{
23732385
struct i40e_netdev_priv *np = netdev_priv(dev);
23742386
struct i40e_vsi *vsi = np->vsi;

drivers/net/ethernet/intel/i40e/i40e_fcoe.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*
2525
******************************************************************************/
2626

27-
2827
#include <linux/if_ether.h>
2928
#include <scsi/scsi_cmnd.h>
3029
#include <scsi/scsi_device.h>
@@ -1447,7 +1446,6 @@ static int i40e_fcoe_set_features(struct net_device *netdev,
14471446
return 0;
14481447
}
14491448

1450-
14511449
static const struct net_device_ops i40e_fcoe_netdev_ops = {
14521450
.ndo_open = i40e_open,
14531451
.ndo_stop = i40e_close,

drivers/net/ethernet/intel/i40e/i40e_fcoe.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#define I40E_FILTER_CONTEXT_DESC(R, i) \
3838
(&(((struct i40e_fcoe_filter_context_desc *)((R)->desc))[i]))
3939

40-
4140
/* receive queue descriptor filter status for FCoE */
4241
#define I40E_RX_DESC_FLTSTAT_FCMASK 0x3
4342
#define I40E_RX_DESC_FLTSTAT_NOMTCH 0x0 /* no ddp context match */

drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ static void i40e_write_dword(u8 *hmc_bits,
856856
if (ce_info->width < 32)
857857
mask = ((u32)1 << ce_info->width) - 1;
858858
else
859-
mask = 0xFFFFFFFF;
859+
mask = ~(u32)0;
860860

861861
/* don't swizzle the bits until after the mask because the mask bits
862862
* will be in a different bit position on big endian machines
@@ -908,7 +908,7 @@ static void i40e_write_qword(u8 *hmc_bits,
908908
if (ce_info->width < 64)
909909
mask = ((u64)1 << ce_info->width) - 1;
910910
else
911-
mask = 0xFFFFFFFFFFFFFFFF;
911+
mask = ~(u64)0;
912912

913913
/* don't swizzle the bits until after the mask because the mask bits
914914
* will be in a different bit position on big endian machines

0 commit comments

Comments
 (0)