From nobody Tue Nov 18 19:43:47 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1612784105; cv=none; d=zohomail.com; s=zohoarc; b=VbyiRkavoE3IDC2RVSr3fn/LaEoJ8CEWBY3zYBebX9Npa3cebDoCrd9Hb/SDLkOzLsi+7I1zdX6xU/x0t5ByfyVDvXIG3uXOdERvw3oDKDd8tbTXnwI+KYUU0yikwscd3LnUwMk1/Ng1n3MpdtDlXTyIeSEyCezPdmenDjIJSAs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612784105; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=vfyGIVBLh46WHUXmpy8/GIwWAOX2AIpZ5UzYaoUuAEQ=; b=iCNjDvd0VdsMJmzby5MrtpDCq0xHLIW7FK5yZ6rv1pTbwvqs9jK+lSIT/ylY53Y9yXNkY8ktLiyBCtWH9VEzYTwaDmlUtH0uWFPi12i5RwFWjPNy//baQ+/rCp5o8W/LaY5Nbce6NLUwRs3RNu0pj3Rs4JrK5wgBxCBDHBW8jbE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612784105562471.01128461196424; Mon, 8 Feb 2021 03:35:05 -0800 (PST) Received: from localhost ([::1]:37808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l94b8-0005hk-Uq for importer@patchew.org; Mon, 08 Feb 2021 06:20:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l90GB-0003fl-5S; Mon, 08 Feb 2021 01:43:01 -0500 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:38182) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l90Fi-0000XL-O5; Mon, 08 Feb 2021 01:42:46 -0500 Received: by mail-ed1-x536.google.com with SMTP id s11so16809410edd.5; Sun, 07 Feb 2021 22:41:17 -0800 (PST) Received: from pek-vx-bsp2.wrs.com (ec2-44-242-66-180.us-west-2.compute.amazonaws.com. [44.242.66.180]) by smtp.gmail.com with ESMTPSA id b4sm3222734edh.40.2021.02.07.22.41.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Feb 2021 22:41:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=vfyGIVBLh46WHUXmpy8/GIwWAOX2AIpZ5UzYaoUuAEQ=; b=Ks2PXtH4rkJPalqPrzzIO3fnv80Bm6CS/cHkqZOmocsU/OQTL1NsOUbU4rY2yO7g9+ tuPsayX/rOts3PyTOifReRr2J/3NsnqJjHHHTLaqsXW3itq24z4WQnV8aztGumx66ifK OA1UZDwKiKikPay2w3yLnuUziPXtyXwk0Zew8s6Xal9VMdjMj15iMTkV/W3ZlVVgE6AX t5GZMzaddl8LqOlSWlyNVGYrU7I+MwpZXeGITLiCg0UUkEzKaCf69J+XzM1QL/8IgN9y /y5efwUVSYsPUA8CssGOq5NPuA8LmTFceITbsDLSe3wYl9+GjMgnm2qjiS9cFnrX7Daf I0BA== 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; bh=vfyGIVBLh46WHUXmpy8/GIwWAOX2AIpZ5UzYaoUuAEQ=; b=ZtA6YW7/xnU1jbjdr7IByEMZueU9BxLePbPEtrI8N8+WbPkwhjNze5v/NbeidTRu8R Ls4V9dKMtlosiLe/N7X5wg6kxA8hoJHprf0ptn2JyTo+aY4uOcw4aI4d20ISGnzEniKg yhNnj5O/UJ+ZSAwsTWYM/TA+hHhimkNuglUW4vw+rnqe9swOSocW1wqPabd0v89vxY1L 8nYrnevmGSScXkQGUofMbLAbuuusGQlgKIn+2VNHIlTHUopnNgZZJRa+SUaywM4TD8Xj bDxVfumSMQKMH81Ej4eHwpa/fpfx3Qubg9xvr6NkGFCGXGhdt91ZY+txFaDLMovexps7 q0iA== X-Gm-Message-State: AOAM530vyUjakh5rzF7yq4pZDgp8wbvdAHpj4MzIV+YkultCkTa/km15 o6f5PR8bk6WbwH/awSoz/KA= X-Google-Smtp-Source: ABdhPJy0lZBHtVESecesvXy1CvlEW/39/dx4sADNHV5ezd1y9J6buK2bW06iAcqiy36KCbxlb2IaAw== X-Received: by 2002:aa7:d98f:: with SMTP id u15mr15806198eds.267.1612766476719; Sun, 07 Feb 2021 22:41:16 -0800 (PST) From: Bin Meng X-Google-Original-From: Bin Meng To: David Gibson , Greg Kurz , Jason Wang Subject: [PATCH] hw/net: fsl_etsec: Do not reject short frames Date: Mon, 8 Feb 2021 14:41:05 +0800 Message-Id: <1612766465-7639-1-git-send-email-bin.meng@windriver.com> X-Mailer: git-send-email 2.7.4 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: pass client-ip=2a00:1450:4864:20::536; envelope-from=bmeng.cn@gmail.com; helo=mail-ed1-x536.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" As of today both slirp and tap networking do not pad short frames (e.g.: an ARP packet) to the minimum frame size of 60 bytes. If eTSEC is programmed to reject short frames, ARP requests will be dropped, preventing the guest from becoming visible on the network. The same issue was reported on e1000 and vmxenet3 before, see: commit 78aeb23eded2 ("e1000: Pad short frames to minimum size (60 bytes)") commit 40a87c6c9b11 ("vmxnet3: Pad short frames to minimum size (60 bytes)") Ideally this should be fixed on the slirp/tap networking side to pad short frames to the minimum frame length, but I am not sure whether that's doable. This commit changes to codes to ignore the RCTRL_RSF setting and still allow receiving the short frame. The log message is updated to mention the reject short frames functionality is unimplemented. Signed-off-by: Bin Meng --- hw/net/fsl_etsec/rings.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/net/fsl_etsec/rings.c b/hw/net/fsl_etsec/rings.c index 121415a..503b4d3 100644 --- a/hw/net/fsl_etsec/rings.c +++ b/hw/net/fsl_etsec/rings.c @@ -502,10 +502,17 @@ ssize_t etsec_rx_ring_write(eTSEC *etsec, const uint8= _t *buf, size_t size) return -1; } =20 + /* + * Both slirp and tap networking do not pad short frames + * (e.g.: an ARP packet) to the minimum frame size of 60 bytes. + * + * If eTSEC is programmed to reject short frames, ARP requests + * will be dropped, preventing the guest from becoming visible + * on the network. + */ if ((etsec->regs[RCTRL].value & RCTRL_RSF) && (size < 60)) { /* CRC is not in the packet yet, so short frame is below 60 bytes = */ - RING_DEBUG("%s: Drop short frame\n", __func__); - return -1; + RING_DEBUG("%s: Drop short frame not implemented\n", __func__); } =20 rx_init_frame(etsec, buf, size); --=20 2.7.4