DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Ivan Dyukov" <i.dyukov@samsung.com>,
	"Thomas Monjalon" <thomas@monjalon.net>,
	"Ferruh Yigit" <ferruh.yigit@intel.com>,
	"Andrew Rybchenko" <arybchenko@solarflare.com>
Cc: <dev@dpdk.org>, "Matan Azrad" <matan@mellanox.com>,
	"Benoit Ganne (bganne)" <bganne@cisco.com>,
	<maxime.coquelin@redhat.com>, <tiwei.bie@intel.com>,
	<amorenoz@redhat.com>, <zhihong.wang@intel.com>,
	<xiaolong.ye@intel.com>
Subject: Re: [dpdk-dev] [RFC] ethdev: use special speed for virtual Ethernetdevices
Date: Thu, 2 Apr 2020 15:50:00 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35C60F3A@smartserver.smartshare.dk> (raw)
In-Reply-To: <bbe2260d-2839-db8e-81b2-fb8bc1e91347@samsung.com>

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ivan Dyukov
> Sent: Thursday, April 2, 2020 2:54 PM
> 
> 01.04.2020 13:06, Morten Brørup пишет:
> >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> >> Sent: Wednesday, April 1, 2020 11:54 AM
> >>
> >> 01/04/2020 11:33, Morten Brørup:
> >>> Thomas, Ferruh, Andrew (Ethernet API Maintainers),
> >>>
> >>> A command line option was recently added to set which speed a vNIC
> >> reports when the link is up. This makes sense for Spanning Tree and
> >> other protocols which depend on link speed.
> >>
> >> Please could you reference the patch?
> > It is a patch for the virtio driver:
> > https://protect2.fireeye.com/url?k=e37beb37-beabe3df-e37a6078-
> 000babff32e3-
> 4aaaa0986ed7ec57&u=http://inbox.dpdk.org/dev/20191212085012.9170-1-
> i.dyukov@samsung.com/T/#m052f90ea8c559406aeaefaea1fc24ed9bb573788
> This patch is related to similar work in qemu & kernel virtio driver.
> Please see
> https://lists.oasis-open.org/archives/virtio-
> comment/201911/msg00058.html.
> These changes have been implemented and released in kernel and qemu.
> speed is negotiated from qemu and then user may change the speed of
> virtio device using ethtool utility. I have added similiar patchset for
> pmd driver which do the same but for changing speed I used devargs
> instead of ethtool.

Very interesting link, indeed!

It gives the virtio driver the possibility to expose a specific speed in Mbit/s, which I assume - when used correctly - should reflect the speed of the underlying hardware. So it could be 20 Gbit/s for a link aggregate (in IEEE 802.3 Ethernet terminology; "bond" in Linux terminology) of two 10G ports.

It also provides a special value for unknown speed.

> >
> >>> However, I suspect that this workaround rarely reflects the
> physical
> >> truth, and suggest that the application should handle it instead.
> >>
> >> I don't understand why we need to define some speed for virtual
> >> devices.
> >>
> >>> In other words... Instead of faking it in the virtual Ethernet
> >> drivers, I suggest that rte_ethdev.h defines a special speed value
> for
> >> vNICs which really don't have a physical link speed:
> >>> #define ETH_SPEED_NUM_NONE         0 /**< Not defined */
> >> The only issue with this constant is the lack of RTE_ prefix :-)
> >> Otherwise I think "0 - NONE - not defined" fits well with virtual
> >> device case.
> >>
> >>> +#define ETH_SPEED_NUM_UNKNOWN      1 /**< Unknown (virtual device)
> >> */
> >>
> >> 1 means 1 Mbps
> >>
> >>> #define ETH_SPEED_NUM_10M         10 /**<  10 Mbps */
> >>>
> >>> Alternatively, we could expand the meaning of ETH_SPEED_NUM_NONE:
> >>>
> >>> -#define ETH_SPEED_NUM_NONE         0 /**< Not defined */
> >>> +#define ETH_SPEED_NUM_NONE         0 /**< Not defined or unknown
> >> (virtual device) */
> >>
> >> Yes I agree with extending the comment for NONE.
> >>
> >>> The special value could also be used in cases like this:
> >>>
> >> https://protect2.fireeye.com/url?k=6154668d-3c846e65-6155edc2-
> 000babff32e3-
> bf63d034253cac80&u=http://inbox.dpdk.org/dev/AM0PR0502MB401907ADE7CEA27
> DC642DF35D2CB0@AM0P
> >> R0502MB4019.eurprd05.prod.outlook.com/T/#t
> >>
> >> Yes, if speed is unknown, it should be reported as 0.

Could the DPDK vNIC PMDs be updated accordingly? At least the virtio driver...

> > So the next related question is: Should a vNIC be allowed to report a
> fake speed if it does not know that the underlying hardware actually
> provides this speed?

Your link to the Kernel/QEMU patch answers this question: Yes, because we assume it reflects the underlying speed.



  reply	other threads:[~2020-04-02 13:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01  9:33 [dpdk-dev] [RFC] ethdev: use special speed for virtual Ethernet devices Morten Brørup
2020-04-01  9:53 ` Thomas Monjalon
2020-04-01 10:03   ` Benoit Ganne (bganne)
2020-04-01 10:06   ` [dpdk-dev] [RFC] ethdev: use special speed for virtual Ethernetdevices Morten Brørup
2020-04-02 12:54     ` Ivan Dyukov
2020-04-02 13:50       ` Morten Brørup [this message]
2020-04-02 15:29         ` Stephen Hemminger
2020-04-02 20:41         ` Ivan Dyukov
2020-04-02 20:58           ` Thomas Monjalon
2020-04-03  8:05             ` Ivan Dyukov
2020-04-03  9:45               ` Morten Brørup
2020-04-03 11:01                 ` Thomas Monjalon
2020-04-07 22:26                 ` [dpdk-dev] [PATCH 0/2] ethdev link speed Thomas Monjalon
2020-04-07 22:26                   ` [dpdk-dev] [PATCH 1/2] ethdev: deduplicate functions to get link infos Thomas Monjalon
2020-04-08  5:21                     ` Asaf Penso
2020-04-08 12:49                       ` Thomas Monjalon
2020-04-13 14:14                     ` Andrew Rybchenko
2020-04-07 22:26                   ` [dpdk-dev] [PATCH 2/2] ethdev: allow unknown link speed Thomas Monjalon
2020-04-08  5:39                     ` Jerin Jacob
2020-04-10 10:53                     ` Morten Brørup
2020-04-13 14:26                     ` Andrew Rybchenko
2020-04-16 13:42                       ` Ferruh Yigit
2020-04-26 11:44                     ` Matan Azrad

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=98CBD80474FA8B44BF855DF32C47DC35C60F3A@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=amorenoz@redhat.com \
    --cc=arybchenko@solarflare.com \
    --cc=bganne@cisco.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=i.dyukov@samsung.com \
    --cc=matan@mellanox.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=thomas@monjalon.net \
    --cc=tiwei.bie@intel.com \
    --cc=xiaolong.ye@intel.com \
    --cc=zhihong.wang@intel.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).