All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Dmitry Fleytman <dmitry@daynix.com>,
	virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org
Cc: Yan Vugenfirer <yan@daynix.com>, Ronen Hod <rhod@redhat.com>,
	Dmitry Fleytman <dfleytma@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH 1/2 V3] virtio-spec: dynamic network offloads configuration
Date: Wed, 03 Apr 2013 11:50:19 +1030	[thread overview]
Message-ID: <87ehes5s18.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1364902740-24948-2-git-send-email-dmitry@daynix.com>

Dmitry Fleytman <dmitry@daynix.com> writes:
> From: Dmitry Fleytman <dfleytma@redhat.com>
>
> Virtio-net driver currently negotiates network offloads
> on startup via features mechanism and have no ability to
> change offloads state later.
> This patch introduced a new control command that allows
> to configure device network offloads state dynamically.
> The patch also introduces a new feature flag
> VIRTIO_NET_F_CTRL_GUEST_OFFLOADS.
>
> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>

(BTW, I like to be CC'd on these things directly, so I don't miss them)

The idea is fine.

But I dislike the duplication of constants: let's just use the feature
bits directly:

#define VIRTIO_NET_F_GUEST_CSUM	1	/* Guest handles pkts w/ partial csum */
#define VIRTIO_NET_F_GUEST_TSO4	7	/* Guest can handle TSOv4 in. */
#define VIRTIO_NET_F_GUEST_TSO6	8	/* Guest can handle TSOv6 in. */
#define VIRTIO_NET_F_GUEST_ECN	9	/* Guest can handle TSO[6] w/ ECN in. */
#define VIRTIO_NET_F_GUEST_UFO	10	/* Guest can handle UFO in. */

You want this, because you have to test against them anyway before
trying to re-enable them.

And secondly, it'll be much clearer if you don't say "change" but
"disable and re-enable", which is what's actually allowed.

Thanks,
Rusty.

WARNING: multiple messages have this Message-ID (diff)
From: Rusty Russell <rusty@rustcorp.com.au>
To: Dmitry Fleytman <dmitry@daynix.com>,
	virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org
Cc: Yan Vugenfirer <yan@daynix.com>, Ronen Hod <rhod@redhat.com>,
	Dmitry Fleytman <dfleytma@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2 V3] virtio-spec: dynamic network offloads configuration
Date: Wed, 03 Apr 2013 11:50:19 +1030	[thread overview]
Message-ID: <87ehes5s18.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1364902740-24948-2-git-send-email-dmitry@daynix.com>

Dmitry Fleytman <dmitry@daynix.com> writes:
> From: Dmitry Fleytman <dfleytma@redhat.com>
>
> Virtio-net driver currently negotiates network offloads
> on startup via features mechanism and have no ability to
> change offloads state later.
> This patch introduced a new control command that allows
> to configure device network offloads state dynamically.
> The patch also introduces a new feature flag
> VIRTIO_NET_F_CTRL_GUEST_OFFLOADS.
>
> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>

(BTW, I like to be CC'd on these things directly, so I don't miss them)

The idea is fine.

But I dislike the duplication of constants: let's just use the feature
bits directly:

#define VIRTIO_NET_F_GUEST_CSUM	1	/* Guest handles pkts w/ partial csum */
#define VIRTIO_NET_F_GUEST_TSO4	7	/* Guest can handle TSOv4 in. */
#define VIRTIO_NET_F_GUEST_TSO6	8	/* Guest can handle TSOv6 in. */
#define VIRTIO_NET_F_GUEST_ECN	9	/* Guest can handle TSO[6] w/ ECN in. */
#define VIRTIO_NET_F_GUEST_UFO	10	/* Guest can handle UFO in. */

You want this, because you have to test against them anyway before
trying to re-enable them.

And secondly, it'll be much clearer if you don't say "change" but
"disable and re-enable", which is what's actually allowed.

Thanks,
Rusty.

  reply	other threads:[~2013-04-03  1:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-02 11:38 [PATCH 0/2 V3] virtio-spec/net: dynamic network offloads configuration Dmitry Fleytman
2013-04-02 11:38 ` [Qemu-devel] " Dmitry Fleytman
2013-04-02 11:38 ` [PATCH 1/2 V3] virtio-spec: " Dmitry Fleytman
2013-04-02 11:38   ` [Qemu-devel] " Dmitry Fleytman
2013-04-03  1:20   ` Rusty Russell [this message]
2013-04-03  1:20     ` Rusty Russell
2013-04-03 11:25     ` Michael S. Tsirkin
2013-04-03 11:25       ` [Qemu-devel] " Michael S. Tsirkin
2013-04-04  7:51       ` Dmitry Fleytman
2013-04-04  7:51         ` [Qemu-devel] " Dmitry Fleytman
2013-04-02 11:39 ` [PATCH 2/2 V3] virtio-net: " Dmitry Fleytman
2013-04-02 11:39   ` [Qemu-devel] " Dmitry Fleytman
2013-04-02 11:57 ` [PATCH 0/2 V3] virtio-spec/net: " Michael S. Tsirkin
2013-04-02 11:57   ` [Qemu-devel] " Michael S. Tsirkin

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=87ehes5s18.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=dfleytma@redhat.com \
    --cc=dmitry@daynix.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rhod@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=yan@daynix.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 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.