From: Stephen Hemminger <stephen@networkplumber.org>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 6/9] actions: add skbmod action
Date: Sun, 9 Oct 2016 19:08:17 -0700 [thread overview]
Message-ID: <20161009190817.16ea41cb@xeon-e3> (raw)
In-Reply-To: <1475354917-7912-7-git-send-email-jhs@emojatatu.com>
On Sat, 1 Oct 2016 16:48:34 -0400
Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> From: Jamal Hadi Salim <jhs@mojatatu.com>
>
> This action is intended to be an upgrade from a usability perspective
> from pedit (as well as operational debugability).
> Compare this:
>
> sudo tc filter add dev $ETH parent 1: protocol ip prio 10 \
> u32 match ip protocol 1 0xff flowid 1:2 \
> action pedit munge offset -14 u8 set 0x02 \
> munge offset -13 u8 set 0x15 \
> munge offset -12 u8 set 0x15 \
> munge offset -11 u8 set 0x15 \
> munge offset -10 u16 set 0x1515 \
> pipe
>
> to:
>
> sudo tc filter add dev $ETH parent 1: protocol ip prio 10 \
> u32 match ip protocol 1 0xff flowid 1:2 \
> action skbmod dmac 02:15:15:15:15:15
>
> Or worse, try to debug a policy with destination mac, source mac and
> etherype. Then make that a hundred rules and you'll get my point.
>
> The most important ethernet use case at the moment is when redirecting or
> mirroring packets to a remote machine. The dst mac address needs a re-write
> so that it doesnt get dropped or confuse an interconnecting (learning) switch
> or dropped by a target machine (which looks at the dst mac).
>
> In the future common use cases on pedit can be migrated to this action
> (as an example different fields in ip v4/6, transports like tcp/udp/sctp
> etc). For this first cut, this allows modifying basic ethernet header.
>
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Lots of checkpatch errors on this. Please fix and resubmit series.
For example:
ERROR: spaces required around that '+=' (ctx:WxV)
#442: FILE: tc/m_skbmod.c:79:
+ ok +=1;
ERROR: code indent should use tabs where possible
#567: FILE: tc/m_skbmod.c:204:
+ SPRINT_BUF(b1);$
WARNING: please, no spaces at the start of a line
#567: FILE: tc/m_skbmod.c:204:
+ SPRINT_BUF(b1);$
ERROR: code indent should use tabs where possible
#568: FILE: tc/m_skbmod.c:205:
+ SPRINT_BUF(b2);$
WARNING: please, no spaces at the start of a line
#568: FILE: tc/m_skbmod.c:205:
+ SPRINT_BUF(b2);$
WARNING: braces {} are not necessary for single statement blocks
#610: FILE: tc/m_skbmod.c:247:
+ if (p->flags & SKBMOD_F_SWAPMAC) {
+ fprintf(f, "swap mac ");
+ }
ERROR: trailing whitespace
#816: FILE: man/man8/tc-skbmod.8:28:
+.IR CONTROL " := {" $
next prev parent reply other threads:[~2016-10-10 2:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-01 20:48 [PATCH iproute2 0/9] Cleanup backlog Jamal Hadi Salim
2016-10-01 20:48 ` [PATCH iproute2 1/9] ife action: allow specifying index in hex Jamal Hadi Salim
2016-10-01 20:48 ` [PATCH iproute2 2/9] ife: print prio, mark and hash as unsigned Jamal Hadi Salim
2016-10-01 20:48 ` [PATCH iproute2 3/9] ife: improve help text Jamal Hadi Salim
2016-10-01 20:48 ` [PATCH iproute2 4/9] actions ife: Introduce encoding and decoding of tcindex metadata Jamal Hadi Salim
2016-10-01 20:48 ` [PATCH iproute2 5/9] action gact: list pipe as a valid action Jamal Hadi Salim
2016-10-01 20:48 ` [PATCH iproute2 6/9] actions: add skbmod action Jamal Hadi Salim
2016-10-10 2:08 ` Stephen Hemminger [this message]
2016-10-01 20:48 ` [PATCH iproute2 7/9] man pages: update ife action to include tcindex Jamal Hadi Salim
2016-10-01 20:48 ` [PATCH iproute2 8/9] man pages: Add tc-ife to Makefile Jamal Hadi Salim
2016-10-01 20:48 ` [PATCH iproute2 9/9] man pages: add man page for skbmod action Jamal Hadi Salim
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=20161009190817.16ea41cb@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=jhs@mojatatu.com \
--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).