Netdev List
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: netdev@vger.kernel.org, andrew@lunn.ch, f.fainelli@gmail.com,
	vinicius.gomes@intel.com, po.liu@nxp.com, xiaoliang.yang@nxp.com,
	mingkai.hu@nxp.com, christian.herber@nxp.com,
	claudiu.manoil@nxp.com, vladimir.oltean@nxp.com,
	alexandru.marginean@nxp.com, vlad@buslov.dev, jiri@mellanox.com,
	idosch@mellanox.com, kuba@kernel.org
Subject: Re: [PATCH net-next 4/6] net: dsa: sja1105: support flow-based redirection via virtual links
Date: Mon, 4 May 2020 14:19:13 -0400	[thread overview]
Message-ID: <20200504141913.GB941102@t480s.localdomain> (raw)
In-Reply-To: <20200503211035.19363-5-olteanv@gmail.com>

Hi Vladimir,

On Mon,  4 May 2020 00:10:33 +0300, Vladimir Oltean <olteanv@gmail.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;
    
        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

  reply	other threads:[~2020-05-04 18:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03 21:10 [PATCH net-next 0/6] tc-gate offload for SJA1105 DSA switch Vladimir Oltean
2020-05-03 21:10 ` [PATCH net-next 1/6] net: dsa: export dsa_slave_dev_check and dsa_slave_to_port Vladimir Oltean
2020-05-03 22:45   ` Florian Fainelli
2020-05-03 22:47     ` Vladimir Oltean
2020-05-03 22:56       ` Florian Fainelli
2020-05-03 21:10 ` [PATCH net-next 2/6] net: dsa: sja1105: add static tables for virtual links Vladimir Oltean
2020-05-03 21:10 ` [PATCH net-next 3/6] net: dsa: sja1105: make room for virtual link parsing in flower offload Vladimir Oltean
2020-05-03 21:10 ` [PATCH net-next 4/6] net: dsa: sja1105: support flow-based redirection via virtual links Vladimir Oltean
2020-05-04 18:19   ` Vivien Didelot [this message]
2020-05-04 18:23     ` Vivien Didelot
2020-05-04 18:38       ` Vladimir Oltean
2020-05-04 19:24         ` Vivien Didelot
2020-05-04 19:40           ` Vladimir Oltean
2020-05-03 21:10 ` [PATCH net-next 5/6] net: dsa: sja1105: implement tc-gate using time-triggered " Vladimir Oltean
2020-05-05 14:25   ` kbuild test robot
2020-05-05 14:35     ` Vladimir Oltean
2020-05-03 21:10 ` [PATCH net-next 6/6] docs: net: dsa: sja1105: document intended usage of " Vladimir Oltean

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=20200504141913.GB941102@t480s.localdomain \
    --to=vivien.didelot@gmail.com \
    --cc=alexandru.marginean@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=christian.herber@nxp.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=mingkai.hu@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=po.liu@nxp.com \
    --cc=vinicius.gomes@intel.com \
    --cc=vlad@buslov.dev \
    --cc=vladimir.oltean@nxp.com \
    --cc=xiaoliang.yang@nxp.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