* [PATCH 0/6] skb fragment API: convert network drivers (part V, take 2)
@ 2011-10-20 9:01 Ian Campbell
2011-10-20 9:01 ` [PATCH 1/6] mm: add a "struct page_frag" type containing a page, offset and length Ian Campbell
2011-10-20 9:23 ` [PATCH 0/6] skb fragment API: convert network drivers (part V, take 2) David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Ian Campbell @ 2011-10-20 9:01 UTC (permalink / raw)
To: netdev@vger.kernel.org; +Cc: linux-scsi@vger.kernel.org, linux-mm@kvack.org
The following series is the second attempt to convert a fifth (and
hopefully final) batch of network drivers to the SKB pages fragment API
introduced in 131ea6675c76.
There are four drivers here (mlx4, cxgb4, cxgb4vf and cxgbi) which used
skb_frag_t as part of their internal datastructures which meant that
they are impacted by changes to that type more than most drivers. To
break this dependency I added a "struct page_frag" (struct page + offset
+ len) and converted them to use it. These conversions are a little less
trivial than most of the preceding ones and I have only been able to
compile test them.
The struct page_frag addition has been acked by Andrew Morton to go
through the net tree. (Andrew, I took you "yes please" as an Acked-by. I
hope that's ok).
The final patch here wraps the page member of skb_frag_t in a structure,
this is a precursor to adding the destructor here (those patches need a
little more work, arising from comments made at LPC, I'll post regarding
those shortly). This should help ensure that no direct uses of the page
get introduced in the meantime.
In the previous posting of this series I ran an allmodconfig build on a
boatload architectures[2] on a baseline of the then current
net-next/master (88c5100c28b0) and with that series. Although the
baseline didn't build for most architectures I used "make -k" and
confirmed that this series added no new warnings or errors. For this
iteration I have just rebuilt things which changed in the interval
88c5100c28b0..a0bec1cd8f7a (current net-next/master) on amd64 and
eyeballed the diff for new uses of frag->page (I saw none).
This is part of my series to enable visibility into SKB paged fragment's
lifecycles, [0] contains some more background and rationale but
basically the completed series will allow entities which inject pages
into the networking stack to receive a notification when the stack has
really finished with those pages (i.e. including retransmissions,
clones, pull-ups etc) and not just when the original skb is finished
with, which is beneficial to many subsystems which wish to inject pages
into the network stack without giving up full ownership of those page's
lifecycle. It implements something broadly along the lines of what was
described in [1].
Cheers,
Ian.
[0] http://marc.info/?l=linux-netdev&m=131072801125521&w=2
[1] http://marc.info/?l=linux-netdev&m=130925719513084&w=2
[2] arm amd64 blackfin cris i386 ia64 m68k mips64 mips powerpc64 powerpc
s390x sh4 sparc64 sparc xtensa
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/6] mm: add a "struct page_frag" type containing a page, offset and length
2011-10-20 9:01 [PATCH 0/6] skb fragment API: convert network drivers (part V, take 2) Ian Campbell
@ 2011-10-20 9:01 ` Ian Campbell
2011-10-20 9:23 ` [PATCH 0/6] skb fragment API: convert network drivers (part V, take 2) David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2011-10-20 9:01 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: Ian Campbell, Christoph Hellwig, David Miller, linux-mm,
linux-kernel
A few network drivers currently use skb_frag_struct for this purpose but I have
patches which add additional fields and semantics there which these other uses
do not want.
A structure for reference sub-page regions seems like a generally useful thing
so do so instead of adding a network subsystem specific structure.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jens Axboe <jaxboe@fusionio.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: David Miller <davem@davemloft.net>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
[since v1: s/struct subpage/struct page_frag/ on advice from Christoph]
[since v2: s/page_offset/offset/ on advice from Andrew]
---
include/linux/mm_types.h | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 774b895..29971a5 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -135,6 +135,17 @@ struct page {
#endif
;
+struct page_frag {
+ struct page *page;
+#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
+ __u32 offset;
+ __u32 size;
+#else
+ __u16 offset;
+ __u16 size;
+#endif
+};
+
typedef unsigned long __nocast vm_flags_t;
/*
--
1.7.2.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 0/6] skb fragment API: convert network drivers (part V, take 2)
2011-10-20 9:01 [PATCH 0/6] skb fragment API: convert network drivers (part V, take 2) Ian Campbell
2011-10-20 9:01 ` [PATCH 1/6] mm: add a "struct page_frag" type containing a page, offset and length Ian Campbell
@ 2011-10-20 9:23 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2011-10-20 9:23 UTC (permalink / raw)
To: Ian.Campbell; +Cc: netdev, linux-scsi, linux-mm
From: Ian Campbell <Ian.Campbell@citrix.com>
Date: Thu, 20 Oct 2011 10:01:15 +0100
> The following series is the second attempt to convert a fifth (and
> hopefully final) batch of network drivers to the SKB pages fragment API
> introduced in 131ea6675c76.
Applied, thanks Ian.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-20 9:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-20 9:01 [PATCH 0/6] skb fragment API: convert network drivers (part V, take 2) Ian Campbell
2011-10-20 9:01 ` [PATCH 1/6] mm: add a "struct page_frag" type containing a page, offset and length Ian Campbell
2011-10-20 9:23 ` [PATCH 0/6] skb fragment API: convert network drivers (part V, take 2) David Miller
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).