From: jamal <hadi@cyberus.ca>
To: David Miller <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
Herbert Xu <herbert@gondor.apana.org.au>,
Patrick McHardy <kaber@trash.net>,
netdev@vger.kernel.org
Subject: [PATCH 1/3] [NET_CLS_ACT] Introduce skb_act_clone
Date: Tue, 16 Oct 2007 08:29:57 -0400 [thread overview]
Message-ID: <1192537797.4480.77.camel@localhost> (raw)
[-- Attachment #1: Type: text/plain, Size: 15 bytes --]
cheers,
jamal
[-- Attachment #2: 0001-NET_CLS_ACT-Introduce-skb_act_clone --]
[-- Type: text/plain, Size: 1024 bytes --]
[NET_CLS_ACT] Introduce skb_act_clone
Reworked skb_clone looks uglier with the single ifdef CONFIG_NET_CLS_ACT
This patch introduces skb_act_clone which will replace skb_clone
in tc actions
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
---
include/net/sch_generic.h | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index a02ec9e..c926551 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -316,4 +316,19 @@ static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen)
return rtab->data[slot];
}
+#ifdef CONFIG_NET_CLS_ACT
+static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask)
+{
+ struct sk_buff *n = skb_clone(skb, gfp_mask);
+
+ if (n) {
+ n->tc_verd = SET_TC_VERD(n->tc_verd, 0);
+ n->tc_verd = CLR_TC_OK2MUNGE(n->tc_verd);
+ n->tc_verd = CLR_TC_MUNGED(n->tc_verd);
+ n->iif = skb->iif;
+ }
+ return n;
+}
+#endif
+
#endif
--
1.4.4.1.gaed4
next reply other threads:[~2007-10-16 12:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-16 12:29 jamal [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-10-21 19:18 [PATCH 1/3] [NET_CLS_ACT] Introduce skb_act_clone jamal
2007-10-26 9:52 ` David Miller
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=1192537797.4480.77.camel@localhost \
--to=hadi@cyberus.ca \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--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.