From: Daniel Machon <daniel.machon@microchip.com>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: Lars Povlsen <lars.povlsen@microchip.com>,
Steen Hegelund <Steen.Hegelund@microchip.com>,
<UNGLinuxDriver@microchip.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
<linux-arm-kernel@lists.infradead.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 2/3] net: sparx5: add support for tc flower mirred action.
Date: Thu, 4 Apr 2024 07:58:13 +0000 [thread overview]
Message-ID: <20240404075813.nploesovm4katckb@DEN-DL-M70577> (raw)
In-Reply-To: <20240404064627.6m25m2mi7zbpqbyo@DEN-DL-M31836.microchip.com>
> The 04/03/2024 20:41, Daniel Machon wrote:
>
> Hi Daniel,
>
> ...
>
> > +static int sparx5_tc_action_mirred(struct vcap_admin *admin,
> > + struct vcap_rule *vrule,
> > + struct flow_cls_offload *fco,
> > + struct flow_action_entry *act)
> > +{
> > + struct vcap_u72_action ports = {0};
>
> Maybe this is just a preferences, but usually we use memset instead of {0};
Yes, I think this falls under preference. I'd like to keep this one as
is.
>
> > + int err;
> > +
> > + if (admin->vtype != VCAP_TYPE_IS0 && admin->vtype != VCAP_TYPE_IS2) {
> > + NL_SET_ERR_MSG_MOD(fco->common.extack,
> > + "Mirror action not supported in this VCAP");
> > + return -EOPNOTSUPP;
> > + }
> > +
> > + err = vcap_rule_add_action_u32(vrule, VCAP_AF_MASK_MODE,
> > + SPX5_PMM_OR_DSTMASK);
> > + if (err)
> > + return err;
> > +
> > + sparx5_tc_flower_set_port_mask(&ports, act->dev);
> > +
> > + err = vcap_rule_add_action_u72(vrule, VCAP_AF_PORT_MASK, &ports);
> > + if (err)
> > + return err;
>
> You can just return directly the return value from vcap_rule_add_action_u72
> Something like:
>
> return vcap_rule_add_action_u72(...)
>
Yes, seems like a reasonable change :-) I need to respin anyway, since
NIPA is complaining about something I didn't catch in my local run. Will
incorporate changes in v2 - thanks.
> > +
> > + return 0;
> > +}
> > --
> > 2.34.1
> >
>
> --
> /Horatiu
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-04-04 7:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-03 18:41 [PATCH net-next 0/3] Add support for flower actions mirred and redirect Daniel Machon
2024-04-03 18:41 ` [PATCH net-next 1/3] net: sparx5: support 72-bit VCAP actions Daniel Machon
2024-04-03 18:41 ` [PATCH net-next 2/3] net: sparx5: add support for tc flower mirred action Daniel Machon
2024-04-04 6:46 ` Horatiu Vultur
2024-04-04 7:58 ` Daniel Machon [this message]
2024-04-03 18:41 ` [PATCH net-next 3/3] net: sparx5: add support for tc flower redirect action Daniel Machon
2024-04-04 6:47 ` Horatiu Vultur
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=20240404075813.nploesovm4katckb@DEN-DL-M70577 \
--to=daniel.machon@microchip.com \
--cc=Steen.Hegelund@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horatiu.vultur@microchip.com \
--cc=kuba@kernel.org \
--cc=lars.povlsen@microchip.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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