Commit ebc8d2ab authored by David S. Miller's avatar David S. Miller

be2net: Remove unnecessary frag list traversing.

This driver does not indicate support for frag lists.

Furthermore, even if it did, the code is walking the frag
lists incorrectly.  The idiom is:

	for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next)

but it's doing:

	for (iter = skb_shinfo(skb)->frag_list; iter;
	     iter = skb_shinfo(iter)->frag_list)

which would never work.  And this proves that this driver never
saw an SKB with active frag lists.

So just remove the code altogether and the driver TX path becomes
much simpler.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d4fd3bc1
...@@ -337,13 +337,10 @@ static void be_tx_stats_update(struct be_adapter *adapter, ...@@ -337,13 +337,10 @@ static void be_tx_stats_update(struct be_adapter *adapter,
/* Determine number of WRB entries needed to xmit data in an skb */ /* Determine number of WRB entries needed to xmit data in an skb */
static u32 wrb_cnt_for_skb(struct sk_buff *skb, bool *dummy) static u32 wrb_cnt_for_skb(struct sk_buff *skb, bool *dummy)
{ {
int cnt = 0; int cnt = (skb->len > skb->data_len);
while (skb) {
if (skb->len > skb->data_len)
cnt++;
cnt += skb_shinfo(skb)->nr_frags; cnt += skb_shinfo(skb)->nr_frags;
skb = skb_shinfo(skb)->frag_list;
}
/* to account for hdr wrb */ /* to account for hdr wrb */
cnt++; cnt++;
if (cnt & 1) { if (cnt & 1) {
...@@ -409,7 +406,6 @@ static int make_tx_wrbs(struct be_adapter *adapter, ...@@ -409,7 +406,6 @@ static int make_tx_wrbs(struct be_adapter *adapter,
hdr = queue_head_node(txq); hdr = queue_head_node(txq);
queue_head_inc(txq); queue_head_inc(txq);
while (skb) {
if (skb->len > skb->data_len) { if (skb->len > skb->data_len) {
int len = skb->len - skb->data_len; int len = skb->len - skb->data_len;
busaddr = pci_map_single(pdev, skb->data, len, busaddr = pci_map_single(pdev, skb->data, len,
...@@ -433,8 +429,6 @@ static int make_tx_wrbs(struct be_adapter *adapter, ...@@ -433,8 +429,6 @@ static int make_tx_wrbs(struct be_adapter *adapter,
queue_head_inc(txq); queue_head_inc(txq);
copied += frag->size; copied += frag->size;
} }
skb = skb_shinfo(skb)->frag_list;
}
if (dummy_wrb) { if (dummy_wrb) {
wrb = queue_head_node(txq); wrb = queue_head_node(txq);
......
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