netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: f.fainelli@gmail.com, vivien.didelot@gmail.com, andrew@lunn.ch,
	davem@davemloft.net, vinicius.gomes@intel.com,
	vedang.patel@intel.com, richardcochran@gmail.com,
	weifeng.voon@intel.com, jiri@mellanox.com, m-karicheri2@ti.com,
	Jose.Abreu@synopsys.com, netdev@vger.kernel.org
Subject: Re: [RFC PATCH net-next 3/6] net: dsa: Pass tc-taprio offload to drivers
Date: Mon, 8 Jul 2019 14:23:07 +0300	[thread overview]
Message-ID: <20190708112307.GA7480@apalos> (raw)
In-Reply-To: <20190707172921.17731-4-olteanv@gmail.com>

Hi Vladimir,

> tc-taprio is a qdisc based on the enhancements for scheduled traffic
> specified in IEEE 802.1Qbv (later merged in 802.1Q).  This qdisc has
> a software implementation and an optional offload through which
> compatible Ethernet ports may configure their egress 802.1Qbv
> schedulers.
> 
> Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
> ---
>  include/net/dsa.h |  3 +++
>  net/dsa/slave.c   | 14 ++++++++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/include/net/dsa.h b/include/net/dsa.h
> index 1e8650fa8acc..e7ee6ac8ce6b 100644
> --- a/include/net/dsa.h
> +++ b/include/net/dsa.h
> @@ -152,6 +152,7 @@ struct dsa_mall_tc_entry {
>  	};
>  };
>  
> +struct tc_taprio_qopt_offload;
>  
>  struct dsa_port {
>  	/* A CPU port is physically connected to a master device.
> @@ -516,6 +517,8 @@ struct dsa_switch_ops {
>  				   bool ingress);
>  	void	(*port_mirror_del)(struct dsa_switch *ds, int port,
>  				   struct dsa_mall_mirror_tc_entry *mirror);
> +	int	(*port_setup_taprio)(struct dsa_switch *ds, int port,
> +				     struct tc_taprio_qopt_offload *qopt);

Is there any way to make this more generic? 802.1Qbv are not the only hardware
schedulers. CBS and ETF are examples that first come to mind. Maybe having
something more generic than tc_taprio_qopt_offload as an option could host
future schedulers?

>  
>  	/*
>  	 * Cross-chip operations
> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index 99673f6b07f6..2bae33788708 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -965,12 +965,26 @@ static int dsa_slave_setup_tc_block(struct net_device *dev,
>  	}
>  }
>  
> +static int dsa_slave_setup_tc_taprio(struct net_device *dev,
> +				     struct tc_taprio_qopt_offload *f)
> +{
> +	struct dsa_port *dp = dsa_slave_to_port(dev);
> +	struct dsa_switch *ds = dp->ds;
> +
> +	if (!ds->ops->port_setup_taprio)
> +		return -EOPNOTSUPP;
> +
> +	return ds->ops->port_setup_taprio(ds, dp->index, f);
> +}
> +
>  static int dsa_slave_setup_tc(struct net_device *dev, enum tc_setup_type type,
>  			      void *type_data)
>  {
>  	switch (type) {
>  	case TC_SETUP_BLOCK:
>  		return dsa_slave_setup_tc_block(dev, type_data);
> +	case TC_SETUP_QDISC_TAPRIO:
> +		return dsa_slave_setup_tc_taprio(dev, type_data);
>  	default:
>  		return -EOPNOTSUPP;
>  	}
> -- 
> 2.17.1
> 
Thanks
/Ilias

  reply	other threads:[~2019-07-08 11:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-07 17:29 [RFC PATCH net-next 0/6] tc-taprio offload for SJA1105 DSA Vladimir Oltean
2019-07-07 17:29 ` [RFC PATCH net-next 1/6] Revert "Merge branch 'net-sched-Add-txtime-assist-support-for-taprio'" Vladimir Oltean
2019-07-07 17:29 ` [RFC PATCH net-next 2/6] taprio: Add support for hardware offloading Vladimir Oltean
2019-07-07 17:39   ` Andrew Lunn
2019-07-07 20:23     ` Vladimir Oltean
2019-07-07 17:29 ` [RFC PATCH net-next 3/6] net: dsa: Pass tc-taprio offload to drivers Vladimir Oltean
2019-07-08 11:23   ` Ilias Apalodimas [this message]
2019-07-13 12:48     ` Vladimir Oltean
2019-07-07 17:29 ` [RFC PATCH net-next 4/6] net: dsa: sja1105: Add static config tables for scheduling Vladimir Oltean
2019-07-07 17:29 ` [RFC PATCH net-next 5/6] net: dsa: sja1105: Advertise the 8 TX queues Vladimir Oltean
2019-07-07 17:29 ` [RFC PATCH net-next 6/6] net: dsa: sja1105: Configure the Time-Aware Shaper via tc-taprio offload Vladimir Oltean
2019-07-07 17:47 ` [RFC PATCH net-next 0/6] tc-taprio offload for SJA1105 DSA Andrew Lunn
2019-07-07 20:28   ` Vladimir Oltean
2019-07-08 16:10     ` Vivien Didelot
2019-07-08 23:28 ` Vinicius Costa Gomes

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=20190708112307.GA7480@apalos \
    --to=ilias.apalodimas@linaro.org \
    --cc=Jose.Abreu@synopsys.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=jiri@mellanox.com \
    --cc=m-karicheri2@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=richardcochran@gmail.com \
    --cc=vedang.patel@intel.com \
    --cc=vinicius.gomes@intel.com \
    --cc=vivien.didelot@gmail.com \
    --cc=weifeng.voon@intel.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).