Skip to content

netfilter: flowtable: correct and advertise the vlan match

Julius Bairaktaris netdev netfilter-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 4 repliesIn review
  2. v11 patch 1 replySuperseded

Changes in v2 from the cover letter

- Name mlx5e as the consumer instead of mtk. mtk_flow_offload_replace()
reads the vlan key only in its addr_type == 0 arm, which a flowtable
rule never takes.
- Add patch 1. The else branch of the second encapsulation block was
also reached with an 802.1ad tag outside an 802.1Q tag and described
the inner tag as the outer one.
- v1: https://lore.kernel.org/netfilter-devel/[email protected]/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2netfilter: flowtable: fill the vlan key from the outermost tag onlynet/netfilter/nf_flow_table_offload.c+1 -12 replies
2/2netfilter: flowtable: advertise the vlan match in used_keysnet/netfilter/nf_flow_table_offload.c+5 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH nf v2 0/2] netfilter: flowtable: correct and advertise the vlan match

nf_flow_rule_match() builds a vlan match for an offloaded flow and never declares it in used_keys, so no driver reads it. Patch 1 restricts the vlan key to the tag that is outermost on the frame. Patch 2 sets the used_keys bits.

mlx5e is the in-tree driver that reads the vlan key. With the key undeclared, __parse_cls_flower() installs an untagged-only match for a flow whose ingress path carries a tag. After patch 2, mlx5 hardware without outer_second_vid support rejects a double-tagged flow instead of installing a match that cannot hit, and the flow stays in the software path as before.

An 802.1ad tag is neither matched nor popped, before and after this series, and a flow with an 802.1ad tag outside an 802.1Q tag gets no vlan key after patch 1, as a flow with a single 802.1ad tag does today. The pop action for the inner 802.1Q tag stays: mtk and airoha ignore the vlan keys and FLOW_ACTION_VLAN_POP and accept that rule today, so patch 1 does not reject it. Matching and popping 802.1ad is a separate change.

Patch 2 is tested with an out-of-tree driver on IPQ8074 (6.18): the driver reads the ingress vid and offloads the flow. The mlx5e behaviour is read from the driver and was not run on mlx5 hardware.

Changes in v2:
- Name mlx5e as the consumer instead of mtk. mtk_flow_offload_replace()
reads the vlan key only in its addr_type == 0 arm, which a flowtable
rule never takes.
- Add patch 1. The else branch of the second encapsulation block was
also reached with an 802.1ad tag outside an 802.1Q tag and described
the inner tag as the outer one.
- v1: https://lore.kernel.org/netfilter-devel/[email protected]/

Julius Bairaktaris (2):
netfilter: flowtable: fill the vlan key from the outermost tag only
netfilter: flowtable: advertise the vlan match in used_keys

 net/netfilter/nf_flow_table_offload.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Signature · 1 line
2.53.0