DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Igor Ryzhov <iryzhov@nfware.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] kni: use kni_ethtool_ops only with unknown drivers
Date: Tue, 18 Dec 2018 18:04:54 +0000	[thread overview]
Message-ID: <93844466-cf28-0cec-b841-bebc398da61e@intel.com> (raw)
In-Reply-To: <20181130194750.13870-1-iryzhov@nfware.com>

On 11/30/2018 7:47 PM, Igor Ryzhov wrote:
> Current implementation of kni_ethtool_ops just uses corresponding
> ethtool_ops function of underlying driver for all functions except for
> .get_link. This commit sets kni->net_dev->ethtool_ops directly to the
> ethtool_ops of the corresponding driver.
I think we can't assign ethtool_ops directly to the driver ethtool_ops.

There are two net_device in the system for the ethtool support case:
1) kni net_device
2) driver net_device

Linux kernel driver probed() at some level at least a net_device struct created
for it, that is how we have 2). And 2), driver net_device, is saved in the
context of the kni.

The function of the kni_ethtool.c is, convert "kni net_device" to "driver
net_device":

 struct kni_dev *priv = netdev_priv(dev);
 ethtool_ops->xxx(priv->lad_dev, ...);

When you are directly set kni ethtool_ops to driver ethtool_ops, you will be
passing "kni net_device" to the kernel driver. I can't predict what will be the
results there.
How this can work, did you able to test this?

> 
> For unknown drivers (all but ixgbe and i40e) we still use

It is igb & ixgbe, i40e is not supported but it is a detail only.

> kni_ethtool_ops with implemented .get_link function.

Not exactly, unless I am missing something.

.get_link function is not implemented for "unknown drivers". It gets carrier
status of the kni net_device. There is nothing related to the underlying device
here.

For the ethtool functions you have removed, they goes to hardware mapped to kni
interface and gets the value from them. Existing .get_link just gets the kni
interface value, it doesn't go to any hardware.

In *sample* application a logic has been added to reflect the hardware link
status to kni interface thorough the sysfs interface kni has, if you are
referring that one, it is not implementing ethtool support for "unknown
drivers", it is relying to application later to reflect hardware link status to
kni interface so that you can read from kni interface.

> 
> Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
> ---
>  kernel/linux/kni/Makefile      |   2 +-
>  kernel/linux/kni/kni_ethtool.c | 210 ---------------------------------
>  kernel/linux/kni/kni_misc.c    |   9 +-
>  3 files changed, 7 insertions(+), 214 deletions(-)

<...>

      parent reply	other threads:[~2018-12-18 18:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 19:29 [dpdk-dev] [PATCH] " Igor Ryzhov
2018-11-30 19:47 ` [dpdk-dev] [PATCH v2] " Igor Ryzhov
2018-11-30 23:38   ` Stephen Hemminger
2018-12-01 11:12     ` Igor Ryzhov
2018-12-01 17:31       ` Stephen Hemminger
2018-12-02 10:54         ` Igor Ryzhov
2018-12-03 19:51           ` Stephen Hemminger
2018-12-18 18:10       ` Ferruh Yigit
2018-12-03 13:09     ` Ferruh Yigit
2018-12-03 14:06       ` Igor Ryzhov
2018-12-18 18:13         ` Ferruh Yigit
2019-01-05 16:53           ` Igor Ryzhov
2018-12-18 18:04   ` Ferruh Yigit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93844466-cf28-0cec-b841-bebc398da61e@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=iryzhov@nfware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).