From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by dpdk.org (Postfix) with ESMTP id 2C2C791D7 for ; Mon, 5 Oct 2015 19:50:30 +0200 (CEST) Received: by wiclk2 with SMTP id lk2so132288522wic.0 for ; Mon, 05 Oct 2015 10:50:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wnWxT5j5xqssbPUeiOGxTmrVq0SoawL/SPTJNcgkyW8=; b=QMTfRUDV7paqs7Ljsmw0dpK0Lm/c5EtvfnFb6TLw4hXzZlkDV4N18GVOwx13rMW7MC aaBWQ/DhX15uG+x/CriahUA8aaCR46PeTMyx1ZenUpfXlV27hKC30+Czsm3F5fbBbeVT 4Tf47j34nCqYgAV5T75Spy2r04dSVI4zK1orYyhwbkGQV4qhfQbnoWrQRAeSHg+jFnwY M80qfSn6XVPfH5GEUIM7DMg3ys0nQdP5dGQR5LtMsyE178ayfP0sKsLwhI9oxSGjRdw3 8v4PkyNYz6h2IsPs/gZK1u1D7MYE657RhYwYysIbOwtTQEEz/HWIhiEBf+3o/ZR9KVep /lhA== X-Gm-Message-State: ALoCoQn8HvmtKSPIZ0VXU7Auzj5+4ET0G4a+3DuvUMqEgH4X+sDZ05m2FsQOADtmRJ7LJQXf2oMs X-Received: by 10.194.116.106 with SMTP id jv10mr35895926wjb.0.1444067429858; Mon, 05 Oct 2015 10:50:29 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id gd10sm5976241wjb.47.2015.10.05.10.50.29 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 05 Oct 2015 10:50:29 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Mon, 5 Oct 2015 19:50:07 +0200 Message-Id: <1444067408-29329-2-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1444067408-29329-1-git-send-email-adrien.mazarguil@6wind.com> References: <1444067408-29329-1-git-send-email-adrien.mazarguil@6wind.com> Cc: Francesco Santoro Subject: [dpdk-dev] [PATCH 2/3] mlx4: fill if_index field in dev_info structure 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: Mon, 05 Oct 2015 17:50:30 -0000 From: Francesco Santoro Allows applications to retrieve the name of the related netdevice. Signed-off-by: Francesco Santoro --- drivers/net/mlx4/mlx4.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index e1ca577..9614471 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -3819,6 +3819,7 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) { struct priv *priv = dev->data->dev_private; unsigned int max; + char ifname[IF_NAMESIZE]; priv_lock(priv); /* FIXME: we should ask the device for these values. */ @@ -3848,6 +3849,8 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM) : 0); + if (priv_get_ifname(priv, &ifname) == 0) + info->if_index = if_nametoindex(ifname); priv_unlock(priv); } -- 2.1.0