qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cindy Lu <lulu@redhat.com>
To: lulu@redhat.com, mst@redhat.com, jasowang@redhat.com,
	qemu-devel@nongnu.org
Subject: [PATCH 3/3] virtio_net: remove the unnecessary check in get_config
Date: Tue,  6 Aug 2024 08:58:03 +0800	[thread overview]
Message-ID: <20240806005814.51651-3-lulu@redhat.com> (raw)
In-Reply-To: <20240806005814.51651-1-lulu@redhat.com>

The vdpa device with MAC address 0 should not boot.
So remove the check here

Signed-off-by: Cindy Lu <lulu@redhat.com>
---
 hw/net/virtio-net.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index c144ae2e78..8a7c743ad3 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -142,7 +142,6 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)
     VirtIONet *n = VIRTIO_NET(vdev);
     struct virtio_net_config netcfg;
     NetClientState *nc = qemu_get_queue(n->nic);
-    static const MACAddr zero = { .a = { 0, 0, 0, 0, 0, 0 } };
 
     int ret = 0;
     memset(&netcfg, 0 , sizeof(struct virtio_net_config));
@@ -170,18 +169,6 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)
         if (ret == -1) {
             return;
         }
-
-        /*
-         * Some NIC/kernel combinations present 0 as the mac address.  As that
-         * is not a legal address, try to proceed with the address from the
-         * QEMU command line in the hope that the address has been configured
-         * correctly elsewhere - just not reported by the device.
-         */
-        if (memcmp(&netcfg.mac, &zero, sizeof(zero)) == 0) {
-            info_report("Zero hardware mac address detected. Ignoring.");
-            memcpy(netcfg.mac, n->mac, ETH_ALEN);
-        }
-
         netcfg.status |= virtio_tswap16(vdev,
                                         n->status & VIRTIO_NET_S_ANNOUNCE);
         memcpy(config, &netcfg, n->config_size);
-- 
2.45.0



  parent reply	other threads:[~2024-08-06  0:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-06  0:58 [PATCH 1/3] virtio_net: Add the check for vdpa's mac address Cindy Lu
2024-08-06  0:58 ` [PATCH 2/3] virtio_net: Add the check for vdpa " Cindy Lu
2024-08-06  3:08   ` Jason Wang
2024-08-06  0:58 ` Cindy Lu [this message]
2024-08-06  3:09   ` [PATCH 3/3] virtio_net: remove the unnecessary check in get_config Jason Wang
2024-08-06  9:47     ` Cindy Lu
2024-08-06  3:06 ` [PATCH 1/3] virtio_net: Add the check for vdpa's mac address Jason Wang
2024-08-06  9:43   ` Cindy Lu
2024-08-06 11:12     ` Yan Vugenfirer
2024-08-09  9:14       ` Cindy Lu
2024-08-07  2:35     ` Jason Wang
2024-08-09  9:14       ` Cindy Lu
2024-08-06 13:30 ` Michael S. Tsirkin
2024-08-09  9:15   ` Cindy Lu

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=20240806005814.51651-3-lulu@redhat.com \
    --to=lulu@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).