From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b5-smtp.messagingengine.com (fout-b5-smtp.messagingengine.com [202.12.124.148]) (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 70B032EFD8F for ; Mon, 20 Oct 2025 09:10:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.148 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760951424; cv=none; b=WDr8LsQ0eAUNPwLLN15AuMpcdDvcoJoEeK5WsqlGfrsMa25uA/CEGsNJwu30ZHsRw4Lv0JLVj4tCzObmkdcF8LTp4J1vBnAb12jPEdYu3FsLEtEonxXYo7198tE72Oye8MlESHwlCNyKH0Z1ZDJSwxktb1utk19a7ZZ5FMTQGjw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760951424; c=relaxed/simple; bh=P79UHccwcgEWVBGz1KcEPTQTM6OY5QxvDpDKCvddb3k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ofqidzpRjgj29njdfeXQL62lGXEpHFelrHnAVtdYujakIh/cGP/1yZO23L4hAdCAS4/3capVQmvPzzVOChDz3RGH0WkRWfcBwlei1/tJ6wKT0NrNaAhw6TiuAhQearUXT9dl6UnCHPcPnA5YGQDmkDpAATlOl0eUMg0zAfveRpU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net; spf=pass smtp.mailfrom=queasysnail.net; dkim=pass (2048-bit key) header.d=queasysnail.net header.i=@queasysnail.net header.b=1Dmt4BIj; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=cVv9h4vv; arc=none smtp.client-ip=202.12.124.148 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=queasysnail.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=queasysnail.net header.i=@queasysnail.net header.b="1Dmt4BIj"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="cVv9h4vv" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id CEA361D000DE; Mon, 20 Oct 2025 05:10:18 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Mon, 20 Oct 2025 05:10:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=queasysnail.net; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1760951418; x= 1761037818; bh=fbeI+mZpIV+oK437BE8tkb1TtWDzlBfuXU+n/16Vcw8=; b=1 Dmt4BIjeowEd30c95j7D2XXYJbr6I1OrWCw7E30gAsRJq6SfY5XrCAj449mMCDNq ov+UTEApwK9IWGZZR/2Zpy30T3Dp/g8kToGBdfYazmPqdBJ3nLXQBgrF4UMOq4bx iZqJhxWwkVIM2XoPz02vQWHZ+hZIVSs+9L1ypKSc9VSrVMuWUhqC40+p1vpmDGx8 T9W/J76OfiSCA5+tHFGPObkfjzLPe5tmNNQWCSY5ZtK+H/iQqi0bPxgNC/S3w57K /vyMGDyXzPfgfe03kPUxOFoFtd8AXIaS9DVFShYZGiD2O9W7G3/8aCV74NdWPzMl 76E8fRBr/3oQEme1hd6QQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1760951418; x=1761037818; bh=fbeI+mZpIV+oK437BE8tkb1TtWDzlBfuXU+ n/16Vcw8=; b=cVv9h4vvyf9vk8VRfpIdHGGcTyDsGcDIAMdpWZZRrwAUbYOLblT MUh6Sm5qnPY1scK9x3VR2vNXEbAKG+AdiVhUXRMjvaCTQOEMgZjlIpNPOb8Mc6Np U5o5rLNbu4NEYuXQ9yXoNtwhKW04vrKC8cLloe4PPjGnd36zpXr9PF1YLNw/RW2W YOp0Y2CbYhcE5tI/3OP8oo9930xiPvXidkq2P9HdN1KttjYzJn7DWrMDtOoDuXbU XSstEyymGO2MYiYu+1I3fzoSo9GzTinrWg0hicDzWtYA/Eq1ybOg52rD1Fr3j4jg kNdF+8a3x67TFvsF2KH+xMudx+BUAxQJpQw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddufeejgedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtjeenucfhrhhomhepufgrsghrihhn rgcuffhusghrohgtrgcuoehsugesqhhuvggrshihshhnrghilhdrnhgvtheqnecuggftrf grthhtvghrnhepuefhhfffgfffhfefueeiudegtdefhfekgeetheegheeifffguedvueff fefgudffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epshgusehquhgvrghshihsnhgrihhlrdhnvghtpdhnsggprhgtphhtthhopedujedpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheplhhiuhhhrghnghgsihhnsehgmhgrihhlrd gtohhmpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhr tghpthhtohepjhhvsehjvhhoshgsuhhrghhhrdhnvghtpdhrtghpthhtoheprghnughrvg ifodhnvghtuggvvheslhhunhhnrdgthhdprhgtphhtthhopegurghvvghmsegurghvvghm lhhofhhtrdhnvghtpdhrtghpthhtohepvgguuhhmrgiivghtsehgohhoghhlvgdrtghomh dprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepphgrsggv nhhisehrvgguhhgrthdrtghomhdprhgtphhtthhopehjihhrihesrhgvshhnuhhllhhird hush X-ME-Proxy: Feedback-ID: i934648bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Oct 2025 05:10:16 -0400 (EDT) Date: Mon, 20 Oct 2025 11:10:14 +0200 From: Sabrina Dubroca To: Hangbin Liu Cc: netdev@vger.kernel.org, Jay Vosburgh , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jiri Pirko , Simon Horman , Ido Schimmel , Shuah Khan , Stanislav Fomichev , Stanislav Fomichev , Kuniyuki Iwashima , Alexander Lobakin , bridge@lists.linux.dev Subject: Re: [PATCHv6 net-next 1/4] net: add a common function to compute features for upper devices Message-ID: References: <20251017034155.61990-1-liuhangbin@gmail.com> <20251017034155.61990-2-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20251017034155.61990-2-liuhangbin@gmail.com> 2025-10-17, 03:41:52 +0000, Hangbin Liu wrote: > Some high level software drivers need to compute features from lower > devices. But each has their own implementations and may lost some > feature compute. Let's use one common function to compute features > for kinds of these devices. > > The new helper uses the current bond implementation as the reference > one, as the latter already handles all the relevant aspects: netdev > features, TSO limits and dst retention. > > Suggested-by: Paolo Abeni > Signed-off-by: Hangbin Liu No objection to this patch/series, just a nit and some discussion below, so: Reviewed-by: Sabrina Dubroca [...] > +/** > + * netdev_compute_master_upper_features - compute feature from lowers nit: I'm slightly annoyed (that's not quite the right word, sorry) that we're adding a new function to "compute features" that doesn't touch netdev->features, but I can't come up with a better name (the best I got was "compute extra features" and it doesn't help). > + * @dev: the upper device > + * @update_header: whether to update upper device's header_len/headroom/tailroom > + * > + * Recompute the upper device's feature based on all lower devices. > + */ > +void netdev_compute_master_upper_features(struct net_device *dev, bool update_header) > +{ [...] > + netif_set_tso_max_segs(dev, tso_max_segs); > + netif_set_tso_max_size(dev, tso_max_size); > + > + netdev_change_features(dev); Maybe a dumb idea: I'm wondering if we're doing this from the wrong side. Right now we have: [some device op] -> [this new function] -> netdev_change_features -> __netdev_update_features -> ndo_fix_features Would it make more sense to go instead: [some device op] -> netdev_change_features -> __netdev_update_features -> ndo_fix_features -> [this new function] ? Possible benefit: not forgetting to fix up the "extra" features in some cases? (ie calling netdev_change_features when we should have called netdev_compute_master_upper_features) > +} -- Sabrina