netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, yotamg@mellanox.com, eladr@mellanox.com,
	idosch@mellanox.com, nogahf@mellanox.com, ogerlitz@mellanox.com,
	jhs@mojatatu.com
Subject: [patch net-next 8/9] net/sched: act_mirred: Add helper inlines to access tcf_mirred info.
Date: Thu, 21 Jul 2016 10:19:19 +0200	[thread overview]
Message-ID: <1469089160-4239-9-git-send-email-jiri@resnulli.us> (raw)
In-Reply-To: <1469089160-4239-1-git-send-email-jiri@resnulli.us>

From: Yotam Gigi <yotamg@mellanox.com>

The helper function is_tcf_mirred_mirror helps finding whether an action
struct is of type mirred and is configured to be of type mirror.

Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 include/net/tc_act/tc_mirred.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/net/tc_act/tc_mirred.h b/include/net/tc_act/tc_mirred.h
index e891835..6a13a7c 100644
--- a/include/net/tc_act/tc_mirred.h
+++ b/include/net/tc_act/tc_mirred.h
@@ -24,6 +24,15 @@ static inline bool is_tcf_mirred_redirect(const struct tc_action *a)
 	return false;
 }
 
+static inline bool is_tcf_mirred_mirror(const struct tc_action *a)
+{
+#ifdef CONFIG_NET_CLS_ACT
+	if (a->ops && a->ops->type == TCA_ACT_MIRRED)
+		return to_mirred(a)->tcfm_eaction == TCA_EGRESS_MIRROR;
+#endif
+	return false;
+}
+
 static inline int tcf_mirred_ifindex(const struct tc_action *a)
 {
 	return to_mirred(a)->tcfm_ifindex;
-- 
2.5.5

  parent reply	other threads:[~2016-07-21  8:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21  8:19 [patch net-next 0/9] mlxsw: implement port mirroring offload Jiri Pirko
2016-07-21  8:19 ` [patch net-next 1/9] mlxsw: pci: Add resources query implementation Jiri Pirko
2016-07-21  8:25   ` Ido Schimmel
2016-07-21  9:41   ` Jamal Hadi Salim
2016-07-21  9:43     ` Jiri Pirko
2016-07-21  9:49       ` Jamal Hadi Salim
2016-07-21  8:19 ` [patch net-next 2/9] mlxsw: pci: Add max span resources to resources query Jiri Pirko
2016-07-21  8:26   ` Ido Schimmel
2016-07-21  8:19 ` [patch net-next 3/9] net/sched: introduce Match-all classifier Jiri Pirko
2016-07-21  8:19 ` [patch net-next 4/9] net/sched: Add match-all classifier hw offloading Jiri Pirko
2016-07-21  8:19 ` [patch net-next 5/9] mlxsw: reg: Add Shared Buffer Internal Buffer register Jiri Pirko
2016-07-21  8:19 ` [patch net-next 6/9] mlxsw: reg: Add Monitoring Port Analyzer Table register Jiri Pirko
2016-07-21  8:19 ` [patch net-next 7/9] mlxsw: reg: Add the Monitoring Port Analyzer register Jiri Pirko
2016-07-21  8:19 ` Jiri Pirko [this message]
2016-07-21  8:19 ` [patch net-next 9/9] mlxsw: spectrum: Add support in matchall mirror TC offloading Jiri Pirko
2016-07-21  9:00 ` [patch net-next 0/9] mlxsw: implement port mirroring offload Jamal Hadi Salim
2016-07-21  9:07   ` Jiri Pirko
2016-07-21  9:24     ` Jamal Hadi Salim
2016-07-21  9:33       ` Jiri Pirko

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=1469089160-4239-9-git-send-email-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=eladr@mellanox.com \
    --cc=idosch@mellanox.com \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=nogahf@mellanox.com \
    --cc=ogerlitz@mellanox.com \
    --cc=yotamg@mellanox.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).