On 6/14/23 10:22, Roi Dayan wrote:
> From: Gavin Li <gav...@nvidia.com>
> 
> Kernels that do not support vxlan gbp would treat the rule that has vxlan
> gbp encap action or vxlan gbp id match differently, either reject it or
> just skip the action/match and continue processing the knowing ones.
> 
> To solve the issue, probe and disallow inserting rules with vxlan gbp
> action/match if kernel does not support it.
> 
> Signed-off-by: Gavin Li <gav...@nvidia.com>
> Reviewed-by: Roi Dayan <r...@nvidia.com>
> ---
>  lib/netdev-offload-tc.c | 64 +++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 61 insertions(+), 3 deletions(-)
> 

<snip>

> @@ -2788,6 +2800,51 @@ probe_tc_block_support(int ifindex)
>      }
>  }
>  
> +static void
> +probe_vxlan_gbp_support(int ifindex)
> +{
> +    struct tc_flower flower;
> +    struct tcf_id id;
> +    int block_id = 0;
> +    int prio = 1;
> +    int error;
> +
> +    error = tc_add_del_qdisc(ifindex, true, block_id, TC_INGRESS);
> +    if (error) {
> +        return;
> +    }
> +
> +    memset(&flower, 0, sizeof flower);
> +
> +    flower.tc_policy = TC_POLICY_SKIP_HW;
> +    flower.key.eth_type = htons(ETH_P_IP);
> +    flower.mask.eth_type = OVS_BE16_MAX;
> +    flower.tunnel = true;
> +    flower.mask.tunnel.id = 1;
> +    flower.mask.tunnel.ipv4.ipv4_src = 1;
> +    flower.mask.tunnel.ipv4.ipv4_dst = 1;
> +    flower.mask.tunnel.tp_dst = 1;
> +    flower.mask.tunnel.gbp.id = 512;
> +    flower.key.tunnel.ipv4.ipv4_src = 117901063;
> +    flower.key.tunnel.ipv4.ipv4_dst = 134678279;
> +    flower.key.tunnel.tp_dst = 46354;
> +    flower.key.tunnel.gbp.id = 512;

Most of the fields above are defined as restricted BE types.
Assigning plain integers breaks the build with sparse.
You can see GHA failures on this patch.  As reported by the
ovsrobot:
  https://mail.openvswitch.org/pipermail/ovs-build/2023-June/031588.html

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to