Message ID | 20230804150527.6117-1-petr.pavlu@suse.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:1a9a:b0:139:fa0d:b2d with SMTP id gm26csp106313rwb; Fri, 4 Aug 2023 11:00:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeKBnvFG11vb5I2J2iJIVQs9ZPczZZudpB+jMN5pimgkDzFLWzj1TbZtHMmQKVs4dR1CQ/ X-Received: by 2002:a2e:9c55:0:b0:2b9:eb8b:eeb1 with SMTP id t21-20020a2e9c55000000b002b9eb8beeb1mr1809360ljj.37.1691172030736; Fri, 04 Aug 2023 11:00:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691172030; cv=none; d=google.com; s=arc-20160816; b=CNO3SN5NcFcgeMw9/NH1LbgIH3tiWA86cRtP1lmAANb0ExRD3awq53Yem1dAi3ZLWA jTfFawadvCJYcm5+O8Gwu14xS+jCfJ/N80CC1rzDs6JjMMurfLBYJMsEIoPXyNOgJChQ 1TVPSveOnORJTo6BXetSmfjUczfbQS5Xfj1RMZqudQdyDDy196+VAjpTI152E0Kj0zzH EeM3DyJza8/537qq2Scf74DmYo0rL98YjTWAwKXOMmJtWCvkgQSkqtivYdSNINqbQ3ls g+Vuo9Na/WmGwB+FIgUlkNYdZtgi9Eo9qc1ZPhwIq7mhLkbbF8akEndJURSltl8/LpZv Dvwg== 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:dkim-signature; bh=R2CNUU0poJf8y+6hqEdygzh3lBlBrvnrBDyeSv19c4k=; fh=N4UEMElQk6hGbGbNgo9xbmRN6j/FKmp2t1DTY4O02jg=; b=TLzjX+82lIESjn1MPe1OjYvzvJTQVbisIvsp9Lhqk7q5Six5DUwB+ot0A3O7sRv8Ja jhG8V0VRSMOI3aDVgoz/53Kk2N1jLI8J9BdGMANMn1UHnYSILHLwy0XY7P6V3PXJvG79 MHOeCda50h2WDnoXlOQhC1CuUn3/NZIyfvarBVE/Y6lKG9oYd4ezvKlcrg1UKC4VyAKb HJ7Gcek2bc2Avm8yeXBmt7Fou7SKOAxBDuyoeTB/jvEZWAVIGkv+cC2LHL9riebacoxG N+kTaF95jwwo8XpCyx5Nrp+0a+ZZCkdkyGiCRiv9CQtQtpXWAcUVJEmsC5RmlxgaQtKz AFeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=GJ3DiR9h; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f3-20020a170906494300b00992bcbf775asi1775291ejt.940.2023.08.04.11.00.05; Fri, 04 Aug 2023 11:00:30 -0700 (PDT) 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=@suse.com header.s=susede1 header.b=GJ3DiR9h; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230061AbjHDPGF (ORCPT <rfc822;sukrut.bellary@gmail.com> + 99 others); Fri, 4 Aug 2023 11:06:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229906AbjHDPGD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 4 Aug 2023 11:06:03 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC72549D8; Fri, 4 Aug 2023 08:05:59 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3CEA51F86A; Fri, 4 Aug 2023 15:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1691161558; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=R2CNUU0poJf8y+6hqEdygzh3lBlBrvnrBDyeSv19c4k=; b=GJ3DiR9hJlKov7uKmukzuCiKZvgPHbQCtv6GznjKDSH3Wufmkm3gAd63DOCvPWr8FXJXPZ oTsfyjNNrjx8TL2IU77yV6aQu5/XSy6H5j41b8k+bisrOQ77z/29XOT5JJjJm6YUGqM/nn 7QSRNv4ZeR6gFkfOMGgrFgUW+BeyzIs= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0816B133B5; Fri, 4 Aug 2023 15:05:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id PwItAdYTzWRwSQAAMHmgww (envelope-from <petr.pavlu@suse.com>); Fri, 04 Aug 2023 15:05:58 +0000 From: Petr Pavlu <petr.pavlu@suse.com> To: tariqt@nvidia.com, yishaih@nvidia.com, leon@kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, jgg@ziepe.ca, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Petr Pavlu <petr.pavlu@suse.com> Subject: [PATCH net-next 00/10] Convert mlx4 to use auxiliary bus Date: Fri, 4 Aug 2023 17:05:17 +0200 Message-Id: <20230804150527.6117-1-petr.pavlu@suse.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham 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: INBOX X-GMAIL-THRID: 1773322403045523731 X-GMAIL-MSGID: 1773322403045523731 |
Series |
Convert mlx4 to use auxiliary bus
|
|
Message
Petr Pavlu
Aug. 4, 2023, 3:05 p.m. UTC
This series converts the mlx4 drivers to use auxiliary bus, similarly to how mlx5 was converted [1]. The first 6 patches are preparatory changes, the remaining 4 are the final conversion. Initial motivation for this change was to address a problem related to loading mlx4_en/mlx4_ib by mlx4_core using request_module_nowait(). When doing such a load in initrd, the operation is asynchronous to any init control and can get unexpectedly affected/interrupted by an eventual root switch. Using an auxiliary bus leaves these module loads to udevd which better integrates with systemd processing. [2] General benefit is to get rid of custom interface logic and instead use a common facility available for this task. An obvious risk is that some new bug is introduced by the conversion. Leon Romanovsky was kind enough to check for me that the series passes their verification tests. [1] https://lore.kernel.org/netdev/20201101201542.2027568-1-leon@kernel.org/ [2] https://lore.kernel.org/netdev/0a361ac2-c6bd-2b18-4841-b1b991f0635e@suse.com/ Petr Pavlu (10): mlx4: Get rid of the mlx4_interface.get_dev callback mlx4: Rename member mlx4_en_dev.nb to netdev_nb mlx4: Replace the mlx4_interface.event callback with a notifier mlx4: Get rid of the mlx4_interface.activate callback mlx4: Move the bond work to the core driver mlx4: Avoid resetting MLX4_INTFF_BONDING per driver mlx4: Register mlx4 devices to an auxiliary virtual bus mlx4: Connect the ethernet part to the auxiliary bus mlx4: Connect the infiniband part to the auxiliary bus mlx4: Delete custom device management logic drivers/infiniband/hw/mlx4/main.c | 207 ++++++---- drivers/infiniband/hw/mlx4/mlx4_ib.h | 2 + drivers/net/ethernet/mellanox/mlx4/Kconfig | 1 + drivers/net/ethernet/mellanox/mlx4/en_main.c | 141 ++++--- .../net/ethernet/mellanox/mlx4/en_netdev.c | 64 +--- drivers/net/ethernet/mellanox/mlx4/intf.c | 361 ++++++++++++------ drivers/net/ethernet/mellanox/mlx4/main.c | 110 ++++-- drivers/net/ethernet/mellanox/mlx4/mlx4.h | 16 +- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 4 +- include/linux/mlx4/device.h | 20 + include/linux/mlx4/driver.h | 42 +- 11 files changed, 572 insertions(+), 396 deletions(-) base-commit: 86b7e033d684a9d4ca20ad8e6f8b9300cf99668f
Comments
On Fri, Aug 04, 2023 at 05:05:17PM +0200, Petr Pavlu wrote: > This series converts the mlx4 drivers to use auxiliary bus, similarly to > how mlx5 was converted [1]. The first 6 patches are preparatory changes, > the remaining 4 are the final conversion. > > Initial motivation for this change was to address a problem related to > loading mlx4_en/mlx4_ib by mlx4_core using request_module_nowait(). When > doing such a load in initrd, the operation is asynchronous to any init > control and can get unexpectedly affected/interrupted by an eventual > root switch. Using an auxiliary bus leaves these module loads to udevd > which better integrates with systemd processing. [2] Neat, I didn't realize that was a pain point for distros. Jason
On 04/08/2023 18:05, Petr Pavlu wrote: > This series converts the mlx4 drivers to use auxiliary bus, similarly to > how mlx5 was converted [1]. The first 6 patches are preparatory changes, > the remaining 4 are the final conversion. > > Initial motivation for this change was to address a problem related to > loading mlx4_en/mlx4_ib by mlx4_core using request_module_nowait(). When > doing such a load in initrd, the operation is asynchronous to any init > control and can get unexpectedly affected/interrupted by an eventual > root switch. Using an auxiliary bus leaves these module loads to udevd > which better integrates with systemd processing. [2] > > General benefit is to get rid of custom interface logic and instead use > a common facility available for this task. An obvious risk is that some > new bug is introduced by the conversion. > > Leon Romanovsky was kind enough to check for me that the series passes > their verification tests. > > [1] https://lore.kernel.org/netdev/20201101201542.2027568-1-leon@kernel.org/ > [2] https://lore.kernel.org/netdev/0a361ac2-c6bd-2b18-4841-b1b991f0635e@suse.com/ > > Petr Pavlu (10): > mlx4: Get rid of the mlx4_interface.get_dev callback > mlx4: Rename member mlx4_en_dev.nb to netdev_nb > mlx4: Replace the mlx4_interface.event callback with a notifier > mlx4: Get rid of the mlx4_interface.activate callback > mlx4: Move the bond work to the core driver > mlx4: Avoid resetting MLX4_INTFF_BONDING per driver > mlx4: Register mlx4 devices to an auxiliary virtual bus > mlx4: Connect the ethernet part to the auxiliary bus > mlx4: Connect the infiniband part to the auxiliary bus > mlx4: Delete custom device management logic > > drivers/infiniband/hw/mlx4/main.c | 207 ++++++---- > drivers/infiniband/hw/mlx4/mlx4_ib.h | 2 + > drivers/net/ethernet/mellanox/mlx4/Kconfig | 1 + > drivers/net/ethernet/mellanox/mlx4/en_main.c | 141 ++++--- > .../net/ethernet/mellanox/mlx4/en_netdev.c | 64 +--- > drivers/net/ethernet/mellanox/mlx4/intf.c | 361 ++++++++++++------ > drivers/net/ethernet/mellanox/mlx4/main.c | 110 ++++-- > drivers/net/ethernet/mellanox/mlx4/mlx4.h | 16 +- > drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 4 +- > include/linux/mlx4/device.h | 20 + > include/linux/mlx4/driver.h | 42 +- > 11 files changed, 572 insertions(+), 396 deletions(-) > > > base-commit: 86b7e033d684a9d4ca20ad8e6f8b9300cf99668f For the series: Acked-by: Tariq Toukan <tariqt@nvidia.com>