Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp533790rwb; Tue, 29 Nov 2022 01:54:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf5kFShNxSVCdgmetvtoVSaqwEcVCpdqP0xF+WoZ+QL2bUQASOgZ+qdunUgyLw3ZQqDcAUTs X-Received: by 2002:a05:6402:3642:b0:459:53dc:adc9 with SMTP id em2-20020a056402364200b0045953dcadc9mr44033320edb.166.1669715647919; Tue, 29 Nov 2022 01:54:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669715647; cv=none; d=google.com; s=arc-20160816; b=L+FqPgdgnwLfT9iu6JaOh7HtKmyx6eJ+bJR2g2m9xpL4OGWurVEX/x/uwiEeiklv0E MxKM9qP8gXZJ3rtlJOXMaO1lpQ/ObPFxtVDjNz8SN94i5VenX7oDQvJ7CMzGev2OBoPz Yr87P9HUlLF/oYb3aKMs4WLSR3wjZa4SeplTx+FsGK22CyAJwsN+R2DFc+druiWrQV+r NwHTyi6GQ8+wqgCMnhft7D4slAzIAf1/ippi+LbaUce4msCeQmgytSER+EMfad5d+/iK NyNzWeECDTt4mLMxczvfB1gqcQ9GAf5DS4a5CMYiY0hHzoub35BEdcn7AHu3fqEpPYyp Qiww== 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=DoHQzm8iYHF80spHwuizizw7dl9whlXqQdx1rDh9IHE=; b=ZHZM9KEAzHjyd2CvZ2y6K6rw2227VTShq7ZhRYAWjHKIDgyVe9bWcD6rvztTmksjZ2 YxWdCWR5hAT1vRrVcDNkM+tZK8yvXolyAOCQKP070iwzpAQX62fMv4BVr6NL8uts6jRr pswbU8ZkoK82LaZ9+PTWNh5erHkuKFK40CS5+rriKE3HVqrzoCoqS5IMSggPfF2YsrUJ 3oHyzpd6Q4uvhyPp8LEaSLryBu2dp56p6BceFU4sNrBaLq33jQ4NI4pFhM90kJnvYv35 3v1nJjWlmy9+at5eRov/mqdsKeZ4+n8hQZ2g3pcwq3hPlJjgaNLzGtTdFRiDvfW31IFZ c0Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bejrZVaK; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt32-20020a1709072da000b007bd8ac3aebbsi9853152ejc.812.2022.11.29.01.53.41; Tue, 29 Nov 2022 01:54:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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=bejrZVaK; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbiK2Jw3 (ORCPT + 99 others); Tue, 29 Nov 2022 04:52:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbiK2Jw1 (ORCPT ); Tue, 29 Nov 2022 04:52:27 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7C333E096; Tue, 29 Nov 2022 01:52:25 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id ns17so5334093pjb.1; Tue, 29 Nov 2022 01:52:25 -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=DoHQzm8iYHF80spHwuizizw7dl9whlXqQdx1rDh9IHE=; b=bejrZVaKDSalOuYZ2B4bydrehFoiPv/luw7eftEZ+420oFiz0yNbZcsJH8YBOGTZXg ilG/oS/g5sxPYVPM66IwLJCszDO5hSQ2qmfZ2Y9C4JMNz1lesIZmB+AqeBRAOjz2qVR8 GALd0VrCWA3+gVysZ39W69HIeyJn/a0BB7c+L5aKweukPU4JFJtJ2mPw3l+g37QAXQ2n gVbMCJUdxXADPF+br8E1KmW/piaBj36Foy3ymKF5n8lpic5jofeUkMRPy8D+RYzyPxrX 4rtvUENtwE49BpPwayakeJbKCxXYuifofz0eCmo4EIAOm0UgbmPTJayYwmslpQdoUugN QOCg== 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=DoHQzm8iYHF80spHwuizizw7dl9whlXqQdx1rDh9IHE=; b=LMI3A+zm28ZrhOcZmmzkfffjmolK9l3OEIqcQWxAa9aevhY/aJ+5f3T/lpKvVyj5Ob 25IJqlGinBpGkMcTpUGS3wwChzkVlEdkBvpjeRZWkrJYVylkefTbKrZo20DeePqRCWgG gJMlfTlbWBImRVHEtSMtw6LWs7tnJjoevkkmSfESfiexAPf6NN1pquVSSU+8LxiPefq0 CgH/gy22+EeRkUtKOqWOtVm7KwM3/aruD8UlAoh36sRfWHo9o6qwTQGJYyzg1LsQOV1t T6jOUzJoSKEJx2uyZHn3RLX/yMw39khcIFpGN4KaY+tIW3Vy8CA4I2qW1JRAoNPYOXRr SCBg== X-Gm-Message-State: ANoB5pm4WdfHDCn5aK09JnwUc5rt1Q9aOS4yjWlgzVGp2/WStad/ISpf HVh/LeZyJg0W2wY3ViGgmyQ= X-Received: by 2002:a17:90b:3944:b0:214:1df0:fe53 with SMTP id oe4-20020a17090b394400b002141df0fe53mr63738466pjb.214.1669715545345; Tue, 29 Nov 2022 01:52:25 -0800 (PST) Received: from XH22050090-L.ad.ts.tri-ad.global ([103.175.111.222]) by smtp.gmail.com with ESMTPSA id mv15-20020a17090b198f00b0021937b2118bsm941346pjb.54.2022.11.29.01.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 01:52:25 -0800 (PST) Sender: Vincent Mailhol From: Vincent Mailhol To: Jiri Pirko , netdev@vger.kernel.org, Jakub Kicinski Cc: "David S . Miller" , Eric Dumazet , Paolo Abeni , linux-kernel@vger.kernel.org, Boris Brezillon , Arnaud Ebalard , Srujana Challa , Kurt Kanzenbach , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Michael Chan , Ioana Ciornei , Dimitris Michailidis , Yisen Zhuang , Salil Mehta , Jesse Brandeburg , Tony Nguyen , Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , Taras Chornyi , Saeed Mahameed , Leon Romanovsky , Ido Schimmel , Petr Machata , Simon Horman , Shannon Nelson , drivers@pensando.io, Ariel Elior , Manish Chopra , Jonathan Lemon , Vadim Fedorenko , Richard Cochran , Vadim Pasternak , Shalom Toledo , linux-crypto@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, oss-drivers@corigine.com, Jiri Pirko , Herbert Xu , Hao Chen , Guangbin Huang , Minghao Chi , Shijith Thotton , Vincent Mailhol Subject: [PATCH net-next v6 0/3] net: devlink: return the driver name in devlink_nl_info_fill Date: Tue, 29 Nov 2022 18:51:37 +0900 Message-Id: <20221129095140.3913303-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: X-Mailing-List: linux-crypto@vger.kernel.org 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. This same patch also removes the devlink_info_driver_name_put() function to prevent future drivers from reporting the driver name themselves. The second patch allows the core to call devlink_nl_info_fill() even if the devlink_ops::info_get() callback is NULL. This leads to the third and final patch which cleans up the drivers which have an empty info_get(). --- * Changelog * v5 -> v6: * No change in code. * add Reviewed-by: Jacob Keller tag. * add Reviewed-by: Jiri Pirko tag. * squash patches 1 and 2 together. * [PATCH 1/3]: remove the paragraph explaining why attributes get duplicated if nla_put() is called twice. v4 -> v5: * No change in code. * [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 (3): net: devlink: let the core report the driver name instead of the drivers 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