[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230916150558.GD1125562@kernel.org>
Date: Sat, 16 Sep 2023 17:05:58 +0200
From: Simon Horman <horms@...nel.org>
To: Hariprasad Kelam <hkelam@...vell.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
kuba@...nel.org, davem@...emloft.net, sgoutham@...vell.com,
gakula@...vell.com, sbhatta@...vell.com, edumazet@...gle.com,
pabeni@...hat.com
Subject: Re: [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@...nel.org>
...
Powered by blists - more mailing lists