From nobody Tue Feb 10 01:31:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614798784; cv=none; d=zohomail.com; s=zohoarc; b=Zip+BwS2ff8GFuWWYPvn5o05BsIRPOefxwoULZEFm1qOXSd3Uu2hOAD3LQCZYRiJ29+AM4yoiik1fdyTv9BuNm/94pLS0q/4CCmgTSTClWkaQ2/PbpRn+tBretwe+sa+G3gKwVg2aVfMgZ+53quAE9IkgDWwFveOr1VcLSXJ4Mk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614798784; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=BuH4+Q0BM50iRTQU72DhaJAvYxJTYB/CnCHI67AXPbc=; b=VIXn7zTlKudfetTrslHialTwo0Nm/6dyonXI0aWrpJEtvP0EMyOum4D+TJG059hl/AllKBgp6KZJh3zd66p6vOtIjRBQnu2Jbl5vIwvyw0/PGatrYHwFfu124tncxo91Zl1ne/Cq0hj6U2ZfnB4/sinaNxQ0X0Xysa4wkOjg3I4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1614798784185993.0344056021484; Wed, 3 Mar 2021 11:13:04 -0800 (PST) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-477-qUbvYbccMheVq5h8m25lcA-1; Wed, 03 Mar 2021 14:13:01 -0500 Received: by mail-wr1-f71.google.com with SMTP id v1so2696550wru.7 for ; Wed, 03 Mar 2021 11:13:00 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id v5sm6812810wmh.2.2021.03.03.11.12.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 11:12:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614798783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BuH4+Q0BM50iRTQU72DhaJAvYxJTYB/CnCHI67AXPbc=; b=B+vdZjKWScTr9KKY3XJ4tK6wrmj8o6sC0lpDqfIubPTqo+Z5CgNbi6jo5t+oUfK78zFkoo 320qKQqwIeLnw8/LRkPm9QTZFJB0a9bU3uGr59YyBsii/kdmoT6Rsqk0a/tVzSf7pyQAe2 e24MUpDukZyanIMx8wmn7oWB5VGteVk= X-MC-Unique: qUbvYbccMheVq5h8m25lcA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BuH4+Q0BM50iRTQU72DhaJAvYxJTYB/CnCHI67AXPbc=; b=Se1m7jXx6XD2SHXSO2gyHPnywx7RdzS6MyeeMSPiUZZlUtO+hBJGSjlJncJNUxtNyq IQjabjXkZVuMgs01Ye422OQMlp9n0t6GREcQlk+X5mINmqbzYpft3t1FoITKsA0fpv15 W3qiRP3jkuPNjEtPwbUuKb1NmLYovc6Li4LzF5rf4ZfnK0qdEgDpRvnjp34Ou3Uh2E/g j+QrRF83mBTnRb5bKol0khBwkWOk5slsaBL6eG8lpjm4wTnNvJ+NcMXUiBeHpeu3g/25 5O9nwzk8ZkXAPorM6RMs/LxRi4ybmHKM5SEmuIbDr4FpxUp6H6KrgxZ+ZAc1rDuFqZ+5 wVXg== X-Gm-Message-State: AOAM532S1K1wWMOf5cqROa9PsIYGUdoUt8t8oLMFiDGkIX6dwr4phYYn TzqIQuhGVaz92ItfTNpeFhz1QUsrc4K3CrZtGbxvFfVgrAj457fwtjkTqMufnfmDb0SRaeZUWyg 1ZI5Ufu3WS+RhnA== X-Received: by 2002:a05:6000:18a:: with SMTP id p10mr224945wrx.166.1614798779294; Wed, 03 Mar 2021 11:12:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWtN2TXiNu/ZWiYkxV34OkYRiF1Vbunrzq6zARCVyP8COfaatgOcglggtfP1H3F9F4efQC9A== X-Received: by 2002:a05:6000:18a:: with SMTP id p10mr224930wrx.166.1614798779180; Wed, 03 Mar 2021 11:12:59 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jason Wang , Bin Meng , Dmitry Fleytman , Peter Maydell , Richard Henderson , Bin Meng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v3 10/10] hw/net: sunhme: Remove the logic of padding short frames in the receive path Date: Wed, 3 Mar 2021 20:12:05 +0100 Message-Id: <20210303191205.1656980-11-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210303191205.1656980-1-philmd@redhat.com> References: <20210303191205.1656980-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Bin Meng Now that we have implemented unified short frames padding in the QEMU networking codes, remove the same logic in the NIC codes. Signed-off-by: Bin Meng Message-Id: <1614763306-18026-10-git-send-email-bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/sunhme.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index fc34905f875..6971796e575 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -714,8 +714,6 @@ static inline void sunhme_set_rx_ring_nr(SunHMEState *s= , int i) s->erxregs[HME_ERXI_RING >> 2] =3D ring; } =20 -#define MIN_BUF_SIZE 60 - static ssize_t sunhme_receive(NetClientState *nc, const uint8_t *buf, size_t size) { @@ -724,7 +722,6 @@ static ssize_t sunhme_receive(NetClientState *nc, const= uint8_t *buf, dma_addr_t rb, addr; uint32_t intstatus, status, buffer, buffersize, sum; uint16_t csum; - uint8_t buf1[60]; int nr, cr, len, rxoffset, csum_offset; =20 trace_sunhme_rx_incoming(size); @@ -775,14 +772,6 @@ static ssize_t sunhme_receive(NetClientState *nc, cons= t uint8_t *buf, =20 trace_sunhme_rx_filter_accept(); =20 - /* If too small buffer, then expand it */ - if (size < MIN_BUF_SIZE) { - memcpy(buf1, buf, size); - memset(buf1 + size, 0, MIN_BUF_SIZE - size); - buf =3D buf1; - size =3D MIN_BUF_SIZE; - } - rb =3D s->erxregs[HME_ERXI_RING >> 2] & HME_ERXI_RING_ADDR; nr =3D sunhme_get_rx_ring_count(s); cr =3D sunhme_get_rx_ring_nr(s); --=20 2.26.2