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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 C0271C3A5A9 for ; Mon, 4 May 2020 13:35:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9992821582 for ; Mon, 4 May 2020 13:35:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728249AbgEDNfi (ORCPT ); Mon, 4 May 2020 09:35:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:34982 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726913AbgEDNfi (ORCPT ); Mon, 4 May 2020 09:35:38 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3AA7AAD2C; Mon, 4 May 2020 13:35:38 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id AFC15604EE; Mon, 4 May 2020 15:35:35 +0200 (CEST) Date: Mon, 4 May 2020 15:35:35 +0200 From: Michal Kubecek To: Oleksij Rempel Cc: Marek Vasut , Andrew Lunn , Florian Fainelli , Jonathan Corbet , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Russell King , mkl@pengutronix.de, kernel@pengutronix.de, David Jander , Jakub Kicinski , Christian Herber , "David S. Miller" , Heiner Kallweit Subject: Re: [PATCH v5 1/2] ethtool: provide UAPI for PHY master/slave configuration. Message-ID: <20200504133535.GC8237@lion.mk-sys.cz> References: <20200504071214.5890-1-o.rempel@pengutronix.de> <20200504071214.5890-2-o.rempel@pengutronix.de> <20200504080417.i3d2jsjjpu2zjk4z@pengutronix.de> <20200504083734.GA5989@lion.mk-sys.cz> <20200504085556.rzkvn47q2k5iqyap@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200504085556.rzkvn47q2k5iqyap@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 04, 2020 at 10:55:56AM +0200, Oleksij Rempel wrote: > On Mon, May 04, 2020 at 10:37:34AM +0200, Michal Kubecek wrote: > > On Mon, May 04, 2020 at 10:04:17AM +0200, Oleksij Rempel wrote: > > > @Michal, > > > > > > i noticed that linkmodes_fill_reply() some times get not enough > > > tailroom. > > > if data->peer_empty == 0 > > > linkmodes_reply_size() size: 476 > > > linkmodes_fill_reply() skb tailroom: 724 > > > > > > > > > if data->peer_empty == 1 > > > linkmodes_reply_size() size: 216 > > > linkmodes_fill_reply() skb tailroom: 212 > > > > > > In the last case i won't be able to attach master_lave state and cfg > > > fields. > > > > > > It looks like this issue was not introduced by my patches. May be you > > > have idea, what is missing? > > > > It's my mistake, I'm just not sure why I never ran into this while > > testing. Please try the patch below. > > thx! it works now: > [ 82.754019] linkmodes_reply_size:103 size: 216 > [ 82.758523] linkmodes_fill_reply:117 skb tailroom: 724 > > [ 126.781892] linkmodes_reply_size:103 size: 476 > [ 126.786464] linkmodes_fill_reply:117 skb tailroom: 724 Thank you. It seems so far the natural skb padding was always sufficient to hide the broken calculation. Some time ago I had a debugging printk in place which checked calculated an actual size but that was with an older version of the series and the code has been rewritten few times before it reached mainline. I'll run some tests with additional tracing of estimated and actual message size and if I don't find other problem, I'll submit the fix. Michal