Re: [PATCH 1/1] RDMA/irdma: Make the source udp port vary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/14/2021 12:29 PM, Jason Gunthorpe wrote:
On Tue, Dec 14, 2021 at 12:27:24PM -0500, Tom Talpey wrote:
On 12/14/2021 12:42 AM, yanjun.zhu@xxxxxxxxx wrote:
From: Zhu Yanjun <yanjun.zhu@xxxxxxxxx>

Based on the link https://www.spinics.net/lists/linux-rdma/msg73735.html,
get the source udp port number for a QP based on the local QPN. This
provides a better spread of traffic across NIC RX queues.  The method in
the commit d3c04a3a6870 ("IB/rxe: vary the source udp port for receive
scaling") is stable. So it is also adopted in this commit.

Signed-off-by: Zhu Yanjun <yanjun.zhu@xxxxxxxxx>
   drivers/infiniband/hw/irdma/verbs.c | 7 ++++++-
   1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index 102dc9342f2a..2697b40a539e 100644
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -690,6 +690,11 @@ static int irdma_cqp_create_qp_cmd(struct irdma_qp *iwqp)
   	return status ? -ENOMEM : 0;
   }
+static inline u16 irdma_get_src_port(struct irdma_qp *iwqp)
+{
+	return 0xc000 + (hash_32_generic(iwqp->ibqp.qp_num, 14) & 0x3fff);
+}

How do you ensure the resulting port number is not already in use?

It doesn't matter, it is never used by anything, the receiver captures
all data with the roce dport and ignores the sport

It still violates core networking addressing principles, and will
mightily confuse a network capture that's filtering on source ports.
Firewalls, ICMP, and similar fabric behaviors may also interfere.

SoftRoCE is forced to register/reserve the source port, isn't it?

Tom.



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux