From patchwork Thu Jul 1 09:46:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1499475 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=OgtgRcKL; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GFtfG6k1qz9sVb for ; Thu, 1 Jul 2021 19:47:01 +1000 (AEST) Received: from localhost ([::1]:48880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lytHd-0001qH-Q0 for incoming@patchwork.ozlabs.org; Thu, 01 Jul 2021 05:46:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lytHI-0001q6-6i for qemu-devel@nongnu.org; Thu, 01 Jul 2021 05:46:37 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:39828) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lytHF-0003rA-Hw for qemu-devel@nongnu.org; Thu, 01 Jul 2021 05:46:35 -0400 Received: by mail-ej1-x630.google.com with SMTP id yy20so9394374ejb.6 for ; Thu, 01 Jul 2021 02:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=orPQeS2G48u2gt6v14DWfmBn75seg7vljGHtmw7pNGU=; b=OgtgRcKLIpvDTL/DmdC0by+Va+c/lOtXjMQXiixN7PZGHOb6ASC8HmCaRAbyOpi9Op paNau54I/js1C/t0Lx75IzzqAY6cEm8ov53x+X2pw8Ef2ex+ZfW1oWKtruf4uSumGJN4 ptdUyYHbFJWpQtR0G86O3TYJKPddKSBMVOufTiLcC/xxdLjbqZskDvRpPX3AHFnxZAYq M3uqB522OLQ1zPip9vrjLaD20ONECMKmpI7U9T9C2H5tX/Dn89WsRgVacEheK+I3I943 UwrKDSODnT1GKb7ga/Lt7T39jEmeo6tz4LMVyzimKdd3KdjeDI6ixo178oojh4UW8Ndd +U3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=orPQeS2G48u2gt6v14DWfmBn75seg7vljGHtmw7pNGU=; b=OyQ52lp1x4fM0Iax5sOhQbqknW4U3O8VvbllJYm6Zm/9rSvDA33amysQgGe7ysi6pE GfFmLoWLgUihjx+p4Yc0uUOx7IzJiuKkl+BAOfFHkIqgvACKLnoNaX2xfqSbBcRq+pEH XXz30GkYc/F2TIzoMAIxSGdLdq7VUolzN5R0xV8TRol0AE2VmdEEwci8D4bbtsEFF/nD k5WIWMYKV0mNsi6XzVo68/OQaB6Q7P3CXch5gPbvzS9gSNoDy0RxVJW70F4mXlF1i9j8 Hu2g/+dYHKVeqiT3cwIg6MlyJQvMDkw/RKVDMM/G+m8WWGfPFV8toULq4x1KZy4pFuIA LLfg== X-Gm-Message-State: AOAM532Wi7n6mH3KP3i5+OL7BD9YLdHxrkpWMfqU17Z9KgKOneiVX8/7 BMlw9aD3ZXRRdRMrjh8fm8k= X-Google-Smtp-Source: ABdhPJzXRxBojfh1qANDogY19+drpNNMPo6uK+VwKIRHA016pnpIDaiW0fHzZqkM3nwSm3TuWwyx/Q== X-Received: by 2002:a17:906:2bc6:: with SMTP id n6mr40631660ejg.256.1625132791611; Thu, 01 Jul 2021 02:46:31 -0700 (PDT) Received: from pek-vx-bsp2.wrs.com (ec2-44-242-66-180.us-west-2.compute.amazonaws.com. [44.242.66.180]) by smtp.gmail.com with ESMTPSA id d25sm14467479edu.83.2021.07.01.02.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 02:46:31 -0700 (PDT) From: Bin Meng To: Jason Wang , qemu-devel@nongnu.org Subject: [PATCH 1/3] hw/net: e1000: Correct the initial value of VET register Date: Thu, 1 Jul 2021 17:46:49 +0800 Message-Id: <20210701094651.1258613-1-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=bmeng.cn@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bin Meng , Christina Wang , Markus Carlstedt Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Christina Wang The initial value of VLAN Ether Type (VET) register is 0x8100, as per the manual and real hardware. While Linux e1000 driver always writes VET register to 0x8100, it is not always the case for everyone. Drivers relying on the reset value of VET won't be able to transmit and receive VLAN frames in QEMU. Reported-by: Markus Carlstedt Signed-off-by: Christina Wang Signed-off-by: Bin Meng Signed-off-by: Bin Meng --- hw/net/e1000.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 4f75b44cfc..20cbba6411 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -29,6 +29,7 @@ #include "hw/pci/pci.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" +#include "net/eth.h" #include "net/net.h" #include "net/checksum.h" #include "sysemu/sysemu.h" @@ -254,6 +255,7 @@ static const uint32_t mac_reg_init[] = { [MANC] = E1000_MANC_EN_MNG2HOST | E1000_MANC_RCV_TCO_EN | E1000_MANC_ARP_EN | E1000_MANC_0298_EN | E1000_MANC_RMCP_EN, + [VET] = ETH_P_VLAN, }; /* Helper function, *curr == 0 means the value is not set */ From patchwork Thu Jul 1 09:46:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1499483 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=qQxcwIkj; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GFth33KKMz9sVb for ; Thu, 1 Jul 2021 19:48:35 +1000 (AEST) Received: from localhost ([::1]:52926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lytJB-0004YW-7e for incoming@patchwork.ozlabs.org; Thu, 01 Jul 2021 05:48:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lytHL-0001qJ-Mc for qemu-devel@nongnu.org; Thu, 01 Jul 2021 05:46:39 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:34535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lytHJ-0003tK-7M for qemu-devel@nongnu.org; Thu, 01 Jul 2021 05:46:39 -0400 Received: by mail-ed1-x52b.google.com with SMTP id i5so7541567eds.1 for ; Thu, 01 Jul 2021 02:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P5hDw/nlIpTS+nKMVatqsFM30wswQxYZ5Vh6WmjDBM4=; b=qQxcwIkjdcoWHcr6r7Pc9K2DszHbKhokriViu9Kwsrx2jbk8lqKdgT7KBXRnMB8z3G 2Lz4ygzSlm/rvztnD4UfrqWkWA2vEK6UPrf8E8LcCYmK/nV6TcYTe0O4zjquACm0d6x3 Mi2aVQ/O7S9D5Jog/gJb50a1Uy4sH96VK+r2JyNyXhqG/ZmHtlC2/+D4Lj4p3YPsyh66 ZGc+uxpPXkJUcLcswuzkIf9DgcIjpqqklyesu2yzlvxtLieWhqh4lCHS44EomTNXjO0O q74Y7XY9LuF1m5Fz2TfPaeM17tEuiFuaTZtaFKvVIBfT8sjBFSGlPz/jUgqXzeF+4qNs BAUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P5hDw/nlIpTS+nKMVatqsFM30wswQxYZ5Vh6WmjDBM4=; b=XNEY2iq3dQyLFxb4udSPaGcdL8d/7RT7YgOTFNKc78MUWT+tDM6c33E/bfo+SWRH6f 1rzTr+IPm2F3dcWUjjaYPerX/JobULwmU8UaQjy0awDwAJImk8ZNj7fhy3Xnp1P/HngK o4x14KbsUoUAiwbJW0FdBnOdFZgKiwNZ38F88gv1+rYBH1yWvHFv7lroa6gxCs1ivEvM 5UItN5TUiyvyAYlvad5EttUCcnk/VesCetNnxmMEnzHU2FlAw6ML9MqXheO+Vgh1DjZL jTvU2hpuEPrJRBU5fZwfcxAEAVXBH/xO8k5HH46N9/u/cNMq7zekiQ0IEcE8hN3DRNy1 La4w== X-Gm-Message-State: AOAM531X8lnkRLrT14tTjeTUt5kLCK5jn/izwi3W0U8awlhkwsLLesjv Hhk93f98T5kLt7R8QxYz6mw= X-Google-Smtp-Source: ABdhPJyN8972ADi5vjv5nf+wPoVqyqMLzjA/m+QNbgcIdpHE4e08A/FEz3m61rNLDCH4Gq2sq86AQw== X-Received: by 2002:aa7:cb43:: with SMTP id w3mr54692017edt.126.1625132795676; Thu, 01 Jul 2021 02:46:35 -0700 (PDT) Received: from pek-vx-bsp2.wrs.com (ec2-44-242-66-180.us-west-2.compute.amazonaws.com. [44.242.66.180]) by smtp.gmail.com with ESMTPSA id d25sm14467479edu.83.2021.07.01.02.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 02:46:35 -0700 (PDT) From: Bin Meng To: Jason Wang , qemu-devel@nongnu.org Subject: [PATCH 2/3] hw/net: e1000e: Correct the initial value of VET register Date: Thu, 1 Jul 2021 17:46:50 +0800 Message-Id: <20210701094651.1258613-2-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210701094651.1258613-1-bmeng.cn@gmail.com> References: <20210701094651.1258613-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=bmeng.cn@gmail.com; helo=mail-ed1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bin Meng , Christina Wang , Markus Carlstedt Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Christina Wang The initial value of VLAN Ether Type (VET) register is 0x8100, as per the manual and real hardware. While Linux e1000e driver always writes VET register to 0x8100, it is not always the case for everyone. Drivers relying on the reset value of VET won't be able to transmit and receive VLAN frames in QEMU. Unlike e1000 in QEMU, e1000e uses a field 'vet' in "struct E1000Core" to cache the value of VET register, but the cache only gets updated when VET register is written. To always get a consistent VET value no matter VET is written or remains its reset value, drop the 'vet' field and use 'core->mac[VET]' directly. Reported-by: Markus Carlstedt Signed-off-by: Christina Wang Signed-off-by: Bin Meng Signed-off-by: Bin Meng --- hw/net/e1000e_core.h | 2 -- hw/net/e1000e.c | 6 ++---- hw/net/e1000e_core.c | 11 ++++++----- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/net/e1000e_core.h b/hw/net/e1000e_core.h index 4ddb4d2c39..07d722bc68 100644 --- a/hw/net/e1000e_core.h +++ b/hw/net/e1000e_core.h @@ -105,8 +105,6 @@ struct E1000Core { uint32_t itr_guest_value; uint32_t eitr_guest_value[E1000E_MSIX_VEC_NUM]; - uint16_t vet; - uint8_t permanent_mac[ETH_ALEN]; NICState *owner_nic; diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index a8a77eca95..1797e4a7cb 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -602,8 +602,8 @@ static const VMStateDescription e1000e_vmstate_intr_timer = { static const VMStateDescription e1000e_vmstate = { .name = "e1000e", - .version_id = 1, - .minimum_version_id = 1, + .version_id = 2, + .minimum_version_id = 2, .pre_save = e1000e_pre_save, .post_load = e1000e_post_load, .fields = (VMStateField[]) { @@ -645,8 +645,6 @@ static const VMStateDescription e1000e_vmstate = { VMSTATE_UINT32_ARRAY(core.eitr_guest_value, E1000EState, E1000E_MSIX_VEC_NUM), - VMSTATE_UINT16(core.vet, E1000EState), - VMSTATE_STRUCT_ARRAY(core.tx, E1000EState, E1000E_NUM_QUEUES, 0, e1000e_vmstate_tx, struct e1000e_tx), VMSTATE_END_OF_LIST() diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index b75f2ab8fc..38b3e3b784 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -35,6 +35,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" +#include "net/eth.h" #include "net/net.h" #include "net/tap.h" #include "hw/pci/msi.h" @@ -731,7 +732,7 @@ e1000e_process_tx_desc(E1000ECore *core, if (e1000x_vlan_enabled(core->mac) && e1000x_is_vlan_txd(txd_lower)) { net_tx_pkt_setup_vlan_header_ex(tx->tx_pkt, - le16_to_cpu(dp->upper.fields.special), core->vet); + le16_to_cpu(dp->upper.fields.special), core->mac[VET]); } if (e1000e_tx_pkt_send(core, tx, queue_index)) { e1000e_on_tx_done_update_stats(core, tx->tx_pkt); @@ -1012,7 +1013,7 @@ e1000e_receive_filter(E1000ECore *core, const uint8_t *buf, int size) { uint32_t rctl = core->mac[RCTL]; - if (e1000x_is_vlan_packet(buf, core->vet) && + if (e1000x_is_vlan_packet(buf, core->mac[VET]) && e1000x_vlan_rx_filter_enabled(core->mac)) { uint16_t vid = lduw_be_p(buf + 14); uint32_t vfta = ldl_le_p((uint32_t *)(core->mac + VFTA) + @@ -1686,7 +1687,7 @@ e1000e_receive_iov(E1000ECore *core, const struct iovec *iov, int iovcnt) } net_rx_pkt_attach_iovec_ex(core->rx_pkt, iov, iovcnt, iov_ofs, - e1000x_vlan_enabled(core->mac), core->vet); + e1000x_vlan_enabled(core->mac), core->mac[VET]); e1000e_rss_parse_packet(core, core->rx_pkt, &rss_info); e1000e_rx_ring_init(core, &rxr, rss_info.queue); @@ -2397,8 +2398,7 @@ static void e1000e_set_vet(E1000ECore *core, int index, uint32_t val) { core->mac[VET] = val & 0xffff; - core->vet = le16_to_cpu(core->mac[VET]); - trace_e1000e_vlan_vet(core->vet); + trace_e1000e_vlan_vet(core->mac[VET]); } static void @@ -3442,6 +3442,7 @@ static const uint32_t e1000e_mac_reg_init[] = { [RXCSUM] = E1000_RXCSUM_IPOFLD | E1000_RXCSUM_TUOFLD, [ITR] = E1000E_MIN_XITR, [EITR...EITR + E1000E_MSIX_VEC_NUM - 1] = E1000E_MIN_XITR, + [VET] = ETH_P_VLAN, }; void From patchwork Thu Jul 1 09:46:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1499476 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Gc4Rblwi; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GFtfV6Cw7z9sVb for ; Thu, 1 Jul 2021 19:47:14 +1000 (AEST) Received: from localhost ([::1]:49040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lytHs-0001xL-KR for incoming@patchwork.ozlabs.org; Thu, 01 Jul 2021 05:47:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lytHO-0001um-IO for qemu-devel@nongnu.org; Thu, 01 Jul 2021 05:46:42 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]:34467) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lytHN-0003vP-17 for qemu-devel@nongnu.org; Thu, 01 Jul 2021 05:46:42 -0400 Received: by mail-ej1-x634.google.com with SMTP id hr1so5983356ejc.1 for ; Thu, 01 Jul 2021 02:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1q3FhOHZuKfxKp+TQHtgN4PSg9Y2txmELaoYvzRhyY8=; b=Gc4RblwinBt3azhWjp8Tv84jgsC3tpHLRQm0xk2jhEh4tKMTnTz6+fscjfk0AM4uEC +xdv45j7zu21T82sYgcs6e7zE+n5TugY9MsoytBSj+C1Yj5DXuCWuJbHKcoWpX3vdBXo IciudbAd//twNssnvnR8bmVsYVCmPK4kBSEGiS0StKTbzp6NIyo7dLakouFxbkzh51qL fRmmNU73Ndz7j7xAOPYIbRSh+5y5z9he+GVtscH8mbrLC6RXeT1WnKn5ES08a+IluN7E vZZGzAhDilAuboZDWhiOADLX2TrZGkpZar82nmuSl+7pwuRNGt5wu6SwjWuNlTfFwgCo cegQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1q3FhOHZuKfxKp+TQHtgN4PSg9Y2txmELaoYvzRhyY8=; b=EYPqA4hg5bAgzd8DmGG2Pq0Sfos1bytHn/yut00NgdI8Qcp3L2IVMI8SDZi6NBG6n2 Mp1SvBXXcTgvE/Zo4pp8jlWY8qEAZqu8zavrdmJKPcfe3ba/tMgkbvVRYkVXu0nCq4Kw yR8jMfDqhSgIWWRLC7B0vLmtLB1aIuzcd3LkZ/dbQK63iE7j230eUFwAyZUKNcQtqnvl eQSF1CkoAfle3z2jG+r2U2CZfzj1BFLW43WgPEgpAUpLNpMyh5kJbZCE46QkHxfmVSbD 1smN0XGEUNoP/3GK5olPsITf6AvgUQYNSXofsSN93HgaFq+16R5SdPIFQkfVp4Ee53OI TRSQ== X-Gm-Message-State: AOAM533xrfXDHkmtABDrPWJTpGiFLZBUYFTti/LxbTxrho6KsZfPwCGE EzrhtGOCiqMmU1kptLjEtW4= X-Google-Smtp-Source: ABdhPJwFNXHn4mwY39P6cTntGWK+FWXIFRBn4q5ip33uTNTyduIQ1Mxb7QfkzywYFKQfLntR7ZN8zg== X-Received: by 2002:a17:907:2622:: with SMTP id aq2mr40473857ejc.48.1625132799686; Thu, 01 Jul 2021 02:46:39 -0700 (PDT) Received: from pek-vx-bsp2.wrs.com (ec2-44-242-66-180.us-west-2.compute.amazonaws.com. [44.242.66.180]) by smtp.gmail.com with ESMTPSA id d25sm14467479edu.83.2021.07.01.02.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 02:46:39 -0700 (PDT) From: Bin Meng To: Jason Wang , qemu-devel@nongnu.org Subject: [PATCH 3/3] hw/net: e1000e: Don't zero out the VLAN tag in the legacy RX descriptor Date: Thu, 1 Jul 2021 17:46:51 +0800 Message-Id: <20210701094651.1258613-3-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210701094651.1258613-1-bmeng.cn@gmail.com> References: <20210701094651.1258613-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=bmeng.cn@gmail.com; helo=mail-ej1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bin Meng , Christina Wang , Markus Carlstedt Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Christina Wang In the legacy RX descriptor mode, VLAN tag was saved to d->special by e1000e_build_rx_metadata() in e1000e_write_lgcy_rx_descr(), but it was then zeroed out again at the end of the call, which is wrong. Fixes: c89d416a2b0f ("e1000e: Don't zero out buffer address in rx descriptor") Reported-by: Markus Carlstedt Signed-off-by: Christina Wang Signed-off-by: Bin Meng Signed-off-by: Bin Meng --- hw/net/e1000e_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 38b3e3b784..738c7169e4 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1286,7 +1286,6 @@ e1000e_write_lgcy_rx_descr(E1000ECore *core, uint8_t *desc, &d->special); d->errors = (uint8_t) (le32_to_cpu(status_flags) >> 24); d->status = (uint8_t) le32_to_cpu(status_flags); - d->special = 0; } static inline void