From: Vladimir Oltean <olteanv@gmail.com>
To: 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
Cc: weifeng.voon@intel.com, jiri@mellanox.com, m-karicheri2@ti.com,
Jose.Abreu@synopsys.com, ilias.apalodimas@linaro.org,
netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>
Subject: [RFC PATCH net-next 3/6] net: dsa: Pass tc-taprio offload to drivers
Date: Sun, 7 Jul 2019 20:29:18 +0300 [thread overview]
Message-ID: <20190707172921.17731-4-olteanv@gmail.com> (raw)
In-Reply-To: <20190707172921.17731-1-olteanv@gmail.com>
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);
/*
* 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
next prev parent reply other threads:[~2019-07-07 17:29 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 ` Vladimir Oltean [this message]
2019-07-08 11:23 ` [RFC PATCH net-next 3/6] net: dsa: Pass tc-taprio offload to drivers Ilias Apalodimas
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=20190707172921.17731-4-olteanv@gmail.com \
--to=olteanv@gmail.com \
--cc=Jose.Abreu@synopsys.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jiri@mellanox.com \
--cc=m-karicheri2@ti.com \
--cc=netdev@vger.kernel.org \
--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).