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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 686B3C433EF for ; Mon, 1 Nov 2021 03:42:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4487360EE9 for ; Mon, 1 Nov 2021 03:42:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230237AbhKADpE (ORCPT ); Sun, 31 Oct 2021 23:45:04 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:15322 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230222AbhKADpD (ORCPT ); Sun, 31 Oct 2021 23:45:03 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4HjJkg1mRcz90cS; Mon, 1 Nov 2021 11:42:19 +0800 (CST) Received: from kwepemm600016.china.huawei.com (7.193.23.20) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Mon, 1 Nov 2021 11:42:19 +0800 Received: from [10.67.102.67] (10.67.102.67) by kwepemm600016.china.huawei.com (7.193.23.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Mon, 1 Nov 2021 11:42:18 +0800 Subject: Re: [PATCH V5 net-next 0/6] ethtool: add support to set/get tx copybreak buf size and rx buf len To: Andrew Lunn CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <20211030131001.38739-1-huangguangbin2@huawei.com> From: "huangguangbin (A)" Message-ID: Date: Mon, 1 Nov 2021 11:42:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.67] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600016.china.huawei.com (7.193.23.20) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-s390@vger.kernel.org On 2021/10/31 1:58, Andrew Lunn wrote: >> Rx buf len is buffer length of each rx BD. Use ethtool -g command to get >> it, and ethtool -G command to set it, examples are as follow: >> >> 1. set rx buf len to 4096 >> $ ethtool -G eth1 rx-buf-len 4096 >> >> 2. get rx buf len >> $ ethtool -g eth1 >> ... >> RX Buf Len: 4096 > > How does this interact with MTU? If i have an MTU of 1500, and i set > the rx-buf-len to 1000, can i expect all frames to the discarded? > Should the core return -EINVAL? Or do you think some hardware will > simply allocate two buffers and scatter/gather over them? Which > implies that drivers which cannot SG must check if the rx-buf-len is > less than the MTU and return -EINVAL? > > Andrew > . > Yes, hns3 driver supports scatter/gather for this situation, it's necessary for driver which cannot support SG to check if rx buf len is less than mtu.