All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Sridhar Samudrala <sridhar.samudrala@intel.com>
Cc: stephen@networkplumber.org, netdev@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	virtio-dev@lists.oasis-open.org, jesse.brandeburg@intel.com
Subject: [virtio-dev] Re: [PATCH net-next 1/2] virtio_net: Introduce VIRTIO_NET_F_MASTER feature bit
Date: Wed, 3 Jan 2018 19:43:02 +0200	[thread overview]
Message-ID: <20180103191101-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1514939738-22423-2-git-send-email-sridhar.samudrala@intel.com>

On Tue, Jan 02, 2018 at 04:35:37PM -0800, Sridhar Samudrala wrote:
> This feature bit can be used by hypervisor to indicate virtio_net device to
> act as a master for a directly attached passthru device with the same MAC
> address.
> 
> Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
> ---
>  drivers/net/virtio_net.c        | 3 ++-
>  include/uapi/linux/virtio_net.h | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 6fb7b658a6cc..46844a1d9a62 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -2796,7 +2796,8 @@ static struct virtio_device_id id_table[] = {
>  	VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \
>  	VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \
>  	VIRTIO_NET_F_CTRL_MAC_ADDR, \
> -	VIRTIO_NET_F_MTU, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS
> +	VIRTIO_NET_F_MTU, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, \
> +	VIRTIO_NET_F_MASTER
>  
>  static unsigned int features[] = {
>  	VIRTNET_FEATURES,
> diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
> index fc353b518288..a9b4e0836786 100644
> --- a/include/uapi/linux/virtio_net.h
> +++ b/include/uapi/linux/virtio_net.h
> @@ -56,6 +56,7 @@
>  #define VIRTIO_NET_F_MQ	22	/* Device supports Receive Flow
>  					 * Steering */
>  #define VIRTIO_NET_F_CTRL_MAC_ADDR 23	/* Set MAC address */
> +#define VIRTIO_NET_F_MASTER	62	/* act as master for a VF device */

Well the virtio hardware doesn't really know whether it's a master or
the slave of a bond. In fact quite possibly down the road we'll add a
virtual device on top as others seem to want to do - that other one will
be the master then.

And we do nothing do check it's a VF.

So maybe a better name would be

#define VIRTIO_NET_F_BACKUP	62	/* Act as backup for another device with the same MAC */

>  
>  #ifndef VIRTIO_NET_NO_LEGACY
>  #define VIRTIO_NET_F_GSO	6	/* Host handles pkts w/ any GSO type */
> -- 
> 2.14.3

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Sridhar Samudrala <sridhar.samudrala@intel.com>
Cc: stephen@networkplumber.org, netdev@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	virtio-dev@lists.oasis-open.org, jesse.brandeburg@intel.com
Subject: Re: [PATCH net-next 1/2] virtio_net: Introduce VIRTIO_NET_F_MASTER feature bit
Date: Wed, 3 Jan 2018 19:43:02 +0200	[thread overview]
Message-ID: <20180103191101-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1514939738-22423-2-git-send-email-sridhar.samudrala@intel.com>

On Tue, Jan 02, 2018 at 04:35:37PM -0800, Sridhar Samudrala wrote:
> This feature bit can be used by hypervisor to indicate virtio_net device to
> act as a master for a directly attached passthru device with the same MAC
> address.
> 
> Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
> ---
>  drivers/net/virtio_net.c        | 3 ++-
>  include/uapi/linux/virtio_net.h | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 6fb7b658a6cc..46844a1d9a62 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -2796,7 +2796,8 @@ static struct virtio_device_id id_table[] = {
>  	VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \
>  	VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \
>  	VIRTIO_NET_F_CTRL_MAC_ADDR, \
> -	VIRTIO_NET_F_MTU, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS
> +	VIRTIO_NET_F_MTU, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, \
> +	VIRTIO_NET_F_MASTER
>  
>  static unsigned int features[] = {
>  	VIRTNET_FEATURES,
> diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
> index fc353b518288..a9b4e0836786 100644
> --- a/include/uapi/linux/virtio_net.h
> +++ b/include/uapi/linux/virtio_net.h
> @@ -56,6 +56,7 @@
>  #define VIRTIO_NET_F_MQ	22	/* Device supports Receive Flow
>  					 * Steering */
>  #define VIRTIO_NET_F_CTRL_MAC_ADDR 23	/* Set MAC address */
> +#define VIRTIO_NET_F_MASTER	62	/* act as master for a VF device */

Well the virtio hardware doesn't really know whether it's a master or
the slave of a bond. In fact quite possibly down the road we'll add a
virtual device on top as others seem to want to do - that other one will
be the master then.

And we do nothing do check it's a VF.

So maybe a better name would be

#define VIRTIO_NET_F_BACKUP	62	/* Act as backup for another device with the same MAC */

>  
>  #ifndef VIRTIO_NET_NO_LEGACY
>  #define VIRTIO_NET_F_GSO	6	/* Host handles pkts w/ any GSO type */
> -- 
> 2.14.3

  parent reply	other threads:[~2018-01-03 17:43 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03  0:35 [virtio-dev] [PATCH net-next 0/2] Enable virtio to act as a master for a passthru device Sridhar Samudrala
2018-01-03  0:35 ` Sridhar Samudrala
2018-01-03  0:35 ` [virtio-dev] [PATCH net-next 1/2] virtio_net: Introduce VIRTIO_NET_F_MASTER feature bit Sridhar Samudrala
2018-01-03  0:35   ` Sridhar Samudrala
2018-01-03 16:36   ` David Miller
2018-01-03 16:36   ` David Miller
2018-01-03 17:43   ` Michael S. Tsirkin [this message]
2018-01-03 17:43     ` Michael S. Tsirkin
2018-01-03 18:17     ` Samudrala, Sridhar
2018-01-03 18:17     ` [virtio-dev] " Samudrala, Sridhar
2018-01-03 18:17       ` Samudrala, Sridhar
2018-01-03 17:43   ` Michael S. Tsirkin
2018-01-03  0:35 ` Sridhar Samudrala
2018-01-03  0:35 ` [virtio-dev] [PATCH net-next 2/2] virtio_net: Extend virtio to use VF datapath when available Sridhar Samudrala
2018-01-03  0:35   ` Sridhar Samudrala
2018-01-03  0:35 ` Sridhar Samudrala
2018-01-03  2:16 ` [PATCH net-next 0/2] Enable virtio to act as a master for a passthru device Jakub Kicinski
2018-01-03 16:59   ` Alexander Duyck
2018-01-03 16:59   ` Alexander Duyck
2018-01-03 18:14     ` Samudrala, Sridhar
2018-01-03 18:14     ` [virtio-dev] " Samudrala, Sridhar
2018-01-03 18:14       ` Samudrala, Sridhar
2018-01-03 18:28       ` Alexander Duyck
2018-01-03 18:28       ` [virtio-dev] " Alexander Duyck
2018-01-03 18:28         ` Alexander Duyck
2018-01-04  0:22         ` [virtio-dev] " Samudrala, Sridhar
2018-01-04  0:22           ` Samudrala, Sridhar
     [not found]           ` <CADGSJ22TXcyJ1iAAtKho7S=jGfUzUsqvAx-HV2XuwV2sLwfR_Q@mail.gmail.com>
     [not found]             ` <b623709f-69ab-b491-3931-7df74745b723@intel.com>
     [not found]               ` <CADGSJ223aJjt6X-dA=pKVP3_5+BOQ==Rd017LqBrBsKWqXiNSw@mail.gmail.com>
     [not found]                 ` <432a4b0a-fadc-3025-b9f6-09fd3e1b384a@intel.com>
     [not found]                   ` <CADGSJ21rDfqzsnd+m5f6w=LqoTY3Bb0p1Pe+_tppdEm_8HysKA@mail.gmail.com>
2018-01-22 19:00                     ` Siwei Liu
2018-01-22 19:00                     ` Siwei Liu
2018-01-04  0:22         ` Samudrala, Sridhar
2018-01-03  2:16 ` Jakub Kicinski

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=20180103191101-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sridhar.samudrala@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.