From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20084.outbound.protection.outlook.com [40.107.2.84]) by dpdk.org (Postfix) with ESMTP id 1F7427CC0 for ; Thu, 24 Aug 2017 16:04:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=S2n9OhzNs+X4GpzhESBnRViFRbVa0M/8arlbElrMpUQ=; b=aZlJwohCTEANcILPvCxUBaaYzYY3PlK3oj+6Dti9zDDZPp9E4v6bLMFkCD8OCHPxWStqO8GT9XhU4L//OMmwByad0CC4S0Ybgtkmk1WL5UlUV2HGwSppXQ72iPcypO7t9X8zS3X8ysYj3CXo+xULLOsbMuadq+9UgpG9eqP/SN8= Received: from AM4PR05MB3202.eurprd05.prod.outlook.com (10.171.186.31) by AM4PR05MB1683.eurprd05.prod.outlook.com (10.165.245.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1362.18; Thu, 24 Aug 2017 14:04:32 +0000 Received: from AM4PR05MB3202.eurprd05.prod.outlook.com ([fe80::b121:ca37:1513:71f7]) by AM4PR05MB3202.eurprd05.prod.outlook.com ([fe80::b121:ca37:1513:71f7%13]) with mapi id 15.01.1385.010; Thu, 24 Aug 2017 14:04:32 +0000 From: Ori Kam To: =?iso-8859-1?Q?N=E9lio_Laranjeiro?= CC: "adrien.mazaruil@6wind.com" , "dev@dpdk.org" Thread-Topic: [RFC] net/mlx5: support count flow action Thread-Index: AQHTHKXX2zaW5WJZaUOhRs6ppadx9aKTFgCA Date: Thu, 24 Aug 2017 14:04:32 +0000 Message-ID: References: <1503318941-42015-1-git-send-email-orika@mellanox.com> <20170824065419.GH12995@autoinstall.dev.6wind.com> In-Reply-To: <20170824065419.GH12995@autoinstall.dev.6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB1683; 6:J7rJpTCoKB3HntUBgBwf+OVlqGKuTM5mRqcYvQeLOSYotjEv6bdAEWNDWIx0Tr0DgJq1BOpmW7xXoWdKVmV2l/vfKgQ8IwRkV4H2b+SmLZW7ljCryiaqBOyjavK53Nw2zXZrbaUhdhJ/HKdyhdhFyB1tN/KCU9Yz4AOCpCbvpRGVx0O+Kl/T+GMVocF4JzQyvXK/6itUrw/7nR6PM6LxRQeiiP/QxU87SMtT1H0Dwzfa/LH1w0ZcPcWJeZwqBibQHCMNGaxEP6GOFq2LhX6AQdO8sX4rXGkJn60i9Nn/xs0oKEFA65685GGF4dMnS6yWfpWRO/4Tl/YLtygjOFCbeQ==; 5:95fIcvlu4eO1bV8ywnC3IWmYyypQgXgDW9wwPlOw9C8wUQON/lC9K+XkLSj1MF4DK2NVLm59m9hha71ijbsy/l+YKYhPKqrtQ65OkKwTgHd7OP4UiyjY0+nPDyje4Bw68Zu+DC9uufATpltbGaT+bMXI9d5OUoWJ0Ng5WA10nQQ=; 24:wVNwmxbFmJrNXrdF3cSl8uU+y9/suttk2rIpnSGv61isqk0G+WBn4Haeb3BQQePOryidZwgiQ8Ga1XDYO0bIfAdl+NQb0Mne7pdePLHam5E=; 7:/eVsz8i7/QwtsNrDruV9wCwx85wLeHp8U+uUnVA+CG2WB/3DDOvE9F99KCxG5NzLneuYEQPGK/zIwrPtTYWDSEsDVeGrlFaA7ugo0zF97RgSpRPFPLj9mokHI7ZPATQAQY8P5vCdA1iqulqckDR88hyGCGU+GQjDpUPwGxxo946JqO5BWDyD0eJK1q/j418P18qny5ScC1HnKlbOzKDIMM3SrrsMIjUCW48l1/E5vUk= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-office365-filtering-correlation-id: 3e16d0bc-2351-45b9-646f-08d4eaf90b3d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:AM4PR05MB1683; x-ms-traffictypediagnostic: AM4PR05MB1683: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM4PR05MB1683; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM4PR05MB1683; x-forefront-prvs: 04097B7F7F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(13464003)(199003)(377454003)(189002)(24454002)(2950100002)(54356999)(6436002)(66066001)(6506006)(76176999)(3280700002)(97736004)(50986999)(2906002)(99286003)(9686003)(14454004)(229853002)(110136004)(53936002)(53546010)(55016002)(6246003)(68736007)(3660700001)(54906002)(6916009)(8676002)(5660300001)(81156014)(7696004)(2900100001)(4326008)(33656002)(3846002)(81166006)(6116002)(8936002)(7736002)(105586002)(101416001)(478600001)(86362001)(74316002)(25786009)(106356001)(189998001)(5250100002)(305945005)(102836003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1683; H:AM4PR05MB3202.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Aug 2017 14:04:32.1400 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1683 Subject: Re: [dpdk-dev] [RFC] net/mlx5: support count flow action X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Aug 2017 14:04:34 -0000 Hi Nelio, Please see my comments in line. Ori > -----Original Message----- > From: N=E9lio Laranjeiro [mailto:nelio.laranjeiro@6wind.com] > Sent: Thursday, August 24, 2017 9:54 AM > To: Ori Kam > Cc: adrien.mazaruil@6wind.com; dev@dpdk.org > Subject: Re: [RFC] net/mlx5: support count flow action >=20 > Hi Ori, >=20 > Please keep the coding style of the file, and pass checkpatch before > submitting a patch on the mailing list. It helps the review by having a = correct > patch respecting the coding style of the file. > I won't spot out here all the coding style issues, if you need some help,= feel > free to ask. >=20 Sorry won't happen again. > On Mon, Aug 21, 2017 at 03:35:41PM +0300, Ori Kam wrote: > > Support count flow action. >=20 > Why copy/pasting the title in the commit message? >=20 I was under the impression that main function of the RFC should also be in = the message body. > > This patch is basic design only, do to missing features on the verbs > > driver. As soon as the features will be implemented on the verbs > > driver this will be updated and rebased on top of > > dpdk.org/ml/archives/dev/2017-August/072351.html > > (The verbs driver should be ready starting September) > > > > This RFC should be applied on top of > > dpdk.org/ml/archives/dev/2017-August/072351.html >=20 > Last two comments should be after '---' line. >=20 Those two lines are part of the commit message, any way I will move them. > > Signed-off-by: Ori Kam > > --- > > drivers/net/mlx5/mlx5.h | 4 ++ > > drivers/net/mlx5/mlx5_flow.c | 163 > > ++++++++++++++++++++++++++++++++++++++++++- >=20 > There are missing changes in the Makefile to have the > HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_COUNT and the include of the > mlx5_autoconf.h in mlx5_flow.c. >=20 I haven't added them since this feature is not supported yet, and=20 I don't want anybody trying to activate them. When the feature will be supported on the verbs then I will update those files.=20 > > 2 files changed, 166 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index > > e89aba8..434e848 100644 > > --- a/drivers/net/mlx5/mlx5.h > > +++ b/drivers/net/mlx5/mlx5.h > >[...] > > +/** > > + * Query an existing flow rule. > > + * > > + * @see rte_flow_query() > > + * @see rte_flow_ops > > + */ > > +int > > +mlx5_flow_query(struct rte_eth_dev *dev, > > + struct rte_flow *flow, > > + enum rte_flow_action_type type, > > + void *res, > > + struct rte_flow_error *error) > > +{ > > + > > + int res_value =3D 0; > > + switch (type){ > > + case RTE_FLOW_ACTION_TYPE_COUNT: > > + if (!flow->counter) { > > + rte_flow_error_set(error, EINVAL, > > + > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > > + NULL, > > + "No counter > is set for this flow"); > > + return -1; >=20 > Wrong returned value, read the rte_flow_query API allowed values. >=20 Will be fixed > > + } > > +#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_COUNT > > + res_value =3D > priv_flow_query_counter(mlx5_get_priv(dev), flow->counter, > > + (struct rte_flow_query_count*)res, > > + error); > > +#else > > + rte_flow_error_set(error, ENOTSUP, > RTE_FLOW_ERROR_TYPE_ACTION, > > + NULL, > "Flow count unsupported"); > > + (void)dev; > > + (void)flow; > > + (void)type; > > + (void)res; > > + (void)error; > > + return -1; >=20 > Same here. >=20 Will be fixed. > > +#endif >=20 > I'll suggest to have a dedicated function here to handle this situation, = like a > mlx5_flow_query_counters() and call it from this case. It will clearly e= ase the > readability and maintenance. >=20 Will be update according to your suggestion. > Thanks, >=20 > -- > N=E9lio Laranjeiro > 6WIND Thanks, Ori Kam