mbox series

[net-next,v4,00/13] flower: rework TCA_FLOWER_KEY_ENC_FLAGS usage

Message ID 20240713021911.1631517-1-ast@fiberby.net (mailing list archive)
Headers show
Series flower: rework TCA_FLOWER_KEY_ENC_FLAGS usage | expand

Message

Asbjørn Sloth Tønnesen July 13, 2024, 2:18 a.m. UTC
This series reworks the recently added TCA_FLOWER_KEY_ENC_FLAGS
attribute, to be more like TCA_FLOWER_KEY_FLAGS, and use the unused
u32 flags field in FLOW_DISSECTOR_KEY_ENC_CONTROL, instead of adding
a new flags field as FLOW_DISSECTOR_KEY_ENC_FLAGS.

I have defined the new FLOW_DIS_F_* and TCA_FLOWER_KEY_FLAGS_*
flags to co-exist with the existing flags, so the meaning
of the flags field in struct flow_dissector_key_control is not
depending on the context it is used in. If we run out of bits
then we can always split them up later, if we really want to.
Future flags might also be valid in both contexts.

iproute2 RFC v2 patch:
https://lore.kernel.org/560bcd549ca8ab24b1ad5abe352580a621f6d426.1720790774.git.dcaratti@redhat.com/

---
Changelog:

v4:
- Define control flags in ynl
- Describe enc-flags in ynl
- Propagate tca[TCA_OPTIONS] to NL_REQ_ATTR_CHECK
  (all 3 requested by Jakub)
- Link to new iproute2 patch in cover
- Add Reviewed-By from Davide to patches that haven't changed since v3.

v3: https://lore.kernel.org/20240709163825.1210046-1-ast@fiberby.net/
- Retitle patch 1 (tunnel flags -> control flags)

v2: https://lore.kernel.org/20240705133348.728901-1-ast@fiberby.net/
- Refactor flower control flag definitions
  (requested by Jakub and Alexander)
- Add Tested-by from Davide Caratti on patch 3-10.

v1: https://lore.kernel.org/20240703104600.455125-1-ast@fiberby.net/
- Change netlink attribute type from NLA_U32 to NLA_BE32.
- Ensure that the FLOW_DISSECTOR_KEY_ENC_CONTROL
  is also masked for non-IP.
- Fix preexisting typo in kdoc for struct flow_dissector_key_control
  (all suggested by Davide)

RFC: https://lore.kernel.org/20240611235355.177667-1-ast@fiberby.net/

Asbjørn Sloth Tønnesen (13):
  net/sched: flower: refactor control flag definitions
  doc: netlink: specs: tc: describe flower control flags
  net/sched: flower: define new tunnel flags
  net/sched: cls_flower: prepare fl_{set,dump}_key_flags() for ENC_FLAGS
  net/sched: cls_flower: add policy for TCA_FLOWER_KEY_FLAGS
  flow_dissector: prepare for encapsulated control flags
  flow_dissector: set encapsulated control flags from tun_flags
  net/sched: cls_flower: add tunnel flags to fl_{set,dump}_key_flags()
  net/sched: cls_flower: rework TCA_FLOWER_KEY_ENC_FLAGS usage
  doc: netlink: specs: tc: flower: add enc-flags
  flow_dissector: cleanup FLOW_DISSECTOR_KEY_ENC_FLAGS
  flow_dissector: set encapsulation control flags for non-IP
  net/sched: cls_flower: propagate tca[TCA_OPTIONS] to NL_REQ_ATTR_CHECK

 Documentation/netlink/specs/tc.yaml |  26 +++++
 include/net/flow_dissector.h        |  30 ++---
 include/net/ip_tunnels.h            |  12 --
 include/uapi/linux/pkt_cls.h        |  11 +-
 net/core/flow_dissector.c           |  50 +++++----
 net/sched/cls_flower.c              | 168 ++++++++++++++++------------
 6 files changed, 177 insertions(+), 120 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org July 15, 2024, 4:40 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 13 Jul 2024 02:18:57 +0000 you wrote:
> This series reworks the recently added TCA_FLOWER_KEY_ENC_FLAGS
> attribute, to be more like TCA_FLOWER_KEY_FLAGS, and use the unused
> u32 flags field in FLOW_DISSECTOR_KEY_ENC_CONTROL, instead of adding
> a new flags field as FLOW_DISSECTOR_KEY_ENC_FLAGS.
> 
> I have defined the new FLOW_DIS_F_* and TCA_FLOWER_KEY_FLAGS_*
> flags to co-exist with the existing flags, so the meaning
> of the flags field in struct flow_dissector_key_control is not
> depending on the context it is used in. If we run out of bits
> then we can always split them up later, if we really want to.
> Future flags might also be valid in both contexts.
> 
> [...]

Here is the summary with links:
  - [net-next,v4,01/13] net/sched: flower: refactor control flag definitions
    https://git.kernel.org/netdev/net-next/c/6e5c85c003e4
  - [net-next,v4,02/13] doc: netlink: specs: tc: describe flower control flags
    https://git.kernel.org/netdev/net-next/c/49ba9fc1c773
  - [net-next,v4,03/13] net/sched: flower: define new tunnel flags
    https://git.kernel.org/netdev/net-next/c/bfda5a63137b
  - [net-next,v4,04/13] net/sched: cls_flower: prepare fl_{set,dump}_key_flags() for ENC_FLAGS
    https://git.kernel.org/netdev/net-next/c/fcb4bb07a927
  - [net-next,v4,05/13] net/sched: cls_flower: add policy for TCA_FLOWER_KEY_FLAGS
    https://git.kernel.org/netdev/net-next/c/0e83a7875d69
  - [net-next,v4,06/13] flow_dissector: prepare for encapsulated control flags
    https://git.kernel.org/netdev/net-next/c/4d0aed380f9d
  - [net-next,v4,07/13] flow_dissector: set encapsulated control flags from tun_flags
    https://git.kernel.org/netdev/net-next/c/03afeb613bfe
  - [net-next,v4,08/13] net/sched: cls_flower: add tunnel flags to fl_{set,dump}_key_flags()
    https://git.kernel.org/netdev/net-next/c/988f8723d398
  - [net-next,v4,09/13] net/sched: cls_flower: rework TCA_FLOWER_KEY_ENC_FLAGS usage
    https://git.kernel.org/netdev/net-next/c/11036bd7a0b3
  - [net-next,v4,10/13] doc: netlink: specs: tc: flower: add enc-flags
    https://git.kernel.org/netdev/net-next/c/880a51a8ab8c
  - [net-next,v4,11/13] flow_dissector: cleanup FLOW_DISSECTOR_KEY_ENC_FLAGS
    https://git.kernel.org/netdev/net-next/c/db5271d50ec1
  - [net-next,v4,12/13] flow_dissector: set encapsulation control flags for non-IP
    https://git.kernel.org/netdev/net-next/c/706bf4f44c6d
  - [net-next,v4,13/13] net/sched: cls_flower: propagate tca[TCA_OPTIONS] to NL_REQ_ATTR_CHECK
    https://git.kernel.org/netdev/net-next/c/536b97acddd7

You are awesome, thank you!