On 10/9/20 10:28 AM, Jason Gunthorpe wrote: > On Fri, Oct 09, 2020 at 11:23:31PM +0800, Zhu Yanjun wrote: >> On 10/9/2020 5:27 AM, Bob Pearson wrote: >>> - Fix a bug in rxe_rcv that causes all multicast packets to be >>> dropped. Currently rxe_match_dgid is called for each packet >>> to verify that the destination IP address matches one of the >>> entries in the port source GID table. This is incorrect for >>> IP multicast addresses since they do not appear in the GID table. >>> - Add code to detect multicast addresses. >>> - Change function name to rxe_chk_dgid which is clearer. >>> >>> Signed-off-by: Bob Pearson <rpearson@xxxxxxx> >>> drivers/infiniband/sw/rxe/rxe_recv.c | 19 ++++++++++++++++--- >>> 1 file changed, 16 insertions(+), 3 deletions(-) >>> >>> diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c >>> index a3eed4da1540..b6fee61b2aee 100644 >>> +++ b/drivers/infiniband/sw/rxe/rxe_recv.c >>> @@ -280,7 +280,17 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb) >>> kfree_skb(skb); >>> } >>> -static int rxe_match_dgid(struct rxe_dev *rxe, struct sk_buff *skb) >>> +/** >>> + * rxe_chk_dgid - validate destination IP address >>> + * @rxe: rxe device that received packet >>> + * @skb: the received packet buffer >>> + * >>> + * Accept any loopback packets >> >> About loopback packets, will rdma_find_gid_by_port return correct value? I didn't touch that but the RXE_LOOPBACK test comes before the call to rdma_find_gid_by_port so it should never get called for loopback packets. > > I don't think you can use 127.0.0.0 with the RDMA devices, at least > not on the wire. The CM has special code to swap it out with a real > device address The following does work: $ ib_send_bw -d rxe_0 (in window A) $ ib_send_bw -d rxe_0 127.0.0.1 (in window B) This uses the LOOPBACK path and just hands the skb from sender to receiver. It never touches the IP stack. I have never been able to get this to work: $ ib_send_bw -d rxe_1 (at 10.0.0.1 in window A) $ ib_send_bw -d rxe_2 10.0.0.1 (at 10.0.0.2 in window B) If it did work I could test the full path. > > Jason >