From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tuomas Tynkkynen Date: Fri, 28 Sep 2018 01:12:19 +0300 Subject: [U-Boot] [PATCH 05/27] virtio: Add net driver support In-Reply-To: <1537710145-1888-6-git-send-email-bmeng.cn@gmail.com> References: <1537710145-1888-1-git-send-email-bmeng.cn@gmail.com> <1537710145-1888-6-git-send-email-bmeng.cn@gmail.com> Message-ID: <529204d2-aee7-052a-f4bb-e4812a3ff2b7@iki.fi> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Bin, On 09/23/2018 04:42 PM, Bin Meng wrote: > From: Tuomas Tynkkynen > > This adds virtio net device driver support. > > Signed-off-by: Tuomas Tynkkynen > Signed-off-by: Bin Meng > --- ... > +static u32 feature[] = { > + VIRTIO_NET_F_MAC > +}; > + > +static u32 feature_legacy[] = { > + VIRTIO_NET_F_MAC > +}; These can be const. ... > + > +static void virtio_net_stop(struct udevice *dev) > +{ > + /* > + * There is no way to stop the queue from running, unless we issue > + * a reset to the virtio device, and re-do the queue initialization > + * from the beginning. > + */ > +} Unless I missed it, we still need to do something when we pass control to Linux so that the memory used for receive buffers doesn't get overwritten by the virtio device during Linux boot. I think this can be done by calling virtio_reset() on the device in some uclass-level hook, maybe .child_post_remove().