From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id B312FA0471
	for <public@inbox.dpdk.org>; Fri, 21 Jun 2019 10:26:22 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id CE2E01D570;
	Fri, 21 Jun 2019 10:26:21 +0200 (CEST)
Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com
 [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id 9EA2C1D56A
 for <dev@dpdk.org>; Fri, 21 Jun 2019 10:26:20 +0200 (CEST)
Received: by mail-wm1-f65.google.com with SMTP id h19so8601148wme.0
 for <dev@dpdk.org>; Fri, 21 Jun 2019 01:26:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=nfware-com.20150623.gappssmtp.com; s=20150623;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=7QwsJ329wfdlQeyDSNOVskGahcv5q46NSrQzLVMftZk=;
 b=2R76JKlxHU9E9nXW3wmRDx/XPyCYguDssvG0XlkEy3VVVeA903j8NA3EIP2oWoQi9k
 drRSwlBIn371KJTU2adUEGieQL5JSmIGgGtQxBgqOJbGCqH/Js/l4crYO/pHrlsdJrDI
 WnQUmeW1cZ0xKEkj7A2t0iFvaMjGOu2xXsjdC6ssiO1f1PqUSS+QuK/aVDI1bwfird6X
 XcNZanxOm3hqO9YrVor+Tt9JUqFHbQLyoJtfHV2cqHNr+HAUqtnBIynn9LJXo29ZMd3Y
 ENx5i0el6diuhTXFGjweEeoUIIiD5CpqB83RrJUzTFTurLDUoULKDuIOvZdCsF2NxXlr
 wf9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=7QwsJ329wfdlQeyDSNOVskGahcv5q46NSrQzLVMftZk=;
 b=W3n5L1iUp63l5zZoX8dX4C52hBite742QD+l+Yk+mn/F0gu79vSdg06FkOplejth6N
 3sWZeB1dSVNPteU6j4+LEu18obcUBeB1tUnMbzt2KpkLjMsc455LmjRh0Vz7pBHtY4SS
 Od2XshF1iWeY0XqHSJnHrq+p6psJug9EXU5I2zl2mv61qqxekTw+5PczIlvM+URYyJWk
 PWed4ly+vHLSys+gTv1zeHpljsBHIGVBxCwZMCX4kNIJP7Getrdg0q/gUkXH2I68QOIG
 VIkyOVsG00aykWefb7cPMqQ3P070AeAustCLnmI6NdLNPErwVHfPKQ6BiMwLfj+VFEGv
 KhwQ==
X-Gm-Message-State: APjAAAWHUeTuT8K5STbteiX7H/NfJLyFqjJmMwE0gNv8Flp1tgSeN4Hp
 PD8twfFIx+8osy8XHM9kba1K6ofG/DeUYCpi2+n8UPdMJfk=
X-Google-Smtp-Source: APXvYqx+5aLEzS7D7DxF6xmLFQJICguqlq3GenWYjQbdq2WUjCCjYecgUn2el3vvVuBhU09UTKFBW8zxBf6EfFEWFJE=
X-Received: by 2002:a1c:3:: with SMTP id 3mr2465846wma.6.1561105580170; Fri,
 21 Jun 2019 01:26:20 -0700 (PDT)
MIME-Version: 1.0
References: <20190610175155.21374-1-stephen@networkplumber.org>
 <20190620192048.13814-1-stephen@networkplumber.org>
 <20190620192048.13814-10-stephen@networkplumber.org>
In-Reply-To: <20190620192048.13814-10-stephen@networkplumber.org>
From: Igor Ryzhov <iryzhov@nfware.com>
Date: Fri, 21 Jun 2019 11:26:09 +0300
Message-ID: <CAF+s_Fy9OCdPReAEu7p09tgfk=PZKmK=xFSTDdwPNQkOca+EXg@mail.gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH v5 9/9] kni: add minimal ethtool
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Hi Stephen,

As ethtool support is restored, I think your patch #7 should be
updated to keep ethtool support in docs.

Best regards,
Igor

On Thu, Jun 20, 2019 at 10:22 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> Some applications use ethtool so add the minimum ethtool ops.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  kernel/linux/kni/kni_dev.h  |  2 ++
>  kernel/linux/kni/kni_misc.c |  1 +
>  kernel/linux/kni/kni_net.c  | 14 ++++++++++++++
>  3 files changed, 17 insertions(+)
>
> diff --git a/kernel/linux/kni/kni_dev.h b/kernel/linux/kni/kni_dev.h
> index ceba5f73c1d9..c1ca6789ce12 100644
> --- a/kernel/linux/kni/kni_dev.h
> +++ b/kernel/linux/kni/kni_dev.h
> @@ -11,6 +11,8 @@
>  #endif
>  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> +#define KNI_VERSION    "1.0"
> +
>  #include "compat.h"
>
>  #include <linux/if.h>
> diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c
> index be45f823408f..2b75502a8b0e 100644
> --- a/kernel/linux/kni/kni_misc.c
> +++ b/kernel/linux/kni/kni_misc.c
> @@ -21,6 +21,7 @@
>  #include "compat.h"
>  #include "kni_dev.h"
>
> +MODULE_VERSION(KNI_VERSION);
>  MODULE_LICENSE("Dual BSD/GPL");
>  MODULE_AUTHOR("Intel Corporation");
>  MODULE_DESCRIPTION("Kernel Module for managing kni devices");
> diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
> index 320d51d7fc83..319ee2dcb19a 100644
> --- a/kernel/linux/kni/kni_net.c
> +++ b/kernel/linux/kni/kni_net.c
> @@ -13,6 +13,7 @@
>  #include <linux/version.h>
>  #include <linux/netdevice.h>
>  #include <linux/etherdevice.h> /* eth_type_trans */
> +#include <linux/ethtool.h>
>  #include <linux/skbuff.h>
>  #include <linux/kthread.h>
>  #include <linux/delay.h>
> @@ -725,6 +726,18 @@ static const struct net_device_ops kni_net_netdev_ops = {
>  #endif
>  };
>
> +static void kni_get_drvinfo(struct net_device *dev,
> +                           struct ethtool_drvinfo *info)
> +{
> +       strlcpy(info->version, KNI_VERSION, sizeof(info->version));
> +       strlcpy(info->driver, "kni", sizeof(info->driver));
> +}
> +
> +static const struct ethtool_ops kni_net_ethtool_ops = {
> +       .get_drvinfo    = kni_get_drvinfo,
> +       .get_link       = ethtool_op_get_link,
> +};
> +
>  void
>  kni_net_init(struct net_device *dev)
>  {
> @@ -736,6 +749,7 @@ kni_net_init(struct net_device *dev)
>         ether_setup(dev); /* assign some of the fields */
>         dev->netdev_ops      = &kni_net_netdev_ops;
>         dev->header_ops      = &kni_net_header_ops;
> +       dev->ethtool_ops     = &kni_net_ethtool_ops;
>         dev->watchdog_timeo = WD_TIMEOUT;
>  }
>
> --
> 2.20.1
>