netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remove dead skb_iter code
@ 2005-03-02 18:10 Stephen Hemminger
  2005-03-02 18:20 ` David S. Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2005-03-02 18:10 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

The code iterate over skb_frags is defined but not used by any
existing kernel code.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h
--- a/include/linux/skbuff.h	2005-03-02 10:13:14 -08:00
+++ b/include/linux/skbuff.h	2005-03-02 10:13:14 -08:00
@@ -1118,22 +1118,6 @@
 extern void skb_init(void);
 extern void skb_add_mtu(int mtu);
 
-struct skb_iter {
-	/* Iteration functions set these */
-	unsigned char *data;
-	unsigned int len;
-
-	/* Private to iteration */
-	unsigned int nextfrag;
-	struct sk_buff *fraglist;
-};
-
-/* Keep iterating until skb_iter_next returns false. */
-extern void skb_iter_first(const struct sk_buff *skb, struct skb_iter *i);
-extern int skb_iter_next(const struct sk_buff *skb, struct skb_iter *i);
-/* Call this if aborting loop before !skb_iter_next */
-extern void skb_iter_abort(const struct sk_buff *skb, struct skb_iter *i);
-
 #ifdef CONFIG_NETFILTER
 static inline void nf_conntrack_put(struct nf_conntrack *nfct)
 {
diff -Nru a/net/core/skbuff.c b/net/core/skbuff.c
--- a/net/core/skbuff.c	2005-03-02 10:13:14 -08:00
+++ b/net/core/skbuff.c	2005-03-02 10:13:14 -08:00
@@ -982,70 +982,6 @@
 	return -EFAULT;
 }
 
-/* Keep iterating until skb_iter_next returns false. */
-void skb_iter_first(const struct sk_buff *skb, struct skb_iter *i)
-{
-	i->len = skb_headlen(skb);
-	i->data = (unsigned char *)skb->data;
-	i->nextfrag = 0;
-	i->fraglist = NULL;
-}
-
-int skb_iter_next(const struct sk_buff *skb, struct skb_iter *i)
-{
-	/* Unmap previous, if not head fragment. */
-	if (i->nextfrag)
-		kunmap_skb_frag(i->data);
-
-	if (i->fraglist) {
-	fraglist:
-		/* We're iterating through fraglist. */
-		if (i->nextfrag < skb_shinfo(i->fraglist)->nr_frags) {
-			i->data = kmap_skb_frag(&skb_shinfo(i->fraglist)
-						->frags[i->nextfrag]);
-			i->len = skb_shinfo(i->fraglist)->frags[i->nextfrag]
-				.size;
-			i->nextfrag++;
-			return 1;
-		}
-		/* Fragments with fragments?  Too hard! */
-		BUG_ON(skb_shinfo(i->fraglist)->frag_list);
-		i->fraglist = i->fraglist->next;
-		if (!i->fraglist)
-			goto end;
-
-		i->len = skb_headlen(i->fraglist);
-		i->data = i->fraglist->data;
-		i->nextfrag = 0;
-		return 1;
-	}
-
-	if (i->nextfrag < skb_shinfo(skb)->nr_frags) {
-		i->data = kmap_skb_frag(&skb_shinfo(skb)->frags[i->nextfrag]);
-		i->len = skb_shinfo(skb)->frags[i->nextfrag].size;
-		i->nextfrag++;
-		return 1;
-	}
-
-	i->fraglist = skb_shinfo(skb)->frag_list;
-	if (i->fraglist)
-		goto fraglist;
-
-end:
-	/* Bug trap for callers */
-	i->data = NULL;
-	return 0;
-}
-
-void skb_iter_abort(const struct sk_buff *skb, struct skb_iter *i)
-{
-	/* Unmap previous, if not head fragment. */
-	if (i->data && i->nextfrag)
-		kunmap_skb_frag(i->data);
-	/* Bug trap for callers */
-	i->data = NULL;
-}
-
 /* Checksum skb data. */
 
 unsigned int skb_checksum(const struct sk_buff *skb, int offset,
@@ -1516,6 +1452,3 @@
 EXPORT_SYMBOL(skb_unlink);
 EXPORT_SYMBOL(skb_append);
 EXPORT_SYMBOL(skb_split);
-EXPORT_SYMBOL(skb_iter_first);
-EXPORT_SYMBOL(skb_iter_next);
-EXPORT_SYMBOL(skb_iter_abort);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] remove dead skb_iter code
  2005-03-02 18:10 [PATCH] remove dead skb_iter code Stephen Hemminger
@ 2005-03-02 18:20 ` David S. Miller
  2005-03-02 22:07   ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: David S. Miller @ 2005-03-02 18:20 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

