netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
To: netdev@vger.kernel.org
Cc: Anton Blanchard <anton@samba.org>,
	Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Subject: [PATCH 10/15] ehea: Simplify type 3 transmit routine
Date: Fri, 14 Oct 2011 12:31:07 -0300	[thread overview]
Message-ID: <1318606272-27647-11-git-send-email-cascardo@linux.vnet.ibm.com> (raw)
In-Reply-To: <1318606272-27647-1-git-send-email-cascardo@linux.vnet.ibm.com>

From: Anton Blanchard <anton@samba.org>

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>
---
 drivers/net/ethernet/ibm/ehea/ehea_main.c |   19 +++----------------
 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 0fc0ae8..289ad4d 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);
-- 
1.7.4.4

  parent reply	other threads:[~2011-10-14 15:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-14 15:30 EHEA updates Thadeu Lima de Souza Cascardo
2011-10-14 15:30 ` [PATCH 01/15] ehea: Remove NETIF_F_LLTX Thadeu Lima de Souza Cascardo
2011-10-14 15:30 ` [PATCH 02/15] ehea: Update multiqueue support Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` [PATCH 03/15] ehea: Remove force_irq logic in napi poll routine Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` [PATCH 04/15] ehea: Remove num_tx_qps module option Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` [PATCH 05/15] ehea: Dont check NETIF_F_TSO in TX path Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` [PATCH 06/15] ehea: Add vlan_features Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` [PATCH 07/15] ehea: Allocate large enough skbs to avoid partial cacheline DMA writes Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` [PATCH 08/15] ehea: Simplify ehea_xmit2 and ehea_xmit3 Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` [PATCH 09/15] ehea: Merge swqe2 TSO and non TSO paths Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` Thadeu Lima de Souza Cascardo [this message]
2011-10-14 15:31 ` [PATCH 11/15] ehea: Remove some unused definitions Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` [PATCH 12/15] ehea: Add 64bit statistics Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` [PATCH 13/15] ehea: Remove LRO support Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` [PATCH 14/15] ehea: Add GRO support Thadeu Lima de Souza Cascardo
2011-10-14 15:31 ` [PATCH 15/15] ehea: Remove unused tcp_end field in send WQ Thadeu Lima de Souza Cascardo
2011-10-17 23:06 ` EHEA updates David Miller
  -- strict thread matches above, loose matches on Subject: below --
2011-05-12  0:52 [PATCH 00/15] ehea updates v2 Anton Blanchard
2011-05-12  0:52 ` [PATCH 10/15] ehea: Simplify type 3 transmit routine Anton Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1318606272-27647-11-git-send-email-cascardo@linux.vnet.ibm.com \
    --to=cascardo@linux.vnet.ibm.com \
    --cc=anton@samba.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).