From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9989A606A33B for ; Thu, 3 Dec 2026 08:02:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=U9MJwj8E; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fb9d6EPC Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7165386255; Thu, 3 Dec 2026 08:02:03 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id eN1FyOsj2gxr; Thu, 3 Dec 2026 08:02:02 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp1.osuosl.org A7DCD86249 Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796284922; b=ciK95MRy12qszEWA0zXKueKIZ4wGvc2dI2/fByNoPgdU8YzdmrBi9lY3vLhMuIlUiEUL AN1zm2lql1fNaKBoOhf5TLY9U3B7TrIIX+DfBSXWQNH9ZL7Tu7OHsDhXUs1Nc3axEL24R qUQZGSiGxtTMJ9kfZYu+yPeFp6K036kP5V8w82YsOuLQ7ouk1u/FHe4aWbPt8Lgkcnyax 3UfXXCkDFkUmhdD/Dentnvgi+PKCyxM2POLfWq9/qiYKO9QyW1MKPP2TD8v8KIWeTD+9D sWDJp/blyRU9RjdhU2ua82ZNxkUV65eY1UAjeUklWFj7sdGy/SGIRieo1HI2d0+79yA== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796284922; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version:X-BeenThere:X-Mailman-Version: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Errors-To; bh=uKLjXxGG5z8zM0Nk4vXsc1p9z+Ka//cmQJQ4A0UrP0s=; b=f2x4TZfMEG88Yklh7FuiMTNnxpftJZKEsc1QCfIqnGwAy7fCDAbZHXMyQw+0GXxQnGmp X2z82VmIq2w0EwXtVhvzd8nlXXjl6I0sEvav16LnHt7OruDyrbw+UCthjosLi751W+RVi OxWFk5c1V2CYfMcecpW3njx5r/eE1Ak2WgFfJ/SM/YMH1/6oXkWhSUwaDsZVy6gORk3Lk dSyS15TJVGOLsqveIZ4UDey/Uh2/a1Peq51HkiNnpJnDZcfDTAMxkYMZ1ARwJzJZnZxjv epieO8vXB+wb1MHBHAJUBl4XBpW3EEzoMvImNMes+B18A4tHVP3S4iWgZCA1wc/bLgA== ARC-Authentication-Results: i=1; smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1796284922; bh=uKLjXxGG5z8zM0Nk4vXsc1p9z+Ka//cmQJQ4A0UrP0s=; h=Subject:From:To:Cc:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=U9MJwj8EOz5wBDm8wag4C9/1k7XrRBMygexZg9xj3adYdKqb0k7llq2D80tvE9U63 jpWjy3hFXtz3HuYIrj6r6gm/NVLAT827JdJdAW9F0zFa49ga9oLNiuXTME457taEhf W8p1lV3ITwmfi8LxMF/8Ofm7aVCqe8r00HZ6n3H6d6hWAD5OMhmbxPXrnBV9mAERiW viergE2UA2fAx4evri4nf0UfeeURGGt6844PBsaIP8Bl71sAqLV3WOir0UgJA4xi8s cOI8vX6u87Eg2Qqhb67aT4becxfV7QsnOOtG4j0XExFeGmrRn1+52rw9SbZxnhmJbQ fbV7ZTgFghs5Q== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id A7DCD86249; Thu, 3 Dec 2026 08:02:02 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists1.osuosl.org (Postfix) with ESMTP id CC3363DB for ; Thu, 3 Dec 2026 08:02:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B248B400FD for ; Thu, 3 Dec 2026 08:02:00 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id D0wRD8MzBFum for ; Thu, 3 Dec 2026 08:01:59 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp2.osuosl.org 921CE400CB Authentication-Results: smtp2.osuosl.org; arc=none smtp.remote-ip="2600:3c04:e001:324:0:1991:8:25" Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org; envelope-from=netdev-bot+sashiko@kernel.org; receiver= Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fb9d6EPC Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) by smtp2.osuosl.org (Postfix) with ESMTPS id 921CE400CB for ; Thu, 3 Dec 2026 08:01:59 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 9893B61D33; Thu, 3 Dec 2026 08:01:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FE0A1F000C1; Thu, 3 Dec 2026 08:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796284917; bh=uKLjXxGG5z8zM0Nk4vXsc1p9z+Ka//cmQJQ4A0UrP0s=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=fb9d6EPCGdzVY3PgfByfDMKx+xEDJPalYnMZdq1RU9NULCKWOPJhcnSa3rXU+XGiQ g3a3YmRnfe3PT785lWBLCvRysQbh2RxGyU8acA+XGcbNAYqLhBqzFnt0VrfjnUwWSR oY00b0D9U+isuDbAy3XUpO4ynBQyU5HOZfCKo9OJZ34MMUmg7u6cMQX5iS65M40xlx bzrYYyCHuE91oV+v3HL0WBeE0xcY34PWgG6ZYZ9AKoo3yl+y6Tifo3zissowGXsKFn 8HGJs4ImQs7GjKxY6hO0GVzI1/CznEb0jBEyqMNu0/5FfhCFmX++09FkGcKVz0Ck7u wRBPYWKfZSoNg== Subject: Re: [PATCH net v7 2/4] ice: do not leave switchdev mode while subfunction ports exist From: netdev-bot+sashiko@kernel.org To: poros@redhat.com Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, aleksandr.loktionov@intel.com, horms@kernel.org, michal.swiatkowski@linux.intel.com, grzegorz.nitka@intel.com, pmenzel@molgen.mpg.de, wojciech.drewek@intel.com, marcin.szycik@linux.intel.com, martyna.szapar-mudlaw@linux.intel.com, ivecera@redhat.com, alice.michael@intel.com, jacob.e.keller@intel.com, jbrandeb@kernel.org, patryk.holda@intel.com, sx.rinitha@intel.com, aaron.ma@canonical.com, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Date: Thu, 03 Dec 2026 08:01:55 +0000 Message-ID: <179628491563.3146.9047666199900210939@kernel.org> In-Reply-To: <20261202071642.2527605-3-poros@redhat.com> References: <20261202071642.2527605-3-poros@redhat.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Archived-By: MIME-Version: 1.0 X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] When SF ports still exist, the new refusal in ice_eswitch_mode_set() (drivers/net/ethernet/intel/ice/ice_eswitch.c)… -- ice: do not leave switchdev mode while subfunction ports exist This patch makes ice_eswitch_mode_set() refuse a switch to legacy mode while subfunction ports exist, by checking pf->dyn_ports. Without the check, devlink core can let the change through when DCB is active and no rate nodes are exported. The representor xarray is then destroyed under a running switchdev session, which later leads to a use after free in devlink_nl_port_fill(). > diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c b/drivers/net/ethernet/intel/ice/ice_eswitch.c > index 6e7bba4738989..44ef1fcfc6e4a 100644 > --- a/drivers/net/ethernet/intel/ice/ice_eswitch.c > +++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c > @@ -356,6 +356,13 @@ ice_eswitch_mode_set(struct devlink *devlink, u16 mode, > > switch (mode) { > case DEVLINK_ESWITCH_MODE_LEGACY: > + /* subfunction ports have representors too */ > + if (!xa_empty(&pf->dyn_ports)) { > + NL_SET_ERR_MSG_MOD(extack, > + "Remove all subfunction ports before changing eswitch mode"); > + return -EOPNOTSUPP; ^^^^^^^^^^^ [Severity: Low] Should this be -EBUSY rather than -EOPNOTSUPP? The condition is temporary and goes away once the SF ports are deleted. The same user sequence (eswitch switchdev, port add pcisf, eswitch legacy) can also be refused one level up, in devlink_nl_eswitch_set_doit() in net/devlink/dev.c. That check runs before the driver callback: err = devlink_rates_check(devlink, devlink_rate_is_node, info->extack); if (err) return err; mode = nla_get_u16(info->attrs[DEVLINK_ATTR_ESWITCH_MODE]); err = ops->eswitch_mode_set(devlink, mode, info->extack); When rate nodes exist, devlink_rates_check() returns -EBUSY with "Rate node(s) exists.". ice only exports rate nodes when DCB and ADQ are off, because ice_repr_set_tx_topology() returns early if ice_is_dcb_active(pf). As a result, user space gets -EBUSY from devlink core with DCB off, and -EOPNOTSUPP from the driver with DCB on, for the same operation. -EOPNOTSUPP usually means the operation is not supported, not that it is blocked until other objects are removed. Could tools that branch on the errno treat a retryable condition as a missing feature? The existing ice_has_vfs() check just above in the same function also returns -EOPNOTSUPP for a similar temporary condition. So the patch follows local driver style, and that mismatch with devlink core already existed. > + } > + > dev_info(ice_pf_to_dev(pf), "PF %d changed eswitch mode to legacy", > pf->hw.pf_id); > xa_destroy(&pf->eswitch.reprs); -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202071642.2527605-1-poros%40redhat.com