From patchwork Fri Apr 28 09:39:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Yanjun X-Patchwork-Id: 13226140 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 4C9D6C77B61 for ; Fri, 28 Apr 2023 09:43:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345621AbjD1JnG (ORCPT ); Fri, 28 Apr 2023 05:43:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345455AbjD1JnF (ORCPT ); Fri, 28 Apr 2023 05:43:05 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6FF24690 for ; Fri, 28 Apr 2023 02:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682674983; x=1714210983; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oC+vQEcrZoXSOOPg8qfiEA8dpCptDmqO+lSlOzglrm4=; b=Yg97M/6vVg9JYCsgMvNojDw6tx8U3QotF7gzAxGJ9JNq2T8R2M83nj5o af4FZDhOWf2tZGMqQNrjyMTY4NS89mZjfL3gGrs6tmDto1KaC2O1bI7kf mbUQSqDKpojQXogaMnfs1j660pYgYYPV4GEycO910nxowQ1gpnb1CAE4K HfTY4+G5nQzHR5D1lIvkmsO5lOeZjFNX32MN4mfxH4x6SUumTsrrvc2fv mMuaYmRdgJHJyGzI6xw9TZLUw5R+MM3Uu32vMV6f01z48egeDkLQn1CuZ UP8BNcSA9iS6eROUibCy5llWl9KvjZPm35zJZNuIXWM0AGMRsLOun93Hy w==; X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="328035121" X-IronPort-AV: E=Sophos;i="5.99,234,1677571200"; d="scan'208";a="328035121" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2023 02:43:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="764220293" X-IronPort-AV: E=Sophos;i="5.99,234,1677571200"; d="scan'208";a="764220293" Received: from unknown (HELO intel-71.bj.intel.com) ([10.238.154.71]) by fmsmga004.fm.intel.com with ESMTP; 28 Apr 2023 02:43:00 -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 Cc: Zhu Yanjun , Rain River Subject: [PATCHv5 for-rc1 v5 1/8] RDMA/rxe: Creating listening sock in newlink function Date: Fri, 28 Apr 2023 17:39:07 +0800 Message-Id: <20230428093914.2121131-2-yanjun.zhu@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230428093914.2121131-1-yanjun.zhu@intel.com> References: <20230428093914.2121131-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 136c2efe3466..64644cb0bb38 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) { rxe_dbg(exists, "failed to add %s\n", ndev->name); @@ -208,12 +212,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;