[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200504142302.GD941102@t480s.localdomain>
Date: Mon, 4 May 2020 14:23:02 -0400
From: Vivien Didelot <vivien.didelot@...il.com>
To: Vladimir Oltean <olteanv@...il.com>
Cc: netdev@...r.kernel.org, andrew@...n.ch, f.fainelli@...il.com,
vinicius.gomes@...el.com, po.liu@....com, xiaoliang.yang@....com,
mingkai.hu@....com, christian.herber@....com,
claudiu.manoil@....com, vladimir.oltean@....com,
alexandru.marginean@....com, vlad@...lov.dev, jiri@...lanox.com,
idosch@...lanox.com, kuba@...nel.org
Subject: Re: [PATCH net-next 4/6] net: dsa: sja1105: support flow-based
redirection via virtual links
On Mon, 4 May 2020 14:19:13 -0400, Vivien Didelot <vivien.didelot@...il.com> wrote:
> Hi Vladimir,
>
> On Mon, 4 May 2020 00:10:33 +0300, Vladimir Oltean <olteanv@...il.com> wrote:
> > + case FLOW_ACTION_REDIRECT: {
> > + struct dsa_port *to_dp;
> > +
> > + if (!dsa_slave_dev_check(act->dev)) {
> > + NL_SET_ERR_MSG_MOD(extack,
> > + "Destination not a switch port");
> > + return -EOPNOTSUPP;
> > + }
> > +
> > + to_dp = dsa_slave_to_port(act->dev);
>
> Instead of exporting two DSA core internal functions, I would rather expose
> a new helper for drivers, such as this one:
>
> struct dsa_port *dsa_dev_to_port(struct net_device *dev)
> {
> if (!dsa_slave_dev_check(dev))
> return -EOPNOTSUPP;
Oops, NULL, not an integer error code, but you get the idea of public helpers.
>
> return dsa_slave_to_port(dev);
> }
>
> The naming might not be the best, this helper could even be mirroring-specific,
> I didn't really check the requirements for this functionality yet.
>
>
> Thank you,
>
> Vivien
Powered by blists - more mailing lists