From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AB9FCA04AC; Mon, 24 Aug 2020 17:07:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 96D47F72; Mon, 24 Aug 2020 17:07:45 +0200 (CEST) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by dpdk.org (Postfix) with ESMTP id 9D43BDE3 for ; Mon, 24 Aug 2020 17:07:43 +0200 (CEST) Received: by mail-pg1-f179.google.com with SMTP id v15so4687769pgh.6 for ; Mon, 24 Aug 2020 08:07:43 -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:mime-version :content-transfer-encoding; bh=aKNrHYo6B38Jqt//0UgGsgcY8IettZKlDaPYoC9x1AA=; b=ovPP+WOSisqg/vwGnZ9MCraeVIi8WbMfVaZFoDIqqZFvEs0ZfRSal3DCXERL+NSyYi k9ze+JzpZR8U3M7cS0Ni1EjoecTScSsZhcC3JTwA3FO81MSvycZsPjHNwXF7cYZrEH0P GxqFik2L64QNHfF3uZqx09Lx5hSwi1+7WyfQC8C42uk5dIdliEZpkchoMH0W1lZG+X5o BTtFdlchtcKoGq6jLrp1f3VH8HML1tVze6m61xtfql6k5jy7kRM60SxvvMtI8Ita/LY8 b4ouzKSInjnje0H4xin9KqdQpITZeFC3ydTRf+TrkKo3/an76rkKGyZUgm9dQrggRoKz We9g== 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:mime-version :content-transfer-encoding; bh=aKNrHYo6B38Jqt//0UgGsgcY8IettZKlDaPYoC9x1AA=; b=Zy5LYJeztyvhYA3hoz3k0hilWvcZPuBqcahtHy+QbtfQ6nyLK9xGxw7Mt7OaQitiBH oSImQmIc3UHb87Ndgn8F6truJG73+Vgcoz1B3vzwCBwX6xE4FY4CtAOp1cXP+yWGjwCm tF0nCnq2Pvs/Lilyy4QmErMABffLiuoa6YgA7Tr0gHiAsNL5x4kZcEuGWSBwSnyGn0Mk X0b1XF23G01a/FqiDZO9ZcBMP/PBxf5sG/77rdkljg5rrEN0GLhm+TpdYCrBn6w1c/MM vZpso/U63suvRa6NwdK1Y9J/NmyoIqYr82kNQxMBg94NKpJEDcqDaBiXYPfGwYz6p2cF eZYA== X-Gm-Message-State: AOAM532LGyxpiuUtkgVDYNMUIN5Cs8aUCW8c2PmPXrcsH4bNNp6OfOJZ O4vBJgW53+VMrAVjcwGefqeexQ== X-Google-Smtp-Source: ABdhPJw1Bjy90XWC3+RqwMlywcGbXkJ+uPsQZgpTQ7IdRC5ORK8N60r4f5h+QV3Jba8C8ylwzC3FHw== X-Received: by 2002:a63:4543:: with SMTP id u3mr3424693pgk.398.1598281662490; Mon, 24 Aug 2020 08:07:42 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id y4sm12153310pff.44.2020.08.24.08.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 08:07:41 -0700 (PDT) Date: Mon, 24 Aug 2020 08:07:33 -0700 From: Stephen Hemminger To: Hemant Agrawal , Sachin Saxena Cc: dev@dpdk.org, Gagandeep Singh , Akhil Goyal Message-ID: <20200824080733.064b4748@hermes.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] Misuses of dev_info->if_index in embedded drivers. 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" The use of if_index in some drivers is wrong. It does not match the user expectation in the documentation. This code: dpaa2/dpaa2_ethdev.c: dev_info->if_index = priv->hw_id; pfe/pfe_ethdev.c: dev_info->if_index = internals->id; Does match: struct rte_eth_dev_info { struct rte_device *device; /** Generic device information */ const char *driver_name; /**< Device Driver name. */ unsigned int if_index; /**< Index to bound host interface, or 0 if none. Use if_indextoname() to translate into an interface name. */ Also, this code is unnecessary.