From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969726; cv=none; d=zohomail.com; s=zohoarc; b=Gl8RmMyhiuBk7BGx9gvEXxR2PwWT6z+Vpxj9fcj3wNy4QdHVGRXnVivuD2MW/UkHnibAEMjn2cHyWC34b1i2T6uDqhJKZIR8hOAG5br2katWKeRyfEuSjaUXbwE9tdi8WgDBhwFDfoAy98efE5hKjvPby4f1ZLVQnc9+mI1vYds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969726; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=I/pDwl8AWifWnquycf9eti2pt0sVkbePe+g+hr0tUgQ=; b=KxvxyXTlO28csOyzxdqYMZysqk8MS4+s5kbzD5at1KVRxnPHo32Aa1xkIQB4hdkZ27b3fyP9RBuqNLoJMxem+cF/45kiJHSrZWYCZ1J0c2OylWITVhE8EmQWzHrbmeTTGrpyFmz1XA9eox6EYMrDhJORH4uaI8lNmRUUcQF/MOQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969726852405.1677570473769; Wed, 19 Apr 2023 22:48:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9A-0006qW-UO; Thu, 20 Apr 2023 01:47:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN8y-0006ks-6z for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:47:45 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN8w-000126-Gf for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:47:43 -0400 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-24986ade373so491324a91.2 for ; Wed, 19 Apr 2023 22:47:42 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969661; x=1684561661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I/pDwl8AWifWnquycf9eti2pt0sVkbePe+g+hr0tUgQ=; b=tVhd0bCD1hcM3fyRecqrpCpnFYwnLILgBXThtL9sdTfGJghQSEUtIvAE89iTPBqPn1 KrJiCuKXdDUnluJpQftqXteMUS/5mFla1WgfHnLzcUs6rQT8aerW8yaHE7lIwAoUnKfk 3fk5hLRxfTPk0aJLHzloKwaGhpafHbvlLjCREPXIP919ajJybzgwx4MYt2+de9WZn3I0 1QmmN2doHjg1LxTadKD0Fjjza12wb7VYMQwaFHvnWRaSiqpZ/I1plaC/+2Z7YMLhHMg1 JQcK6KWpQ92prbVHcWXJmJTjHGPRVr6aJ2WSAaWpOVJyDK9BVS0GEUXssbptxUI2k8SB 3+ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969661; x=1684561661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I/pDwl8AWifWnquycf9eti2pt0sVkbePe+g+hr0tUgQ=; b=E4+ucdxEwHFVDadFwpl6bclUEMnzzY9fayduJ7rNGiMutPvm4ahEqiWlXWuOJidy0H NSJ8tpfAiG+xL8qD/XnoL2+pS1bYeqHBavYqS96us4zq5gLqUqa02DpcjtcgfpA69NdL cxGTCys1dVwcQAPYXyP14gjopNnO7tWtzCE6V6b5p7wce0ipbUTcV2rswvoAK3A99RWS 738UIZuWJjZwiEDL3CvZWBLZijUx0kv9Xu/MZ2kmxa3kGk05EbZdNQO50YGDHezssQgd TDT8dW+jhGAIvF7QrssYzBKBv/igEwurkl2bbjn7FlAh8zsS+pTyIVGowlDk7mdFodJM SK7A== X-Gm-Message-State: AAQBX9fyfr8/V5MDXag/glIZgxry4LXjPIAZaXrnH3GiGiP0URKQIbro LQP4e7ixo9HQr+oxgV/jSqvA0A== X-Google-Smtp-Source: AKy350bL5Y6aXnuAt1VzlB5ZDyi2FzsTRx0M1+Nt6hHPpiVznH89GuXrotNV+5pEogcLZNQYWhUbMQ== X-Received: by 2002:a17:90a:dd89:b0:247:271:c3f4 with SMTP id l9-20020a17090add8900b002470271c3f4mr620113pjv.2.1681969661194; Wed, 19 Apr 2023 22:47:41 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 01/41] hw/net/net_tx_pkt: Decouple implementation from PCI Date: Thu, 20 Apr 2023 14:46:17 +0900 Message-Id: <20230420054657.50367-2-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::1031; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1031.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969727969100003 Content-Type: text/plain; charset="utf-8" This is intended to be followed by another change for the interface. It also fixes the leak of memory mapping when the specified memory is partially mapped. Fixes: e263cd49c7 ("Packet abstraction for VMWARE network devices") Signed-off-by: Akihiko Odaki --- hw/net/net_tx_pkt.h | 9 ++++++++ hw/net/net_tx_pkt.c | 53 ++++++++++++++++++++++++++++----------------- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/hw/net/net_tx_pkt.h b/hw/net/net_tx_pkt.h index e5ce6f20bc..5eb123ef90 100644 --- a/hw/net/net_tx_pkt.h +++ b/hw/net/net_tx_pkt.h @@ -153,6 +153,15 @@ void net_tx_pkt_dump(struct NetTxPkt *pkt); */ void net_tx_pkt_reset(struct NetTxPkt *pkt, PCIDevice *dev); =20 +/** + * Unmap a fragment mapped from a PCI device. + * + * @context: PCI device owning fragment + * @base: pointer to fragment + * @len: length of fragment + */ +void net_tx_pkt_unmap_frag_pci(void *context, void *base, size_t len); + /** * Send packet to qemu. handles sw offloads if vhdr is not supported. * diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index 8dc8568ba2..aca12ff035 100644 --- a/hw/net/net_tx_pkt.c +++ b/hw/net/net_tx_pkt.c @@ -384,10 +384,9 @@ void net_tx_pkt_setup_vlan_header_ex(struct NetTxPkt *= pkt, } } =20 -bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, hwaddr pa, - size_t len) +static bool net_tx_pkt_add_raw_fragment_common(struct NetTxPkt *pkt, + void *base, size_t len) { - hwaddr mapped_len =3D 0; struct iovec *ventry; assert(pkt); =20 @@ -395,23 +394,12 @@ bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt= , hwaddr pa, return false; } =20 - if (!len) { - return true; - } - ventry =3D &pkt->raw[pkt->raw_frags]; - mapped_len =3D len; + ventry->iov_base =3D base; + ventry->iov_len =3D len; + pkt->raw_frags++; =20 - ventry->iov_base =3D pci_dma_map(pkt->pci_dev, pa, - &mapped_len, DMA_DIRECTION_TO_DEVICE); - - if ((ventry->iov_base !=3D NULL) && (len =3D=3D mapped_len)) { - ventry->iov_len =3D mapped_len; - pkt->raw_frags++; - return true; - } else { - return false; - } + return true; } =20 bool net_tx_pkt_has_fragments(struct NetTxPkt *pkt) @@ -465,8 +453,9 @@ void net_tx_pkt_reset(struct NetTxPkt *pkt, PCIDevice *= pci_dev) assert(pkt->raw); for (i =3D 0; i < pkt->raw_frags; i++) { assert(pkt->raw[i].iov_base); - pci_dma_unmap(pkt->pci_dev, pkt->raw[i].iov_base, - pkt->raw[i].iov_len, DMA_DIRECTION_TO_DEVICE, 0); + net_tx_pkt_unmap_frag_pci(pkt->pci_dev, + pkt->raw[i].iov_base, + pkt->raw[i].iov_len); } } pkt->pci_dev =3D pci_dev; @@ -476,6 +465,30 @@ void net_tx_pkt_reset(struct NetTxPkt *pkt, PCIDevice = *pci_dev) pkt->l4proto =3D 0; } =20 +void net_tx_pkt_unmap_frag_pci(void *context, void *base, size_t len) +{ + pci_dma_unmap(context, base, len, DMA_DIRECTION_TO_DEVICE, 0); +} + +bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, hwaddr pa, + size_t len) +{ + dma_addr_t mapped_len =3D len; + void *base =3D pci_dma_map(pkt->pci_dev, pa, &mapped_len, + DMA_DIRECTION_TO_DEVICE); + if (!base) { + return false; + } + + if (mapped_len !=3D len || + !net_tx_pkt_add_raw_fragment_common(pkt, base, len)) { + net_tx_pkt_unmap_frag_pci(pkt->pci_dev, base, mapped_len); + return false; + } + + return true; +} + static void net_tx_pkt_do_sw_csum(struct NetTxPkt *pkt, struct iovec *iov, uint32_t iov_len, uint16_t csl) --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969784; cv=none; d=zohomail.com; s=zohoarc; b=VUK2gbAbyNXS3kfuuetVHp7h/qwWLpmAPGpmkL8X4K02N/4/EtSVpvn1UNAD9gi0qsyHskxhOFd1nAE8Ylp0fza7Mk1Aumoan4VCPUPCIR0Zm6HQg09zGZii7bcb0Yx7rlE6Ph24gDNHjrKYXAHNUbuHfdY05rN1/ZqUE8EhHeE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969784; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=NkVXvokw9s2PN6VTZ31vcDkykSPQUJKLV8zJ0p5Pe/E=; b=L6I7lRi8ev9P4k9W6DpuGVRV2fbU4lJQS1DCLlxMwUV4Itc7/lunCxn5CdcHkJkE64jFGs5Fchq82EL9Eogkso3Vh7iij0yB2e9nAb3J7Jdr5R9iv6R0RLbAcDxZnJafNSBbHZd/XHzjmu/Ao1kDHD/EaGG/zvyBXdNR1dV4aIQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168196978398652.141895526703934; Wed, 19 Apr 2023 22:49:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN98-0006oC-EB; Thu, 20 Apr 2023 01:47:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN92-0006lG-K9 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:47:48 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN90-00012m-2V for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:47:48 -0400 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-244a5ccf13eso388647a91.2 for ; Wed, 19 Apr 2023 22:47:45 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:47:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969664; x=1684561664; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NkVXvokw9s2PN6VTZ31vcDkykSPQUJKLV8zJ0p5Pe/E=; b=ErDm0LWqPVM95qwnx0llrGP+sNONS3bMB3v0DWEQ6Nu2tkogxrVYuiE8FQQcXUVasu Hmld1hg8dKbevvmDrPf5ozjaCaNYGmbE3yaLLrawEFESIf7aA/STE0b4eN1NUXZPP8Ep f0nmTJS07HVR1DXk4Wx7GpDUrPZIr20+bfnpbn/j35KBHsFvFWe9KfN19pnIvHMzATUe U3ZxPXHLXN7t8Lt0qExf4voHyORPkJatq15VgByQqwE/0LnCd7OpTcqPTsVE9DE8+SQ9 9Qxa/PmE/HJ0DW59h4BygaDvSVOZFKirH5MjXbl13Y08IitveRq3o7+NSOjrpvm0gSFN cNWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969664; x=1684561664; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NkVXvokw9s2PN6VTZ31vcDkykSPQUJKLV8zJ0p5Pe/E=; b=ZfqVVfsJz4NTHUY8iw++lELNk3tHEbsiZyRsZE6ZyiyaDN78znHs+Towx7IZZSh02B nzUFfMnrzPSbw+eRIOqdQt/I5BBGpcRVPBRJMkscLHScBJXvzn4+Tl0DYS8BdR8T2Ts2 56SzM3VLH/hZitapNoHT6vj4g79ms+Fhkd7bOR+y49bzBahMlESgapj2Su1lozFRuOwy yalX30s94j7jqFah8N9jX790/Z6gvzkwjYf8o/DeDbgFGr5PDGdELlLONkPVr0wHDWLx DBX8mTXCk5xGqFLvqElJv/GshspemEMKz8j4Ud17D8TwTBVNZvseqC0FHpHPxNv8ebsu 3jHw== X-Gm-Message-State: AAQBX9ei9TWCw/PW1iYxaVpG3d7lURj5x9wBeH3RnkWtfdJGy7OqSsdv V/XBbVXoXjE69z+VF+PODqqMTQ== X-Google-Smtp-Source: AKy350Z/f/UYdIk9hYe49BLXY54J1FnTXPHTKb4IQu5sz6lqkN7RO08oKxzkX8SAqd6UYgAXKRC+TQ== X-Received: by 2002:a17:90b:1c0b:b0:246:8193:1fdc with SMTP id oc11-20020a17090b1c0b00b0024681931fdcmr650219pjb.3.1681969664580; Wed, 19 Apr 2023 22:47:44 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 02/41] hw/net/net_tx_pkt: Decouple interface from PCI Date: Thu, 20 Apr 2023 14:46:18 +0900 Message-Id: <20230420054657.50367-3-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::102e; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969786315100003 Content-Type: text/plain; charset="utf-8" This allows to use the network packet abstractions even if PCI is not used. Signed-off-by: Akihiko Odaki --- hw/net/net_tx_pkt.h | 31 ++++++++++++++++++++----------- hw/net/e1000e_core.c | 13 ++++++++----- hw/net/igb_core.c | 13 ++++++------- hw/net/net_tx_pkt.c | 36 +++++++++++++----------------------- hw/net/vmxnet3.c | 14 +++++++------- 5 files changed, 54 insertions(+), 53 deletions(-) diff --git a/hw/net/net_tx_pkt.h b/hw/net/net_tx_pkt.h index 5eb123ef90..f5cd44da6f 100644 --- a/hw/net/net_tx_pkt.h +++ b/hw/net/net_tx_pkt.h @@ -26,17 +26,16 @@ =20 struct NetTxPkt; =20 -typedef void (* NetTxPktCallback)(void *, const struct iovec *, int, const= struct iovec *, int); +typedef void (*NetTxPktFreeFrag)(void *, void *, size_t); +typedef void (*NetTxPktSend)(void *, const struct iovec *, int, const stru= ct iovec *, int); =20 /** * Init function for tx packet functionality * * @pkt: packet pointer - * @pci_dev: PCI device processing this packet * @max_frags: max tx ip fragments */ -void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice *pci_dev, - uint32_t max_frags); +void net_tx_pkt_init(struct NetTxPkt **pkt, uint32_t max_frags); =20 /** * Clean all tx packet resources. @@ -95,12 +94,11 @@ net_tx_pkt_setup_vlan_header(struct NetTxPkt *pkt, uint= 16_t vlan) * populate data fragment into pkt context. * * @pkt: packet - * @pa: physical address of fragment + * @pa: pointer to fragment * @len: length of fragment * */ -bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, hwaddr pa, - size_t len); +bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, void *base, size_t = len); =20 /** * Fix ip header fields and calculate IP header and pseudo header checksum= s. @@ -148,10 +146,11 @@ void net_tx_pkt_dump(struct NetTxPkt *pkt); * reset tx packet private context (needed to be called between packets) * * @pkt: packet - * @dev: PCI device processing the next packet - * + * @callback: function to free the fragments + * @context: pointer to be passed to the callback */ -void net_tx_pkt_reset(struct NetTxPkt *pkt, PCIDevice *dev); +void net_tx_pkt_reset(struct NetTxPkt *pkt, + NetTxPktFreeFrag callback, void *context); =20 /** * Unmap a fragment mapped from a PCI device. @@ -162,6 +161,16 @@ void net_tx_pkt_reset(struct NetTxPkt *pkt, PCIDevice = *dev); */ void net_tx_pkt_unmap_frag_pci(void *context, void *base, size_t len); =20 +/** + * map data fragment from PCI device and populate it into pkt context. + * + * @pci_dev: PCI device owning fragment + * @pa: physical address of fragment + * @len: length of fragment + */ +bool net_tx_pkt_add_raw_fragment_pci(struct NetTxPkt *pkt, PCIDevice *pci_= dev, + dma_addr_t pa, size_t len); + /** * Send packet to qemu. handles sw offloads if vhdr is not supported. * @@ -182,7 +191,7 @@ bool net_tx_pkt_send(struct NetTxPkt *pkt, NetClientSta= te *nc); * @ret: operation result */ bool net_tx_pkt_send_custom(struct NetTxPkt *pkt, bool offload, - NetTxPktCallback callback, void *context); + NetTxPktSend callback, void *context); =20 /** * parse raw packet data and analyze offload requirements. diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index cfa3f55e96..15821a75e0 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -746,7 +746,8 @@ e1000e_process_tx_desc(E1000ECore *core, addr =3D le64_to_cpu(dp->buffer_addr); =20 if (!tx->skip_cp) { - if (!net_tx_pkt_add_raw_fragment(tx->tx_pkt, addr, split_size)) { + if (!net_tx_pkt_add_raw_fragment_pci(tx->tx_pkt, core->owner, + addr, split_size)) { tx->skip_cp =3D true; } } @@ -764,7 +765,7 @@ e1000e_process_tx_desc(E1000ECore *core, } =20 tx->skip_cp =3D false; - net_tx_pkt_reset(tx->tx_pkt, core->owner); + net_tx_pkt_reset(tx->tx_pkt, net_tx_pkt_unmap_frag_pci, core->owne= r); =20 tx->sum_needed =3D 0; tx->cptse =3D 0; @@ -3421,7 +3422,7 @@ e1000e_core_pci_realize(E1000ECore *core, qemu_add_vm_change_state_handler(e1000e_vm_state_change, core); =20 for (i =3D 0; i < E1000E_NUM_QUEUES; i++) { - net_tx_pkt_init(&core->tx[i].tx_pkt, core->owner, E1000E_MAX_TX_FR= AGS); + net_tx_pkt_init(&core->tx[i].tx_pkt, E1000E_MAX_TX_FRAGS); } =20 net_rx_pkt_init(&core->rx_pkt); @@ -3446,7 +3447,8 @@ e1000e_core_pci_uninit(E1000ECore *core) qemu_del_vm_change_state_handler(core->vmstate); =20 for (i =3D 0; i < E1000E_NUM_QUEUES; i++) { - net_tx_pkt_reset(core->tx[i].tx_pkt, core->owner); + net_tx_pkt_reset(core->tx[i].tx_pkt, + net_tx_pkt_unmap_frag_pci, core->owner); net_tx_pkt_uninit(core->tx[i].tx_pkt); } =20 @@ -3571,7 +3573,8 @@ static void e1000e_reset(E1000ECore *core, bool sw) e1000x_reset_mac_addr(core->owner_nic, core->mac, core->permanent_mac); =20 for (i =3D 0; i < ARRAY_SIZE(core->tx); i++) { - net_tx_pkt_reset(core->tx[i].tx_pkt, core->owner); + net_tx_pkt_reset(core->tx[i].tx_pkt, + net_tx_pkt_unmap_frag_pci, core->owner); memset(&core->tx[i].props, 0, sizeof(core->tx[i].props)); core->tx[i].skip_cp =3D false; } diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 826e7a6cf1..abfdce9aaf 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -597,7 +597,8 @@ igb_process_tx_desc(IGBCore *core, length =3D cmd_type_len & 0xFFFF; =20 if (!tx->skip_cp) { - if (!net_tx_pkt_add_raw_fragment(tx->tx_pkt, buffer_addr, length))= { + if (!net_tx_pkt_add_raw_fragment_pci(tx->tx_pkt, dev, + buffer_addr, length)) { tx->skip_cp =3D true; } } @@ -616,7 +617,7 @@ igb_process_tx_desc(IGBCore *core, =20 tx->first =3D true; tx->skip_cp =3D false; - net_tx_pkt_reset(tx->tx_pkt, dev); + net_tx_pkt_reset(tx->tx_pkt, net_tx_pkt_unmap_frag_pci, dev); } } =20 @@ -842,8 +843,6 @@ igb_start_xmit(IGBCore *core, const IGB_TxRing *txr) d =3D core->owner; } =20 - net_tx_pkt_reset(txr->tx->tx_pkt, d); - while (!igb_ring_empty(core, txi)) { base =3D igb_ring_head_descr(core, txi); =20 @@ -861,6 +860,8 @@ igb_start_xmit(IGBCore *core, const IGB_TxRing *txr) core->mac[EICR] |=3D eic; igb_set_interrupt_cause(core, E1000_ICR_TXDW); } + + net_tx_pkt_reset(txr->tx->tx_pkt, net_tx_pkt_unmap_frag_pci, d); } =20 static uint32_t @@ -3954,7 +3955,7 @@ igb_core_pci_realize(IGBCore *core, core->vmstate =3D qemu_add_vm_change_state_handler(igb_vm_state_change= , core); =20 for (i =3D 0; i < IGB_NUM_QUEUES; i++) { - net_tx_pkt_init(&core->tx[i].tx_pkt, NULL, E1000E_MAX_TX_FRAGS); + net_tx_pkt_init(&core->tx[i].tx_pkt, E1000E_MAX_TX_FRAGS); } =20 net_rx_pkt_init(&core->rx_pkt); @@ -3979,7 +3980,6 @@ igb_core_pci_uninit(IGBCore *core) qemu_del_vm_change_state_handler(core->vmstate); =20 for (i =3D 0; i < IGB_NUM_QUEUES; i++) { - net_tx_pkt_reset(core->tx[i].tx_pkt, NULL); net_tx_pkt_uninit(core->tx[i].tx_pkt); } =20 @@ -4158,7 +4158,6 @@ static void igb_reset(IGBCore *core, bool sw) =20 for (i =3D 0; i < ARRAY_SIZE(core->tx); i++) { tx =3D &core->tx[i]; - net_tx_pkt_reset(tx->tx_pkt, NULL); memset(tx->ctx, 0, sizeof(tx->ctx)); tx->first =3D true; tx->skip_cp =3D false; diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index aca12ff035..cc36750c9b 100644 --- a/hw/net/net_tx_pkt.c +++ b/hw/net/net_tx_pkt.c @@ -16,12 +16,12 @@ */ =20 #include "qemu/osdep.h" -#include "net_tx_pkt.h" #include "net/eth.h" #include "net/checksum.h" #include "net/tap.h" #include "net/net.h" #include "hw/pci/pci_device.h" +#include "net_tx_pkt.h" =20 enum { NET_TX_PKT_VHDR_FRAG =3D 0, @@ -32,8 +32,6 @@ enum { =20 /* TX packet private context */ struct NetTxPkt { - PCIDevice *pci_dev; - struct virtio_net_hdr virt_hdr; =20 struct iovec *raw; @@ -59,13 +57,10 @@ struct NetTxPkt { uint8_t l4proto; }; =20 -void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice *pci_dev, - uint32_t max_frags) +void net_tx_pkt_init(struct NetTxPkt **pkt, uint32_t max_frags) { struct NetTxPkt *p =3D g_malloc0(sizeof *p); =20 - p->pci_dev =3D pci_dev; - p->vec =3D g_new(struct iovec, max_frags + NET_TX_PKT_PL_START_FRAG); =20 p->raw =3D g_new(struct iovec, max_frags); @@ -384,8 +379,7 @@ void net_tx_pkt_setup_vlan_header_ex(struct NetTxPkt *p= kt, } } =20 -static bool net_tx_pkt_add_raw_fragment_common(struct NetTxPkt *pkt, - void *base, size_t len) +bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, void *base, size_t = len) { struct iovec *ventry; assert(pkt); @@ -433,7 +427,8 @@ void net_tx_pkt_dump(struct NetTxPkt *pkt) #endif } =20 -void net_tx_pkt_reset(struct NetTxPkt *pkt, PCIDevice *pci_dev) +void net_tx_pkt_reset(struct NetTxPkt *pkt, + NetTxPktFreeFrag callback, void *context) { int i; =20 @@ -453,12 +448,9 @@ void net_tx_pkt_reset(struct NetTxPkt *pkt, PCIDevice = *pci_dev) assert(pkt->raw); for (i =3D 0; i < pkt->raw_frags; i++) { assert(pkt->raw[i].iov_base); - net_tx_pkt_unmap_frag_pci(pkt->pci_dev, - pkt->raw[i].iov_base, - pkt->raw[i].iov_len); + callback(context, pkt->raw[i].iov_base, pkt->raw[i].iov_len); } } - pkt->pci_dev =3D pci_dev; pkt->raw_frags =3D 0; =20 pkt->hdr_len =3D 0; @@ -470,19 +462,17 @@ void net_tx_pkt_unmap_frag_pci(void *context, void *b= ase, size_t len) pci_dma_unmap(context, base, len, DMA_DIRECTION_TO_DEVICE, 0); } =20 -bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, hwaddr pa, - size_t len) +bool net_tx_pkt_add_raw_fragment_pci(struct NetTxPkt *pkt, PCIDevice *pci_= dev, + dma_addr_t pa, size_t len) { dma_addr_t mapped_len =3D len; - void *base =3D pci_dma_map(pkt->pci_dev, pa, &mapped_len, - DMA_DIRECTION_TO_DEVICE); + void *base =3D pci_dma_map(pci_dev, pa, &mapped_len, DMA_DIRECTION_TO_= DEVICE); if (!base) { return false; } =20 - if (mapped_len !=3D len || - !net_tx_pkt_add_raw_fragment_common(pkt, base, len)) { - net_tx_pkt_unmap_frag_pci(pkt->pci_dev, base, mapped_len); + if (mapped_len !=3D len || !net_tx_pkt_add_raw_fragment(pkt, base, len= )) { + net_tx_pkt_unmap_frag_pci(pci_dev, base, mapped_len); return false; } =20 @@ -710,7 +700,7 @@ static void net_tx_pkt_udp_fragment_fix(struct NetTxPkt= *pkt, } =20 static bool net_tx_pkt_do_sw_fragmentation(struct NetTxPkt *pkt, - NetTxPktCallback callback, + NetTxPktSend callback, void *context) { uint8_t gso_type =3D pkt->virt_hdr.gso_type & ~VIRTIO_NET_HDR_GSO_ECN; @@ -807,7 +797,7 @@ bool net_tx_pkt_send(struct NetTxPkt *pkt, NetClientSta= te *nc) } =20 bool net_tx_pkt_send_custom(struct NetTxPkt *pkt, bool offload, - NetTxPktCallback callback, void *context) + NetTxPktSend callback, void *context) { assert(pkt); =20 diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index f7b874c139..9acff310e7 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -651,9 +651,8 @@ static void vmxnet3_process_tx_queue(VMXNET3State *s, i= nt qidx) data_len =3D (txd.len > 0) ? txd.len : VMXNET3_MAX_TX_BUF_SIZE; data_pa =3D txd.addr; =20 - if (!net_tx_pkt_add_raw_fragment(s->tx_pkt, - data_pa, - data_len)) { + if (!net_tx_pkt_add_raw_fragment_pci(s->tx_pkt, PCI_DEVICE(s), + data_pa, data_len)) { s->skip_current_tx_pkt =3D true; } } @@ -678,7 +677,8 @@ static void vmxnet3_process_tx_queue(VMXNET3State *s, i= nt qidx) vmxnet3_complete_packet(s, qidx, txd_idx); s->tx_sop =3D true; s->skip_current_tx_pkt =3D false; - net_tx_pkt_reset(s->tx_pkt, PCI_DEVICE(s)); + net_tx_pkt_reset(s->tx_pkt, + net_tx_pkt_unmap_frag_pci, PCI_DEVICE(s)); } } } @@ -1159,7 +1159,7 @@ static void vmxnet3_deactivate_device(VMXNET3State *s) { if (s->device_active) { VMW_CBPRN("Deactivating vmxnet3..."); - net_tx_pkt_reset(s->tx_pkt, PCI_DEVICE(s)); + net_tx_pkt_reset(s->tx_pkt, net_tx_pkt_unmap_frag_pci, PCI_DEVICE(= s)); net_tx_pkt_uninit(s->tx_pkt); net_rx_pkt_uninit(s->rx_pkt); s->device_active =3D false; @@ -1519,7 +1519,7 @@ static void vmxnet3_activate_device(VMXNET3State *s) =20 /* Preallocate TX packet wrapper */ VMW_CFPRN("Max TX fragments is %u", s->max_tx_frags); - net_tx_pkt_init(&s->tx_pkt, PCI_DEVICE(s), s->max_tx_frags); + net_tx_pkt_init(&s->tx_pkt, s->max_tx_frags); net_rx_pkt_init(&s->rx_pkt); =20 /* Read rings memory locations for RX queues */ @@ -2399,7 +2399,7 @@ static int vmxnet3_post_load(void *opaque, int versio= n_id) { VMXNET3State *s =3D opaque; =20 - net_tx_pkt_init(&s->tx_pkt, PCI_DEVICE(s), s->max_tx_frags); + net_tx_pkt_init(&s->tx_pkt, s->max_tx_frags); net_rx_pkt_init(&s->rx_pkt); =20 if (s->msix_used) { --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969726; cv=none; d=zohomail.com; s=zohoarc; b=ZvMSjjgSpSZj2mM0LrYOLtsvBHvUTlvw4GA0cygFli5MGq6viK3z4qr6BAak9A/4Rzji+Smrk27Zgp2GB0AygxZgAWiSE5YIh+vUZHQKGiNhs2hqbUb0vtYJqAKK6vCz/rXlIn3o1LB0gD77pA7d7ZyT2e2eM8NwFSeqjdfBlc0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969726; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=olsD2xgUqYp8y9KV8yKVW3jfVHpAdqd+kCAwZWJ1hCE=; b=mAW3QA6soWlzYVj6InnTzQmfe/UoIZLDbMnKZAECm4a2X6VddggiHMKw6KH3db+vAwXRB+eRneitKxxPoQMpkq8K90kdCMbTQbX9uJSbwvlXdlJZ+DiNLvYZajwxgGgeoaSNBPr+5mCXKR5C91sPU1NYCzie9bl2TLLqqfcUTWY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969726858964.9160216020283; Wed, 19 Apr 2023 22:48:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN98-0006oo-RM; Thu, 20 Apr 2023 01:47:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN94-0006nU-W5 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:47:51 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN93-00013Q-6r for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:47:50 -0400 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-51efefe7814so594942a12.3 for ; Wed, 19 Apr 2023 22:47:48 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969668; x=1684561668; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=olsD2xgUqYp8y9KV8yKVW3jfVHpAdqd+kCAwZWJ1hCE=; b=DDUnNdpSqD+W3P0Jm9SHxBSavOLTWshMioOiLewqX1GNN9vrLynCwAUl1SA8KbEb7w 97ylK0j0XbP+/IiiBodw8OfK/WDyW+rPwoHv5gyAQkW7lCrpldv09rve66wwe9zweldL J26TvDBvYyg0d3FTCZF1gpEndEHfkQyQs+SgKgbCBecvNu+wWzU0zA/zPTBWr0PBKhDr b8D3vOblJsg4sDTMkm3yGWSYT74KnQpiXQHBPgVNE0IK738V9rvr8fEEm+lHxRRIaCEO zYNpGdz8xRvIQCIPEq0q5+Tfr3JFdqjyVUpZp5k1ORG534XXf98q7GD1cqow6TacpsNJ I7Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969668; x=1684561668; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=olsD2xgUqYp8y9KV8yKVW3jfVHpAdqd+kCAwZWJ1hCE=; b=V2uiwilT50SqF/mtMVRIcm2pUv7gQYT92bfQumrcnMaK2zJDufyFRkchTYeLMCVN4y BpmXH0S4YHCf+M+Sco1G/vWFbnhz5ujTUy9D3emDENwG+PPPX5VByMqsEtm9r59TPTq9 5Acb5/LtREo6xgYLmyx/Os1PN7pCgi0RahPPnIQv6FtYyfgIYWFGxrIN45YboR0CezW1 zNryDZ9yRYpPl8uh6BxkHiq41PkvHYfVcld4xxuUghRJtEjBH3CGfgx8tCUnZiIwRsLz fa7+w1cVYalg+7qjW62YRayf9zQ9xl+56x1Bm9YbdX0T0XpkLO8N7DnvBFTcAOkm9hyk A1Xg== X-Gm-Message-State: AAQBX9e4ZR+1eIVb42gpXyx2lBQCdv8RugwXd2Xa0uz6izReR2guR7II YzQra7++HJX+oSbuCE0InegDBQ== X-Google-Smtp-Source: AKy350bKur9j2ZHdN8w1Ak8P7NrPG999UGYW43fFT5ITByfJJ7q3i8ZxjuzbIjqYKhQAAXShF/7JyA== X-Received: by 2002:a17:90b:3d8:b0:249:87f0:604b with SMTP id go24-20020a17090b03d800b0024987f0604bmr532307pjb.30.1681969667978; Wed, 19 Apr 2023 22:47:47 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 03/41] e1000x: Fix BPRC and MPRC Date: Thu, 20 Apr 2023 14:46:19 +0900 Message-Id: <20230420054657.50367-4-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::52e; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969727985100004 Content-Type: text/plain; charset="utf-8" Before this change, e1000 and the common code updated BPRC and MPRC depending on the matched filter, but e1000e and igb decided to update those counters by deriving the packet type independently. This inconsistency caused a multicast packet to be counted twice. Updating BPRC and MPRC depending on are fundamentally flawed anyway as a filter can be used for different types of packets. For example, it is possible to filter broadcast packets with MTA. Always determine what counters to update by inspecting the packets. Fixes: 3b27430177 ("e1000: Implementing various counters") Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- hw/net/e1000x_common.h | 5 +++-- hw/net/e1000.c | 6 +++--- hw/net/e1000e_core.c | 20 +++----------------- hw/net/e1000x_common.c | 25 +++++++++++++++++++------ hw/net/igb_core.c | 22 +++++----------------- 5 files changed, 33 insertions(+), 45 deletions(-) diff --git a/hw/net/e1000x_common.h b/hw/net/e1000x_common.h index 911abd8a90..0298e06283 100644 --- a/hw/net/e1000x_common.h +++ b/hw/net/e1000x_common.h @@ -91,8 +91,9 @@ e1000x_update_regs_on_link_up(uint32_t *mac, uint16_t *ph= y) } =20 void e1000x_update_rx_total_stats(uint32_t *mac, - size_t data_size, - size_t data_fcs_size); + eth_pkt_types_e pkt_type, + size_t pkt_size, + size_t pkt_fcs_size); =20 void e1000x_core_prepare_eeprom(uint16_t *eeprom, const uint16_t *templ, diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 59bacb5d3b..18eb6d8876 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -826,12 +826,10 @@ receive_filter(E1000State *s, const uint8_t *buf, int= size) } =20 if (ismcast && (rctl & E1000_RCTL_MPE)) { /* promiscuous mcas= t */ - e1000x_inc_reg_if_not_full(s->mac_reg, MPRC); return 1; } =20 if (isbcast && (rctl & E1000_RCTL_BAM)) { /* broadcast enable= d */ - e1000x_inc_reg_if_not_full(s->mac_reg, BPRC); return 1; } =20 @@ -922,6 +920,7 @@ e1000_receive_iov(NetClientState *nc, const struct iove= c *iov, int iovcnt) size_t desc_offset; size_t desc_size; size_t total_size; + eth_pkt_types_e pkt_type; =20 if (!e1000x_hw_rx_enabled(s->mac_reg)) { return -1; @@ -971,6 +970,7 @@ e1000_receive_iov(NetClientState *nc, const struct iove= c *iov, int iovcnt) size -=3D 4; } =20 + pkt_type =3D get_eth_packet_type(PKT_GET_ETH_HDR(filter_buf)); rdh_start =3D s->mac_reg[RDH]; desc_offset =3D 0; total_size =3D size + e1000x_fcs_len(s->mac_reg); @@ -1036,7 +1036,7 @@ e1000_receive_iov(NetClientState *nc, const struct io= vec *iov, int iovcnt) } } while (desc_offset < total_size); =20 - e1000x_update_rx_total_stats(s->mac_reg, size, total_size); + e1000x_update_rx_total_stats(s->mac_reg, pkt_type, size, total_size); =20 n =3D E1000_ICS_RXT0; if ((rdt =3D s->mac_reg[RDT]) < s->mac_reg[RDH]) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 15821a75e0..c2d864a504 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1488,24 +1488,10 @@ e1000e_write_to_rx_buffers(E1000ECore *core, } =20 static void -e1000e_update_rx_stats(E1000ECore *core, - size_t data_size, - size_t data_fcs_size) +e1000e_update_rx_stats(E1000ECore *core, size_t pkt_size, size_t pkt_fcs_s= ize) { - e1000x_update_rx_total_stats(core->mac, data_size, data_fcs_size); - - switch (net_rx_pkt_get_packet_type(core->rx_pkt)) { - case ETH_PKT_BCAST: - e1000x_inc_reg_if_not_full(core->mac, BPRC); - break; - - case ETH_PKT_MCAST: - e1000x_inc_reg_if_not_full(core->mac, MPRC); - break; - - default: - break; - } + eth_pkt_types_e pkt_type =3D net_rx_pkt_get_packet_type(core->rx_pkt); + e1000x_update_rx_total_stats(core->mac, pkt_type, pkt_size, pkt_fcs_si= ze); } =20 static inline bool diff --git a/hw/net/e1000x_common.c b/hw/net/e1000x_common.c index 4c8e7dcf70..7694673bcc 100644 --- a/hw/net/e1000x_common.c +++ b/hw/net/e1000x_common.c @@ -80,7 +80,6 @@ bool e1000x_rx_group_filter(uint32_t *mac, const uint8_t = *buf) f =3D mta_shift[(rctl >> E1000_RCTL_MO_SHIFT) & 3]; f =3D (((buf[5] << 8) | buf[4]) >> f) & 0xfff; if (mac[MTA + (f >> 5)] & (1 << (f & 0x1f))) { - e1000x_inc_reg_if_not_full(mac, MPRC); return true; } =20 @@ -212,13 +211,14 @@ e1000x_rxbufsize(uint32_t rctl) =20 void e1000x_update_rx_total_stats(uint32_t *mac, - size_t data_size, - size_t data_fcs_size) + eth_pkt_types_e pkt_type, + size_t pkt_size, + size_t pkt_fcs_size) { static const int PRCregs[6] =3D { PRC64, PRC127, PRC255, PRC511, PRC1023, PRC1522 }; =20 - e1000x_increase_size_stats(mac, PRCregs, data_fcs_size); + e1000x_increase_size_stats(mac, PRCregs, pkt_fcs_size); e1000x_inc_reg_if_not_full(mac, TPR); e1000x_inc_reg_if_not_full(mac, GPRC); /* TOR - Total Octets Received: @@ -226,8 +226,21 @@ e1000x_update_rx_total_stats(uint32_t *mac, * Address> field through the field, inclusively. * Always include FCS length (4) in size. */ - e1000x_grow_8reg_if_not_full(mac, TORL, data_size + 4); - e1000x_grow_8reg_if_not_full(mac, GORCL, data_size + 4); + e1000x_grow_8reg_if_not_full(mac, TORL, pkt_size + 4); + e1000x_grow_8reg_if_not_full(mac, GORCL, pkt_size + 4); + + switch (pkt_type) { + case ETH_PKT_BCAST: + e1000x_inc_reg_if_not_full(mac, BPRC); + break; + + case ETH_PKT_MCAST: + e1000x_inc_reg_if_not_full(mac, MPRC); + break; + + default: + break; + } } =20 void diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index abfdce9aaf..464a41d0aa 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1438,29 +1438,17 @@ igb_write_to_rx_buffers(IGBCore *core, =20 static void igb_update_rx_stats(IGBCore *core, const E1000E_RingInfo *rxi, - size_t data_size, size_t data_fcs_size) + size_t pkt_size, size_t pkt_fcs_size) { - e1000x_update_rx_total_stats(core->mac, data_size, data_fcs_size); - - switch (net_rx_pkt_get_packet_type(core->rx_pkt)) { - case ETH_PKT_BCAST: - e1000x_inc_reg_if_not_full(core->mac, BPRC); - break; - - case ETH_PKT_MCAST: - e1000x_inc_reg_if_not_full(core->mac, MPRC); - break; - - default: - break; - } + eth_pkt_types_e pkt_type =3D net_rx_pkt_get_packet_type(core->rx_pkt); + e1000x_update_rx_total_stats(core->mac, pkt_type, pkt_size, pkt_fcs_si= ze); =20 if (core->mac[MRQC] & 1) { uint16_t pool =3D rxi->idx % IGB_NUM_VM_POOLS; =20 - core->mac[PVFGORC0 + (pool * 64)] +=3D data_size + 4; + core->mac[PVFGORC0 + (pool * 64)] +=3D pkt_size + 4; core->mac[PVFGPRC0 + (pool * 64)]++; - if (net_rx_pkt_get_packet_type(core->rx_pkt) =3D=3D ETH_PKT_MCAST)= { + if (pkt_type =3D=3D ETH_PKT_MCAST) { core->mac[PVFMPRC0 + (pool * 64)]++; } } --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969756; cv=none; d=zohomail.com; s=zohoarc; b=Q+ZehNeTGQM03R7/9cWf9Dz2z6RoPW3r/ScWy4GHk5IHby6TAhXCHP0LXnuCSbXV8iYMYo7YegLUkuf2Y86Tgck6hlxULcXzKPT9zUNyTDzk6aqXR9VfqzQwK4BrmGgXZ8yJOz0YB/ArpSOygBTrcF6F3KOFAbMM6UPE3PhdtUU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969756; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=GGE1R6BlYkxGLSK1V/FXomiUUYv2xdpJPXzF3eewYKc=; b=gDEJTMKeA7cKeMu8n6A8fgop601tlaO28AKZgB0lsnBeo+tJU2l/zWJ7IqvuhjWli8dT8gYVcYgZ6hMgMeCBsQlwFJ3tlgsMEoi0qLxDpbLZefMTRWVeiMq0Jey9666T7rNLFKnxe7pfBYv4KeA/p//DoDbe5CdAJHu/jUDNRYQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969756899731.0241166168435; Wed, 19 Apr 2023 22:49:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9E-0006ry-Kg; Thu, 20 Apr 2023 01:48:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN98-0006oa-Hg for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:47:54 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN96-00014L-L6 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:47:53 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-51f3289d306so440310a12.3 for ; Wed, 19 Apr 2023 22:47:52 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969671; x=1684561671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GGE1R6BlYkxGLSK1V/FXomiUUYv2xdpJPXzF3eewYKc=; b=sef+0shTbhRJYtK5wWj6JVrD8AvVZYI8QfxRhkLuZNKcn4aGH4aK/VHkmlDLbpodD/ SNCqDBdbSDAZzpgcFRLIY2ZArs4wyGzUwuihU+/g2em2B+yV4srZbB0LelqyVWe1NQB4 2bbbt9nRfGlAiIQJQ1a2cOQHmv8ZJIMohXDW3h96fRe+sByebP3nPIyzLvdOyT1b3y9c J9+ZoM0oSYxrT3RHMTMs1cEehxh4laPPMOJvSCyrDlQjPSkmR0SzgHFJ+re4PGMvEJun wrI+E17jCnR/iodSMO7OJ5IEVmlo6oXLUMTsiWqITmFP4xauluqZxBHj/5peewEWr+Kc KcCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969671; x=1684561671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GGE1R6BlYkxGLSK1V/FXomiUUYv2xdpJPXzF3eewYKc=; b=EbWkTuUWC+xmJmAb6QM00vTYETDPmmeVwjez0cpIRPGBenlrDx5a608/NEm5KlgPOl QH6S25SmtDIxYGNAWml9hOElJt8O2OoZKiaf9eSxUgyEd8+5kpYB8B65ip24mQ6S75Eh Q16TxTj6VJfPtzaVMkqOAan5rxAXkt8Dg+5hjJJGmbuTe608lBHYZERcDETQVehHGw05 5/YouxuJAZk5C6JcTc8tT2KBQCrBq++fPqWWdMa5IsaVC/5LgSk0G3Y+Qm18vKSJj0mV 2bmyXdCZzq8C+86FGJm+U6t3hgX7L9VTk/3I8eFDNDw9X6eS6lqhrmCTkFXmS2EA+8yd r1zQ== X-Gm-Message-State: AAQBX9dNNCQGBLXlj/LgGv/Nk9YCuatbo1BlcLAl5Z3XNCDaiVH310rX wa+hp7ufkawcVrKHUc1Cyv/2Ug== X-Google-Smtp-Source: AKy350bZPXhAM0FVrHI7iT933nCsxTmkPmfDrXDHkU3L3hUIRLV+IQHaANCvtU1HFSJQtDKQocH2GQ== X-Received: by 2002:a17:90b:120c:b0:23f:ebf2:d3e9 with SMTP id gl12-20020a17090b120c00b0023febf2d3e9mr562817pjb.6.1681969671473; Wed, 19 Apr 2023 22:47:51 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 04/41] igb: Fix Rx packet type encoding Date: Thu, 20 Apr 2023 14:46:20 +0900 Message-Id: <20230420054657.50367-5-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::52c; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969757516100009 Content-Type: text/plain; charset="utf-8" igb's advanced descriptor uses a packet type encoding different from one used in e1000e's extended descriptor. Fix the logic to encode Rx packet type accordingly. Fixes: 3a977deebe ("Intrdocue igb device emulation") Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- hw/net/igb_regs.h | 5 +++++ hw/net/igb_core.c | 38 +++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/hw/net/igb_regs.h b/hw/net/igb_regs.h index c5c5b3c3b8..21ee9a3b2d 100644 --- a/hw/net/igb_regs.h +++ b/hw/net/igb_regs.h @@ -641,6 +641,11 @@ union e1000_adv_rx_desc { =20 #define E1000_STATUS_NUM_VFS_SHIFT 14 =20 +#define E1000_ADVRXD_PKT_IP4 BIT(4) +#define E1000_ADVRXD_PKT_IP6 BIT(6) +#define E1000_ADVRXD_PKT_TCP BIT(8) +#define E1000_ADVRXD_PKT_UDP BIT(9) + static inline uint8_t igb_ivar_entry_rx(uint8_t i) { return i < 8 ? i * 4 : (i - 8) * 4 + 2; diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 464a41d0aa..dbd1192a8e 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1227,7 +1227,6 @@ igb_build_rx_metadata(IGBCore *core, struct virtio_net_hdr *vhdr; bool hasip4, hasip6; EthL4HdrProto l4hdr_proto; - uint32_t pkt_type; =20 *status_flags =3D E1000_RXD_STAT_DD; =20 @@ -1266,28 +1265,29 @@ igb_build_rx_metadata(IGBCore *core, trace_e1000e_rx_metadata_ack(); } =20 - if (hasip6 && (core->mac[RFCTL] & E1000_RFCTL_IPV6_DIS)) { - trace_e1000e_rx_metadata_ipv6_filtering_disabled(); - pkt_type =3D E1000_RXD_PKT_MAC; - } else if (l4hdr_proto =3D=3D ETH_L4_HDR_PROTO_TCP || - l4hdr_proto =3D=3D ETH_L4_HDR_PROTO_UDP) { - pkt_type =3D hasip4 ? E1000_RXD_PKT_IP4_XDP : E1000_RXD_PKT_IP6_XD= P; - } else if (hasip4 || hasip6) { - pkt_type =3D hasip4 ? E1000_RXD_PKT_IP4 : E1000_RXD_PKT_IP6; - } else { - pkt_type =3D E1000_RXD_PKT_MAC; - } + if (pkt_info) { + *pkt_info =3D rss_info->enabled ? rss_info->type : 0; =20 - trace_e1000e_rx_metadata_pkt_type(pkt_type); + if (hasip4) { + *pkt_info |=3D E1000_ADVRXD_PKT_IP4; + } =20 - if (pkt_info) { - if (rss_info->enabled) { - *pkt_info =3D rss_info->type; + if (hasip6) { + *pkt_info |=3D E1000_ADVRXD_PKT_IP6; } =20 - *pkt_info |=3D (pkt_type << 4); - } else { - *status_flags |=3D E1000_RXD_PKT_TYPE(pkt_type); + switch (l4hdr_proto) { + case ETH_L4_HDR_PROTO_TCP: + *pkt_info |=3D E1000_ADVRXD_PKT_TCP; + break; + + case ETH_L4_HDR_PROTO_UDP: + *pkt_info |=3D E1000_ADVRXD_PKT_UDP; + break; + + default: + break; + } } =20 if (hdr_info) { --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969771; cv=none; d=zohomail.com; s=zohoarc; b=A9DSq4eAQsdehW1kW7Ha5IVctcdv16avJcttrtjq6s2CQjFizG0b8eURbSvNqqwp7ddZLXnsMWUuXGwWS6cTRvXMfEi4U3LbcrPcmS39HKjAuauB/wqHnr3nFWQbTF4ujzc6IS4VWton7O9c2Rho4h4DxQwslra4XHrUdTEoRg0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969771; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=publPZs1fhxTrshwCuWg7dsVdQXSXv6ynCZ1gW8YOpU=; b=c8yJ/d3RRA9N2mz7KXiAQQDlYpSQaYWnpJK0u2UFIfG5kDRx4/CTnejbt0pXP/xofsJXwOx8e4eKSYC2rbe1NgRUXMobjZD2XnRblOW6jqoCJ6CIIgWvrnba1OxStb382L6ICIhEkowB5fnwyvHpzI6hQUoNxW1EA02k6BpO+Zc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969771915504.4504577558653; Wed, 19 Apr 2023 22:49:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9F-0006sH-Jv; Thu, 20 Apr 2023 01:48:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9B-0006rC-Qn for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:47:58 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9A-00014m-As for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:47:57 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-24736992dd3so367672a91.1 for ; Wed, 19 Apr 2023 22:47:55 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969675; x=1684561675; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=publPZs1fhxTrshwCuWg7dsVdQXSXv6ynCZ1gW8YOpU=; b=X4NvK83zOZ+r26KP3J1dx+4P2v6XpGaC1QxpyKC9z9NqIDbVIt5fK4WT6UcCJmCK1O /CGe7BCsx/VjL1rw+xeb/Q9Cqcqa0U+jPGxkbvoBuqUVgaEEtcvGfOE7kIdHLdKm5IWh nOJZSgIMAQt6b/9KXwHMYdBWEHVLCaefe1iaM2pfs5JicNzMAshNthjG1PD/67sEreOE UtFnnlAhtTaeb4dkH5FgNC0B6OvhjJ30Qyu8w5VBmd1pbfaUDw368oiqNrHyIUa9noc8 kNUwlolWdnWSUHFkPQjedN4NC2rU82i8dRf+A4cMy6hXyW2vus7oh1QISNLBz4DFt3Ik b2Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969675; x=1684561675; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=publPZs1fhxTrshwCuWg7dsVdQXSXv6ynCZ1gW8YOpU=; b=km86/2E5WZfar03e8kmk5zUljBYVBREAne8KIBJFv3yGLZ+Wm4WW9f1dYMzH3BfbkH WOqfOqG4Gos48NTlnvMK/JLNUs+AZQby4CRKU7AFrqkZlItJduh9ttad8UwpARcXMJlv SnFBYWckWfJQVAOekEk1hl0GU1EYvK6mXCh9rX3V1ACI4oUV9DDXbtnJpk4AOWD0BJ2n 5oVSSsRU19NIvmxVcV97Ld/866k3vMI2+pFgETY0XhbPZaEjU9oVTnglXKVwaGiF9um/ G3HDba7hFMAdO6m3Cp3YFZaGShmVRLH94iSS19pjugdG7R/eRJ/GVtBgHav9e1bRqHzz mJCA== X-Gm-Message-State: AAQBX9f40Sq7WmbIGKQXezBO2nws38JZFEnonVIb9b7kJoaHPzBwwE2k T5V0WqPhWNvRNQ70lam/b2ctSA== X-Google-Smtp-Source: AKy350aFAtdhnGUGULtlX/BOHShQPUjdI0jWdMSKbOYrh3CikKLAZD7DNIo+oZGuJog8aZr30yoARg== X-Received: by 2002:a17:90a:d90e:b0:247:8b5f:59ce with SMTP id c14-20020a17090ad90e00b002478b5f59cemr591526pjv.20.1681969675084; Wed, 19 Apr 2023 22:47:55 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 05/41] igb: Do not require CTRL.VME for tx VLAN tagging Date: Thu, 20 Apr 2023 14:46:21 +0900 Message-Id: <20230420054657.50367-6-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::102a; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969772966100001 Content-Type: text/plain; charset="utf-8" While the datasheet of e1000e says it checks CTRL.VME for tx VLAN tagging, igb's datasheet has no such statements. It also says for "CTRL.VLE": > This register only affects the VLAN Strip in Rx it does not have any > influence in the Tx path in the 82576. (Appendix A. Changes from the 82575) There is no "CTRL.VLE" so it is more likely that it is a mistake of CTRL.VME. Fixes: fba7c3b788 ("igb: respect VMVIR and VMOLR for VLAN") Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- hw/net/igb_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index dbd1192a8e..96a118b6c1 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -402,7 +402,7 @@ igb_tx_insert_vlan(IGBCore *core, uint16_t qn, struct i= gb_tx *tx, } } =20 - if (insert_vlan && e1000x_vlan_enabled(core->mac)) { + if (insert_vlan) { net_tx_pkt_setup_vlan_header_ex(tx->tx_pkt, vlan, core->mac[VET] & 0xffff); } --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969763; cv=none; d=zohomail.com; s=zohoarc; b=HiqWIj8l31RGTShTtwtXInHD2tw5X8C2iUWKaRvFYs3l+h0lCsw3q/VsFKmQYt0QjeY4T7mappDSRAxCEG/ZLhlJDJontlnHkRco9jY3X2jEz2pCje28KIdhETwNyOQxC7I9w1xTgX5/Ep920/Jrs48z+EM8GLTY28LuaBpiEVA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969763; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=v/nrEX4P5E15OsBCheTj+PJDTAJleMbN2kLPc8cL6pw=; b=Y+cIfqMZAKb0q/N/Nt/AjaVtPhjByrFZCIml2RQZBqnEau76U63StijZC5BTZMLiF/CR7jkg+rGDTxIBoXB5Z5MyU+UHtdyNU1bMRy9+csGZPJZXFS3Z6RT8UD6fZTVxLFi2/1oN1PS+e1ZGhSxrisyg9iZhRZXbMPaBNMRn/S0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16819697632391004.5614727775405; Wed, 19 Apr 2023 22:49:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9N-0006sw-HW; Thu, 20 Apr 2023 01:48:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9G-0006sX-T0 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:06 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9E-00015K-0q for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:02 -0400 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-247122e9845so401981a91.0 for ; Wed, 19 Apr 2023 22:47:59 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:47:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969679; x=1684561679; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v/nrEX4P5E15OsBCheTj+PJDTAJleMbN2kLPc8cL6pw=; b=QF8i2NOaB3Hb1fYgkJRbVs7Q7P5NliQx1g3d6GZlkP1OE1X20cfJdV+dHPyEy2ViEM f89TAlgC/mDQ7Am3SEc9mGQuOuEdyVTdAehUKfq8+c4N4FL994ZpdpWaguhm2S2M274s inx3f+8yFymKNIuqtJw2021n04d23zM6YLocXMcJ2/fj9J/gynsHKeGRmhjcqFTVq4My B98eC1v34oxM8tE92SuOILFVXCM77K5UvWCMkRXXPVaXY+vczHsiAsDjOcA2egk6boRQ wEJJ8ISekyuEhN2gCArI2MM1Atcr8JEhQFa+6ctpJaOuQK2QfqwKCOsl24khhjZt+1V5 +M0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969679; x=1684561679; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v/nrEX4P5E15OsBCheTj+PJDTAJleMbN2kLPc8cL6pw=; b=O3jlZhNW4hrPkvuv7t0JTiALGTL+FG/ptywvk2l0DxFP9H4czophgU7aa31bnAentb 7cUhnaaoU9fb6n89cPn5KSSLEcNpF45WTjXAE0KWA9Bicuzhgj5HmauaWviDrzDELuZn msx6gFPOiUQAUymbr9ri101M6BOGlwBVXabDMwPzkpVHYKe2EXpWy+DoKcvP9Da552NX /yCc5p9rjwVyt3EFPM10x6nZMDQD65naQElLtOTDKNbNjk30hDopX9xHwhLmhRPPlLtK iIkGZRv/Bktj8EHOQN3+EorW0tCT2zSSTo5PCN9f5M1YX590sbnn1kBZ1LQtazoEGZHN CpWw== X-Gm-Message-State: AAQBX9d3ZdOmKXhwKjSPruRKQf8dQ5qqvFNQTC8qkC9wO0Zbgm6YOZ1f m8PjpGbWVrE72vR2q5LXNkFylw== X-Google-Smtp-Source: AKy350ZhftYITfKxX7ZL7d4rF2gitscOiX2kd0t7MKsJo784VnkEcC31Vn+KOK77AWYxMIniLbLoew== X-Received: by 2002:a17:90b:3507:b0:246:8f9b:d28e with SMTP id ls7-20020a17090b350700b002468f9bd28emr565708pjb.18.1681969678696; Wed, 19 Apr 2023 22:47:58 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 06/41] net/net_rx_pkt: Use iovec for net_rx_pkt_set_protocols() Date: Thu, 20 Apr 2023 14:46:22 +0900 Message-Id: <20230420054657.50367-7-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::102d; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x102d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969764187100003 Content-Type: text/plain; charset="utf-8" igb does not properly ensure the buffer passed to net_rx_pkt_set_protocols() is contiguous for the entire L2/L3/L4 header. Allow it to pass scattered data to net_rx_pkt_set_protocols(). Fixes: 3a977deebe ("Intrdocue igb device emulation") Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- hw/net/net_rx_pkt.h | 10 ++++++---- include/net/eth.h | 6 +++--- hw/net/igb_core.c | 2 +- hw/net/net_rx_pkt.c | 14 +++++--------- hw/net/virtio-net.c | 7 +++++-- hw/net/vmxnet3.c | 7 ++++++- net/eth.c | 18 ++++++++---------- 7 files changed, 34 insertions(+), 30 deletions(-) diff --git a/hw/net/net_rx_pkt.h b/hw/net/net_rx_pkt.h index d00b484900..a06f5c2675 100644 --- a/hw/net/net_rx_pkt.h +++ b/hw/net/net_rx_pkt.h @@ -55,12 +55,14 @@ size_t net_rx_pkt_get_total_len(struct NetRxPkt *pkt); * parse and set packet analysis results * * @pkt: packet - * @data: pointer to the data buffer to be parsed - * @len: data length + * @iov: received data scatter-gather list + * @iovcnt: number of elements in iov + * @iovoff: data start offset in the iov * */ -void net_rx_pkt_set_protocols(struct NetRxPkt *pkt, const void *data, - size_t len); +void net_rx_pkt_set_protocols(struct NetRxPkt *pkt, + const struct iovec *iov, size_t iovcnt, + size_t iovoff); =20 /** * fetches packet analysis results diff --git a/include/net/eth.h b/include/net/eth.h index c5ae4493b4..9f19c3a695 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -312,10 +312,10 @@ eth_get_l2_hdr_length(const void *p) } =20 static inline uint32_t -eth_get_l2_hdr_length_iov(const struct iovec *iov, int iovcnt) +eth_get_l2_hdr_length_iov(const struct iovec *iov, size_t iovcnt, size_t i= ovoff) { uint8_t p[sizeof(struct eth_header) + sizeof(struct vlan_header)]; - size_t copied =3D iov_to_buf(iov, iovcnt, 0, p, ARRAY_SIZE(p)); + size_t copied =3D iov_to_buf(iov, iovcnt, iovoff, p, ARRAY_SIZE(p)); =20 if (copied < ARRAY_SIZE(p)) { return copied; @@ -397,7 +397,7 @@ typedef struct eth_l4_hdr_info_st { bool has_tcp_data; } eth_l4_hdr_info; =20 -void eth_get_protocols(const struct iovec *iov, int iovcnt, +void eth_get_protocols(const struct iovec *iov, size_t iovcnt, size_t iovo= ff, bool *hasip4, bool *hasip6, size_t *l3hdr_off, size_t *l4hdr_off, diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 96a118b6c1..62d10f971e 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1650,7 +1650,7 @@ igb_receive_internal(IGBCore *core, const struct iove= c *iov, int iovcnt, =20 ehdr =3D PKT_GET_ETH_HDR(filter_buf); net_rx_pkt_set_packet_type(core->rx_pkt, get_eth_packet_type(ehdr)); - net_rx_pkt_set_protocols(core->rx_pkt, filter_buf, size); + net_rx_pkt_set_protocols(core->rx_pkt, iov, iovcnt, iov_ofs); =20 queues =3D igb_receive_assign(core, ehdr, size, &rss_info, external_tx= ); if (!queues) { diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c index 39cdea06de..63be6e05ad 100644 --- a/hw/net/net_rx_pkt.c +++ b/hw/net/net_rx_pkt.c @@ -103,7 +103,7 @@ net_rx_pkt_pull_data(struct NetRxPkt *pkt, iov, iovcnt, ploff, pkt->tot_len); } =20 - eth_get_protocols(pkt->vec, pkt->vec_len, &pkt->hasip4, &pkt->hasip6, + eth_get_protocols(pkt->vec, pkt->vec_len, 0, &pkt->hasip4, &pkt->hasip= 6, &pkt->l3hdr_off, &pkt->l4hdr_off, &pkt->l5hdr_off, &pkt->ip6hdr_info, &pkt->ip4hdr_info, &pkt->l4hdr_in= fo); =20 @@ -186,17 +186,13 @@ size_t net_rx_pkt_get_total_len(struct NetRxPkt *pkt) return pkt->tot_len; } =20 -void net_rx_pkt_set_protocols(struct NetRxPkt *pkt, const void *data, - size_t len) +void net_rx_pkt_set_protocols(struct NetRxPkt *pkt, + const struct iovec *iov, size_t iovcnt, + size_t iovoff) { - const struct iovec iov =3D { - .iov_base =3D (void *)data, - .iov_len =3D len - }; - assert(pkt); =20 - eth_get_protocols(&iov, 1, &pkt->hasip4, &pkt->hasip6, + eth_get_protocols(iov, iovcnt, iovoff, &pkt->hasip4, &pkt->hasip6, &pkt->l3hdr_off, &pkt->l4hdr_off, &pkt->l5hdr_off, &pkt->ip6hdr_info, &pkt->ip4hdr_info, &pkt->l4hdr_in= fo); } diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 53e1c32643..37551fd854 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1835,9 +1835,12 @@ static int virtio_net_process_rss(NetClientState *nc= , const uint8_t *buf, VIRTIO_NET_HASH_REPORT_UDPv6, VIRTIO_NET_HASH_REPORT_UDPv6_EX }; + struct iovec iov =3D { + .iov_base =3D (void *)buf, + .iov_len =3D size + }; =20 - net_rx_pkt_set_protocols(pkt, buf + n->host_hdr_len, - size - n->host_hdr_len); + net_rx_pkt_set_protocols(pkt, &iov, 1, n->host_hdr_len); net_rx_pkt_get_protocols(pkt, &hasip4, &hasip6, &l4hdr_proto); net_hash_type =3D virtio_net_get_hash_type(hasip4, hasip6, l4hdr_proto, n->rss_data.hash_types); diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 9acff310e7..05f41b6dfa 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -2001,7 +2001,12 @@ vmxnet3_receive(NetClientState *nc, const uint8_t *b= uf, size_t size) get_eth_packet_type(PKT_GET_ETH_HDR(buf))); =20 if (vmxnet3_rx_filter_may_indicate(s, buf, size)) { - net_rx_pkt_set_protocols(s->rx_pkt, buf, size); + struct iovec iov =3D { + .iov_base =3D (void *)buf, + .iov_len =3D size + }; + + net_rx_pkt_set_protocols(s->rx_pkt, &iov, 1, 0); vmxnet3_rx_need_csum_calculate(s->rx_pkt, buf, size); net_rx_pkt_attach_data(s->rx_pkt, buf, size, s->rx_vlan_stripping); bytes_indicated =3D vmxnet3_indicate_packet(s) ? size : -1; diff --git a/net/eth.c b/net/eth.c index 70bcd8e355..d7b30df79f 100644 --- a/net/eth.c +++ b/net/eth.c @@ -136,7 +136,7 @@ _eth_tcp_has_data(bool is_ip4, return l4len > TCP_HEADER_DATA_OFFSET(tcp); } =20 -void eth_get_protocols(const struct iovec *iov, int iovcnt, +void eth_get_protocols(const struct iovec *iov, size_t iovcnt, size_t iovo= ff, bool *hasip4, bool *hasip6, size_t *l3hdr_off, size_t *l4hdr_off, @@ -147,26 +147,24 @@ void eth_get_protocols(const struct iovec *iov, int i= ovcnt, { int proto; bool fragment =3D false; - size_t l2hdr_len =3D eth_get_l2_hdr_length_iov(iov, iovcnt); size_t input_size =3D iov_size(iov, iovcnt); size_t copied; uint8_t ip_p; =20 *hasip4 =3D *hasip6 =3D false; + *l3hdr_off =3D iovoff + eth_get_l2_hdr_length_iov(iov, iovcnt, iovoff); l4hdr_info->proto =3D ETH_L4_HDR_PROTO_INVALID; =20 - proto =3D eth_get_l3_proto(iov, iovcnt, l2hdr_len); - - *l3hdr_off =3D l2hdr_len; + proto =3D eth_get_l3_proto(iov, iovcnt, *l3hdr_off); =20 if (proto =3D=3D ETH_P_IP) { struct ip_header *iphdr =3D &ip4hdr_info->ip4_hdr; =20 - if (input_size < l2hdr_len) { + if (input_size < *l3hdr_off) { return; } =20 - copied =3D iov_to_buf(iov, iovcnt, l2hdr_len, iphdr, sizeof(*iphdr= )); + copied =3D iov_to_buf(iov, iovcnt, *l3hdr_off, iphdr, sizeof(*iphd= r)); if (copied < sizeof(*iphdr) || IP_HEADER_VERSION(iphdr) !=3D IP_HEADER_VERSION_4) { return; @@ -175,17 +173,17 @@ void eth_get_protocols(const struct iovec *iov, int i= ovcnt, *hasip4 =3D true; ip_p =3D iphdr->ip_p; ip4hdr_info->fragment =3D IP4_IS_FRAGMENT(iphdr); - *l4hdr_off =3D l2hdr_len + IP_HDR_GET_LEN(iphdr); + *l4hdr_off =3D *l3hdr_off + IP_HDR_GET_LEN(iphdr); =20 fragment =3D ip4hdr_info->fragment; } else if (proto =3D=3D ETH_P_IPV6) { - if (!eth_parse_ipv6_hdr(iov, iovcnt, l2hdr_len, ip6hdr_info)) { + if (!eth_parse_ipv6_hdr(iov, iovcnt, *l3hdr_off, ip6hdr_info)) { return; } =20 *hasip6 =3D true; ip_p =3D ip6hdr_info->l4proto; - *l4hdr_off =3D l2hdr_len + ip6hdr_info->full_hdr_len; + *l4hdr_off =3D *l3hdr_off + ip6hdr_info->full_hdr_len; fragment =3D ip6hdr_info->fragment; } else { return; --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970051; cv=none; d=zohomail.com; s=zohoarc; b=JyhkLWv7yBvJmCmtVvPAV2K4b/qkfLFAtrfM3Y8InEAyKJ2LX4KTifKdmqw3WE2nG7uwEB8Uq4JHW11fUuj7owBPoVxAPN/nfbWBtiKl1TcgPomNZd3wEpEikHV26soLlINft6dSZsfQFRryvISWf3W7MueRD/hQvdIKmv1Na+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970051; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=VY0RJ2zeL4ADYhynCOJEmTANyW901p2WIKUi3FWJhB8=; b=O+CSfqPyDYqNsd2XLHgPW1p6RZ4ruk5ncm+9iYGaJ4i+KGWGibk+6Hqf17axEy9mA9gyyKY66DVpLdaYYF7WoKuB1IjSJbZJGoE6UtEwgcS0snZ6UMruSNWX1pMKtK27IMBBcSXbH2DWJmEfyQYX+rgVITW8IyKOskjiUaVhEBc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970051644363.3811527627822; Wed, 19 Apr 2023 22:54:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9O-0006tD-E9; Thu, 20 Apr 2023 01:48:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9J-0006sY-RV for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:06 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9H-00015i-GG for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:04 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-52019617020so543485a12.3 for ; Wed, 19 Apr 2023 22:48:03 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.47.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969682; x=1684561682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VY0RJ2zeL4ADYhynCOJEmTANyW901p2WIKUi3FWJhB8=; b=nXWRV1+e/gmt0rbWJPg705bkgC+v/OSoLV43Me5JNn+rFigGNrzbNdsFEZghSD9Y87 4S5TvPfeN0B8XIPQYyzDx4ud2C0GmtppvplP7sbIXQKyoMGfSR63gWpi1GtglYqC0l0x H7dfHVuRP2NYlB6jVBsYdCfj+wWEhsB+G631WGRTxgmACj9nD1goVJ1MwL0lQLwRxBUd iYWdPex05EnK9bf8j2bNdcx9HP5NQ6nMflcHIcyOmC6B63AP63gr7KCqblSxjdYyQFCH gPhnhD95X3n4hhWEN/LKxm9OlWrB4XG4J0HkDLx/Tcp8hzuFyu3vEkKnB9bxUHTrwnAu CzbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969682; x=1684561682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VY0RJ2zeL4ADYhynCOJEmTANyW901p2WIKUi3FWJhB8=; b=E/ZLid8QDzJpI6KfFLoExouQm7Qx7qaoawyhHTrAXXUEETc86NAwK/qn2XPKNxOk55 3W6A820I1pejjxMR/MuDGX0685NacuiRs4rx8ItVAZH0VIngZCjcHUl3eX5drgNrs16V fFjVXKK1ehbnRX6gqhL09SM8pVB3JLZ87+dQlQOTPD1JZ8CdWPpA755b7mWGZrGGpL/5 s3RcXP1z/jFMqwPAVaKeogLQPQ0N+4BzrOYTVZyRcu6IigfuFH/OMwFlqWYgaVPBRs67 2S7SLoolycTB6XK6mN4ZkkJt/bIPB3Tfqmasp4IRzXF9i4uUd13bkMr60q0TUHZhV0VJ 5Kxw== X-Gm-Message-State: AAQBX9fOxKdoPlzfmFtOZ27RGVdR+smdZTdVRwH79orH73EvJTo2CdqX QDXSNfKs4ueyzsGTCkur5n7sqQ== X-Google-Smtp-Source: AKy350YQjFQXElNlZcTNrabqkCXrCMjTV93rE99cvIXgq5WGo2bBkrHxTaFaTAUoU8dZ/tAhgaWCYg== X-Received: by 2002:a17:90a:2cc1:b0:247:48a1:3fb2 with SMTP id n59-20020a17090a2cc100b0024748a13fb2mr589884pjd.19.1681969682196; Wed, 19 Apr 2023 22:48:02 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 07/41] e1000e: Always copy ethernet header Date: Thu, 20 Apr 2023 14:46:23 +0900 Message-Id: <20230420054657.50367-8-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::52b; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970052803100025 Content-Type: text/plain; charset="utf-8" e1000e_receive_internal() used to check the iov length to determine copy the iovs to a contiguous buffer, but the check is flawed in two ways: - It does not ensure that iovcnt > 0. - It does not take virtio-net header into consideration. The size of this copy is just 18 octets, which can be even less than the code size required for checks. This (wrong) optimization is probably not worth so just remove it. Fixes: 6f3fbe4ed0 ("net: Introduce e1000e device emulation") Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index c2d864a504..f3335194d8 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1686,12 +1686,9 @@ static ssize_t e1000e_receive_internal(E1000ECore *core, const struct iovec *iov, int iov= cnt, bool has_vnet) { - static const int maximum_ethernet_hdr_len =3D (ETH_HLEN + 4); - uint32_t n =3D 0; uint8_t min_buf[ETH_ZLEN]; struct iovec min_iov; - uint8_t *filter_buf; size_t size, orig_size; size_t iov_ofs =3D 0; E1000E_RxRing rxr; @@ -1714,7 +1711,6 @@ e1000e_receive_internal(E1000ECore *core, const struc= t iovec *iov, int iovcnt, net_rx_pkt_unset_vhdr(core->rx_pkt); } =20 - filter_buf =3D iov->iov_base + iov_ofs; orig_size =3D iov_size(iov, iovcnt); size =3D orig_size - iov_ofs; =20 @@ -1723,15 +1719,13 @@ e1000e_receive_internal(E1000ECore *core, const str= uct iovec *iov, int iovcnt, iov_to_buf(iov, iovcnt, iov_ofs, min_buf, size); memset(&min_buf[size], 0, sizeof(min_buf) - size); e1000x_inc_reg_if_not_full(core->mac, RUC); - min_iov.iov_base =3D filter_buf =3D min_buf; + min_iov.iov_base =3D min_buf; min_iov.iov_len =3D size =3D sizeof(min_buf); iovcnt =3D 1; iov =3D &min_iov; iov_ofs =3D 0; - } else if (iov->iov_len < maximum_ethernet_hdr_len) { - /* This is very unlikely, but may happen. */ - iov_to_buf(iov, iovcnt, iov_ofs, min_buf, maximum_ethernet_hdr_len= ); - filter_buf =3D min_buf; + } else { + iov_to_buf(iov, iovcnt, iov_ofs, min_buf, ETH_HLEN + 4); } =20 /* Discard oversized packets if !LPE and !SBP. */ @@ -1740,9 +1734,9 @@ e1000e_receive_internal(E1000ECore *core, const struc= t iovec *iov, int iovcnt, } =20 net_rx_pkt_set_packet_type(core->rx_pkt, - get_eth_packet_type(PKT_GET_ETH_HDR(filter_buf))); + get_eth_packet_type(PKT_GET_ETH_HDR(min_buf))); =20 - if (!e1000e_receive_filter(core, filter_buf, size)) { + if (!e1000e_receive_filter(core, min_buf, size)) { trace_e1000e_rx_flt_dropped(); return orig_size; } --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969891; cv=none; d=zohomail.com; s=zohoarc; b=ODCK7vXUiZ/ZT1EwcDMbuSjWFr8iAo45/MRT/1u+T7022nJVWAq/shy2TkXKcZMvEGd6/SJcpEn++dHmm3pw/U4ar/VOoEYIdZQTM8KNlUHIA9DX+nJwH/3kbETwU9sBiDnIi26+qOSwtFUmiRQOE0AQ25kM/Z+JmUylUJ0bIQ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969891; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=JZLZ6syDe67wGHmQM3Z+1cpabxDcSS1kb2HPMg6PeUo=; b=IYpDZurNsIeQRuq5TM9CpYoMDJVBidUZa98OZLYjoqoOzgQ1UtF+8vMqQilPq5oVOg8eZfe2zR0TRZPgw2LWVHii/oBmQhkm7itQ+03Ze25Hl+RbP/LTPIJ4vAkdPI+5ehjcI+IMBa7zGQbLOV0dQ+a4zXODAEQpngLKwASh8Tc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969891242717.0943974459933; Wed, 19 Apr 2023 22:51:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9P-0006tg-V0; Thu, 20 Apr 2023 01:48:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9O-0006t3-1p for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:10 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9L-00019a-27 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:09 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-517bdd9957dso447718a12.1 for ; Wed, 19 Apr 2023 22:48:06 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969685; x=1684561685; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JZLZ6syDe67wGHmQM3Z+1cpabxDcSS1kb2HPMg6PeUo=; b=rrd7aVqFNAF+fROBmytWuNEakpMBCa4rTe4ORjshciqGFJEg0WZkYaOL5Cgy7n2MS+ WQyYVQZ7LyCn6RmZBNJgPuEUNslvcLs8QIbGnKAMYMja7SZBjE38QHV3qpBjBFiGS/uF GxtSqANwHRUvOZ4JH2Xva9M1E+rMa5qZtMxaXj+0CpvmgufIv2cTFOxjPVCAWQwKCdB+ 5RRC7E9ImgE5rdYhEEA0JMi3MvvOnjNor/IPwPenjKTX5F0Vum/kpJgozcwdjEnax+Z4 7tP9R/HqFGJ+ofnWPawfmQC5aKbQF813dv4GSPCNW/ijuw06Y6WR3Jix4S84pqMxkzrE x7Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969685; x=1684561685; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JZLZ6syDe67wGHmQM3Z+1cpabxDcSS1kb2HPMg6PeUo=; b=GFdSkKymfJTpCIYlTu2+zPLgUR/ea7g648V+AaM+j+LkmuqXAvRwQty0UT/iSoiktL 1odXssqyfzPCSLWxJkjjxg5dpaWhzk9tTx/jNtR4otb8zgRNrp9SF0mUT/12wUmgen5g uH+gQnH+VFfc4HMlcUrN87lEDqs09AFa8JVx8Ep3vZSAAzm1g/ShnDABPqpF+WWaCcZn Mi4PyeIxtCFdH0/XWEm1GVTOAmqpaKPUZYqoR+8TRI1wOW5koORaqWOu6hBJlgFTuNFI hC6nts7NthVYLZg0+cM39DXJShfrXh3jRzJQB375b9VjbQsoBv7LHeJ4E45SA84GeUrW 4eww== X-Gm-Message-State: AAQBX9c7hBN6YF9/T6HgM9XTuJ/DZUPQDren//Bu7yAF36E/hpd+r1DH X+DY6uVBJg209rq37HYQ1TKfLg== X-Google-Smtp-Source: AKy350bLoc/+vJ1uBXHzeBmdTDlGwt3BJ/FTIdw5uGGnT5h/hk+tYp4HuIa5WnMTk1EihNEek46Tbw== X-Received: by 2002:a17:90b:3144:b0:247:6c32:37e5 with SMTP id ip4-20020a17090b314400b002476c3237e5mr577351pjb.13.1681969685645; Wed, 19 Apr 2023 22:48:05 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 08/41] igb: Always copy ethernet header Date: Thu, 20 Apr 2023 14:46:24 +0900 Message-Id: <20230420054657.50367-9-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::534; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x534.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969893232100003 Content-Type: text/plain; charset="utf-8" igb_receive_internal() used to check the iov length to determine copy the iovs to a contiguous buffer, but the check is flawed in two ways: - It does not ensure that iovcnt > 0. - It does not take virtio-net header into consideration. The size of this copy is just 22 octets, which can be even less than the code size required for checks. This (wrong) optimization is probably not worth so just remove it. Removing this also allows igb to assume aligned accesses for the ethernet header. Fixes: 3a977deebe ("Intrdocue igb device emulation") Signed-off-by: Akihiko Odaki --- hw/net/igb_core.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 62d10f971e..72a00564cf 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -67,6 +67,11 @@ typedef struct IGBTxPktVmdqCallbackContext { NetClientState *nc; } IGBTxPktVmdqCallbackContext; =20 +typedef struct L2Header { + struct eth_header eth; + struct vlan_header vlan; +} L2Header; + static ssize_t igb_receive_internal(IGBCore *core, const struct iovec *iov, int iovcnt, bool has_vnet, bool *external_tx); @@ -961,15 +966,16 @@ igb_rx_is_oversized(IGBCore *core, uint16_t qn, size_= t size) return size > (lpe ? max_ethernet_lpe_size : max_ethernet_vlan_size); } =20 -static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header = *ehdr, +static uint16_t igb_receive_assign(IGBCore *core, const L2Header *l2_heade= r, size_t size, E1000E_RSSInfo *rss_info, bool *external_tx) { static const int ta_shift[] =3D { 4, 3, 2, 0 }; + const struct eth_header *ehdr =3D &l2_header->eth; uint32_t f, ra[2], *macp, rctl =3D core->mac[RCTL]; uint16_t queues =3D 0; uint16_t oversized =3D 0; - uint16_t vid =3D lduw_be_p(&PKT_GET_VLAN_HDR(ehdr)->h_tci) & VLAN_VID_= MASK; + uint16_t vid =3D be16_to_cpu(l2_header->vlan.h_tci) & VLAN_VID_MASK; bool accepted =3D false; int i; =20 @@ -1590,14 +1596,13 @@ static ssize_t igb_receive_internal(IGBCore *core, const struct iovec *iov, int iovcnt, bool has_vnet, bool *external_tx) { - static const int maximum_ethernet_hdr_len =3D (ETH_HLEN + 4); - uint16_t queues =3D 0; uint32_t n =3D 0; - uint8_t min_buf[ETH_ZLEN]; + union { + L2Header l2_header; + uint8_t octets[ETH_ZLEN]; + } min_buf; struct iovec min_iov; - struct eth_header *ehdr; - uint8_t *filter_buf; size_t size, orig_size; size_t iov_ofs =3D 0; E1000E_RxRing rxr; @@ -1623,24 +1628,21 @@ igb_receive_internal(IGBCore *core, const struct io= vec *iov, int iovcnt, net_rx_pkt_unset_vhdr(core->rx_pkt); } =20 - filter_buf =3D iov->iov_base + iov_ofs; orig_size =3D iov_size(iov, iovcnt); size =3D orig_size - iov_ofs; =20 /* Pad to minimum Ethernet frame length */ if (size < sizeof(min_buf)) { - iov_to_buf(iov, iovcnt, iov_ofs, min_buf, size); - memset(&min_buf[size], 0, sizeof(min_buf) - size); + iov_to_buf(iov, iovcnt, iov_ofs, &min_buf, size); + memset(&min_buf.octets[size], 0, sizeof(min_buf) - size); e1000x_inc_reg_if_not_full(core->mac, RUC); - min_iov.iov_base =3D filter_buf =3D min_buf; + min_iov.iov_base =3D &min_buf; min_iov.iov_len =3D size =3D sizeof(min_buf); iovcnt =3D 1; iov =3D &min_iov; iov_ofs =3D 0; - } else if (iov->iov_len < maximum_ethernet_hdr_len) { - /* This is very unlikely, but may happen. */ - iov_to_buf(iov, iovcnt, iov_ofs, min_buf, maximum_ethernet_hdr_len= ); - filter_buf =3D min_buf; + } else { + iov_to_buf(iov, iovcnt, iov_ofs, &min_buf, sizeof(min_buf.l2_heade= r)); } =20 /* Discard oversized packets if !LPE and !SBP. */ @@ -1648,11 +1650,12 @@ igb_receive_internal(IGBCore *core, const struct io= vec *iov, int iovcnt, return orig_size; } =20 - ehdr =3D PKT_GET_ETH_HDR(filter_buf); - net_rx_pkt_set_packet_type(core->rx_pkt, get_eth_packet_type(ehdr)); + net_rx_pkt_set_packet_type(core->rx_pkt, + get_eth_packet_type(&min_buf.l2_header.eth)= ); net_rx_pkt_set_protocols(core->rx_pkt, iov, iovcnt, iov_ofs); =20 - queues =3D igb_receive_assign(core, ehdr, size, &rss_info, external_tx= ); + queues =3D igb_receive_assign(core, &min_buf.l2_header, size, + &rss_info, external_tx); if (!queues) { trace_e1000e_rx_flt_dropped(); return orig_size; --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969978; cv=none; d=zohomail.com; s=zohoarc; b=X7mYaxPb5mSrkZss/+2dGlfdrP0DWM2n7jHby1gOr66pIzykuv8p8NWDGO4uy5jJkCz3dKoq2Jxd9VG1AJSchHsBC62rRZiw8NmCJ0yG7BziBysb9TbIkstv5uI3FbPfjkSLMgutfFl9NUu+CEibgkZ3sjVWBlh4kBPTaZ2gwZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969978; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=hO7vy38C7n7U8m09DYFIOuqZKNDrQj3wd3r1DxexBJ4=; b=mDEyyReJFMPpKg7p95zGSE3kBA4OYbFTg45uuRFtXE7CqzdJm2ulDijrJ+BshnC6Epltpt111ljQrRgYQZdeYuj+vMjB95lbHgRjVtWio1cw5q1hg4pxsxlAbVMC+owTTeAYzIaiXB+NhdA16RbjbblhAUjMBMlu4nubiJhaFds= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969978737110.16105749206486; Wed, 19 Apr 2023 22:52:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9R-0006u7-Qr; Thu, 20 Apr 2023 01:48:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9P-0006tf-Dj for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:11 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9N-00012m-Oo for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:11 -0400 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-244a5ccf13eso388873a91.2 for ; Wed, 19 Apr 2023 22:48:09 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969689; x=1684561689; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hO7vy38C7n7U8m09DYFIOuqZKNDrQj3wd3r1DxexBJ4=; b=HAE39E0UFwRARmKj8m7ywt1z5MPs6pV/wh6/mXTGVY3D5R0yCNDzifA/UWlm2gb4eA ODVeXyB4rLP0cR3+Zw1qVLAxgW1fw6oqNzqb2WwqdRoMGPLhmzN8O48qkMiaUb0x0gQQ uvMwgJFzwmc9r6pATa0eHafaw0iTf8p3sd3F+aWqaxetZD7rXX9HittIspGVHlUgicX6 ATxsBdUuakz29njUO9W+54Gii8d5uPz/eKV8imrNOpouNu/JNoS/zznUZEkP9qwbGSu/ hS/cYzT0AXak6Afne5mr9J+Nfp+iTiNcDzMKZr/Ek5Kod4ztI/1qk2F780VLI2vftIFB ZZMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969689; x=1684561689; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hO7vy38C7n7U8m09DYFIOuqZKNDrQj3wd3r1DxexBJ4=; b=YwzsD6H7ueH2JW731iSWpsqcPZtgRcC9puD5BtdCsi2NjXf9DCRVD+lMWFO6rrfFDY 4yZ/t/4Gxfr8J/Or9sj3VnFi5OnTUp17VhqeADjJ7I6VKtd8RBVLxyhNMXzhklL45Qh+ d0FaWYy3LyDIhp5hT0/sjicylL9B+l0qioeJzhkyZERqZRYRBm27ZTvafBnP7vOnISgx uHYtM7VB4h9qIGCmWwpJx+PIjNXqrzA355H+iLhCXzDaAeIcFJvF+h0qNJ35mH5D0LK1 kdTw/J5U7LFd9VKL6NSNNF84dGzOhcSyzJGiuEbbUOim9Dy22s2YLCM10v7s9Od8qRV1 fDmQ== X-Gm-Message-State: AAQBX9eRt2HUoFgWgOp7WjIU6uKTq6LRzGQnuTR64K+67PCcsjDDDoQy Gzik84pBHPDj/BN++QjeqZ0vCQ== X-Google-Smtp-Source: AKy350aRLxrvgBPQVYsx1GsNc9M3cWSYtA6egKdsmYvmgYrsuzbygNpJ7+VYJT+LIT1TTSGZUmTeEg== X-Received: by 2002:a17:90a:ca07:b0:249:89a2:5800 with SMTP id x7-20020a17090aca0700b0024989a25800mr653062pjt.9.1681969689052; Wed, 19 Apr 2023 22:48:09 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 09/41] Fix references to igb Avocado test Date: Thu, 20 Apr 2023 14:46:25 +0900 Message-Id: <20230420054657.50367-10-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::102e; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969979499100007 Fixes: 9f95111474 ("tests/avocado: re-factor igb test to avoid timeouts") Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 2 +- docs/system/devices/igb.rst | 2 +- scripts/ci/org.centos/stream/8/x86_64/test-avocado | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index ef45b5e71e..c31d2279ab 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2256,7 +2256,7 @@ R: Sriram Yagnaraman S: Maintained F: docs/system/devices/igb.rst F: hw/net/igb* -F: tests/avocado/igb.py +F: tests/avocado/netdev-ethtool.py F: tests/qtest/igb-test.c F: tests/qtest/libqos/igb.c =20 diff --git a/docs/system/devices/igb.rst b/docs/system/devices/igb.rst index 70edadd574..afe036dad2 100644 --- a/docs/system/devices/igb.rst +++ b/docs/system/devices/igb.rst @@ -60,7 +60,7 @@ Avocado test and can be ran with the following command: =20 .. code:: shell =20 - make check-avocado AVOCADO_TESTS=3Dtests/avocado/igb.py + make check-avocado AVOCADO_TESTS=3Dtests/avocado/netdev-ethtool.py =20 References =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff --git a/scripts/ci/org.centos/stream/8/x86_64/test-avocado b/scripts/c= i/org.centos/stream/8/x86_64/test-avocado index d2c0e5fb4c..a1aa601ee3 100755 --- a/scripts/ci/org.centos/stream/8/x86_64/test-avocado +++ b/scripts/ci/org.centos/stream/8/x86_64/test-avocado @@ -30,7 +30,7 @@ make get-vm-images tests/avocado/cpu_queries.py:QueryCPUModelExpansion.test \ tests/avocado/empty_cpu_model.py:EmptyCPUModel.test \ tests/avocado/hotplug_cpu.py:HotPlugCPU.test \ - tests/avocado/igb.py:IGB.test \ + tests/avocado/netdev-ethtool.py:NetDevEthtool.test_igb_nomsi \ tests/avocado/info_usernet.py:InfoUsernet.test_hostfwd \ tests/avocado/intel_iommu.py:IntelIOMMU.test_intel_iommu \ tests/avocado/intel_iommu.py:IntelIOMMU.test_intel_iommu_pt \ --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969726; cv=none; d=zohomail.com; s=zohoarc; b=fWsixn1IVMskupDl5DQy7hDVANMEOHaxwZ5rMGeBfa3mK1fA/6SXCMrtcTRzt9ryjz1lIF9I0kfw+ZfMG/k0YdC5AM+zZA78WaCXcCOPDO5lJXBdSFMN4yoXpoSryWe1rq2+E3Jg1k9xasB63JfIUosYT5dcNXqWy4GIg053OAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969726; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=3xDGlD2yRV3C0PkIp3jpH6p4fU6/buA90WdM6GaBzNs=; b=mQ4CgAZulWeBQ6HsrK+C/hCcHRG0OLcvPi6RZhNqo6dN4njiWZ3/gcUFJdLVh02rbDWiRl0fIHWn81l/A7HDKQFdxNT4oPXu/6zyj8Gk1WLWWJyodMAk7v6YFQM2S0C/FXXUOirt9njPtOjGRvGtLnse3EJQyp1QZ0g2aNVO2eo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969726984565.8220761508002; Wed, 19 Apr 2023 22:48:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9Z-00075A-B9; Thu, 20 Apr 2023 01:48:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9T-0006uO-MM for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:15 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9R-00015i-4E for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:15 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-52019617020so543618a12.3 for ; Wed, 19 Apr 2023 22:48:12 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969692; x=1684561692; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3xDGlD2yRV3C0PkIp3jpH6p4fU6/buA90WdM6GaBzNs=; b=BJrPSjFPNZZt07NINnBLvWs8FLATXpp4APpaNxDHBZiiYFHxoY5HS5aa8R6an6LdCG jcxl2a+3ndy9EQNYUMTcS7iNi8NtYDlrx5NIpWR/bXmOyp6PGcJuX6AJ07UMiVBUaSIR mhSHbNE6y2LT/enxa62K6FvS8SL8KkWNhloJlsEZdW2xWzcffnaFhIaQyJUtTxlRyJ4X tsg+BoYIr09icqBK/PzV74JzYlhTNIEoCrXNQeuaE78cVoF7yBg7KHB48TDZ/RJxq83h hduHTgqZel08h3YuxgCOXKkXxpgI3gR3L4R4vfw/LgKO2qSxky7Q1jUa0NY55R4ZKLQY 1nxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969692; x=1684561692; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3xDGlD2yRV3C0PkIp3jpH6p4fU6/buA90WdM6GaBzNs=; b=LrumhkPKN2IK0hB4/JuV0+kOYIj85udIY+vNvqPA6VkcWJJlXS4bggRRB9M0k/QqNi oLpWvwHfsT16GddMaZ7jAVNB7Htl9I769mU0x8S2rS66LDp2KDcvTKMPfi44ej69ZrzQ WsyGdY+e+4586J+WwZ26N7XDR48d4g5OT5QW8xRsXd1zUGkjOmMue61GnYBb1sSE+hed IvL3F+bayvtddkOlagmoa93/WMEJHiW3G9isHpktgwoNZ/Kzdz9C+3qELObZBlFdnx5T Sd6vCW8FKcEjMyergJVfIPzLmKkmwdGO0+PsGn/jv//+lkDpGFv9IO8Zmu/riUcrRBl0 k+HQ== X-Gm-Message-State: AAQBX9d7vylgjL8zN6NnYTDHrF1fsxLM761G1wTVPD1th8/fyGXMsxPH vaZNwj6jfok5VWO94uaFWoXOdA== X-Google-Smtp-Source: AKy350bb8Knz7CftPNh0DCM/s9FA5gkh/D6+p9vDQbKTp5HsKkQDcG1DOoeHUlHQVUM71Y4KTLltwA== X-Received: by 2002:a17:902:d48d:b0:1a6:6c58:d36e with SMTP id c13-20020a170902d48d00b001a66c58d36emr388316plg.66.1681969692485; Wed, 19 Apr 2023 22:48:12 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 10/41] tests/avocado: Remove unused imports Date: Thu, 20 Apr 2023 14:46:26 +0900 Message-Id: <20230420054657.50367-11-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::52b; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969728076100007 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki --- tests/avocado/netdev-ethtool.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/avocado/netdev-ethtool.py b/tests/avocado/netdev-ethtool= .py index f7e9464184..8de118e313 100644 --- a/tests/avocado/netdev-ethtool.py +++ b/tests/avocado/netdev-ethtool.py @@ -7,7 +7,6 @@ =20 from avocado import skip from avocado_qemu import QemuSystemTest -from avocado_qemu import exec_command, exec_command_and_wait_for_pattern from avocado_qemu import wait_for_console_pattern =20 class NetDevEthtool(QemuSystemTest): --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969978; cv=none; d=zohomail.com; s=zohoarc; b=EVtjwPuu0is2mocKibZ2pPzUjqZA+4eqzci/yt4QGRslbPOUL8+5v7plqjH5AmBxlIj4+hN529QSH2ESIU6A88mbPss1ghhSsfShVvGaR5lsxbt072QCful2r29iX9szq0fM+5PyeE2NlolRF2vsL+ebceKDUrpdvJP+gJCcLiA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969978; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=5Ra4vem1bEUNGQf/At/UarboHQTyTTT4h6LEAWK7BBQ=; b=KAesBvmdFBbbkF2xb5+FTjdA4+Blcm68886fqoyq9E2vc68fEJBP+dEkOSppFmIqYxWHm9y5pf0HD0wPQnpt/S9g6X3vnI0g78DaZFcRtoHsbGMuP5BYFURwtREUMUMfu20ecUpJ9JyNMWPyd+6DcFv+0xDJx8RpsYHHoX5Q7pA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969978855297.40102178276175; Wed, 19 Apr 2023 22:52:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9r-0007DZ-ME; Thu, 20 Apr 2023 01:48:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9X-00074t-0e for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:19 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9V-0001DR-31 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:18 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-63b4dfead1bso601999b3a.3 for ; Wed, 19 Apr 2023 22:48:16 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969696; x=1684561696; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5Ra4vem1bEUNGQf/At/UarboHQTyTTT4h6LEAWK7BBQ=; b=WPKtu+YqVE4I5JwiR6TgGJrcbiZrxPSm4Upe1jx85q3sqVpz7zpS7skIDNzw1CRb1t 801powGIKh8JiQleiJ5VZfGGh2xhkRMe1bVAdvIL2qn/X/NydimBKONu8fwQqu97wPkN sZ4KjMwrjlYaEF7mc1gNnRUrC+5DiEXw1lXiLY6JuF43mOb6fQIiKDMDDQ/Jfmz5qXf+ hyEStEmOMM74X3ZGU0zY2e0GGFWDyOqsr18hal5IzoD2tJDVxfm+/5nBZpe+c4YBpj0k 23pwffsLz39a4zBV3cfofiK7C34Izl9kCMYj637wohJaEt/mXFtvgvhjSvgs8PPRJ14D nUww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969696; x=1684561696; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5Ra4vem1bEUNGQf/At/UarboHQTyTTT4h6LEAWK7BBQ=; b=E4+yYEq+czgC5oP7IHbYU6aZrMsj/WP1GpUY3VY1tIFkr9dIFEiaf5OpktYZYbEUnE iAdHiHf1kWhKHkb+VZuLhITAMiWs708HQHZxbCH7XULKcO0J3/1FbQ+RHxxmQxjGpV3B 1Cqm0zbXJuZHGREDQyE59F9jQ+fsbfu7PrvgFApvgezPw5EDXyFLhCdPYzvSVz7jQDr5 N6D216q7bkCJn+B7NidDrKHNAwgH8Wg8T8IqXrjWYMt0UPNHst4j0+l92pglIBaECvak 7IMbh0KreckolXx9jzydZNjCzcbdsGLkso+sM2Z9Welr46Tmfmr3doacmFiyNaEtOf8H IabA== X-Gm-Message-State: AAQBX9e+eps6YaRpFweENd+jRbixB5at1PZgv8RJQDzXQcPkibw3kIlC VNzIOEwM7zQ2jHkanDNWWAa0RA== X-Google-Smtp-Source: AKy350Yxsu8qfRuY7ixH4zzh5Xd34DYMKjwsV3nCnh8FeR9yF5ZF8L0/l8qyeYAhnvm9528L7wjG5Q== X-Received: by 2002:a17:903:294c:b0:1a1:e01e:7279 with SMTP id li12-20020a170903294c00b001a1e01e7279mr388890plb.4.1681969695889; Wed, 19 Apr 2023 22:48:15 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 11/41] tests/avocado: Remove test_igb_nomsi_kvm Date: Thu, 20 Apr 2023 14:46:27 +0900 Message-Id: <20230420054657.50367-12-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::436; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x436.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969979688100009 Content-Type: text/plain; charset="utf-8" It is unlikely to find more bugs with KVM so remove test_igb_nomsi_kvm to save time to run it. Signed-off-by: Akihiko Odaki Acked-by: Alex Benn=C3=A9e Reviewed-by: Thomas Huth --- tests/avocado/netdev-ethtool.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/avocado/netdev-ethtool.py b/tests/avocado/netdev-ethtool= .py index 8de118e313..6da800f62b 100644 --- a/tests/avocado/netdev-ethtool.py +++ b/tests/avocado/netdev-ethtool.py @@ -29,7 +29,7 @@ def get_asset(self, name, sha1): # URL into a unique one return self.fetch_asset(name=3Dname, locations=3D(url), asset_hash= =3Dsha1) =20 - def common_test_code(self, netdev, extra_args=3DNone, kvm=3DFalse): + def common_test_code(self, netdev, extra_args=3DNone): =20 # This custom kernel has drivers for all the supported network # devices we can emulate in QEMU @@ -57,9 +57,6 @@ def common_test_code(self, netdev, extra_args=3DNone, kvm= =3DFalse): '-drive', drive, '-device', netdev) =20 - if kvm: - self.vm.add_args('-accel', 'kvm') - self.vm.set_console(console_index=3D0) self.vm.launch() =20 @@ -86,13 +83,6 @@ def test_igb_nomsi(self): """ self.common_test_code("igb", "pci=3Dnomsi") =20 - def test_igb_nomsi_kvm(self): - """ - :avocado: tags=3Ddevice:igb - """ - self.require_accelerator('kvm') - self.common_test_code("igb", "pci=3Dnomsi", True) - # It seems the other popular cards we model in QEMU currently fail # the pattern test with: # --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970045; cv=none; d=zohomail.com; s=zohoarc; b=OInvmmj0H/qWgxwdr9rjHGcy4oFKXkVrCT4TAqsQMuQjVWxPDbcR6f9B90BuohLGOI/saQL8Cmub7OYi0lQDVey3yWSpzTfDkFlVtwWODrvd8xlIuDaP/uP6l2CGSkmXKCypCRag7ygCfBppQQ59Ely9DtTwDK+KOcqoBQCOC3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970045; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=s7PZIm04ooSj6Ki8OsJLg23id0yLR39T0g3+u0vz1Wk=; b=hH2nQHb2G9Y//P9DBHzGNS0WlJgVLQLvcjsQE5tM0cX96cyC2HWBUonnBTXDJc3MmyLZiOY2EEGwlDMR8yNkC9tq97CRWl9aJMAKOcfjx3rj6dA18Ajkg0qrwYkYNflx3rhBPoi7qeNTeJkV9wz6+8eiLqCFvexi4X0fxMLAvTE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970045018221.79594190728255; Wed, 19 Apr 2023 22:54:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9p-00079D-BA; Thu, 20 Apr 2023 01:48:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9a-00076c-GU for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:25 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9Z-0001E1-0b for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:22 -0400 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-518d325b8a2so588339a12.0 for ; Wed, 19 Apr 2023 22:48:20 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969699; x=1684561699; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s7PZIm04ooSj6Ki8OsJLg23id0yLR39T0g3+u0vz1Wk=; b=v5uf2qz0fbZQH1bXbYuRR0/7qUd+I2kGFP4zAPhT8ZC6A7UicQXZMf2F12zz/2Fg5P XPOU60r8lrEuwgAHToruyddC/cOujorO9YBxLL5HllPcEBPlr7qPgOD5x7xADptMSzVy ZNJbtpfg/dHZIA1NlYT+7Kl1PeOMnYgnoI3ikeCo2vtCb9FlF1WWi2Q+mjHMkMoY3SZk ACeNAgirSfbHK8tG8DORkt5P4X52PD2SkSQOsyoNM0pX9AhqfXbG78CoB5L0SxYePNOD mJBzrAuNBsvW4A8KsYa+wxSghHvftPJsQfMLeLiBw2vpu8JUttYwhrqPgMLC8Ndna6kC ISsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969699; x=1684561699; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s7PZIm04ooSj6Ki8OsJLg23id0yLR39T0g3+u0vz1Wk=; b=j7YRUIjqoQfH6SpyBImyls+JsHRYwXGhmKhquU6qwOzyCI1f5+qbmiFcSEcfzNrTjb ioVciBe9lOfGKfKsPwl83egbItVZnllKrX8bvOc29IjP2aSgvdeDGjhntSfVEY37kzgO 0okhKZ7EOMBchJnwEZvUoL9Ri/viMcDqk0a7B28NzGSlFfA73deTYZDGG5VLk4dbEn+S kOh6JSvK4mr/8YI+WJyvST07vZacf/0h3nOWF379ZJ+V9jvutuIM8euPHrvmD9pM92JV nEq3pqFAIUaMK+qBmYjjnKo4ERCzyzHb8+I2J5Hf5dn0F0RZwjLv9J1FnBTIg0xhLIjk zBGQ== X-Gm-Message-State: AAQBX9eOw2B99EliN6VpHGfsumJYylIWi/JMDcQINbT7of+Lq6byt+5d UCi8v1bPrnVL7URMBf+/Sq/a+A== X-Google-Smtp-Source: AKy350arh2GriEDXnYlE0YHBy8hppaZFS56gwe/aMfLLql0TSUXSfzZ7haWWwlVVQ3s0KZR2Zlgu2A== X-Received: by 2002:a17:90a:2a03:b0:249:86bd:42a7 with SMTP id i3-20020a17090a2a0300b0024986bd42a7mr450105pjd.42.1681969699430; Wed, 19 Apr 2023 22:48:19 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 12/41] hw/net/net_tx_pkt: Remove net_rx_pkt_get_l4_info Date: Thu, 20 Apr 2023 14:46:28 +0900 Message-Id: <20230420054657.50367-13-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::536; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x536.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970051791100020 Content-Type: text/plain; charset="utf-8" This function is not used. Signed-off-by: Akihiko Odaki --- hw/net/net_rx_pkt.h | 9 --------- hw/net/net_rx_pkt.c | 5 ----- 2 files changed, 14 deletions(-) diff --git a/hw/net/net_rx_pkt.h b/hw/net/net_rx_pkt.h index a06f5c2675..ce8dbdb284 100644 --- a/hw/net/net_rx_pkt.h +++ b/hw/net/net_rx_pkt.h @@ -119,15 +119,6 @@ eth_ip6_hdr_info *net_rx_pkt_get_ip6_info(struct NetRx= Pkt *pkt); */ eth_ip4_hdr_info *net_rx_pkt_get_ip4_info(struct NetRxPkt *pkt); =20 -/** - * fetches L4 header analysis results - * - * Return: pointer to analysis results structure which is stored in inter= nal - * packet area. - * - */ -eth_l4_hdr_info *net_rx_pkt_get_l4_info(struct NetRxPkt *pkt); - typedef enum { NetPktRssIpV4, NetPktRssIpV4Tcp, diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c index 63be6e05ad..6125a063d7 100644 --- a/hw/net/net_rx_pkt.c +++ b/hw/net/net_rx_pkt.c @@ -236,11 +236,6 @@ eth_ip4_hdr_info *net_rx_pkt_get_ip4_info(struct NetRx= Pkt *pkt) return &pkt->ip4hdr_info; } =20 -eth_l4_hdr_info *net_rx_pkt_get_l4_info(struct NetRxPkt *pkt) -{ - return &pkt->l4hdr_info; -} - static inline void _net_rx_rss_add_chunk(uint8_t *rss_input, size_t *bytes_written, void *ptr, size_t size) --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969756; cv=none; d=zohomail.com; s=zohoarc; b=hX7bkmD3jgsUrcOlkGLZm6pT3FyNVcQD71eDivcJnorpoe/ymLySkb/J7vHkjhq4Aelx6SqkG9MpfTuM16LlwaBGi/oPgdKxScn5PVtjIOFDUeQgs87atB9FaZYbuhb+Nx2JF5FkUJ3GUpnNMQ9DwvVZ6FEw/68bgvJ8yTWSbZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969756; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=9NH/ll5GymINE+o67jVPDPh88ENZTXN2KmByhXu2lJk=; b=G17/YPJbQ2M5LozUfWo6CfWRZqRSApCnQN/Y9GUOAtdz2r5wQWF2VE+3pHPGFVOaD/bIL4IMFzSTqvS3ez891DUqR22P7EQTIwAPzbbTFQ9mixAV4O+B6dJ9s3c4R03+fASoXvEO4+KdJQ+y20nTr+TA8U0xM1cVubCNcRbJ164= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969756628530.7324225765306; Wed, 19 Apr 2023 22:49:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9w-0007an-7R; Thu, 20 Apr 2023 01:48:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9e-00077Z-9G for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:29 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9c-0001Eh-8f for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:26 -0400 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-51b6d0b9430so435126a12.2 for ; Wed, 19 Apr 2023 22:48:23 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969703; x=1684561703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9NH/ll5GymINE+o67jVPDPh88ENZTXN2KmByhXu2lJk=; b=gahnLMAWOp43nj6qrQPYbU9B6LR093xJyIqyVu5hr1DfhKFTKRxp/RTMPxAZ3EBN3T 9r8X34o0da4+tqDQLKJCPkNWkTQXvgH9wT/i5fKTMGeo+1OjCe+1VaLnJxCZ70gLvNbg jswl0xI+fAVvVxx694f0wgAj+oL9hHBIB3awYeHn09rYq98isrSm0iyNKZiptLQsTJsD peUYl55EJzI5ffPIy245JKkOgQakvuw/vnvrAkJuswODFFAf6fayA6EOZDRWZOOPzJYv HNWGFRdwZBAeLzbviH5eJ7PIgXb6l2PI1OpuY9/1TBHjx5qojAEYkZMWwVMh4Vq9bkcS 5NRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969703; x=1684561703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9NH/ll5GymINE+o67jVPDPh88ENZTXN2KmByhXu2lJk=; b=JDnbLrCBx3XabFDOKMaBR9jhpAxMXWGirgqZdxP3JD8dISigJjFCALaXgekL7vK7x7 /GHX4cq5a4hRvPdyPUBZMUM3kkVjKePYQgLVaBDXOTGbCyvb9g50SOTwoikY8forsK/j ug2VuL/ZsjRQvakd0XmLLaxeQKmXV/fWpWfL/dlI1mDrj0Xyb0mwxwmJFCJ8st8rk7lA 9CvMWTc3mucUyd3FwSFdMkehpft8OtmMdARJggo5MDkrX7/Z7GGJMwYPbZmoXiw225Jv yhx7S2jkGLEvuSJz85NEHRKuwVVepT8a/h0B6L73Hk32zfKhXZKObdUqopBSDPAP+ZbO 2lbA== X-Gm-Message-State: AAQBX9ckm0n+m2eajik/HIhjkpSEzWllOKHTHU+SVuNEh99BiG0otD6T BVaf6riSoCMyLJg/UfdamK+9dQ== X-Google-Smtp-Source: AKy350boph9iAet2YIx7+uhgZJlfIJtAzgHy53RoUKqiLfn0uFo5ejeOhisxmnTL9tIYtW+E1aJBWw== X-Received: by 2002:a17:903:32d1:b0:1a6:dc1f:6230 with SMTP id i17-20020a17090332d100b001a6dc1f6230mr415591plr.55.1681969702881; Wed, 19 Apr 2023 22:48:22 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 13/41] net/eth: Rename eth_setup_vlan_headers_ex Date: Thu, 20 Apr 2023 14:46:29 +0900 Message-Id: <20230420054657.50367-14-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::530; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x530.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969756966100003 Content-Type: text/plain; charset="utf-8" The old eth_setup_vlan_headers has no user so remove it and rename eth_setup_vlan_headers_ex. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/net/eth.h | 9 +-------- hw/net/net_tx_pkt.c | 2 +- net/eth.c | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/include/net/eth.h b/include/net/eth.h index 9f19c3a695..e8af5742be 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -351,16 +351,9 @@ eth_strip_vlan_ex(const struct iovec *iov, int iovcnt,= size_t iovoff, uint16_t eth_get_l3_proto(const struct iovec *l2hdr_iov, int iovcnt, size_t l2hdr_l= en); =20 -void eth_setup_vlan_headers_ex(struct eth_header *ehdr, uint16_t vlan_tag, +void eth_setup_vlan_headers(struct eth_header *ehdr, uint16_t vlan_tag, uint16_t vlan_ethtype, bool *is_new); =20 -static inline void -eth_setup_vlan_headers(struct eth_header *ehdr, uint16_t vlan_tag, - bool *is_new) -{ - eth_setup_vlan_headers_ex(ehdr, vlan_tag, ETH_P_VLAN, is_new); -} - =20 uint8_t eth_get_gso_type(uint16_t l3_proto, uint8_t *l3_hdr, uint8_t l4pro= to); =20 diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index cc36750c9b..ce6b102391 100644 --- a/hw/net/net_tx_pkt.c +++ b/hw/net/net_tx_pkt.c @@ -368,7 +368,7 @@ void net_tx_pkt_setup_vlan_header_ex(struct NetTxPkt *p= kt, bool is_new; assert(pkt); =20 - eth_setup_vlan_headers_ex(pkt->vec[NET_TX_PKT_L2HDR_FRAG].iov_base, + eth_setup_vlan_headers(pkt->vec[NET_TX_PKT_L2HDR_FRAG].iov_base, vlan, vlan_ethtype, &is_new); =20 /* update l2hdrlen */ diff --git a/net/eth.c b/net/eth.c index d7b30df79f..b6ff89c460 100644 --- a/net/eth.c +++ b/net/eth.c @@ -21,7 +21,7 @@ #include "net/checksum.h" #include "net/tap.h" =20 -void eth_setup_vlan_headers_ex(struct eth_header *ehdr, uint16_t vlan_tag, +void eth_setup_vlan_headers(struct eth_header *ehdr, uint16_t vlan_tag, uint16_t vlan_ethtype, bool *is_new) { struct vlan_header *vhdr =3D PKT_GET_VLAN_HDR(ehdr); --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969899; cv=none; d=zohomail.com; s=zohoarc; b=e4lrP0udBJ9W0qxhmGQowKZk9aPkw2S7LjkIdPoKrpm2b4udhZUweQemsOeIie679Z2SMW1Hn1Qkdw+jX6PFMMqiBUACBfIEDfTtNP/oiTTFjen3r/PUbTFHXr5LqNXsXvgkWLyXRyVei5v8JrlBpaIRdhEbcw0jyNocpQLRbeU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969899; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=Tl9f92216yqdyz0w94GLX0DDUZ9ja9a0/OMVZzQGksE=; b=Gu3p7XoJeyn0nuFRYQIdjv/9ar2oOP8kXyZY3eZdzS1DGTlBDufXNSDaC26bsSf3oTbGQE04QMbXWtYzi+044GjZSllq+dmyGx2yKEWGb1XjlTBPDqnFFdcjhvgxWSU30ny/iM5yCDNS3vLb6JCt0yMqmlvt/j5+EZZxCKuHsvE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969899346327.330624272927; Wed, 19 Apr 2023 22:51:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9u-0007Us-O1; Thu, 20 Apr 2023 01:48:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9j-00078q-PT for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:33 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9g-0001Fi-32 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:30 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2468495aad8so361372a91.3 for ; Wed, 19 Apr 2023 22:48:27 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969706; x=1684561706; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Tl9f92216yqdyz0w94GLX0DDUZ9ja9a0/OMVZzQGksE=; b=Z0W1Wg092qP6fGq/EaCiMr6RNisgGsE7FbYpBTVT33BQ4SFuxRX0wboApaeJpp+BBf NwVuzISQlf3PRYzch9IBe98F6NFrMKKS6EMfRdUb1Ec4HLlLW7fVvDuuxaF8ohXHvSJ2 rvVtKRgoWlYGlI3wowMcOE9LNZTcFAQktX/D+PuZbleWgOTjEZm/LKxPPXt7dDDQMGkk y/dZTkQVbXnYcEsk6kYb4U5n2q3tEZ48cZoMHOIePmTD9ze3L8sftZC+gSUrWrHaN71E dao6NjU3zFrp4eNzUBdLNdYN23Fl6vFl2mAS/OAGjerWGDqUuIrkADU4E9Dl5Bg/WRie Exbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969706; x=1684561706; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tl9f92216yqdyz0w94GLX0DDUZ9ja9a0/OMVZzQGksE=; b=SDYdVnIq/dzeAPKxIZtv5kf16sWajjwUeH24Q+AOiyzAw55/Nir5xTkw+sVMrWyzWq b6eO40eCpu7m9ADpnKkUWbMppS4p6mO9h7A0w0xNfUOwCBg3HmdaOat4ruJ8eIB/gJNy Y3E6UxA/BvLAmiToZS0dOhRqMRsETFXOjXZOPKzJi7DIgeq4n5iT+sRI2zkKEZnu5AjH fMQGrr3UEXrsLFJxBjdK6WYztF5rQRYLbWQYXvUtWoFpRWe4j+kUZzyaHJUHNNiDm5ow dfUDkxNTRjqIuPsEhpu4+yad7EoAtbQrZgaGNmfGR8vuHNNMpvARA6NhytVwIuu4m4l5 JFVQ== X-Gm-Message-State: AAQBX9f/rR4RGFPlJ3UrSgWcKy89E2FH0+35gHkPi4tA+OJC3sB7ulZ9 1o3534ZXe5NBHB4EU11/KAAJcQ== X-Google-Smtp-Source: AKy350a66LokQ2yJn8sEHsj52dbJ34+JdJWjbD65ilf5d6PSD+zjNbRH6z1xB7QwfmwuhBsSbjsAhw== X-Received: by 2002:a17:90b:3841:b0:247:2671:ca43 with SMTP id nl1-20020a17090b384100b002472671ca43mr511523pjb.36.1681969706378; Wed, 19 Apr 2023 22:48:26 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 14/41] e1000x: Share more Rx filtering logic Date: Thu, 20 Apr 2023 14:46:30 +0900 Message-Id: <20230420054657.50367-15-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::1032; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1032.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969900480100006 Content-Type: text/plain; charset="utf-8" This saves some code and enables tracepoint for e1000's VLAN filtering. Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- hw/net/e1000x_common.h | 4 +++- hw/net/e1000.c | 35 +++++-------------------------- hw/net/e1000e_core.c | 47 +++++------------------------------------- hw/net/e1000x_common.c | 44 +++++++++++++++++++++++++++++++++------ hw/net/igb_core.c | 41 +++--------------------------------- hw/net/trace-events | 4 ++-- 6 files changed, 56 insertions(+), 119 deletions(-) diff --git a/hw/net/e1000x_common.h b/hw/net/e1000x_common.h index 0298e06283..be291684de 100644 --- a/hw/net/e1000x_common.h +++ b/hw/net/e1000x_common.h @@ -107,7 +107,9 @@ bool e1000x_rx_ready(PCIDevice *d, uint32_t *mac); =20 bool e1000x_is_vlan_packet(const void *buf, uint16_t vet); =20 -bool e1000x_rx_group_filter(uint32_t *mac, const uint8_t *buf); +bool e1000x_rx_vlan_filter(uint32_t *mac, const struct vlan_header *vhdr); + +bool e1000x_rx_group_filter(uint32_t *mac, const struct eth_header *ehdr); =20 bool e1000x_hw_rx_enabled(uint32_t *mac); =20 diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 18eb6d8876..aae5f0bdc0 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -804,36 +804,11 @@ start_xmit(E1000State *s) } =20 static int -receive_filter(E1000State *s, const uint8_t *buf, int size) +receive_filter(E1000State *s, const void *buf) { - uint32_t rctl =3D s->mac_reg[RCTL]; - int isbcast =3D is_broadcast_ether_addr(buf); - int ismcast =3D is_multicast_ether_addr(buf); - - if (e1000x_is_vlan_packet(buf, le16_to_cpu(s->mac_reg[VET])) && - e1000x_vlan_rx_filter_enabled(s->mac_reg)) { - uint16_t vid =3D lduw_be_p(&PKT_GET_VLAN_HDR(buf)->h_tci); - uint32_t vfta =3D - ldl_le_p((uint32_t *)(s->mac_reg + VFTA) + - ((vid >> E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_M= ASK)); - if ((vfta & (1 << (vid & E1000_VFTA_ENTRY_BIT_SHIFT_MASK))) =3D=3D= 0) { - return 0; - } - } - - if (!isbcast && !ismcast && (rctl & E1000_RCTL_UPE)) { /* promiscuous = ucast */ - return 1; - } - - if (ismcast && (rctl & E1000_RCTL_MPE)) { /* promiscuous mcas= t */ - return 1; - } - - if (isbcast && (rctl & E1000_RCTL_BAM)) { /* broadcast enable= d */ - return 1; - } - - return e1000x_rx_group_filter(s->mac_reg, buf); + return (!e1000x_is_vlan_packet(buf, s->mac_reg[VET]) || + e1000x_rx_vlan_filter(s->mac_reg, PKT_GET_VLAN_HDR(buf))) && + e1000x_rx_group_filter(s->mac_reg, buf); } =20 static void @@ -949,7 +924,7 @@ e1000_receive_iov(NetClientState *nc, const struct iove= c *iov, int iovcnt) return size; } =20 - if (!receive_filter(s, filter_buf, size)) { + if (!receive_filter(s, filter_buf)) { return size; } =20 diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index f3335194d8..743b36ddfb 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1034,48 +1034,11 @@ e1000e_rx_l4_cso_enabled(E1000ECore *core) } =20 static bool -e1000e_receive_filter(E1000ECore *core, const uint8_t *buf, int size) +e1000e_receive_filter(E1000ECore *core, const void *buf) { - uint32_t rctl =3D core->mac[RCTL]; - - if (e1000x_is_vlan_packet(buf, core->mac[VET]) && - e1000x_vlan_rx_filter_enabled(core->mac)) { - uint16_t vid =3D lduw_be_p(&PKT_GET_VLAN_HDR(buf)->h_tci); - uint32_t vfta =3D - ldl_le_p((uint32_t *)(core->mac + VFTA) + - ((vid >> E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_M= ASK)); - if ((vfta & (1 << (vid & E1000_VFTA_ENTRY_BIT_SHIFT_MASK))) =3D=3D= 0) { - trace_e1000e_rx_flt_vlan_mismatch(vid); - return false; - } else { - trace_e1000e_rx_flt_vlan_match(vid); - } - } - - switch (net_rx_pkt_get_packet_type(core->rx_pkt)) { - case ETH_PKT_UCAST: - if (rctl & E1000_RCTL_UPE) { - return true; /* promiscuous ucast */ - } - break; - - case ETH_PKT_BCAST: - if (rctl & E1000_RCTL_BAM) { - return true; /* broadcast enabled */ - } - break; - - case ETH_PKT_MCAST: - if (rctl & E1000_RCTL_MPE) { - return true; /* promiscuous mcast */ - } - break; - - default: - g_assert_not_reached(); - } - - return e1000x_rx_group_filter(core->mac, buf); + return (!e1000x_is_vlan_packet(buf, core->mac[VET]) || + e1000x_rx_vlan_filter(core->mac, PKT_GET_VLAN_HDR(buf))) && + e1000x_rx_group_filter(core->mac, buf); } =20 static inline void @@ -1736,7 +1699,7 @@ e1000e_receive_internal(E1000ECore *core, const struc= t iovec *iov, int iovcnt, net_rx_pkt_set_packet_type(core->rx_pkt, get_eth_packet_type(PKT_GET_ETH_HDR(min_buf))); =20 - if (!e1000e_receive_filter(core, min_buf, size)) { + if (!e1000e_receive_filter(core, min_buf)) { trace_e1000e_rx_flt_dropped(); return orig_size; } diff --git a/hw/net/e1000x_common.c b/hw/net/e1000x_common.c index 7694673bcc..6cc23138a8 100644 --- a/hw/net/e1000x_common.c +++ b/hw/net/e1000x_common.c @@ -58,32 +58,64 @@ bool e1000x_is_vlan_packet(const void *buf, uint16_t ve= t) return res; } =20 -bool e1000x_rx_group_filter(uint32_t *mac, const uint8_t *buf) +bool e1000x_rx_vlan_filter(uint32_t *mac, const struct vlan_header *vhdr) +{ + if (e1000x_vlan_rx_filter_enabled(mac)) { + uint16_t vid =3D lduw_be_p(&vhdr->h_tci); + uint32_t vfta =3D + ldl_le_p((uint32_t *)(mac + VFTA) + + ((vid >> E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_M= ASK)); + if ((vfta & (1 << (vid & E1000_VFTA_ENTRY_BIT_SHIFT_MASK))) =3D=3D= 0) { + trace_e1000x_rx_flt_vlan_mismatch(vid); + return false; + } + + trace_e1000x_rx_flt_vlan_match(vid); + } + + return true; +} + +bool e1000x_rx_group_filter(uint32_t *mac, const struct eth_header *ehdr) { static const int mta_shift[] =3D { 4, 3, 2, 0 }; uint32_t f, ra[2], *rp, rctl =3D mac[RCTL]; =20 + if (is_broadcast_ether_addr(ehdr->h_dest)) { + if (rctl & E1000_RCTL_BAM) { + return true; + } + } else if (is_multicast_ether_addr(ehdr->h_dest)) { + if (rctl & E1000_RCTL_MPE) { + return true; + } + } else { + if (rctl & E1000_RCTL_UPE) { + return true; + } + } + for (rp =3D mac + RA; rp < mac + RA + 32; rp +=3D 2) { if (!(rp[1] & E1000_RAH_AV)) { continue; } ra[0] =3D cpu_to_le32(rp[0]); ra[1] =3D cpu_to_le32(rp[1]); - if (!memcmp(buf, (uint8_t *)ra, ETH_ALEN)) { + if (!memcmp(ehdr->h_dest, (uint8_t *)ra, ETH_ALEN)) { trace_e1000x_rx_flt_ucast_match((int)(rp - mac - RA) / 2, - MAC_ARG(buf)); + MAC_ARG(ehdr->h_dest)); return true; } } - trace_e1000x_rx_flt_ucast_mismatch(MAC_ARG(buf)); + trace_e1000x_rx_flt_ucast_mismatch(MAC_ARG(ehdr->h_dest)); =20 f =3D mta_shift[(rctl >> E1000_RCTL_MO_SHIFT) & 3]; - f =3D (((buf[5] << 8) | buf[4]) >> f) & 0xfff; + f =3D (((ehdr->h_dest[5] << 8) | ehdr->h_dest[4]) >> f) & 0xfff; if (mac[MTA + (f >> 5)] & (1 << (f & 0x1f))) { return true; } =20 - trace_e1000x_rx_flt_inexact_mismatch(MAC_ARG(buf), + trace_e1000x_rx_flt_inexact_mismatch(MAC_ARG(ehdr->h_dest), (rctl >> E1000_RCTL_MO_SHIFT) & 3, f >> 5, mac[MTA + (f >> 5)]); diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 72a00564cf..4b9131e566 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -976,7 +976,6 @@ static uint16_t igb_receive_assign(IGBCore *core, const= L2Header *l2_header, uint16_t queues =3D 0; uint16_t oversized =3D 0; uint16_t vid =3D be16_to_cpu(l2_header->vlan.h_tci) & VLAN_VID_MASK; - bool accepted =3D false; int i; =20 memset(rss_info, 0, sizeof(E1000E_RSSInfo)); @@ -986,16 +985,8 @@ static uint16_t igb_receive_assign(IGBCore *core, cons= t L2Header *l2_header, } =20 if (e1000x_is_vlan_packet(ehdr, core->mac[VET] & 0xffff) && - e1000x_vlan_rx_filter_enabled(core->mac)) { - uint32_t vfta =3D - ldl_le_p((uint32_t *)(core->mac + VFTA) + - ((vid >> E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_M= ASK)); - if ((vfta & (1 << (vid & E1000_VFTA_ENTRY_BIT_SHIFT_MASK))) =3D=3D= 0) { - trace_e1000e_rx_flt_vlan_mismatch(vid); - return queues; - } else { - trace_e1000e_rx_flt_vlan_match(vid); - } + !e1000x_rx_vlan_filter(core->mac, PKT_GET_VLAN_HDR(ehdr))) { + return queues; } =20 if (core->mac[MRQC] & 1) { @@ -1103,33 +1094,7 @@ static uint16_t igb_receive_assign(IGBCore *core, co= nst L2Header *l2_header, } } } else { - switch (net_rx_pkt_get_packet_type(core->rx_pkt)) { - case ETH_PKT_UCAST: - if (rctl & E1000_RCTL_UPE) { - accepted =3D true; /* promiscuous ucast */ - } - break; - - case ETH_PKT_BCAST: - if (rctl & E1000_RCTL_BAM) { - accepted =3D true; /* broadcast enabled */ - } - break; - - case ETH_PKT_MCAST: - if (rctl & E1000_RCTL_MPE) { - accepted =3D true; /* promiscuous mcast */ - } - break; - - default: - g_assert_not_reached(); - } - - if (!accepted) { - accepted =3D e1000x_rx_group_filter(core->mac, ehdr->h_dest); - } - + bool accepted =3D e1000x_rx_group_filter(core->mac, ehdr); if (!accepted) { for (macp =3D core->mac + RA2; macp < core->mac + RA2 + 16; ma= cp +=3D 2) { if (!(macp[1] & E1000_RAH_AV)) { diff --git a/hw/net/trace-events b/hw/net/trace-events index d35554fce8..a34d196ff7 100644 --- a/hw/net/trace-events +++ b/hw/net/trace-events @@ -106,6 +106,8 @@ e1000_receiver_overrun(size_t s, uint32_t rdh, uint32_t= rdt) "Receiver overrun: # e1000x_common.c e1000x_rx_can_recv_disabled(bool link_up, bool rx_enabled, bool pci_master= ) "link_up: %d, rx_enabled %d, pci_master %d" e1000x_vlan_is_vlan_pkt(bool is_vlan_pkt, uint16_t eth_proto, uint16_t vet= ) "Is VLAN packet: %d, ETH proto: 0x%X, VET: 0x%X" +e1000x_rx_flt_vlan_mismatch(uint16_t vid) "VID mismatch: 0x%X" +e1000x_rx_flt_vlan_match(uint16_t vid) "VID match: 0x%X" e1000x_rx_flt_ucast_match(uint32_t idx, uint8_t b0, uint8_t b1, uint8_t b2= , uint8_t b3, uint8_t b4, uint8_t b5) "unicast match[%d]: %02x:%02x:%02x:%0= 2x:%02x:%02x" e1000x_rx_flt_ucast_mismatch(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b= 3, uint8_t b4, uint8_t b5) "unicast mismatch: %02x:%02x:%02x:%02x:%02x:%02x" e1000x_rx_flt_inexact_mismatch(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t= b3, uint8_t b4, uint8_t b5, uint32_t mo, uint32_t mta, uint32_t mta_val) "= inexact mismatch: %02x:%02x:%02x:%02x:%02x:%02x MO %d MTA[%d] 0x%x" @@ -154,8 +156,6 @@ e1000e_rx_can_recv_rings_full(void) "Cannot receive: al= l rings are full" e1000e_rx_can_recv(void) "Can receive" e1000e_rx_has_buffers(int ridx, uint32_t free_desc, size_t total_size, uin= t32_t desc_buf_size) "ring #%d: free descr: %u, packet size %zu, descr buff= er size %u" e1000e_rx_null_descriptor(void) "Null RX descriptor!!" -e1000e_rx_flt_vlan_mismatch(uint16_t vid) "VID mismatch: 0x%X" -e1000e_rx_flt_vlan_match(uint16_t vid) "VID match: 0x%X" e1000e_rx_desc_ps_read(uint64_t a0, uint64_t a1, uint64_t a2, uint64_t a3)= "buffers: [0x%"PRIx64", 0x%"PRIx64", 0x%"PRIx64", 0x%"PRIx64"]" e1000e_rx_desc_ps_write(uint16_t a0, uint16_t a1, uint16_t a2, uint16_t a3= ) "bytes written: [%u, %u, %u, %u]" e1000e_rx_desc_buff_sizes(uint32_t b0, uint32_t b1, uint32_t b2, uint32_t = b3) "buffer sizes: [%u, %u, %u, %u]" --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970017; cv=none; d=zohomail.com; s=zohoarc; b=YJ5MU83yEvuPraSirjBLYyNbkpmYtM2CPB0KgUi3LqoziZrhd9yY4h/tN6WG4gcsTbjBPFIl7dQOSd896q9wvLQ2br1w5NrzZjQ3hMyTEKYhCTx095DJckIEMLBrATMj0G31N/As4Mn1sqmNZ4GOnkf8Y7tGPqTjRt9J9yvHcMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970017; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=rwy5rvMUqP3oelPjHxfIZcxpBNQc9ghPL/3JUmVe4oU=; b=hr2lPWxfAkVbpa2TStrEmMN7GbqHJMZdfRVseurcjUWmkVV7gc3HnASRxnXae73iiqBvTV5wtzF/WyIcJySPvBGaVy0xzeg2qb25Pd5qhz+9wIV3MGFrNHnGgjwE3N8Tm3JJSwgNlhbFKgFMd5gwrwX9MDPXlRFMK+cC1NRCs/I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16819700171901012.3856451953493; Wed, 19 Apr 2023 22:53:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9t-0007Na-2U; Thu, 20 Apr 2023 01:48:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9l-00078t-Ef for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:33 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9j-0001HJ-HL for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:32 -0400 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-246f856d751so422713a91.0 for ; Wed, 19 Apr 2023 22:48:30 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969710; x=1684561710; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rwy5rvMUqP3oelPjHxfIZcxpBNQc9ghPL/3JUmVe4oU=; b=z99POhVF1wAAkbCarreAxiBmsXtJoW6piDVE72G53O3UfHzCh28ssQG6cD4IcyyKPs mC1Yxk2RdiXRdMSyWNUVyNyujCVmuIfFB+HWjWotFDIlRCK79TYQJCwC+wCkyxt4ug5w PJqtVrLXvXBZb3372zb8nDel+mlvGDzYovkL4uTPn4FuEVII9+gsmqzKkcAybRkCrdk/ OqBFw1/FWRMV5t9vLGvzBPXNfcskP5p4GSFQpov1ufuq/gfF9dZaknLvLrpXGTFpiORr vEbc2yG95IOOZ+g/fZWeV+CW16FpWrzQXegbVjQLocVptHUFfT9n1I/vVnVu3EnbBUjn hCxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969710; x=1684561710; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rwy5rvMUqP3oelPjHxfIZcxpBNQc9ghPL/3JUmVe4oU=; b=g2VhqEiK+RoeOJUOnycQnrewZe7E+pnYbPjxVlrOaoJ4AKHVKP+WGXytgrlMarvQCA nhVlpg8FnVaRkXeeQUQssijD6Mv8/J6B9HqjtE03QJMvqMqkRFmf+FQtUX2zh+oYSbg5 g7U4Q/xREjEGIurwuY/mrKGC/dkTv/WxM9qn4ZbjbJ5kkTrpKv9JFOiuPba18Ip8lQcp 1HSwKflGsfbr5/89u3Vxu2hn4ltjK2bS7wwrQUnpGB4w9hTgAyvbuZ/p0p8FFQBurT93 NFl0kp/I6WGFecetkePIHBdA7fD2Xh0POsWXUzhJ3fBkuqvKSwjfGESVz2mAbZCvqKXJ iL3A== X-Gm-Message-State: AAQBX9clNk88D18zB/YPwwDu0PB2Wc+4zUSkot59i8YxyOIOgMrMJhV5 B29V/zNB0rJnNkLC1OiRbLgReA== X-Google-Smtp-Source: AKy350Y71wXpBixiHN//zuNJXObUNIEPzLgN3OformdI5Adw9143eDqsNcHWNDBz6FJ8Em1ldgYv5w== X-Received: by 2002:a17:90a:4547:b0:246:696f:b1f1 with SMTP id r7-20020a17090a454700b00246696fb1f1mr730830pjm.6.1681969709865; Wed, 19 Apr 2023 22:48:29 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 15/41] e1000x: Take CRC into consideration for size check Date: Thu, 20 Apr 2023 14:46:31 +0900 Message-Id: <20230420054657.50367-16-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::1034; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1034.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970017917100001 Content-Type: text/plain; charset="utf-8" Section 13.7.15 Receive Length Error Count says: > Packets over 1522 bytes are oversized if LongPacketEnable is 0b > (RCTL.LPE). If LongPacketEnable (LPE) is 1b, then an incoming packet > is considered oversized if it exceeds 16384 bytes. > These lengths are based on bytes in the received packet from > through , inclusively. As QEMU processes packets without CRC, the number of bytes for CRC need to be subtracted. This change adds some size definitions to be used to derive the new size thresholds to eth.h. Signed-off-by: Akihiko Odaki --- include/net/eth.h | 2 ++ hw/net/e1000x_common.c | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/net/eth.h b/include/net/eth.h index e8af5742be..05f56931e7 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -32,6 +32,8 @@ #define ETH_ALEN 6 #define ETH_HLEN 14 #define ETH_ZLEN 60 /* Min. octets in frame without FCS */ +#define ETH_FCS_LEN 4 +#define ETH_MTU 1500 =20 struct eth_header { uint8_t h_dest[ETH_ALEN]; /* destination eth addr */ diff --git a/hw/net/e1000x_common.c b/hw/net/e1000x_common.c index 6cc23138a8..212873fd77 100644 --- a/hw/net/e1000x_common.c +++ b/hw/net/e1000x_common.c @@ -140,16 +140,16 @@ bool e1000x_hw_rx_enabled(uint32_t *mac) =20 bool e1000x_is_oversized(uint32_t *mac, size_t size) { + size_t header_size =3D sizeof(struct eth_header) + sizeof(struct vlan_= header); /* this is the size past which hardware will drop packets when setting LPE=3D0 */ - static const int maximum_ethernet_vlan_size =3D 1522; + size_t maximum_short_size =3D header_size + ETH_MTU; /* this is the size past which hardware will drop packets when setting LPE=3D1 */ - static const int maximum_ethernet_lpe_size =3D 16 * KiB; + size_t maximum_large_size =3D 16 * KiB - ETH_FCS_LEN; =20 - if ((size > maximum_ethernet_lpe_size || - (size > maximum_ethernet_vlan_size - && !(mac[RCTL] & E1000_RCTL_LPE))) + if ((size > maximum_large_size || + (size > maximum_short_size && !(mac[RCTL] & E1000_RCTL_LPE))) && !(mac[RCTL] & E1000_RCTL_SBP)) { e1000x_inc_reg_if_not_full(mac, ROC); trace_e1000x_rx_oversized(size); --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970063; cv=none; d=zohomail.com; s=zohoarc; b=jeBJTiNIgPskOEh/HvjxcRm7z9k4QyqZtqa6gUpjCa1qnBlNUBbXEdaisok5LbqJHCmCFxqbkptXCdT4XvV2JrmBIGewHMz/jL020tBH6/JEJ+I1ZT8FMQYMdVkJOiPeLQUEY/3vxjWNyp/KiOGHpaL6aOq8AwjKdHizm5yIHMs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970063; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=ZzMYVPOHwBXyLt8U0v8KjlVgvUCA6OmXyQHXHv1DCkc=; b=gwqHJhK60m0dAjSafMBWj8tbVrmPCh9W4NMjzblHX3TusfyBAl6kN4XUM3k03uaPqw/LLxQsG/B4pojPhASB076fSXz6fOhUnO9b4TIbPnZLe18+12ufJR1tWQYQh+YOpfRETcohgj9T0qvjr+nTpUrFb1Itqiwdgfi8n5uJVzw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970063760158.2478125114302; Wed, 19 Apr 2023 22:54:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9s-0007Kg-JG; Thu, 20 Apr 2023 01:48:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9o-00079q-Ex for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:37 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9m-0001Hx-MQ for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:36 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-517c57386f6so391211a12.2 for ; Wed, 19 Apr 2023 22:48:34 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969713; x=1684561713; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZzMYVPOHwBXyLt8U0v8KjlVgvUCA6OmXyQHXHv1DCkc=; b=0QvvJVA5sqmAF7xvVz+sG8RODJcHnfrUqB4J7j8+8pv6UjNnd54z9J4vl3ermbla11 ZRxAUJCAngBPs8K9Ohkt8oD2rYl1/Rmi5noo6gmlUC2vYLxq+uH3JGJqBvSlgy+mESXR QdKjuLsYowxCQFjimurCnMELZ/yfdPV9bf79Nd3/rxIobvfCVmGv5yESB7lFZlOu8x1H ZENfy/1yRK/HccycsSC9/Xjpj5sE+7UEaxaLxdyW4JAmu/CPWIyswWaNKrNBK61bPgXV h6Y3ZBdQaAivnohMLVZxCl3Il6XkKgFimngSeBUXWDpr/LyAljsfNm+8Kd/RjxZ5Nueq QU7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969713; x=1684561713; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZzMYVPOHwBXyLt8U0v8KjlVgvUCA6OmXyQHXHv1DCkc=; b=XMgb4jIaeIqufTWTKjQWNQYfP/9P9ef6s/gXo+boRrnQr1CT8tnzyr/7uAEB5n+nAB CMvyWmQExFwovp4APsqkGYrYuVodiie5h3fCOrnoeuvb+73h28gFHlDpOCXU5xH7W09Q qN1xnWcdPR1ltt2bXjNdPFutjwwNdg5F8kgsqUMXkPAzT5Kxw/0JiTQ3bdLsyI3w22vR 3BO4l70K8zGezNVr/um0Tt4+KN0/TmtDqWQLMs/qgOSqYJUfq2LFU+Xt+QIzz1NmjCTt CANtUkSAA6PylKestmT+o0rSwASXNfchmq3pRZn6IjsYdtYyPgQ3CQRWh4iQpLAqA4A2 lcUQ== X-Gm-Message-State: AAQBX9fe8pax6pW26WzXn97Vkfx99XkFtahVNO4Cff/tENnNr7rVtk0s kk5wvlc5GwM1h/7A3IMLpzLtUA== X-Google-Smtp-Source: AKy350YE2tLFpar55Ep8gsqg7g+dR+pClrFCWv5LEd6eGYFesDvj/VGbswUkLfBqE6+u00H6lLSB5A== X-Received: by 2002:a17:90b:143:b0:247:ad6d:7250 with SMTP id em3-20020a17090b014300b00247ad6d7250mr841567pjb.12.1681969713555; Wed, 19 Apr 2023 22:48:33 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 16/41] e1000x: Rename TcpIpv6 into TcpIpv6Ex Date: Thu, 20 Apr 2023 14:46:32 +0900 Message-Id: <20230420054657.50367-17-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::534; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x534.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970064234100005 Content-Type: text/plain; charset="utf-8" e1000e and igb employs NetPktRssIpV6TcpEx for RSS hash if TcpIpv6 MRQC bit is set. Moreover, igb also has a MRQC bit for NetPktRssIpV6Tcp though it is not implemented yet. Rename it to TcpIpv6Ex to avoid confusion. Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- hw/net/e1000x_regs.h | 24 ++++++++++++------------ hw/net/e1000e_core.c | 8 ++++---- hw/net/igb_core.c | 8 ++++---- hw/net/trace-events | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/hw/net/e1000x_regs.h b/hw/net/e1000x_regs.h index 6d3c4c6d3a..13760c66d3 100644 --- a/hw/net/e1000x_regs.h +++ b/hw/net/e1000x_regs.h @@ -290,18 +290,18 @@ #define E1000_RETA_IDX(hash) ((hash) & (BIT(7) - 1)) #define E1000_RETA_VAL(reta, hash) (((uint8_t *)(reta))[E1000_RETA_IDX(ha= sh)]) =20 -#define E1000_MRQC_EN_TCPIPV4(mrqc) ((mrqc) & BIT(16)) -#define E1000_MRQC_EN_IPV4(mrqc) ((mrqc) & BIT(17)) -#define E1000_MRQC_EN_TCPIPV6(mrqc) ((mrqc) & BIT(18)) -#define E1000_MRQC_EN_IPV6EX(mrqc) ((mrqc) & BIT(19)) -#define E1000_MRQC_EN_IPV6(mrqc) ((mrqc) & BIT(20)) - -#define E1000_MRQ_RSS_TYPE_NONE (0) -#define E1000_MRQ_RSS_TYPE_IPV4TCP (1) -#define E1000_MRQ_RSS_TYPE_IPV4 (2) -#define E1000_MRQ_RSS_TYPE_IPV6TCP (3) -#define E1000_MRQ_RSS_TYPE_IPV6EX (4) -#define E1000_MRQ_RSS_TYPE_IPV6 (5) +#define E1000_MRQC_EN_TCPIPV4(mrqc) ((mrqc) & BIT(16)) +#define E1000_MRQC_EN_IPV4(mrqc) ((mrqc) & BIT(17)) +#define E1000_MRQC_EN_TCPIPV6EX(mrqc) ((mrqc) & BIT(18)) +#define E1000_MRQC_EN_IPV6EX(mrqc) ((mrqc) & BIT(19)) +#define E1000_MRQC_EN_IPV6(mrqc) ((mrqc) & BIT(20)) + +#define E1000_MRQ_RSS_TYPE_NONE (0) +#define E1000_MRQ_RSS_TYPE_IPV4TCP (1) +#define E1000_MRQ_RSS_TYPE_IPV4 (2) +#define E1000_MRQ_RSS_TYPE_IPV6TCPEX (3) +#define E1000_MRQ_RSS_TYPE_IPV6EX (4) +#define E1000_MRQ_RSS_TYPE_IPV6 (5) =20 #define E1000_ICR_ASSERTED BIT(31) #define E1000_EIAC_MASK 0x01F00000 diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 743b36ddfb..481db41931 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -537,7 +537,7 @@ e1000e_rss_get_hash_type(E1000ECore *core, struct NetRx= Pkt *pkt) ip6info->rss_ex_dst_valid, ip6info->rss_ex_src_valid, core->mac[MRQC], - E1000_MRQC_EN_TCPIPV6(core->mac[MRQC]), + E1000_MRQC_EN_TCPIPV6EX(core->mac[MRQC]), E1000_MRQC_EN_IPV6EX(core->mac[MRQC]), E1000_MRQC_EN_IPV6(core->mac[MRQC])); =20 @@ -546,8 +546,8 @@ e1000e_rss_get_hash_type(E1000ECore *core, struct NetRx= Pkt *pkt) ip6info->rss_ex_src_valid))) { =20 if (l4hdr_proto =3D=3D ETH_L4_HDR_PROTO_TCP && - E1000_MRQC_EN_TCPIPV6(core->mac[MRQC])) { - return E1000_MRQ_RSS_TYPE_IPV6TCP; + E1000_MRQC_EN_TCPIPV6EX(core->mac[MRQC])) { + return E1000_MRQ_RSS_TYPE_IPV6TCPEX; } =20 if (E1000_MRQC_EN_IPV6EX(core->mac[MRQC])) { @@ -581,7 +581,7 @@ e1000e_rss_calc_hash(E1000ECore *core, case E1000_MRQ_RSS_TYPE_IPV4TCP: type =3D NetPktRssIpV4Tcp; break; - case E1000_MRQ_RSS_TYPE_IPV6TCP: + case E1000_MRQ_RSS_TYPE_IPV6TCPEX: type =3D NetPktRssIpV6TcpEx; break; case E1000_MRQ_RSS_TYPE_IPV6: diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 4b9131e566..0182880adf 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -301,7 +301,7 @@ igb_rss_get_hash_type(IGBCore *core, struct NetRxPkt *p= kt) ip6info->rss_ex_dst_valid, ip6info->rss_ex_src_valid, core->mac[MRQC], - E1000_MRQC_EN_TCPIPV6(core->mac[MRQC]), + E1000_MRQC_EN_TCPIPV6EX(core->mac[MRQC]), E1000_MRQC_EN_IPV6EX(core->mac[MRQC]), E1000_MRQC_EN_IPV6(core->mac[MRQC])); =20 @@ -310,8 +310,8 @@ igb_rss_get_hash_type(IGBCore *core, struct NetRxPkt *p= kt) ip6info->rss_ex_src_valid))) { =20 if (l4hdr_proto =3D=3D ETH_L4_HDR_PROTO_TCP && - E1000_MRQC_EN_TCPIPV6(core->mac[MRQC])) { - return E1000_MRQ_RSS_TYPE_IPV6TCP; + E1000_MRQC_EN_TCPIPV6EX(core->mac[MRQC])) { + return E1000_MRQ_RSS_TYPE_IPV6TCPEX; } =20 if (E1000_MRQC_EN_IPV6EX(core->mac[MRQC])) { @@ -343,7 +343,7 @@ igb_rss_calc_hash(IGBCore *core, struct NetRxPkt *pkt, = E1000E_RSSInfo *info) case E1000_MRQ_RSS_TYPE_IPV4TCP: type =3D NetPktRssIpV4Tcp; break; - case E1000_MRQ_RSS_TYPE_IPV6TCP: + case E1000_MRQ_RSS_TYPE_IPV6TCPEX: type =3D NetPktRssIpV6TcpEx; break; case E1000_MRQ_RSS_TYPE_IPV6: diff --git a/hw/net/trace-events b/hw/net/trace-events index a34d196ff7..64d776bc2a 100644 --- a/hw/net/trace-events +++ b/hw/net/trace-events @@ -179,7 +179,7 @@ e1000e_rx_rss_disabled(void) "RSS is disabled" e1000e_rx_rss_type(uint32_t type) "RSS type is %u" e1000e_rx_rss_ip4(int l4hdr_proto, uint32_t mrqc, bool tcpipv4_enabled, bo= ol ipv4_enabled) "RSS IPv4: L4 header protocol %d, mrqc 0x%X, tcpipv4 enabl= ed %d, ipv4 enabled %d" e1000e_rx_rss_ip6_rfctl(uint32_t rfctl) "RSS IPv6: rfctl 0x%X" -e1000e_rx_rss_ip6(bool ex_dis, bool new_ex_dis, int l4hdr_proto, bool has_= ext_headers, bool ex_dst_valid, bool ex_src_valid, uint32_t mrqc, bool tcpi= pv6_enabled, bool ipv6ex_enabled, bool ipv6_enabled) "RSS IPv6: ex_dis: %d,= new_ex_dis: %d, L4 header protocol %d, has_ext_headers %d, ex_dst_valid %d= , ex_src_valid %d, mrqc 0x%X, tcpipv6 enabled %d, ipv6ex enabled %d, ipv6 e= nabled %d" +e1000e_rx_rss_ip6(bool ex_dis, bool new_ex_dis, int l4hdr_proto, bool has_= ext_headers, bool ex_dst_valid, bool ex_src_valid, uint32_t mrqc, bool tcpi= pv6ex_enabled, bool ipv6ex_enabled, bool ipv6_enabled) "RSS IPv6: ex_dis: %= d, new_ex_dis: %d, L4 header protocol %d, has_ext_headers %d, ex_dst_valid = %d, ex_src_valid %d, mrqc 0x%X, tcpipv6ex enabled %d, ipv6ex enabled %d, ip= v6 enabled %d" =20 e1000e_rx_metadata_protocols(bool hasip4, bool hasip6, int l4hdr_protocol)= "protocols: ip4: %d, ip6: %d, l4hdr: %d" e1000e_rx_metadata_vlan(uint16_t vlan_tag) "VLAN tag is 0x%X" --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969796; cv=none; d=zohomail.com; s=zohoarc; b=RqhCCj3fZ1G0QtwV2fziXX6w3IU8DqxICrXxLrYobmFhjBnF7U9RCHoqCUvh8+waZEDdXuiRVRhZXaMROB8XsHwuyYubLWf1ly1zMKyg/52WONnajyUG7bOXX0fx+Uebkr2SpFTVXu7WD5HFFHgDoOHdHoMJ8/RV1KoimeI/BcM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969796; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=NKrjZcc5spW3PcfEcfPF1xgA9c/5G8C/80+pcYNs6X0=; b=bk/R/l/NOVwZmy7AMgSuiTM4RrbVX5unnQx7lhOcojKB3EQrbb6vbJfwMkQYgXdqGbnBYaF/Ij+f4w9MNvZweqq/g/u4+R8S74x3cPg9jW1lqTdipJ297JNrN0QSfNJjv9vDvhCmx2RJ85PDZXU/vIjSlGQ3uSxIXJZf+RMgc9Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969796231360.0696721029252; Wed, 19 Apr 2023 22:49:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9u-0007Sq-Ed; Thu, 20 Apr 2023 01:48:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9r-0007FR-Jf for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:39 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9q-0001Il-1e for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:39 -0400 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-52160f75920so440721a12.2 for ; Wed, 19 Apr 2023 22:48:37 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969717; x=1684561717; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NKrjZcc5spW3PcfEcfPF1xgA9c/5G8C/80+pcYNs6X0=; b=L2fVtS0zUOeazrYTqMoYyr3BXMRAUAOn/CanYTqzJY0BP797ijcIL9SVArZ9Ilz+5o rehloz3PyDU65O1A/otdpy117AZ+r2QT6cxlHS6NFjsD5tQ/BV+CvNHlYUUg8cfTXk6Z s38EMdNiJ0HgaYTr5SZhkect+OG/+CP1AVCzZcd/97T1lDJog8eB90WlV4+v06v4KjQs 36q7x+U1hHiTMTtknwqxZFkSEQy357p0AzmBs2t8/aRAObq+nQJobpT9U8ZmKhlFSNnU BFPCJShquKuw2+hRRrQZHrfL8Y1CgxojxAMCxYcGzvIqCO9knhAqjTdBTczixRAS6X2r N6tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969717; x=1684561717; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NKrjZcc5spW3PcfEcfPF1xgA9c/5G8C/80+pcYNs6X0=; b=h2i3YnLy7A5VypVpCTnAItMzK2MKPokSr8AfxGe36V7Az2fs7XTE2XUlJS+QEMOMou HKZSFmKSTNL19PhidlmJGC/QpDVJ3p8eT/CqhVkGpZVHLto6b64wFmWSA1T1hX0SIlRq C/Cx1CMahvlYfbivcjpXBooZxzxK4tkiBAvAdwp75Khw3L9e/qCiNzanW6UPg8uzSkPR 9pYnIn6kZoqXSYogEDrkZiMVJmc31ljGlKSA/J9YPjs7P8xXbS90BXj3DDtMoiBx1dSf z+dzKRsitum9oivH5nLyxl12JvkMArTxa1hH2xbcadvcH3HsEcC9R/6O3mIwX45pm7d8 KQOg== X-Gm-Message-State: AAQBX9e1PrUaTEzWMeA8jo/bThe4tdlfU2AObSslomnaXX++Ey1xDceu X/gw8czYDsoIElUdNbPT8tjeWw== X-Google-Smtp-Source: AKy350at1Ov41HTiRigYkkSEHikHZI9He9JK5R0eyyVdGPuUMGAS5j+GhHKt02aLvdEnvNJzwPAc1w== X-Received: by 2002:a17:90b:38c4:b0:23f:6830:568e with SMTP id nn4-20020a17090b38c400b0023f6830568emr623996pjb.8.1681969716966; Wed, 19 Apr 2023 22:48:36 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 17/41] e1000e: Always log status after building rx metadata Date: Thu, 20 Apr 2023 14:46:33 +0900 Message-Id: <20230420054657.50367-18-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::530; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x530.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969796436100001 Without this change, the status flags may not be traced e.g. if checksum offloading is disabled. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/e1000e_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 481db41931..d4a9984fe4 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1244,9 +1244,8 @@ e1000e_build_rx_metadata(E1000ECore *core, trace_e1000e_rx_metadata_l4_cso_disabled(); } =20 - trace_e1000e_rx_metadata_status_flags(*status_flags); - func_exit: + trace_e1000e_rx_metadata_status_flags(*status_flags); *status_flags =3D cpu_to_le32(*status_flags); } =20 --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970062; cv=none; d=zohomail.com; s=zohoarc; b=DBBz/QMJHCE18eY06bCrmwkrqftmAW4DHNAdCIuz0iffeNKjvlUTfOJFETLu4CgAlC3O8C6aloVI/KO7DdQQfKiHDzPvWeFEA9I/gF+5clwgeUSs8wGQwM60eMdtu32Xvh3q1Ttw5lXWaP1hiQ2sCp9SMZJKj0AIOB/1f8w0s/8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970062; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=xnagxZ+E2n9TVg5oW3uGy+jRWdbtBn+94wc6hhrGdGg=; b=CmEOZicBufVXzNVkMqnRR8Yrk1RT90Vadi89m5Z2VUh2rcgLGSaraVQEOH7T9G5X8axKTKfUbdmODpcX4VcQgxs8OIYc2LTHCKh3S9tk/Pi3hsFcsLgo5HiHACc4uBO8HfGO0POa5qd4hNJP1fwlqUO1xZMFLYUoEPkorYkMsAc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970062154176.66303124749948; Wed, 19 Apr 2023 22:54:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppN9x-0007f6-Pu; Thu, 20 Apr 2023 01:48:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9w-0007b9-4v for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:44 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9t-0001JS-Vj for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:43 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-63b73203e0aso4472605b3a.1 for ; Wed, 19 Apr 2023 22:48:41 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969720; x=1684561720; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xnagxZ+E2n9TVg5oW3uGy+jRWdbtBn+94wc6hhrGdGg=; b=D5ud44Ahexa++SR+FdiFdbY9IPv//S/qgD5AxdNtwQ/aTI8E+l603In2trHLRLqpWS pd0aHXvnQUb99eCFdr4JPUuJ9Q8nqXzpfsSR0iBH3VhT8f//vp3yDMZ5bvi0CvDbBQcv 9VkvtqpoXcxva/FmWeO7pKYqSbYAf/ciH0GhxJgg+kjBOJJBhBgx8T+oW/bglXZSTJ9R bq635IitakMYvMHsONEMi6sTnLuiN5uV06ac7Bi17wrs9gvREXntQRGEkntcNOEt9TyR h0WqnA+LjM1NPrvBsMf2S/NusKUsjHv62mmRusm7+TzpLyEFpo4Jzk8hMiAoQDE1JtZz hijg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969720; x=1684561720; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xnagxZ+E2n9TVg5oW3uGy+jRWdbtBn+94wc6hhrGdGg=; b=ghDSjNaEFip9WveLbljC+5O5kOfQcztrUtPEnlcHKV6KPpDO7byHabP+J624rrNZD9 rRKSJftM/Qh+zpq2ufO3NZ1Tq7qFuCdwP4ZuPAs9stMLyuV4PPuXM10Xdan12tTjDdc3 pTc89cVda1w4Mkh/odFVogefB7Uqw0KtAGfa2U8/Yi+mahr6TRLjw73LlZYY9MsfPhSn +EQ6BJuQGwC8SNOi7wXu9VAwURJwUeeWXB/VbgfiWRW40TMSb6hRtdI3y7QuePWQe/pv uwgtzg1n+YYSafXKURy7L//wcZENjE6Sdw9wWjgP3/FqcLSuuiAodRKL24gpdDLcRI4l RHNw== X-Gm-Message-State: AAQBX9cyMDKZ8JJCHy3md/A55O8a0SwBd0wd6gMp/flvUVjcSl8ewl91 ZRR7Yn3Z24WAe+BtTOVO1L5bhg== X-Google-Smtp-Source: AKy350Zrki9iJuI5DW+L8PUAIDVv6PUUaGsliHNFpmdT0cfFcCKDxiB9pU0AHw8hfRXK9gfGe8Nmjg== X-Received: by 2002:a17:90a:c404:b0:247:2da0:8f42 with SMTP id i4-20020a17090ac40400b002472da08f42mr5254854pjt.20.1681969720366; Wed, 19 Apr 2023 22:48:40 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 18/41] igb: Always log status after building rx metadata Date: Thu, 20 Apr 2023 14:46:34 +0900 Message-Id: <20230420054657.50367-19-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::42d; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970064267100007 Without this change, the status flags may not be traced e.g. if checksum offloading is disabled. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/igb_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 0182880adf..dabf1a91d8 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1303,9 +1303,8 @@ igb_build_rx_metadata(IGBCore *core, trace_e1000e_rx_metadata_l4_cso_disabled(); } =20 - trace_e1000e_rx_metadata_status_flags(*status_flags); - func_exit: + trace_e1000e_rx_metadata_status_flags(*status_flags); *status_flags =3D cpu_to_le32(*status_flags); } =20 --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969755; cv=none; d=zohomail.com; s=zohoarc; b=lntUeO9VsHEGgwtROhMiHSguUUH4ixvTvzIPZeG/gJYhhyaZpEBiiBh3TrLq6PiA/TkJoFmpreTt1sqYAN6N74gbCkRb27EIYZvOjZl/3oCWhaPOpwaeHHS8usz2yFGFr37L1+0Qs56b1ZEz0xWRobW+sw/NJJm08fj7NXSnbQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969755; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=LNbtNm08oFX/Kr+hWh5WddPg3P8O9fRwIo9uMNbOz2E=; b=JWNXQSyLOgZQmXCDPKjdyxaRx0MmzaZ5ykCpY6QIVxaqOTQVCEif7jseXPFaRiooUZeB7isjDDLjqUFPQs3QAITlx2HbR7zdOKUOb7IiE4N/MmwU3n+3TMXCRUWpKDWr6mDZrOQqFMgt7MQXia8SogRvZ3hili9rIIF2MUV0+O8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969755942419.8958176357029; Wed, 19 Apr 2023 22:49:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNA0-0007pQ-Mp; Thu, 20 Apr 2023 01:48:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppN9y-0007mk-NO for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:46 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9x-0001KG-50 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:46 -0400 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-247122e9845so402356a91.0 for ; Wed, 19 Apr 2023 22:48:44 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969724; x=1684561724; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LNbtNm08oFX/Kr+hWh5WddPg3P8O9fRwIo9uMNbOz2E=; b=0ZZwrk/5N+cSCjmrvdsQqZvihfwcImyW5ITjCEXwx70Axn2jITox43ZUOy8F1kDKMp 79DuctehS3PbshlZ0gJeJX5KswoNCbWuWIx5i2IRrAKhBSrMs5ry8aPkJEEVVtIpLLPG QzGGHfrtq/g4Iew6NZJOAaQfC+8tcTkycZ7HPEaq7lBOO350B3JjOZTWGOTU8D0ee7Jx cvnQQZc/pRDmP7jR/QLSbCp0/NlYTA+vt5sidm3CbsoYw4/B3cXITDRkcXWb+ww56aVl tap++Yw27FlvaCzH5ariPi5nkzF8vPBVchcC0TxRUDRCk3IGxoWrPHW9ZerskoHDuuoY byyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969724; x=1684561724; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LNbtNm08oFX/Kr+hWh5WddPg3P8O9fRwIo9uMNbOz2E=; b=Asildha9v4JE48DTc/lbfS9KbKgSaW5apu6KqF42C+yPQoza4Dtl0oFan7K4vdgbNm wK4oeqq2hdZQ/SiQkqqWL8Mtb4Y5c4XJePoqhEfKT2SSkpj4PyMJPIQ4Yax1UlyOoWl7 1fkpGWxbuNaVMKnXz/Qd2gZ40jeX5Ef5aYuv8xwgAk7+T19EbZIggPRiVHzs1i8j8LFR o0IIkDJiaEBU6x3CxMRIC+xJug0HhePw70BZCoy4RTILzp2Tq6lF2+Kz3OZTqe/NZIsA 3z6+17twZyvsh/E24XI0sCFcwyOCUziU843vmpxZstjjwvoCp7kNpvX3HYn58YDxAQ1f /RyA== X-Gm-Message-State: AAQBX9fLOvA5VRJW0BNETTeKKVcJ7GezxelCmG3rIkoXdaDmSrK87mpj U/FYKAn2Inn0c2bKpXjbgsE6gA== X-Google-Smtp-Source: AKy350Y9aZoyaS4EJwTEUBI+UJ/1MYxc7dyGL2TZwB6McT1BJW5bhvsomnUzIiUoUbJ5aJPRsQOnpg== X-Received: by 2002:a17:90a:72c5:b0:23f:e4b7:afb3 with SMTP id l5-20020a17090a72c500b0023fe4b7afb3mr611621pjk.9.1681969723859; Wed, 19 Apr 2023 22:48:43 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 19/41] igb: Remove goto Date: Thu, 20 Apr 2023 14:46:35 +0900 Message-Id: <20230420054657.50367-20-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::1034; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1034.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969757743100012 Content-Type: text/plain; charset="utf-8" The goto is a bit confusing as it changes the control flow only if L4 protocol is not recognized. It is also different from e1000e, and noisy when comparing e1000e and igb. Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- hw/net/igb_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index dabf1a91d8..d966aa6bfa 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1297,7 +1297,7 @@ igb_build_rx_metadata(IGBCore *core, break; =20 default: - goto func_exit; + break; } } else { trace_e1000e_rx_metadata_l4_cso_disabled(); --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969990; cv=none; d=zohomail.com; s=zohoarc; b=EzSknz3DPTZYddTTjRmwXWqjXTegxHSfuefMrQ4DwiMr8N25H+kz5hp7mMrulosDfwZ+fLJAOwv1IK4FydWLlUiFYp7cHmrabAV6vsM4TM25r0elQzkm4jjHcaiI51h83OCD7HoJ8je0e0vf0jeNS0bkeTXj83fUh/mGlcaiXhM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969990; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=+GBSeBUBaofin94ag2w2hYOc0wx+DM8C5VONJYbDhLg=; b=bfm1Gqcvo9Vt1+vrkiYNgdUst4uA+ZXLQhT+RPHQFhM9GGr1K/7IidoaVZABgNGNENOwGJwHivubbcTtlNt/K15zK6SN7oMm1opSDn75z6W8otf7ItpYiCT4aBAC3n21alydWCM5hnbG8ugQAOy0pM0kDkkrniBXidUuRl6jc4A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969990829793.6658214098312; Wed, 19 Apr 2023 22:53:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNA3-0007y3-9k; Thu, 20 Apr 2023 01:48:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNA1-0007sp-Ki for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:49 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppN9z-0001JS-V4 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:49 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-63b73203e0aso4473084b3a.1 for ; Wed, 19 Apr 2023 22:48:47 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969727; x=1684561727; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+GBSeBUBaofin94ag2w2hYOc0wx+DM8C5VONJYbDhLg=; b=sGLnmRq+GbJoGJ0pALb9S6uVjVM9irnDGk+JSkmdZ7eEqz9BG0LR3NSDf3EvbBsLUO LlHcx852qF8ru0gMPFtBmG4LY/hd7qop7ngxl+xpOrHJ/T6pX8RdDepC9sJktrxnQl1z ChmwJvQqtj/otYctlhERhpMlJq81zrdNd6QKWXVPyZx+3XT1E4A6EdJQiLrrv70bFpfN icKtablVd8R6od6M7XT0YNwewHrdKrdZtsqbtvdaRZyfRYZHy3zw/zQfKHsA/mJpooRH kWgVXnsDhkOgqKtm1ALOgmF7KJGfnGLmA12G+nR9PsZSzjokY/AQQrdfjauwd5M5MX0L xAZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969727; x=1684561727; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+GBSeBUBaofin94ag2w2hYOc0wx+DM8C5VONJYbDhLg=; b=RQUGCRrpAW6/m87jZp0tD+WWV0kV+spPGpFwZ+uVhq0Fgowi7IKs8E+8Oryr+2R+8P xtpCidvKVac1BkXqdkK6a4yYuntXhDAvhj82AXnql7Bk5L1jki9ijvBPbRi6OB+LFA9I u6JyXzKKFhwh5gEbITs4upffhLAcauDJmr+PNwpTCqYiS87LYoCbeEi+uoyASv9c3Zlx 0z6s/ekwEcaQEIopNoz4gQal/afYyaY2RyF2X/Dj5TArZf0OLn468z8DD8iwtzgPeFVp 9hWgyGhb8fZJ5Aj4785GeacEjFlXFN6rJpMR6/XiQ083nNcTO3RbYK64cJmbDmC4jQOp 05dQ== X-Gm-Message-State: AAQBX9e3XfEYP/MYnhI1Yu/GF4uhg82UbrVLknS/vk5nyN2vWoW6mPfg JhHkUmJ3bMp4I6odXBCSeBJLgA== X-Google-Smtp-Source: AKy350aZbyV8iqUhtIBGenueRNZvcRy0enVliULF5QcuQUMTDyd3S1x5uXs4wHh7shs8QB+fXwpu5A== X-Received: by 2002:a17:90b:3756:b0:247:714e:94e5 with SMTP id ne22-20020a17090b375600b00247714e94e5mr5121188pjb.23.1681969727278; Wed, 19 Apr 2023 22:48:47 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 20/41] igb: Read DCMD.VLE of the first Tx descriptor Date: Thu, 20 Apr 2023 14:46:36 +0900 Message-Id: <20230420054657.50367-21-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::42d; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969992552100003 Content-Type: text/plain; charset="utf-8" Section 7.2.2.3 Advanced Transmit Data Descriptor says: > For frames that spans multiple descriptors, all fields apart from > DCMD.EOP, DCMD.RS, DCMD.DEXT, DTALEN, Address and DTYP are valid only > in the first descriptors and are ignored in the subsequent ones. Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- hw/net/igb_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index d966aa6bfa..5ecb4b6c16 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -613,7 +613,7 @@ igb_process_tx_desc(IGBCore *core, idx =3D (tx->first_olinfo_status >> 4) & 1; igb_tx_insert_vlan(core, queue_index, tx, tx->ctx[idx].vlan_macip_lens >> 16, - !!(cmd_type_len & E1000_TXD_CMD_VLE)); + !!(tx->first_cmd_type_len & E1000_TXD_CMD_VLE)); =20 if (igb_tx_pkt_send(core, tx, queue_index)) { igb_on_tx_done_update_stats(core, tx->tx_pkt, queue_index); --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970048; cv=none; d=zohomail.com; s=zohoarc; b=NcHT/8DqC7FF6o1fqROu1beBLdOhfw1te0AukroZQJHZ5cfbUOfLuvvAcOwNs5Q7RdieFPBNOt/snknIP+EJmvl8qOtIWQ10pVNgoEqJA3o910eLs5xWj5mH4xXfM+u+vtBV7jsXKaRuBiUD2dXpUeO3AEcVlrzO2C/iEH4RRFo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970048; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=WOJ6hIB2Qfh92lFD+jfSoOxdT6/0aqhANv6JPVUUvUg=; b=UA+eJF9vNOY7uGN3nLJV5h/G/7kQKSGJ13uP6BudORzlL0BxPVrzTraCqChsx1yVHoLx0s70FmF0gxChfUVw7sJOYyZvlNyE95FouGUTzCdal/gwERc1mbpIgRovPko/61SnzJlOgg76/MAsTDXQ2c2wO0wHY6l1LQ43D/WR0sY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970048892635.2618923550252; Wed, 19 Apr 2023 22:54:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNA7-0007zp-F0; Thu, 20 Apr 2023 01:48:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNA5-0007zZ-Ii for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:53 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNA3-0001Lp-S6 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:53 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-63d4595d60fso4604111b3a.0 for ; Wed, 19 Apr 2023 22:48:51 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969730; x=1684561730; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WOJ6hIB2Qfh92lFD+jfSoOxdT6/0aqhANv6JPVUUvUg=; b=O/QpXEZeu9zGCZqMho/9+ZBSbE2pLsQ7D4fND8Lb9lruNoGCuGOnztQDaNhYLvY4RQ sKFYPsUZuv+HJkYHWB3WNtM4WdTHZLduENXXJ7zY4SCisF45Gc8pOWHD3wFBZQPX5AOJ IkxoeEijnbRcdhn5urVnXoidqPKmGngUFIsy7YdTjGhrtM/LBWsHfMMdIYbixW5DR70b TWm+EmduFBbZqn1Mg5sekdoKXnJOBk+rYmqbUBpNpLJOtBQSzY/tcDXlyWJF08G5Ewbc /8b396LpyWpw53QarPUSb+L1xHKLFEOkh+t+hGBYN2TIjOGnoC/u8VFZE25Lr42HgHiw JTTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969730; x=1684561730; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WOJ6hIB2Qfh92lFD+jfSoOxdT6/0aqhANv6JPVUUvUg=; b=XBKjdGnZr8waBZ+H9BQz+kK5yWwWxaRE+08AobyjuYejysFgxYThOCUk+VKaHZW1VU yoyjgLwTpgQg/m4cjBL5x3tdP5f0kiIKzDwpr4hK3iwizBcX6OnbnC7c20/d72HRKX1D McUQkoN1NZM3mLhMEza2GokSKV8z4q6Uz1+wQ3Pd+JcT27pvZN7isIs6BfpXTzW4Kra0 vTk23mqJBISdnbYFtOgaKHQ5jb1SwyPNTvwrjZrHkSMJjQeMfouYMlqwPYhtBXnRsAB8 cu0V5al9AsPUiUWYkDywvz8jB9/EwoUfUNbtVfgUQR7t36f3pGO0vZmZpOixjV8M8U63 mltA== X-Gm-Message-State: AAQBX9ckvKaEGBZoq25jXRQFCLsy9pLhvbjpKtx3rlV0tUb6aj5SNS+3 5+QL4K2c78pakGRYV9AEdsFU0Q== X-Google-Smtp-Source: AKy350bKaxED43X5zxCyKto7LLS4B0iVy4670eND4l+3pLBCpqnpF6Tw3DZ76KOpUsPnCbbLLQz84g== X-Received: by 2002:a17:90a:65c5:b0:246:b9e3:aab5 with SMTP id i5-20020a17090a65c500b00246b9e3aab5mr179391pjs.21.1681969730722; Wed, 19 Apr 2023 22:48:50 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 21/41] e1000e: Reset packet state after emptying Tx queue Date: Thu, 20 Apr 2023 14:46:37 +0900 Message-Id: <20230420054657.50367-22-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::432; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970050179100017 Content-Type: text/plain; charset="utf-8" Keeping Tx packet state after the transmit queue is emptied has some problems: - The datasheet says the descriptors can be reused after the transmit queue is emptied, but the Tx packet state may keep references to them. - The Tx packet state cannot be migrated so it can be reset anytime the migration happens. Always reset Tx packet state always after the queue is emptied. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index d4a9984fe4..27124bba07 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -959,6 +959,8 @@ e1000e_start_xmit(E1000ECore *core, const E1000E_TxRing= *txr) if (!ide || !e1000e_intrmgr_delay_tx_causes(core, &cause)) { e1000e_set_interrupt_cause(core, cause); } + + net_tx_pkt_reset(txr->tx->tx_pkt, net_tx_pkt_unmap_frag_pci, core->own= er); } =20 static bool @@ -3389,8 +3391,6 @@ e1000e_core_pci_uninit(E1000ECore *core) qemu_del_vm_change_state_handler(core->vmstate); =20 for (i =3D 0; i < E1000E_NUM_QUEUES; i++) { - net_tx_pkt_reset(core->tx[i].tx_pkt, - net_tx_pkt_unmap_frag_pci, core->owner); net_tx_pkt_uninit(core->tx[i].tx_pkt); } =20 @@ -3515,8 +3515,6 @@ static void e1000e_reset(E1000ECore *core, bool sw) e1000x_reset_mac_addr(core->owner_nic, core->mac, core->permanent_mac); =20 for (i =3D 0; i < ARRAY_SIZE(core->tx); i++) { - net_tx_pkt_reset(core->tx[i].tx_pkt, - net_tx_pkt_unmap_frag_pci, core->owner); memset(&core->tx[i].props, 0, sizeof(core->tx[i].props)); core->tx[i].skip_cp =3D false; } --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969898; cv=none; d=zohomail.com; s=zohoarc; b=XRuvMj67kliC5nyK8VldRwFReB7HT5OWnkHB6JoSu5LtL1YKYjLRPCdnDbL3zz6M0mP8CB1kiWwUZRNy0DmNDf6aik4mRsmjY0VWKYDjHB9wC9n4YUBYJNayrRVITJ53Yh3lRZNivaTReZVgn2ptJEgLl5ZnMm1gX6y6g6rA4v0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969898; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=vyIvtVtEkzRRQ65xTTp3qSNNrOItJcBqvkf4ykjxuok=; b=VZU23AMFDyBVhgV8L31Inn44mF95h+CnX1p3W8WHiidfmaO6e1SnR7WhgzgAM2rLA1IzojMLbwbRFJDi0u7Hu6nuHdjegEtNyyy5NmE36lGGRi+RmMb6Wooa+E5jnItXVQd2wICn1FavFrzgrrs8hZuZZDJIyD5538UnSC7piXk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969898388124.95852532667595; Wed, 19 Apr 2023 22:51:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAN-0008Ph-NX; Thu, 20 Apr 2023 01:49:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNA9-00080p-ML for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:58 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNA7-0001MQ-Qf for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:48:57 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-51fcf5d1e44so565117a12.3 for ; Wed, 19 Apr 2023 22:48:55 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969734; x=1684561734; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vyIvtVtEkzRRQ65xTTp3qSNNrOItJcBqvkf4ykjxuok=; b=G8jENpT+wYroVqLfAzTmAL6hOyC5RVRck8JfYvwAt2ucWbCPb9J+CxXMKXkyxT5dpQ GuUcxDRBg7I3qgkBFTAwQXddcKy/SddnQNM1twQRqb60lZnOAT5ynP+42vWZ9al2a9PE E9bqYG9yR7kpP93k15C2nargW12oZFJx1SFr9W7TNbc69anIj60jO4ak+0bMT6z6rVYG YFe/bK31fkeZuOl5oRl1xMbzjQKaIpL089gx8YYiCXl06hKOZ6mcdS4sIfij6XDsjVQE hfAKbdfzdULnK0Wd91gsP2WRfM6JdHeaTH8hf7LMWw5s5mwsZia3plN8SsQhYKI0qe1d 0EFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969734; x=1684561734; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vyIvtVtEkzRRQ65xTTp3qSNNrOItJcBqvkf4ykjxuok=; b=Ggz4VTiaKmKib2rc3RK0fktf8Vd/zhLsve5oR+eaRK/DuKheazYokbcveeKw2A8zpn 1oiAX1iHZrHFEKyAkIEhuGKkn1P5OiHlvVtFo8/i0Iq7o2ZQFOLKDkpB8K/Lc6bhx4FY 7CooVOJB9FmFmQ8cq/g2dE1BbGQYcqh+OJ4QVrg5xJUO8goz20W/5vVcEYZz6pn2gZh1 X6E1EiPu+MYYaXP2rBBMxd0LDGwrzN6HqQYcEm0FM0xyEyS1Zb7xaWlzrDO0qutBf9pC bIa52i4bpnRQVRqsP+ibQUmm95ktWkSXnK7Z0kurf8/wRRACA5Euo8CUiZkY8tv/Z601 ojCA== X-Gm-Message-State: AAQBX9fGjuDOsrMMZllgdHoIHxJnX4C/qy0oahI25PsjF4rr8bucVOPO UyeLScRD1PYwzp183exQabWvmw== X-Google-Smtp-Source: AKy350YvgNgkkqnj8gf9o/l5P04j9RA7WDrsGDjK5vcOm1bSgDZSFVmcJsy2cXMOUfFnHbCQvpLI1A== X-Received: by 2002:a17:90b:2286:b0:247:bd9b:c19c with SMTP id kx6-20020a17090b228600b00247bd9bc19cmr443443pjb.44.1681969734122; Wed, 19 Apr 2023 22:48:54 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 22/41] vmxnet3: Reset packet state after emptying Tx queue Date: Thu, 20 Apr 2023 14:46:38 +0900 Message-Id: <20230420054657.50367-23-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::52c; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969900478100005 Content-Type: text/plain; charset="utf-8" Keeping Tx packet state after the transmit queue is emptied but this behavior is unreliable as the state can be reset anytime the migration happens. Always reset Tx packet state always after the queue is emptied. Signed-off-by: Akihiko Odaki --- hw/net/vmxnet3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 05f41b6dfa..18b9edfdb2 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -681,6 +681,8 @@ static void vmxnet3_process_tx_queue(VMXNET3State *s, i= nt qidx) net_tx_pkt_unmap_frag_pci, PCI_DEVICE(s)); } } + + net_tx_pkt_reset(s->tx_pkt, net_tx_pkt_unmap_frag_pci, PCI_DEVICE(s)); } =20 static inline void @@ -1159,7 +1161,6 @@ static void vmxnet3_deactivate_device(VMXNET3State *s) { if (s->device_active) { VMW_CBPRN("Deactivating vmxnet3..."); - net_tx_pkt_reset(s->tx_pkt, net_tx_pkt_unmap_frag_pci, PCI_DEVICE(= s)); net_tx_pkt_uninit(s->tx_pkt); net_rx_pkt_uninit(s->rx_pkt); s->device_active =3D false; --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969798; cv=none; d=zohomail.com; s=zohoarc; b=KCNHt2CJ6S/x0Ax1C0nT1OllaYMUuoDzIFMpq/eEc/bSyphzsUF1kPklpC8xfAJsi+wj8++P7uR6w7iREO+XVuNn8CUWFflwjwdlJ9T6PXowljNqm8CTV+upOq7sQ5V8YWFD0n8+pHOmdlsNvCu1LOY9dtPUorXuhT2d6jb3MNA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969798; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=qsz1+De6rK+Z/ND7CN4QdxHCwGKEit2LEdDyQeZ20XU=; b=RuniZilTMbNwET6HNPLI2dBd29GapsvrhT3iMm1YAWBYfImimKps7yelS+n1RLjteYvxvTwWzlmGERL6/9PAp8zV50oBP8mWiX3rCqoCVeB0enQNBcnrKgmt8vjTuNA/zORkR+DvtvGsFgjqnmOLCAJnq97xrZVLGYFBq6Rpu+M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969798353569.2885916638566; Wed, 19 Apr 2023 22:49:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAV-0000m2-Bk; Thu, 20 Apr 2023 01:49:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAL-0008Po-55 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:11 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAI-0001N8-9y for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:08 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2478485fd76so389485a91.2 for ; Wed, 19 Apr 2023 22:48:58 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969737; x=1684561737; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qsz1+De6rK+Z/ND7CN4QdxHCwGKEit2LEdDyQeZ20XU=; b=bTPpn50Uonvrvj93qCv6hxEAyAzpyuHjy9v990UPQFD7js0n9zAFklzDBHPV7ay5+l VECSyQasRgny2g7wtutQ/l0BBvoYzl7281jcOLgTyGFCm/FsfrH6r/de6B9k8Eey1cjy UFrSVDRbBFq5Ccd+2TGIGEqKg+W//D05FdxNhPbgnpiZz47dAXrvz4R9Dtlx8gg8iRb2 kUPkEAHMJLi1sb7NhiDN0YUwCk7RHm1DC7v9aTYUnx4odBQi2TXHbM0kpKbHnQpZ0qVo zwNN4Eo6N8oKFKrtwvIfilTMvEXkPi85Wqd4jYppwHryWmSK5vpDxsjPyW26BRGlqdf5 Ho+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969737; x=1684561737; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qsz1+De6rK+Z/ND7CN4QdxHCwGKEit2LEdDyQeZ20XU=; b=ATLw+BD+pNnjzGRbUEtZ/gwl0YNRu05FljArHp1TRsPnWEJOy24xcLmPf+B7t4IcL5 1XuUVq6pTDXjB+X69cOVQze8rmUJne5RZrroMzlAHut2hwd9EMz+sS4xcD5yxKk3pPQo T9Jpm8wJ2gmp8tuO6m3oAXUFjCDrlOnYxPydp+t6b47SJyz/FlmlndGdEX8WYLCESFP/ i7HhPipOhbrRrK2ZQw2ikt6veutKlKTvmW2EPwY0PTTk/zj+hMPSdDhAWH4CYJx6MaJ0 nxtQkSlCTWC4VDJ047ADeuHW0BSMsAsBIKOI64UTktM9tQlf8gTHPaANO9+4TSaIP1Eo wmwg== X-Gm-Message-State: AAQBX9dQCEruBGRNj8QBUfSGm6qmXm1shhq/b4ALdWs7WiHb1nNiS3sv 1/SCvPNwshjDGNbs5I6rpD/qcQ== X-Google-Smtp-Source: AKy350ZZhcgeCmjlU9zRrnj1tpr4AY/n2fk9SZSsYVzSrZvHhtubDzHswIeZVWmwmAIbnJHseL47dA== X-Received: by 2002:a17:90a:ad90:b0:247:bd63:c3af with SMTP id s16-20020a17090aad9000b00247bd63c3afmr659084pjq.8.1681969737604; Wed, 19 Apr 2023 22:48:57 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 23/41] igb: Add more definitions for Tx descriptor Date: Thu, 20 Apr 2023 14:46:39 +0900 Message-Id: <20230420054657.50367-24-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::1032; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1032.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969799139100005 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- hw/net/igb_regs.h | 32 +++++++++++++++++++++++++++----- hw/net/igb_core.c | 4 ++-- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/hw/net/igb_regs.h b/hw/net/igb_regs.h index 21ee9a3b2d..eb995d8b2e 100644 --- a/hw/net/igb_regs.h +++ b/hw/net/igb_regs.h @@ -42,11 +42,6 @@ union e1000_adv_tx_desc { } wb; }; =20 -#define E1000_ADVTXD_DTYP_CTXT 0x00200000 /* Advanced Context Descriptor = */ -#define E1000_ADVTXD_DTYP_DATA 0x00300000 /* Advanced Data Descriptor */ -#define E1000_ADVTXD_DCMD_DEXT 0x20000000 /* Descriptor Extension (1=3DAd= v) */ -#define E1000_ADVTXD_DCMD_TSE 0x80000000 /* TCP/UDP Segmentation Enable = */ - #define E1000_ADVTXD_POTS_IXSM 0x00000100 /* Insert TCP/UDP Checksum */ #define E1000_ADVTXD_POTS_TXSM 0x00000200 /* Insert TCP/UDP Checksum */ =20 @@ -151,6 +146,10 @@ union e1000_adv_rx_desc { #define IGB_82576_VF_DEV_ID 0x10CA #define IGB_I350_VF_DEV_ID 0x1520 =20 +/* VLAN info */ +#define IGB_TX_FLAGS_VLAN_MASK 0xffff0000 +#define IGB_TX_FLAGS_VLAN_SHIFT 16 + /* from igb/e1000_82575.h */ =20 #define E1000_MRQC_ENABLE_RSS_MQ 0x00000002 @@ -160,6 +159,29 @@ union e1000_adv_rx_desc { #define E1000_MRQC_RSS_FIELD_IPV6_UDP 0x00800000 #define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000 =20 +/* Adv Transmit Descriptor Config Masks */ +#define E1000_ADVTXD_MAC_TSTAMP 0x00080000 /* IEEE1588 Timestamp packet = */ +#define E1000_ADVTXD_DTYP_CTXT 0x00200000 /* Advanced Context Descripto= r */ +#define E1000_ADVTXD_DTYP_DATA 0x00300000 /* Advanced Data Descriptor */ +#define E1000_ADVTXD_DCMD_EOP 0x01000000 /* End of Packet */ +#define E1000_ADVTXD_DCMD_IFCS 0x02000000 /* Insert FCS (Ethernet CRC) = */ +#define E1000_ADVTXD_DCMD_RS 0x08000000 /* Report Status */ +#define E1000_ADVTXD_DCMD_DEXT 0x20000000 /* Descriptor extension (1=3D= Adv) */ +#define E1000_ADVTXD_DCMD_VLE 0x40000000 /* VLAN pkt enable */ +#define E1000_ADVTXD_DCMD_TSE 0x80000000 /* TCP Seg enable */ +#define E1000_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */ + +#define E1000_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */ +#define E1000_ADVTXD_TUCMD_L4T_UDP 0x00000000 /* L4 Packet TYPE of UDP */ +#define E1000_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type: 1=3DIPv4= */ +#define E1000_ADVTXD_TUCMD_L4T_TCP 0x00000800 /* L4 Packet TYPE of TCP */ +#define E1000_ADVTXD_TUCMD_L4T_SCTP 0x00001000 /* L4 packet TYPE of SCTP */ +/* IPSec Encrypt Enable for ESP */ +#define E1000_ADVTXD_L4LEN_SHIFT 8 /* Adv ctxt L4LEN shift */ +#define E1000_ADVTXD_MSS_SHIFT 16 /* Adv ctxt MSS shift */ +/* Adv ctxt IPSec SA IDX mask */ +/* Adv ctxt IPSec ESP len mask */ + /* Additional Transmit Descriptor Control definitions */ #define E1000_TXDCTL_QUEUE_ENABLE 0x02000000 /* Enable specific Tx Queue = */ =20 diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 5ecb4b6c16..e23c638899 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -418,7 +418,7 @@ igb_setup_tx_offloads(IGBCore *core, struct igb_tx *tx) { if (tx->first_cmd_type_len & E1000_ADVTXD_DCMD_TSE) { uint32_t idx =3D (tx->first_olinfo_status >> 4) & 1; - uint32_t mss =3D tx->ctx[idx].mss_l4len_idx >> 16; + uint32_t mss =3D tx->ctx[idx].mss_l4len_idx >> E1000_ADVTXD_MSS_SH= IFT; if (!net_tx_pkt_build_vheader(tx->tx_pkt, true, true, mss)) { return false; } @@ -612,7 +612,7 @@ igb_process_tx_desc(IGBCore *core, if (!tx->skip_cp && net_tx_pkt_parse(tx->tx_pkt)) { idx =3D (tx->first_olinfo_status >> 4) & 1; igb_tx_insert_vlan(core, queue_index, tx, - tx->ctx[idx].vlan_macip_lens >> 16, + tx->ctx[idx].vlan_macip_lens >> IGB_TX_FLAGS_VLAN_SHIFT, !!(tx->first_cmd_type_len & E1000_TXD_CMD_VLE)); =20 if (igb_tx_pkt_send(core, tx, queue_index)) { --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969976; cv=none; d=zohomail.com; s=zohoarc; b=MBdmY3c+nHgSI+pxMNbsSoHFyz3kz6AOCJ58+Uhp89Xu3K5ViQxHLIRCRN2OWL8keu+SFMrL1rzDmI/ZIn4Y/AKNPa7kxoGFiiNdxRDP6ZQ67QIP583lolrYU0LD18b3DDoqO8rY5SBFhPCn03dtqLwTeYYOBCJSEd4w4rjUkns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969976; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=MrtCRX6iQBVwgwLH2Xil/FY7eqoBzL39/3IOXtgkA6M=; b=CUB6OKVYMBo6SlFSZdy3WIEWbt0t8Hd2KbJt/cLALCW5k48VjqiL76aPR3ZMyvw6ttvCn2rrsflpw8YIkieualKUmZGkVGO4Q+uEfuQV9/WRS4GztpOY2BJnJsYPFIzPuLdxpp5PIveVBaNd5JXZFNmGLAbdAhpJE9fcZE9Cah4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969976459340.6819192197056; Wed, 19 Apr 2023 22:52:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAX-00011T-M4; Thu, 20 Apr 2023 01:49:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAM-0008Ss-9U for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:11 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAJ-0001JS-Hb for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:10 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-63b73203e0aso4474091b3a.1 for ; Wed, 19 Apr 2023 22:49:01 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.48.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969741; x=1684561741; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MrtCRX6iQBVwgwLH2Xil/FY7eqoBzL39/3IOXtgkA6M=; b=V/mApj3NrUVRrw9q+bIRNF9QUJYkYtYPH3D+c4wehAFEEXVynEbQCeod0fluwAQSNl h8QrYLHiSVb2OifNfdDnvrf3+52GN5p0Zrn3SCz+htlJkV1EHuDPOHNEBPu0uTijwtND K+Fx4T6HMTCbsctI+KzGDsxU38b0U92kswNo1GVwW8Yir+fCg5YaJoisbpxiJBJwBdP5 lRmh8tfGGLkzPdMSHAeMFcRYH18WgyjVYX5EOw+w/omM5rQuwEdFwn82gBzFipAJ37Ud M6hvLvxwdEtKqwdKOYF7SYx4yQ7GHzgB+IpCn9hN9/PFZ0I2TQq1hs5m8JDG9pFJVUVH GTQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969741; x=1684561741; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MrtCRX6iQBVwgwLH2Xil/FY7eqoBzL39/3IOXtgkA6M=; b=HVjeXyEz8OQIhMiJn1bkyU8vK08yoQGoCMpRfUN5dXLqjkb/dDwuwChK3M/WviJZ6c zWlAfN3ZNUGoe6OUHpwlkBMDv7YMQuBBNSA6qUyyb6oy47njt7N3JGKHuzq8TjJPRA0G h7kGopy+lPwQ4bNkaqH2Ab35q//f5OEKwNYCfbnThm/Eaq53ZLMQ8avKf9sm7FsjWBZU WRLdd0nf9wOvPhj9/i8OHTI26ujoCaMJWkJ+m8J6g4vIQDCYzVbkHmTrZSwHudESzHEC 2g2k7vbq2NTP2eMejtxp+lCcRdr7OXhGr8x4Fg2MHcqIvj+Ays+rmzILnLD2SjcFbdPP ZXNA== X-Gm-Message-State: AAQBX9e4qn0O+L9R+GzuzbRrcMevalJd2fV9MQr1s67X3HoXwiY71CvD AACiPZq5WOETsNMVVSYmMmL2Hw== X-Google-Smtp-Source: AKy350Y6CsGLWgftZumOq6/rIi0CcxUQ89ttVrfCUFwdbkhmfNJLENeqV7ALDcsrx5Z/pOdCX6C0cQ== X-Received: by 2002:a17:90a:c708:b0:246:aeee:e61c with SMTP id o8-20020a17090ac70800b00246aeeee61cmr313061pjt.11.1681969741039; Wed, 19 Apr 2023 22:49:01 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 24/41] igb: Share common VF constants Date: Thu, 20 Apr 2023 14:46:40 +0900 Message-Id: <20230420054657.50367-25-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::42d; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969977674100001 The constants need to be consistent between the PF and VF. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Sriram Yagnaraman --- hw/net/igb_common.h | 8 ++++++++ hw/net/igb.c | 10 +++++----- hw/net/igbvf.c | 7 ------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/hw/net/igb_common.h b/hw/net/igb_common.h index 69ac490f75..f2a9065791 100644 --- a/hw/net/igb_common.h +++ b/hw/net/igb_common.h @@ -28,6 +28,14 @@ =20 #include "igb_regs.h" =20 +#define TYPE_IGBVF "igbvf" + +#define IGBVF_MMIO_BAR_IDX (0) +#define IGBVF_MSIX_BAR_IDX (3) + +#define IGBVF_MMIO_SIZE (16 * 1024) +#define IGBVF_MSIX_SIZE (16 * 1024) + #define defreg(x) x =3D (E1000_##x >> 2) #define defreg_indexed(x, i) x##i =3D (E1000_##x(i) >> 2) #define defreg_indexeda(x, i) x##i##_A =3D (E1000_##x##_A(i) >> 2) diff --git a/hw/net/igb.c b/hw/net/igb.c index 51a7e9133e..1c989d7677 100644 --- a/hw/net/igb.c +++ b/hw/net/igb.c @@ -433,16 +433,16 @@ static void igb_pci_realize(PCIDevice *pci_dev, Error= **errp) =20 pcie_ari_init(pci_dev, 0x150, 1); =20 - pcie_sriov_pf_init(pci_dev, IGB_CAP_SRIOV_OFFSET, "igbvf", + pcie_sriov_pf_init(pci_dev, IGB_CAP_SRIOV_OFFSET, TYPE_IGBVF, IGB_82576_VF_DEV_ID, IGB_MAX_VF_FUNCTIONS, IGB_MAX_VF_FUNCTIONS, IGB_VF_OFFSET, IGB_VF_STRIDE); =20 - pcie_sriov_pf_init_vf_bar(pci_dev, 0, + pcie_sriov_pf_init_vf_bar(pci_dev, IGBVF_MMIO_BAR_IDX, PCI_BASE_ADDRESS_MEM_TYPE_64 | PCI_BASE_ADDRESS_MEM_PREFETCH, - 16 * KiB); - pcie_sriov_pf_init_vf_bar(pci_dev, 3, + IGBVF_MMIO_SIZE); + pcie_sriov_pf_init_vf_bar(pci_dev, IGBVF_MSIX_BAR_IDX, PCI_BASE_ADDRESS_MEM_TYPE_64 | PCI_BASE_ADDRESS_MEM_PREFETCH, - 16 * KiB); + IGBVF_MSIX_SIZE); =20 igb_init_net_peer(s, pci_dev, macaddr); =20 diff --git a/hw/net/igbvf.c b/hw/net/igbvf.c index 70beb7af50..284ea61184 100644 --- a/hw/net/igbvf.c +++ b/hw/net/igbvf.c @@ -50,15 +50,8 @@ #include "trace.h" #include "qapi/error.h" =20 -#define TYPE_IGBVF "igbvf" OBJECT_DECLARE_SIMPLE_TYPE(IgbVfState, IGBVF) =20 -#define IGBVF_MMIO_BAR_IDX (0) -#define IGBVF_MSIX_BAR_IDX (3) - -#define IGBVF_MMIO_SIZE (16 * 1024) -#define IGBVF_MSIX_SIZE (16 * 1024) - struct IgbVfState { PCIDevice parent_obj; =20 --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970029; cv=none; d=zohomail.com; s=zohoarc; b=Eo1HtmCGfhQERqSxr7QdT+d2SzU4Ydzr80mr0qUBAxkk9CorR5UYGMfNYVOO3j56H8iTf4pAiy9238H5dYTHN7vfQKTfWGFrQn1mxPZm3bHnPDRs7lqaYX7F1AcRze4zawTUfIahUxwL25Etb33cM8DF6+iKL4Iu37P29FFQvDo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970029; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=EHea3rpGiJtRZtnnqKDFEmlRzLO6TtsGKMrgSDo1I98=; b=GhoWgT+s0DHNHDtqHcdVRDVXIbTre1rsUUVcUyPKQW0ztncUSHOr1OE89GrUwDRkMU4zwvCtM/NhStLFr1lrMsvtjOHKDusBZgRTQwkvkfb5xzT7hRUo8b/2KpMTwM+EPc+SwmMqDCmKkTvDkcnkAXMJ76BeWtLQxnoqrz9ApSM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970029762465.84726983570386; Wed, 19 Apr 2023 22:53:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAQ-00009h-LA; Thu, 20 Apr 2023 01:49:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAM-0008Sr-9A for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:11 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAJ-0001O5-DZ for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:10 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-51b6d0b9430so435513a12.2 for ; Wed, 19 Apr 2023 22:49:05 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969744; x=1684561744; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EHea3rpGiJtRZtnnqKDFEmlRzLO6TtsGKMrgSDo1I98=; b=rMDxrSkwuLT+rYkA9KVR6iejSy+ufIPI8lDZEhpnq4qLubVfWLtzxJ9fmgNCSB2KcW yV5JWTiH0VvSOXs62JtZf2WmLXe9vawrOJcn8kBObnM1DXOTvUHKou5qyRhVLdUbAfnH TsqQjDVaMzR/ngknVXFpxuvoq+1x9uzF5ZAm/eaRWUGeCXvEGIPHYPdZzUB7kPCD1V/u PF/UETDKoNYr3IxIflQhJ+Z4zI0nWrbNNwG3ad2eCs/gI4QI2OCt/Ob2gX7G6Ktcdh9T r1K4O+BSlYuXs7BYTx/oriv9D5V/5eOACmDUfplZrkxoqGdIFuBZD4lX+lPr6azRLXkm SGwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969744; x=1684561744; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EHea3rpGiJtRZtnnqKDFEmlRzLO6TtsGKMrgSDo1I98=; b=c4yGMqLlsu8sMBfN5x+CPECUR9OpIMVPyLdN9gSw97k5GPu+UXe5kcmcs0T9EwxU6J U0OPBaic1+j+oILclhDSXhfBrIIl/uFz1vW+7hxBbBzUJZEEp1zy9Kx31OrY3n3BAKGB Y8eGNSbbw8wv/M17amfVxblA6xvEtcxkSApJohEN+AvU9uHDzKY0H1cMWqUu/acFq/Di Hnyu3Po9NKTCb9GS+cq1OB9GdKu5eXgkUTuLnP7bCHUswM+iOIiNXtfQAXHCOyxk3kHf dqvSI9r7qKUNKand1tT/hzT2MjwLDOBc3dgj0itf56X0AMiT0H5Mpot7oW71CoxNVdc0 B6Lw== X-Gm-Message-State: AAQBX9cLAbpRYGzdi2x8GxIyLkw136Wf48MG7WJiPgc87jx278rdK/L7 fbJ/VP+huaMqX9vhLBrVCP/2ng== X-Google-Smtp-Source: AKy350Zag1sePehsOgTYt+ADo04WVl3mWEmQJ5SHr0qNA5l2z4P4GR87mtE7am5K7weQ71LHcCi5pw== X-Received: by 2002:a17:90a:2ec6:b0:247:1e13:89be with SMTP id h6-20020a17090a2ec600b002471e1389bemr544517pjs.27.1681969744465; Wed, 19 Apr 2023 22:49:04 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 25/41] igb: Fix igb_mac_reg_init coding style alignment Date: Thu, 20 Apr 2023 14:46:41 +0900 Message-Id: <20230420054657.50367-26-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::52c; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, UPPERCASE_50_75=0.008 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970031796100003 Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/igb_core.c | 96 +++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index e23c638899..c24c522244 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -4027,54 +4027,54 @@ static const uint32_t igb_mac_reg_init[] =3D { [VMOLR0 ... VMOLR0 + 7] =3D 0x2600 | E1000_VMOLR_STRCRC, [RPLOLR] =3D E1000_RPLOLR_STRCRC, [RLPML] =3D 0x2600, - [TXCTL0] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL1] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL2] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL3] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL4] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL5] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL6] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL7] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL8] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL9] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL10] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL11] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL12] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL13] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL14] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, - [TXCTL15] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | - E1000_DCA_TXCTRL_TX_WB_RO_EN | - E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL0] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL1] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL2] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL3] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL4] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL5] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL6] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL7] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL8] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL9] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL10] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL11] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL12] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL13] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL14] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, + [TXCTL15] =3D E1000_DCA_TXCTRL_DATA_RRO_EN | + E1000_DCA_TXCTRL_TX_WB_RO_EN | + E1000_DCA_TXCTRL_DESC_RRO_EN, }; =20 static void igb_reset(IGBCore *core, bool sw) --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969898; cv=none; d=zohomail.com; s=zohoarc; b=KncP9w/RbD+AtsYymdaGZ/QWlqxvN4LR7d9O47IwRJOvil/H9otY+sIZ2YaYOgo4HqsY76HRllxKXKC3bXiuHVje2RBlQKaGJJo1rESbhcvIH1SVEJipGpQJibIpiZ5Xw5at4c2FV+DwiO6/wZcZ/UgGcKqZcEjtwmWDadJ6U6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969898; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=oSx/Q5Zg5D9OUWDD4DVLGcD91xlqvbaERviIetrBRHM=; b=fFnH0DHqk3Om5QJRRpmJlNWChg86ppH2gsgOLwvOyicPmxONCEG9UiD3Lp5v8WtnGIMqITzg1WNYop1fseZsRKvjAJxd+CcFQ08brt344ktRtT6xFASYlatloY8qgLwUp3hJRt8ZcBnlZPqbr/h19h5sXgoAKriCUZt2xqr0pHM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969898898459.52905994314426; Wed, 19 Apr 2023 22:51:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAT-0000UP-KE; Thu, 20 Apr 2023 01:49:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAM-0008Sv-UM for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:11 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAL-0001Oc-8N for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:10 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1a6817adde4so8383865ad.0 for ; Wed, 19 Apr 2023 22:49:08 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969748; x=1684561748; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oSx/Q5Zg5D9OUWDD4DVLGcD91xlqvbaERviIetrBRHM=; b=2gkXacfkhuIr9qec1q5j1aYGvjpIFJkrEe+qdyImI39W8HDcwpBaOgdZeEQhj3VLvW V+V+Nc7nMmVuMPEQmt5M/j3QOaOqsgQhlCSbXSBEC+VshGkgAHG9+XHyUEVOI1GSaDwe xqEWZdP+2MOSSGIiDt8joJLfJ9VgsE7c6lUGfJg4MPXow6TBarx+nzq4MD5zTck11NN5 TXHBuN+nntvAm50jZJfICdHz6uenmTHt/ux/Ryu51Cs6aq2ZoZlb1himiW/opF2QLWdc GFHNzSyVaFOgBYH3hQwhkhncDQ48T2BPiZF4+gSAuPgV4qrXe7HanpS5n/mneda8yqKU KbGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969748; x=1684561748; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oSx/Q5Zg5D9OUWDD4DVLGcD91xlqvbaERviIetrBRHM=; b=F19qZ+aSf/wTXrBDzSoXyaKWbNSMZNLJKXlavaaBM/vtBYcfZZcxjBHw+H36hREtDS kr9zUwvQeaF/W9uhjeSLHp4mSXEALX1uUvMGaBW7PqAlSL+Q1O4Ig2u0++xKU6AOJ71x gTo1Ie05bXHPKO1eAv0iyH9vMyTFPlU/W6lXZk/cATPe2nWAtogt7E+7TVQCqId9nGG2 qkzsctz9lo/o6baD4rEiFH/8DllujSu0wMp8qQd4L07Kicss3fFJQrmxbD181/e/QJgW qeCGKp8vwGEEV+ngln9aGHq9ZaM1CitACoORAwg4F2aDfGjgsesA+OrWdvJ5/8Dqrlbn jPyQ== X-Gm-Message-State: AAQBX9fP3A13BQgRN14Muqdp9WGAaPch/AsjjX5dot2Qbcfg/owkXdLV qlAHPDgZ+IJ3Fw5t2rSTP0jdsQ== X-Google-Smtp-Source: AKy350bqD67qtnT/P2X7upoOtTn3D3vPwD08n7Vo0KNruAv8E3OQzDqBs4XT1222ZDvrUYPI8FgIsg== X-Received: by 2002:a17:902:d2cb:b0:19d:611:2815 with SMTP id n11-20020a170902d2cb00b0019d06112815mr424599plc.42.1681969747873; Wed, 19 Apr 2023 22:49:07 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 26/41] net/eth: Use void pointers Date: Thu, 20 Apr 2023 14:46:42 +0900 Message-Id: <20230420054657.50367-27-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::636; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x636.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969900491100007 The uses of uint8_t pointers were misleading as they are never accessed as an array of octets and it even require more strict alignment to access as struct eth_header. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/net/eth.h | 4 ++-- net/eth.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/net/eth.h b/include/net/eth.h index 05f56931e7..95ff24d6b8 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -342,12 +342,12 @@ eth_get_pkt_tci(const void *p) =20 size_t eth_strip_vlan(const struct iovec *iov, int iovcnt, size_t iovoff, - uint8_t *new_ehdr_buf, + void *new_ehdr_buf, uint16_t *payload_offset, uint16_t *tci); =20 size_t eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, size_t iovoff, - uint16_t vet, uint8_t *new_ehdr_buf, + uint16_t vet, void *new_ehdr_buf, uint16_t *payload_offset, uint16_t *tci); =20 uint16_t diff --git a/net/eth.c b/net/eth.c index b6ff89c460..f7ffbda600 100644 --- a/net/eth.c +++ b/net/eth.c @@ -226,11 +226,11 @@ void eth_get_protocols(const struct iovec *iov, size_= t iovcnt, size_t iovoff, =20 size_t eth_strip_vlan(const struct iovec *iov, int iovcnt, size_t iovoff, - uint8_t *new_ehdr_buf, + void *new_ehdr_buf, uint16_t *payload_offset, uint16_t *tci) { struct vlan_header vlan_hdr; - struct eth_header *new_ehdr =3D (struct eth_header *) new_ehdr_buf; + struct eth_header *new_ehdr =3D new_ehdr_buf; =20 size_t copied =3D iov_to_buf(iov, iovcnt, iovoff, new_ehdr, sizeof(*new_ehdr)); @@ -276,7 +276,7 @@ eth_strip_vlan(const struct iovec *iov, int iovcnt, siz= e_t iovoff, =20 size_t eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, size_t iovoff, - uint16_t vet, uint8_t *new_ehdr_buf, + uint16_t vet, void *new_ehdr_buf, uint16_t *payload_offset, uint16_t *tci) { struct vlan_header vlan_hdr; --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969841; cv=none; d=zohomail.com; s=zohoarc; b=WNOkhqtr7+GqkaKoNsJeO/Lhb94KC+bzenFemRqNnRJp9IwIB+CORzkXOrOvqU8kcFr3aMdpstbHsUcwG66oGOhNDXK+q1VPF7/W0OFDdL1dm6/FDP1lOpP00BXGyB+AZY81irJFoTzUcL/DN0EOzjYSpAI5BIr9Ahb7RItJQEM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969841; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=WfMEYJ9MsNl1NEs1qpCe7w36MfTu1Ir4rIbITGTkOa8=; b=VGXWqZi85jmWUM3pszmIiLtahgXL+Xc61Al/jbqycbdIW/YSfycNkUPTDK7dgR/ykwmO73+3MkYd3elcGCsjccjVXDfgjUnYLJk7ry1iplJ21YCnfAzMRjwE8Kcy06KlRlg+4DAV9Y3eh5KQztMjJyMWiKWSLAF3iTneSahQ1hY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969841462374.07040730055576; Wed, 19 Apr 2023 22:50:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAr-0001oN-Hs; Thu, 20 Apr 2023 01:49:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAd-0001M7-Ad for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:34 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAP-0001PS-Hd for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:26 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1a645fd0c6dso6301395ad.1 for ; Wed, 19 Apr 2023 22:49:12 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969751; x=1684561751; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WfMEYJ9MsNl1NEs1qpCe7w36MfTu1Ir4rIbITGTkOa8=; b=KwXMAiMlK4CkhNMYFYwTKTQnfYAZUpAKjucIrnh7Gbrsj4uAAvbvrDvMLYSYO/nlYe zgG5yZlTTdTpZ9ToAgc/VOJVeBPNNsUQWE38M3ABvmkocXThBCgxmQqmTtedRCvsZFwq 9iAg0k+Ow4A0Oqovm7AWiJz7aX39iINF8TwjrZ2YWMKfWrdEZVnAg7h9pM5snqPWObbu Aep1Wy7yAy0DRdhOW6RUpHCeZ6mm2Aw+V78IjKRZrY8l16TRYQmVuSE2+3A9Ex6qYGow HCvamLrhieg0pgWNzCY5Wra47p8B+53XLsAz/YlO0GvZx6+YmNiQ3k3fq9yxmw8WttlW dR4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969751; x=1684561751; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WfMEYJ9MsNl1NEs1qpCe7w36MfTu1Ir4rIbITGTkOa8=; b=IMuVdYfXnZi6+lJWCEe3qIo3NGnbp1FaeZlA+ACNu5SoQfrpDdbACG5PpaPWUjzVDq BfUrfLiGXfC1sLuuSvrVViT8xcvV92D+MC57ENYMWJTcodJ7PaPNfbsVIh1/XDnO4zzG P3jx7GtDqkQbQ6fL3OkFbbdtgOeMz9wfPyNgVJoPg12ku52XN1XnqU1LfYWIYalG4wYg tG3U/7Km+REOmU3ZMno6X5LhHF3vVOkOS3oTj98VhTJFKQOECVIly4ArgQPDJVH2VJQY MOrcciFtLTW49hKcvqqklCUAlow7+uDueEjQAL0cxxkxy7VpQmg2gjT8fY0GIBvu1uy2 F15A== X-Gm-Message-State: AAQBX9cTQSX2/fNHsBJI3t+vvfbBgy1EQTEM0jVM6EaPe9NlBdIR+XH1 TS2B1CSuEfs9UNlMRHF4Ios8Zg== X-Google-Smtp-Source: AKy350Yjav/oDDQJV5vocZnYpu7EtU8q5/rlTM8aDKEwSvieK9Jz58AoHvJMo+0Jb2kyss1t4SIx4w== X-Received: by 2002:a17:903:22d0:b0:1a8:1867:1f71 with SMTP id y16-20020a17090322d000b001a818671f71mr454039plg.41.1681969751258; Wed, 19 Apr 2023 22:49:11 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 27/41] net/eth: Always add VLAN tag Date: Thu, 20 Apr 2023 14:46:43 +0900 Message-Id: <20230420054657.50367-28-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::635; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x635.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969841826100001 Content-Type: text/plain; charset="utf-8" It is possible to have another VLAN tag even if the packet is already tagged. Signed-off-by: Akihiko Odaki --- include/net/eth.h | 4 ++-- hw/net/net_tx_pkt.c | 16 +++++++--------- net/eth.c | 22 ++++++---------------- 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/include/net/eth.h b/include/net/eth.h index 95ff24d6b8..048e434685 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -353,8 +353,8 @@ eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, = size_t iovoff, uint16_t eth_get_l3_proto(const struct iovec *l2hdr_iov, int iovcnt, size_t l2hdr_l= en); =20 -void eth_setup_vlan_headers(struct eth_header *ehdr, uint16_t vlan_tag, - uint16_t vlan_ethtype, bool *is_new); +void eth_setup_vlan_headers(struct eth_header *ehdr, size_t *ehdr_size, + uint16_t vlan_tag, uint16_t vlan_ethtype); =20 =20 uint8_t eth_get_gso_type(uint16_t l3_proto, uint8_t *l3_hdr, uint8_t l4pro= to); diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index ce6b102391..af8f77a3f0 100644 --- a/hw/net/net_tx_pkt.c +++ b/hw/net/net_tx_pkt.c @@ -40,7 +40,10 @@ struct NetTxPkt { =20 struct iovec *vec; =20 - uint8_t l2_hdr[ETH_MAX_L2_HDR_LEN]; + struct { + struct eth_header eth; + struct vlan_header vlan[3]; + } l2_hdr; union { struct ip_header ip; struct ip6_header ip6; @@ -365,18 +368,13 @@ bool net_tx_pkt_build_vheader(struct NetTxPkt *pkt, b= ool tso_enable, void net_tx_pkt_setup_vlan_header_ex(struct NetTxPkt *pkt, uint16_t vlan, uint16_t vlan_ethtype) { - bool is_new; assert(pkt); =20 eth_setup_vlan_headers(pkt->vec[NET_TX_PKT_L2HDR_FRAG].iov_base, - vlan, vlan_ethtype, &is_new); + &pkt->vec[NET_TX_PKT_L2HDR_FRAG].iov_len, + vlan, vlan_ethtype); =20 - /* update l2hdrlen */ - if (is_new) { - pkt->hdr_len +=3D sizeof(struct vlan_header); - pkt->vec[NET_TX_PKT_L2HDR_FRAG].iov_len +=3D - sizeof(struct vlan_header); - } + pkt->hdr_len +=3D sizeof(struct vlan_header); } =20 bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, void *base, size_t = len) diff --git a/net/eth.c b/net/eth.c index f7ffbda600..5307978486 100644 --- a/net/eth.c +++ b/net/eth.c @@ -21,26 +21,16 @@ #include "net/checksum.h" #include "net/tap.h" =20 -void eth_setup_vlan_headers(struct eth_header *ehdr, uint16_t vlan_tag, - uint16_t vlan_ethtype, bool *is_new) +void eth_setup_vlan_headers(struct eth_header *ehdr, size_t *ehdr_size, + uint16_t vlan_tag, uint16_t vlan_ethtype) { struct vlan_header *vhdr =3D PKT_GET_VLAN_HDR(ehdr); =20 - switch (be16_to_cpu(ehdr->h_proto)) { - case ETH_P_VLAN: - case ETH_P_DVLAN: - /* vlan hdr exists */ - *is_new =3D false; - break; - - default: - /* No VLAN header, put a new one */ - vhdr->h_proto =3D ehdr->h_proto; - ehdr->h_proto =3D cpu_to_be16(vlan_ethtype); - *is_new =3D true; - break; - } + memmove(vhdr + 1, vhdr, *ehdr_size - ETH_HLEN); vhdr->h_tci =3D cpu_to_be16(vlan_tag); + vhdr->h_proto =3D ehdr->h_proto; + ehdr->h_proto =3D cpu_to_be16(vlan_ethtype); + *ehdr_size +=3D sizeof(*vhdr); } =20 uint8_t --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970044; cv=none; d=zohomail.com; s=zohoarc; b=YvaRDJ9EvRp6xNszVZMv1WBI1QfWylHaTdUjh3w69o+oF7tii/CvEKi7uDD1OUyFy3j8JMuV76WWksIeyfScliNhxMNgfSwh1jYhMElPhsEqe9GQC2t+wi7bR+ZtIpCVlz3N2nkuB9eTdM0nb6Q4CjiTi7B7T7bXt2o/A6j6sCI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970044; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=yyDU87BlE/kQQrI2wYzJ9rXC3RCPhxbvaI9JKH3Mb+E=; b=AssWGwJ40rjzEKyocz4T6gZhK8I35y3UBR7xQToOwgmWMHY6l/qmoIPj7ACOd/C9T404+O+XLWJtNc8C63Q47Cw0arkPbislh0lNn2U4XYm2L9oxm7coxi3GQeG7r3/7cWriR+bQOIOR/tDMhW/Ji77ktHVmK+lKIJXkE4nUYec= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970044767990.951554526189; Wed, 19 Apr 2023 22:54:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAX-0000zz-BC; Thu, 20 Apr 2023 01:49:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAT-0000X7-L9 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:17 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAS-0001Px-07 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:17 -0400 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-24704a7bf34so495157a91.1 for ; Wed, 19 Apr 2023 22:49:15 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969754; x=1684561754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yyDU87BlE/kQQrI2wYzJ9rXC3RCPhxbvaI9JKH3Mb+E=; b=Qbe/1w3XB54213D1eWoj9YtQ2MKWf5oANMFc3aS12ejHjOgn0yRpd3dFVAcHrUxy83 0XrNlh0O5LqO3u6I1nmoTGzopbUeBLOyw/qKERpg8VAYzxue3HpBnaknYTP/IgcMZpfJ INy4+Adem8RTayftA25cpWLFT6jzh+MT93w7Lct7fZs4Ci+eY7jK+KWyBPA1C/dg8IH3 Ke8PcEG3+JnAhFiwyJdmLnXqOlCoSq6MycMaZUvM7zmWXWKWfeJxj15jNJlzud0EArHl YJrwGcOhiVFv2bMR9I+bPChOFqiOXNenAfu1NhZrv1IkmjD5qGu8FtksytGDrOT/5Av2 qsBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969754; x=1684561754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yyDU87BlE/kQQrI2wYzJ9rXC3RCPhxbvaI9JKH3Mb+E=; b=NyxnKMlewHN6/TEA1h4XXlQKvCnvG7sw7kxMa3rBHVhT1kkmvRgyIqeN9RhDztOM6D P07Ka9hwj1HsWBptJtRri9UB7IC014GLlmGgS+3QEUpZoH7rJYGdfdsXCS5Ce5UjZwJ2 W38kaPMDe2SE4C2W3B9lF6PVwsg+ERXj0ShtFWXwrRPSo6Li1BohRzIdDBWmRAx9SoGG 7OLKhasqJifGisVDGKhWucRBE75e4lPDeleKQPCjfJE/xxF1t9YHix5rEgBBBMkH+nUU 9DpsEYtNI4+h6njcEuYMv0QOV+giVZFn9SKc0bEaQNm+RClcJvanY7q8uL7t40fZMYXZ iY7g== X-Gm-Message-State: AAQBX9cRt7pIY4G30aRh8j2n38NpJhduWDyIUBJdnWf3vNjQRKrJ7+TP rvJy+UHaWT7vHJ0pyEHCdkv6og== X-Google-Smtp-Source: AKy350ZNn7o7+1d5itsFxjFUNm20syfgu0/+M7O3e5d1+VviuqJlUh7pYZxIJiVu6pt2a8bsEUKGiA== X-Received: by 2002:a17:90a:7003:b0:233:f393:f6cd with SMTP id f3-20020a17090a700300b00233f393f6cdmr632023pjk.5.1681969754695; Wed, 19 Apr 2023 22:49:14 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 28/41] hw/net/net_rx_pkt: Enforce alignment for eth_header Date: Thu, 20 Apr 2023 14:46:44 +0900 Message-Id: <20230420054657.50367-29-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::102f; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x102f.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970045516100001 Content-Type: text/plain; charset="utf-8" eth_strip_vlan and eth_strip_vlan_ex refers to ehdr_buf as struct eth_header. Enforce alignment for the structure. Signed-off-by: Akihiko Odaki --- hw/net/net_rx_pkt.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c index 6125a063d7..1de42b4f51 100644 --- a/hw/net/net_rx_pkt.c +++ b/hw/net/net_rx_pkt.c @@ -23,7 +23,10 @@ =20 struct NetRxPkt { struct virtio_net_hdr virt_hdr; - uint8_t ehdr_buf[sizeof(struct eth_header) + sizeof(struct vlan_header= )]; + struct { + struct eth_header eth; + struct vlan_header vlan; + } ehdr_buf; struct iovec *vec; uint16_t vec_len_total; uint16_t vec_len; @@ -89,7 +92,7 @@ net_rx_pkt_pull_data(struct NetRxPkt *pkt, if (pkt->ehdr_buf_len) { net_rx_pkt_iovec_realloc(pkt, iovcnt + 1); =20 - pkt->vec[0].iov_base =3D pkt->ehdr_buf; + pkt->vec[0].iov_base =3D &pkt->ehdr_buf; pkt->vec[0].iov_len =3D pkt->ehdr_buf_len; =20 pkt->tot_len =3D pllen + pkt->ehdr_buf_len; @@ -120,7 +123,7 @@ void net_rx_pkt_attach_iovec(struct NetRxPkt *pkt, assert(pkt); =20 if (strip_vlan) { - pkt->ehdr_buf_len =3D eth_strip_vlan(iov, iovcnt, iovoff, pkt->ehd= r_buf, + pkt->ehdr_buf_len =3D eth_strip_vlan(iov, iovcnt, iovoff, &pkt->eh= dr_buf, &ploff, &tci); } else { pkt->ehdr_buf_len =3D 0; @@ -142,7 +145,7 @@ void net_rx_pkt_attach_iovec_ex(struct NetRxPkt *pkt, =20 if (strip_vlan) { pkt->ehdr_buf_len =3D eth_strip_vlan_ex(iov, iovcnt, iovoff, vet, - pkt->ehdr_buf, + &pkt->ehdr_buf, &ploff, &tci); } else { pkt->ehdr_buf_len =3D 0; --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969779; cv=none; d=zohomail.com; s=zohoarc; b=XzPfqQxcA5yqqH6h4+ksmQXh+ZIqIDCoQnqzxl6r1vgCpzpzArn3vFgTQwBWKavxfkC4sEQSY0InijlJiNlbaUJuK4QB1kr91On74rtundLviac5+09/NEURKjp0oSl9pngLAuyR+VsxBaPxEhayN5bNOPyIT3+dzNPOFEtUuYI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969779; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=rBFig1hzkHXQ3n+UcaXDa5HvtCT8+DbEwCzGzLBsJs8=; b=JwPXYxmt0VLbVPBn4nd8d2WNnrIPKr182sRzbC+wLDvmERQ2HyQRda8OYYHh1xrTwBmrwy4lnWLSvOxrFGXz3IrTsI3Nl3364bGnuRcihg4rnZEGmAmXt635V3Hq8KkPwOsBhjq0vCOUtbI8Z7UHS2ycTodvUMuNkG+bgwGjzbs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969779357788.0774438736729; Wed, 19 Apr 2023 22:49:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAb-0001A4-Jo; Thu, 20 Apr 2023 01:49:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAX-00010I-Bt for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:21 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAV-0001RC-7e for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:20 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-517c840f181so360214a12.3 for ; Wed, 19 Apr 2023 22:49:18 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969758; x=1684561758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rBFig1hzkHXQ3n+UcaXDa5HvtCT8+DbEwCzGzLBsJs8=; b=dFrR7STUWwTcAPHDABLqRHslXowSmoD28087dFsgNcT5KCfYLeBYX6a0jFolohDAwI +fIeKM2rmnkPVn64z7n7M3kCqHQfP80G//nU12iUA89+giiw04XWmOBa0KFnPkGLMTlm wrg3nP34GMWObXItbvNWGghfgCsrXRfX+8HE+GCMdcC2ALFK6/K9nWuYxPU8zpZSPEl+ ODcTw3xQiN0BT2hppIkmA9vW56yXh+LyBAatnlV+A8JWXkZlcmluMzKE1w0RajjxuM4l TbRh4iMq7Bc2xmeLOy3XK82kq5ZC+u5q1ixv/W9TTsAVKJI9KSXFhXvP7a1IbZvnSKLM 95RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969758; x=1684561758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rBFig1hzkHXQ3n+UcaXDa5HvtCT8+DbEwCzGzLBsJs8=; b=KkulqPL720LT2CYA09fVBc3/TTgmoJhW96eL+NKKsxAjQv9XArKs7mzRUvhFaLwL3P Gt6AbwkLMRlxQaHVoSrANFOjS4W1EMVENzpgcSwpzuaTMrTjwVFxxKa84nRULBEU7CLg 0JEcP3ZFpxpwVi7IC9E1CR5+Mcjxz1uwWm+TjDZnhAY381i3WsX62y8vNIypelTAzJcG aDH+W9QJ+1MmecMuVEHlHCLrLRJcth/PiZ8monmmFs6RZkmWXZHXMdTDKyDJkrB/RJrs F6p2O/kT1u7YH7S7aBmRnAqFKEOQu4CZDLIB8W7JRVG2foFTy+IHf4r7ES65ukAvdsLj XfcA== X-Gm-Message-State: AAQBX9ca3K1ZNXAYkj3C+XmhdPMMmDH8cJNjiQLlKJwawnbUtIEEeO8J BD8IymApVp5unJsdaRFLl/MYXw== X-Google-Smtp-Source: AKy350YRThRWr+5/kParTB72ft8Pk+C2zUeVX+2hikDCagEh3Huk9bWaomzq7ZomqnROedVPWiOiug== X-Received: by 2002:a17:90a:fb4d:b0:246:9a43:39e5 with SMTP id iq13-20020a17090afb4d00b002469a4339e5mr532023pjb.23.1681969758106; Wed, 19 Apr 2023 22:49:18 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 29/41] tests/qtest/libqos/igb: Set GPIE.Multiple_MSIX Date: Thu, 20 Apr 2023 14:46:45 +0900 Message-Id: <20230420054657.50367-30-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::52c; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969781729100001 Content-Type: text/plain; charset="utf-8" GPIE.Multiple_MSIX is not set by default, and needs to be set to get interrupts from multiple MSI-X vectors. Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- tests/qtest/libqos/igb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/libqos/igb.c b/tests/qtest/libqos/igb.c index 12fb531bf0..a603468beb 100644 --- a/tests/qtest/libqos/igb.c +++ b/tests/qtest/libqos/igb.c @@ -114,6 +114,7 @@ static void igb_pci_start_hw(QOSGraphObject *obj) e1000e_macreg_write(&d->e1000e, E1000_RCTL, E1000_RCTL_EN); =20 /* Enable all interrupts */ + e1000e_macreg_write(&d->e1000e, E1000_GPIE, E1000_GPIE_MSIX_MODE); e1000e_macreg_write(&d->e1000e, E1000_IMS, 0xFFFFFFFF); e1000e_macreg_write(&d->e1000e, E1000_EIMS, 0xFFFFFFFF); =20 --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970039; cv=none; d=zohomail.com; s=zohoarc; b=CQfg27rZ4Tq75xAppjXqz+s9VCcLPrXAja+Gfab1gjb7PzFy8pAhQDCRMmrvNobb92P07b0pRBT4pC7J76iBiKHBuPyzF7w0CQA7nqrxFco3GVsE/k8g7yZoDqX/Gq2zBCiuuqqFbQa9p4a1pylbo/caia3yzs9P8wtzimOqssE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970039; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=EkFnOWz8k65GM78Vyn6pXiVzR9tMO/XJPCs+OY+XiaI=; b=R0igevPLs02cibGQI+0BOpecyRwMVrHteCPWSYeqZMKsQO2HiTqJRFC/Re2igaprERAvYLhBwHF9lm6ivqsk5aZFu8PS9UD5qDmZrr5EmJ5D2KkSc1GJmuzG3kvRbmxiKBdXfyRMy94scsxpoHAmXFODk0nYz6i6jTyTBPHGppU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970039886928.4065845692314; Wed, 19 Apr 2023 22:53:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAp-0001XW-It; Thu, 20 Apr 2023 01:49:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAa-0001Fd-BP for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:25 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAY-0001Rg-Ml for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:24 -0400 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-24781e23c27so508615a91.0 for ; Wed, 19 Apr 2023 22:49:22 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969761; x=1684561761; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EkFnOWz8k65GM78Vyn6pXiVzR9tMO/XJPCs+OY+XiaI=; b=Mp4j0c2kuhf2ZlEuma9sk80kSAWTE2MkAvRTv4AE1d8FB6Biz747jB65m5LRnwvh7w ae5J9H/d8E81Hr1Mhv2odznz+An+92keMUXNBAb9ZlrG8A9WRkJCHUkvP8G6yRm7Q0/Q H2x64uBguon/t7nPufkRWxMlmNDm0vOcDSC3IV0egd3Smq70kS2lAi5xra0GrwGhcr8K taqcUWw7nZM92sBnjiIPUNxUXTajX5Sxe+WzNKsyanE9HHe/sUl+HGmOm5IzEnE4J6jw mej1f2atOneeXf3HfK4iMYigr6pwq6fMnxr02Vv+K5UHwJgP62p++sEJhbteY9e92nUZ xk5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969761; x=1684561761; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EkFnOWz8k65GM78Vyn6pXiVzR9tMO/XJPCs+OY+XiaI=; b=dVAHEZd8ufcePNANtL1aX2nnyl70XtxVPeElQxA5ywCD9OMregTr0cnXooLFmVrFMd 4GvQfSjRghIkC3RBjvgNhKRLplE3HPGcXyceeqMxpczUAUatL6HUipasvr4JP/WfhPDS pLKBk/P1dGDj3wsuSdXuc3S2KykJz/X+IvmGOoqDgoXJViP8c6iQSD8/3Xne7F6UHguD GJVCh4hQQx45sSCrnumZvbgTWdaqmDHVOgGrjmrOdZiQtqCVZV6mwn+2KyhwJfi/V3pp 040iqEYraC9OE4+F2DXFhJonKzBni4/4Y6gU2fEPWHgTqDbfdqB8DEQRtE1mOoXhKWs0 +zvg== X-Gm-Message-State: AAQBX9c8je5ajjDdmKBMCMvzZahfLaPRedAUz+/sAlbCRDw0VWeOs84e /phVxUSB8HkE6VUD1ZwbZX2gWChnFpj+hpFe8hk= X-Google-Smtp-Source: AKy350aLOK852XIVGlNoSX8qW95WsJwyDxZC+kjNJ5xhGOlKX7eSZ/KiOVkDA+Ss95z7Gu4nWPwF2g== X-Received: by 2002:a17:90a:3181:b0:247:8b61:a41 with SMTP id j1-20020a17090a318100b002478b610a41mr475328pjb.25.1681969761579; Wed, 19 Apr 2023 22:49:21 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 30/41] igb: Implement MSI-X single vector mode Date: Thu, 20 Apr 2023 14:46:46 +0900 Message-Id: <20230420054657.50367-31-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::102e; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970042180100007 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- hw/net/igb_core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index c24c522244..2c287688c7 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1870,7 +1870,7 @@ igb_update_interrupt_state(IGBCore *core) =20 icr =3D core->mac[ICR] & core->mac[IMS]; =20 - if (msix_enabled(core->owner)) { + if (core->mac[GPIE] & E1000_GPIE_MSIX_MODE) { if (icr) { causes =3D 0; if (icr & E1000_ICR_DRSTA) { @@ -1905,7 +1905,12 @@ igb_update_interrupt_state(IGBCore *core) trace_e1000e_irq_pending_interrupts(core->mac[ICR] & core->mac[IMS= ], core->mac[ICR], core->mac[IMS]= ); =20 - if (msi_enabled(core->owner)) { + if (msix_enabled(core->owner)) { + if (icr) { + trace_e1000e_irq_msix_notify_vec(0); + msix_notify(core->owner, 0); + } + } else if (msi_enabled(core->owner)) { if (icr) { msi_notify(core->owner, 0); } --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970045; cv=none; d=zohomail.com; s=zohoarc; b=ScEiKd1vowECnGxbW4dyIaM07Z/ITrb4sL9YdCvgI/AaxlmZkdlr5C3olIAajINE+mllXNl6uBN3TiaR9IfF2iMCpmz2vPWIDZh+JkFJeQNjDm2zzumssrAiK9Y+Yt8nuB7TfVXx3fTW+wUa2xe/+YQROgbKbJGVfvZ72k6Kgnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970045; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=FpLAmFhaGGWzHy8uwTYLfcxMLDVGf3X74q8OXPUW5Xg=; b=XkfdeEr3uJASQISud2T6Op5xgH0qqlgOQCkdFlVFe3iifoGgpeukF6h85Qf1CXLPdDz66jkfV/vCz7lznrXqMwkNIOv4LmrN/eHgbBQEswlld94/XZHsH/syI8EOUHx7zBqGSvRF2ld+XTgvpMFE3IZD7hmvMRP+M/pwPcWuZO0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970045166253.78216809870514; Wed, 19 Apr 2023 22:54:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAs-0001qR-HE; Thu, 20 Apr 2023 01:49:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAm-0001VN-Kb for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:37 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAc-0001SP-RW for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:28 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1a5197f00e9so6782895ad.1 for ; Wed, 19 Apr 2023 22:49:25 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969765; x=1684561765; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FpLAmFhaGGWzHy8uwTYLfcxMLDVGf3X74q8OXPUW5Xg=; b=chMZfarAFrXYMrwltz7tLPs/pXcION/Sf437LUpeY5JjrPajE+n+ZaMEcNS3iheS8R 3In2b0zWKRzPxhnqH8piDUMGb9tcV8OgywgGmf66YKmJgjEbwTPwK+ay6TDvvRxmlhbJ d7xblFBNCelLX+OxbSIZRMFyq5qkw2dp1j1e9gAhJdr3uLqGoOtLSztGMZQ0WXLfWC/k tbQMWh4fAMR97SVvhAzcPcjxF8AUW8W2EZ39T003viS4BW/em9Ogz+M+ml/U4i6IxFMy 97qhgiw2Vo/jn5aONrUFna8km1mbWuIylqQtcVdRZ1yOsrkHR3jXrOrA8TL7ldq9P00g uRgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969765; x=1684561765; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FpLAmFhaGGWzHy8uwTYLfcxMLDVGf3X74q8OXPUW5Xg=; b=V3fw9TwoUYutc1KvWtluSp/SSCXJFBmyJCbXgYmW8xVWDBO4tbFNDaRpoMN1qq7p86 uuITnXlZVnPZlAx3rw15aMBT3jtcBX6c4KfxU4fnrYJrV+FtH31kIJVvzQsilWK8SEH5 2x9hjL6/S26M464qhVyr4qEKq0iKYX6b6UTc3M7aBSu75TbAikEERq01HPrnX7rAeNmO /d+cO+Z9mblQAvLNKIu28PZvQ4tN48kmkdnSVJmRKwLtEp+kTlibB0WoFjVIfHQVXLDZ K/65thBQBbUDYYdUKsp0Y9DNy8Jjw9qAmRvjwx5hl8nMgO0Nb1zKKOHGx6ku0vCv2CMg fp6g== X-Gm-Message-State: AAQBX9djk3LakUcPI8UR/inR4OG/ZvyJNOfcm7mfevvzoYHnwWmASI1b lsbUbNR3Nt0mSDp9DiV2hT9d1A== X-Google-Smtp-Source: AKy350aClLECq8MRP9EmMXz+f+TdmRyiL+CjubvZV0jvLeEd4fiCGocGPw6moA05q2ywLV9hAztmtg== X-Received: by 2002:a17:903:495:b0:1a6:7fb1:8de7 with SMTP id jj21-20020a170903049500b001a67fb18de7mr465337plb.24.1681969764945; Wed, 19 Apr 2023 22:49:24 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 31/41] igb: Use UDP for RSS hash Date: Thu, 20 Apr 2023 14:46:47 +0900 Message-Id: <20230420054657.50367-32-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::629; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x629.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970046701100006 Content-Type: text/plain; charset="utf-8" e1000e does not support using UDP for RSS hash, but igb does. Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- hw/net/igb_regs.h | 3 +++ hw/net/igb_core.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/hw/net/igb_regs.h b/hw/net/igb_regs.h index eb995d8b2e..e6ac26dc0e 100644 --- a/hw/net/igb_regs.h +++ b/hw/net/igb_regs.h @@ -659,6 +659,9 @@ union e1000_adv_rx_desc { =20 #define E1000_RSS_QUEUE(reta, hash) (E1000_RETA_VAL(reta, hash) & 0x0F) =20 +#define E1000_MRQ_RSS_TYPE_IPV4UDP 7 +#define E1000_MRQ_RSS_TYPE_IPV6UDP 8 + #define E1000_STATUS_IOV_MODE 0x00040000 =20 #define E1000_STATUS_NUM_VFS_SHIFT 14 diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 2c287688c7..4dc8e3ae7b 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -279,6 +279,11 @@ igb_rss_get_hash_type(IGBCore *core, struct NetRxPkt *= pkt) return E1000_MRQ_RSS_TYPE_IPV4TCP; } =20 + if (l4hdr_proto =3D=3D ETH_L4_HDR_PROTO_UDP && + (core->mac[MRQC] & E1000_MRQC_RSS_FIELD_IPV4_UDP)) { + return E1000_MRQ_RSS_TYPE_IPV4UDP; + } + if (E1000_MRQC_EN_IPV4(core->mac[MRQC])) { return E1000_MRQ_RSS_TYPE_IPV4; } @@ -314,6 +319,11 @@ igb_rss_get_hash_type(IGBCore *core, struct NetRxPkt *= pkt) return E1000_MRQ_RSS_TYPE_IPV6TCPEX; } =20 + if (l4hdr_proto =3D=3D ETH_L4_HDR_PROTO_UDP && + (core->mac[MRQC] & E1000_MRQC_RSS_FIELD_IPV6_UDP)) { + return E1000_MRQ_RSS_TYPE_IPV6UDP; + } + if (E1000_MRQC_EN_IPV6EX(core->mac[MRQC])) { return E1000_MRQ_RSS_TYPE_IPV6EX; } @@ -352,6 +362,12 @@ igb_rss_calc_hash(IGBCore *core, struct NetRxPkt *pkt,= E1000E_RSSInfo *info) case E1000_MRQ_RSS_TYPE_IPV6EX: type =3D NetPktRssIpV6Ex; break; + case E1000_MRQ_RSS_TYPE_IPV4UDP: + type =3D NetPktRssIpV4Udp; + break; + case E1000_MRQ_RSS_TYPE_IPV6UDP: + type =3D NetPktRssIpV6Udp; + break; default: assert(false); return 0; --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969897; cv=none; d=zohomail.com; s=zohoarc; b=jweSlZVfTTGCFQf0gbGVLBAfJxUHproe6juugJ+USpC390/ijYhT86vv0FnFhkMfp3mr7RhBR3QxvBkMHa7Dxy4RvH5+Bh2lx7v+vkNqG62h1UjKHc9PgGXuszjPmLTkcIwt85EsCcYJvT/Nv1NdS13ZT4xP5jHjwlNGZXZRzIY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969897; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=9Lv0d/NV+0ZkMGVu+9Ymh1dbGLX5ZQ2hSmdHi6ZuVv8=; b=bllp0yCahg6T+QhPy7wDwWLLAnlt9697CKndSGjTKi0qyvMouqnA0e4Cu0ij7XBFa15g4O3Ru/XZc/01RlkDLZXVas4gd+0Wja+jaGvaTx0ZEIXKfpwl38blcyrMiJvzkm7FO7hujsd5MEnlTEG+2Zo3JB4MCwX2zyxg4dYIEL4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969897737784.8117251336676; Wed, 19 Apr 2023 22:51:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAu-0002Bx-4q; Thu, 20 Apr 2023 01:49:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAo-0001a4-Jc for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:39 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAk-0001T2-RS for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:37 -0400 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-517bb01bac9so409221a12.0 for ; Wed, 19 Apr 2023 22:49:29 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969768; x=1684561768; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9Lv0d/NV+0ZkMGVu+9Ymh1dbGLX5ZQ2hSmdHi6ZuVv8=; b=RSYufEEXzLXsICpK/7TjdFcabMShjg3N7q90g97xhpeMMl/wO7wFne1NVNlfpoTsoh lPTP2BvhEq3K0xhGBVVzKWDA714JfsA3XbjqPJhLY1ZSQuS1PGOhR4WNYtl6Be8qcocK qjYbeoBDFq5Z8mD5lfWUg3wLnWLgCu1AyaBLpa0T/h1U7fijV/Ypl06jS582Whpnu7XR UysSB+GP0h1Ljm2XN8nEewjLUg8cFH6lp0Zocs2gP/qG6wjlba9DVadMaR9x1DDqKjb2 he1l31RUgJkjsBWfRXU5hECmhYqLG2EYFTJn8utIm9iu4H2jwlqd/m/76Axf2KmeZMcC HCdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969768; x=1684561768; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9Lv0d/NV+0ZkMGVu+9Ymh1dbGLX5ZQ2hSmdHi6ZuVv8=; b=Mfx2/KJQ9NQG3/O3zQ13tnBpvwjf/+Y7qbYKbkee2Sgui1tydEJsB4GYJ2qWldODqu qlTNdY0Ff7sxwBsqrp2EMPAX8riRjlHawgpsvrAd7Rm/wRfcoXN4QasmpSX8Krd1lCvo uox+FTj2B2lGrAO0gqfhGxAzW++VTY+uY9d/rMWkKcL8LToqoMm7p+FaMiRhKEh7t6Um SqdbAFlRICTyZqVx+nU8UOymLCIOzXdWm0eV/EPE5x/Bkv+cm2/fHweAp7yvsWTFVJh3 NyzZE2pNLJQrPp1/iGtXz9D3v3SrHZFmtO1MNFItvUo+yjK+kiGtoJH/EnIeQLfVEVfM FlCw== X-Gm-Message-State: AAQBX9fjLXOoi/YP2YLc5kKsMazKRRcsyMYBlJ+OGGn2Fcncu1+KpbEn WjxDy+5OAZn1QufASP2yJ9/yKA== X-Google-Smtp-Source: AKy350Z64Ye5DpNJXQx5IUAUC6cED1HC92npkW6S4IsjUG1uMyeSF7tkG2u0MQPL9V5OwU6hCxD/lw== X-Received: by 2002:a17:90a:940f:b0:246:b4b4:555f with SMTP id r15-20020a17090a940f00b00246b4b4555fmr707764pjo.7.1681969768371; Wed, 19 Apr 2023 22:49:28 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 32/41] igb: Implement Rx SCTP CSO Date: Thu, 20 Apr 2023 14:46:48 +0900 Message-Id: <20230420054657.50367-33-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::52d; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969898975100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki --- hw/net/igb_regs.h | 1 + include/net/eth.h | 4 ++- include/qemu/crc32c.h | 1 + hw/net/e1000e_core.c | 5 ++++ hw/net/igb_core.c | 15 +++++++++- hw/net/net_rx_pkt.c | 64 +++++++++++++++++++++++++++++++++++-------- net/eth.c | 4 +++ util/crc32c.c | 8 ++++++ 8 files changed, 89 insertions(+), 13 deletions(-) diff --git a/hw/net/igb_regs.h b/hw/net/igb_regs.h index e6ac26dc0e..4b4ebd3369 100644 --- a/hw/net/igb_regs.h +++ b/hw/net/igb_regs.h @@ -670,6 +670,7 @@ union e1000_adv_rx_desc { #define E1000_ADVRXD_PKT_IP6 BIT(6) #define E1000_ADVRXD_PKT_TCP BIT(8) #define E1000_ADVRXD_PKT_UDP BIT(9) +#define E1000_ADVRXD_PKT_SCTP BIT(10) =20 static inline uint8_t igb_ivar_entry_rx(uint8_t i) { diff --git a/include/net/eth.h b/include/net/eth.h index 048e434685..75e7f1551c 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -224,6 +224,7 @@ struct tcp_hdr { #define IP_HEADER_VERSION_6 (6) #define IP_PROTO_TCP (6) #define IP_PROTO_UDP (17) +#define IP_PROTO_SCTP (132) #define IPTOS_ECN_MASK 0x03 #define IPTOS_ECN(x) ((x) & IPTOS_ECN_MASK) #define IPTOS_ECN_CE 0x03 @@ -379,7 +380,8 @@ typedef struct eth_ip4_hdr_info_st { typedef enum EthL4HdrProto { ETH_L4_HDR_PROTO_INVALID, ETH_L4_HDR_PROTO_TCP, - ETH_L4_HDR_PROTO_UDP + ETH_L4_HDR_PROTO_UDP, + ETH_L4_HDR_PROTO_SCTP } EthL4HdrProto; =20 typedef struct eth_l4_hdr_info_st { diff --git a/include/qemu/crc32c.h b/include/qemu/crc32c.h index 5b78884c38..88b4d2b3b3 100644 --- a/include/qemu/crc32c.h +++ b/include/qemu/crc32c.h @@ -30,5 +30,6 @@ =20 =20 uint32_t crc32c(uint32_t crc, const uint8_t *data, unsigned int length); +uint32_t iov_crc32c(uint32_t crc, const struct iovec *iov, size_t iov_cnt); =20 #endif diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 27124bba07..8b35735799 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1114,6 +1114,11 @@ e1000e_verify_csum_in_sw(E1000ECore *core, return; } =20 + if (l4hdr_proto !=3D ETH_L4_HDR_PROTO_TCP && + l4hdr_proto !=3D ETH_L4_HDR_PROTO_UDP) { + return; + } + if (!net_rx_pkt_validate_l4_csum(pkt, &csum_valid)) { trace_e1000e_rx_metadata_l4_csum_validation_failed(); return; diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 4dc8e3ae7b..b7f7e765a5 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1212,7 +1212,7 @@ igb_build_rx_metadata(IGBCore *core, uint16_t *vlan_tag) { struct virtio_net_hdr *vhdr; - bool hasip4, hasip6; + bool hasip4, hasip6, csum_valid; EthL4HdrProto l4hdr_proto; =20 *status_flags =3D E1000_RXD_STAT_DD; @@ -1272,6 +1272,10 @@ igb_build_rx_metadata(IGBCore *core, *pkt_info |=3D E1000_ADVRXD_PKT_UDP; break; =20 + case ETH_L4_HDR_PROTO_SCTP: + *pkt_info |=3D E1000_ADVRXD_PKT_SCTP; + break; + default: break; } @@ -1304,6 +1308,15 @@ igb_build_rx_metadata(IGBCore *core, =20 if (igb_rx_l4_cso_enabled(core)) { switch (l4hdr_proto) { + case ETH_L4_HDR_PROTO_SCTP: + if (!net_rx_pkt_validate_l4_csum(pkt, &csum_valid)) { + trace_e1000e_rx_metadata_l4_csum_validation_failed(); + goto func_exit; + } + if (!csum_valid) { + *status_flags |=3D E1000_RXDEXT_STATERR_TCPE; + } + /* fall through */ case ETH_L4_HDR_PROTO_TCP: *status_flags |=3D E1000_RXD_STAT_TCPCS; break; diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c index 1de42b4f51..3575c8b9f9 100644 --- a/hw/net/net_rx_pkt.c +++ b/hw/net/net_rx_pkt.c @@ -16,6 +16,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/crc32c.h" #include "trace.h" #include "net_rx_pkt.h" #include "net/checksum.h" @@ -554,32 +555,73 @@ _net_rx_pkt_calc_l4_csum(struct NetRxPkt *pkt) return csum; } =20 -bool net_rx_pkt_validate_l4_csum(struct NetRxPkt *pkt, bool *csum_valid) +static bool +_net_rx_pkt_validate_sctp_sum(struct NetRxPkt *pkt) { - uint16_t csum; + size_t csum_off; + size_t off =3D pkt->l4hdr_off; + size_t vec_len =3D pkt->vec_len; + struct iovec *vec; + uint32_t calculated =3D 0; + uint32_t original; + bool valid; =20 - trace_net_rx_pkt_l4_csum_validate_entry(); + for (vec =3D pkt->vec; vec->iov_len < off; vec++) { + off -=3D vec->iov_len; + vec_len--; + } =20 - if (pkt->l4hdr_info.proto !=3D ETH_L4_HDR_PROTO_TCP && - pkt->l4hdr_info.proto !=3D ETH_L4_HDR_PROTO_UDP) { - trace_net_rx_pkt_l4_csum_validate_not_xxp(); + csum_off =3D off + 8; + + if (!iov_to_buf(vec, vec_len, csum_off, &original, sizeof(original))) { return false; } =20 - if (pkt->l4hdr_info.proto =3D=3D ETH_L4_HDR_PROTO_UDP && - pkt->l4hdr_info.hdr.udp.uh_sum =3D=3D 0) { - trace_net_rx_pkt_l4_csum_validate_udp_with_no_checksum(); + if (!iov_from_buf(vec, vec_len, csum_off, + &calculated, sizeof(calculated))) { return false; } =20 + calculated =3D crc32c(0xffffffff, + (uint8_t *)vec->iov_base + off, vec->iov_len - off= ); + calculated =3D iov_crc32c(calculated ^ 0xffffffff, vec + 1, vec_len - = 1); + valid =3D calculated =3D=3D le32_to_cpu(original); + iov_from_buf(vec, vec_len, csum_off, &original, sizeof(original)); + + return valid; +} + +bool net_rx_pkt_validate_l4_csum(struct NetRxPkt *pkt, bool *csum_valid) +{ + uint32_t csum; + + trace_net_rx_pkt_l4_csum_validate_entry(); + if (pkt->hasip4 && pkt->ip4hdr_info.fragment) { trace_net_rx_pkt_l4_csum_validate_ip4_fragment(); return false; } =20 - csum =3D _net_rx_pkt_calc_l4_csum(pkt); + switch (pkt->l4hdr_info.proto) { + case ETH_L4_HDR_PROTO_UDP: + if (pkt->l4hdr_info.hdr.udp.uh_sum =3D=3D 0) { + trace_net_rx_pkt_l4_csum_validate_udp_with_no_checksum(); + return false; + } + /* fall through */ + case ETH_L4_HDR_PROTO_TCP: + csum =3D _net_rx_pkt_calc_l4_csum(pkt); + *csum_valid =3D ((csum =3D=3D 0) || (csum =3D=3D 0xFFFF)); + break; + + case ETH_L4_HDR_PROTO_SCTP: + *csum_valid =3D _net_rx_pkt_validate_sctp_sum(pkt); + break; =20 - *csum_valid =3D ((csum =3D=3D 0) || (csum =3D=3D 0xFFFF)); + default: + trace_net_rx_pkt_l4_csum_validate_not_xxp(); + return false; + } =20 trace_net_rx_pkt_l4_csum_validate_csum(*csum_valid); =20 diff --git a/net/eth.c b/net/eth.c index 5307978486..7f02aea010 100644 --- a/net/eth.c +++ b/net/eth.c @@ -211,6 +211,10 @@ void eth_get_protocols(const struct iovec *iov, size_t= iovcnt, size_t iovoff, *l5hdr_off =3D *l4hdr_off + sizeof(l4hdr_info->hdr.udp); } break; + + case IP_PROTO_SCTP: + l4hdr_info->proto =3D ETH_L4_HDR_PROTO_SCTP; + break; } } =20 diff --git a/util/crc32c.c b/util/crc32c.c index 762657d853..ea7f345de8 100644 --- a/util/crc32c.c +++ b/util/crc32c.c @@ -113,3 +113,11 @@ uint32_t crc32c(uint32_t crc, const uint8_t *data, uns= igned int length) return crc^0xffffffff; } =20 +uint32_t iov_crc32c(uint32_t crc, const struct iovec *iov, size_t iov_cnt) +{ + while (iov_cnt--) { + crc =3D crc32c(crc, iov->iov_base, iov->iov_len) ^ 0xffffffff; + iov++; + } + return crc ^ 0xffffffff; +} --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969799; cv=none; d=zohomail.com; s=zohoarc; b=DmxdHAnetf3QG/i1Dcqq1jqNhq68fkB27fbvcFBrdWAQQlKOvgPjPANOsDrbgyDEBS5dak8/Q88HOSIqhyLJxtz1sygi0DA4oZQFmGnHyIgdznBt1qc+OzjUdl4mPSgOtzWWOzagiYg9xSvYL0lWGtR0vf5zHNpdRa7mYLh7Ncg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969799; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=lhHRazQ1Xyz5kEvlAe8Bgx9OM5ANAAvESgkitu1uPko=; b=ImqAzw8bSxVQ1PgF7aoAPfE2ec5oeJzfE8zNlqfz8DcSvmcbXLmYHH6MShDo23XYcHRJEX3uTWUhLo4uybBi53YycJhCNwB+vFjzSGGsqhvw6ql32mj40CflLVMhAtnChOmvyNaQ/dTj/jgUofWCkp1mPUHjWQaHBoKaG7DKQhc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969799316369.6064584134417; Wed, 19 Apr 2023 22:49:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAu-0002EM-Bk; Thu, 20 Apr 2023 01:49:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAo-0001Xj-29 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:39 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAm-0001Uy-CK for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:37 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1a814fe0ddeso8063325ad.2 for ; Wed, 19 Apr 2023 22:49:32 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969772; x=1684561772; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lhHRazQ1Xyz5kEvlAe8Bgx9OM5ANAAvESgkitu1uPko=; b=H90fVT2SfgqPG+kOaqBaH4ovrZI/4vmMLGtHKZlDL0Bj4es/jcfgPt/R0yrt5ZtSnA KytOzbY6pXTXCZ5vua0Pz/Ghhjm4ZtWhACNCoG1TAqiTaRhYaVS78ONX5O+QOPIUI7u0 fdPaOGj1MVHD3eXHZSGD4bm4F0ZnUwUdxei0pH5vs3Ax42G9rgPXH2qHCT6sZ9jBGS9Z duqZoPpuNM33uw+5dr2oXVycXsg6rLej9QQJHeeiBBEqT4A2XqRpNEgPKbAVZhhXqIV/ kUMWmfaSL2L7SREFj9fSCCf0Rm7g3F8OjcqLbsdUwGtImWy0pBncN4ft3s105X/yAexz YnEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969772; x=1684561772; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lhHRazQ1Xyz5kEvlAe8Bgx9OM5ANAAvESgkitu1uPko=; b=YUuRwmxmrGaxTcMVKlQpujnvaCNUP1bh+/SxK4qs8Wl7chZpHLCGYu8nzgWeAxc2dz aSNIXCSOTL4qNARVCatEAIznf//h2cj3fWDmXi9lPntLG93E+E/izyUtKGBdJ5cBbidO np1JsDUcKpW/z+hJfniGefOLuO3fPG/Wj8slLlfUEozZtcjplcBevo1W2geFKhUNacLN Rh9TPayZJEj+HyBEoppUeBVf9CWD2x4ha6oDFGN4G8KBTBdI2pBb0kwJyETsOAd/XE2d z+iPTZhW6jzgA5lrD/QUxepggOMq9Sy1Mv6J6luS4dnZtk4DXA/DB+WRa6rz1sEvhhMO 8iRQ== X-Gm-Message-State: AAQBX9fzBG0/6khohnN1oK9mZ6UVoVfTf7WotVat/nofDexNiqMCl1Si rwAk7jqW3VKu5IKv6J7yBpCJqw== X-Google-Smtp-Source: AKy350a2filE4g+Fktu46cSWXeAL0CATyxUdRZgJpewqKQTbKvPUvmx6gfVFFrNNkxSKJudTEsesEQ== X-Received: by 2002:a17:902:ecd0:b0:1a6:8d57:5c0b with SMTP id a16-20020a170902ecd000b001a68d575c0bmr367339plh.67.1681969771922; Wed, 19 Apr 2023 22:49:31 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 33/41] igb: Implement Tx SCTP CSO Date: Thu, 20 Apr 2023 14:46:49 +0900 Message-Id: <20230420054657.50367-34-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::631; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x631.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969800152100011 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki --- hw/net/net_tx_pkt.h | 8 ++++++++ hw/net/igb_core.c | 12 +++++++----- hw/net/net_tx_pkt.c | 18 ++++++++++++++++++ 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/hw/net/net_tx_pkt.h b/hw/net/net_tx_pkt.h index f5cd44da6f..fc00d7941d 100644 --- a/hw/net/net_tx_pkt.h +++ b/hw/net/net_tx_pkt.h @@ -116,6 +116,14 @@ void net_tx_pkt_update_ip_checksums(struct NetTxPkt *p= kt); */ void net_tx_pkt_update_ip_hdr_checksum(struct NetTxPkt *pkt); =20 +/** + * Calculate the SCTP checksum. + * + * @pkt: packet + * + */ +bool net_tx_pkt_update_sctp_checksum(struct NetTxPkt *pkt); + /** * get length of all populated data. * diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index b7f7e765a5..00fd163bf3 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -432,8 +432,9 @@ igb_tx_insert_vlan(IGBCore *core, uint16_t qn, struct i= gb_tx *tx, static bool igb_setup_tx_offloads(IGBCore *core, struct igb_tx *tx) { + uint32_t idx =3D (tx->first_olinfo_status >> 4) & 1; + if (tx->first_cmd_type_len & E1000_ADVTXD_DCMD_TSE) { - uint32_t idx =3D (tx->first_olinfo_status >> 4) & 1; uint32_t mss =3D tx->ctx[idx].mss_l4len_idx >> E1000_ADVTXD_MSS_SH= IFT; if (!net_tx_pkt_build_vheader(tx->tx_pkt, true, true, mss)) { return false; @@ -444,10 +445,11 @@ igb_setup_tx_offloads(IGBCore *core, struct igb_tx *t= x) return true; } =20 - if (tx->first_olinfo_status & E1000_ADVTXD_POTS_TXSM) { - if (!net_tx_pkt_build_vheader(tx->tx_pkt, false, true, 0)) { - return false; - } + if ((tx->first_olinfo_status & E1000_ADVTXD_POTS_TXSM) && + !((tx->ctx[idx].type_tucmd_mlhl & E1000_ADVTXD_TUCMD_L4T_SCTP) ? + net_tx_pkt_update_sctp_checksum(tx->tx_pkt) : + net_tx_pkt_build_vheader(tx->tx_pkt, false, true, 0))) { + return false; } =20 if (tx->first_olinfo_status & E1000_ADVTXD_POTS_IXSM) { diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index af8f77a3f0..2e5f58b3c9 100644 --- a/hw/net/net_tx_pkt.c +++ b/hw/net/net_tx_pkt.c @@ -16,6 +16,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/crc32c.h" #include "net/eth.h" #include "net/checksum.h" #include "net/tap.h" @@ -135,6 +136,23 @@ void net_tx_pkt_update_ip_checksums(struct NetTxPkt *p= kt) pkt->virt_hdr.csum_offset, &csum, sizeof(csum)); } =20 +bool net_tx_pkt_update_sctp_checksum(struct NetTxPkt *pkt) +{ + uint32_t csum =3D 0; + struct iovec *pl_start_frag =3D pkt->vec + NET_TX_PKT_PL_START_FRAG; + + if (iov_from_buf(pl_start_frag, pkt->payload_frags, 8, &csum, sizeof(c= sum)) < sizeof(csum)) { + return false; + } + + csum =3D cpu_to_le32(iov_crc32c(0xffffffff, pl_start_frag, pkt->payloa= d_frags)); + if (iov_from_buf(pl_start_frag, pkt->payload_frags, 8, &csum, sizeof(c= sum)) < sizeof(csum)) { + return false; + } + + return true; +} + static void net_tx_pkt_calculate_hdr_len(struct NetTxPkt *pkt) { pkt->hdr_len =3D pkt->vec[NET_TX_PKT_L2HDR_FRAG].iov_len + --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969887; cv=none; d=zohomail.com; s=zohoarc; b=WDGwvRuWSQ+Hu2yhzk1MqZgHufbuv/SddV718Zhaw6b5VwNAmAoaMAQQtk6Arf2Ymh8haBeHuU6kvlH6c390Da7u2XafB/1d87F2uhrYBUgXCh2cph2oXfXB3AtvdBYAeR6tUqP5z4ZqnaB0li4gj8INmkh1QYfJCYYNBc8s/xA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969887; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=Dq92rSu8aDGjRaomXrRgMkHeyUSHbPBAOE2GXxrm/c8=; b=O6OZR9iUDc4KUmLxrTAaXqMkMFWlwaPe2DE+gCLUlcol+o8dr6WIf9Tp0K29/7damNFigVN0bKrsVcsh80c5YMqe9xkHrfLhacogUP7rOjCNSFLN+JdCKJd5vvhbA5ae2DIJh/DanGsGTnidP2vcwCTC8nf6P4zY/gceUl7/rco= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTP id 1681969887833445.27773422850885; Wed, 19 Apr 2023 22:51:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAw-0002R5-B5; Thu, 20 Apr 2023 01:49:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAq-0001ha-Hb for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:40 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAm-0001VI-Hm for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:40 -0400 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-24756a12ba0so396492a91.1 for ; Wed, 19 Apr 2023 22:49:36 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969775; x=1684561775; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dq92rSu8aDGjRaomXrRgMkHeyUSHbPBAOE2GXxrm/c8=; b=jVUhoj8ZS3qgXjCM4BnNSa9O7QwBlexetPvVEK8D3NQQkrpCE9lzvG0RsFIoSOa9Hr g2+M5sOBWrbuKLbMOcMB6DWbz6Za+zlZYbyZtEUKAJ3lR4GrjgY0Kk3vlmDj8iW5TFQX Ljr5JqBjDHPsBmVFQ7sqiv2w5rNT5QJKWdOHwDTCmghPwEHo30nkVyppd8sb9mC72hEx rYa0YbdCsVuHcVZelsfe/jGPs9GflkH/wriP9uyTPyK8ob6MkMGG4twv22kuYCueo0Eu 5/uY5pWujiQa+EA9/w8GorGP6EcrYNCRSaH48wQM+/T/3HlW0L70HO3dEz5Wgh2ocOfy odbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969775; x=1684561775; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dq92rSu8aDGjRaomXrRgMkHeyUSHbPBAOE2GXxrm/c8=; b=kHNIlOBxcrKusNKxc64X6UxU/QB07dlD1f6IUlGeeyOkNp4rQ1VLJ+MIJ8U+7hgKV5 wmPsFyhLH26RoVQ9Y4CWd2rcHU3XKDNSyDhZj2zinJncoXD23mtZZunQ199mOXFzcmtm bFzMJn4Vlvtz7cclXbrjX0Ozc/Wrerg3uS0Ow80c0uzFkeq4YqnSjVqhuEjUmi3ZuGGq 7gEAhkr4m3N81AYH1XSngHcRkmnRn76Mt5SqN9TaZHGZ5PI8gWNVwHKy/ZTvdqWb/MZB IsROtqSeeCn08NnPDutDWSAyulFMb569TQ1qCoYqbSBCi06hFVTkWupTJoR1B1l92EXT JTHA== X-Gm-Message-State: AAQBX9dXuxcWF0N8X3HW0Zy0SEC6ckZTEX1BE6ExCGLZPZ4/Qi8El7uf YQfO1jq2u4oBPQZcKDoNvNkGxg== X-Google-Smtp-Source: AKy350YnusMLG07nzu7QyUO86GzExyvK3UwpIHo8Sa57g7RMvfdsuePvPnoA2+FXkgJClaDgH0+BQw== X-Received: by 2002:a17:90a:72c5:b0:23f:e4b7:afb3 with SMTP id l5-20020a17090a72c500b0023fe4b7afb3mr613509pjk.9.1681969775294; Wed, 19 Apr 2023 22:49:35 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 34/41] igb: Strip the second VLAN tag for extended VLAN Date: Thu, 20 Apr 2023 14:46:50 +0900 Message-Id: <20230420054657.50367-35-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::1033; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969889951100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki --- hw/net/net_rx_pkt.h | 19 ++++++++-------- include/net/eth.h | 4 ++-- hw/net/e1000e_core.c | 3 ++- hw/net/igb_core.c | 14 ++++++++++-- hw/net/net_rx_pkt.c | 15 +++++-------- net/eth.c | 52 ++++++++++++++++++++++++++++---------------- 6 files changed, 65 insertions(+), 42 deletions(-) diff --git a/hw/net/net_rx_pkt.h b/hw/net/net_rx_pkt.h index ce8dbdb284..55ec67a1a7 100644 --- a/hw/net/net_rx_pkt.h +++ b/hw/net/net_rx_pkt.h @@ -223,18 +223,19 @@ void net_rx_pkt_attach_iovec(struct NetRxPkt *pkt, /** * attach scatter-gather data to rx packet * -* @pkt: packet -* @iov: received data scatter-gather list -* @iovcnt number of elements in iov -* @iovoff data start offset in the iov -* @strip_vlan: should the module strip vlan from data -* @vet: VLAN tag Ethernet type +* @pkt: packet +* @iov: received data scatter-gather list +* @iovcnt: number of elements in iov +* @iovoff: data start offset in the iov +* @strip_vlan_index: index of Q tag if it is to be stripped. negative othe= rwise. +* @vet: VLAN tag Ethernet type +* @vet_ext: outer VLAN tag Ethernet type * */ void net_rx_pkt_attach_iovec_ex(struct NetRxPkt *pkt, - const struct iovec *iov, int iovcnt, - size_t iovoff, bool strip_vlan, - uint16_t vet); + const struct iovec *iov, int iovcnt, + size_t iovoff, int strip_vlan_index, + uint16_t vet, uint16_t vet_ext); =20 /** * attach data to rx packet diff --git a/include/net/eth.h b/include/net/eth.h index 75e7f1551c..3b80b6e07f 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -347,8 +347,8 @@ eth_strip_vlan(const struct iovec *iov, int iovcnt, siz= e_t iovoff, uint16_t *payload_offset, uint16_t *tci); =20 size_t -eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, size_t iovoff, - uint16_t vet, void *new_ehdr_buf, +eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, size_t iovoff, int = index, + uint16_t vet, uint16_t vet_ext, void *new_ehdr_buf, uint16_t *payload_offset, uint16_t *tci); =20 uint16_t diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 8b35735799..0740a3f3bc 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1711,7 +1711,8 @@ e1000e_receive_internal(E1000ECore *core, const struc= t iovec *iov, int iovcnt, } =20 net_rx_pkt_attach_iovec_ex(core->rx_pkt, iov, iovcnt, iov_ofs, - e1000x_vlan_enabled(core->mac), core->mac[V= ET]); + e1000x_vlan_enabled(core->mac) ? 0 : -1, + core->mac[VET], 0); =20 e1000e_rss_parse_packet(core, core->rx_pkt, &rss_info); e1000e_rx_ring_init(core, &rxr, rss_info.queue); diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 00fd163bf3..9590e9bc4e 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -1603,6 +1603,7 @@ igb_receive_internal(IGBCore *core, const struct iove= c *iov, int iovcnt, E1000E_RxRing rxr; E1000E_RSSInfo rss_info; size_t total_size; + int strip_vlan_index; int i; =20 trace_e1000e_rx_receive_iov(iovcnt); @@ -1664,9 +1665,18 @@ igb_receive_internal(IGBCore *core, const struct iov= ec *iov, int iovcnt, =20 igb_rx_ring_init(core, &rxr, i); =20 + if (!igb_rx_strip_vlan(core, rxr.i)) { + strip_vlan_index =3D -1; + } else if (core->mac[CTRL_EXT] & BIT(26)) { + strip_vlan_index =3D 1; + } else { + strip_vlan_index =3D 0; + } + net_rx_pkt_attach_iovec_ex(core->rx_pkt, iov, iovcnt, iov_ofs, - igb_rx_strip_vlan(core, rxr.i), - core->mac[VET] & 0xffff); + strip_vlan_index, + core->mac[VET] & 0xffff, + core->mac[VET] >> 16); =20 total_size =3D net_rx_pkt_get_total_len(core->rx_pkt) + e1000x_fcs_len(core->mac); diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c index 3575c8b9f9..32e5f3f9cf 100644 --- a/hw/net/net_rx_pkt.c +++ b/hw/net/net_rx_pkt.c @@ -137,20 +137,17 @@ void net_rx_pkt_attach_iovec(struct NetRxPkt *pkt, =20 void net_rx_pkt_attach_iovec_ex(struct NetRxPkt *pkt, const struct iovec *iov, int iovcnt, - size_t iovoff, bool strip_vlan, - uint16_t vet) + size_t iovoff, int strip_vlan_index, + uint16_t vet, uint16_t vet_ext) { uint16_t tci =3D 0; uint16_t ploff =3D iovoff; assert(pkt); =20 - if (strip_vlan) { - pkt->ehdr_buf_len =3D eth_strip_vlan_ex(iov, iovcnt, iovoff, vet, - &pkt->ehdr_buf, - &ploff, &tci); - } else { - pkt->ehdr_buf_len =3D 0; - } + pkt->ehdr_buf_len =3D eth_strip_vlan_ex(iov, iovcnt, iovoff, + strip_vlan_index, vet, vet_ext, + &pkt->ehdr_buf, + &ploff, &tci); =20 pkt->tci =3D tci; =20 diff --git a/net/eth.c b/net/eth.c index 7f02aea010..649e66bb1f 100644 --- a/net/eth.c +++ b/net/eth.c @@ -269,36 +269,50 @@ eth_strip_vlan(const struct iovec *iov, int iovcnt, s= ize_t iovoff, } =20 size_t -eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, size_t iovoff, - uint16_t vet, void *new_ehdr_buf, +eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, size_t iovoff, int = index, + uint16_t vet, uint16_t vet_ext, void *new_ehdr_buf, uint16_t *payload_offset, uint16_t *tci) { struct vlan_header vlan_hdr; - struct eth_header *new_ehdr =3D (struct eth_header *) new_ehdr_buf; - - size_t copied =3D iov_to_buf(iov, iovcnt, iovoff, - new_ehdr, sizeof(*new_ehdr)); - - if (copied < sizeof(*new_ehdr)) { - return 0; - } + uint16_t *new_ehdr_proto; + size_t new_ehdr_size; + size_t copied; =20 - if (be16_to_cpu(new_ehdr->h_proto) =3D=3D vet) { - copied =3D iov_to_buf(iov, iovcnt, iovoff + sizeof(*new_ehdr), - &vlan_hdr, sizeof(vlan_hdr)); + switch (index) { + case 0: + new_ehdr_proto =3D &PKT_GET_ETH_HDR(new_ehdr_buf)->h_proto; + new_ehdr_size =3D sizeof(struct eth_header); + copied =3D iov_to_buf(iov, iovcnt, iovoff, new_ehdr_buf, new_ehdr_= size); + break; =20 - if (copied < sizeof(vlan_hdr)) { + case 1: + new_ehdr_proto =3D &PKT_GET_VLAN_HDR(new_ehdr_buf)->h_proto; + new_ehdr_size =3D sizeof(struct eth_header) + sizeof(struct vlan_h= eader); + copied =3D iov_to_buf(iov, iovcnt, iovoff, new_ehdr_buf, new_ehdr_= size); + if (be16_to_cpu(PKT_GET_ETH_HDR(new_ehdr_buf)->h_proto) !=3D vet_e= xt) { return 0; } + break; =20 - new_ehdr->h_proto =3D vlan_hdr.h_proto; + default: + return 0; + } =20 - *tci =3D be16_to_cpu(vlan_hdr.h_tci); - *payload_offset =3D iovoff + sizeof(*new_ehdr) + sizeof(vlan_hdr); - return sizeof(struct eth_header); + if (copied < new_ehdr_size || be16_to_cpu(*new_ehdr_proto) !=3D vet) { + return 0; + } + + copied =3D iov_to_buf(iov, iovcnt, iovoff + new_ehdr_size, + &vlan_hdr, sizeof(vlan_hdr)); + if (copied < sizeof(vlan_hdr)) { + return 0; } =20 - return 0; + *new_ehdr_proto =3D vlan_hdr.h_proto; + *payload_offset =3D iovoff + new_ehdr_size + sizeof(vlan_hdr); + *tci =3D be16_to_cpu(vlan_hdr.h_tci); + + return new_ehdr_size; } =20 void --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969998; cv=none; d=zohomail.com; s=zohoarc; b=MoOSEQN+kW7tOm4IgPXzVfORTCkGCbqk+6Qax8t0KYMHrcLqEeYHkCkkBF4XYELpwH1PChE5bsxp+JDQxTFThiSy3iQqKTNGQAqCD+uYGBWDV7iQcRyntjcnX2cvlXWrZA5raZLcE3h6/p46eltarFyDiQ+UwFOh9euwFhTdOG4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969998; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=m4aodSVoRvLCqGZGe9Xf6Sd8SbqNHCRxb26wHWYA5Pk=; b=PYKsTLGpckw0NayvWP4GzfB8KLw22RjQZXTDexOhhyJj6doLjG0Z28KqZ8O6lu0D/cAqE/DS8if2o+NzT/etZgWbIvFP7CrXU12AjGTuoBQHbeauzVaIIu+hqDFQeOsV8EL4byEEpE5ErHDjRSkzNeHd9WUH+lSV2NmHf4NSTsM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969998665439.1677684009318; Wed, 19 Apr 2023 22:53:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAv-0002Jp-4z; Thu, 20 Apr 2023 01:49:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAr-0001te-U0 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:42 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAq-0001WG-7g for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:41 -0400 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-24736992dd3so368421a91.1 for ; Wed, 19 Apr 2023 22:49:39 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969779; x=1684561779; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m4aodSVoRvLCqGZGe9Xf6Sd8SbqNHCRxb26wHWYA5Pk=; b=aE8ttKv5WkFhU+e3qI3JV771NoOu43CXt+6ynpyhfnRQRzyLbAjJa/nYO1O80OLVxJ 1UAVjUW9cv7padk/cUfVefZIHejgJZzKbeWV/qWyBu7Bmua9hBgNSfYD10s/ZqP89ETA 0MWth+BlCpQhz+wgcZJeNwpnENu5IKJXmJ9N/8Jt/MtOcsIUtniVoxb9tE0M/Wr23eBL EnSrc2l6ZTOlvh58hUXOOOw82oOcCnmi/yx/Mi/Crhd4Te1EoW1fhnaWQ4Ve44PfWw69 CegLHmkuT6dCJ5jUYMLjRrrHxqWk2dVlPJq437LPS5gp0o2VTtcqCepRxAANmUsbGjER 0nSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969779; x=1684561779; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m4aodSVoRvLCqGZGe9Xf6Sd8SbqNHCRxb26wHWYA5Pk=; b=bCX1DAawiTk6TNJh27ZcWELCsocN7gqqH+MqCTwKzPIcNz4Ukq39Yx1f43kZ1obUq7 7sLaXeL+MdPb6d/f20LOFgGoL7bOchQyaj8LfgHQ3IdX2yQvqmR50S88lN3hFk2c+DtY jzsLglWnSGbEOLqo5rp1OA/4fGe9tfui3ZOxelTJd5sHis+IIRptrB3/2aJV7dGayqgd AydaQlq+j6tPmhAriTOnEXxcluHBDcz2fGSf/7FovkY7CXPAjIrrR/2BNGTX/LYnGJ3C BshwkxcIkiX9Szz+Q78DuiBomt29IwHwno1rKXcN+R0WjsFhmtkUu5auGC9HpVtgPBFj TdLQ== X-Gm-Message-State: AAQBX9drhM21Y6jrWqT/mVi3rYURSZc1VcM9FA6GfZvD+jqYRtwVmh3X nxFve51CU4EfnrYe+Z57gwgfig== X-Google-Smtp-Source: AKy350YVgyPfDXgn6/PptH1mjPBM36LLalxekNT05jeyker1g6k+TlkYOZB45OHSAN4F5BJS29CHtQ== X-Received: by 2002:a17:90a:df86:b0:247:802a:53a5 with SMTP id p6-20020a17090adf8600b00247802a53a5mr519167pjv.40.1681969778836; Wed, 19 Apr 2023 22:49:38 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 35/41] igb: Filter with the second VLAN tag for extended VLAN Date: Thu, 20 Apr 2023 14:46:51 +0900 Message-Id: <20230420054657.50367-36-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::1029; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969999478100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki --- hw/net/igb_core.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 9590e9bc4e..54abcf023c 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -69,7 +69,7 @@ typedef struct IGBTxPktVmdqCallbackContext { =20 typedef struct L2Header { struct eth_header eth; - struct vlan_header vlan; + struct vlan_header vlan[2]; } L2Header; =20 static ssize_t @@ -993,7 +993,7 @@ static uint16_t igb_receive_assign(IGBCore *core, const= L2Header *l2_header, uint32_t f, ra[2], *macp, rctl =3D core->mac[RCTL]; uint16_t queues =3D 0; uint16_t oversized =3D 0; - uint16_t vid =3D be16_to_cpu(l2_header->vlan.h_tci) & VLAN_VID_MASK; + size_t vlan_num =3D 0; int i; =20 memset(rss_info, 0, sizeof(E1000E_RSSInfo)); @@ -1002,8 +1002,19 @@ static uint16_t igb_receive_assign(IGBCore *core, co= nst L2Header *l2_header, *external_tx =3D true; } =20 - if (e1000x_is_vlan_packet(ehdr, core->mac[VET] & 0xffff) && - !e1000x_rx_vlan_filter(core->mac, PKT_GET_VLAN_HDR(ehdr))) { + if (core->mac[CTRL_EXT] & BIT(26)) { + if (be16_to_cpu(ehdr->h_proto) =3D=3D core->mac[VET] >> 16 && + be16_to_cpu(l2_header->vlan[0].h_proto) =3D=3D (core->mac[VET]= & 0xffff)) { + vlan_num =3D 2; + } + } else { + if (be16_to_cpu(ehdr->h_proto) =3D=3D (core->mac[VET] & 0xffff)) { + vlan_num =3D 1; + } + } + + if (vlan_num && + !e1000x_rx_vlan_filter(core->mac, l2_header->vlan + vlan_num - 1))= { return queues; } =20 @@ -1057,7 +1068,9 @@ static uint16_t igb_receive_assign(IGBCore *core, con= st L2Header *l2_header, if (e1000x_vlan_rx_filter_enabled(core->mac)) { uint16_t mask =3D 0; =20 - if (e1000x_is_vlan_packet(ehdr, core->mac[VET] & 0xffff)) { + if (vlan_num) { + uint16_t vid =3D be16_to_cpu(l2_header->vlan[vlan_num - 1]= .h_tci) & VLAN_VID_MASK; + for (i =3D 0; i < E1000_VLVF_ARRAY_SIZE; i++) { if ((core->mac[VLVF0 + i] & E1000_VLVF_VLANID_MASK) = =3D=3D vid && (core->mac[VLVF0 + i] & E1000_VLVF_VLANID_ENABLE))= { --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970058; cv=none; d=zohomail.com; s=zohoarc; b=oC4CoG8KIwXT3lIuxNfW8n7W06IkvVOkg/jJpnBcyqm7ZeEMX7zpozaY1MZZF0EF/ISudiFA8EN14sT1Z6Hz+AHpCBmeFvlsQrIdMRvKB9zpz4TTKvOpce4ppokKb+RosKu/IZKSLKwRpoJBuuAAtglPgrzNnQNpxSQvGnk1R7w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970058; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=NczRXYgrJoyickG45pebNx6oCI48M10WRsaEYhSjGNI=; b=F0EsZKJ81LnKSQMPMT+GJvNH0wHnviUGDEOYbhnZ57pukLh6mR/mXdAkX+nCzBx7fHGV3Fm9h0f2oxdt0vItJpQOM1z+FU15UMXLZnCU0JM/llhTePW5lqxN84f3U14J5Wh9oWp3TC7w8mp4uuffTrhAgLBSF+jWMo/7odAs25Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970058870366.6975333540536; Wed, 19 Apr 2023 22:54:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNAx-0002Yh-Mr; Thu, 20 Apr 2023 01:49:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAv-0002MO-7n for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:45 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAt-0001Wj-H5 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:44 -0400 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-52019617020so544740a12.3 for ; Wed, 19 Apr 2023 22:49:43 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969782; x=1684561782; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NczRXYgrJoyickG45pebNx6oCI48M10WRsaEYhSjGNI=; b=xYzVGfi+dKhzhdTPVkOf6pLyeNqbSQx94dLPvqlj7PG3oweyMwrsBoM5+3OQyVEuKg PGz4q9NVZy+AFGKx6D3leAXuf8KkTZjGJjMZjuLWtnAn1w0Kyy5bv5ogtPyX1TxDWKQb a7OwcsUUGD8h3tABOTPxkmjp4q35nfG+N85h1cFiOXSz0ObrSyHqkhU8bNpq9q93dDJ0 huO1/Su193wGvGfFAGDOslfaOTaBawEGZkkyLCz1rFEoHr6WBhlxNAViO3r2yOB2lo/t 91edNzqVWv/NtMZ7ELEJuYCxZ/L9cql0FpqdWDL6If8LiQZCw6VL9hBHRS8E6LChuPC9 vOsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969782; x=1684561782; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NczRXYgrJoyickG45pebNx6oCI48M10WRsaEYhSjGNI=; b=PZfh8CkcsjNpyPFuFRl1oS4X5yMs/HIxSIslVTYaI+h0svABUE7teqmbwjQ9muaxP2 sC/k5rzHkODO9bgQjjlTeHYTDYDJIHE+lakABhzoVYvE/yyGunBjymxBw5DdURYPdKvS CoGFreUnmkBcLDqfBY9QXKhqxzwACLjXXwqaX3N+gv/wquWwnX8qE8nrhn2HI9aw72Pj m+nKMF9yENMGAC2brB9jBK0SsQfwlp6iYjUcxtuSnk2yLNQEbD3ZV3Ttd6KZogfrTlfb Y8xjzZMEJYiYrOXfD6d+32R6YBaR7KMbcz/fErR50vLxJF2UFsX8vsLi2Va6GVYseA1z WKQA== X-Gm-Message-State: AAQBX9f7m0o5hwRbotig3mm60YyCJee2bSLiZRF6fVTR8gS6jgAjp5W1 3pbXbED9orHO5fLgPITnkdUVbA== X-Google-Smtp-Source: AKy350ZpZG7ywMHm/1pkal5mi9OY4yCU2omD0kjdc/pHFFN0HnGueZDtCxOzE5SQYL+0nZamFVxgEQ== X-Received: by 2002:a17:903:234b:b0:1a1:e33f:d567 with SMTP id c11-20020a170903234b00b001a1e33fd567mr418941plh.52.1681969782262; Wed, 19 Apr 2023 22:49:42 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 36/41] igb: Implement igb-specific oversize check Date: Thu, 20 Apr 2023 14:46:52 +0900 Message-Id: <20230420054657.50367-37-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::52f; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52f.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970060771100003 Content-Type: text/plain; charset="utf-8" igb has a configurable size limit for LPE, and uses different limits depending on whether the packet is treated as a VLAN packet. Signed-off-by: Akihiko Odaki --- hw/net/igb_core.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 54abcf023c..8ff5a2b4bb 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -972,16 +972,13 @@ igb_rx_l4_cso_enabled(IGBCore *core) return !!(core->mac[RXCSUM] & E1000_RXCSUM_TUOFLD); } =20 -static bool -igb_rx_is_oversized(IGBCore *core, uint16_t qn, size_t size) +static bool igb_rx_is_oversized(IGBCore *core, const struct eth_header *eh= dr, + size_t size, size_t vlan_num, + bool lpe, uint16_t rlpml) { - uint16_t pool =3D qn % IGB_NUM_VM_POOLS; - bool lpe =3D !!(core->mac[VMOLR0 + pool] & E1000_VMOLR_LPE); - int max_ethernet_lpe_size =3D - core->mac[VMOLR0 + pool] & E1000_VMOLR_RLPML_MASK; - int max_ethernet_vlan_size =3D 1522; - - return size > (lpe ? max_ethernet_lpe_size : max_ethernet_vlan_size); + size_t vlan_header_size =3D sizeof(struct vlan_header) * vlan_num; + size_t header_size =3D sizeof(struct eth_header) + vlan_header_size; + return lpe ? size + ETH_FCS_LEN > rlpml : size > header_size + ETH_MTU; } =20 static uint16_t igb_receive_assign(IGBCore *core, const L2Header *l2_heade= r, @@ -994,6 +991,8 @@ static uint16_t igb_receive_assign(IGBCore *core, const= L2Header *l2_header, uint16_t queues =3D 0; uint16_t oversized =3D 0; size_t vlan_num =3D 0; + bool lpe; + uint16_t rlpml; int i; =20 memset(rss_info, 0, sizeof(E1000E_RSSInfo)); @@ -1013,6 +1012,14 @@ static uint16_t igb_receive_assign(IGBCore *core, co= nst L2Header *l2_header, } } =20 + lpe =3D !!(core->mac[RCTL] & E1000_RCTL_LPE); + rlpml =3D core->mac[RLPML]; + if (!(core->mac[RCTL] & E1000_RCTL_SBP) && + igb_rx_is_oversized(core, ehdr, size, vlan_num, lpe, rlpml)) { + trace_e1000x_rx_oversized(size); + return queues; + } + if (vlan_num && !e1000x_rx_vlan_filter(core->mac, l2_header->vlan + vlan_num - 1))= { return queues; @@ -1098,7 +1105,11 @@ static uint16_t igb_receive_assign(IGBCore *core, co= nst L2Header *l2_header, queues &=3D core->mac[VFRE]; if (queues) { for (i =3D 0; i < IGB_NUM_VM_POOLS; i++) { - if ((queues & BIT(i)) && igb_rx_is_oversized(core, i, size= )) { + lpe =3D !!(core->mac[VMOLR0 + i] & E1000_VMOLR_LPE); + rlpml =3D core->mac[VMOLR0 + i] & E1000_VMOLR_RLPML_MASK; + if ((queues & BIT(i)) && + igb_rx_is_oversized(core, ehdr, size, vlan_num, + lpe, rlpml)) { oversized |=3D BIT(i); } } @@ -1654,11 +1665,6 @@ igb_receive_internal(IGBCore *core, const struct iov= ec *iov, int iovcnt, iov_to_buf(iov, iovcnt, iov_ofs, &min_buf, sizeof(min_buf.l2_heade= r)); } =20 - /* Discard oversized packets if !LPE and !SBP. */ - if (e1000x_is_oversized(core->mac, size)) { - return orig_size; - } - net_rx_pkt_set_packet_type(core->rx_pkt, get_eth_packet_type(&min_buf.l2_header.eth)= ); net_rx_pkt_set_protocols(core->rx_pkt, iov, iovcnt, iov_ofs); --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970041; cv=none; d=zohomail.com; s=zohoarc; b=G4jgCtvJTh78eJAFearmSq9s9b+GR735wts7ldT+39ttKFu5PNyJsZTvyADrbY6YEYzU0hFlGyLM70URkbp/tSbfER48dz6W7pXGvd0gdn7aI+gZR5HdigTbPzu3M6elA2hXwRetQ20WLOD1hVlQ6y8bGL7QWb0PSyfdWB8BJFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970041; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=qU1bwLADFQbsoDCRIYLNRDy8e5i5VpME9gACokqm9P0=; b=Kqw/SHwesJ0TF9QHfCbZ9nG0rNFP9xfzdYDp+Dkl/NAvHSksBgsFNeyYl0JIjrh5WhDW72HXB5SCs0+9CikawSeG2EISkh76W8dPpy+X6nYIDMvqspu/asZLVZJERHd3KByGRQhnT/Nc8nxANXIfOJ2P31cUKewAWTMqBaIRguA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970041024769.6608912334858; Wed, 19 Apr 2023 22:54:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNB1-00037d-TR; Thu, 20 Apr 2023 01:49:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNAz-0002py-GM for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:49 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAx-0001XR-3M for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:49 -0400 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-517bdc9e81dso365143a12.1 for ; Wed, 19 Apr 2023 22:49:46 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969785; x=1684561785; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qU1bwLADFQbsoDCRIYLNRDy8e5i5VpME9gACokqm9P0=; b=IsyWEJ8Zx2oMyOZv0UW2x5AV6CE+C/Qo0ZvB8KFS2fuCPA7k3ui3tx+R07bzwNZwo8 LTNYWhKWVEcdfDm6mW+iVdLD2u8THcTDA1xH0/oFZeaE8GQ2CG5BK/G0ZECkKGgVkst2 0EyYAUgMcIk/+RvZTW1HfcPMAD9NyStcXPqfCPsfTm2iX/N5zs3RBVGdKKzpMReYHXnd y/cQopNdOpma8y7X+8oFO+ryHXEg7xajTNVV7AsN5kSq7Ad46a1N6k1ltMqJWOnMWvIS CkNhlTD2pGf7s0jln6OeKqDEsIA7e9NemK9aeTpjTRTuHJ1EScO4cNdZDsIA4uBEUJ8a 4pqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969785; x=1684561785; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qU1bwLADFQbsoDCRIYLNRDy8e5i5VpME9gACokqm9P0=; b=DWFMlAqujDhz7q01fK5rO3nKwMN5hzpoiAjGW/Th/t/0XbqwARd6g/2yxAVwsYj7C6 4DPcQ4P1tq+PUUX/c8Rqf+8yd8Xjm/PiI+NUcDmYYGZdpsQtOBJ2WMIcHRqUVYP1by9W pRPAkdqt+mCCKYuYzL1TZ3zBDeDv6c6/l0f7JJJDE7HcC6t8IESimGZqx7BVYdKWN0MJ +V5BSepmqf8o7RSmcacCbIusifZe98AvNtxOKYMlqHGMZFK1athZsIyaMcIdIfFHcvBR Sw8e27w5JuQAgQWyAmX1Uuki+grvfJszP9YoPv6nl+tFEz3t4Bn3gcWEoq4YBUEXzjHU ttkQ== X-Gm-Message-State: AAQBX9ddUPaOmyfUYKxdagta8hfvxI5b2IzeyHVniJJTBv/5R/wjw+pL D+1Ojtqt16rX7J9+uaHbK4YNMg== X-Google-Smtp-Source: AKy350b0VUwLf6iu8hEKUQ3alMkWQMs6AHeXBzhPJV3XEOzOkmKQlipjNZ23wWtE7NqVeqBM7LEexg== X-Received: by 2002:a17:90a:a016:b0:247:2300:87d9 with SMTP id q22-20020a17090aa01600b00247230087d9mr521412pjp.34.1681969785692; Wed, 19 Apr 2023 22:49:45 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 37/41] igb: Implement Rx PTP2 timestamp Date: Thu, 20 Apr 2023 14:46:53 +0900 Message-Id: <20230420054657.50367-38-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::529; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970041324100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki --- hw/net/igb_common.h | 16 +++--- hw/net/igb_regs.h | 23 ++++++++ hw/net/igb_core.c | 129 ++++++++++++++++++++++++++++++++------------ 3 files changed, 127 insertions(+), 41 deletions(-) diff --git a/hw/net/igb_common.h b/hw/net/igb_common.h index f2a9065791..5c261ba9d3 100644 --- a/hw/net/igb_common.h +++ b/hw/net/igb_common.h @@ -51,7 +51,7 @@ defreg_indexeda(x, 0), defreg_indexeda(x, 1), \ defreg_indexeda(x, 2), defreg_indexeda(x, 3) =20 -#define defregv(x) defreg_indexed(x, 0), defreg_indexed(x, 1), \ +#define defreg8(x) defreg_indexed(x, 0), defreg_indexed(x, 1), \ defreg_indexed(x, 2), defreg_indexed(x, 3), \ defreg_indexed(x, 4), defreg_indexed(x, 5), \ defreg_indexed(x, 6), defreg_indexed(x, 7) @@ -122,6 +122,8 @@ enum { defreg(EICS), defreg(EIMS), defreg(EIMC), defreg(E= IAM), defreg(EICR), defreg(IVAR_MISC), defreg(GPIE), =20 + defreg(TSYNCRXCFG), defreg8(ETQF), + defreg(RXPBS), defregd(RDBAL), defregd(RDBAH), defregd(= RDLEN), defregd(SRRCTL), defregd(RDH), defregd(RDT), defregd(RXDCTL), defregd(RXCTL), defregd(RQDPC), defreg(R= A2), @@ -133,15 +135,15 @@ enum { =20 defreg(VT_CTL), =20 - defregv(P2VMAILBOX), defregv(V2PMAILBOX), defreg(MBVFICR), defreg(M= BVFIMR), + defreg8(P2VMAILBOX), defreg8(V2PMAILBOX), defreg(MBVFICR), defreg(M= BVFIMR), defreg(VFLRE), defreg(VFRE), defreg(VFTE), defreg(W= VBR), defreg(QDE), defreg(DTXSWC), defreg_indexed(VLVF, 0), - defregv(VMOLR), defreg(RPLOLR), defregv(VMBMEM), defregv(= VMVIR), + defreg8(VMOLR), defreg(RPLOLR), defreg8(VMBMEM), defreg8(= VMVIR), =20 - defregv(PVTCTRL), defregv(PVTEICS), defregv(PVTEIMS), defregv(= PVTEIMC), - defregv(PVTEIAC), defregv(PVTEIAM), defregv(PVTEICR), defregv(= PVFGPRC), - defregv(PVFGPTC), defregv(PVFGORC), defregv(PVFGOTC), defregv(= PVFMPRC), - defregv(PVFGPRLBC), defregv(PVFGPTLBC), defregv(PVFGORLBC), defregv(= PVFGOTLBC), + defreg8(PVTCTRL), defreg8(PVTEICS), defreg8(PVTEIMS), defreg8(= PVTEIMC), + defreg8(PVTEIAC), defreg8(PVTEIAM), defreg8(PVTEICR), defreg8(= PVFGPRC), + defreg8(PVFGPTC), defreg8(PVFGORC), defreg8(PVFGOTC), defreg8(= PVFMPRC), + defreg8(PVFGPRLBC), defreg8(PVFGPTLBC), defreg8(PVFGORLBC), defreg8(= PVFGOTLBC), =20 defreg(MTA_A), =20 diff --git a/hw/net/igb_regs.h b/hw/net/igb_regs.h index 4b4ebd3369..894705599d 100644 --- a/hw/net/igb_regs.h +++ b/hw/net/igb_regs.h @@ -210,6 +210,15 @@ union e1000_adv_rx_desc { #define E1000_DCA_TXCTRL_CPUID_SHIFT 24 /* Tx CPUID now in the last byte */ #define E1000_DCA_RXCTRL_CPUID_SHIFT 24 /* Rx CPUID now in the last byte */ =20 +/* ETQF register bit definitions */ +#define E1000_ETQF_FILTER_ENABLE BIT(26) +#define E1000_ETQF_1588 BIT(30) +#define E1000_ETQF_IMM_INT BIT(29) +#define E1000_ETQF_QUEUE_ENABLE BIT(31) +#define E1000_ETQF_QUEUE_SHIFT 16 +#define E1000_ETQF_QUEUE_MASK 0x00070000 +#define E1000_ETQF_ETYPE_MASK 0x0000FFFF + #define E1000_DTXSWC_MAC_SPOOF_MASK 0x000000FF /* Per VF MAC spoof contr= ol */ #define E1000_DTXSWC_VLAN_SPOOF_MASK 0x0000FF00 /* Per VF VLAN spoof cont= rol */ #define E1000_DTXSWC_LLE_MASK 0x00FF0000 /* Per VF Local LB enable= s */ @@ -384,6 +393,20 @@ union e1000_adv_rx_desc { #define E1000_FRTIMER 0x01048 /* Free Running Timer - RW */ #define E1000_FCRTV 0x02460 /* Flow Control Refresh Timer Value - RW = */ =20 +#define E1000_TSYNCRXCFG 0x05F50 /* Time Sync Rx Configuration - RW */ + +/* Filtering Registers */ +#define E1000_SAQF(_n) (0x5980 + 4 * (_n)) +#define E1000_DAQF(_n) (0x59A0 + 4 * (_n)) +#define E1000_SPQF(_n) (0x59C0 + 4 * (_n)) +#define E1000_FTQF(_n) (0x59E0 + 4 * (_n)) +#define E1000_SAQF0 E1000_SAQF(0) +#define E1000_DAQF0 E1000_DAQF(0) +#define E1000_SPQF0 E1000_SPQF(0) +#define E1000_FTQF0 E1000_FTQF(0) +#define E1000_SYNQF(_n) (0x055FC + (4 * (_n))) /* SYN Packet Queue Fltr */ +#define E1000_ETQF(_n) (0x05CB0 + (4 * (_n))) /* EType Queue Fltr */ + #define E1000_RQDPC(_n) (0x0C030 + ((_n) * 0x40)) =20 #define E1000_RXPBS 0x02404 /* Rx Packet Buffer Size - RW */ diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 8ff5a2b4bb..388614ea10 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -72,6 +72,24 @@ typedef struct L2Header { struct vlan_header vlan[2]; } L2Header; =20 +typedef struct PTP2 { + uint8_t message_id_transport_specific; + uint8_t version_ptp; + uint16_t message_length; + uint8_t subdomain_number; + uint8_t reserved0; + uint16_t flags; + uint64_t correction; + uint8_t reserved1[5]; + uint8_t source_communication_technology; + uint32_t source_uuid_lo; + uint16_t source_uuid_hi; + uint16_t source_port_id; + uint16_t sequence_id; + uint8_t control; + uint8_t log_message_period; +} PTP2; + static ssize_t igb_receive_internal(IGBCore *core, const struct iovec *iov, int iovcnt, bool has_vnet, bool *external_tx); @@ -981,9 +999,11 @@ static bool igb_rx_is_oversized(IGBCore *core, const s= truct eth_header *ehdr, return lpe ? size + ETH_FCS_LEN > rlpml : size > header_size + ETH_MTU; } =20 -static uint16_t igb_receive_assign(IGBCore *core, const L2Header *l2_heade= r, - size_t size, E1000E_RSSInfo *rss_info, - bool *external_tx) +static uint16_t igb_receive_assign(IGBCore *core, const struct iovec *iov, + size_t iovcnt, size_t iov_ofs, + const L2Header *l2_header, size_t size, + E1000E_RSSInfo *rss_info, + uint16_t *etqf, bool *ts, bool *externa= l_tx) { static const int ta_shift[] =3D { 4, 3, 2, 0 }; const struct eth_header *ehdr =3D &l2_header->eth; @@ -991,11 +1011,13 @@ static uint16_t igb_receive_assign(IGBCore *core, co= nst L2Header *l2_header, uint16_t queues =3D 0; uint16_t oversized =3D 0; size_t vlan_num =3D 0; + PTP2 ptp2; bool lpe; uint16_t rlpml; int i; =20 memset(rss_info, 0, sizeof(E1000E_RSSInfo)); + *ts =3D false; =20 if (external_tx) { *external_tx =3D true; @@ -1020,6 +1042,26 @@ static uint16_t igb_receive_assign(IGBCore *core, co= nst L2Header *l2_header, return queues; } =20 + for (*etqf =3D 0; *etqf < 8; (*etqf)++) { + if ((core->mac[ETQF0 + *etqf] & E1000_ETQF_FILTER_ENABLE) && + be16_to_cpu(ehdr->h_proto) =3D=3D (core->mac[ETQF0 + *etqf] & = E1000_ETQF_ETYPE_MASK)) { + if ((core->mac[ETQF0 + *etqf] & E1000_ETQF_1588) && + (core->mac[TSYNCRXCTL] & E1000_TSYNCRXCTL_ENABLED) && + !(core->mac[TSYNCRXCTL] & E1000_TSYNCRXCTL_VALID) && + iov_to_buf(iov, iovcnt, iov_ofs + ETH_HLEN, &ptp2, sizeof(= ptp2)) >=3D sizeof(ptp2) && + (ptp2.version_ptp & 15) =3D=3D 2 && + ptp2.message_id_transport_specific =3D=3D ((core->mac[TSYN= CRXCFG] >> 8) & 255)) { + e1000x_timestamp(core->mac, core->timadj, RXSTMPL, RXSTMPH= ); + *ts =3D true; + core->mac[TSYNCRXCTL] |=3D E1000_TSYNCRXCTL_VALID; + core->mac[RXSATRL] =3D le32_to_cpu(ptp2.source_uuid_lo); + core->mac[RXSATRH] =3D le16_to_cpu(ptp2.source_uuid_hi) | + (le16_to_cpu(ptp2.sequence_id) << 16); + } + break; + } + } + if (vlan_num && !e1000x_rx_vlan_filter(core->mac, l2_header->vlan + vlan_num - 1))= { return queues; @@ -1230,7 +1272,7 @@ static void igb_build_rx_metadata(IGBCore *core, struct NetRxPkt *pkt, bool is_eop, - const E1000E_RSSInfo *rss_info, + const E1000E_RSSInfo *rss_info, uint16_t etqf, bool = ts, uint16_t *pkt_info, uint16_t *hdr_info, uint32_t *rss, uint32_t *status_flags, @@ -1281,29 +1323,33 @@ igb_build_rx_metadata(IGBCore *core, if (pkt_info) { *pkt_info =3D rss_info->enabled ? rss_info->type : 0; =20 - if (hasip4) { - *pkt_info |=3D E1000_ADVRXD_PKT_IP4; - } + if (etqf < 8) { + *pkt_info |=3D BIT(11) | (etqf << 4); + } else { + if (hasip4) { + *pkt_info |=3D E1000_ADVRXD_PKT_IP4; + } =20 - if (hasip6) { - *pkt_info |=3D E1000_ADVRXD_PKT_IP6; - } + if (hasip6) { + *pkt_info |=3D E1000_ADVRXD_PKT_IP6; + } =20 - switch (l4hdr_proto) { - case ETH_L4_HDR_PROTO_TCP: - *pkt_info |=3D E1000_ADVRXD_PKT_TCP; - break; + switch (l4hdr_proto) { + case ETH_L4_HDR_PROTO_TCP: + *pkt_info |=3D E1000_ADVRXD_PKT_TCP; + break; =20 - case ETH_L4_HDR_PROTO_UDP: - *pkt_info |=3D E1000_ADVRXD_PKT_UDP; - break; + case ETH_L4_HDR_PROTO_UDP: + *pkt_info |=3D E1000_ADVRXD_PKT_UDP; + break; =20 - case ETH_L4_HDR_PROTO_SCTP: - *pkt_info |=3D E1000_ADVRXD_PKT_SCTP; - break; + case ETH_L4_HDR_PROTO_SCTP: + *pkt_info |=3D E1000_ADVRXD_PKT_SCTP; + break; =20 - default: - break; + default: + break; + } } } =20 @@ -1311,6 +1357,10 @@ igb_build_rx_metadata(IGBCore *core, *hdr_info =3D 0; } =20 + if (ts) { + *status_flags |=3D BIT(16); + } + /* RX CSO information */ if (hasip6 && (core->mac[RFCTL] & E1000_RFCTL_IPV6_XSUM_DIS)) { trace_e1000e_rx_metadata_ipv6_sum_disabled(); @@ -1366,7 +1416,7 @@ func_exit: static inline void igb_write_lgcy_rx_descr(IGBCore *core, struct e1000_rx_desc *desc, struct NetRxPkt *pkt, - const E1000E_RSSInfo *rss_info, + const E1000E_RSSInfo *rss_info, uint16_t etqf, boo= l ts, uint16_t length) { uint32_t status_flags, rss; @@ -1377,7 +1427,7 @@ igb_write_lgcy_rx_descr(IGBCore *core, struct e1000_r= x_desc *desc, desc->csum =3D 0; =20 igb_build_rx_metadata(core, pkt, pkt !=3D NULL, - rss_info, + rss_info, etqf, ts, NULL, NULL, &rss, &status_flags, &ip_id, &desc->special); @@ -1388,7 +1438,7 @@ igb_write_lgcy_rx_descr(IGBCore *core, struct e1000_r= x_desc *desc, static inline void igb_write_adv_rx_descr(IGBCore *core, union e1000_adv_rx_desc *desc, struct NetRxPkt *pkt, - const E1000E_RSSInfo *rss_info, + const E1000E_RSSInfo *rss_info, uint16_t etqf, bool= ts, uint16_t length) { memset(&desc->wb, 0, sizeof(desc->wb)); @@ -1396,7 +1446,7 @@ igb_write_adv_rx_descr(IGBCore *core, union e1000_adv= _rx_desc *desc, desc->wb.upper.length =3D cpu_to_le16(length); =20 igb_build_rx_metadata(core, pkt, pkt !=3D NULL, - rss_info, + rss_info, etqf, ts, &desc->wb.lower.lo_dword.pkt_info, &desc->wb.lower.lo_dword.hdr_info, &desc->wb.lower.hi_dword.rss, @@ -1407,12 +1457,15 @@ igb_write_adv_rx_descr(IGBCore *core, union e1000_a= dv_rx_desc *desc, =20 static inline void igb_write_rx_descr(IGBCore *core, union e1000_rx_desc_union *desc, -struct NetRxPkt *pkt, const E1000E_RSSInfo *rss_info, uint16_t length) + struct NetRxPkt *pkt, const E1000E_RSSInfo *rss_info, + uint16_t etqf, bool ts, uint16_t length) { if (igb_rx_use_legacy_descriptor(core)) { - igb_write_lgcy_rx_descr(core, &desc->legacy, pkt, rss_info, length= ); + igb_write_lgcy_rx_descr(core, &desc->legacy, pkt, rss_info, + etqf, ts, length); } else { - igb_write_adv_rx_descr(core, &desc->adv, pkt, rss_info, length); + igb_write_adv_rx_descr(core, &desc->adv, pkt, rss_info, + etqf, ts, length); } } =20 @@ -1489,7 +1542,8 @@ igb_rx_descr_threshold_hit(IGBCore *core, const E1000= E_RingInfo *rxi) static void igb_write_packet_to_guest(IGBCore *core, struct NetRxPkt *pkt, const E1000E_RxRing *rxr, - const E1000E_RSSInfo *rss_info) + const E1000E_RSSInfo *rss_info, + uint16_t etqf, bool ts) { PCIDevice *d; dma_addr_t base; @@ -1571,7 +1625,7 @@ igb_write_packet_to_guest(IGBCore *core, struct NetRx= Pkt *pkt, } =20 igb_write_rx_descr(core, &desc, is_last ? core->rx_pkt : NULL, - rss_info, written); + rss_info, etqf, ts, written); igb_pci_dma_write_rx_desc(core, d, base, &desc, core->rx_desc_len); =20 igb_ring_advance(core, rxi, core->rx_desc_len / E1000_MIN_RX_DESC_= LEN); @@ -1626,6 +1680,8 @@ igb_receive_internal(IGBCore *core, const struct iove= c *iov, int iovcnt, size_t iov_ofs =3D 0; E1000E_RxRing rxr; E1000E_RSSInfo rss_info; + uint16_t etqf; + bool ts; size_t total_size; int strip_vlan_index; int i; @@ -1669,8 +1725,9 @@ igb_receive_internal(IGBCore *core, const struct iove= c *iov, int iovcnt, get_eth_packet_type(&min_buf.l2_header.eth)= ); net_rx_pkt_set_protocols(core->rx_pkt, iov, iovcnt, iov_ofs); =20 - queues =3D igb_receive_assign(core, &min_buf.l2_header, size, - &rss_info, external_tx); + queues =3D igb_receive_assign(core, iov, iovcnt, iov_ofs, + &min_buf.l2_header, size, + &rss_info, &etqf, &ts, external_tx); if (!queues) { trace_e1000e_rx_flt_dropped(); return orig_size; @@ -1709,7 +1766,7 @@ igb_receive_internal(IGBCore *core, const struct iove= c *iov, int iovcnt, n |=3D E1000_ICR_RXDW; =20 igb_rx_fix_l4_csum(core, core->rx_pkt); - igb_write_packet_to_guest(core, core->rx_pkt, &rxr, &rss_info); + igb_write_packet_to_guest(core, core->rx_pkt, &rxr, &rss_info, etq= f, ts); =20 /* Check if receive descriptor minimum threshold hit */ if (igb_rx_descr_threshold_hit(core, rxr.i)) { @@ -3302,6 +3359,8 @@ static const readops igb_macreg_readops[] =3D { [EIAM] =3D igb_mac_readreg, [IVAR0 ... IVAR0 + 7] =3D igb_mac_readreg, igb_getreg(IVAR_MISC), + igb_getreg(TSYNCRXCFG), + [ETQF0 ... ETQF0 + 7] =3D igb_mac_readreg, igb_getreg(VT_CTL), [P2VMAILBOX0 ... P2VMAILBOX7] =3D igb_mac_readreg, [V2PMAILBOX0 ... V2PMAILBOX7] =3D igb_mac_vfmailbox_read, @@ -3709,6 +3768,8 @@ static const writeops igb_macreg_writeops[] =3D { [EIMS] =3D igb_set_eims, [IVAR0 ... IVAR0 + 7] =3D igb_mac_writereg, igb_putreg(IVAR_MISC), + igb_putreg(TSYNCRXCFG), + [ETQF0 ... ETQF0 + 7] =3D igb_mac_writereg, igb_putreg(VT_CTL), [P2VMAILBOX0 ... P2VMAILBOX7] =3D igb_set_pfmailbox, [V2PMAILBOX0 ... V2PMAILBOX7] =3D igb_set_vfmailbox, --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969922; cv=none; d=zohomail.com; s=zohoarc; b=JAvE6WiiHM/sLdgwErORaHs/oIkUkHf315RWHzcb85H7OWioujetRVW1Q6rKdt6/wi+8E9mjX0zSOvaDE9RGfzkQfKxekXpP7GSIFwzOCDiLIIKcsC4sAbNcRAUFUd7ylTtSA6yDLsMQNmwatuq6UXkozenou7f6FHRmOY8IOqU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969922; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=vkoNbWZG9i1CmIE2Cu19bONHm4V6Lyc/RxJi0es0ArA=; b=nBYUudUAP96ZmHK3jE1JpK8muoIgnIhtLKIcx3w59COHdPDPUEmEQ+3X0ZeWf0XVkaMGbuBK8+hoZ3+cTEWquyPVM+wT4SDiTbUSRZqwAmMSE4fIQkhEBoxDluqytQpkEC0BCHGLAHCeSdPnmAiX2WZy+gODz9RR9LxidJDIAsk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969922708373.69706405753914; Wed, 19 Apr 2023 22:52:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNB3-0003O9-UY; Thu, 20 Apr 2023 01:49:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNB1-00037u-KH for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:51 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNAz-0001RC-TI for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:51 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-517c840f181so360445a12.3 for ; Wed, 19 Apr 2023 22:49:49 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969789; x=1684561789; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vkoNbWZG9i1CmIE2Cu19bONHm4V6Lyc/RxJi0es0ArA=; b=RsFRoIzDSMapMZJ6F1zOH+pzkwGWA59nMwEa0+4HQpvmpZLGpi3LADf2DxMQxo/Ihl if/PX3nahtJtOWboB85vn3FvYOEcnvVhnpZjyTygi94RD8MLudb2+yyOa9cP7f9Jzyg1 wBALJiUE5GYVkQQqBo7iv65pBz2QldyjkylgRCM2aeX/PxKthhdVpfpmB4v8uzofhdZg CeDRW7fR/r1xXrosruYfCCllFe7eO9rhA7H9TCodKFnTmfqXQibMR5/J+8yzdhahnx16 g8AXD0XtiImiVuoxdSs2cKOp4yFpOXkKIapNHdROUMzpxv+9PdVfR5fZNh0uv4YrJI1l YIBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969789; x=1684561789; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vkoNbWZG9i1CmIE2Cu19bONHm4V6Lyc/RxJi0es0ArA=; b=jCLSrv50AmMfEclauac9SCkjrWT7AIImLb+ZtWAVnVRR2T6kCkwfPjP2yG+h6tkeJq n0W+/PolgLXJSV6jVkuxtOy6Vh4kiPithHU1LyzsG/FKf28ndylCaFdorplbPqz6sgux MIkxKp8QmPu80zZKTBmrwrnMEKJ9AilDLbFtpeI+3mS8Ii/ng3jsE5Jge9Xm9ss0aHPR r+qFJYuOOouG8bi3Jkrv19Jhovu5b55dDFrRGZNVEW1xB0kkC0EqAVdBZ9bLhapz03pz bnqvTPlbmDTpHO8xnRRsa1Lsx0YEwr+f2QLkJbgp+oHNcXNYwXUMGFIx1Ik/EKmFNE4K FDsw== X-Gm-Message-State: AAQBX9dVkliqrA0e3OhGtu/yAB0W5DHuixpHEFZb0mx7n2hLqNDQLKUw 6eipIj4Rl1uwdOQc+CHEvmpQ6w== X-Google-Smtp-Source: AKy350akgEeg6Wdmynni6GA/eRiI2+7tpZcPjuuQZ0UGWdrqpuWrMKiVJbUKzeAkZVbw+vCXz3QDDw== X-Received: by 2002:a17:90a:4741:b0:249:6a63:7b8e with SMTP id y1-20020a17090a474100b002496a637b8emr635278pjg.5.1681969789223; Wed, 19 Apr 2023 22:49:49 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 38/41] igb: Implement Tx timestamp Date: Thu, 20 Apr 2023 14:46:54 +0900 Message-Id: <20230420054657.50367-39-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::52c; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969923756100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki Reviewed-by: Sriram Yagnaraman --- hw/net/igb_regs.h | 3 +++ hw/net/igb_core.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/hw/net/igb_regs.h b/hw/net/igb_regs.h index 894705599d..82ff195dfc 100644 --- a/hw/net/igb_regs.h +++ b/hw/net/igb_regs.h @@ -322,6 +322,9 @@ union e1000_adv_rx_desc { /* E1000_EITR_CNT_IGNR is only for 82576 and newer */ #define E1000_EITR_CNT_IGNR 0x80000000 /* Don't reset counters on writ= e */ =20 +#define E1000_TSYNCTXCTL_VALID 0x00000001 /* tx timestamp valid */ +#define E1000_TSYNCTXCTL_ENABLED 0x00000010 /* enable tx timestampping */ + /* PCI Express Control */ #define E1000_GCR_CMPL_TMOUT_MASK 0x0000F000 #define E1000_GCR_CMPL_TMOUT_10ms 0x00001000 diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 388614ea10..172543f291 100644 --- a/hw/net/igb_core.c +++ b/hw/net/igb_core.c @@ -651,6 +651,13 @@ igb_process_tx_desc(IGBCore *core, tx->ctx[idx].vlan_macip_lens >> IGB_TX_FLAGS_VLAN_SHIFT, !!(tx->first_cmd_type_len & E1000_TXD_CMD_VLE)); =20 + if ((tx->first_cmd_type_len & E1000_ADVTXD_MAC_TSTAMP) && + (core->mac[TSYNCTXCTL] & E1000_TSYNCTXCTL_ENABLED) && + !(core->mac[TSYNCTXCTL] & E1000_TSYNCTXCTL_VALID)) { + core->mac[TSYNCTXCTL] |=3D E1000_TSYNCTXCTL_VALID; + e1000x_timestamp(core->mac, core->timadj, TXSTMPL, TXSTMPH= ); + } + if (igb_tx_pkt_send(core, tx, queue_index)) { igb_on_tx_done_update_stats(core, tx->tx_pkt, queue_index); } --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681969900; cv=none; d=zohomail.com; s=zohoarc; b=cQh/lbJzAjO+bunJHQvCUQhQbXFo44OVoT4KzmCKZYppUYHJEVVNR3ljpgU6rAsardYziTDMRZqsVkxAJGdIGbd2wRcNnN2tN2GapQm6xBpwCxGfSATuOr8de8MSZrLMZqyq1/NbBdSYmR05klmvDHP7KlakYG4fRnYNdCh/YDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681969900; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=WhEhy4Jd1mKN670RG/ec6toCTEp/s9C7PmGHjJRti/0=; b=fGPZrA/+xlyy/qvu6XeX54s5Kem89clSv1kMkv4w13fGpyP5oKtMupraLOlwJRsZceKmtzWzt6wYz3n8vWHiUGyxfQ+cmAZWeUVIB+T24aphv467Q16StWcRjq/4NFJ90ZyoR6nalCp2+TRC8a8DjeXpPORh7ZnsyEUFrkJxFJw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681969900554722.5153529478966; Wed, 19 Apr 2023 22:51:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNCU-0004hu-O5; Thu, 20 Apr 2023 01:51:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNBg-0004C4-55 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:50:32 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNB3-0001Uy-63 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:50:06 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1a814fe0ddeso8065545ad.2 for ; Wed, 19 Apr 2023 22:49:52 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969792; x=1684561792; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WhEhy4Jd1mKN670RG/ec6toCTEp/s9C7PmGHjJRti/0=; b=Zhy5lCgiVC+hEUnS0z7MqEHlZoNhhSnbK7EtVfXvKwciLpk9LpTxXHDcC2K61sZ1l5 PKDQwqnLHafDRGHBhXILdye7lM/YxgwlHlkN9IKGyExu8TbIwHc9Qr6+9BUYUFx2Lsi9 e4mhgCEHtiiLYIWVSuWh7TyG598iBgZxC2z71pgd4b1e0mhIf+AXNv56SLATjeRPQA+4 hk+bk/jDkZ1HELdmoNuZZjBJBNcr4dsYo5evnlSg02jh6wdqGxCuxLB9zTz6hV1sNVFx qcrKl11XatbV2+X5hDQJT8EI7gqNtkosPYJG/UMdv2hg3AM9bEGgTbZhSb5twf2gpLtP kVmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969792; x=1684561792; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WhEhy4Jd1mKN670RG/ec6toCTEp/s9C7PmGHjJRti/0=; b=kP6ThU38ni/xSsg1khsu4CpQU2Eu7292tinsnrWVH4r1qkey+2iSxofikqKaKqWKgL lvaI/7eJt7HxlidykjYWaLvUlvfH4/nrU5VFvfOymvgRURrVf3Vk/wAgmJfCqEk0yWmS khuoJtTnRM35KJqVkRJvMl5E6ttHSE4LzyQDCpJO3s1FK/9SOl3ndSpZeEvCrS3jt3T2 z9EU3m2+ovV0zhyrri6omVaOheY8zfpC7IZoImq3Ej8ip2wGdy2vTLrlJsU58troXl6c DrAM7Z0ghXphfhkp7S527OZdUDyN5lYjhU/LtF4R9ad32OpOsniDirQcuM+TvJTTUTiN 3M3A== X-Gm-Message-State: AAQBX9cFYlOTVHGb+2XY7wLOhVJHvY0rZZ1APtWrJXtCswucqRcLmCfY kebFGe/TZZd27zWzCdFdjCwDGg== X-Google-Smtp-Source: AKy350bBYe7fkV/JUbnmxertOCVx5jWHO3M251DMkBjKofIcOa5V4Vf85PfZ7CsEiE2S/YU7XJbIrw== X-Received: by 2002:a17:902:e5d1:b0:1a6:f0d5:3e21 with SMTP id u17-20020a170902e5d100b001a6f0d53e21mr616421plf.32.1681969792565; Wed, 19 Apr 2023 22:49:52 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 39/41] vmxnet3: Do not depend on PC Date: Thu, 20 Apr 2023 14:46:55 +0900 Message-Id: <20230420054657.50367-40-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::631; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x631.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681969902476100015 vmxnet3 has no dependency on PC, and VMware Fusion actually makes it available on Apple Silicon according to: https://kb.vmware.com/s/article/90364 Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/Kconfig b/hw/net/Kconfig index 18c7851efe..98e00be4f9 100644 --- a/hw/net/Kconfig +++ b/hw/net/Kconfig @@ -56,7 +56,7 @@ config RTL8139_PCI =20 config VMXNET3_PCI bool - default y if PCI_DEVICES && PC_PCI + default y if PCI_DEVICES depends on PCI =20 config SMC91C111 --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970046; cv=none; d=zohomail.com; s=zohoarc; b=ViY3qwkZoHrc/iRG2fDwn5wdUgb0zWDRxaUmJrhXQMlw8ySDXGPZ3NlVRUhKJB7w7+jQElUD7bW2OKV3rEbgj5A+h6nU/7KqlY7lr3Iy1E98Hb9AJH9ZO3sF7ZKUtf5a3areTHigXFi2qn8/3jE1XBNuysbbXSmeI1ne4JGGYkM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970046; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=pWOvNuMYZRWoq2fhDorz4NqQl+9mD4GENe1+ycHRxRI=; b=AllKY8wo7uSU5fSwlQjkUs/Uo7h/4hhaY/shw93ljkflrmbFuZOZuh3AyfLfttSAFLN8fHuJxjdNczSx7an3Umfl8NgX/oE+fHDyZWMRGKh5EzQaIIEZorBvL7EltdCcQk/pJuB7sw4PTgdD4gxigc7YfDk3aaY7Zi1lN1f2T10= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970046505450.6958801468636; Wed, 19 Apr 2023 22:54:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNBp-0004Ot-0j; Thu, 20 Apr 2023 01:50:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNB8-000406-L4 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:50:03 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNB7-0001ZO-2A for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:49:58 -0400 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-246bb512038so402473a91.1 for ; Wed, 19 Apr 2023 22:49:56 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969796; x=1684561796; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pWOvNuMYZRWoq2fhDorz4NqQl+9mD4GENe1+ycHRxRI=; b=FlLlno9oUJ0v3lTUorKFZyXjhFn9NkgVxm1wZ9/jeZ2TI8P0s0bLZqSSasl8ocDka4 K45m5LvOlq+9CWAb27aRQmK9jRNNKi6Sxc+60iLURaM1j4m+xWJuNuF9QP3MxDn+1r2/ EETp0kNK6w8eJa1VdjxTN9428b8ec/8S89m5xepcLaLqYOXwLAwT7Wi0UsbiOx2eRnG8 95riPTAbvILOMjONkF4hpC8ofdBXnSINNTzjBp1wCcrOMnk/isiQIGUDpyCSFF0kdJLC e9j+3xmN/RS3dMsTn0BF2EZTP/Ihbd3W4p8BghhZkWxokeuOF1snn8/wJBi2FFDJC42a nkqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969796; x=1684561796; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pWOvNuMYZRWoq2fhDorz4NqQl+9mD4GENe1+ycHRxRI=; b=U7ZEOy2qHwGGqsQhzhnWH+vp1SkHKHGkwqzOCIS+W6h7bH9OVUqpwCcOGE8J222AOF Wl2PhsFxUKMZYzh1WYD4spbsLfuzIn+koBmPjLdVJJbJsKPRisd2f/Lkdp/bK7WwOp79 4msVWLXdR86B/aRLmIsLAZB/edmY1PYxPeHzjFNiT7p4U/f4JEDWI9yADay2KsAylAPY NRKB1wDxFOQfhopBYpFHGwX7DN5tXdIbVEmWYjlaZNBcNxB/+tz9lR+MS67uwgX8BXAT z8qIGXBwNFh3L7sONoiUEQI7kWrNBUvTB3VaX5Tzg7ogzonFf8lDgbBgrFiV1qXWoJg6 cH5w== X-Gm-Message-State: AAQBX9dJfHcxVWmFo9/K0hTnV6Kwz0lCZ436LNoG6Mfv/lFGV5aZy0QW h2qKxaxZZj2vohxWPPgRhYsysQ== X-Google-Smtp-Source: AKy350b0txJrlDTgubjF/mPK+PTiYlkLl7j+vXMFdCclihjoNOhMV4p0kUR1rBi+WByy040QNGnjhg== X-Received: by 2002:a17:90a:2d8a:b0:24b:2e6a:24ed with SMTP id p10-20020a17090a2d8a00b0024b2e6a24edmr515347pjd.37.1681969795954; Wed, 19 Apr 2023 22:49:55 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 40/41] MAINTAINERS: Add a reviewer for network packet abstractions Date: Thu, 20 Apr 2023 14:46:56 +0900 Message-Id: <20230420054657.50367-41-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::1033; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970046701100005 I have made significant changes for network packet abstractions so add me as a reviewer. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index c31d2279ab..8b2ef5943c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2214,6 +2214,7 @@ F: tests/qtest/fuzz-megasas-test.c =20 Network packet abstractions M: Dmitry Fleytman +R: Akihiko Odaki S: Maintained F: include/net/eth.h F: net/eth.c --=20 2.40.0 From nobody Fri May 17 06:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1681970048; cv=none; d=zohomail.com; s=zohoarc; b=O7BxMhp1ptN13FBX2noNH0umhJ7GRITMT3Kw7rcRNO2CC1B0NymbuSja9O4YRkyRRVdJjmbL3VoRBPwx7Gs9aywh27BSiCHFR0++sC6t11AqWaOiD9dIoDketg1CJe+y6mBhYWW6xjpejarvKwz9BMzMWxfnbElJXlcntD0M2ms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681970048; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=ILeEC45O4cCOmKoGJEqXwqlDpUW0IKc6Vq1tRoBknx4=; b=Yaj/uwNeY2fVSgbZNwbnMl0Ra0t1RBT1o9qd557GQPFybcMB68UNTTdXi64//PH8w4LbnzACnFq7Y/XCo6NqhbWDKN1jKHV+6Ei+FdsSUF3i7RA4r7pc1KQa8Ll4cPeaBgx3B+CncUEu9NH9bet3muInQhgZUDoNIl/DfV7Tl2s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681970048157253.83372135810748; Wed, 19 Apr 2023 22:54:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppNBf-0004B3-6y; Thu, 20 Apr 2023 01:50:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppNBV-00048g-84 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:50:21 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppNBA-0001a6-MX for qemu-devel@nongnu.org; Thu, 20 Apr 2023 01:50:02 -0400 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-24735727c83so406014a91.3 for ; Wed, 19 Apr 2023 22:50:00 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a17090a46cf00b00247164c1947sm2769255pjg.0.2023.04.19.22.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 22:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681969799; x=1684561799; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ILeEC45O4cCOmKoGJEqXwqlDpUW0IKc6Vq1tRoBknx4=; b=W5bkx2MBSKlQdXRX90wmSA0q2XEoW6QAX0xxvbUMp6TaCKqNgIMqgSYN6TrQQpUAxk KNQbvDnctj9Ge5s2G4Pmyp1rLBY+hZD1YBwzg8R+oywOoa06xqI7e0Zr6bVEUFBnlg2L z1s6ZJUw38lBu4E9K/LhXQ0K6DFQbQc/CDPDQTVRzJ0UvRHYAkYjsK7JJQ18PB/akUvv ZIDUHoHKE6EOJSc0auCQKA/drP67FxMFcJF/Yzv9wmnIDSCwBbwegLFyxnBwfRJJQLlA KqcKs5iLDduVxQ1NiPyLSaJgWCLJAwtrDtuyKM2cHEDDyP4EixywPgUpMalpWn9xVJO/ yh2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681969799; x=1684561799; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ILeEC45O4cCOmKoGJEqXwqlDpUW0IKc6Vq1tRoBknx4=; b=FL3+Gdx4dXoHlezkr0EDGRarRqX2TuzPWjgl3mm+a3PzbZUalJ+URtz2efTNlOJh4x 5J03CcsXPZ7M6alE2F0epZZidfyffhKLRNM1FOp4AtVIMLZ9B+Gh1/Vdg7LKAEFrDFdS FZ6szw2w5jwxRSrPLKmV4DpeofDT9pWAihsWE3iK9CXTVvpHDgRym3d4+GQpny/tfscW KvCK8A/WcEpQai3wTOKIHW8UAg8tIekp5Y+6JVTCSyH/mApYYs8oy+ASo6YZUpw8wVRg DLnhnqfMa7N6qD5VWr9zWOy42gGNrhCgkSvJQ2KE5P1dt/SHJ4bMe20LUWMzLxDpHWjB hXwg== X-Gm-Message-State: AAQBX9cMGYR1mGa95NmKOglUA/oZ48Y6hjyNc7c6iS2/f1x3C/lA9iwN y/Ra1TcyXVFNVIzLbH/e4b7NjA== X-Google-Smtp-Source: AKy350btpyPON7proZ/xy50heh5+9WdMLL483B+qfhGvFWJeZwH966K7PWoNYsWqQSffEQg3JATpMg== X-Received: by 2002:a17:90a:b001:b0:23f:6958:e931 with SMTP id x1-20020a17090ab00100b0023f6958e931mr518724pjq.46.1681969799372; Wed, 19 Apr 2023 22:49:59 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v2 41/41] docs/system/devices/igb: Note igb is tested for DPDK Date: Thu, 20 Apr 2023 14:46:57 +0900 Message-Id: <20230420054657.50367-42-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420054657.50367-1-akihiko.odaki@daynix.com> References: <20230420054657.50367-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::1029; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1681970049954100013 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki --- docs/system/devices/igb.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/system/devices/igb.rst b/docs/system/devices/igb.rst index afe036dad2..60c10bf7c7 100644 --- a/docs/system/devices/igb.rst +++ b/docs/system/devices/igb.rst @@ -14,7 +14,8 @@ Limitations =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 This igb implementation was tested with Linux Test Project [2]_ and Window= s HLK -[3]_ during the initial development. The command used when testing with LT= P is: +[3]_ during the initial development. Later it was also tested with DPDK Te= st +Suite [4]_. The command used when testing with LTP is: =20 .. code-block:: shell =20 @@ -22,8 +23,8 @@ This igb implementation was tested with Linux Test Projec= t [2]_ and Windows HLK =20 Be aware that this implementation lacks many functionalities available wit= h the actual hardware, and you may experience various failures if you try to use= it -with a different operating system other than Linux and Windows or if you t= ry -functionalities not covered by the tests. +with a different operating system other than DPDK, Linux, and Windows or i= f you +try functionalities not covered by the tests. =20 Using igb =3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -32,7 +33,7 @@ Using igb should be nothing different from using another = network device. See :ref:`pcsys_005fnetwork` in general. =20 However, you may also need to perform additional steps to activate SR-IOV -feature on your guest. For Linux, refer to [4]_. +feature on your guest. For Linux, refer to [5]_. =20 Developing igb =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -68,4 +69,5 @@ References .. [1] https://www.intel.com/content/dam/www/public/us/en/documents/datash= eets/82576eb-gigabit-ethernet-controller-datasheet.pdf .. [2] https://github.com/linux-test-project/ltp .. [3] https://learn.microsoft.com/en-us/windows-hardware/test/hlk/ -.. [4] https://docs.kernel.org/PCI/pci-iov-howto.html +.. [4] https://doc.dpdk.org/dts/gsg/ +.. [5] https://docs.kernel.org/PCI/pci-iov-howto.html --=20 2.40.0