Thread (10 messages) flat view 10 messages, 5 authors, 2026-03-17

Re: [PATCH net-next v8 1/2] net/sched: cls_flower: remove unions from fl_flow_key

From: Cedric Jehasse <hidden>
Date: 2026-03-13 14:31:52
Also in: lkml

On Wed, Mar 11, 2026 at 11:46:18AM +0100, Cedric Jehasse via B4 Relay wrote:
quoted
From: Cedric Jehasse <redacted>

When creating a flower classifier with an ipv4 address the
flow_dissector has both FLOW_DISSECTOR_KEY_IPV4_ADDRS and
FLOW_DISSECTOR_KEY_IPV6_ADDRS bits set in used_keys.
This happens because ipv4/ipv6 fields are a union and
FL_KEY_SET_IF_MASKED() will interpret either being set as both.

Removing the unions fixes this behavior without needing special handling
for union fields.

Example of a command that caused FLOW_DISSECTOR_KEY_IPV4_ADDRS and
FLOW_DISSECTOR_KEY_IPV6_ADDRS to be set:
tc filter add dev p1 ingress protocol ip flower skip_sw \
    dst_ip 224.0.1.129 action trap

Signed-off-by: Cedric Jehasse <redacted>
Hi Cedric,

This doesn't seem to be the right approach to me.

It seems to me that the use of a union is intentional here, as either IPv4
or IPv6 addresses can be present in each case - never both.  And that
control.addr_type and enc_control.addr_type are intended to allow
differentiation of the address type in use for each of these unions.
I chose this approach because keeping the unions required special handling for
these union keys. Removing the union it keeps the code simpler.
I understand the union exists because IPv4 and IPv6 addresses are mutually
exclusive, but some other keys are also mutually exclusive (e.g. arp and icmp
key wil never be present at the same time)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help