Thread (10 messages) read the whole thread 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: Jakub Kicinski <kuba@kernel.org>
Date: 2026-03-14 17:00:04
Also in: lkml

On Fri, 13 Mar 2026 13:26:51 +0000 Simon Horman wrote:
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.
My reading was that the initial author simply wanted to save space in
the struct.

As the commit message explains this leads to complications in the logic
which sets the keys. The alternative is to complicate
FL_KEY_SET_IF_MASKED - doable, but given that the union feels like a
micro-optimization in the first place the simpler approach of separating
fields seems okay too? (TBH my mind also initially went down the
FL_KEY_SET_IF_MASKED rabbit hole but once I saw the simplicity of
Cedric's patch I changed my mind)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help