From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ye Xiaolong Subject: Re: [PATCH v3 1/5] net/af_xdp: introduce AF XDP PMD driver Date: Fri, 22 Mar 2019 09:54:22 +0800 Message-ID: <20190322015422.GB84243@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190321091845.78495-1-xiaolong.ye@intel.com> <20190321091845.78495-2-xiaolong.ye@intel.com> <20190321083258.568c82c6@shemminger-XPS-13-9360> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, Qi Zhang , Karlsson Magnus , Topel Bjorn To: Stephen Hemminger Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 780991B546 for ; Fri, 22 Mar 2019 02:58:29 +0100 (CET) Content-Disposition: inline In-Reply-To: <20190321083258.568c82c6@shemminger-XPS-13-9360> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 03/21, Stephen Hemminger wrote: >On Thu, 21 Mar 2019 17:18:41 +0800 >Xiaolong Ye wrote: > >> + >> + strlcpy(ifr.ifr_name, if_name, IFNAMSIZ); >> + if (ioctl(sock, SIOCGIFINDEX, &ifr)) >> + goto error; >> + >> + if (ioctl(sock, SIOCGIFHWADDR, &ifr)) >> + goto error; >> + >> + rte_memcpy(eth_addr, ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN); >> + >> + close(sock); >> + *if_index = if_nametoindex(if_name); > >This seems confused: > - first you get ifindex with SIOCGIFINDEX, then you ignore the result > - then get MAC address. > - then use if_nametoindex() which does SIOCGIFINDEX internally You're right, the code is chaotic here, will improve it in next version. Thanks, Xiaolong