Skip to content

Commit 5215046

Browse files
committed
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 2018-01-23 This series contains updates to i40e and i40evf only. Pawel enables FlatNVM support on x722 devices by allowing nvmupdate tool to configure the preservation flags in the AdminQ command. Mitch fixes a potential divide by zero error when DCB is enabled and the firmware fails to configure the VSI, so check for this state. Fixed a bug where the driver could fail to adhere to ETS bandwidth allocations if 8 traffic classes were configured on the switch. Sudheer fixes a potential deadlock by avoiding to call flush_schedule_work() in i40evf_remove(), since cancel_work_sync() and cancel_delayed_work_sync() already cleans up necessary work items. Fixed an issue with the problematic detection and recovery from hung queues in the PF which was causing lost interrupts. This is done by triggering a software interrupt so that interrupts are forced on and if we are already in napi_poll and an interrupt fires, napi_poll will not be rescheduled and the interrupt is lost. Avinash fixes an issue in the VF where is was possible to issue a reset_task while the device is currently being removed. Michal fixes an issue occurring while calling i40e_led_set() with the blink parameter set to true, which was causing the activity LED instead of the link LED to blink for port identification. Shiraz changes the client interface to not call client close/open on netdev down/up events, since this causes a lot of thrash that is not needed. Instead, disable the PE TCP-ENA flag during a netdev down event and re-enable on a netdev up event, since this blocks all TCP traffic to the RDMA protocol engine. Alan fixes an issue which was causing a potential transmit hang by ignoring the PF link up message if the VF state is not yet in the RUNNING state. Amritha fixes the channel VSI recreation during the reset flow to reconfigure the transmit rings and the queue context associated with the channel VSI. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 6b44d0f + bbf0bdd commit 5215046

18 files changed

+403
-210
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw,
10271027
hw->aq.arq.next_to_clean = ntc;
10281028
hw->aq.arq.next_to_use = ntu;
10291029

1030-
i40e_nvmupd_check_wait_event(hw, le16_to_cpu(e->desc.opcode));
1030+
i40e_nvmupd_check_wait_event(hw, le16_to_cpu(e->desc.opcode), &e->desc);
10311031
clean_arq_element_out:
10321032
/* Set pending if needed, unlock and return */
10331033
if (pending)

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,8 +2231,12 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_phy_register_access);
22312231
*/
22322232
struct i40e_aqc_nvm_update {
22332233
u8 command_flags;
2234-
#define I40E_AQ_NVM_LAST_CMD 0x01
2235-
#define I40E_AQ_NVM_FLASH_ONLY 0x80
2234+
#define I40E_AQ_NVM_LAST_CMD 0x01
2235+
#define I40E_AQ_NVM_FLASH_ONLY 0x80
2236+
#define I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT 1
2237+
#define I40E_AQ_NVM_PRESERVATION_FLAGS_MASK 0x03
2238+
#define I40E_AQ_NVM_PRESERVATION_FLAGS_SELECTED 0x03
2239+
#define I40E_AQ_NVM_PRESERVATION_FLAGS_ALL 0x01
22362240
u8 module_pointer;
22372241
__le16 length;
22382242
__le32 offset;

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

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,11 @@ void i40e_client_subtask(struct i40e_pf *pf)
378378
if (!client || !cdev)
379379
return;
380380

381-
/* Here we handle client opens. If the client is down, but
382-
* the netdev is up, then open the client.
381+
/* Here we handle client opens. If the client is down, and
382+
* the netdev is registered, then open the client.
383383
*/
384384
if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) {
385-
if (!test_bit(__I40E_VSI_DOWN, vsi->state) &&
385+
if (vsi->netdev_registered &&
386386
client->ops && client->ops->open) {
387387
set_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);
388388
ret = client->ops->open(&cdev->lan_info, client);
@@ -393,17 +393,19 @@ void i40e_client_subtask(struct i40e_pf *pf)
393393
i40e_client_del_instance(pf);
394394
}
395395
}
396-
} else {
397-
/* Likewise for client close. If the client is up, but the netdev
398-
* is down, then close the client.
399-
*/
400-
if (test_bit(__I40E_VSI_DOWN, vsi->state) &&
401-
client->ops && client->ops->close) {
402-
clear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);
403-
client->ops->close(&cdev->lan_info, client, false);
404-
i40e_client_release_qvlist(&cdev->lan_info);
405-
}
406396
}
397+
398+
/* enable/disable PE TCP_ENA flag based on netdev down/up
399+
*/
400+
if (test_bit(__I40E_VSI_DOWN, vsi->state))
401+
i40e_client_update_vsi_ctxt(&cdev->lan_info, client,
402+
0, 0, 0,
403+
I40E_CLIENT_VSI_FLAG_TCP_ENABLE);
404+
else
405+
i40e_client_update_vsi_ctxt(&cdev->lan_info, client,
406+
0, 0,
407+
I40E_CLIENT_VSI_FLAG_TCP_ENABLE,
408+
I40E_CLIENT_VSI_FLAG_TCP_ENABLE);
407409
}
408410

