From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 7413FA00E6 for ; Thu, 21 Mar 2019 16:33:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 51EFC1B50C; Thu, 21 Mar 2019 16:33:03 +0100 (CET) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 46EF81B509 for ; Thu, 21 Mar 2019 16:33:02 +0100 (CET) Received: by mail-pf1-f193.google.com with SMTP id 10so4538031pfo.5 for ; Thu, 21 Mar 2019 08:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dnAjZshHMcDVtizzb/UORTOXSb53TmieGS2ji+MSIJQ=; b=v6lTnWtqKRXic2nKauc3gg4+7d+KK1ksywTWebqYQ43CzNIhIdcUDc32p4PZCmuPCQ fROqdg8U/5WtfKKggzSXpqNNk3wro9qbfxHeCJ7Ds0OPlf3JroidYtsFdfrd1Y+M4cC1 nT7oyRqQN4Y5V0O+CHYWkvwQSpFGEZgZf2xV4zvKMXsweub2mk8ltgsjpsU9N+bvxHIr uBlo0fPHKDe4wv1cItXt6Qfgxo/EOmr/A+RpZPwMJv+nTpKukJIliVYJlPfjA55e/3kA v2A0bKO1p956xavjluZxadpOAX6jWCe6wjC8KxzMoVXkplFycO11Xut1rO/tbgkwZ/Sz inZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dnAjZshHMcDVtizzb/UORTOXSb53TmieGS2ji+MSIJQ=; b=tLD+eznPzfqKvGMWpJmA/SLYZ5C67r/foWve1dHgW1NcW/s+t3Dy4HCQWOsngoJ3in qZjPIGV/2S06PFWMb9ru2AkQZMqIUw0DVat0thYTaYf4RKZEoOk+Js2iIRhjq4WD+ZwW E7vsMMr3Q0B5lSPkZx5LpJd8kyKoTKASnwol2rawTxErc2rQNqJcyG+sUJ5cCMtT9l7I fXlYTQx2uYKLm4UsKFQH5sVxdDM5hijba04fcVTfoXgeC6BAn24y91MkoH7ZKFRg7A3G ha/or7oCa+A8mjH4MLwjddkRyMHmvFFcbwMElsrZbgXsyBu/xh2L0wOTY3F4S4PrQqnp +w3w== X-Gm-Message-State: APjAAAVfArVNIrGujlyVE8VOvNfNVKqsE9aFq+s6vxf0NPiBR+IEEzbp E/rtQF0LK2bBsCyE35vL/GI8CkxEwM5HmQ== X-Google-Smtp-Source: APXvYqzKxpYMy0+/eediuZp91Fc2Cgw6jhloIttGBZx25TpO3/nLq5xt3MSgLB3zJvYyYLut8hBapw== X-Received: by 2002:a17:902:7e46:: with SMTP id a6mr4233272pln.150.1553182381473; Thu, 21 Mar 2019 08:33:01 -0700 (PDT) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id o3sm1214062pfh.74.2019.03.21.08.33.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Mar 2019 08:33:01 -0700 (PDT) Date: Thu, 21 Mar 2019 08:32:58 -0700 From: Stephen Hemminger To: Xiaolong Ye Cc: dev@dpdk.org, Qi Zhang , Karlsson Magnus , Topel Bjorn Message-ID: <20190321083258.568c82c6@shemminger-XPS-13-9360> In-Reply-To: <20190321091845.78495-2-xiaolong.ye@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190321091845.78495-1-xiaolong.ye@intel.com> <20190321091845.78495-2-xiaolong.ye@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 1/5] net/af_xdp: introduce AF XDP PMD driver 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" Message-ID: <20190321153258.DCeW-Xp0VVWBdG62Rp-BQKugcoLbnh88ktMmN3ry7ns@z> 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