All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rasesh Mody <rmody@brocade.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>,
	<adapter_linux_open_src_team@Brocade.COM>,
	Rasesh Mody <rmody@Brocade.COM>
Subject: [net-next 10/12] bna: Embed SKB Length in TX Vector
Date: Tue, 17 Dec 2013 17:07:40 -0800	[thread overview]
Message-ID: <1387328862-27213-11-git-send-email-rmody@brocade.com> (raw)
In-Reply-To: <1387328862-27213-1-git-send-email-rmody@brocade.com>

 - Store the length of the skb buffer mapped along with the handle and use it
   while unmapping the buffer.

Signed-off-by: Rasesh Mody <rmody@brocade.com>
---
 drivers/net/ethernet/brocade/bna/bnad.c | 6 ++++--
 drivers/net/ethernet/brocade/bna/bnad.h | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index ad8dd75..0d7a304 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -142,7 +142,8 @@ bnad_tx_buff_unmap(struct bnad *bnad,
 
 		dma_unmap_page(&bnad->pcidev->dev,
 			dma_unmap_addr(&unmap->vectors[vector], dma_addr),
-			skb_shinfo(skb)->frags[nvecs].size, DMA_TO_DEVICE);
+			dma_unmap_len(&unmap->vectors[vector], dma_len),
+			DMA_TO_DEVICE);
 		dma_unmap_addr_set(&unmap->vectors[vector], dma_addr, 0);
 		nvecs--;
 	}
@@ -3045,7 +3046,7 @@ bnad_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 
 	for (i = 0, vect_id = 0; i < vectors - 1; i++) {
 		const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i];
-		u16		size = skb_frag_size(frag);
+		u32		size = skb_frag_size(frag);
 
 		if (unlikely(size == 0)) {
 			/* Undo the changes starting at tcb->producer_index */
@@ -3070,6 +3071,7 @@ bnad_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 
 		dma_addr = skb_frag_dma_map(&bnad->pcidev->dev, frag,
 					    0, size, DMA_TO_DEVICE);
+		unmap->vectors[vect_id].dma_len = size;
 		BNA_SET_DMA_ADDR(dma_addr, &txqent->vector[vect_id].host_addr);
 		txqent->vector[vect_id].length = htons(size);
 		dma_unmap_addr_set(&unmap->vectors[vect_id], dma_addr,
diff --git a/drivers/net/ethernet/brocade/bna/bnad.h b/drivers/net/ethernet/brocade/bna/bnad.h
index 3cdc88e..e174e22 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.h
+++ b/drivers/net/ethernet/brocade/bna/bnad.h
@@ -222,6 +222,7 @@ struct bnad_rx_info {
 
 struct bnad_tx_vector {
 	DEFINE_DMA_UNMAP_ADDR(dma_addr);
+	DEFINE_DMA_UNMAP_LEN(dma_len);
 };
 
 struct bnad_tx_unmap {
-- 
1.8.2.3

  parent reply	other threads:[~2013-12-18  1:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18  1:07 [net-next 00/12] bna: Update the Driver to v3.2.23.0 Rasesh Mody
2013-12-18  1:07 ` [net-next 01/12] bna: Add software timestamping support Rasesh Mody
2013-12-18  1:07 ` [net-next 02/12] bna: Set Get IOC fw State Rasesh Mody
2013-12-18  1:07 ` [net-next 03/12] bna: Fix Filter Add Del Rasesh Mody
2013-12-18  1:07 ` [net-next 04/12] bna: RX Filter Enhancements Rasesh Mody
2013-12-18  1:07 ` [net-next 05/12] bna: Enable Multi Buffer RX Rasesh Mody
2013-12-18  1:07 ` [net-next 06/12] bna: RX Processing and Config Changes Rasesh Mody
2013-12-18  1:07 ` [net-next 07/12] bna: CQ Read Fix Rasesh Mody
2013-12-18  1:07 ` [net-next 08/12] bna: Add NULL Check Before Dereferencing TCB Rasesh Mody
2013-12-18  1:07 ` [net-next 09/12] bna: Handle the TX Setup Failures Rasesh Mody
2013-12-18  1:07 ` Rasesh Mody [this message]
2013-12-18  1:07 ` [net-next 11/12] bna: Firmware Patch Simplification Rasesh Mody
2013-12-18  1:07 ` [net-next 12/12] bna: Update the Driver Version to 3.2.23.0 Rasesh Mody
2013-12-18  5:31 ` [net-next 00/12] bna: Update the Driver to v3.2.23.0 David Miller
  -- strict thread matches above, loose matches on Subject: below --
2013-12-13  1:54 Rasesh Mody
2013-12-13  1:54 ` [net-next 10/12] bna: Embed SKB Length in TX Vector Rasesh Mody
2013-12-11  7:00 [net-next 00/12] bna: Update the Driver to v3.2.23.0 Rasesh Mody
2013-12-11  7:00 ` [net-next 10/12] bna: Embed SKB Length in TX Vector Rasesh Mody

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=1387328862-27213-11-git-send-email-rmody@brocade.com \
    --to=rmody@brocade.com \
    --cc=adapter_linux_open_src_team@Brocade.COM \
    --cc=davem@davemloft.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.