Message ID | 20221129000550.3833570-1-mailhol.vincent@wanadoo.fr |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp22202wrr; Mon, 28 Nov 2022 16:11:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf4nn9azn1sqIGQve0FpsVA3djCTPEr8zqS1G5RqcUL1/foLrNEnGje3xHrUQJrRQAjx5mh/ X-Received: by 2002:aa7:9ec2:0:b0:574:8995:eb7f with SMTP id r2-20020aa79ec2000000b005748995eb7fmr23926417pfq.85.1669680709474; Mon, 28 Nov 2022 16:11:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669680709; cv=none; d=google.com; s=arc-20160816; b=oklXV1o4qFNVc/038ET9b0jtZsKw+e/0/o21UcLu9r22xSlSvjDUjims6QKPePHV1c hjcx0OB1LKN+UdtDRUwGcQM9HTuJv4IcLP5lpvqH7ItYehdheEl61DQSQOaD5ORuXKOj +KxKz57OX1EFrSeoBOIXK/HNZAWuZVqv/prAVxz/ILreSoTQn6emeUahfDQVuBxyrZ3b 8347TkvIdA9TKDhQ7vObW4D9/sHm5fMKOflIPsdzpG++xzwJgGC8fnJQCsQmZx9XEBqP u4BKffnoxeI4ALwwPI5eOlfJL8r69UBl9SgmrCvjlkfNdU5TJjHZUQuL1jGhlc7juhXT AVsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=OzEu0mNuawYU4A8ixhfSekIPSykA7cQRGHNQPCvkxKI=; b=A4OkeAs3cGvQJE/Dy/6Cua5a+Z+I+QyO7WNG5GcoxtKEnQt2A4TTqV5rm33NSDP/jU RnR7KvySRba0WYQl61DkzO+vHo8PhiKjqePkK6XVtRjnRBoItHduHLYFOOQvUGRPclZ7 TeEtsHTOPg9dHlt7qH36qvx4KHt/JkWCFdcDStNl4bpHI1Zx4qVxhVnt8P6dwja/q2wh QSL5T8fQzWNM1HqistMTwOPKlN/gUFhTmb5bCcjFRVyVMDoZrUOZwyatcB/uGBQNIIdY jKD2lBk2ddXjxXnbmn5HHM4aktbJdbFameUViFowpPvwyDUvzDmE+l58q/cBhF1rGYL/ dPgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c29fOTJk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t15-20020a63444f000000b0046e9da9ac40si12768633pgk.556.2022.11.28.16.11.33; Mon, 28 Nov 2022 16:11:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c29fOTJk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234860AbiK2AGJ (ORCPT <rfc822;gah0developer@gmail.com> + 99 others); Mon, 28 Nov 2022 19:06:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234518AbiK2AGH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 28 Nov 2022 19:06:07 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88D5E1E3C1; Mon, 28 Nov 2022 16:06:03 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id l22-20020a17090a3f1600b00212fbbcfb78so15673272pjc.3; Mon, 28 Nov 2022 16:06:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=OzEu0mNuawYU4A8ixhfSekIPSykA7cQRGHNQPCvkxKI=; b=c29fOTJkGhrSOl14tX8ALzL7Z8JRbAKENjvd46LnS0GWYkCtROYEQPHeBQmx9KXnA+ 8171rCzdumIi9h1Vb4X0SOxj2L5/Z4ZXw8GKF+twWDpryQu+3JfZDmSHCoSchfko62ij aO4n9mj/JgBDdgzHvTxNopuX3f+tK2dFxRSObYj2PB2SQU/S4vkEwXQj0yJX7cw56tfS JGOaaS48ijJ5gqg7+h2uXsNcPPdOtUOzxVEf6hUrk65gCrXNNqGFO0iSMblLpWywGo6U mw0CwvdFdK69r+MbWD9OGDZldzntUIpPUUQYsyWQW8HjdKSoVwepJHyIvcNHdGwmsqzm OQCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OzEu0mNuawYU4A8ixhfSekIPSykA7cQRGHNQPCvkxKI=; b=FkbUZlYh4ncgHNXwVCTa5Fxs/W+2zqqr7yMCvZt4OkfVASRTaREJwm9haMQxsV3ufS hiVIPKV5+GDw2czD5gdx0KULQxzw48oeQZeWCQqnHQ+bnWbfnPXfWbc1+65ZIAvus0Ou w23iah77LHoyp7QWlNe0ZDZNAU9OmSb9/wDaNAdzaTdQWlgF63O5vY/f9FZBr/9+TP+I erqd0fWrBj4FXxjTEXYjUF9eZXkY3j51ouXKTXBQht8umNE6j2EKDBo7GBIzm93bBEL4 qRVZEfINOcB28PdwX1qcyEItjI4KvY5y7qpXfPQQ1gmdBzKrg6jwLXL4S1iC7/zEI5zg vmPw== X-Gm-Message-State: ANoB5pn217C10/RmpgMIz68tzjnYp3jbKOJppJ3C3bEUGkCgJ094gyqZ qWiOG5ij5Ses2W77LRJssgM= X-Received: by 2002:a17:90b:48c8:b0:20b:16bc:8493 with SMTP id li8-20020a17090b48c800b0020b16bc8493mr57596434pjb.210.1669680362942; Mon, 28 Nov 2022 16:06:02 -0800 (PST) Received: from XH22050090-L.ad.ts.tri-ad.global ([103.175.111.222]) by smtp.gmail.com with ESMTPSA id r2-20020aa79ec2000000b00572198393c2sm8588147pfq.194.2022.11.28.16.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 16:06:02 -0800 (PST) Sender: Vincent Mailhol <vincent.mailhol@gmail.com> From: Vincent Mailhol <mailhol.vincent@wanadoo.fr> To: Jiri Pirko <jiri@nvidia.com>, netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org> Cc: "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Paolo Abeni <pabeni@redhat.com>, linux-kernel@vger.kernel.org, Boris Brezillon <bbrezillon@kernel.org>, Arnaud Ebalard <arno@natisbad.org>, Srujana Challa <schalla@marvell.com>, Kurt Kanzenbach <kurt@linutronix.de>, Andrew Lunn <andrew@lunn.ch>, Florian Fainelli <f.fainelli@gmail.com>, Vladimir Oltean <olteanv@gmail.com>, Michael Chan <michael.chan@broadcom.com>, Ioana Ciornei <ioana.ciornei@nxp.com>, Dimitris Michailidis <dmichail@fungible.com>, Yisen Zhuang <yisen.zhuang@huawei.com>, Salil Mehta <salil.mehta@huawei.com>, Jesse Brandeburg <jesse.brandeburg@intel.com>, Tony Nguyen <anthony.l.nguyen@intel.com>, Sunil Goutham <sgoutham@marvell.com>, Linu Cherian <lcherian@marvell.com>, Geetha sowjanya <gakula@marvell.com>, Jerin Jacob <jerinj@marvell.com>, hariprasad <hkelam@marvell.com>, Subbaraya Sundeep <sbhatta@marvell.com>, Taras Chornyi <tchornyi@marvell.com>, Saeed Mahameed <saeedm@nvidia.com>, Leon Romanovsky <leon@kernel.org>, Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>, Simon Horman <simon.horman@corigine.com>, Shannon Nelson <snelson@pensando.io>, drivers@pensando.io, Ariel Elior <aelior@marvell.com>, Manish Chopra <manishc@marvell.com>, Jonathan Lemon <jonathan.lemon@gmail.com>, Vadim Fedorenko <vadfed@fb.com>, Richard Cochran <richardcochran@gmail.com>, Vadim Pasternak <vadimp@mellanox.com>, Shalom Toledo <shalomt@mellanox.com>, linux-crypto@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, oss-drivers@corigine.com, Jiri Pirko <jiri@mellanox.com>, Herbert Xu <herbert@gondor.apana.org.au>, Hao Chen <chenhao288@hisilicon.com>, Guangbin Huang <huangguangbin2@huawei.com>, Minghao Chi <chi.minghao@zte.com.cn>, Shijith Thotton <sthotton@marvell.com>, Vincent Mailhol <mailhol.vincent@wanadoo.fr> Subject: [PATCH net-next v5 0/4] net: devlink: return the driver name in devlink_nl_info_fill Date: Tue, 29 Nov 2022 09:05:46 +0900 Message-Id: <20221129000550.3833570-1-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750787119518765003?= X-GMAIL-MSGID: =?utf-8?q?1750787119518765003?= |
Series |
net: devlink: return the driver name in devlink_nl_info_fill
|
|
Message
Vincent Mailhol
Nov. 29, 2022, 12:05 a.m. UTC
The driver name is available in device_driver::name. Right now, drivers still have to report this piece of information themselves in their devlink_ops::info_get callback function. The goal of this series is to have the devlink core to report this information instead of the drivers. The first patch fulfills the actual goal of this series: modify devlink core to report the driver name and clean-up all drivers. Both have to be done in an atomic change to avoid attribute duplication. The second patch removes the devlink_info_driver_name_put() function to prevent future drivers from reporting the driver name themselves. The third patch allows the core to call devlink_nl_info_fill() even if the devlink_ops::info_get() callback is NULL. This leads to the fourth and final patch which cleans up the drivers which have an empty info_get(). --- * Changelog * v4 -> v5 * [PATCH 1/4] add Tested-by: Ido Schimmel tag. * split patch 3/3 in two patches. v3 -> v4 * Ido pointed out that the mlxsw did not need to be fixed: https://lore.kernel.org/netdev/Y4ONgD4dAj8yU2%2F+@shredder/ Remove the first two patches from the series. v2 -> v3 * [PATCH 3/5] remove the call to devlink_info_driver_name_put() in mlxsw driver as well (this was missing in v2, making the build fail... sorry for the noise). * add additional people in CC as pointed by netdev patchwork CI: https://patchwork.kernel.org/project/netdevbpf/list/?series=699451 * use the "Link:" prefix before URL to silence checkpatch's line length warning. RFC v1 -> v2 * drop the RFC tag * big rework following the discussion on RFC: https://lore.kernel.org/netdev/20221122154934.13937-1-mailhol.vincent@wanadoo.fr/ Went from one patch to a series of five patches: * drop the idea to report the USB serial number following Greg's comment: https://lore.kernel.org/linux-usb/Y3+VfNdt%2FK7UtRcw@kroah.com/ Vincent Mailhol (4): net: devlink: let the core report the driver name instead of the drivers net: devlink: remove devlink_info_driver_name_put() net: devlink: make the devlink_ops::info_get() callback optional net: devlink: clean-up empty devlink_ops::info_get() .../marvell/octeontx2/otx2_cpt_devlink.c | 4 --- drivers/net/dsa/hirschmann/hellcreek.c | 5 --- drivers/net/dsa/mv88e6xxx/devlink.c | 5 --- drivers/net/dsa/sja1105/sja1105_devlink.c | 12 ++----- .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 4 --- .../freescale/dpaa2/dpaa2-eth-devlink.c | 11 +----- .../ethernet/fungible/funeth/funeth_devlink.c | 7 ---- .../hisilicon/hns3/hns3pf/hclge_devlink.c | 5 --- .../hisilicon/hns3/hns3vf/hclgevf_devlink.c | 5 --- drivers/net/ethernet/intel/ice/ice_devlink.c | 6 ---- .../marvell/octeontx2/af/rvu_devlink.c | 7 ---- .../marvell/octeontx2/nic/otx2_devlink.c | 15 -------- .../marvell/prestera/prestera_devlink.c | 5 --- .../net/ethernet/mellanox/mlx5/core/devlink.c | 4 --- drivers/net/ethernet/mellanox/mlxsw/core.c | 5 --- .../net/ethernet/netronome/nfp/nfp_devlink.c | 4 --- .../ethernet/pensando/ionic/ionic_devlink.c | 4 --- drivers/net/ethernet/qlogic/qed/qed_devlink.c | 4 --- drivers/net/netdevsim/dev.c | 3 -- drivers/ptp/ptp_ocp.c | 4 --- include/net/devlink.h | 2 -- net/core/devlink.c | 35 ++++++++++++------- 22 files changed, 26 insertions(+), 130 deletions(-)
Comments
> -----Original Message----- > From: Vincent Mailhol <vincent.mailhol@gmail.com> On Behalf Of Vincent > Mailhol > Sent: Monday, November 28, 2022 4:06 PM > To: Jiri Pirko <jiri@nvidia.com>; netdev@vger.kernel.org; Jakub Kicinski > <kuba@kernel.org> > Cc: David S . Miller <davem@davemloft.net>; Eric Dumazet > <edumazet@google.com>; Paolo Abeni <pabeni@redhat.com>; linux- > kernel@vger.kernel.org; Boris Brezillon <bbrezillon@kernel.org>; Arnaud Ebalard > <arno@natisbad.org>; Srujana Challa <schalla@marvell.com>; Kurt Kanzenbach > <kurt@linutronix.de>; Andrew Lunn <andrew@lunn.ch>; Florian Fainelli > <f.fainelli@gmail.com>; Vladimir Oltean <olteanv@gmail.com>; Michael Chan > <michael.chan@broadcom.com>; Ioana Ciornei <ioana.ciornei@nxp.com>; > Dimitris Michailidis <dmichail@fungible.com>; Yisen Zhuang > <yisen.zhuang@huawei.com>; Salil Mehta <salil.mehta@huawei.com>; > Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen, Anthony L > <anthony.l.nguyen@intel.com>; Sunil Goutham <sgoutham@marvell.com>; Linu > Cherian <lcherian@marvell.com>; Geetha sowjanya <gakula@marvell.com>; > Jerin Jacob <jerinj@marvell.com>; hariprasad <hkelam@marvell.com>; > Subbaraya Sundeep <sbhatta@marvell.com>; Taras Chornyi > <tchornyi@marvell.com>; Saeed Mahameed <saeedm@nvidia.com>; Leon > Romanovsky <leon@kernel.org>; Ido Schimmel <idosch@nvidia.com>; Petr > Machata <petrm@nvidia.com>; Simon Horman <simon.horman@corigine.com>; > Shannon Nelson <snelson@pensando.io>; drivers@pensando.io; Ariel Elior > <aelior@marvell.com>; Manish Chopra <manishc@marvell.com>; Jonathan > Lemon <jonathan.lemon@gmail.com>; Vadim Fedorenko <vadfed@fb.com>; > Richard Cochran <richardcochran@gmail.com>; Vadim Pasternak > <vadimp@mellanox.com>; Shalom Toledo <shalomt@mellanox.com>; linux- > crypto@vger.kernel.org; intel-wired-lan@lists.osuosl.org; linux- > rdma@vger.kernel.org; oss-drivers@corigine.com; Jiri Pirko > <jiri@mellanox.com>; Herbert Xu <herbert@gondor.apana.org.au>; Hao Chen > <chenhao288@hisilicon.com>; Guangbin Huang > <huangguangbin2@huawei.com>; Minghao Chi <chi.minghao@zte.com.cn>; > Shijith Thotton <sthotton@marvell.com>; Vincent Mailhol > <mailhol.vincent@wanadoo.fr> > Subject: [PATCH net-next v5 0/4] net: devlink: return the driver name in > devlink_nl_info_fill > > The driver name is available in device_driver::name. Right now, > drivers still have to report this piece of information themselves in > their devlink_ops::info_get callback function. > > The goal of this series is to have the devlink core to report this > information instead of the drivers. > > The first patch fulfills the actual goal of this series: modify > devlink core to report the driver name and clean-up all drivers. Both > have to be done in an atomic change to avoid attribute duplication. > > The second patch removes the devlink_info_driver_name_put() function > to prevent future drivers from reporting the driver name themselves. > > The third patch allows the core to call devlink_nl_info_fill() even if > the devlink_ops::info_get() callback is NULL. This leads to the fourth > and final patch which cleans up the drivers which have an empty > info_get(). > --- Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> I'm fine with keeping it 4 patches as-is. Thanks! > * Changelog * > > v4 -> v5 > > * [PATCH 1/4] add Tested-by: Ido Schimmel tag. > > * split patch 3/3 in two patches. > > v3 -> v4 > > * Ido pointed out that the mlxsw did not need to be fixed: > https://lore.kernel.org/netdev/Y4ONgD4dAj8yU2%2F+@shredder/ > Remove the first two patches from the series. > > v2 -> v3 > > * [PATCH 3/5] remove the call to devlink_info_driver_name_put() in > mlxsw driver as well (this was missing in v2, making the build > fail... sorry for the noise). > > * add additional people in CC as pointed by netdev patchwork CI: > https://patchwork.kernel.org/project/netdevbpf/list/?series=699451 > > * use the "Link:" prefix before URL to silence checkpatch's line > length warning. > > > RFC v1 -> v2 > > * drop the RFC tag > > * big rework following the discussion on RFC: > https://lore.kernel.org/netdev/20221122154934.13937-1- > mailhol.vincent@wanadoo.fr/ > Went from one patch to a series of five patches: > > * drop the idea to report the USB serial number following Greg's > comment: > https://lore.kernel.org/linux-usb/Y3+VfNdt%2FK7UtRcw@kroah.com/ > > Vincent Mailhol (4): > net: devlink: let the core report the driver name instead of the > drivers > net: devlink: remove devlink_info_driver_name_put() > net: devlink: make the devlink_ops::info_get() callback optional > net: devlink: clean-up empty devlink_ops::info_get() > > .../marvell/octeontx2/otx2_cpt_devlink.c | 4 --- > drivers/net/dsa/hirschmann/hellcreek.c | 5 --- > drivers/net/dsa/mv88e6xxx/devlink.c | 5 --- > drivers/net/dsa/sja1105/sja1105_devlink.c | 12 ++----- > .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 4 --- > .../freescale/dpaa2/dpaa2-eth-devlink.c | 11 +----- > .../ethernet/fungible/funeth/funeth_devlink.c | 7 ---- > .../hisilicon/hns3/hns3pf/hclge_devlink.c | 5 --- > .../hisilicon/hns3/hns3vf/hclgevf_devlink.c | 5 --- > drivers/net/ethernet/intel/ice/ice_devlink.c | 6 ---- > .../marvell/octeontx2/af/rvu_devlink.c | 7 ---- > .../marvell/octeontx2/nic/otx2_devlink.c | 15 -------- > .../marvell/prestera/prestera_devlink.c | 5 --- > .../net/ethernet/mellanox/mlx5/core/devlink.c | 4 --- > drivers/net/ethernet/mellanox/mlxsw/core.c | 5 --- > .../net/ethernet/netronome/nfp/nfp_devlink.c | 4 --- > .../ethernet/pensando/ionic/ionic_devlink.c | 4 --- > drivers/net/ethernet/qlogic/qed/qed_devlink.c | 4 --- > drivers/net/netdevsim/dev.c | 3 -- > drivers/ptp/ptp_ocp.c | 4 --- > include/net/devlink.h | 2 -- > net/core/devlink.c | 35 ++++++++++++------- > 22 files changed, 26 insertions(+), 130 deletions(-) > > -- > 2.25.1