From patchwork Sat May 12 13:54:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Yanjun X-Patchwork-Id: 10395905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B978E60390 for ; Sat, 12 May 2018 13:51:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8B9B28F33 for ; Sat, 12 May 2018 13:51:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D4CE28F70; Sat, 12 May 2018 13:51:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E37628F33 for ; Sat, 12 May 2018 13:51:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751217AbeELNvQ (ORCPT ); Sat, 12 May 2018 09:51:16 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48726 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751033AbeELNvP (ORCPT ); Sat, 12 May 2018 09:51:15 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4CDoqUF160934; Sat, 12 May 2018 13:50:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=cPKaXJawn5UcbsRvMZ1bwwDxg/mPKuhPin+jfCW3U6Q=; b=NCZkCuIKe7aHF9iqluTeDxoTlk5Nwg/4BgrU7iO1sfgB31yHwVwsoDUL6dV/pdwA5+b9 HU4M1L0X7yH3RlBEd2UFdmPqaJ+kQBSgx2YDduzs5PDlSInLyH5nXwkEAQSB00gG4nB1 WVFxBblyaTbuUbehFRcd+SOjBA5TOry8EqHSLQ39cZ160pcqH1d2DtrDd2Xnr3/h+BvP KSUtCcSNVFHGRqpcW5WtqTHbW0QAW1TpIV0kAzioB9HY/gLym8QB4BzDlAYpP1T6L3Md tKID1d2BA2kvKWE7/HKP321f4ub0HnC1CJUnKyOGBEPpLBM2HQIa7UkivsQe2sTXbprb Hg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2hwrx50nwj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 12 May 2018 13:50:52 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4CDopnA027788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 12 May 2018 13:50:51 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w4CDooCS020153; Sat, 12 May 2018 13:50:50 GMT Received: from office-bj2017.cn.oracle.com (/10.182.69.78) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 12 May 2018 06:50:50 -0700 From: Zhu Yanjun To: monis@mellanox.com, dledford@redhat.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org Subject: [PATCH 2/4] IB/rxe: create a new udp port for ipv4 and ipv6 Date: Sat, 12 May 2018 09:54:26 -0400 Message-Id: <1526133268-23926-3-git-send-email-yanjun.zhu@oracle.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526133268-23926-1-git-send-email-yanjun.zhu@oracle.com> References: <1526133268-23926-1-git-send-email-yanjun.zhu@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8890 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805120139 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A new port is created to listen to udp sockets for ipv4 and ipv6. The new udp port is 4891. The original udp port is 4791. CC: Srinivas Eeda CC: Junxiao Bi Reviewed-by: Yuval Shaia Signed-off-by: Zhu Yanjun --- drivers/infiniband/sw/rxe/rxe_net.c | 22 +++++++++++++++++++++- drivers/infiniband/sw/rxe/rxe_net.h | 4 ++++ include/rdma/ib_verbs.h | 3 +++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c index 9da6e37..fb5c7ff 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.c +++ b/drivers/infiniband/sw/rxe/rxe_net.c @@ -720,7 +720,15 @@ static int rxe_net_ipv4_init(void) pr_err("Failed to create IPv4 UDP tunnel\n"); return -1; } - +#ifdef CONFIG_RDMA_RXE_DUAL_PORT_MODULE + recv_sockets.dual_sk4 = rxe_setup_udp_tunnel(&init_net, + htons(ROCE_V2_UDP_DUAL_DPORT), false); + if (IS_ERR(recv_sockets.dual_sk4)) { + recv_sockets.dual_sk4 = NULL; + pr_err("Failed to create IPv4 secondary UDP tunnel\n"); + return -1; + } +#endif return 0; } @@ -735,6 +743,18 @@ static int rxe_net_ipv6_init(void) pr_err("Failed to create IPv6 UDP tunnel\n"); return -1; } +#ifdef CONFIG_RDMA_RXE_DUAL_PORT_MODULE +{ + __be16 dport = htons(ROCE_V2_UDP_DUAL_DPORT); + + recv_sockets.dual_sk6 = rxe_setup_udp_tunnel(&init_net, dport, true); + if (IS_ERR(recv_sockets.dual_sk6)) { + recv_sockets.dual_sk6 = NULL; + pr_err("Failed to create dual IPv6 UDP tunnel\n"); + return -1; + } +} +#endif #endif return 0; } diff --git a/drivers/infiniband/sw/rxe/rxe_net.h b/drivers/infiniband/sw/rxe/rxe_net.h index 728d8c7..ec33762 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.h +++ b/drivers/infiniband/sw/rxe/rxe_net.h @@ -41,6 +41,10 @@ struct rxe_recv_sockets { struct socket *sk4; struct socket *sk6; +#ifdef CONFIG_RDMA_RXE_DUAL_PORT_MODULE + struct socket *dual_sk4; + struct socket *dual_sk6; +#endif }; extern struct notifier_block rxe_net_notifier; diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 9fc8a82..9a4332b 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -91,6 +91,9 @@ enum ib_gid_type { }; #define ROCE_V2_UDP_DPORT 4791 +#ifdef CONFIG_RDMA_RXE_DUAL_PORT_MODULE +#define ROCE_V2_UDP_DUAL_DPORT 4891 +#endif struct ib_gid_attr { struct net_device *ndev; struct ib_device *device;