From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0079.outbound.protection.outlook.com [104.47.2.79]) by dpdk.org (Postfix) with ESMTP id 04D9725D9 for ; Thu, 26 Jul 2018 07:39:20 +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:X-MS-Exchange-SenderADCheck; bh=pFSom4Xe1lGyNv8jP/GBKs0uF5cT48ov2tPjwIFNSNk=; b=A8iDvKr7iro0EU8tTFMmjDZBppKdxG3bgTmg0ma++mKpK/FcjxAc/OEWGgOtyTMtjqXibxigQJNbaQhmXlRawX45b0eiJAp/mq1bzUWwLVPbu0zsT3ctiAePK7n1ZKsD+NVmt9DwxRUpnrUjCrkqKrKzqgMUfiAOSTHTv2SY8Po= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB5050.eurprd05.prod.outlook.com (20.176.236.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.22; Thu, 26 Jul 2018 05:39:18 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::52a:650b:ae10:fc3]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::52a:650b:ae10:fc3%4]) with mapi id 15.20.0995.014; Thu, 26 Jul 2018 05:39:18 +0000 From: Shahaf Shuler To: Yongseok Koh , =?iso-8859-1?Q?N=E9lio_Laranjeiro?= CC: "dev@dpdk.org" , Ori Kam , Wisam Monther , Raslan Darawsheh Thread-Topic: [PATCH] net/mlx5: fix count query when flow has not counters Thread-Index: AQHUI/P4qhCRbaCw3EuBsX897NXq6qSgMPyAgADM7oA= Date: Thu, 26 Jul 2018 05:39:18 +0000 Message-ID: References: <5078406F-E033-43EA-8FFF-0D53EA58DD57@mellanox.com> In-Reply-To: <5078406F-E033-43EA-8FFF-0D53EA58DD57@mellanox.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=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB5050; 6:htAP3eXioH8KJXZOcoVOrBTYhBtF2DZdfTc3nDJHXPRdLrWAYjeqD+bpoEeyovOZBhOsVxG1sTZ4d9XeqE0GTrHGNMdyXduAScnrnFhyKN52p04ZNAwYvKxN99UrTlXZuKQPnbjJB/0gpVSJuDn9pWyJZA7ssW7aTC7z00YyqfnVbn+eMNqKLH/HZaZonFn7/SPSYMXafMvaPRXmUEKuNK2SMLGw9LuAOToOXvbMTdxVW5kbhUxV8ZbGEYOyaodiX8Ica7PmnxryBa2DheR2sy6omddcEnH6vjCr5sje3mQU4jf28fto/MQ2aFo79vxIxX0W9PzV6y/SYGzcwaKRsI01ls6thBKUvCHfS8fq5mFd8Y3jCrSrDkEJSUmF7aTjMbRzR8EqqNKcMeWqwekqws4f0IP94Mi3nB97+pwWEKGIouZYD6o4Ap8Q0/PgS7j621BUdOdgFKhD24tloyJpRQ==; 5:Fy4AoRYcao3FhKFnFLcYHUL2mu80cca++7nC7NoH06s4kaqKiiFF3UvvqAK0rysREKHFmLRJetkTmRXAXywJBc1c6NmRqvzEQaJz3AKRfZl7QMUydPB+Jlo2IEbrb2w2rSQqgdP69hBIkhHMPZu1FYhr+0n+FVeH3nA191mIDIc=; 7:j5TL097vEm7TbtwBmrsEOXgv6wSh4G8ilLawD0AReokoQPza6E4KY9DKmxoKaQblS+tbUsrYg3xZmxbvZmHjXuc+8uFN9Lvc58lGHH/A43/NivZSsMRCO5lh7RjPgp+PjRCRuZRhHK1xamfgncKmiyYqfT9IZm1B7wRe1spuwFUTi/KrETHtuOZWup+PZ8ZpSwsIEls0vAMydI5uOXiu8Ti/PwZuVwocHNNSL//s1+nmvbSut/y2zFfIlpuf4A4/ x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: a57ec3fa-0299-4297-3c16-08d5f2ba21ae x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB5050; x-ms-traffictypediagnostic: DB7PR05MB5050: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB5050; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB5050; x-forefront-prvs: 07459438AA x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(366004)(136003)(346002)(376002)(189003)(199004)(2900100001)(25786009)(66066001)(97736004)(256004)(2906002)(14444005)(81156014)(8676002)(107886003)(6436002)(6246003)(8936002)(81166006)(53936002)(86362001)(229853002)(55016002)(14454004)(4326008)(7736002)(74316002)(316002)(99286004)(3846002)(9686003)(446003)(305945005)(476003)(5660300001)(7696005)(33656002)(53546011)(110136005)(11346002)(76176011)(6116002)(68736007)(102836004)(105586002)(5250100002)(6506007)(106356001)(26005)(486006)(478600001)(54906003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB5050; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: EDfLjcvn8lwWrwGZYIlhhi/nCufD9wCg8ZrHNuMMGG6tMvyF9eJNB7GXZQnRqYyfBV888jvNkbPIR+oV898t9HNwnVh1wqZOdY3kfYugN56NlZLR/KlsDlwISQ2Cn1mf5osW93c6fnndGA7Wi1U3fQUEadpVtRLeXGhZjON2t7jHZFoFUD2Vdvla4Li/W0bkf/0gpIBHNz+6hfY5s13kS3ONtnPvTwqV0S0TjFP/vSvW5vmhbetuZgpbC4Vhl63vZFh3UMpBqTump+AbbJ9ZjcBgTntuDoEZuHpstUeDi1itmiEUZ2IiM/xhfjPtcO/LVeYENapUklB+NZaxbq8obXlU2zJveX0LeIgqqHbzr0w= 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-Network-Message-Id: a57ec3fa-0299-4297-3c16-08d5f2ba21ae X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jul 2018 05:39:18.4407 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5050 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix count query when flow has not counters 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, 26 Jul 2018 05:39:20 -0000 Wednesday, July 25, 2018 8:25 PM, Yongseok Koh: > Subject: Re: [PATCH] net/mlx5: fix count query when flow has not counters >=20 >=20 > > On Jul 25, 2018, at 1:46 AM, Nelio Laranjeiro > wrote: > > > > Querying a counters on a flow without counter is ending with a > > segmentation fault. > > > > Fixes: 60bd8c9747e8 ("net/mlx5: add count flow action") > > > > Signed-off-by: Nelio Laranjeiro > > --- > > drivers/net/mlx5/mlx5_flow.c | 56 ++++++++++++++++++++---------------- > > 1 file changed, 32 insertions(+), 24 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5_flow.c > > b/drivers/net/mlx5/mlx5_flow.c index 6fa4e30ae..efaa8b4fb 100644 > > --- a/drivers/net/mlx5/mlx5_flow.c > > +++ b/drivers/net/mlx5/mlx5_flow.c > > @@ -3192,32 +3192,40 @@ mlx5_flow_query_count(struct rte_flow *flow > __rte_unused, > > struct rte_flow_error *error) > > { > > #ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT > > - struct rte_flow_query_count *qc =3D data; > > - uint64_t counters[2] =3D {0, 0}; > > - struct ibv_query_counter_set_attr query_cs_attr =3D { > > - .cs =3D flow->counter->cs, > > - .query_flags =3D IBV_COUNTER_SET_FORCE_UPDATE, > > - }; > > - struct ibv_counter_set_data query_out =3D { > > - .out =3D counters, > > - .outlen =3D 2 * sizeof(uint64_t), > > - }; > > - int err =3D mlx5_glue->query_counter_set(&query_cs_attr, > &query_out); > > + if (flow->modifier & MLX5_FLOW_MOD_COUNT) { >=20 > Instead of adding extra indentation, how about returning error immediatel= y > if the flow doesn't have a counter? That looks more natural. But even if = you > insist this way, I'm also okay. Please let Shahaf know if you will submit= v2. >=20 > Acked-by: Yongseok Koh I will take this one, Applied to next-net-mlx, thanks.=20