summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorAnton Blanchard2011-10-14 07:31:07 +0200
committerDavid S. Miller2011-10-18 01:00:55 +0200
commit30e2e90b4de735769c8c9dc2397388fdf305e5ca (patch)
tree3440093b6c0d0b900e1ab101744574f3a40c4432 /drivers/net/ethernet
parentehea: Merge swqe2 TSO and non TSO paths (diff)
downloadkernel-qcow2-linux-30e2e90b4de735769c8c9dc2397388fdf305e5ca.tar.gz
kernel-qcow2-linux-30e2e90b4de735769c8c9dc2397388fdf305e5ca.tar.xz
kernel-qcow2-linux-30e2e90b4de735769c8c9dc2397388fdf305e5ca.zip
ehea: Simplify type 3 transmit routine
If a nonlinear skb fits within the immediate area, use skb_copy_bits instead of copying the frags by hand. v3: [cascardo] fixed conflict with use of skb frag API Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_main.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 0fc0ae8b830f..289ad4d31f1d 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -2087,27 +2087,14 @@ static void ehea_xmit2(struct sk_buff *skb, struct net_device *dev,
static void ehea_xmit3(struct sk_buff *skb, struct net_device *dev,
struct ehea_swqe *swqe)
{
- int nfrags = skb_shinfo(skb)->nr_frags;
u8 *imm_data = &swqe->u.immdata_nodesc.immediate_data[0];
- skb_frag_t *frag;
- int i;
xmit_common(skb, swqe);
- if (nfrags == 0) {
+ if (!skb->data_len)
skb_copy_from_linear_data(skb, imm_data, skb->len);
- } else {
- skb_copy_from_linear_data(skb, imm_data,
- skb_headlen(skb));
- imm_data += skb_headlen(skb);
-
- /* ... then copy data from the fragments */
- for (i = 0; i < nfrags; i++) {
- frag = &skb_shinfo(skb)->frags[i];
- memcpy(imm_data, skb_frag_address(frag), frag->size);
- imm_data += frag->size;
- }
- }
+ else
+ skb_copy_bits(skb, 0, imm_data, skb->len);
swqe->immediate_data_length = skb->len;
dev_kfree_skb(skb);