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=-0.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 8AE5DC433DB for ; Tue, 9 Mar 2021 10:19:01 +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 E62F365266 for ; Tue, 9 Mar 2021 10:19:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E62F365266 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]:33556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJZS8-0004Ve-1W for qemu-devel@archiver.kernel.org; Tue, 09 Mar 2021 05:19:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJZRI-000437-0o for qemu-devel@nongnu.org; Tue, 09 Mar 2021 05:18:08 -0500 Received: from mail-yb1-xb32.google.com ([2607:f8b0:4864:20::b32]:44701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJZRG-0008AA-8Y for qemu-devel@nongnu.org; Tue, 09 Mar 2021 05:18:07 -0500 Received: by mail-yb1-xb32.google.com with SMTP id f4so13363541ybk.11 for ; Tue, 09 Mar 2021 02:18:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=QVTFd8LzAzeA94RJuOg4b+T1W+WQCzVje88pnJi2aMc=; b=VOcqbZvaGc3+Gp+Un+QjSAW5tcgXbM54z+Q1FBQDu7ftZCexx8cdPR17ke4jabhNyS ORnmFJNyCF+4gWlvcfirgBYR7cfbWdr8no8xnN3/ZfVnJ+GdJ5sfzsB5lslr4OGuPV7Y JKsJUrATgIN+N+C+2UxMyJrgJBG57H3WWjuEMU5jviMyyMVXEIC/bNeFIurK981nHO/7 RkHj0BEUHjkheJ2Llp7g3uj2L5eKrsarE7w1kJbuWHFRUKBEu53B68l3GSTEOIex5h9c sEKuNzDFYpZBiBNsfIbVt5JVlAajmarsBxkXToUi8Cnn6AANkA5xX4dNsnSwmGC5yclj sGFg== 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:content-transfer-encoding; bh=QVTFd8LzAzeA94RJuOg4b+T1W+WQCzVje88pnJi2aMc=; b=M1N1Qtl7oYdI04fD5ndIEFJsw1KfYsI03fWOJsNG6N39vhzLmL2Y4L8K23+pHNrotD MnbGu2j+u/t/I7HmzUKku9nyv6fM36tAAUr4kYwGXjuCBjbsHbePSRgKrdZkRVEsqdIy F2haUS5+yFsaJmEe3W0N2ULa3FYaXiz8YP7Tfoi+u4hz4LAJV2rTtVsPM/HFQR+XAAdX 9EPc945bHGDv0hBC3jd95sN4DnfFnKj3lbY1TUZE5Ut48GZc96tBvQWeBdKY3oy3XtWI rre7onS+MoQl6HqnPKalQyoiX42K4KZ1hOYmAcXNMj2RgmW/NPOjKTwEhjr7lbs/vPs9 +QSg== X-Gm-Message-State: AOAM533H4yGNsYZD37CdZsZbh/La/cCcLwuCPkWZZYXqhc05f0DyZ+jM ePK701WpmFOy0cqjS5aSEkh8DWRwQ7IPgiY427Q= X-Google-Smtp-Source: ABdhPJwzU1Ukf9vjgTAD7nhDGnIjyVawfxddECo7Wn4wOaSeEXtPkt9bRLtbk02jbmfXyq9Pl1q7qbgPlWCYoGk+kKk= X-Received: by 2002:a5b:147:: with SMTP id c7mr40583219ybp.332.1615285085466; Tue, 09 Mar 2021 02:18:05 -0800 (PST) MIME-Version: 1.0 References: <20210303191205.1656980-1-philmd@redhat.com> <20210303191205.1656980-3-philmd@redhat.com> <36123f35-06ab-d0da-37d2-6f8324e7f582@redhat.com> In-Reply-To: From: Bin Meng Date: Tue, 9 Mar 2021 18:17:54 +0800 Message-ID: Subject: Re: [RFC PATCH v3 02/10] net: Pad short frames to minimum size before send from SLiRP/TAP To: Peter Maydell Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::b32; envelope-from=bmeng.cn@gmail.com; helo=mail-yb1-xb32.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: , Cc: Dmitry Fleytman , Jason Wang , Bin Meng , Richard Henderson , QEMU Developers , =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Hi Peter, On Tue, Mar 9, 2021 at 6:13 PM Peter Maydell wro= te: > > On Tue, 9 Mar 2021 at 09:01, Bin Meng wrote: > > > > Hi Jason, > > > > On Tue, Mar 9, 2021 at 5:00 PM Bin Meng wrote: > > > > > > Hi Jason, > > > > > > On Tue, Mar 9, 2021 at 4:57 PM Jason Wang wrote= : > > > > > > > > > > > > On 2021/3/9 4:35 =E4=B8=8B=E5=8D=88, Bin Meng wrote: > > > > > Hi Jason, > > > > > > > > > > On Tue, Mar 9, 2021 at 4:23 PM Jason Wang w= rote: > > > > >> > > > > >> On 2021/3/8 6:22 =E4=B8=8B=E5=8D=88, Peter Maydell wrote: > > > > >>> I think the key thing we need to do here is make a decision > > > > >>> and be clear about what we're doing. There are three options > > > > >>> I can see: > > > > >>> > > > > >>> (1) we say that the net API demands that backends pad > > > > >>> packets they emit to the minimum ethernet frame length > > > > >>> unless they specifically are intending to emit a short frame, > > > > >>> and we fix any backends that don't comply (or equivalently, > > > > >>> add support in the core code for a backend to mark itself > > > > >>> as "I don't pad; please do it for me"). > > > > >>> > > > > >>> (2) we say that the networking subsystem doesn't support > > > > >>> short packets, and just have the common code always enforce > > > > >>> padding short frames to the minimum length somewhere between > > > > >>> when it receives a packet from a backend and passes it to > > > > >>> a NIC model. > > > > >>> > > > > >>> (3) we say that it's the job of the NIC models to pad > > > > >>> short frames as they see them coming in. > > > > > >> I'm not sure how much value we can gain from (1). So (2) looks b= etter to me. > > > > >> > > > > >> Bin or Philippe, want to send a new version? > > > > >> > > > > > I think this series does what (2) asks for. Or am I missing anyth= ing? > > > > > > > > > > > > It only did the padding for user/TAP. > > > > > > > (hit send too soon ...) > > > > Ah, so we want this: > > > > if (sender->info->type !=3D NET_CLIENT_DRIVER_NIC) > > > > correct? > > No, option (2) is "always pad short packets regardless of > sender->info->type". Even if a NIC driver sends out a short > packet, we want to pad it, because we might be feeding it to > something that assumes it does not see short packets. Then this is v1: http://patchwork.ozlabs.org/project/qemu-devel/patch/1614333786-74258-2-git= -send-email-bmeng.cn@gmail.com/ If yes, I will respin v3. Regards, Bin