netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next V2 0/3] net/sched: act_pedit: Use offset relative to conventional network headers
@ 2017-01-05  9:54 Amir Vadai
  2017-01-05  9:54 ` [PATCH net-next V2 1/3] net/skbuff: Introduce skb_mac_offset() Amir Vadai
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Amir Vadai @ 2017-01-05  9:54 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Jiri Pirko, Or Gerlitz, Hadar Har-Zion, Amir Vadai

Hi Dave,

This is a respin of the patchset. V1 was sent and didn't make it for 4.10.

You asked me [1] why did I use specific header names instead of layers (L2, L3...),
and I explained that it is on purpose, this extra information is planned to be used
by hardware drivers to offload the action.

Some FW/HW parser APIs are such that they need to get the specific header type (e.g
IPV4 or IPV6, TCP or UDP) and not only the networking level (e.g network or transport).

Enhancing the UAPI to allow for specifying that would allow the same flows to be
set into both SW and HW.

This patchset also makes pedit more robust. Currently fields offset is specified
by offset relative to the ip header, while using negative offsets for 
MAC layer fields.

This series enables the user to set offset relative to the relevant header.

This patch is reusing existing fields in a way where backward UAPI 
compatibility is being kept.

Usage example:
$ tc filter add dev enp0s9 protocol ip parent ffff: \
   flower \
     ip_proto tcp \
    dst_port 80 \
   action \
       pedit munge ip ttl add 0xff \
       pedit munge tcp dport set 8080 \
     pipe action mirred egress redirect dev veth0

Will forward traffic destined to tcp dport 80, while modifying the
destination port to 8080, and decreasing the ttl by one.

I've uploaded a draft for the userspace [2] to make it easier to review and
test the patchset.

[1] - http://patchwork.ozlabs.org/patch/700909/
[2] - git: https://bitbucket.org/av42/iproute2.git
      branch: pedit

Patchset was tested and applied on top of upstream commit 57ea884b0dcf
("packet: fix panic in __packet_set_timestamp on tpacket_v3 in tx mode")

Thanks,
Amir

Amir Vadai (3):
  net/skbuff: Introduce skb_mac_offset()
  net/act_pedit: Support using offset relative to the conventional
    network headers
  net/act_pedit: Introduce 'add' operation

 include/linux/skbuff.h               |  5 +++
 include/uapi/linux/tc_act/tc_pedit.h | 27 ++++++++++++
 net/sched/act_pedit.c                | 81 ++++++++++++++++++++++++++++++------
 3 files changed, 100 insertions(+), 13 deletions(-)

-- 
2.11.0

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

end of thread, other threads:[~2017-01-08  8:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-05  9:54 [PATCH net-next V2 0/3] net/sched: act_pedit: Use offset relative to conventional network headers Amir Vadai
2017-01-05  9:54 ` [PATCH net-next V2 1/3] net/skbuff: Introduce skb_mac_offset() Amir Vadai
2017-01-05  9:54 ` [PATCH net-next V2 2/3] net/act_pedit: Support using offset relative to the conventional network headers Amir Vadai
2017-01-05  9:54 ` [PATCH net-next V2 3/3] net/act_pedit: Introduce 'add' operation Amir Vadai
2017-01-05 11:54 ` [PATCH net-next V2 0/3] net/sched: act_pedit: Use offset relative to conventional network headers Jiri Benc
2017-01-05 12:34   ` Amir Vadai
2017-01-05 12:44     ` Jiri Benc
2017-01-07  1:51 ` David Miller
2017-01-08  8:46   ` Amir Vadai

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