aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw
diff options
context:
space:
mode:
authorParav Pandit <pandit.parav@gmail.com>2016-09-28 16:24:42 -0400
committerDoug Ledford <dledford@redhat.com>2016-10-06 13:50:04 -0400
commitffae955d49e6cff28589d6e7388bb9275f9ce2d1 (patch)
tree505f762e5e0c7edb32f461fac5cac6a75b4905a6 /drivers/infiniband/sw
parent063af59597492d31c44e549d6c773b6485f7dc53 (diff)
IB/rxe: Fix sending out loopback packet on netdev interface.
Both prepare4 and prepare6 sets loopback mask in pkt_info structure instance of skb. The xmit_packet and other requester side functions use a pkt_info struct from the stack without the proper mask. This results in sending out the packet to the actual netdev device and loopback functionality is broken. Modify prepare() to pass its correctly marked pkt_info struct to prepare4() and prepare6() instead of them using SKB_TO_PKT(skb) and getting an incorrectly set mask. Verified with perftest applications. Signed-off-by: Parav Pandit <pandit.parav@gmail.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_net.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index eedf2f1cafdf..549aa84f9f9f 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -350,14 +350,14 @@ static void prepare_ipv6_hdr(struct dst_entry *dst, struct sk_buff *skb,
350 ip6h->payload_len = htons(skb->len - sizeof(*ip6h)); 350 ip6h->payload_len = htons(skb->len - sizeof(*ip6h));
351} 351}
352 352
353static int prepare4(struct rxe_dev *rxe, struct sk_buff *skb, struct rxe_av *av) 353static int prepare4(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
354 struct sk_buff *skb, struct rxe_av *av)
354{ 355{
355 struct dst_entry *dst; 356 struct dst_entry *dst;
356 bool xnet = false; 357 bool xnet = false;
357 __be16 df = htons(IP_DF); 358 __be16 df = htons(IP_DF);
358 struct in_addr *saddr = &av->sgid_addr._sockaddr_in.sin_addr; 359 struct in_addr *saddr = &av->sgid_addr._sockaddr_in.sin_addr;
359 struct in_addr *daddr = &av->dgid_addr._sockaddr_in.sin_addr; 360 struct in_addr *daddr = &av->dgid_addr._sockaddr_in.sin_addr;
360 struct rxe_pkt_info *pkt = SKB_TO_PKT(skb);
361 361
362 dst = rxe_find_route4(rxe->ndev, saddr, daddr); 362 dst = rxe_find_route4(rxe->ndev, saddr, daddr);
363 if (!dst) { 363 if (!dst) {
@@ -376,12 +376,12 @@ static int prepare4(struct rxe_dev *rxe, struct sk_buff *skb, struct rxe_av *av)
376 return 0; 376 return 0;
377} 377}
378 378
379static int prepare6(struct rxe_dev *rxe, struct sk_buff *skb, struct rxe_av *av) 379static int prepare6(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
380 struct sk_buff *skb, struct rxe_av *av)
380{ 381{
381 struct dst_entry *dst; 382 struct dst_entry *dst;
382 struct in6_addr *saddr = &av->sgid_addr._sockaddr_in6.sin6_addr; 383 struct in6_addr *saddr = &av->sgid_addr._sockaddr_in6.sin6_addr;
383 struct in6_addr *daddr = &av->dgid_addr._sockaddr_in6.sin6_addr; 384 struct in6_addr *daddr = &av->dgid_addr._sockaddr_in6.sin6_addr;
384 struct rxe_pkt_info *pkt = SKB_TO_PKT(skb);
385 385
386 dst = rxe_find_route6(rxe->ndev, saddr, daddr); 386 dst = rxe_find_route6(rxe->ndev, saddr, daddr);
387 if (!dst) { 387 if (!dst) {
@@ -408,9 +408,9 @@ static int prepare(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
408 struct rxe_av *av = rxe_get_av(pkt); 408 struct rxe_av *av = rxe_get_av(pkt);
409 409
410 if (av->network_type == RDMA_NETWORK_IPV4) 410 if (av->network_type == RDMA_NETWORK_IPV4)
411 err = prepare4(rxe, skb, av); 411 err = prepare4(rxe, pkt, skb, av);
412 else if (av->network_type == RDMA_NETWORK_IPV6) 412 else if (av->network_type == RDMA_NETWORK_IPV6)
413 err = prepare6(rxe, skb, av); 413 err = prepare6(rxe, pkt, skb, av);
414 414
415 *crc = rxe_icrc_hdr(pkt, skb); 415 *crc = rxe_icrc_hdr(pkt, skb);
416 416