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=-8.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 B2287C433DB for ; Fri, 26 Feb 2021 18:58:14 +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 23B4F64F1F for ; Fri, 26 Feb 2021 18:58:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23B4F64F1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:54944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFiJY-0003b6-TK for qemu-devel@archiver.kernel.org; Fri, 26 Feb 2021 13:58:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFiIw-0003AW-HV for qemu-devel@nongnu.org; Fri, 26 Feb 2021 13:57:34 -0500 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]:40235) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lFiIu-0004zT-Tt for qemu-devel@nongnu.org; Fri, 26 Feb 2021 13:57:34 -0500 Received: by mail-ej1-x62b.google.com with SMTP id u20so16560065ejb.7 for ; Fri, 26 Feb 2021 10:57:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=G+UhYcLHBOukE8OvsJD/XDFIIlD46niw26xKg8q77yU=; b=Uw7+Rye7GCUBWKjFECFwAZ/EKd1cCPldBLdn/sH6SSDVV/nehQtrDgGp8EYgdE9dcb lEzIsNSZrejKN+93UNdHhpMO7xQLnB+upDrISTq4mgYpzSgI5Kiq84fl5rNvK7kgjYMB RGHh1pgBQpmC42srNqTRoZPftQcgAox21lM9V0NedFxPHg8OHU3fBUydbc3VRdpadWjd wogVntyBxFMLaznvo+hV2f2nKFyn/OyCCtjx3+9ssWgtR7GpNCjiRI7z0I1bXoGUealv KQsVl9SwT2+xZ/zqn4MwPQaECnQVBRIMM3BCYG6ROavEE61X3zHzHGTBVusw4gt6jGWs S8Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G+UhYcLHBOukE8OvsJD/XDFIIlD46niw26xKg8q77yU=; b=UQWBLpU98b0A0fO/1fx6XdqtucV5I0sNB4txIdAEEkJfb/YfAPdvgKGjtVyb3WjcMk akl0D9H8co7VKCwD9iznnhpDKanyjScergsCc+MvJoGnAG8qTsf4SXFZxPt62jBzHBL9 RwWoBysuusEOxwpTUcQIkAAG8Gl61+12qPzNYan5Hr2NRnnfhslFdUGz0vWdxoeQYbi+ X8vZPxpP38ShTbRaozNDh/f9j6z0SZX/K+DLWdKkVMUKMY+O/cPYZYGF7tff4giOwJEO QK4aSJknAihKYF3hJFW7KBc9C56+IW6MhtAMt6sTvr94PR/h3AmEStvnYOsceNKZ6HG9 9pvw== X-Gm-Message-State: AOAM531KdcWXx0Ivnva0Z0c37eRb8hoqoauukd9nFBmbZrf13OxJaZjX uVnQGaJjRkeGbxRrbBzCTZAc95R4uarvNsil86KCRg== X-Google-Smtp-Source: ABdhPJzjEeQPi0A2TkHLJgruhieAA/td88OJdRHxhczWc2KDExpSlQpFIOEH1f/V8uGCYtoHjjZ7f1RXD7qIlYPnkQM= X-Received: by 2002:a17:906:1ecc:: with SMTP id m12mr4971042ejj.4.1614365850496; Fri, 26 Feb 2021 10:57:30 -0800 (PST) MIME-Version: 1.0 References: <1614333786-74258-1-git-send-email-bmeng.cn@gmail.com> <1614333786-74258-2-git-send-email-bmeng.cn@gmail.com> In-Reply-To: <1614333786-74258-2-git-send-email-bmeng.cn@gmail.com> From: Peter Maydell Date: Fri, 26 Feb 2021 18:57:19 +0000 Message-ID: Subject: Re: [RFC PATCH 1/3] net: Pad short frames to minimum size (60 bytes) To: Bin Meng Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=peter.maydell@linaro.org; helo=mail-ej1-x62b.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , Bin Meng , =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= , QEMU Developers Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Fri, 26 Feb 2021 at 10:03, Bin Meng wrote: > > From: Bin Meng > > The minimum Ethernet frame length is 60 bytes, and we should pad > frames whose length is smaller to the minimum size. > > This commit fixes the issue as seen with various ethernet models, > that ARP requests get dropped, preventing the guest from becoming > visible on the network. > > The following 2 commits that attempted to workaround this issue > in e1000 and vmxenet3 before, should be reverted. > > commit 78aeb23eded2 ("e1000: Pad short frames to minimum size (60 bytes)") > commit 40a87c6c9b11 ("vmxnet3: Pad short frames to minimum size (60 bytes)") > > Signed-off-by: Bin Meng > --- Is it better to do this here, or in the places which create network packets? Doing it centrally has the advantage of being just one place to change which then means senders and receivers don't need to think about it. On the other hand it means we don't have any equivalent of really actually sending a short frame and having the modelled ethernet device implement the handling of the short frame. thanks -- PMM