Commit 5f07b3c5 authored by Sathya Perla's avatar Sathya Perla Committed by David S. Miller

be2net: support TX batching using skb->xmit_more flag

This patch uses skb->xmit_more flag to batch TX requests.
TX is flushed either when xmit_more is false or there is
no more space in the TXQ.

Skyhawk-R and BEx chips require an even number of wrbs to be posted.
So, when a batch of TX requests is accumulated, the last header wrb
may need to be fixed with an extra dummy wrb.

This patch refactors be_xmit() routine as a sequence of be_xmit_enqueue()
and be_xmit_flush() calls. The Tx completion code is also
updated to be able to unmap/free a batch of skbs rather than a single
skb.
Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 889ee2c7
...@@ -243,7 +243,6 @@ struct be_tx_stats { ...@@ -243,7 +243,6 @@ struct be_tx_stats {
u64 tx_bytes; u64 tx_bytes;
u64 tx_pkts; u64 tx_pkts;
u64 tx_reqs; u64 tx_reqs;
u64 tx_wrbs;
u64 tx_compl; u64 tx_compl;
ulong tx_jiffies; ulong tx_jiffies;
u32 tx_stops; u32 tx_stops;
...@@ -266,6 +265,9 @@ struct be_tx_obj { ...@@ -266,6 +265,9 @@ struct be_tx_obj {
/* Remember the skbs that were transmitted */ /* Remember the skbs that were transmitted */
struct sk_buff *sent_skb_list[TX_Q_LEN]; struct sk_buff *sent_skb_list[TX_Q_LEN];
struct be_tx_stats stats; struct be_tx_stats stats;
u16 pend_wrb_cnt; /* Number of WRBs yet to be given to HW */
u16 last_req_wrb_cnt; /* wrb cnt of the last req in the Q */
u16 last_req_hdr; /* index of the last req's hdr-wrb */
} ____cacheline_aligned_in_smp; } ____cacheline_aligned_in_smp;
/* Struct to remember the pages posted for rx frags */ /* Struct to remember the pages posted for rx frags */
......
...@@ -193,8 +193,6 @@ static const struct be_ethtool_stat et_tx_stats[] = { ...@@ -193,8 +193,6 @@ static const struct be_ethtool_stat et_tx_stats[] = {
{DRVSTAT_TX_INFO(tx_pkts)}, {DRVSTAT_TX_INFO(tx_pkts)},
/* Number of skbs queued for trasmission by the driver */ /* Number of skbs queued for trasmission by the driver */
{DRVSTAT_TX_INFO(tx_reqs)}, {DRVSTAT_TX_INFO(tx_reqs)},
/* Number of TX work request blocks DMAed to HW */
{DRVSTAT_TX_INFO(tx_wrbs)},
/* Number of times the TX queue was stopped due to lack /* Number of times the TX queue was stopped due to lack
* of spaces in the TXQ. * of spaces in the TXQ.
*/ */
......
...@@ -311,6 +311,11 @@ struct amap_eth_hdr_wrb { ...@@ -311,6 +311,11 @@ struct amap_eth_hdr_wrb {
u8 vlan_tag[16]; u8 vlan_tag[16];
} __packed; } __packed;
#define TX_HDR_WRB_COMPL 1 /* word 2 */
#define TX_HDR_WRB_EVT (1 << 1) /* word 2 */
#define TX_HDR_WRB_NUM_SHIFT 13 /* word 2: bits 13:17 */
#define TX_HDR_WRB_NUM_MASK 0x1F /* word 2: bits 13:17 */
struct be_eth_hdr_wrb { struct be_eth_hdr_wrb {
u32 dw[4]; u32 dw[4];
}; };
......
This diff is collapsed.
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