On Tue, Apr 25, 2023 at 03:41:20PM +0300, Roi Dayan via dev wrote:
> From: Gavin Li <[email protected]>
>
> Add TC offload support for filtering vxlan tunnels with gbp option
>
> Signed-off-by: Gavin Li <[email protected]>
> Reviewed-by: Gavi Teitz <[email protected]>
...
> @@ -3439,11 +3479,12 @@ nl_msg_put_flower_tunnel_opts(struct ofpbuf *request,
> uint16_t type,
> int len, cnt = 0;
>
> len = metadata->present.len;
> - if (!len) {
> + if (!len && !tunnel->gbp.id_present) {
> return;
> }
>
> outer = nl_msg_start_nested(request, type);
> + /* Geneve */
> while (len) {
> opt = &metadata->opts.gnv[cnt];
> inner = nl_msg_start_nested(request, TCA_FLOWER_KEY_ENC_OPTS_GENEVE);
> @@ -3459,6 +3500,17 @@ nl_msg_put_flower_tunnel_opts(struct ofpbuf *request,
> uint16_t type,
>
> nl_msg_end_nested(request, inner);
> }
I wonder if it would be slightly nicer to move the Geneve code above
and the VxLAN GBP code below into helper functions that are called here.
Also, I'm assuming this patch will be updated as per the discussion
of attribute handling in patch 4/7.
Other than these points this patch looks fine to me.
> +
> + /* VxLAN GBP */
> + if (tunnel->gbp.id_present) {
> + uint32_t gbp_raw;
> +
> + gbp_raw = odp_encode_gbp_raw(tunnel->gbp.flags, tunnel->gbp.id);
> + inner = nl_msg_start_nested(request, TCA_FLOWER_KEY_ENC_OPTS_VXLAN);
> +
> + nl_msg_put_u32(request, TCA_FLOWER_KEY_ENC_OPT_VXLAN_GBP, gbp_raw);
> + nl_msg_end_nested(request, inner);
> + }
> nl_msg_end_nested(request, outer);
> }
>
...
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev