Bug 1468280 - TestOnly: TC pedit action: Support offset relative to L2 and L4 [NEEDINFO]
TestOnly: TC pedit action: Support offset relative to L2 and L4
Status: ON_QA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: iproute (Show other bugs)
7.5
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Phil Sutter
Jaroslav Aster
Ioanna Gkioka
: TestOnly
Depends On: 1435647
Blocks: 1470965
  Show dependency treegraph
 
Reported: 2017-07-06 10:42 EDT by Simon Horman
Modified: 2018-01-17 12:12 EST (History)
8 users (show)

See Also:
Fixed In Version: iproute-4.11.0-5.el7
Doc Type: Enhancement
Doc Text:
The `tc-pedit` action now supports "offset" relative to Layer `2` and Layer `4` The `tc-pedit` action allows modification of packet data. This update adds support for specifying the "offset" options relative to the Layer `2`, `3` and `4` headers to `tc-pedit`. This makes `pedit header` handling more robust and flexible. As a result, editing Ethernet header is more convenient and accessing the Layer `4` header works independently to the Layer `3` header size.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
psutter: needinfo? (jaster)


Attachments (Terms of Use)

  None (edit)
Description Simon Horman 2017-07-06 10:42:42 EDT
Preface:

The intention of this bug is to provide insight into a feature proposed by Netronome for inclusion in RHEL 7.5.

Description:

Pedit allows modification of packet data. Historically this has been done
relative to an offset from the start of the L3 header with a negative offset used to modify the L2 header. This is, however, not robust in the presence of variable length headers.

Status:

To alleviate this problem pedit has been updated to allow offsets relative to the start of L2 and L4 headers. This is provided by the following upstream patch which was included in v4.11.

7c71a40cbd31 ("tc/pedit: Extend pedit to specify offset relative to mac/transport headers")

The following patches build on the above to provide helper-type facilities to allow easier use by users. They are also included in v4.11.

3d2a7781ec0b ("tc/pedit: p_udp: introduce pedit udp support")
2c6eb12ab825 ("tc/pedit: p_tcp: introduce pedit tcp support")
3cd5149ecd78 ("tc/pedit: p_eth: ETH header editor")
fa4652ff3b5d ("tc/pedit: Support fields bigger than 32 bits")
8d193d96074b ("tc/pedit: p_ip: introduce editing ttl header")

The above patches relate to a new kernel feature introduced in v4.11 and described in BZ1468278. The kernel feature may be used independently of the user-space updates described here. And the user-space updates described here are expected to be independent of use of this feature in conjunction with OvS.
Comment 5 Jaroslav Aster 2017-12-04 10:52:47 EST
Hi Phil,

I suppose this bug was fixed by re-base, so I can't review patches and find out what has been changed :-).

Could you please send me some example, old and new way?

I read examples, but I'm not sure, how to test it. Thanks.
Comment 6 Phil Sutter 2017-12-05 14:59:16 EST
Hi Jaroslav,

(In reply to Jaroslav Aster from comment #5)
> I suppose this bug was fixed by re-base, so I can't review patches and find
> out what has been changed :-).

Yes, it was. Hence why it is TestOnly.

> Could you please send me some example, old and new way?
> 
> I read examples, but I'm not sure, how to test it. Thanks.

It is all about 'ex' flag in pedit arguments. The example shown in tc-pedit.8 suits quite well - it performs destination port redirection.

Old style:

# tc filter add dev eth0 parent 1: u32 \
     match ip dport 23 0xffff \
     action pedit munge ip dport set 22

New style:

# tc filter add dev eth0 parent 1: u32 \
     match ip dport 23 0xffff \
     action pedit ex munge tcp dport set 22

Both of the above commands will redirect TCP packets with destination port 23
to destination port 22. The difference is that old style also matches UDP and
breaks if IP header options are present.

Cheers, Phil
Comment 7 Jaroslav Aster 2018-01-16 10:30:57 EST
Hi Phil,

thank you for your update. My original point was, I would like to be sure that without using ex param everything is the same for users as was before update, no broken scripts because start point of offset is different. I can't test every possibilities :-).
Comment 8 Phil Sutter 2018-01-17 12:12:56 EST
Hi Jaroslav,

(In reply to Jaroslav Aster from comment #7)
> thank you for your update. My original point was, I would like to be sure
> that without using ex param everything is the same for users as was before
> update, no broken scripts because start point of offset is different. I
> can't test every possibilities :-).

So does my answer help you with that or do you need any further information? I think the old syntax should continue to work just as before. If it doesn't, we have a bug. :)

Cheers, Phil

Note You need to log in before you can comment on or make changes to this bug.