public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* Need to set if_index in ib_init_ah_from_wc() ?
@ 2017-01-30  1:21 Roland Dreier
       [not found] ` <CAL1RGDW6iHo2UYKbcJmcG=wCq63jvZB7nvOD=BJZwASSzc7Zhw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 31+ messages in thread
From: Roland Dreier @ 2017-01-30  1:21 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

I recently debugged an issue where an RDMA-CM / RoCE connection to a
link-local IPv6 address takes 1 second to establish.  The delay comes
when the passive side cm_req_handler() calls
cm_init_av_for_response(), which calls ib_init_ah_from_wc().

That calls into rdma_addr_find_l2_eth_by_grh() with the link-local
address, but with 0 passed in through the if_index parameter.  So
resolving the link-local routing fails (since we don't give the
network stack a device scope).  We end up in the ENODATA case in
rdma_resolve_ip(), so we queue a request to try again with a timeout
of 1000 msec.  Of course, that still fails, so we return failure.  The
CM ignores the return value, but we've delayed sending the REP for a
second.

The fix seems as simple as adding

    if_index = idev->ifindex;

to ib_init_ah_from_wc() before the call to
rdma_addr_find_l2_eth_by_grh() - this can't fail, since we return an
error if finding idev fails.

However, I'm not sure if it's quite that simple - how does this
interact with RoCEv2, or other addressing like IPv4 or non-link-local
IPv6? I'm not sure I understand what the cases where resolved_dev will
be != idev, or if passing in idev->ifindex will break this.

Do I need to add a conditional to limit when I assign if_index?

Thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2017-10-30  5:32 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-30  1:21 Need to set if_index in ib_init_ah_from_wc() ? Roland Dreier
     [not found] ` <CAL1RGDW6iHo2UYKbcJmcG=wCq63jvZB7nvOD=BJZwASSzc7Zhw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-30 19:54   ` Jason Gunthorpe
     [not found]     ` <20170130195412.GE24466-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-30 20:15       ` Parav Pandit
     [not found]         ` <VI1PR0502MB30081EBFBEE5994B77D58BB9D14B0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-01-30 21:14           ` Jason Gunthorpe
     [not found]             ` <20170130211420.GB27111-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-30 21:52               ` Parav Pandit
     [not found]                 ` <VI1PR0502MB30081EC9B35269636B4C2FBCD14B0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-01-30 22:14                   ` Jason Gunthorpe
     [not found]                     ` <20170130221437.GA28117-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-31  0:21                       ` Parav Pandit
     [not found]                         ` <VI1PR0502MB3008B16A0F103D729209EA16D14A0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-01-31  0:53                           ` Jason Gunthorpe
     [not found]                             ` <20170131005340.GA30809-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-31  1:49                               ` Jason Gunthorpe
     [not found]                                 ` <20170131014941.GA15387-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-31  1:57                                   ` Parav Pandit
2017-02-08 16:02                               ` Matan Barak
     [not found]                                 ` <CAAKD3BDbkFHbCi+gHyCXCGV2xi5E9FA+KgwKz+6dBJEtsV0ZkQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-08 17:40                                   ` Jason Gunthorpe
     [not found]                                     ` <20170208174040.GC30720-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-02-09  0:00                                       ` Parav Pandit
     [not found]                                         ` <VI1PR0502MB3008417F3E388B617291147CD1450-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-02-09  0:01                                           ` Jason Gunthorpe
     [not found]                                             ` <20170209000157.GA14556-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-02-09  0:15                                               ` Parav Pandit
     [not found]                                                 ` <VI1PR0502MB3008153CDFD7F9C7CCAB022CD1450-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-02-09  9:24                                                   ` Matan Barak
     [not found]                                                     ` <CAAKD3BBunKCb6Z-FObOD0covTt3gCXDn3oic4LNbU3J5JHiQJw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-09 18:47                                                       ` Jason Gunthorpe
     [not found]                                                         ` <20170209184720.GA809-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-02-09 21:55                                                           ` Parav Pandit
     [not found]                                                             ` <VI1PR0502MB30089F94C9F1504E142B86E0D1450-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-02-09 22:18                                                               ` Jason Gunthorpe
2017-02-09  8:40                                       ` Matan Barak
     [not found]                                         ` <CAAKD3BD88Kp2h3+vP4iMy5T4rR6=Y39ZnNXRLM1P-6G6iB=BNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-09 18:48                                           ` Jason Gunthorpe
2017-01-31  0:24                   ` Roland Dreier
2017-10-18 19:00       ` Parav Pandit
     [not found]         ` <VI1PR0502MB30086B735FD4B5948B521673D14D0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-10-19  4:32           ` Devesh Sharma
     [not found]             ` <CANjDDBhJK=s28zrdCASUVSSeem=NVRWwsHT=jWS2N4jGh2Uvfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-19  4:54               ` Parav Pandit
     [not found]                 ` <VI1PR0502MB300803053059AA7CC0E6DA7DD1420-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-10-23 16:28                   ` Parav Pandit
     [not found]                     ` <VI1PR0502MB30087224F41436F787C4997FD1460-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-10-23 17:39                       ` Leon Romanovsky
     [not found]                         ` <20171023173946.GP2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-29 18:26                           ` Jason Gunthorpe
2017-10-30  3:59                           ` Devesh Sharma
     [not found]                             ` <CANjDDBiuFYo_3Y=0oGMza1N5SGcNcgKE8y1LscYK6bc44-YxGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-30  5:32                               ` Leon Romanovsky
2017-10-19  6:20               ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox