Commit 01b54b14 authored by Jing Huang's avatar Jing Huang Committed by David S. Miller

bna: tx rx cleanup fix

This patch removes busy wait in tx/rx cleanup. bnad_cb_tx_cleanup() and
bnad_cb_rx_cleanup() functions are called from irq context, and currently
they do busy wait for the in-flight transmit or the currently executing napi
polling routine to complete. To fix the issue, we create a workqueue to defer
tx & rx cleanup processing, an in the tx rx cleanup handler, we will
wait respective in flight processing to complete, before freeing the buffers.
Signed-off-by: default avatarJing Huang <huangj@brocade.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f96c1d24
This diff is collapsed.
...@@ -210,6 +210,7 @@ struct bnad_tx_info { ...@@ -210,6 +210,7 @@ struct bnad_tx_info {
struct bna_tx *tx; /* 1:1 between tx_info & tx */ struct bna_tx *tx; /* 1:1 between tx_info & tx */
struct bna_tcb *tcb[BNAD_MAX_TXQ_PER_TX]; struct bna_tcb *tcb[BNAD_MAX_TXQ_PER_TX];
u32 tx_id; u32 tx_id;
struct delayed_work tx_cleanup_work;
} ____cacheline_aligned; } ____cacheline_aligned;
struct bnad_rx_info { struct bnad_rx_info {
...@@ -217,6 +218,7 @@ struct bnad_rx_info { ...@@ -217,6 +218,7 @@ struct bnad_rx_info {
struct bnad_rx_ctrl rx_ctrl[BNAD_MAX_RXP_PER_RX]; struct bnad_rx_ctrl rx_ctrl[BNAD_MAX_RXP_PER_RX];
u32 rx_id; u32 rx_id;
struct work_struct rx_cleanup_work;
} ____cacheline_aligned; } ____cacheline_aligned;
/* Unmap queues for Tx / Rx cleanup */ /* Unmap queues for Tx / Rx cleanup */
...@@ -319,6 +321,7 @@ struct bnad { ...@@ -319,6 +321,7 @@ struct bnad {
mac_t perm_addr; mac_t perm_addr;
struct tasklet_struct tx_free_tasklet; struct tasklet_struct tx_free_tasklet;
struct workqueue_struct *work_q;
/* Statistics */ /* Statistics */
struct bnad_stats stats; struct bnad_stats stats;
...@@ -328,6 +331,7 @@ struct bnad { ...@@ -328,6 +331,7 @@ struct bnad {
char adapter_name[BNAD_NAME_LEN]; char adapter_name[BNAD_NAME_LEN];
char port_name[BNAD_NAME_LEN]; char port_name[BNAD_NAME_LEN];
char mbox_irq_name[BNAD_NAME_LEN]; char mbox_irq_name[BNAD_NAME_LEN];
char wq_name[BNAD_NAME_LEN];
/* debugfs specific data */ /* debugfs specific data */
char *regdata; char *regdata;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment