From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87EC8C433E0 for ; Wed, 17 Mar 2021 06:51:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2A3B764F96 for ; Wed, 17 Mar 2021 06:51:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A3B764F96 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMPoP-0003mL-Rm for qemu-devel@archiver.kernel.org; Wed, 17 Mar 2021 02:37:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMPeN-0003rr-DT for qemu-devel@nongnu.org; Wed, 17 Mar 2021 02:27:28 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:45210) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMPeG-0000Au-2A for qemu-devel@nongnu.org; Wed, 17 Mar 2021 02:27:18 -0400 Received: by mail-ej1-x633.google.com with SMTP id mm21so704909ejb.12 for ; Tue, 16 Mar 2021 23:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=fYxXpZBSx/3UmjTv+pgNgyANPy1MdJ+W91DIofp+gdA=; b=rsjCm1p4oSaT/NrcdRais0wAaXOi8NWgu60uAYdQ7nDkABJvdk6iuSDHW6ordlQDtD QnEilhSqaQOmnEor0V6fGtDc4h3I1qdpbhwDPIVx+w9u7oWidG8S2lffYFXxmwxAbkwM eN0pFPXYuvGIMgXi3AytMThpamVAHHLIJ/eWLPDv6ZcO+/MPKQhGWkP5qE411dZwLvWa 1PlggwZ4tGzB0Ci4e1qKBObf9o9HoEuss9Gur0ut5rCmjanQZMoS1xcoes9RLWHqHGun 7Ly0iucbMmoSnHRGpjQyAXjSr7klNZHzBJRS3SUOWRYpUmtzD4zidZrnZmMR1vEJ0258 Dc+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=fYxXpZBSx/3UmjTv+pgNgyANPy1MdJ+W91DIofp+gdA=; b=kqVyiIe+rFztFFgGbqWyLqlWIiHMm/ifGquZ0SuxWvUB4Qghq4yPQHvpvqNWEK+Z9W SNn/GpyTvMbAQi6Boti783P8jSuqCELzN+ap7ZIZYr4uPx6eQV3r6vjfBK6QjQwpYEwx UBl6e4uAT5G+G5tZCJOQFvP2UoJsMfPL3G/hoNyqzYr2452AI9FXsvHj4Jhn5LZLDcTv rn+MmghmS6xKObwuZ5W21RmhYBfiu2u1qRRQMBbiO47T7Y+eSHCC7E6bT1iQNWKFKvs1 hwrIEm53XwH/0S61zcEgvQxvzkkSvdZlxCYMaIc3KENCXnDFOKWJXNTnz/0O7RIR0mFI /bnQ== X-Gm-Message-State: AOAM532FHvGqD9kqtPyvjbqx9YvhH+RrLVPXDzJz1njRwfmrUwb3cmBR of8AsPF14qfyOdXceucsd9BuUPEglOc= X-Google-Smtp-Source: ABdhPJyP5r9iC9iQZaJn62Cuj7ymKoimIrhsOHc9hIaOOGojXGBMvyJC/YDYFt4q38T9whQGkwiJ7Q== X-Received: by 2002:a17:906:4a50:: with SMTP id a16mr34271487ejv.256.1615962434210; Tue, 16 Mar 2021 23:27:14 -0700 (PDT) Received: from pek-vx-bsp9.wrs.com (ec2-44-242-66-180.us-west-2.compute.amazonaws.com. [44.242.66.180]) by smtp.gmail.com with ESMTPSA id d1sm10751349eje.26.2021.03.16.23.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 23:27:13 -0700 (PDT) From: Bin Meng To: Jason Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH v5 06/12] hw/net: vmxnet3: Remove the logic of padding short frames in the receive path Date: Wed, 17 Mar 2021 14:26:32 +0800 Message-Id: <20210317062638.72626-7-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210317062638.72626-1-bmeng.cn@gmail.com> References: <20210317062638.72626-1-bmeng.cn@gmail.com> Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=bmeng.cn@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Now that we have implemented unified short frames padding in the QEMU networking codes, remove the same logic in the NIC codes. This actually reverts commit 40a87c6c9b11ef9c14e0301f76abf0eb2582f08e. Signed-off-by: Bin Meng --- (no changes since v1) hw/net/vmxnet3.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index eff299f629..d993cce097 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -39,7 +39,6 @@ #define PCI_DEVICE_ID_VMWARE_VMXNET3_REVISION 0x1 #define VMXNET3_MSIX_BAR_SIZE 0x2000 -#define MIN_BUF_SIZE 60 /* Compatibility flags for migration */ #define VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS_BIT 0 @@ -1951,7 +1950,6 @@ vmxnet3_receive(NetClientState *nc, const uint8_t *buf, size_t size) { VMXNET3State *s = qemu_get_nic_opaque(nc); size_t bytes_indicated; - uint8_t min_buf[MIN_BUF_SIZE]; if (!vmxnet3_can_receive(nc)) { VMW_PKPRN("Cannot receive now"); @@ -1964,14 +1962,6 @@ vmxnet3_receive(NetClientState *nc, const uint8_t *buf, size_t size) size -= sizeof(struct virtio_net_hdr); } - /* Pad to minimum Ethernet frame length */ - if (size < sizeof(min_buf)) { - memcpy(min_buf, buf, size); - memset(&min_buf[size], 0, sizeof(min_buf) - size); - buf = min_buf; - size = sizeof(min_buf); - } - net_rx_pkt_set_packet_type(s->rx_pkt, get_eth_packet_type(PKT_GET_ETH_HDR(buf))); -- 2.17.1