From nobody Sat Dec 27 22:52:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC19EC4332F for ; Thu, 14 Dec 2023 14:21:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573452AbjLNOVt (ORCPT ); Thu, 14 Dec 2023 09:21:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573436AbjLNOVr (ORCPT ); Thu, 14 Dec 2023 09:21:47 -0500 Received: from mail.helmholz.de (mail.helmholz.de [217.6.86.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B30FA7 for ; Thu, 14 Dec 2023 06:21:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=helmholz.de ; s=dkim1; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=rJ8VRaMAxL68T8ALEXTDFcln4Zy6so/BUy85gHqlTTU=; b=HmUI4eT7cumr78ie4CcBkziCfB 1NC5k5rikvJN+4ltnt4vI/iOMiZ54ABVi8YNz1tnCA1hgz8JtxOiZ0Tt20f/mWn650OW9+lIwhBJ6 h8kkGLvug/kqAUZCwpkXIhKjEDTMNIcjWXm5XZBn+dzuE3B/ripTQeXOclv88bUaZ6fkBuThTvIT5 refexY2quviTOh1wBUjhGxwsUPe8oNEfIXUGF6Ehzowx6rLg/PsvZu023QVznGvJpTQgyEd6X+GHU MRdY03cBeCvwCGo597+ILcCpWFNppHU1FCgbCPNP5UmAEDWF3jBb8DcJYy4XdWsw3XfBz8TWdbIkJ jsgjj1gA==; Received: from [192.168.1.4] (port=32350 helo=SH-EX2013.helmholz.local) by mail.helmholz.de with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (Exim 4.96) (envelope-from ) id 1rDmas-0006db-0t; Thu, 14 Dec 2023 15:21:42 +0100 Received: from linuxdev.helmholz.local (192.168.6.7) by SH-EX2013.helmholz.local (192.168.1.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 14 Dec 2023 15:21:41 +0100 From: Ante Knezic To: CC: , , , , , , , , Ante Knezic Subject: [PATCH net-next] net: dsa: dont use generic selftest strings for custom selftests Date: Thu, 14 Dec 2023 15:21:36 +0100 Message-ID: <20231214142136.17564-1-ante.knezic@helmholz.de> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-Originating-IP: [192.168.6.7] X-ClientProxiedBy: SH-EX2013.helmholz.local (192.168.1.4) To SH-EX2013.helmholz.local (192.168.1.4) X-EXCLAIMER-MD-CONFIG: 2ae5875c-d7e5-4d7e-baa3-654d37918933 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" if dsa device supports custom selftests than we should use custom selftest strings for ethtool. Signed-off-by: Ante Knezic --- net/dsa/user.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/net/dsa/user.c b/net/dsa/user.c index d438884a4eb0..d0e0d1a2bff7 100644 --- a/net/dsa/user.c +++ b/net/dsa/user.c @@ -1072,7 +1072,11 @@ static void dsa_user_get_strings(struct net_device *= dev, ds->ops->get_strings(ds, dp->index, stringset, data + 4 * len); } else if (stringset =3D=3D ETH_SS_TEST) { - net_selftest_get_strings(data); + if (ds->ops->self_test && ds->ops->get_strings) + ds->ops->get_strings(ds, dp->index, stringset, + data); + else + net_selftest_get_strings(data); } =20 } @@ -1123,7 +1127,10 @@ static int dsa_user_get_sset_count(struct net_device= *dev, int sset) =20 return count + 4; } else if (sset =3D=3D ETH_SS_TEST) { - return net_selftest_get_count(); + if (ds->ops->self_test && ds->ops->get_sset_count) + return ds->ops->get_sset_count(ds, dp->index, sset); + else + return net_selftest_get_count(); } =20 return -EOPNOTSUPP; --=20 2.11.0