mbox series

[net-next,v2,0/2] net: allow dissecting/matching tunnel control flags

Message ID cover.1706805548.git.dcaratti@redhat.com (mailing list archive)
Headers show
Series net: allow dissecting/matching tunnel control flags | expand

Message

Davide Caratti Feb. 1, 2024, 4:51 p.m. UTC
Ilya says: "for correct matching on decapsulated packets, we should match
on not only tunnel id and headers, but also on tunnel configuration flags
like TUNNEL_NO_CSUM and TUNNEL_DONT_FRAGMENT. This is done to distinguish
similar tunnels with slightly different configs. And it is important since
tunnel configuration is flow based, i.e. can be different for every packet,
even though the main tunnel port is the same."

 - patch 1 extends the kernel's flow dissector to extract these flags
   from the packet's tunnel metadata.
 - patch 2 extends TC flower to match on any combination of TUNNEL_NO_CSUM,
   TUNNEL_OAM and TUNNEL_DONT_FRAGMENT.

v2:
 - use NL_REQ_ATTR_CHECK() where possible (thanks Jamal)
 - don't overwrite 'ret' in the error path of fl_set_key_flags()

Davide Caratti (2):
  flow_dissector: add support for tunnel control flags
  net/sched: cls_flower: add support for matching tunnel control flags

 include/net/flow_dissector.h | 11 ++++++++
 include/uapi/linux/pkt_cls.h |  3 +++
 net/core/flow_dissector.c    | 13 +++++++++-
 net/sched/cls_flower.c       | 50 +++++++++++++++++++++++++++++++++++-
 4 files changed, 75 insertions(+), 2 deletions(-)

Comments

Jamal Hadi Salim Feb. 2, 2024, 12:08 p.m. UTC | #1
On Thu, Feb 1, 2024 at 11:53 AM Davide Caratti <dcaratti@redhat.com> wrote:
>
> Ilya says: "for correct matching on decapsulated packets, we should match
> on not only tunnel id and headers, but also on tunnel configuration flags
> like TUNNEL_NO_CSUM and TUNNEL_DONT_FRAGMENT. This is done to distinguish
> similar tunnels with slightly different configs. And it is important since
> tunnel configuration is flow based, i.e. can be different for every packet,
> even though the main tunnel port is the same."
>
>  - patch 1 extends the kernel's flow dissector to extract these flags
>    from the packet's tunnel metadata.
>  - patch 2 extends TC flower to match on any combination of TUNNEL_NO_CSUM,
>    TUNNEL_OAM and TUNNEL_DONT_FRAGMENT.
>


For the patchset:
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

> v2:
>  - use NL_REQ_ATTR_CHECK() where possible (thanks Jamal)
>  - don't overwrite 'ret' in the error path of fl_set_key_flags()
>
> Davide Caratti (2):
>   flow_dissector: add support for tunnel control flags
>   net/sched: cls_flower: add support for matching tunnel control flags
>
>  include/net/flow_dissector.h | 11 ++++++++
>  include/uapi/linux/pkt_cls.h |  3 +++
>  net/core/flow_dissector.c    | 13 +++++++++-
>  net/sched/cls_flower.c       | 50 +++++++++++++++++++++++++++++++++++-
>  4 files changed, 75 insertions(+), 2 deletions(-)
>
> --
> 2.43.0
>