[v2] ethdev: deprecate shared counters using action attribute

Message ID 1604413577-23607-1-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] ethdev: deprecate shared counters using action attribute |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS

Commit Message

Andrew Rybchenko Nov. 3, 2020, 2:26 p.m. UTC
  A new generic shared actions API may be used to create shared
counter. There is no point to keep duplicate COUNT action specific
capability to create shared counters.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Ori Kam <orika@nvidia.com>
Cc: Xueming(Steven) Li <xuemingl@mellanox.com>
Cc: Slava Ovsiienko <viacheslavo@nvidia.com>

Right now it is suggested do not touch ID and keep it as is.
Anyway we have plenty of time before 21.11 when it can be removed.
However it is important to highlight the right direction for shared
counters now.

 doc/guides/prog_guide/rte_flow.rst   | 17 ++++++++++-------
 doc/guides/rel_notes/deprecation.rst |  4 ++++
 lib/librte_ethdev/rte_flow.h         |  6 +++++-
 3 files changed, 19 insertions(+), 8 deletions(-)
  

Comments

Ferruh Yigit Nov. 12, 2020, 1:21 p.m. UTC | #1
On 11/3/2020 2:26 PM, Andrew Rybchenko wrote:
> A new generic shared actions API may be used to create shared
> counter. There is no point to keep duplicate COUNT action specific
> capability to create shared counters.
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> Cc: Ori Kam <orika@nvidia.com>
> Cc: Xueming(Steven) Li <xuemingl@mellanox.com>
> Cc: Slava Ovsiienko <viacheslavo@nvidia.com>
> 

Ping for this deprecation notice.
  
Ferruh Yigit Nov. 24, 2020, 5:51 p.m. UTC | #2
On 11/12/2020 1:21 PM, Ferruh Yigit wrote:
> On 11/3/2020 2:26 PM, Andrew Rybchenko wrote:
>> A new generic shared actions API may be used to create shared
>> counter. There is no point to keep duplicate COUNT action specific
>> capability to create shared counters.
>>
>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>> Cc: Ori Kam <orika@nvidia.com>
>> Cc: Xueming(Steven) Li <xuemingl@mellanox.com>
>> Cc: Slava Ovsiienko <viacheslavo@nvidia.com>
>>
> 
> Ping for this deprecation notice.
> 

For this one too added a few more people, removal target is 21.11, but it also 
marks the fields as deprecated, so it should be merged in this release.

Can you please review this deprecation notice?
  
Bruce Richardson Nov. 27, 2020, 4:07 p.m. UTC | #3
On Thu, Nov 12, 2020 at 01:21:20PM +0000, Ferruh Yigit wrote:
> On 11/3/2020 2:26 PM, Andrew Rybchenko wrote:
> > A new generic shared actions API may be used to create shared
> > counter. There is no point to keep duplicate COUNT action specific
> > capability to create shared counters.
> > 
> > Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > ---
> > Cc: Ori Kam <orika@nvidia.com>
> > Cc: Xueming(Steven) Li <xuemingl@mellanox.com>
> > Cc: Slava Ovsiienko <viacheslavo@nvidia.com>
> > 
> 
> Ping for this deprecation notice.
> 
I believe this patch v2 is largely the same a v1 just with some added docs,
right? In which case the acks on v1 from Ajit and Ori should be kept, no?
  
