From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id CAFD1324C for ; Thu, 18 May 2017 14:19:58 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OQ500EX7E98TH30@mailout1.w1.samsung.com> for dev@dpdk.org; Thu, 18 May 2017 13:19:56 +0100 (BST) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170518121956eucas1p20b5132a67f55eff9766162fef5379b3f~-sp63Qt7y0359003590eucas1p23; Thu, 18 May 2017 12:19:56 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 60.7B.25577.B619D195; Thu, 18 May 2017 13:19:55 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170518121955eucas1p211ce46317d0d74c99db0b94c1662fb59~-sp6JD5cm0512705127eucas1p2f; Thu, 18 May 2017 12:19:55 +0000 (GMT) X-AuditID: cbfec7f5-f792f6d0000063e9-78-591d916b179e Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 50.17.20206.D819D195; Thu, 18 May 2017 13:20:29 +0100 (BST) Received: from imaximets.rnd.samsung.ru ([106.109.129.180]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OQ5007RFE91UHB0@eusync2.samsung.com>; Thu, 18 May 2017 13:19:54 +0100 (BST) From: Ilya Maximets To: dev@dpdk.org, Thomas Monjalon Cc: Heetae Ahn , Ravi Kerur , Ilya Maximets Date: Thu, 18 May 2017 15:19:40 +0300 Message-id: <1495109980-3236-1-git-send-email-i.maximets@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPIsWRmVeSWpSXmKPExsWy7djP87rZE2UjDZbPNbR492k7k8W0z7fZ La60/2S32HNlOZvFpwcnWBxYPX4tWMrqsXPWXXaPYzensXv0bVnFGMASxWWTkpqTWZZapG+X wJXR0rmQuWAzd8WTPbsYGxiPcnYxcnJICJhIbOjuZYSwxSQu3FvP1sXIxSEksJRRYvefK6wQ zmdGifU/JrLCdEx8cJ4JIrGMUeLMnA4WCKeZSWLGhHVsIFVsAjoSp1YfAZsrImAuMXFCJ1g3 s0CRRNeeR2C2sIC3xK9JX8DqWQRUJU4evw0W5xVwlfgx9QETxDY5iZvnOplBFkgIHGGT2LFh M1ADB5AjK7HpADNEjYvEmzMz2CFsYYlXx7dA2TISlyd3s0D0NjNKNKy6xAjhTGCU+NK8HGqD vcSpm1eZIK7jk5i0bTozxAJeiY42IQjTQ2LOBE+IakeJRed6wG4WEoiVWLp9DeMERukFjAyr GEVSS4tz01OLTfWKE3OLS/PS9ZLzczcxAqPx9L/jX3cwLj1mdYhRgINRiYd3Q5BMpBBrYllx Ze4hRgkOZiUR3rYO2Ugh3pTEyqrUovz4otKc1OJDjNIcLErivFynrkUICaQnlqRmp6YWpBbB ZJk4OKUaGLNexLRwbqpWFApbn3ehZ4LY+g9rssPL10w4si/aTO23xe71/ordyypWmG08JCbn ft/j5BfLlRr9drnBsjNTloreDb7lMtM2xThatUeaZdnNOT+F4pvXK8Y8c5NWWGenabcyKHL6 jqZvh3maF939wp/GsDur5OVeiarFO24s5nvp7uuT+PkbpxJLcUaioRZzUXEiAB+btEnCAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsVy+t/xK7q9E2UjDS484LR492k7k8W0z7fZ La60/2S32HNlOZvFpwcnWBxYPX4tWMrqsXPWXXaPYzensXv0bVnFGMAS5WaTkZqYklqkkJqX nJ+SmZduqxQa4qZroaSQl5ibaqsUoesbEqSkUJaYUwrkGRmgAQfnAPdgJX27BLeMls6FzAWb uSue7NnF2MB4lLOLkZNDQsBEYuKD80wQtpjEhXvr2boYuTiEBJYwSsw6fIsJwmllkvj9bAoz SBWbgI7EqdVHGEFsEQFziYkTOlm7GDk4mAWKJA7fSwIJCwt4S/ya9IUNxGYRUJU4efw2K4jN K+Aq8WPqA6hlchI3z3UyT2DkXsDIsIpRJLW0ODc9t9hIrzgxt7g0L10vOT93EyMw/LYd+7ll B2PXu+BDjAIcjEo8vBuCZCKFWBPLiitzDzFKcDArifC2dchGCvGmJFZWpRblxxeV5qQWH2I0 BVo+kVlKNDkfGBt5JfGGJobmloZGxhYW5kZGSuK8Uz9cCRcSSE8sSc1OTS1ILYLpY+LglGpg FJ5wWWd2UXabXw2rp1JZ+g/BhYZf8/JkZnR1ffo6MVYxlMVA/NPzgtmr7Mz4BNJZWwJXKCoq Fv3aMP338RncsWGiLxxP+xlNWLX+4ILH8wI0C7dES+48eFzDa57kPO6LXouc2mv8nqamL3vY GHcm+Kp+kznDY3fBaamGvMkLTHt+mM64um2NEktxRqKhFnNRcSIA4l8PW1UCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170518121955eucas1p211ce46317d0d74c99db0b94c1662fb59 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?SWx5YSBNYXhpbWV0cxtTUlItVmlydHVhbGl6YXRpb24gTGFi?= =?UTF-8?B?G+yCvOyEseyghOyekBtMZWFkaW5nIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?SWx5YSBNYXhpbWV0cxtTUlItVmlydHVhbGl6YXRpb24gTGFi?= =?UTF-8?B?G1NhbXN1bmcgRWxlY3Ryb25pY3MbTGVhZGluZyBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170518121955eucas1p211ce46317d0d74c99db0b94c1662fb59 X-RootMTR: 20170518121955eucas1p211ce46317d0d74c99db0b94c1662fb59 References: Subject: [dpdk-dev] [PATCH] ethdev: keep port_id unchanged if obtaining by name failed 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, 18 May 2017 12:19:59 -0000 Currently, 'rte_eth_dev_get_port_by_name' changes transmitted 'port_id' unconditionally. This is undocumented and misleading behaviour as user may expect unchanged value in case of error. Otherwise, there is no sense having both return value and a pointer in the function. Fixes: 9c5b8d8b9feb ("ethdev: clean port id retrieval when attaching") Signed-off-by: Ilya Maximets --- lib/librte_ether/rte_ethdev.c | 1 - lib/librte_ether/rte_ethdev.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 83898a8..64aefdd 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -339,7 +339,6 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) if (!nb_ports) return -ENODEV; - *port_id = RTE_MAX_ETHPORTS; RTE_ETH_FOREACH_DEV(i) { if (!strncmp(name, rte_eth_dev_data[i].name, strlen(name))) { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 0f38b45..9a19974 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -4587,7 +4587,7 @@ rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, * @param port_id * pointer to port identifier of the device * @return -* - (0) if successful. +* - (0) if successful and port_id is filled. * - (-ENODEV or -EINVAL) on failure. */ int -- 2.7.4