Subject: Re: [net-next Patch] octeontx2-pf: Tc flower offload support for MPLS

From: Simon Horman <[email-masked]>
Date: Sat, 16 Sep 2023 17:05:58 +0200

On Thu, Sep 14, 2023 at 04:36:55PM +0530, Hariprasad Kelam wrote:

...

> @@ -738,6 +741,57 @@ static int otx2_tc_prepare_flow(struct otx2_nic *nic, struct otx2_tc_flow *node,
>  		}
>  	}
>  
> +	if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_MPLS)) {
> +		struct flow_match_mpls match;
> +		u8 bit;
> +
> +		flow_rule_match_mpls(rule, &match);
> +
> +		if (match.mask->used_lses & OTX2_UNSUPP_LSE_DEPTH) {
> +			NL_SET_ERR_MSG_MOD(extack,
> +					   "unsupported LSE depth for MPLS match offload");
> +			return -EOPNOTSUPP;
> +		}
> +
> +		for_each_set_bit(bit, (unsigned long *)&match.mask->used_lses,
> +				 FLOW_DIS_MPLS_MAX)  {
> +			/* check if any of the fields LABEL,TC,BOS are set */
> +			if (*((u32 *)&match.mask->ls[bit]) & 0xffffff00) {

Hi Hariprasad,

I wonder if we could avoid using the magic number 0xffffff00 above.
Perhaps ~MPLS_LS_TTL_MASK is appropriate?

Otherwise this patch looks good to me.

Reviewed-by: Simon Horman <[email-masked]>

...