From: Ian Campbell <ian.campbell@citrix.com>
To: netdev@vger.kernel.org
Cc: Ian Campbell <ian.campbell@citrix.com>,
"James E.J. Bottomley" <JBottomley@parallels.com>,
"David S. Miller" <davem@davemloft.net>,
Mike Christie <michaelc@cs.wisc.edu>,
James Bottomley <James.Bottomley@suse.de>,
Karen Xie <kxie@chelsio.com>,
linux-scsi@vger.kernel.org
Subject: [PATCH 5/9] cxgbi: convert to SKB paged frag API.
Date: Mon, 10 Oct 2011 12:11:37 +0100 [thread overview]
Message-ID: <1318245101-16890-5-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1318245076.21903.408.camel@zakaz.uk.xensource.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: James Bottomley <James.Bottomley@suse.de>
Cc: Karen Xie <kxie@chelsio.com>
Cc: linux-scsi@vger.kernel.org
Cc: netdev@vger.kernel.org
---
drivers/scsi/cxgbi/libcxgbi.c | 16 +++++++++-------
drivers/scsi/cxgbi/libcxgbi.h | 2 +-
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index 77ac217..628b23d 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -1787,7 +1787,7 @@ static int sgl_seek_offset(struct scatterlist *sgl, unsigned int sgcnt,
}
static int sgl_read_to_frags(struct scatterlist *sg, unsigned int sgoffset,
- unsigned int dlen, skb_frag_t *frags,
+ unsigned int dlen, struct subpage *frags,
int frag_max)
{
unsigned int datalen = dlen;
@@ -1944,7 +1944,7 @@ int cxgbi_conn_init_pdu(struct iscsi_task *task, unsigned int offset,
if (tdata->nr_frags > MAX_SKB_FRAGS ||
(padlen && tdata->nr_frags == MAX_SKB_FRAGS)) {
char *dst = skb->data + task->hdr_len;
- skb_frag_t *frag = tdata->frags;
+ struct subpage *frag = tdata->frags;
/* data fits in the skb's headroom */
for (i = 0; i < tdata->nr_frags; i++, frag++) {
@@ -1962,11 +1962,13 @@ int cxgbi_conn_init_pdu(struct iscsi_task *task, unsigned int offset,
skb_put(skb, count + padlen);
} else {
/* data fit into frag_list */
- for (i = 0; i < tdata->nr_frags; i++)
- get_page(tdata->frags[i].page);
-
- memcpy(skb_shinfo(skb)->frags, tdata->frags,
- sizeof(skb_frag_t) * tdata->nr_frags);
+ for (i = 0; i < tdata->nr_frags; i++) {
+ __skb_fill_page_desc(skb, i,
+ tdata->frags[i].page,
+ tdata->frags[i].page_offset,
+ tdata->frags[i].size);
+ skb_frag_ref(skb, i);
+ }
skb_shinfo(skb)->nr_frags = tdata->nr_frags;
skb->len += count;
skb->data_len += count;
diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h
index 9267844..9406759 100644
--- a/drivers/scsi/cxgbi/libcxgbi.h
+++ b/drivers/scsi/cxgbi/libcxgbi.h
@@ -574,7 +574,7 @@ struct cxgbi_endpoint {
#define MAX_PDU_FRAGS ((ULP2_MAX_PDU_PAYLOAD + 512 - 1) / 512)
struct cxgbi_task_data {
unsigned short nr_frags;
- skb_frag_t frags[MAX_PDU_FRAGS];
+ struct subpage frags[MAX_PDU_FRAGS];
struct sk_buff *skb;
unsigned int offset;
unsigned int count;
--
1.7.2.5
next prev parent reply other threads:[~2011-10-10 11:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 11:11 [PATCH 0/9] skb fragment API: convert network drivers (part V) Ian Campbell
2011-10-10 11:11 ` [PATCH 1/9] mm: add a "struct subpage" type containing a page, offset and length Ian Campbell
2011-10-10 12:27 ` Ian Campbell
2011-10-10 15:55 ` Christoph Hellwig
2011-10-10 16:10 ` Ian Campbell
2011-10-10 16:19 ` Christoph Hellwig
2011-10-10 16:27 ` Ian Campbell
2011-10-10 11:11 ` [PATCH 2/9] mlx4: convert to SKB paged frag API Ian Campbell
2011-10-10 11:11 ` [PATCH 3/9] cxgb4: " Ian Campbell
2011-10-10 11:11 ` [PATCH 4/9] cxgb4vf: " Ian Campbell
2011-10-10 11:11 ` Ian Campbell [this message]
2011-10-10 11:11 ` [PATCH 6/9] ehea: " Ian Campbell
2011-10-10 11:11 ` [PATCH 7/9] emac: " Ian Campbell
2011-10-10 11:11 ` [PATCH 8/9] ll_temac: " Ian Campbell
2011-10-10 11:11 ` [PATCH 9/9] net: add opaque struct around skb frag page Ian Campbell
2011-10-10 15:09 ` Eric Dumazet
2011-10-10 15:13 ` Ian Campbell
2011-10-10 18:20 ` [PATCH 0/9] skb fragment API: convert network drivers (part V) David Miller
2011-10-10 18:52 ` Eric Dumazet
2011-10-10 19:16 ` David Miller
2011-10-10 19:17 ` Ian Campbell
2011-10-10 19:18 ` David Miller
2011-10-10 19:42 ` Eric Dumazet
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=1318245101-16890-5-git-send-email-ian.campbell@citrix.com \
--to=ian.campbell@citrix.com \
--cc=JBottomley@parallels.com \
--cc=James.Bottomley@suse.de \
--cc=davem@davemloft.net \
--cc=kxie@chelsio.com \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
--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).