Skip to content

Commit b49087d

Browse files
Sunil Gouthamdavem330
authored andcommitted
net: thunderx: Fix crash when changing rss with mutliple traffic flows
This fixes a crash when changing rss with multiple traffic flows. While interface teardown, disable tx queues after all NAPI threads are done. If done otherwise tx queues might be woken up inside NAPI if any CQE_TX are processed. Signed-off-by: Sunil Goutham <[email protected]> Signed-off-by: Aleksey Makarov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3d7a8aa commit b49087d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/net/ethernet/cavium/thunder/nicvf_main.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static void nicvf_handle_mbx_intr(struct nicvf *nic)
234234
nic->duplex == DUPLEX_FULL ?
235235
"Full duplex" : "Half duplex");
236236
netif_carrier_on(nic->netdev);
237-
netif_tx_wake_all_queues(nic->netdev);
237+
netif_tx_start_all_queues(nic->netdev);
238238
} else {
239239
netdev_info(nic->netdev, "%s: Link is Down\n",
240240
nic->netdev->name);
@@ -551,7 +551,7 @@ static int nicvf_cq_intr_handler(struct net_device *netdev, u8 cq_idx,
551551
if (tx_done) {
552552
txq = netdev_get_tx_queue(netdev, cq_idx);
553553
if (netif_tx_queue_stopped(txq)) {
554-
netif_tx_wake_queue(txq);
554+
netif_tx_start_queue(txq);
555555
nic->drv_stats.txq_wake++;
556556
if (netif_msg_tx_err(nic))
557557
netdev_warn(netdev,
@@ -845,7 +845,7 @@ static netdev_tx_t nicvf_xmit(struct sk_buff *skb, struct net_device *netdev)
845845
return NETDEV_TX_OK;
846846
}
847847

848-
if (!nicvf_sq_append_skb(nic, skb) && !netif_tx_queue_stopped(txq)) {
848+
if (!netif_tx_queue_stopped(txq) && !nicvf_sq_append_skb(nic, skb)) {
849849
netif_tx_stop_queue(txq);
850850
nic->drv_stats.txq_stop++;
851851
if (netif_msg_tx_err(nic))
@@ -871,7 +871,6 @@ int nicvf_stop(struct net_device *netdev)
871871
nicvf_send_msg_to_pf(nic, &mbx);
872872

873873
netif_carrier_off(netdev);
874-
netif_tx_disable(netdev);
875874

876875
/* Disable RBDR & QS error interrupts */
877876
for (qidx = 0; qidx < qs->rbdr_cnt; qidx++) {
@@ -906,6 +905,8 @@ int nicvf_stop(struct net_device *netdev)
906905
kfree(cq_poll);
907906
}
908907

908+
netif_tx_disable(netdev);
909+
909910
/* Free resources */
910911
nicvf_config_data_transfer(nic, false);
911912

0 commit comments

Comments
 (0)