From patchwork Thu Oct 6 08:59:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Yanjun X-Patchwork-Id: 12999444 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 593D5C43219 for ; Wed, 5 Oct 2022 16:33:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230117AbiJEQdM (ORCPT ); Wed, 5 Oct 2022 12:33:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbiJEQdI (ORCPT ); Wed, 5 Oct 2022 12:33:08 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06A467D7AC; Wed, 5 Oct 2022 09:33:07 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6500,9779,10491"; a="303182095" X-IronPort-AV: E=Sophos;i="5.95,161,1661842800"; d="scan'208";a="303182095" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2022 09:33:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10491"; a="619518073" X-IronPort-AV: E=Sophos;i="5.95,161,1661842800"; d="scan'208";a="619518073" Received: from unknown (HELO intel-71.bj.intel.com) ([10.238.154.71]) by orsmga007.jf.intel.com with ESMTP; 05 Oct 2022 09:33:04 -0700 From: yanjun.zhu@linux.dev To: jgg@ziepe.ca, leon@kernel.org, zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org, yanjun.zhu@linux.dev, netdev@vger.kernel.org, davem@davemloft.net Subject: [PATCHv2 1/6] RDMA/rxe: Creating listening sock in newlink function Date: Thu, 6 Oct 2022 04:59:16 -0400 Message-Id: <20221006085921.1323148-2-yanjun.zhu@linux.dev> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221006085921.1323148-1-yanjun.zhu@linux.dev> References: <20221006085921.1323148-1-yanjun.zhu@linux.dev> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@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. Signed-off-by: Zhu Yanjun --- drivers/infiniband/sw/rxe/rxe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c index 51daac5c4feb..a22ff2207b42 100644 --- a/drivers/infiniband/sw/rxe/rxe.c +++ b/drivers/infiniband/sw/rxe/rxe.c @@ -192,6 +192,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) { pr_err("failed to add %s\n", ndev->name); @@ -210,10 +214,6 @@ 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;