From patchwork Sat Oct 27 10:54:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slava Ovsiienko X-Patchwork-Id: 47531 X-Patchwork-Delegate: shahafs@mellanox.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 57DAC2C60; Sat, 27 Oct 2018 12:54:25 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40079.outbound.protection.outlook.com [40.107.4.79]) by dpdk.org (Postfix) with ESMTP id 7D575DED; Sat, 27 Oct 2018 12:54:24 +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=//+oqZ6sRkJPqsrB6nZa2fZAy7Roje+S/Zx97YThA7g=; b=LLcH8uASoerp4tIAlKTKq32PAnx3Z5eLdCwK3eXoeNXiPvf83jRX6NastHJdUQxmCeiZW4ySQWRSQD9O+M+dsLQwzyDLhFBJfDdb+CwjQRJeIB5zgOUwwP3aq8v6hweABQsq2B4XYjIebn3f4jd6Io4P3+iiUSW6Z1YX554j4X0= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.186.150) by AM4PR05MB1699.eurprd05.prod.outlook.com (10.165.246.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.30; Sat, 27 Oct 2018 10:54:21 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::544b:a68d:e6a5:ba6e]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::544b:a68d:e6a5:ba6e%2]) with mapi id 15.20.1273.025; Sat, 27 Oct 2018 10:54:21 +0000 From: Slava Ovsiienko To: Shahaf Shuler CC: "dev@dpdk.org" , Slava Ovsiienko , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix flow counters deletion in Verbs Thread-Index: AQHUbeNqgkrAaXJ8pEGWL6OjmA8FvQ== Date: Sat, 27 Oct 2018 10:54:21 +0000 Message-ID: <1540637629-9233-1-git-send-email-viacheslavo@mellanox.com> References: <1540289032-29628-9-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1540289032-29628-9-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CWLP265CA0300.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:5d::24) To AM4PR05MB3265.eurprd05.prod.outlook.com (2603:10a6:205:4::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB1699; 6:5ofP7aHOyfDKqezRY6SdU4a+nUcbUeILMjG8ZkkeHwK9y8heqgOAmSOKv6cchYN8Fdp269tZsfwU72svfImsRXfLqklkKdWO1RfUy3cZ53YCHXNQ1iXyK6TGJ8PTl7ypRyipXKWiVl7ymY6x2ItbSxcuVboOumERpzI+xlS+E/QggPazhRdt+mPa7yOx+XV4GwRICj5rwOsr4TT/8LBSFdzf9zxSNBkW6MNa30bmqwgOtyItrNWhzN+spoMr8lezedq/BLa/NW55DDV9pE9ILU0tM9ke0aD39CrGrdbPHYKqH+D0YYRnQKvDFL7ET1L/DO1z9x/0TgPyedZjTMs0YMNALycFqigsX1hwnt/FGQaYLZVTDPRWlfr74Tq7HanraaDeKVw0cVEDYFSH5uAeSw9vSabghX6lGt2Bb6aZ1DjJz0+GAfKm5d9/kn5gxDQrV9rwPSlshIC+YkMi44UVM6znRUROzxo1lM/ero0uLEc=; 5:u7V5LIqIKkCbEoPyrAZoJBUT9VtnZEh0x7nJFVhz+VACZE7cIjWKZOFWuBZWT8Vg6S5FonWM64iCo9DGqZ2mjUIx+i6kq7zYJaCIGlUDuUhvSMHfixR9COPdy+/PSKO2dNsn+B8u98NL5IBd8IbnQtqetl7oPiCJGQ4TAaOahwo=; 7:x63hQWr8ipZJZI7LREhQ2L6t/gtQW7pytPggZNsbHCnq78vPaCCbyhPJcC5FmRILv04DM9Hk6xxv0bda3/KFq3rdI25Qe6k/ErNxcUalQ6OoXiolgJw3we+MBsthDCUg+0bvxXvh0H+wRKJYf6pGUPWaeqQFMnE+EDdss9QWZr4KMM3wIiY8mp9ZTvnPE0pTxNJx+ze6cg8NGF8OKXT5czCE6ZlEfCe+rNaPAslllJMQkO9OTRieisDajFI09Ebz x-ms-office365-filtering-correlation-id: ea9a5b53-cef8-49da-20c9-08d63bfa8c98 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB1699; x-ms-traffictypediagnostic: AM4PR05MB1699: 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)(8121501046)(5005006)(3231382)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB1699; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1699; x-forefront-prvs: 08381C729B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(376002)(366004)(39860400002)(396003)(199004)(189003)(6436002)(6512007)(36756003)(97736004)(53936002)(4326008)(106356001)(6486002)(6862004)(25786009)(68736007)(2900100001)(5660300001)(105586002)(1857600001)(86362001)(11346002)(186003)(2616005)(450100002)(5250100002)(476003)(446003)(256004)(486006)(8936002)(81166006)(54906003)(37006003)(8676002)(81156014)(7736002)(305945005)(6636002)(52116002)(99286004)(26005)(102836004)(6506007)(386003)(76176011)(14454004)(6116002)(3846002)(478600001)(2906002)(66066001)(316002)(71200400001)(71190400001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1699; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: FMfCuzj0tW7Fc4aXfRWTVLrrBpNsfL0d8qo0E363RKTz4cA3IYLcuYN1l/3C3+yqY8cOyyDA/iWQCrQU97eSCf/h+cn4rQpJbc44HcU1Oh2qGKZJOAPAiCFOBTqK3QYgLND/QRRgGv4anIid8M9hzCB3ljxdw7vDMiFhlSWThTGgmZFwc1tC8tP/bdlj6KDJHs35DwCgVDpOrbvvEGB3knhnr5MOcPHJyhEfTK41TYHn4r//mjYqMBUcpt1kIEECFO6Z4Ow1edi3SLLjJEzuuH20cgfnlWnUeSUzkGtGyPeOe568CZV1rnGkiEqDWgZY4pT4DBWXlfZDPtqWJcOUTZQSkpRLSEGkVcnFm1ew8t4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea9a5b53-cef8-49da-20c9-08d63bfa8c98 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2018 10:54:21.2865 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1699 Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow counters deletion in Verbs 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The Flow counters created with Verbs are erroneously destroyed in Flow remove function (flow_verbs_remove()). Counter Verbs handles stored in the translated rule buffer become invalid. If rule is reapplied with these invalid counter handles the driver hangs. The counter should be destroyed with Verbs in the Flow destroy function. The Flow remove function should keep counters intact. Fixes: 60bd8c9747e8 ("net/mlx5: add count flow action") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko Acked-by: Shahaf Shuler --- drivers/net/mlx5/mlx5_flow_verbs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c index 81bc39f..2e506b9 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -1669,10 +1669,6 @@ verbs->hrxq = NULL; } } - if (flow->counter) { - flow_verbs_counter_release(flow->counter); - flow->counter = NULL; - } } /** @@ -1696,6 +1692,10 @@ LIST_REMOVE(dev_flow, next); rte_free(dev_flow); } + if (flow->counter) { + flow_verbs_counter_release(flow->counter); + flow->counter = NULL; + } } /**