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,
jhs@mojatatu.com, xiyou.wangcong@gmail.com,
kurt.kanzenbach@linutronix.de, joergen.andreasen@microchip.com,
netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>
Subject: [PATCH v4 net-next 2/6] net: dsa: Pass ndo_setup_tc slave callback to drivers
Date: Sun, 15 Sep 2019 04:59:59 +0300 [thread overview]
Message-ID: <20190915020003.27926-3-olteanv@gmail.com> (raw)
In-Reply-To: <20190915020003.27926-1-olteanv@gmail.com>
DSA currently handles shared block filters (for the classifier-action
qdisc) in the core due to what I believe are simply pragmatic reasons -
hiding the complexity from drivers and offerring a simple API for port
mirroring.
Extend the dsa_slave_setup_tc function by passing all other qdisc
offloads to the driver layer, where the driver may choose what it
implements and how. DSA is simply a pass-through in this case.
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes since v2:
- Added Florian Fainelli's Reviewed-by.
Changes since v1:
- Added Kurt Kanzenbach's Acked-by.
Changes since RFC:
- Removed the unused declaration of struct tc_taprio_qopt_offload.
include/net/dsa.h | 2 ++
net/dsa/slave.c | 12 ++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 96acb14ec1a8..541fb514e31d 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -515,6 +515,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_tc)(struct dsa_switch *ds, int port,
+ enum tc_setup_type type, void *type_data);
/*
* Cross-chip operations
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 9a88035517a6..75d58229a4bd 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1035,12 +1035,16 @@ static int dsa_slave_setup_tc_block(struct net_device *dev,
static int dsa_slave_setup_tc(struct net_device *dev, enum tc_setup_type type,
void *type_data)
{
- switch (type) {
- case TC_SETUP_BLOCK:
+ struct dsa_port *dp = dsa_slave_to_port(dev);
+ struct dsa_switch *ds = dp->ds;
+
+ if (type == TC_SETUP_BLOCK)
return dsa_slave_setup_tc_block(dev, type_data);
- default:
+
+ if (!ds->ops->port_setup_tc)
return -EOPNOTSUPP;
- }
+
+ return ds->ops->port_setup_tc(ds, dp->index, type, type_data);
}
static void dsa_slave_get_stats64(struct net_device *dev,
--
2.17.1
next prev parent reply other threads:[~2019-09-15 2:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-15 1:59 [PATCH v4 net-next 0/6] tc-taprio offload for SJA1105 DSA Vladimir Oltean
2019-09-15 1:59 ` [PATCH v4 net-next 1/6] taprio: Add support for hardware offloading Vladimir Oltean
2019-09-15 1:59 ` Vladimir Oltean [this message]
2019-09-16 9:56 ` [PATCH v4 net-next 2/6] net: dsa: Pass ndo_setup_tc slave callback to drivers Ilias Apalodimas
2019-09-15 2:00 ` [PATCH v4 net-next 3/6] net: dsa: sja1105: Add static config tables for scheduling Vladimir Oltean
2019-09-15 2:00 ` [PATCH v4 net-next 4/6] net: dsa: sja1105: Advertise the 8 TX queues Vladimir Oltean
2019-09-15 15:15 ` Florian Fainelli
2019-09-15 16:41 ` Jose Abreu
2019-09-15 17:28 ` Vladimir Oltean
2019-09-15 2:00 ` [PATCH v4 net-next 5/6] net: dsa: sja1105: Configure the Time-Aware Scheduler via tc-taprio offload Vladimir Oltean
2019-09-15 2:00 ` [PATCH v4 net-next 6/6] docs: net: dsa: sja1105: Add info about the Time-Aware Scheduler Vladimir Oltean
2019-09-16 19:36 ` [PATCH v4 net-next 0/6] tc-taprio offload for SJA1105 DSA David Miller
2019-09-16 19:52 ` 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=20190915020003.27926-3-olteanv@gmail.com \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jhs@mojatatu.com \
--cc=jiri@mellanox.com \
--cc=joergen.andreasen@microchip.com \
--cc=jose.abreu@synopsys.com \
--cc=kurt.kanzenbach@linutronix.de \
--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 \
--cc=xiyou.wangcong@gmail.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).