From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0046.outbound.protection.outlook.com [104.47.2.46]) by dpdk.org (Postfix) with ESMTP id ABDE71B440; Wed, 20 Jun 2018 01:13:32 +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=gxyW4X75OYsV3mxU5RZM6KGHiiUIE8eBgAFFM9DKlGo=; b=l3cTTi3KnozFOD5fS4sONaTckFrqCb3XVMZmvXzLEFtkbBKIbr9H4ONyKu11QX2wy/elXAvQrsI3woBmM+9LuRluZBn3rTxBuYjBz8ncXq1JVCZU4YpAeIZleQ0vUkQgijsOZ4pBbt3jvLqJr5J4NTFqzTQAwBsyd5k0ueQcFhQ= Received: from mellanox.com (209.116.155.178) by AM5PR0501MB2036.eurprd05.prod.outlook.com (2603:10a6:203:1a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.16; Tue, 19 Jun 2018 23:13:28 +0000 From: Yongseok Koh To: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com Cc: dev@dpdk.org, shahafs@mellanox.com, Yongseok Koh , stable@dpdk.org Date: Tue, 19 Jun 2018 16:13:13 -0700 Message-Id: <20180619231313.7264-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180604173731.29125-1-yskoh@mellanox.com> References: <20180604173731.29125-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: CO2PR18CA0051.namprd18.prod.outlook.com (2603:10b6:104:2::19) To AM5PR0501MB2036.eurprd05.prod.outlook.com (2603:10a6:203:1a::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 31aae99b-3751-4426-e9ff-08d5d63a454f X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM5PR0501MB2036; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2036; 3:tCfOljt4gxwJcGnFJQqeoT6CrsBqQAujzfvSME63VIVxRJg07WrfYpaczHtRBpXoD3XbWQ937K6Ps6emf1L/KUOPlznnV59RXnuL+hWxyhXfX46ABIFXHksXQgUQ9XdkOYW1jrXDv1ZQ8acm4U7F9+xE7G2uFJ/howwvHq+pm5K5Td/TYqkmf8vuaiTn/tV/QHBQ+ET488iBjA+1ke6oy2q5WcUfyROIkDce47fIwjrlEOTK+04EkqA/aii73Wkd; 25:/NPHuXUF+zgYjKBJgpRLQFTfqkwRcNRSdzG39DX/IxSJsaL6QRRbzPCQYc6dzI9vOJiEAw48f5te6pwS5CFY7UQ9uAlPIspn98Waea4TiR+r5pbHTokKjPOfwSjEMTWLX/fdB5ohuYw62M5pb0aaloenUAMP7MBc2TcTWOIACz4PrGcj+xdq9tsqBB32xs1v1cuUCzobkOkAbYoXCDihfymRqdnavR+a3hhpo6YZ0ci4012+pqlZfuMZ2wentw7vqwB/k5cN6z+AFTAx2Gm6zr2qafMUSi/pqXUheuruTS1tgr4tw3tsJdjFJ8vNzHi0B3e4kly6NDemwib2nTfBzw==; 31:0h7HYjNrndoeEhNrVAurFnr3FZyzY7mvdBqN9cMKAkvcAVOHRm2/lgWbDMkAhjYKBc74fehmwcpwzzDaqLQs4Y+Lfk559a/aqym/Ym8/9RoYBvouUL7dZ3x/fAlsgn3K+YlLaXnDGYdi1XWQCXvd6G8ZMlWl27XHJs7Hh121L6Hid1BAfkmJp9JPfkxsiIkMBCXUtf01pLnvh0mQ0apwrzkznroZrb0o+gbUfDZtQFM= X-MS-TrafficTypeDiagnostic: AM5PR0501MB2036: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2036; 20:hB+VRo2t50yYdV/ctabZxhI7wTNCiKT6SAPIlQdL4OD3y9qbwkWXKA4jERqhFgY6Q23Dg4NuXh1R7mZ4el5KPNR1csiRmFF2SgxEq0Bop/hdAIIkwr7khV7ppI/wM+9NSwNohu4pzEeNTE/RRBl3fY+NMyC74wI9rRxAUYpAX5+fi7sopzqgxm9ihfDDcla2fi7/wzWxWwtmj85/QnHVw0/SsZPrb9clMLphZ4v4pdZlR75YMuyfn2Qg+sQ7BXycphEB6/gN9YpmWieArGGlt0HuVgg/TRxOd2+E/6ssX7772Qerp+OmQCk+7iG5eqO/K+qyc3TGjYSxZ6MW3AKxCyQr3MO/whNUu8ohKanevhMkWRonnUfUJQYfLyfs6SzVJ+Xaest80ZwHkV/dcqzaOGrSRxn4GPzGtbc90AqhIl3g4p288kUPyaqy9iiRGCKErApwb6hyanNAi362hBiUlu3Adm/RAheUGcJ9kPaOsWiBiy2xGlXtd9xHu/qbDWZ+; 4:2w65NM9tN51nGX4XfsFFbrDqsgW9I78wyzc96EtetmmXdVMDUA0gWVXeeU0Zdzr8Pj/9aPTyglVWS9zzj7DuThTr7MCCnjLBmcMLrdziWuJiIVh6EYRBfuv7FKMfm6bupKgP7P6DwraFo0f6JvTmVORlHAIzjSnqonow+0xtvJoUNpTkswogX+giEeBKjgFoOWIXPsxmgQzVnKmGOfxL4BXD8a0TratnP3tg0bRGoVV0Ypz05uXPfpsTLreU4dB7FNtuxiMeQtLqQ4Cx3vzKPg== 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)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:AM5PR0501MB2036; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0501MB2036; X-Forefront-PRVS: 07083FF734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(39860400002)(396003)(39380400002)(189003)(199004)(36756003)(446003)(76176011)(50226002)(81166006)(6666003)(11346002)(81156014)(8676002)(5660300001)(8936002)(486006)(7696005)(51416003)(53936002)(52116002)(66066001)(47776003)(4326008)(25786009)(478600001)(21086003)(26005)(956004)(105586002)(186003)(1076002)(305945005)(97736004)(386003)(476003)(59450400001)(2616005)(55016002)(106356001)(3846002)(6116002)(7736002)(69596002)(48376002)(16586007)(316002)(86362001)(50466002)(68736007)(16526019)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2036; H:mellanox.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-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0501MB2036; 23:bPMNMLKOMGwcQwAPOlX5d2xdCf+V63Gi/4UqGvm?= =?us-ascii?Q?7Gum1q7U2tGnLPYlxynl+g9fPt3DUcH3qd33JLibR8d4jEqXLK7o2nAVnA/J?= =?us-ascii?Q?3Tey9enBiJaurfuaM72+RLK0VuRURLOeqnQt9ZGdBu+1Bv3WL8sLKkfJo+0b?= =?us-ascii?Q?QI0qHGVV74C+YXf9M5f0hu/Og1q1IdT56vaH+eMgXhxPo4FWp1shaqcccBbG?= =?us-ascii?Q?1SaN0ADkGUbEj1/aTJNxhRfWiN6SbiYTkML2kOv5ZSS9rUr2E732z7v4VGna?= =?us-ascii?Q?pGiyeUJku8kvMkDyZ9rvDlsdkqqz28J7JwsyZHxItf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61T4/463B4K5RtvCdn3Y2kGy+Xzh2yoslkWoL0qDbNOi3mrbF3lEk=; 24:+5Mrdxy7Le4wMPIl7RFF9WvgIjvj1Hinm+HCVnnk3A25abKbWGkrZvdr8cwIahG5oEnWdECS1yj5zJgMUtFD2NlNfRPRqj6Qwctya0nv2Mc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2036; 7:N+FBnmOgv4N2Q60t8gX6gLYvpASJurAKgu2REFtVPXtgjhZrGxni+sgBc4VhXDNe08+cPPTfTrwlg9T/3J1LG7LQ2SL9eawcU7HLGfYtlT4K3XHpspfdYdYY31ydj5kWMb6x2DsTeDWwVKN3gk7/MG4TFZ2xV4nLu4qI+DL6Jw3lwjZbAycEeSCU6E/G7KHKWPJ4AJmwhIoHZhNCSvTmIPH890DdAkJREtS/StFh9dY+Mx8IZtDk/SuohzlVfPn3 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2018 23:13:28.8104 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31aae99b-3751-4426-e9ff-08d5d63a454f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2036 Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix error number handling 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: Tue, 19 Jun 2018 23:13:32 -0000 rte_errno should be saved only if error has occurred because rte_errno could have garbage value. Fixes: a6d83b6a9209 ("net/mlx5: standardize on negative errno values") Cc: stable@dpdk.org Signed-off-by: Yongseok Koh --- drivers/net/mlx5/mlx5_flow.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 994be05be..45207d70e 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -3561,15 +3561,17 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev, /* The flow does not match. */ continue; } - ret = rte_errno; /* Save rte_errno before cleanup. */ if (flow) mlx5_flow_list_destroy(dev, &priv->flows, flow); exit: + if (ret) + ret = rte_errno; /* Save rte_errno before cleanup. */ for (i = 0; i != hash_rxq_init_n; ++i) { if (parser.queue[i].ibv_attr) rte_free(parser.queue[i].ibv_attr); } - rte_errno = ret; /* Restore rte_errno. */ + if (ret) + rte_errno = ret; /* Restore rte_errno. */ return -rte_errno; } -- 2.11.0