From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-f173.google.com (mail-ie0-f173.google.com [209.85.223.173]) by dpdk.org (Postfix) with ESMTP id 9F3105962 for ; Thu, 9 Jan 2014 07:29:00 +0100 (CET) Received: by mail-ie0-f173.google.com with SMTP id u16so666405iet.32 for ; Wed, 08 Jan 2014 22:30:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=uZqBJg5urYi5rvNiGmO7yyACxFi7i8rQ5g91vyRMT10=; b=YnxikBLMghM5M0R2XLTIWrYU9fsT+O6lMUq2dNRN5JEVGEtnBJpuT3jAwr0LOhYIdw Cx9TS7vREG61feReWREd+6Mlo7TKoxVc+oPmw1OfoPFW9V8AUO4WGHuQ3rtrH2qloac2 WDhoH5p8d/GUMuRfYtjBJqZqXJEBG9eenhzExr2dsCDdQKEp4/U+q90H0E8UW0mU/oGq 7kViaDVZ8iuMb1nseWV2VZ2d9QgB68DU+1kY90DesFi65y0SoeDYTsFasUcXyghZ+LSC davrjWDKovhVqjcMWsWMQRRwIVx9OaCeZUtXllY/6aqVYS7cMhF9xKtlWp5/FHcmC9VP CBtA== X-Gm-Message-State: ALoCoQnO7voDL5Nn2UL+ewUYI2SM+exqpS7QXQ5UJ7XjLIRfkV/Q0GC3qULkzbK7Y9m7KHxWEZFS MIME-Version: 1.0 X-Received: by 10.43.16.2 with SMTP id pw2mr972914icb.56.1389249012732; Wed, 08 Jan 2014 22:30:12 -0800 (PST) Received: by 10.64.8.140 with HTTP; Wed, 8 Jan 2014 22:30:12 -0800 (PST) In-Reply-To: References: Date: Wed, 8 Jan 2014 22:30:12 -0800 Message-ID: From: Stephen Hemminger To: Mats Liljegren Content-Type: text/plain; charset=ISO-8859-1 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 1/2] Introduce if_index field to struct rte_eth_dev_info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2014 06:29:01 -0000 Technically in Linux ifindex is unsigned 32 bit value. And 0 is reserved as a marker. Therefore why not use that semantic. On Wed, Jan 8, 2014 at 1:46 AM, Mats Liljegren wrote: > This field is intended for pcap to describe the name of the interface > as known to Linux. It is an interface index, but can be translated into > an interface name using if_indextoname() function. > > When using pcap, interrupt affinity becomes important, and this field > gives the application a chance to ensure that interrupt affinity is set > to the lcore handling the device. > > Signed-off-by: Mats Liljegren > --- > lib/librte_ether/rte_ethdev.c | 1 + > lib/librte_ether/rte_ethdev.h | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index 859ec92..38c1ea1 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -1037,6 +1037,7 @@ rte_eth_dev_info_get(uint8_t port_id, struct > rte_eth_dev_info *dev_info) > /* Default device offload capabilities to zero */ > dev_info->rx_offload_capa = 0; > dev_info->tx_offload_capa = 0; > + dev_info->if_index = -1; > FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get); > (*dev->dev_ops->dev_infos_get)(dev, dev_info); > dev_info->pci_dev = dev->pci_dev; > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index 302d378..5b80e5d 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -787,6 +787,7 @@ struct rte_eth_conf { > struct rte_eth_dev_info { > struct rte_pci_device *pci_dev; /**< Device PCI information. */ > const char *driver_name; /**< Device Driver name. */ > + int if_index; /**< Index to bounded host interface, or -1 if > none. Use if_indextoname() to translate into an interface name. */ > uint32_t min_rx_bufsize; /**< Minimum size of RX buffer. */ > uint32_t max_rx_pktlen; /**< Maximum configurable length of RX pkt. */ > uint16_t max_rx_queues; /**< Maximum number of RX queues. */ > -- > 1.8.3.2