Re: [PATCH rdma-core] iwpmd: Return existing mapping if port reused on active side

Shiraz Saleem
2017-10-10T19:34:49Z

On Tue, Oct 10, 2017 at 12:24:19PM -0500, Steve Wise wrote:
> >
> > On Sun, Oct 08, 2017 at 06:34:28PM -0500, Tatyana Nikolova wrote:
> > > From: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > >
> > > Port-mapper returns a duplicate mapping error and no
> > > mapped port if an attempt is made to add a mapping for
> > > a new connection which re-uses the local port on active side.
> > > Fix this by finding the existing mapping for the re-used
> > > local port and return the mapped port. Also, change ref_cnt
> > > in struct iwpm_port to be atomic and use it to track the
> > > references to a mapping.
> > >
> > > Signed-off-by: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > > Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > > ---
> > > iwpmd/iwarp_pm.h | 5 ++---
> > > iwpmd/iwarp_pm_helper.c | 27 ++++-----------------------
> > > iwpmd/iwarp_pm_server.c | 47
> +++++++++++++++++++++--------------------------
> > > 3 files changed, 27 insertions(+), 52 deletions(-)
> > >
> >
> > Any feedback from iWARP crowd?
> >
>
> Yes.
>
> How is a new connection re-using the local port exactly? Is there a test case
> that reproduces this?
>
> Other than that,
>
> Reviewed-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
>

Hi Steve,

A new connection can reuse a local port if one of destination port, destination address
or source address differs from an existing connection.

This optimization for port reuse was added in kernel in
commit 19b752a19dce ("IB/cma: Allow port reuse for rdma_id")

https://patchwork.kernel.org/patch/9499071/

We saw the port-mapper "duplicate mapping error" during Open MPI scale up testing.

Shiraz