From patchwork Wed Jan 5 22:12:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Yanjun X-Patchwork-Id: 12704051 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 1B7B9C433EF for ; Wed, 5 Jan 2022 05:49:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237571AbiAEFt6 (ORCPT ); Wed, 5 Jan 2022 00:49:58 -0500 Received: from mga07.intel.com ([134.134.136.100]:27100 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237567AbiAEFt6 (ORCPT ); Wed, 5 Jan 2022 00:49:58 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10217"; a="305725932" X-IronPort-AV: E=Sophos;i="5.88,262,1635231600"; d="scan'208";a="305725932" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2022 21:49:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,262,1635231600"; d="scan'208";a="760688637" Received: from intel-obmc.bj.intel.com (HELO intel-71.bj.intel.com) ([10.238.154.71]) by fmsmga006.fm.intel.com with ESMTP; 04 Jan 2022 21:49:56 -0800 From: yanjun.zhu@linux.dev To: liangwenpeng@huawei.com, jgg@ziepe.ca, mustafa.ismail@intel.com, shiraz.saleem@intel.com, zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org, yanjun.zhu@linux.dev Subject: [PATCH 5/5] RDMA/rxe: Remove the redundant randomization for UDP source port Date: Wed, 5 Jan 2022 17:12:37 -0500 Message-Id: <20220105221237.2659462-6-yanjun.zhu@linux.dev> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220105221237.2659462-1-yanjun.zhu@linux.dev> References: <20220105221237.2659462-1-yanjun.zhu@linux.dev> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Zhu Yanjun Since the UDP source port is modified in rxe_modify_qp, the randomization for UDP source port is redundant in this function. So remove it. Signed-off-by: Zhu Yanjun --- drivers/infiniband/sw/rxe/rxe_qp.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c index 54b8711321c1..84d6ffe7350a 100644 --- a/drivers/infiniband/sw/rxe/rxe_qp.c +++ b/drivers/infiniband/sw/rxe/rxe_qp.c @@ -210,15 +210,9 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp, return err; qp->sk->sk->sk_user_data = qp; - /* pick a source UDP port number for this QP based on - * the source QPN. this spreads traffic for different QPs - * across different NIC RX queues (while using a single - * flow for a given QP to maintain packet order). - * the port number must be in the Dynamic Ports range - * (0xc000 - 0xffff). + /* Source UDP port number for this QP is modified in rxe_qp_modify. */ - qp->src_port = RXE_ROCE_V2_SPORT + - (hash_32_generic(qp_num(qp), 14) & 0x3fff); + qp->src_port = RXE_ROCE_V2_SPORT; qp->sq.max_wr = init->cap.max_send_wr; /* These caps are limited by rxe_qp_chk_cap() done by the caller */