From patchwork Fri Jun 23 09:57:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Yanjun X-Patchwork-Id: 13290221 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 28BBCEB64D7 for ; Fri, 23 Jun 2023 09:58:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230338AbjFWJ6c (ORCPT ); Fri, 23 Jun 2023 05:58:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230120AbjFWJ6b (ORCPT ); Fri, 23 Jun 2023 05:58:31 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26ECAC6 for ; Fri, 23 Jun 2023 02:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687514310; x=1719050310; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=srdNvnLtJM4cXhiaa6KO7TQ2+8tSqelv/CbI9RrmN3k=; b=lT8dX8anU+kst2O4Nwe5E+F1FQR9xGgyQQKYnjeBLH3p0eHegoL8pjf4 9GwYu0Ki9Y6n71JHQXc9lb8hfUPub7LNcssOOxya+KOemxmT3z/hIdE+0 OU0JssJVMASgkPwscmm3ESdjNmD79Ph3CX1532QbFSKOjKl5bwrTyyEd6 cNn9rQbJ7//VV3jELQ1T945gYJ36Hp2P5YmSHGAorCzkzZ/cjVCD8XcTG CFRL+axBpJqAOcMQJ9RLz97splXBHRZiHpbiFbJt8Ye734eJ+tHH5awRT 2o/GHfHgco9ezjGiHI9uCqpFCIkW+P+euX7koaxBjTLjZm7nl4kn/k1nO g==; X-IronPort-AV: E=McAfee;i="6600,9927,10749"; a="424411353" X-IronPort-AV: E=Sophos;i="6.01,151,1684825200"; d="scan'208";a="424411353" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2023 02:58:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10749"; a="715262988" X-IronPort-AV: E=Sophos;i="6.01,151,1684825200"; d="scan'208";a="715262988" Received: from unknown (HELO intel-71.bj.intel.com) ([10.238.154.71]) by orsmga002.jf.intel.com with ESMTP; 23 Jun 2023 02:58:27 -0700 From: Zhu Yanjun To: zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org, linux-rdma@vger.kernel.org, parav@nvidia.com, lehrer@gmail.com, rpearsonhpe@gmail.com Cc: Zhu Yanjun , Rain River Subject: [PATCH v6 1/8] RDMA/rxe: Creating listening sock in newlink function Date: Fri, 23 Jun 2023 17:57:42 +0800 Message-Id: <20230623095749.485873-2-yanjun.zhu@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230623095749.485873-1-yanjun.zhu@intel.com> References: <20230623095749.485873-1-yanjun.zhu@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Zhu Yanjun Originally when the module rdma_rxe is loaded, the sock listening on udp port 4791 is created. Currently moving the creating listening port to newlink function. So when running "rdma link add" command, the sock listening on udp port 4791 is created. Tested-by: Rain River Signed-off-by: Zhu Yanjun --- drivers/infiniband/sw/rxe/rxe.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c index 7a7e713de52d..89b24bc34299 100644 --- a/drivers/infiniband/sw/rxe/rxe.c +++ b/drivers/infiniband/sw/rxe/rxe.c @@ -194,6 +194,10 @@ static int rxe_newlink(const char *ibdev_name, struct net_device *ndev) goto err; } + err = rxe_net_init(); + if (err) + return err; + err = rxe_net_add(ibdev_name, ndev); if (err) { rxe_err("failed to add %s\n", ndev->name); @@ -210,12 +214,6 @@ static struct rdma_link_ops rxe_link_ops = { static int __init rxe_module_init(void) { - int err; - - err = rxe_net_init(); - if (err) - return err; - rdma_link_register(&rxe_link_ops); pr_info("loaded\n"); return 0;