From: Ian Campbell <ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org> To: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Ian Campbell <ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>, "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> Subject: [PATCH 07/13] net: xfrm: convert to SKB frag APIs Date: Fri, 22 Jul 2011 14:17:27 +0100 [thread overview] Message-ID: <1311340653-19336-7-git-send-email-ian.campbell@citrix.com> (raw) In-Reply-To: <1311340095.12772.57.camel-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org> Signed-off-by: Ian Campbell <ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org> Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org --- net/xfrm/xfrm_ipcomp.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index fc91ad7..f781b9a 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -70,26 +70,29 @@ static int ipcomp_decompress(struct xfrm_state *x, struct sk_buff *skb) while ((scratch += len, dlen -= len) > 0) { skb_frag_t *frag; + struct page *page; err = -EMSGSIZE; if (WARN_ON(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS)) goto out; frag = skb_shinfo(skb)->frags + skb_shinfo(skb)->nr_frags; - frag->page = alloc_page(GFP_ATOMIC); + page = alloc_page(GFP_ATOMIC); err = -ENOMEM; - if (!frag->page) + if (!page) goto out; + __skb_frag_set_page(frag, page); + len = PAGE_SIZE; if (dlen < len) len = dlen; - memcpy(page_address(frag->page), scratch, len); - frag->page_offset = 0; frag->size = len; + memcpy(skb_frag_address(frag), scratch, len); + skb->truesize += len; skb->data_len += len; skb->len += len; -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Ian Campbell <ian.campbell@citrix.com> To: netdev@vger.kernel.org, linux-nfs@vger.kernel.org Cc: Ian Campbell <ian.campbell@citrix.com>, "David S. Miller" <davem@davemloft.net> Subject: [PATCH 07/13] net: xfrm: convert to SKB frag APIs Date: Fri, 22 Jul 2011 14:17:27 +0100 [thread overview] Message-ID: <1311340653-19336-7-git-send-email-ian.campbell@citrix.com> (raw) In-Reply-To: <1311340095.12772.57.camel@zakaz.uk.xensource.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: netdev@vger.kernel.org --- net/xfrm/xfrm_ipcomp.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index fc91ad7..f781b9a 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -70,26 +70,29 @@ static int ipcomp_decompress(struct xfrm_state *x, struct sk_buff *skb) while ((scratch += len, dlen -= len) > 0) { skb_frag_t *frag; + struct page *page; err = -EMSGSIZE; if (WARN_ON(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS)) goto out; frag = skb_shinfo(skb)->frags + skb_shinfo(skb)->nr_frags; - frag->page = alloc_page(GFP_ATOMIC); + page = alloc_page(GFP_ATOMIC); err = -ENOMEM; - if (!frag->page) + if (!page) goto out; + __skb_frag_set_page(frag, page); + len = PAGE_SIZE; if (dlen < len) len = dlen; - memcpy(page_address(frag->page), scratch, len); - frag->page_offset = 0; frag->size = len; + memcpy(skb_frag_address(frag), scratch, len); + skb->truesize += len; skb->data_len += len; skb->len += len; -- 1.7.2.5
next prev parent reply other threads:[~2011-07-22 13:17 UTC|newest] Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-07-22 13:08 [PATCH/RFC v2 0/13] enable SKB paged fragment lifetime visibility Ian Campbell 2011-07-22 13:08 ` Ian Campbell 2011-07-22 13:17 ` [PATCH 01/13] mm: Make some struct page's const Ian Campbell 2011-07-22 13:17 ` Ian Campbell 2011-07-22 13:17 ` [PATCH 02/13] mm: use const struct page for r/o page-flag accessor methods Ian Campbell 2011-07-22 13:17 ` [PATCH 03/13] net: add APIs for manipulating skb page fragments Ian Campbell 2011-07-22 13:17 ` [PATCH 04/13] net: convert core to skb paged frag APIs Ian Campbell 2011-07-22 13:17 ` [PATCH 05/13] net: ipv4: convert to SKB " Ian Campbell 2011-07-22 13:17 ` [PATCH 06/13] net: ipv6: " Ian Campbell [not found] ` <1311340095.12772.57.camel-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org> 2011-07-22 13:17 ` Ian Campbell [this message] 2011-07-22 13:17 ` [PATCH 07/13] net: xfrm: " Ian Campbell 2011-07-22 14:13 ` [PATCH/RFC v2 0/13] enable SKB paged fragment lifetime visibility David Miller 2011-07-22 14:13 ` David Miller [not found] ` <20110722.071349.1486529438674839197.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> 2011-07-22 14:18 ` Ian Campbell 2011-07-22 14:18 ` Ian Campbell 2011-07-22 13:17 ` [PATCH 08/13] net: convert drivers to paged frag API Ian Campbell [not found] ` <1311340653-19336-8-git-send-email-ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org> 2011-07-22 14:12 ` David Miller 2011-07-22 14:12 ` David Miller [not found] ` <20110722.071217.607687554920673786.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> 2011-07-22 14:16 ` Ian Campbell 2011-07-22 14:16 ` Ian Campbell 2011-07-22 13:17 ` [PATCH 09/13] net: add support for per-paged-fragment destructors Ian Campbell 2011-07-22 13:17 ` [PATCH 10/13] net: add paged frag destructor to skb_fill_page_desc() Ian Campbell [not found] ` <1311340653-19336-10-git-send-email-ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org> 2011-07-22 19:58 ` Michał Mirosław 2011-07-22 19:58 ` Michał Mirosław 2011-07-22 21:07 ` Ian Campbell 2011-07-22 21:07 ` Ian Campbell [not found] ` <1311368872.4027.76.camel-ztPmHsLffjjnO4AKDKe2m+kiAK3p4hvP@public.gmane.org> 2011-07-22 21:44 ` Michał Mirosław 2011-07-22 21:44 ` Michał Mirosław 2011-07-22 13:17 ` [PATCH 11/13] net: only allow paged fragments with the same destructor to be coalesced Ian Campbell 2011-07-22 13:17 ` [PATCH 12/13] net: add paged frag destructor support to kernel_sendpage Ian Campbell 2011-07-22 13:18 ` [Ocfs2-devel] " Ian Campbell 2011-07-22 13:17 ` [PATCH 13/13] sunrpc: use SKB fragment destructors to delay completion until page is released by network stack Ian Campbell [not found] ` <1311340653-19336-13-git-send-email-ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org> 2011-07-22 18:39 ` Trond Myklebust 2011-07-22 18:39 ` Trond Myklebust
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=1311340653-19336-7-git-send-email-ian.campbell@citrix.com \ --to=ian.campbell-sxgqhf6nn4dqt0dzr+alfa@public.gmane.org \ --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \ --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.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: linkBe 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.