Skip to content

Commit 7b0b1a6

Browse files
shirazsaleemJeff Kirsher
authored andcommitted
i40e: Disable iWARP VSI PETCP_ENA flag on netdev down events
Client close is overloaded to handle both un-registration and netdev down event. On netdev down, i40iw client close is called which unregisters the RDMA dev and this is too destructive since the netdev is still registered. Do not call client close/open on netdev down/up events. Instead disable the PE TCP_ENA flag during a netdev down event. This blocks all TCP traffic to the RDMA Protocol Engine. On netdev up, re-enable the flag. Signed-off-by: Shiraz Saleem <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent bc73234 commit 7b0b1a6

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

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 */

0 commit comments

Comments
 (0)