[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161203.230103.2147950370567010856.davem@davemloft.net>
Date: Sat, 03 Dec 2016 23:01:03 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: john.fastabend@...il.com
Cc: daniel@...earbox.net, mst@...hat.com, shm@...ulusnetworks.com,
tgraf@...g.ch, alexei.starovoitov@...il.com,
john.r.fastabend@...el.com, netdev@...r.kernel.org,
bblanco@...mgrid.com, brouer@...hat.com
Subject: Re: [net-next PATCH v4 1/6] net: virtio dynamically disable/enable
LRO
From: John Fastabend <john.fastabend@...il.com>
Date: Fri, 02 Dec 2016 12:49:45 -0800
> + if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS)) {
> + sg_init_one(&sg, &offloads, sizeof(uint64_t));
> + if (!virtnet_send_command(vi,
> + VIRTIO_NET_CTRL_GUEST_OFFLOADS,
> + VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET,
> + &sg)) {
> + dev_warn(&netdev->dev,
> + "Failed to set guest offloads by virtnet command.\n");
> + return -EINVAL;
> + }
> + } else if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS) &&
> + !virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) {
Hmmm, to me this reads as:
if (X) {
...
else if (X && ...) {
I don't see how the second basic block can ever execute. If the virtio
has the VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature, we will execute only
the first basic block.
Maybe I misunderstand the logic for whatever reason.
Powered by blists - more mailing lists