From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40064.outbound.protection.outlook.com [40.107.4.64]) by dpdk.org (Postfix) with ESMTP id 0E5811B2C5 for ; Mon, 30 Oct 2017 13:47:26 +0100 (CET) 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=YQB2qecnLXgG2QzD6TpynWE7Nxy6lxQNF7YPNcyZ0ag=; b=MLTc0jW/Pk3aav8blf4o2koow+dgQPgl4ckBpCKZ3tdhKtqU9ezJc+DNHTNFZfWCYt1zoyUzZ8vP3oi8utJmbFjNmlKh8SrMNsk5n2uffVwb6ayIF3rL2HhZ0VdkIJXFdNraOPkV7qPPxgnu6GLebxnLpH9IcaR2L2vIiRM64Qs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; Received: from localhost.localdomain (82.166.227.17) by DB6PR05MB3206.eurprd05.prod.outlook.com (2603:10a6:6:1a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Mon, 30 Oct 2017 12:47:24 +0000 From: Ori Kam To: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, yskoh@mellanox.com Cc: dev@dpdk.org, orika@mellanox.com Date: Mon, 30 Oct 2017 14:46:54 +0200 Message-Id: <1509367614-1626-1-git-send-email-orika@mellanox.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: VI1PR0801CA0088.eurprd08.prod.outlook.com (2603:10a6:800:7d::32) To DB6PR05MB3206.eurprd05.prod.outlook.com (2603:10a6:6:1a::32) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fa3686fb-8eea-497b-5794-08d51f945ed3 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(2017052603238); SRVR:DB6PR05MB3206; X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3206; 3:4xtfGu1MeCgdOcr0D605NGu7nqD8cJxSrKrawC5zU8bAO1W1qwxTi1pB6yUObbCkvaBu4MRzBHm/t9WWvK7ruaSdJAjUAd+Bl4COBAfbM4gUAp/5IWUUxeBT0N6utQs2EFMCWscmgn5gu9ep++k9FkMkkfgcZX3HPYiTT4jkL/T3sMvE5vc2ocuF7+CjeeYehck8YNBXR/uUGkNGtrDppnYS2lmVDE6XVIAcI3jog6wasLM+9NarPaxCM6c2UUj+; 25:g/E//GDqrs3XJWAGFp+qM+Umgee8BkvpFVTGK9Ihg4yzMMzKl4siigc5TV1Sd1fvCpNE7LN5e7M+ICS/ZVdzPe7dtVr1tgCgQceBHL0FIJOkAQ9zCdI061x+shvpwkxpkhUmeoz+E/FRiAB8WHKKR1XBB64q6ofnGGyB3M9/5LFG5naRaBEgoGtDgBObOx/kcRtMVSFjIjxdkg7tjRScR6g9Fhpf12ei2unjfqaudjPmR5HHNsOFx9f456y0ozdF5gn4NPCo3bB6+kJc6JbxfcEJRDJhHyzHYB9dA7ZDqPdGpoNhWSwSJ+PGqHY82hIadvqSQRDkpb14KiAK9Kp6nsNT170QAT3jtMWhu4U9IwA=; 31:i0C9APvZxhPhBaotFh21uxJN3vg5KFiFNTWL+cJDpQhKn+CBX8U72H4Wtcm1ddcAlEuyJI3dTvU+F8DtOPq97CD90ch/6B4bYbfY7yPhjC0Vsat2vNgnuSzOWPdjtOw6WpldRWe7BSQXftl5iRSJjt+7pPzmvfhEhzZNoQ4kza/FQo2ceQpLUKrIh66ZlJKC9cArGd3OYtlDJ4UPM86fEL6s+9KMHMChQQNQWcrF2Yc= X-MS-TrafficTypeDiagnostic: DB6PR05MB3206: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3206; 20:QJHgLdX03S1CDwbj8kUW/xXvhGis9NcbYPMJWE4VULenMuapvPpKqqSgTAw3iia4QsfOoo5qaqir1ZiLqNfQI8jITFigM/mABuBWRJrKMtydZOndsuhtknBGHD1sXDXfQfNpBx/rIb2XHfz5VAW2Jq7LMJGE2uDBUWvLjTYLHBYqYSGLFAr3VvoCFOrxH3n4HfAOWKoLMbhfebBuRrOMarwUpHzF4SwkLj/6SWRWvUW5x0REfuPa//JcpHdo/zAaJxyqJOghjtrB+CtCt6CyN5w4yp5BqBoFwECEGNzlYtChaz8TFyjUaU38UOw4SA2MTVX8kGxMuvjMgJHHvJer8SkY1xZCi11FNKiS62SPN+UkMNb4RvZw79F3KhiEHO+WfW+8zvNwHLFMSsc3aaLAdyF2Jgi8lkFpprL+8XCpSChWwyrn8Memh2KivMmynsnwLrJxkksJzL7q82CYYgwVE27uiQfQ02jDJokQsuJMNpZzMv7OW22tX5Af2oyEZSVb; 4:iOeCeaQLNFoxUH25KRwo1B/JZ7ln3Nd4HAIAzAbC/qpiwyHsjAEimcQeZfYiGbVf/RncapceLqYpcDnjBZR41mV9OmeXzZI1BekmoOkto6W5BgBt7xnBiQZOb2ZgkU3sr2wBdgRJSHVyime6cEireU1Ao9TJi7agB6ivKK0/CKygnslBXaPPFN3qE8ylp2uI/h2J1uhEUsw6olZUDMSwd7PqmaypwDkSlm4rkaV+Jcp2+KaY/EKa8Iw2knLdpMBxMvvrgDPXtY/cWGDbobNZjQ== 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)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(3002001)(3231020)(10201501046)(6055026)(6041248)(20161123564025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR05MB3206; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR05MB3206; X-Forefront-PRVS: 0476D4AB88 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(39860400002)(346002)(376002)(199003)(189002)(6486002)(4326008)(478600001)(6512007)(25786009)(6506006)(6116002)(6636002)(3846002)(5660300001)(107886003)(53936002)(6666003)(66066001)(36756003)(5003940100001)(101416001)(86362001)(50986999)(81166006)(81156014)(8936002)(47776003)(50466002)(106356001)(105586002)(8676002)(48376002)(33646002)(16586007)(97736004)(68736007)(16526018)(305945005)(2906002)(50226002)(189998001)(316002)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR05MB3206; H:localhost.localdomain; 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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR05MB3206; 23:70RMkO7+8u1GThfZ1ZzHlhsS8lfKJW4YazjAzGNsd?= =?us-ascii?Q?zNisSPSJnOjSN6DGwRjG2coqfQr6CevVlz7GTr6Y6YpduejoN2DQ9Nq2Hrtu?= =?us-ascii?Q?NZpNQHDdn+/l55nMXTbHtMLBDrIGyafF5r+N/en57vKfY82WhGPoMRneiE22?= =?us-ascii?Q?WRlYiYw7e90A48YNoElLlleqwalmiUX8RqVIicd902t3auUyDce8gLNNQjAh?= =?us-ascii?Q?mYniZW7Xr8d0xJJYOuaUPkuJi5KEvJdqNHcIBqIts8HMjAWFyzWHTUtJCy9Z?= =?us-ascii?Q?KsMx3ZV6UtZu24zu0F/8Ar+aFAA06y79fH+899rnREFhOCySVdqvqRquciVn?= =?us-ascii?Q?nDVxN7XSeMTn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1rpr5BQwz710qKk9SWQRyqhMH7wHHTOEUIEyTzO+iCBBX49DABXOHTY7hN2smrt5JvdK3JGM+tmahyFPaAOh/87fdkfxZ/3OxIiVgA7NlbqZae0X9RVM5vnPsgNykmhrQQNQJIvrEp46f4pnaemZWkngaevO6zbgT+CV21YeDs0pu6p4pkbnRGTH14dDnCR09Td5Wpp7McKWsjazck7KH62I9KTFnIMWKsGpck=; 5:4lN+Bv3J1snPsrKHUuxA0SBM6CVT6tVB/O1djSh2VhjC2UgIXgx8YEVMjlA3EJEhSLDyzEvM0fm2628p/K5+9mD/1shfTVKTNAPGimUZzyEQcl9UdAs/dbeSPOmVooNngckVaI25oOEHGEIxoBcs3+97UEjf8KOW1DFeILndh6Y=; 24:gEgMkKHOlCIQLAwoJyLfoy/Z5rPM1E1nJUByEijXYfk9G3xwQqblwHC1atkMGoolFmDwWNQPqu6oC+6TCTjf+sQl/chtvTNoidDefgRGtNM=; 7:EDfx7TIu0+/qt8nQhJRtni20jOQ7beVRnBQ2BEqUU0HOZH7/kCinapgtL8ouVjS2xtqw3lJ0qx85gKb15aBWzqsWvC1sap9/eqmg2iwvTns2k2Z9QD8Xjp1oKIWtv0p0T/KBfSTGT4Pzj220vn/ECv5sRp+2heA5hpdanj4Xci3mlZqZCVNGMwHYJXp2vGn68FkgUUKtSKnAQ8RIJbzFTX8bo/z5VSWNj/TazKmVwi6CrsEmJvc+dL3MT6i3ZRLu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2017 12:47:24.0104 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa3686fb-8eea-497b-5794-08d51f945ed3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR05MB3206 Subject: [dpdk-dev] [PATCH] net/mlx5: fix counter set destroy order 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: Mon, 30 Oct 2017 12:47:26 -0000 The counter set should be destroyed only after the flow was destroyed. Fixes: 9a761de ("net/mlx5: flow counter support") Cc: orika@mellanox.com Signed-off-by: Ori Kam --- drivers/net/mlx5/mlx5_flow.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 3999b84..e810a3a 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2001,10 +2001,6 @@ struct rte_flow * { unsigned int i; - if (flow->cs) { - claim_zero(ibv_destroy_counter_set(flow->cs)); - flow->cs = NULL; - } if (flow->drop || !flow->mark) goto free; for (i = 0; i != flow->queues_n; ++i) { @@ -2053,6 +2049,10 @@ struct rte_flow * rte_free(frxq->ibv_attr); } } + if (flow->cs) { + claim_zero(ibv_destroy_counter_set(flow->cs)); + flow->cs = NULL; + } TAILQ_REMOVE(list, flow, next); DEBUG("Flow destroyed %p", (void *)flow); rte_free(flow); -- 1.7.1