From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE58C2F430C; Thu, 12 Jun 2025 13:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749733787; cv=none; b=uMQDPEgc0hu1Yd/ibAAWyb0z6stduU1EdOycVpVDFzjV6VUiR0ZR4a2IUuPiXlZUgE66donJJqSdLAUClgpKbqzwhaO1p4q1kYmxdSbwVnrKNQcI0T02gRfJ+AQvT1cODy0qScqL+Zp+wqbOgRptp3UvMbnZLOGQiHbfATTHdvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749733787; c=relaxed/simple; bh=DNd41N3FOFnvelD0wpL5VGYshR/FFAfzJM3V9VuwB+U=; h=Message-ID:Date:MIME-Version:CC:Subject:To:References:From: In-Reply-To:Content-Type; b=AJLk2L3ZpaHn0lvK8V3ZsVYukgf5umRXOqjXWz8uaxpqbJbyDybYPT9MpcFClPIN9yZDTD4K7xEIxn2AjUxCN8iIL/goShB0jiVkHt9N7aeyh12NWDS2ga5cwstC5sj1hOj7feBR6JNccwpftHLSuO0wU40Bj+wvx7omASR1o8E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4bJ2s13Q1gz2TS1V; Thu, 12 Jun 2025 21:08:21 +0800 (CST) Received: from kwepemk100013.china.huawei.com (unknown [7.202.194.61]) by mail.maildlp.com (Postfix) with ESMTPS id 408081A0188; Thu, 12 Jun 2025 21:09:42 +0800 (CST) Received: from [10.67.120.192] (10.67.120.192) by kwepemk100013.china.huawei.com (7.202.194.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 12 Jun 2025 21:09:41 +0800 Message-ID: <34d9d8f7-384e-4447-90e2-7c6694ecbb05@huawei.com> Date: Thu, 12 Jun 2025 21:09:40 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird CC: , Nick Desaulniers , Bill Wendling , Justin Stitt , Hao Lan , Guangwei Zhang , Netdev , , Subject: Re: [PATCH] hns3: work around stack size warning To: Arnd Bergmann , Arnd Bergmann , Jian Shen , Salil Mehta , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nathan Chancellor References: <20250610092113.2639248-1-arnd@kernel.org> <41f14b66-f301-45cb-bdfd-0192afe588ec@huawei.com> From: Jijie Shao In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: kwepems200002.china.huawei.com (7.221.188.68) To kwepemk100013.china.huawei.com (7.202.194.61) on 2025/6/12 0:36, Arnd Bergmann wrote: > On Wed, Jun 11, 2025, at 04:10, Jijie Shao wrote: >> on 2025/6/10 17:21, Arnd Bergmann wrote: >>> From: Arnd Bergmann >>> Annotate hns3_dbg_tx_spare_info() as noinline_for_stack to force the >>> behavior that gcc has, regardless of the compiler. >>> >>> Ideally all the functions in here would be changed to avoid on-stack >>> output buffers. >> Would you please help test whether the following changes have solved >> your problem, >> And I'm not sure if this patch should be sent to net or net-next... > Your patch arrived with whitespace corruption here, so I could not > try it, but I'm sure it would help avoid the warning. > > However, this is not what meant with my suggestion: you already > allocate a temporary buffer in hns3_dbg_open() and I would > expect it to be possible to read into that buffer directly > without a second temporary buffer (on stack or kmalloc). > > The normal way of doing this would be to use the infrastructure > from seq_file and then seq_printf() and not have any extra buffers > on top of that. > > Arnd Hi, seq_file is good. But the change is quite big. I need to discuss it internally, and it may not be completed so quickly. I will also need consider the maintainer's suggestion. Thanks, Jijie Shao