409411
/**
@@ -717,13 +719,13 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev,
717719
return -ENOENT;
718720
}
719721

720-
if ((valid_flag & I40E_CLIENT_VSI_FLAG_TCP_PACKET_ENABLE) &&
721-
(flag & I40E_CLIENT_VSI_FLAG_TCP_PACKET_ENABLE)) {
722+
if ((valid_flag & I40E_CLIENT_VSI_FLAG_TCP_ENABLE) &&
723+
(flag & I40E_CLIENT_VSI_FLAG_TCP_ENABLE)) {
722724
ctxt.info.valid_sections =
723725
cpu_to_le16(I40E_AQ_VSI_PROP_QUEUE_OPT_VALID);
724726
ctxt.info.queueing_opt_flags |= I40E_AQ_VSI_QUE_OPT_TCP_ENA;
725-
} else if ((valid_flag & I40E_CLIENT_VSI_FLAG_TCP_PACKET_ENABLE) &&
726-
!(flag & I40E_CLIENT_VSI_FLAG_TCP_PACKET_ENABLE)) {
727+
} else if ((valid_flag & I40E_CLIENT_VSI_FLAG_TCP_ENABLE) &&
728+
!(flag & I40E_CLIENT_VSI_FLAG_TCP_ENABLE)) {
727729
ctxt.info.valid_sections =
728730
cpu_to_le16(I40E_AQ_VSI_PROP_QUEUE_OPT_VALID);
729731
ctxt.info.queueing_opt_flags &= ~I40E_AQ_VSI_QUE_OPT_TCP_ENA;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ struct i40e_info {
132132

133133
#define I40E_CLIENT_RESET_LEVEL_PF 1
134134
#define I40E_CLIENT_RESET_LEVEL_CORE 2
135-
#define I40E_CLIENT_VSI_FLAG_TCP_PACKET_ENABLE BIT(1)
135+
#define I40E_CLIENT_VSI_FLAG_TCP_ENABLE BIT(1)
136136

137137
struct i40e_ops {
138138
/* setup_q_vector_list enables queues with a particular vector */

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,7 @@ u32 i40e_led_get(struct i40e_hw *hw)
14861486
case I40E_COMBINED_ACTIVITY:
14871487
case I40E_FILTER_ACTIVITY:
14881488
case I40E_MAC_ACTIVITY:
1489+
case I40E_LINK_ACTIVITY:
14891490
continue;
14901491
default:
14911492
break;
@@ -1534,6 +1535,7 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
15341535
case I40E_COMBINED_ACTIVITY:
15351536
case I40E_FILTER_ACTIVITY:
15361537
case I40E_MAC_ACTIVITY:
1538+
case I40E_LINK_ACTIVITY:
15371539
continue;
15381540
default:
15391541
break;
@@ -1544,9 +1546,6 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
15441546
gpio_val |= ((mode << I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT) &
15451547
I40E_GLGEN_GPIO_CTL_LED_MODE_MASK);
15461548

1547-
if (mode == I40E_LINK_ACTIVITY)
1548-
blink = false;
1549-
15501549
if (blink)
15511550
gpio_val |= BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT);
15521551
else
@@ -3465,13 +3464,14 @@ i40e_status i40e_aq_discover_capabilities(struct i40e_hw *hw,
34653464
* @length: length of the section to be written (in bytes from the offset)
34663465
* @data: command buffer (size [bytes] = length)
34673466
* @last_command: tells if this is the last command in a series
3467+
* @preservation_flags: Preservation mode flags
34683468
* @cmd_details: pointer to command details structure or NULL
34693469
*
34703470
* Update the NVM using the admin queue commands
34713471
**/
34723472
i40e_status i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
34733473
u32 offset, u16 length, void *data,
3474-
bool last_command,
3474+
bool last_command, u8 preservation_flags,
34753475
struct i40e_asq_cmd_details *cmd_details)
34763476
{
34773477
struct i40e_aq_desc desc;
@@ -3490,6 +3490,16 @@ i40e_status i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
34903490
/* If this is the last command in a series, set the proper flag. */
34913491
if (last_command)
34923492
cmd->command_flags |= I40E_AQ_NVM_LAST_CMD;
3493+
if (hw->mac.type == I40E_MAC_X722) {
3494+
if (preservation_flags == I40E_NVM_PRESERVATION_FLAGS_SELECTED)
3495+
cmd->command_flags |=
3496+
(I40E_AQ_NVM_PRESERVATION_FLAGS_SELECTED <<
3497+
I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT);
3498+
else if (preservation_flags == I40E_NVM_PRESERVATION_FLAGS_ALL)
3499+
cmd->command_flags |=
3500+
(I40E_AQ_NVM_PRESERVATION_FLAGS_ALL <<
3501+
I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT);
3502+
}
34933503
cmd->module_pointer = module_pointer;
34943504
cmd->offset = cpu_to_le32(offset);
34953505
cmd->length = cpu_to_le16(length);

0 commit comments

Comments
 (0)