From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id A9EA02C15 for ; Sun, 2 Dec 2018 11:54:23 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id t13so4969754ply.13 for ; Sun, 02 Dec 2018 02:54:23 -0800 (PST) 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=ALoJdaOtb9sQXuo6uYbzVx7bHvKVK8R8HnVQ2WTS188=; b=KtG+eAhmb34GNRSkFf1elF4SUsd0YgWULMKEmG/4s8URUQsBNmKBjvykLcmA1KLpz6 9+Nfds6QykLvW7T8xNwcl9xcYHb6PIXcXozT5yksEqc3Ka8tzm8CeV9dCxwYf2bMfiXJ tNwLIqJOcxf/FW/hEPKmQb3CSNc1Xf653x0S6h8g7F+gtqLVONdErKFDPUoonD+/t0fl mD4fETQzGiTXQvGdogHvuxK0G6gD5Wo72ZYwbJXqpvF0m193YlaIPgY84MuattlYaUF4 lHJNopVQxKib9+0tFg2ZvYpkJwYAQNim5HJCRy3JRTfDe4KpiDalpjqat8dYABp1R6/8 zaFQ== 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=ALoJdaOtb9sQXuo6uYbzVx7bHvKVK8R8HnVQ2WTS188=; b=JkU24THz6kqiZ0t1ry9GBZULDov8nnaOs5R8oVSkpFVtgQ6PDXatf3DxJPFeW4iCax q/kSOXUaFq/JRJ8Dx3nq8OftMnP2aRSbGu4KAzSR9LSHPmiIo4qw/f+OGnyYW5vcAO/Z uRVh6JesF+K4/sluAWRtciNuo+hONOsKPLWaPiJREygJNO1LQVwgD3PThsZczcQ8upxs VUgPmk/wER+xOdDvwfn5c1Z7S6gB/s598pxkoR4jq+uMOFyLl8RBliqjrTnKzo0pMXdd rSfH7ZP5QVIY+mssDEQxdQIfz+Gh2QlCqqL/dsU3y2QvwR31V1ss++U/EZu2rmSmfiPR Xmkg== X-Gm-Message-State: AA+aEWYsDroxgbbm+kIzJjek/x7+p73htB7KqMpfwEadNr9M9GKOzOYX 19aR2CZeu+z12LZ54DXxO3LjWdIgNE3n1x1FMbMQZQp9iwuMyQ== X-Google-Smtp-Source: AFSGD/X9dIFJpL9Erk7vXJ06T4O9kfgHnX2Jv7BHQKoG7QS3uJRdp5d2mYP4XM9Ly4bKf4F/TBV88E94HEv6pmHb+/o= X-Received: by 2002:a17:902:5601:: with SMTP id h1mr12292423pli.160.1543748062729; Sun, 02 Dec 2018 02:54:22 -0800 (PST) MIME-Version: 1.0 References: <20181130192946.13732-1-iryzhov@nfware.com> <20181130194750.13870-1-iryzhov@nfware.com> <20181130153815.3be2f30b@xeon-e3> <20181201093150.2ab26e85@xeon-e3> In-Reply-To: <20181201093150.2ab26e85@xeon-e3> From: Igor Ryzhov Date: Sun, 2 Dec 2018 13:54:11 +0300 Message-ID: To: Stephen Hemminger Cc: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v2] kni: use kni_ethtool_ops only with unknown 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: , X-List-Received-Date: Sun, 02 Dec 2018 10:54:24 -0000 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 =3D { .cmd =3D ETHTOOL_GLINK }; if (!dev->ethtool_ops->get_link) return -EOPNOTSUPP; edata.data =3D 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 wrote: > On Sat, 1 Dec 2018 14:12:54 +0300 > Igor Ryzhov wrote: > > > Hi Stephen, > > > > I also do not see the point of the current implementation of ethtool > > support. > > That's why I sent this patch =E2=80=93 it enables ethtool_ops for all d= evices, > > 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 fo= r: > > 1. Port configuration from Linux =E2=80=93 such functions as set_mac, c= hange_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 possib= le > but probably not implemented. > >