On Wed, 2 Mar 2005 10:10:35 -0800
Stephen Hemminger <shemminger@osdl.org> wrote:

> The code iterate over skb_frags is defined but not used by any
> existing kernel code.
> 
> Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

Rusty and co.'s planned netfilter packet parsing code will use
the iterators.  Send a patch to add a comment to this effect
or something as I'm tired of folks trying to remove this code.
:-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] remove dead skb_iter code
  2005-03-02 18:20 ` David S. Miller
@ 2005-03-02 22:07   ` Christoph Hellwig
  2005-03-02 22:25     ` David S. Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2005-03-02 22:07 UTC (permalink / raw)
  To: David S. Miller; +Cc: Stephen Hemminger, netdev

On Wed, Mar 02, 2005 at 10:20:25AM -0800, David S. Miller wrote:
> On Wed, 2 Mar 2005 10:10:35 -0800
> Stephen Hemminger <shemminger@osdl.org> wrote:
> 
> > The code iterate over skb_frags is defined but not used by any
> > existing kernel code.
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
> 
> Rusty and co.'s planned netfilter packet parsing code will use
> the iterators.  Send a patch to add a comment to this effect
> or something as I'm tired of folks trying to remove this code.
> :-)

Maybe because the removal is right.  This code is not dependent on
any networking internals so it can easily live in a netfilter support
module instead of bloating everyones kernels.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] remove dead skb_iter code
  2005-03-02 22:07   ` Christoph Hellwig
@ 2005-03-02 22:25     ` David S. Miller
  2005-03-02 22:59       ` Thomas Graf
  0 siblings, 1 reply; 5+ messages in thread
From: David S. Miller @ 2005-03-02 22:25 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: shemminger, netdev

On Wed, 2 Mar 2005 22:07:35 +0000
Christoph Hellwig <hch@infradead.org> wrote:

> Maybe because the removal is right.  This code is not dependent on
> any networking internals so it can easily live in a netfilter support
> module instead of bloating everyones kernels.

Fine, I'll kill it for now.  (I also happen to know that it might
be used for ipv4 fragmentation tricks too, but that's also in the
future).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] remove dead skb_iter code
  2005-03-02 22:25     ` David S. Miller
@ 2005-03-02 22:59       ` Thomas Graf
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Graf @ 2005-03-02 22:59 UTC (permalink / raw)
  To: David S. Miller; +Cc: Christoph Hellwig, shemminger, netdev

* David S. Miller <20050302142542.2ae86040.davem@davemloft.net> 2005-03-02 14:25
> On Wed, 2 Mar 2005 22:07:35 +0000
> Christoph Hellwig <hch@infradead.org> wrote:
> 
> > Maybe because the removal is right.  This code is not dependent on
> > any networking internals so it can easily live in a netfilter support
> > module instead of bloating everyones kernels.
> 
> Fine, I'll kill it for now.  (I also happen to know that it might
> be used for ipv4 fragmentation tricks too, but that's also in the
> future).

It will be used for the string matching API shared by netfilter
and ematches. Not sure yet whether it will live in lib/ or net/netfilter
though.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-03-02 22:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-02 18:10 [PATCH] remove dead skb_iter code Stephen Hemminger
2005-03-02 18:20 ` David S. Miller
2005-03-02 22:07   ` Christoph Hellwig
2005-03-02 22:25     ` David S. Miller
2005-03-02 22:59       ` Thomas Graf

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).