lkml.org 
[lkml]   [2023]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [net-next Patch] octeontx2-pf: Tc flower offload support for MPLS
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 <horms@kernel.org>

...

\
 
 \ /
  Last update: 2023-09-16 17:07    [W:0.225 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site