Bruce Richardson Nov. 27, 2020, 4:08 p.m. UTC | #4
On Thu, Nov 12, 2020 at 01:21:20PM +0000, Ferruh Yigit wrote:
> On 11/3/2020 2:26 PM, Andrew Rybchenko wrote:
> > A new generic shared actions API may be used to create shared
> > counter. There is no point to keep duplicate COUNT action specific
> > capability to create shared counters.
> > 
> > Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > ---
> > Cc: Ori Kam <orika@nvidia.com>
> > Cc: Xueming(Steven) Li <xuemingl@mellanox.com>
> > Cc: Slava Ovsiienko <viacheslavo@nvidia.com>
> > 
> 
> Ping for this deprecation notice.
> 
Reading through the patch history, seems the consensus is that this is
reasonable.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Ajit Khaparde Nov. 27, 2020, 5:43 p.m. UTC | #5
On Fri, Nov 27, 2020 at 8:08 AM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> On Thu, Nov 12, 2020 at 01:21:20PM +0000, Ferruh Yigit wrote:
> > On 11/3/2020 2:26 PM, Andrew Rybchenko wrote:
> > > A new generic shared actions API may be used to create shared
> > > counter. There is no point to keep duplicate COUNT action specific
> > > capability to create shared counters.
> > >
> > > Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > > Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > > ---
> > > Cc: Ori Kam <orika@nvidia.com>
> > > Cc: Xueming(Steven) Li <xuemingl@mellanox.com>
> > > Cc: Slava Ovsiienko <viacheslavo@nvidia.com>
> > >
> >
> > Ping for this deprecation notice.
> >
> Reading through the patch history, seems the consensus is that this is
> reasonable.
>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  
Thomas Monjalon Nov. 27, 2020, 6:11 p.m. UTC | #6
> > > > A new generic shared actions API may be used to create shared
> > > > counter. There is no point to keep duplicate COUNT action specific
> > > > capability to create shared counters.
> > > >
> > > > Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > > > Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > > > ---
> > > > Cc: Ori Kam <orika@nvidia.com>
> > > > Cc: Xueming(Steven) Li <xuemingl@mellanox.com>
> > > > Cc: Slava Ovsiienko <viacheslavo@nvidia.com>
> > > >
> > >
> > > Ping for this deprecation notice.
> > >
> > Reading through the patch history, seems the consensus is that this is
> > reasonable.
> >
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> >
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

Applied, thanks
  

Patch

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index ea203e0..64b533b 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1724,17 +1724,20 @@  that counter.
 For ports within the same switch domain then the counter id namespace extends
 to all ports within that switch domain.
 
+The shared flag is DEPRECATED and ``SHARED`` ``COUNT`` action should be used
+to make shared counters.
+
 .. _table_rte_flow_action_count:
 
 .. table:: COUNT
 
-   +------------+---------------------+
-   | Field      | Value               |
-   +============+=====================+
-   | ``shared`` | shared counter flag |
-   +------------+---------------------+
-   | ``id``     | counter id          |
-   +------------+---------------------+
+   +------------+---------------------------------+
+   | Field      | Value                           |
+   +============+=================================+
+   | ``shared`` | DEPRECATED, shared counter flag |
+   +------------+---------------------------------+
+   | ``id``     | counter id                      |
+   +------------+---------------------------------+
 
 Query structure to retrieve and reset flow rule counters:
 
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index c2d3457..7f3c2e7 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -122,6 +122,10 @@  Deprecation Notices
   will be limited to maximum 256 queues.
   Also compile time flag ``RTE_ETHDEV_QUEUE_STAT_CNTRS`` will be removed.
 
+* ethdev: Attribute ``shared`` of the ``struct rte_flow_action_count``
+  is deprecated and will be removed in DPDK 21.11. Shared counters should
+  be managed using shared actions API (``rte_flow_shared_action_create`` etc).
+
 * cryptodev: support for using IV with all sizes is added, J0 still can
   be used but only when IV length in following structs ``rte_crypto_auth_xform``,
   ``rte_crypto_aead_xform`` is set to zero. When IV length is greater or equal
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index a8eac4d..2bb93d2 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -2287,6 +2287,9 @@  struct rte_flow_query_age {
  * Counters can be retrieved and reset through ``rte_flow_query()``, see
  * ``struct rte_flow_query_count``.
  *
+ * @deprecated Shared attribute is deprecated, use generic
+ * RTE_FLOW_ACTION_TYPE_SHARED action.
+ *
  * The shared flag indicates whether the counter is unique to the flow rule the
  * action is specified with, or whether it is a shared counter.
  *
@@ -2299,7 +2302,8 @@  struct rte_flow_query_age {
  * to all ports within that switch domain.
  */
 struct rte_flow_action_count {
-	uint32_t shared:1; /**< Share counter ID with other flow rules. */
+	/** @deprecated Share counter ID with other flow rules. */
+	uint32_t shared:1;
 	uint32_t reserved:31; /**< Reserved, must be zero. */
 	uint32_t id; /**< Counter ID. */
 };