netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Hariprasad Kelam <hkelam@marvell.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kuba@kernel.org, davem@davemloft.net, sgoutham@marvell.com,
	gakula@marvell.com, sbhatta@marvell.com, edumazet@google.com,
	pabeni@redhat.com
Subject: Re: [net-next Patch] octeontx2-pf: Tc flower offload support for MPLS
Date: Sat, 16 Sep 2023 17:05:58 +0200	[thread overview]
Message-ID: <20230916150558.GD1125562@kernel.org> (raw)
In-Reply-To: <20230914110655.31222-1-hkelam@marvell.com>

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>

...

      reply	other threads:[~2023-09-16 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 11:06 [net-next Patch] octeontx2-pf: Tc flower offload support for MPLS Hariprasad Kelam
2023-09-16 15:05 ` Simon Horman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230916150558.GD1125562@kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).