linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>,
	RDMA mailing list <linux-rdma@vger.kernel.org>,
	Boris Pismenny <borisp@mellanox.com>,
	Matan Barak <matanb@mellanox.com>,
	"Michael J . Ruhl" <michael.j.ruhl@intel.com>,
	Or Gerlitz <ogerlitz@mellanox.com>,
	Raed Salem <raeds@mellanox.com>,
	Yishai Hadas <yishaih@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>,
	linux-netdev <netdev@vger.kernel.org>
Subject: [PATCH rdma-next v3 09/14] IB/core: Add support for flow counters
Date: Thu, 31 May 2018 16:43:36 +0300	[thread overview]
Message-ID: <20180531134341.18441-10-leon@kernel.org> (raw)
In-Reply-To: <20180531134341.18441-1-leon@kernel.org>

From: Raed Salem <raeds@mellanox.com>

A counters object could be attached to flow on creation
by providing the counter specification action.

General counters description which count packets and bytes are
introduced, downstream patches from this series will use them
as part of flow counters binding.

In addition, increase number of flow specifications supported
layers to 10 upon adding count specification and for the
previously added drop specification.

Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Raed Salem <raeds@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 include/rdma/ib_verbs.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 84f412f7b8f3..2cc04abb6df8 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1859,9 +1859,10 @@ enum ib_flow_spec_type {
 	IB_FLOW_SPEC_ACTION_TAG         = 0x1000,
 	IB_FLOW_SPEC_ACTION_DROP        = 0x1001,
 	IB_FLOW_SPEC_ACTION_HANDLE	= 0x1002,
+	IB_FLOW_SPEC_ACTION_COUNT       = 0x1003,
 };
 #define IB_FLOW_SPEC_LAYER_MASK	0xF0
-#define IB_FLOW_SPEC_SUPPORT_LAYERS 8
+#define IB_FLOW_SPEC_SUPPORT_LAYERS 10
 
 /* Flow steering rule priority is set according to it's domain.
  * Lower domain value means higher priority.
@@ -2041,6 +2042,17 @@ struct ib_flow_spec_action_handle {
 	struct ib_flow_action	     *act;
 };
 
+enum ib_counters_description {
+	IB_COUNTER_PACKETS,
+	IB_COUNTER_BYTES,
+};
+
+struct ib_flow_spec_action_count {
+	enum ib_flow_spec_type type;
+	u16 size;
+	struct ib_counters *counters;
+};
+
 union ib_flow_spec {
 	struct {
 		u32			type;
@@ -2058,6 +2070,7 @@ union ib_flow_spec {
 	struct ib_flow_spec_action_tag  flow_tag;
 	struct ib_flow_spec_action_drop drop;
 	struct ib_flow_spec_action_handle action;
+	struct ib_flow_spec_action_count flow_count;
 };
 
 struct ib_flow_attr {
-- 
2.14.3

  parent reply	other threads:[~2018-05-31 13:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 13:43 [PATCH rdma-next v3 00/14] Verbs flow counters support Leon Romanovsky
2018-05-31 13:43 ` [PATCH rdma-next v3 01/14] IB/uverbs: Add an ib_uobject getter to ioctl() infrastructure Leon Romanovsky
2018-05-31 13:43 ` [PATCH mlx5-next v3 02/14] net/mlx5: Use flow counter pointer as input to the query function Leon Romanovsky
2018-05-31 13:43 ` [PATCH mlx5-next v3 03/14] net/mlx5: Export flow counter related API Leon Romanovsky
2018-05-31 13:43 ` [PATCH rdma-next v3 04/14] IB/core: Introduce counters object and its create/destroy Leon Romanovsky
2018-05-31 13:43 ` [PATCH rdma-next v3 05/14] IB/uverbs: Add create/destroy counters support Leon Romanovsky
2018-06-01 20:54   ` Jason Gunthorpe
2018-06-02  5:05     ` Leon Romanovsky
2018-05-31 13:43 ` [PATCH rdma-next v3 06/14] IB/core: Introduce counters read verb Leon Romanovsky
2018-05-31 13:43 ` [PATCH rdma-next v3 07/14] IB/uverbs: Add read counters support Leon Romanovsky
2018-05-31 13:43 ` [PATCH rdma-next v3 08/14] IB/core: Support passing uhw for create_flow Leon Romanovsky
2018-05-31 14:42   ` Ruhl, Michael J
2018-05-31 15:09     ` Yishai Hadas
2018-05-31 13:43 ` Leon Romanovsky [this message]
2018-05-31 13:43 ` [PATCH rdma-next v3 10/14] IB/uverbs: Add support for flow counters Leon Romanovsky
2018-05-31 14:49   ` Ruhl, Michael J
2018-05-31 17:23     ` Leon Romanovsky
2018-05-31 13:43 ` [PATCH rdma-next v3 11/14] IB/mlx5: Add counters create and destroy support Leon Romanovsky
2018-05-31 13:43 ` [PATCH mlx5-next v3 12/14] IB/mlx5: Add flow counters binding support Leon Romanovsky
2018-05-31 13:43 ` [PATCH rdma-next v3 13/14] IB/mlx5: Add flow counters read support Leon Romanovsky
2018-05-31 13:43 ` [PATCH rdma-next v3 14/14] IB/mlx5: Add " Leon Romanovsky
2018-05-31 16:15 ` [PATCH rdma-next v3 00/14] Verbs flow counters support Yishai Hadas
2018-06-01 21:11 ` Jason Gunthorpe
2018-06-02  5:04   ` Leon Romanovsky
2018-06-04 14:53     ` Jason Gunthorpe

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=20180531134341.18441-10-leon@kernel.org \
    --to=leon@kernel.org \
    --cc=borisp@mellanox.com \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=matanb@mellanox.com \
    --cc=michael.j.ruhl@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=raeds@mellanox.com \
    --cc=saeedm@mellanox.com \
    --cc=yishaih@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).