From: Stephen Hemminger <stephen@networkplumber.org>
To: vyasevic@redhat.com
Cc: Alex Williamson <alex.williamson@hp.com>,
Rusty Russell <rusty@rustcorp.com.au>,
"Michael S. Tsirkin" <mst@redhat.com>,
netdev@vger.kernel.org
Subject: Re: [RFC] virtio_net: multicast address list never sent to host
Date: Fri, 6 Dec 2013 14:51:45 -0800 [thread overview]
Message-ID: <20131206145145.29d204f9@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <52A1E16B.8050507@redhat.com>
On Fri, 06 Dec 2013 09:38:35 -0500
Vlad Yasevich <vyasevic@redhat.com> wrote:
> > - sgs[out_num++] = out;
> > - if (in)
> > - sgs[out_num + in_num++] = in;
> > + while (out_cnt-- > 0)
> > + sgs[out_num++] = out++;
>
> I think we can skip sg_count and just use
> while ((sg = sg_next(out)) != NULL)
> sgs[out_num++] = sg;
>
> And we can probably do this loop for both 'in' and 'out' pointers.
>
> -vlad
That won't work because callers pass a list with a single element,
as in:
> static int virtnet_set_mac_address(struct net_device *dev, void *p)
> {
> struct virtnet_info *vi = netdev_priv(dev);
> struct virtio_device *vdev = vi->vdev;
> int ret;
> struct sockaddr *addr = p;
> struct scatterlist sg;
>
> ret = eth_prepare_mac_addr_change(dev, p);
> if (ret)
> return ret;
>
> if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_MAC_ADDR)) {
> sg_init_one(&sg, addr->sa_data, dev->addr_len);
> if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_MAC,
> VIRTIO_NET_CTRL_MAC_ADDR_SET,
> &sg, NULL)) {
> dev_warn(&vdev->dev,
next prev parent reply other threads:[~2013-12-06 22:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-05 23:20 [RFC] virtio_net: multicast address list never sent to host Stephen Hemminger
2013-12-06 14:38 ` Vlad Yasevich
2013-12-06 22:51 ` Stephen Hemminger [this message]
2013-12-07 1:37 ` Vlad Yasevich
2013-12-07 0:42 ` Rusty Russell
2013-12-08 12:35 ` Michael S. Tsirkin
2013-12-08 19:43 ` Stephen Hemminger
2013-12-10 8:22 ` Amos Kong
2013-12-16 7:52 ` Amos Kong
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=20131206145145.29d204f9@nehalam.linuxnetplumber.net \
--to=stephen@networkplumber.org \
--cc=alex.williamson@hp.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=vyasevic@redhat.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.