From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5BDFEA0C41; Wed, 6 Oct 2021 11:45:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B9AC4141F; Wed, 6 Oct 2021 11:45:20 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2064.outbound.protection.outlook.com [40.107.223.64]) by mails.dpdk.org (Postfix) with ESMTP id 077A44141A for ; Wed, 6 Oct 2021 11:45:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H7VT4hgxUjn7bbluFFJ8sWEeFM9kw7BP90OSuerZ+SSS92iyHeGzTupz8OOUhB92+qVEl2WD5wMxplzOkoqUrfSfCItKiMspDL9G1+lEfkLlwBkX46c8ac6sropcVWd3QKvX8hI/7N8CkAzDdQTBFF/bm7XNc2HFDmfKcEjktxNCgwlra5gz4p9IEo0Rv17Nh9iEKQFsRIAsOlgoEe2CBtRrPOgSk37JfT2tMW7qPf15/AS9ZZG2+FN9gWjxjhXv+pz03dvqZfOgcqXTh7LtqEWKqSmAHJnbu+uZXbU5qpBHVB2RUToqIkWSHapO55S8ZJlfgntbrr/kpDC5osuF9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/Os0a4GwdjCDd4H59kCYPUEywW9hcDdGdgHYKzKfflQ=; b=B5dU2tWOttpkJ/ZU0dgzf+ze1ehDZxoD1vNCyzY31zEEHy/9ypj8wQq5D9HM/9KSamQDavyb/WFcrMhIe0/7r2IyIXMyyDa2c4b4N141XzA4x8FaTNH0aJiUlGht94Hq8WTBtbOVOZHPTNRvjD0sVrjoGdX0+418dmVA36xl2GY5BJkga63MJESHCImkx4nXy93Lq6tJhPOtTcryjBW+GIGGZ8bGUwCAEqOId1MrpKysXqvKMTQ8mpxOpTQkN52+nAP+kXi1nb/o2kvSYZQsqD8U1AWaesLC+dU2+PU2pjjfQczShpdG0pfOmcYFY1SDFU8I8VnLVu/HtjLMEJAw2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/Os0a4GwdjCDd4H59kCYPUEywW9hcDdGdgHYKzKfflQ=; b=dmlObt5WdkE3ZTlOkmcq3tcY0RBZp0p+oT7HpjRLHGVcmH7TjLE3waaF+fjRFZQ/XnOGx38z6eLTvAtO6UdFaN93TsStZVIXayimVFwwTnaPNLd6UQ2qw+J+ARe42zcCQQt/b5pwbYH0fjeujD/hOL7T39hjZ8u5Xdo4xP4iq9RQuvbHZaWnYQ8vDR1eCUGEiEZBO6FXDpU1Jk3UdsWe89CK9dX/CFqlHiHvIYGcKzaa4g/g16aB3NVV6w7579EYOpRQhOAT7VL6X4TH67CDmXZbj+PBnLLbe0cgjpzufSTsALAE/U4lpHk8FRQKmySDypw8Rqel8AGo4+OulQ7xeA== Received: from DM4PR12MB5389.namprd12.prod.outlook.com (2603:10b6:5:39a::7) by DM4PR12MB5327.namprd12.prod.outlook.com (2603:10b6:5:39e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.17; Wed, 6 Oct 2021 09:45:16 +0000 Received: from DM4PR12MB5389.namprd12.prod.outlook.com ([fe80::45be:2914:19ef:f4bb]) by DM4PR12MB5389.namprd12.prod.outlook.com ([fe80::45be:2914:19ef:f4bb%3]) with mapi id 15.20.4566.022; Wed, 6 Oct 2021 09:45:16 +0000 From: Matan Azrad To: Andrew Rybchenko , Ori Kam , Xiaoyun Li , Ray Kinsella , Ajit Khaparde , Somnath Kotur , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , "Min Hu (Connor)" , Yisen Zhuang , Lijun Ou , Qiming Yang , Qi Zhang , Slava Ovsiienko , Jerin Jacob , Jasvinder Singh , Cristian Dumitrescu , NBU-Contact-Thomas Monjalon , Ferruh Yigit CC: "dev@dpdk.org" Thread-Topic: [PATCH] ethdev: remove deprecated shared counter attribute Thread-Index: AQHXtHzIq8YaIJSmtkmowXOVGeJ+kKvFpUHA Date: Wed, 6 Oct 2021 09:45:15 +0000 Message-ID: References: <20210928152300.989961-1-andrew.rybchenko@oktetlabs.ru> In-Reply-To: <20210928152300.989961-1-andrew.rybchenko@oktetlabs.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 21d44c1d-99e7-4ce3-0af7-08d988ae006e x-ms-traffictypediagnostic: DM4PR12MB5327: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 43/uycf0AF6LG2zw4+8F+7XA8tWCje4k0ZhZqID/JkJIy1U5FJehr0BshfYQLLeJOs9arvCeLPYYzwxEhnwTyVu7ZYnFfbe5sTpyf1lDwGbNq78M+Shmg1FocgAN4pi6Cbug0j/KQyJpOkY6bFsB8iTBtxmP1c8WGSkh8OGhghJVEkB0D0M3q9egrYJhkE+SQn+VdVuiTtMjVKLg4vD5iFdEzeTwlKIh+r7o2XnhHByByKk78l98VtCOMNSCSoVvFBn4OBAV1R900k7y9e8pl2tceeIQq/z1/wcdtGFXqlh7RC/ajMAuJXoJAIvoU/3wM2F1ZkhWqSOtzEgBGoXgKgx4PdxSB5MXzMjx7btC6tuJP+/vFPh7dszOSROSG4gVrh0bhtz7HL1AlXZKxQN3XquBQW2fefja1M4oQU9RV80UTwbHKy+hiMwLSaizr2qqJxHlQqwwEcscVPBtPJvlHgmtp1qRrtSVAI/ZhnWFeg+HrBPS9Cv08tu+yhEehFyjtx1FrDLPSpE5oMFFvqt09mJK5ZyU02IogKa8RMpAEjf1dhVt+flBHPHkME4KswlagBNf006FMNT9TnRAwpBXHfazg4RXp6IftDn7PZAH31cHBuJpJbkHa0QbfTmCX3vsiWxbO5V6pVyhMXjK0Ef8YYz0Omo5JsvFRV4pEJCGP5CIifZVfcl3i1819AdLa4sWc+nKSOwt958hGwBsytWsjtZy33zg3quEtolZluI87zTqQcJS1dJVrIodrHSNAavI x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5389.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(8676002)(8936002)(86362001)(110136005)(38070700005)(186003)(5660300002)(7696005)(33656002)(52536014)(30864003)(316002)(508600001)(64756008)(38100700002)(6506007)(26005)(921005)(66556008)(7416002)(2906002)(55016002)(76116006)(71200400001)(122000001)(83380400001)(66946007)(9686003)(4326008)(66446008)(66476007)(579004)(559001)(309714004); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Q6pbdO5dmMyI2w237/hQI561TiYtmpTOyqBcLXeigG6kkhQ9GafeZFQg3fSu?= =?us-ascii?Q?7fpR6elEWhKVfTIFXHy+o05It9ahtH5JIPAPPHV92mzO8CF5ojdGn42l3ps9?= =?us-ascii?Q?h0a+EMkUwZjiLpT+v9uNC8ImRhancRqGbg/OXN5+LNGH0VrBaPK06nrnYNm3?= =?us-ascii?Q?SAppx658nsvEbVp0ILrYxat+MejApK3Kn6Pbpommck5vNRNNgQMp3sVH7F5B?= =?us-ascii?Q?HmUFXkjfHlWc+QA8EWuMfsRt0KuwdCoCL6HIoMoA14JgvHJHLsO2CR8kRjKa?= =?us-ascii?Q?6FBRPl5eusyI+MIQ7pYuBcSTz2o6dFMpqJ3OFXEyAWDdIixJLyeRfrJWf7kk?= =?us-ascii?Q?ggxVrZSSNJpNOJQGozjueWHG2zrVZBODDjkm6J/c7OjSuGtAPr58k2Sf9Oaj?= =?us-ascii?Q?/JoiN42sXlyTJKF0QUo7Mpp58uYgnp0GbSnOiFy5SHP0A5dbJ6LZpssgz7RE?= =?us-ascii?Q?in2VvAxbD+eNcgfNlQ4QPPyg1iFSRsnLxfeRuWYmAxupdqB2kjo2Ldq0j6Kc?= =?us-ascii?Q?spuwwJlaJAcMk4wnCGZPIU5LrU+CESxvUSDSpVfOq4FOn7SM9V7lc4NpkF35?= =?us-ascii?Q?EcAd6pVwWsEtu+nshqjzPxhxnLpo3G3RtRzV3ZiHg88CwO9YCVsXs69/FChh?= =?us-ascii?Q?yHcgM8PLbD22+EvGvku4a4N5UmRL7TRFFDxAyyY3j86X7AgNZMYuJgFrlumm?= =?us-ascii?Q?/YKJlJ8KwlgXsciYNWu+HMd/rhlx0fVsE8a+oiu9UJzYYcO/HhIrWbbaDCHE?= =?us-ascii?Q?/NRJQcOyG8pR2yaCwFLTtxbleKICCVHCd1Z5mzhr56fRTyfVD3zW3XWHus+8?= =?us-ascii?Q?7JP91lfA7yT9SukhBPg/MXdumhkSuW2Upu7nx6oXD3qeVSrk8UjigAuNGEIO?= =?us-ascii?Q?SuYJvO6rP3gu/b4G/vi1BsFlAPGahZJGR2fnIEkR/xoJB+mQtxY5/b6D0/kx?= =?us-ascii?Q?hv5Bx80rj4Ak09kIrUSzNVzOXgisJfU6hYTJVdg5UNKhdWPYL0i0ld+uCJdY?= =?us-ascii?Q?BmqO8JmtgBg/sQq86jAHAycDoxuZTg/fzxkyadOyYwVEPRd/E+0FzZpvC4aL?= =?us-ascii?Q?CJo6rqHief1fBSal6h2Y4gqgYIU9DSdaY8boBcjoD2KImUsw7Uzs2LlDK5Ds?= =?us-ascii?Q?vyjMCahCXMXsR9zLHKBKimJrJDiQnQMzV1eG8LW2gu2HNogEAM2Ni8xdZMTY?= =?us-ascii?Q?h1xALCM3suvYf+hlt1+36EEX5uJNI2ivXdV/8b/TE2pRI1P68H+5RGS7bn78?= =?us-ascii?Q?12ekudlHZIoeJ00KTiOfBGsB1YWejmOyY0j+82ie4HnbV0c+9js7xnAEDw69?= =?us-ascii?Q?VztUnYUItHj318omrxNVdmaJ?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5389.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21d44c1d-99e7-4ce3-0af7-08d988ae006e X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Oct 2021 09:45:16.0115 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sjZDSH7nYx/EhbNFUmjEuCgAf+ngWhK0SfieBBypy44kmkPKzrw8TDYJ9RGWlaMy0DQqTfvydSSKzaOhIuY0cQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5327 Subject: Re: [dpdk-dev] [PATCH] ethdev: remove deprecated shared counter attribute X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Andrew Thank you for the big effort to adjust mlx5. I left some comments inside. If you feel it is too much, we can do a later patch to improve. Matan > From: Andrew Rybchenko > Indirect actions should be used to do shared counters. >=20 > Signed-off-by: Andrew Rybchenko > --- > app/test-pmd/cmdline_flow.c | 10 -- > doc/guides/prog_guide/rte_flow.rst | 19 +-- > doc/guides/rel_notes/deprecation.rst | 4 - > doc/guides/rel_notes/release_21_11.rst | 4 + > drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 5 - > drivers/net/cnxk/cnxk_rte_flow.c | 8 -- > drivers/net/hns3/hns3_flow.c | 3 +- > drivers/net/ice/ice_fdir_filter.c | 4 +- > drivers/net/mlx5/mlx5.h | 7 -- > drivers/net/mlx5/mlx5_flow_dv.c | 135 ++------------------- > drivers/net/mlx5/mlx5_flow_verbs.c | 22 +--- > drivers/net/octeontx2/otx2_flow_parse.c | 10 -- > drivers/net/sfc/sfc_mae.c | 9 +- > drivers/net/softnic/rte_eth_softnic_flow.c | 7 -- > lib/ethdev/rte_flow.h | 17 +-- > 15 files changed, 23 insertions(+), 241 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index bb22294dd3..0b5856c7d5 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -322,7 +322,6 @@ enum index { > ACTION_QUEUE_INDEX, > ACTION_DROP, > ACTION_COUNT, > - ACTION_COUNT_SHARED, > ACTION_COUNT_ID, > ACTION_RSS, > ACTION_RSS_FUNC, > @@ -1451,7 +1450,6 @@ static const enum index action_queue[] =3D { >=20 > static const enum index action_count[] =3D { > ACTION_COUNT_ID, > - ACTION_COUNT_SHARED, > ACTION_NEXT, > ZERO, > }; > @@ -3712,14 +3710,6 @@ static const struct token token_list[] =3D { > .args =3D ARGS(ARGS_ENTRY(struct rte_flow_action_count, i= d)), > .call =3D parse_vc_conf, > }, > - [ACTION_COUNT_SHARED] =3D { > - .name =3D "shared", > - .help =3D "shared counter", > - .next =3D NEXT(action_count, NEXT_ENTRY(COMMON_BOOLEAN)), > - .args =3D ARGS(ARGS_ENTRY_BF(struct rte_flow_action_count= , > - shared, 1)), > - .call =3D parse_vc_conf, > - }, > [ACTION_RSS] =3D { > .name =3D "rss", > .help =3D "spread packets among several queues", diff --g= it > a/doc/guides/prog_guide/rte_flow.rst > b/doc/guides/prog_guide/rte_flow.rst > index 2b42d5ec8c..3cb014c1fa 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -158,7 +158,7 @@ Several pattern items and actions are valid and can b= e > used in both directions. At least one direction must be specified. >=20 > Specifying both directions at once for a given rule is not recommended b= ut - > may be valid in a few cases (e.g. shared counters). > +may be valid in a few cases. >=20 > Attribute: Transfer > ^^^^^^^^^^^^^^^^^^^ > @@ -1491,9 +1491,7 @@ Actions are performed in list order: > +=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D+ > | 0 | MARK | ``mark`` | 0x2a | > +-------+--------+------------+-------+ > - | 1 | COUNT | ``shared`` | 0 | > - | | +------------+-------+ > - | | | ``id`` | 0 | > + | 1 | COUNT | ``id`` | 0 | > +-------+--------+------------+-------+ > | 2 | QUEUE | ``queue`` | 10 | > +-------+--------+------------+-------+ > @@ -1734,20 +1732,9 @@ action must specify a unique id. > Counters can be retrieved and reset through ``rte_flow_query()``, see > ``struct rte_flow_query_count``. >=20 > -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. > - > -For a count action with the shared flag set, then a global device -names= pace > is assumed for the counter id, so that any matched flow rules using -a co= unt > action with the same counter id on the same port will contribute to -that > counter. > - > For ports within the same switch domain then the counter id namespace > extends to all ports within that switch domain. >=20 > -The shared flag is DEPRECATED and ``INDIRECT`` ``COUNT`` action should b= e > used -to make shared counters. > - > .. _table_rte_flow_action_count: >=20 > .. table:: COUNT > @@ -1755,8 +1742,6 @@ to make shared counters. > +------------+---------------------------------+ > | Field | Value | > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > - | ``shared`` | DEPRECATED, shared counter flag | > - +------------+---------------------------------+ > | ``id`` | counter id | > +------------+---------------------------------+ >=20 > diff --git a/doc/guides/rel_notes/deprecation.rst > b/doc/guides/rel_notes/deprecation.rst > index 59445a6f42..21ef39841f 100644 > --- a/doc/guides/rel_notes/deprecation.rst > +++ b/doc/guides/rel_notes/deprecation.rst > @@ -124,10 +124,6 @@ Deprecation Notices > to support modifying fields larger than 64 bits. > In addition, documentation will be updated to clarify byte order. >=20 > -* ethdev: Attribute ``shared`` of the ``struct rte_flow_action_count`` > - is deprecated and will be removed in DPDK 21.11. Shared counters shoul= d > - be managed using shared actions API (``rte_flow_shared_action_create`` > etc). > - > * ethdev: Definition of the flow API action > ``RTE_FLOW_ACTION_TYPE_PORT_ID`` > is ambiguous and needs clarification. > Structure ``rte_flow_action_port_id`` will be extended to specify diff= --git > a/doc/guides/rel_notes/release_21_11.rst > b/doc/guides/rel_notes/release_21_11.rst > index a84c912f20..0d91ad5d7b 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -126,6 +126,10 @@ Removed Items > blacklist/whitelist are removed. Users must use the new > block/allow list arguments. >=20 > +* ethdev: Removed deprecated ``shared`` attribute of the > + ``struct rte_flow_action_count``. Shared counters should be managed > + using indirect actions API (``rte_flow_action_handle_create`` etc). > + >=20 > API Changes > ----------- > diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c > b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c > index 3a9c9bba27..f1e270af8b 100644 > --- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c > +++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c > @@ -2111,11 +2111,6 @@ ulp_rte_count_act_handler(const struct > rte_flow_action *action_item, >=20 > act_count =3D action_item->conf; > if (act_count) { > - if (act_count->shared) { > - BNXT_TF_DBG(ERR, > - "Parse Error:Shared count not support= ed\n"); > - return BNXT_TF_RC_PARSE_ERR; > - } > memcpy(&act_prop- > >act_details[BNXT_ULP_ACT_PROP_IDX_COUNT], > &act_count->id, > BNXT_ULP_ACT_PROP_SZ_COUNT); diff --git > a/drivers/net/cnxk/cnxk_rte_flow.c b/drivers/net/cnxk/cnxk_rte_flow.c > index 32c1b5dee5..27defd2fa9 100644 > --- a/drivers/net/cnxk/cnxk_rte_flow.c > +++ b/drivers/net/cnxk/cnxk_rte_flow.c > @@ -110,7 +110,6 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, > const struct rte_flow_attr *attr, > struct roc_npc_action in_actions[], uint32_t *flowkey_cf= g) { > struct cnxk_eth_dev *dev =3D cnxk_eth_pmd_priv(eth_dev); > - const struct rte_flow_action_count *act_count; > const struct rte_flow_action_queue *act_q; > int i =3D 0, rc =3D 0; > int rq; > @@ -131,13 +130,6 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, > const struct rte_flow_attr *attr, > break; >=20 > case RTE_FLOW_ACTION_TYPE_COUNT: > - act_count =3D (const struct rte_flow_action_count= *) > - actions->conf; > - > - if (act_count->shared =3D=3D 1) { > - plt_npc_dbg("Shared counter is not suppor= ted"); > - goto err_exit; > - } > in_actions[i].type =3D ROC_NPC_ACTION_TYPE_COUNT; > break; >=20 > diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c > index 841e0b9da3..fe1a387526 100644 > --- a/drivers/net/hns3/hns3_flow.c > +++ b/drivers/net/hns3/hns3_flow.c > @@ -1782,8 +1782,7 @@ hns3_flow_create(struct rte_eth_dev *dev, const > struct rte_flow_attr *attr, > goto out; >=20 > if (fdir_rule.flags & HNS3_RULE_FLAG_COUNTER) { > - ret =3D hns3_counter_new(dev, fdir_rule.act_cnt.shared, > - fdir_rule.act_cnt.id, error); > + ret =3D hns3_counter_new(dev, 0, fdir_rule.act_cnt.id, > + error); > if (ret) > goto out; >=20 > diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir= _filter.c > index e0cca7cb3c..14e4e069c4 100644 > --- a/drivers/net/ice/ice_fdir_filter.c > +++ b/drivers/net/ice/ice_fdir_filter.c > @@ -1339,9 +1339,7 @@ ice_fdir_create_filter(struct ice_adapter *ad, > if (filter->input.cnt_ena) { > struct rte_flow_action_count *act_count =3D &filter->act_= count; >=20 > - filter->counter =3D ice_fdir_counter_alloc(pf, > - act_count->share= d, > - act_count->id); > + filter->counter =3D ice_fdir_counter_alloc(pf, 0, > + act_count->id); > if (!filter->counter) { > rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ACTION, NULL,= diff --git > a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index > 3581414b78..ba48a0fee2 100644 > --- a/drivers/net/mlx5/mlx5.h > +++ b/drivers/net/mlx5/mlx5.h > @@ -324,7 +324,6 @@ struct mlx5_lb_ctx { #define > MLX5_MAX_PENDING_QUERIES 4 #define MLX5_CNT_CONTAINER_RESIZE > 64 #define MLX5_CNT_SHARED_OFFSET 0x80000000 -#define > IS_LEGACY_SHARED_CNT(cnt) (!!((cnt) & MLX5_CNT_SHARED_OFFSET)) > #define IS_BATCH_CNT(cnt) (((cnt) & (MLX5_CNT_SHARED_OFFSET - 1)) >=3D \ > MLX5_CNT_BATCH_OFFSET) #define MLX5_CNT_SIZE > (sizeof(struct mlx5_flow_counter)) @@ -392,12 +391,6 @@ struct > mlx5_flow_counter_shared { > }; > }; >=20 > -/* Shared counter configuration. */ > -struct mlx5_shared_counter_conf { > - struct rte_eth_dev *dev; /* The device shared counter belongs to.= */ > - uint32_t id; /* The shared counter ID. */ > -}; > - > struct mlx5_flow_counter_pool; > /* Generic counters information. */ > struct mlx5_flow_counter { > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c index b610ad3ef4..91314d5ea5 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -3308,33 +3308,11 @@ flow_dv_validate_action_set_tag(struct > rte_eth_dev *dev, > return 0; > } >=20 > -/** > - * Check if action counter is shared by either old or new mechanism. > - * > - * @param[in] action > - * Pointer to the action structure. > - * > - * @return > - * True when counter is shared, false otherwise. > - */ > -static inline bool > -is_shared_action_count(const struct rte_flow_action *action) -{ > - const struct rte_flow_action_count *count =3D > - (const struct rte_flow_action_count *)action->con= f; > - > - if ((int)action->type =3D=3D MLX5_RTE_FLOW_ACTION_TYPE_COUNT) > - return true; > - return !!(count && count->shared); > -} > - > /** > * Validate count action. > * > * @param[in] dev > * Pointer to rte_eth_dev structure. > - * @param[in] shared > - * Indicator if action is shared. > * @param[in] action_flags > * Holds the actions detected until now. > * @param[out] error > @@ -3344,7 +3322,7 @@ is_shared_action_count(const struct > rte_flow_action *action) > * 0 on success, a negative errno value otherwise and rte_errno is set= . > */ > static int > -flow_dv_validate_action_count(struct rte_eth_dev *dev, bool shared, > +flow_dv_validate_action_count(struct rte_eth_dev *dev, > uint64_t action_flags, > struct rte_flow_error *error) { @@ -3356,1= 1 +3334,6 @@ > flow_dv_validate_action_count(struct rte_eth_dev *dev, bool shared, > return rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ACTION, NUL= L, > "duplicate count actions set"); > - if (shared && (action_flags & MLX5_FLOW_ACTION_AGE) && This check is relevant to the indirect action case in some places, see belo= w. > - !priv->sh->flow_hit_aso_en) > - return rte_flow_error_set(error, EINVAL, > - RTE_FLOW_ERROR_TYPE_ACTION, NUL= L, > - "old age and shared count combi= nation is not > supported"); > #ifdef HAVE_IBV_FLOW_DEVX_COUNTERS > return 0; > #endif > @@ -5658,9 +5631,7 @@ flow_dv_validate_action_sample(uint64_t > *action_flags, > break; > case RTE_FLOW_ACTION_TYPE_COUNT: > ret =3D flow_dv_validate_action_count > - (dev, is_shared_action_count(act), > - *action_flags | sub_action_flags, > - error); > + (dev, *action_flags | sub_action_flags, > + error); > if (ret < 0) > return ret; > *count =3D act->conf; @@ -6230,60 +6201,6 @@ > flow_dv_counter_alloc(struct rte_eth_dev *dev, uint32_t age) > return 0; > } >=20 > -/** > - * Allocate a shared flow counter. > - * > - * @param[in] ctx > - * Pointer to the shared counter configuration. > - * @param[in] data > - * Pointer to save the allocated counter index. > - * > - * @return > - * Index to flow counter on success, 0 otherwise and rte_errno is set. > - */ > - > -static int32_t > -flow_dv_counter_alloc_shared_cb(void *ctx, union mlx5_l3t_data *data) -{ > - struct mlx5_shared_counter_conf *conf =3D ctx; > - struct rte_eth_dev *dev =3D conf->dev; > - struct mlx5_flow_counter *cnt; > - > - data->dword =3D flow_dv_counter_alloc(dev, 0); > - data->dword |=3D MLX5_CNT_SHARED_OFFSET; > - cnt =3D flow_dv_counter_get_by_idx(dev, data->dword, NULL); > - cnt->shared_info.id =3D conf->id; > - return 0; > -} > - > -/** > - * Get a shared flow counter. > - * > - * @param[in] dev > - * Pointer to the Ethernet device structure. > - * @param[in] id > - * Counter identifier. > - * > - * @return > - * Index to flow counter on success, 0 otherwise and rte_errno is set. > - */ > -static uint32_t > -flow_dv_counter_get_shared(struct rte_eth_dev *dev, uint32_t id) -{ > - struct mlx5_priv *priv =3D dev->data->dev_private; > - struct mlx5_shared_counter_conf conf =3D { > - .dev =3D dev, > - .id =3D id, > - }; > - union mlx5_l3t_data data =3D { > - .dword =3D 0, > - }; > - > - mlx5_l3t_prepare_entry(priv->sh->cnt_id_tbl, id, &data, > - flow_dv_counter_alloc_shared_cb, &conf); > - return data.dword; > -} > - Need to remove cnt_id_tbl and from sh and all of its management, no? > /** > * Get age param from counter index. > * > @@ -6366,16 +6283,6 @@ flow_dv_counter_free(struct rte_eth_dev *dev, > uint32_t counter) > if (pool->is_aged) { > flow_dv_counter_remove_from_age(dev, counter, cnt); > } else { > - /* > - * If the counter action is shared by ID, the l3t_clear_e= ntry > - * function reduces its references counter. If after the > - * reduction the action is still referenced, the function > - * returns here and does not release it. > - */ > - if (IS_LEGACY_SHARED_CNT(counter) && > - mlx5_l3t_clear_entry(priv->sh->cnt_id_tbl, > - cnt->shared_info.id)) > - return; > /* > * If the counter action is shared by indirect action API= , > * the atomic function reduces its references counter. > @@ -6385,8 +6292,7 @@ flow_dv_counter_free(struct rte_eth_dev *dev, > uint32_t counter) You can remove the ID sharing notice in this comment. > * indirect action API, shared info is 1 before the reduc= tion, > * so this condition is failed and function doesn't retur= n here. > */ > - if (!IS_LEGACY_SHARED_CNT(counter) && > - __atomic_sub_fetch(&cnt->shared_info.refcnt, 1, > + if (__atomic_sub_fetch(&cnt->shared_info.refcnt, 1, > __ATOMIC_RELAXED)) > return; > } > @@ -7275,7 +7181,6 @@ flow_dv_validate(struct rte_eth_dev *dev, const > struct rte_flow_attr *attr, > } > for (; actions->type !=3D RTE_FLOW_ACTION_TYPE_END; actions++) { > int type =3D actions->type; > - bool shared_count =3D false; >=20 > if (!mlx5_flow_os_action_supported(type)) > return rte_flow_error_set(error, ENOTSUP, @@ -742= 7,8 +7332,7 > @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr > *attr, > break; > case MLX5_RTE_FLOW_ACTION_TYPE_COUNT: > case RTE_FLOW_ACTION_TYPE_COUNT: > - shared_count =3D is_shared_action_count(actions); We need shared_count for the indirect count case(which can be shared with d= ifferent flows), So, if the action is MLX5_RTE_FLOW_ACTION_TYPE_COUNT, shared_count should b= e true. It is relevant to the validate function below and for the check at the end = of the function. > - ret =3D flow_dv_validate_action_count(dev, shared= _count, > + ret =3D flow_dv_validate_action_count(dev, > action_flags, > error); > if (ret < 0) > @@ -7747,12 +7651,6 @@ flow_dv_validate(struct rte_eth_dev *dev, const > struct rte_flow_attr *attr, > * mutual exclusion with share counter actions. > */ > if (!priv->sh->flow_hit_aso_en) { > - if (shared_count) > - return rte_flow_error_set > - (error, EINVAL, > - RTE_FLOW_ERROR_TYPE_ACTIO= N, > - NULL, > - "old age and shared count= combination is not > supported"); > if (sample_count) > return rte_flow_error_set > (error, EINVAL, @@ -10837= ,16 +10735,14 @@ > flow_dv_translate_action_port_id(struct rte_eth_dev *dev, static uint32_= t > flow_dv_translate_create_counter(struct rte_eth_dev *dev, > struct mlx5_flow *dev_flow, > - const struct rte_flow_action_count *count= , > + const struct rte_flow_action_count *count > + __rte_unused, > const struct rte_flow_action_age *age) { > uint32_t counter; > struct mlx5_age_param *age_param; >=20 > - if (count && count->shared) > - counter =3D flow_dv_counter_get_shared(dev, count->id); > - else > - counter =3D flow_dv_counter_alloc(dev, !!age); > + counter =3D flow_dv_counter_alloc(dev, !!age); > if (!counter || age =3D=3D NULL) > return counter; > age_param =3D flow_dv_counter_idx_get_age(dev, counter); @@ - > 13216,8 +13112,7 @@ flow_dv_translate(struct rte_eth_dev *dev, > * when they are not shared. > */ > if (action_flags & MLX5_FLOW_ACTION_AGE) { > - if ((non_shared_age && > - count && !count->shared) || > + if ((non_shared_age && count) || > !(priv->sh->flow_hit_aso_en && > (attr->group || attr->transfer))) { > /* Creates age by counters. */ @@= -17469,19 +17364,7 > @@ flow_dv_action_validate(struct rte_eth_dev *dev, > "Indirect age action not = supported"); > return flow_dv_validate_action_age(0, action, dev, err); > case RTE_FLOW_ACTION_TYPE_COUNT: > - /* > - * There are two mechanisms to share the action count. > - * The old mechanism uses the shared field to share, whil= e the > - * new mechanism uses the indirect action API. > - * This validation comes to make sure that the two mechan= isms > - * are not combined. > - */ > - if (is_shared_action_count(action)) > - return rte_flow_error_set(err, ENOTSUP, > - RTE_FLOW_ERROR_TYPE_ACT= ION, > - NULL, > - "Mix shared and indirec= t counter is not supported"); > - return flow_dv_validate_action_count(dev, true, 0, err); > + return flow_dv_validate_action_count(dev, 0, err); Did you also consider improving struct mlx5_flow_counter_shared? Then, mayb= e we don't need it anymore. > case RTE_FLOW_ACTION_TYPE_CONNTRACK: > if (!priv->sh->ct_aso_en) > return rte_flow_error_set(err, ENOTSUP, diff --gi= t > a/drivers/net/mlx5/mlx5_flow_verbs.c > b/drivers/net/mlx5/mlx5_flow_verbs.c > index b93fd4d2c9..1627c3905f 100644 > --- a/drivers/net/mlx5/mlx5_flow_verbs.c > +++ b/drivers/net/mlx5/mlx5_flow_verbs.c > @@ -250,8 +250,6 @@ flow_verbs_counter_create(struct rte_eth_dev > *dev, > * > * @param[in] dev > * Pointer to the Ethernet device structure. > - * @param[in] shared > - * Indicate if this counter is shared with other flows. > * @param[in] id > * Counter identifier. > * > @@ -259,21 +257,17 @@ flow_verbs_counter_create(struct rte_eth_dev > *dev, > * Index to the counter, 0 otherwise and rte_errno is set. > */ > static uint32_t > -flow_verbs_counter_new(struct rte_eth_dev *dev, uint32_t shared, > uint32_t id) > +flow_verbs_counter_new(struct rte_eth_dev *dev, uint32_t id > +__rte_unused) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > struct mlx5_flow_counter_mng *cmng =3D &priv->sh->cmng; > struct mlx5_flow_counter_pool *pool =3D NULL; > struct mlx5_flow_counter *cnt =3D NULL; > - union mlx5_l3t_data data; > uint32_t n_valid =3D cmng->n_valid; > uint32_t pool_idx, cnt_idx; > uint32_t i; > int ret; >=20 > - if (shared && !mlx5_l3t_get_entry(priv->sh->cnt_id_tbl, id, &data= ) && > - data.dword) > - return data.dword; > for (pool_idx =3D 0; pool_idx < n_valid; ++pool_idx) { > pool =3D cmng->pools[pool_idx]; > if (!pool) > @@ -320,13 +314,6 @@ flow_verbs_counter_new(struct rte_eth_dev *dev, > uint32_t shared, uint32_t id) > TAILQ_REMOVE(&pool->counters[0], cnt, next); > i =3D MLX5_CNT_ARRAY_IDX(pool, cnt); > cnt_idx =3D MLX5_MAKE_CNT_IDX(pool_idx, i); > - if (shared) { > - data.dword =3D cnt_idx; > - if (mlx5_l3t_set_entry(priv->sh->cnt_id_tbl, id, &data)) > - return 0; > - cnt->shared_info.id =3D id; > - cnt_idx |=3D MLX5_CNT_SHARED_OFFSET; > - } > /* Create counter with Verbs. */ > ret =3D flow_verbs_counter_create(dev, cnt); > if (!ret) { > @@ -352,14 +339,10 @@ flow_verbs_counter_new(struct rte_eth_dev > *dev, uint32_t shared, uint32_t id) static void > flow_verbs_counter_release(struct rte_eth_dev *dev, uint32_t counter) { > - struct mlx5_priv *priv =3D dev->data->dev_private; > struct mlx5_flow_counter_pool *pool; > struct mlx5_flow_counter *cnt; >=20 > cnt =3D flow_verbs_counter_get_by_idx(dev, counter, &pool); > - if (IS_LEGACY_SHARED_CNT(counter) && > - mlx5_l3t_clear_entry(priv->sh->cnt_id_tbl, cnt->shared_info.i= d)) > - return; > #if defined(HAVE_IBV_DEVICE_COUNTERS_SET_V42) > claim_zero(mlx5_glue->destroy_counter_set > ((struct ibv_counter_set *)cnt->dcs_when_active))= ; @@ -1198,8 > +1181,7 @@ flow_verbs_translate_action_count(struct mlx5_flow > *dev_flow, #endif >=20 > if (!flow->counter) { > - flow->counter =3D flow_verbs_counter_new(dev, count->shar= ed, > - count->id); > + flow->counter =3D flow_verbs_counter_new(dev, count->id); > if (!flow->counter) > return rte_flow_error_set(error, rte_errno, > RTE_FLOW_ERROR_TYPE_ACT= ION, diff --git > a/drivers/net/octeontx2/otx2_flow_parse.c > b/drivers/net/octeontx2/otx2_flow_parse.c > index 63a33142a5..30a232f033 100644 > --- a/drivers/net/octeontx2/otx2_flow_parse.c > +++ b/drivers/net/octeontx2/otx2_flow_parse.c > @@ -901,7 +901,6 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev, > struct otx2_eth_dev *hw =3D dev->data->dev_private; > struct otx2_npc_flow_info *npc =3D &hw->npc_flow; > const struct rte_flow_action_port_id *port_act; > - const struct rte_flow_action_count *act_count; > const struct rte_flow_action_mark *act_mark; > const struct rte_flow_action_queue *act_q; > const struct rte_flow_action_vf *vf_act; @@ -947,15 +946,6 @@ > otx2_flow_parse_actions(struct rte_eth_dev *dev, > break; >=20 > case RTE_FLOW_ACTION_TYPE_COUNT: > - act_count =3D > - (const struct rte_flow_action_count *) > - actions->conf; > - > - if (act_count->shared =3D=3D 1) { > - errmsg =3D "Shared Counters not supported= "; > - errcode =3D ENOTSUP; > - goto err_exit; > - } > /* Indicates, need a counter */ > flow->ctr_id =3D 1; > req_act |=3D OTX2_FLOW_ACT_COUNT; diff --git > a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index > 4b520bc619..5fcdf9c2f5 100644 > --- a/drivers/net/sfc/sfc_mae.c > +++ b/drivers/net/sfc/sfc_mae.c > @@ -2802,16 +2802,12 @@ sfc_mae_rule_parse_action_mark(struct > sfc_adapter *sa, >=20 > static int > sfc_mae_rule_parse_action_count(struct sfc_adapter *sa, > - const struct rte_flow_action_count *conf, > + const struct rte_flow_action_count *conf > + __rte_unused, > efx_mae_actions_t *spec) { > int rc; >=20 > - if (conf->shared) { > - rc =3D ENOTSUP; > - goto fail_counter_shared; > - } > - > if ((sa->counter_rxq.state & SFC_COUNTER_RXQ_INITIALIZED) =3D=3D = 0) { > sfc_err(sa, > "counter queue is not configured for COUNT action= "); @@ - > 2837,7 +2833,6 @@ sfc_mae_rule_parse_action_count(struct sfc_adapter > *sa, > fail_populate_count: > fail_no_service_core: > fail_counter_queue_uninit: > -fail_counter_shared: >=20 > return rc; > } > diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c > b/drivers/net/softnic/rte_eth_softnic_flow.c > index 27eaf380cd..39038d26d8 100644 > --- a/drivers/net/softnic/rte_eth_softnic_flow.c > +++ b/drivers/net/softnic/rte_eth_softnic_flow.c > @@ -1448,13 +1448,6 @@ flow_rule_action_get(struct pmd_internals > *softnic, > action, > "COUNT: Null configuration"); >=20 > - if (conf->shared) > - return rte_flow_error_set(error, > - ENOTSUP, > - RTE_FLOW_ERROR_TYPE_ACTION_CONF, > - conf, > - "COUNT: Shared counters not suppo= rted"); > - > if (n_count) > return rte_flow_error_set(error, > ENOTSUP, diff --git a/lib/ethdev/= rte_flow.h > b/lib/ethdev/rte_flow.h index 7b1ed7f110..5306e8ca4b 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -75,7 +75,7 @@ extern "C" { > * At least one direction must be specified. > * > * Specifying both directions at once for a given rule is not recommende= d > - * but may be valid in a few cases (e.g. shared counter). > + * but may be valid in a few cases. > */ > struct rte_flow_attr { > uint32_t group; /**< Priority group. */ @@ -2498,24 +2498,11 @@ s= truct > 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_INDIRECT action. > - * > - * The shared flag indicates whether the counter is unique to the flow r= ule > the > - * action is specified with, or whether it is a shared counter. > - * > - * For a count action with the shared flag set, then then a global devic= e > - * namespace is assumed for the counter id, so that any matched flow rul= es > using > - * a count action with the same counter id on the same port will contrib= ute > to > - * that counter. > - * > * For ports within the same switch domain then the counter id namespace > extends > * to all ports within that switch domain. > */ > struct rte_flow_action_count { > - /** @deprecated Share counter ID with other flow rules. */ > - uint32_t shared:1; > - uint32_t reserved:31; /**< Reserved, must be zero. */ > + uint32_t reserved; /**< Reserved, must be zero. */ > uint32_t id; /**< Counter ID. */ }; >=20 > -- > 2.30.2