From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B9C32A034F; Sat, 27 Feb 2021 04:57:02 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 275271CC585; Sat, 27 Feb 2021 04:57:02 +0100 (CET) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id 44BE240146 for ; Sat, 27 Feb 2021 04:56:58 +0100 (CET) Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DnXjg0N85z16CsG; Sat, 27 Feb 2021 11:55:19 +0800 (CST) Received: from [10.78.49.194] (10.78.49.194) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.498.0; Sat, 27 Feb 2021 11:56:52 +0800 To: Ferruh Yigit CC: , References: <1614130139-42926-1-git-send-email-oulijun@huawei.com> <1614130139-42926-10-git-send-email-oulijun@huawei.com> From: oulijun Message-ID: <31ce981f-c76c-3625-86bf-4c1269354f67@huawei.com> Date: Sat, 27 Feb 2021 11:56:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.78.49.194] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH 09/13] net/hns3: fix maximum frame size update after buffer alloc X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 在 2021/2/26 23:25, Ferruh Yigit 写道: > On 2/24/2021 1:28 AM, Lijun Ou wrote: >> From: Chengchang Tang >> >> After MTU changed, the buffer used to store packets in HW should be >> reallocated. And buffer size is allocated based on the maximum frame >> size in the PF struct. However, the value of maximum frame size is >> not updated in time when MTU is changed. This would lead to a packet >> loss for not enough buffer. >> >> This patch update the maximum frame size before reallocating the HW >> buffer. And a rollback operation is added to avoid the side effects >> of buffer reallocation failures. >> >> Fixes: 1f5ca0b460cd ("net/hns3: support some device operations") >> Fixes: d51867db65c1 ("net/hns3: add initialization") >> Cc: stable@dpdk.org >> >> Signed-off-by: Chengchang Tang >> Signed-off-by: Lijun Ou > > Isn't the patch title should say 'before', like: > net/hns3: fix maximum frame size update _before_ buffer alloc > > Or perhaps I get the patch wrong... > . The expression here may vary from different perspectives. From a hardware standpoint, the problem is that the maximum frame size update buffer allocation. From a software standpoint, the the buffer size that should be allocted depends on the maximum frame size kept in the driver, and the problem is caused by the late value update in the driver. >