DPDK patches and discussions
 help / color / mirror / Atom feed
From: Igor Ryzhov <iryzhov@nfware.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] kni: use kni_ethtool_ops only with unknown drivers
Date: Sun, 2 Dec 2018 13:54:11 +0300	[thread overview]
Message-ID: <CAF+s_FwBVeaDu6LSZDpL9X8z4PdRBhpRbeVqdV1sj8yxGQLF4A@mail.gmail.com> (raw)
In-Reply-To: <20181201093150.2ab26e85@xeon-e3>

Stephen,

ethtool_get_link returns EOPNOTSUPP if device doesn't supply get_link:

static int ethtool_get_link(struct net_device *dev, char __user *useraddr)
{
struct ethtool_value edata = { .cmd = ETHTOOL_GLINK };

if (!dev->ethtool_ops->get_link)
return -EOPNOTSUPP;

edata.data = netif_running(dev) && dev->ethtool_ops->get_link(dev);

if (copy_to_user(useraddr, &edata, sizeof(edata)))
return -EFAULT;
return 0;
}

On Sat, Dec 1, 2018 at 8:31 PM Stephen Hemminger <stephen@networkplumber.org>
wrote:

> On Sat, 1 Dec 2018 14:12:54 +0300
> Igor Ryzhov <iryzhov@nfware.com> wrote:
>
> > Hi Stephen,
> >
> > I also do not see the point of the current implementation of ethtool
> > support.
> > That's why I sent this patch – it enables ethtool_ops for all devices,
> > independent of the underlying driver.
> > Right now only .get_link is supported, but I am thinking about
> > implementation of a larger set of functions, using req/resp queue, like
> > netdev_ops functions are working.
> >
> > Regarding the KNI itself, we use it as Linux mirror of physical port for:
> > 1. Port configuration from Linux – such functions as set_mac, change_mtu,
> > etc. And ethtool_ops will be used the same way.
> > 2. Passing control-plane packets to Linux.
> >
> > Can virtio user be used the same way, as a mirror of physical port?
> >
> > Best regards,
> > Igor
>
> In Linux if device does not supply get_link the base code does the
> right thing
>
>
> u32 ethtool_op_get_link(struct net_device *dev)
> {
>         return netif_carrier_ok(dev) ? 1 : 0;
> }
>
>
>
> Doing set_mac, change_mtu and ethtool_ops in virtio_user should be possible
> but probably not implemented.
>
>

  reply	other threads:[~2018-12-02 10:54 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 [this message]
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

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=CAF+s_FwBVeaDu6LSZDpL9X8z4PdRBhpRbeVqdV1sj8yxGQLF4A@mail.gmail.com \
    --to=iryzhov@nfware.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /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).