diff mbox

iw_cxgb4: use wildcard mapping for getting remote addr info

Message ID 20150507145224.28735.97977.stgit@build.ogc.int (mailing list archive)
State Superseded
Delegated to: Doug Ledford
Headers show

Commit Message

Steve Wise May 7, 2015, 2:52 p.m. UTC
For listening endpoints bound to the wildcard address, we need to pass
the wildcard address mapping to iwpm_get_remote_info() instead of the
mapped address of the new child connection.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
 drivers/infiniband/hw/cxgb4/cm.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)


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

Comments

Doug Ledford May 7, 2015, 3:20 p.m. UTC | #1
On Thu, 2015-05-07 at 09:52 -0500, Steve Wise wrote:
> For listening endpoints bound to the wildcard address, we need to pass
> the wildcard address mapping to iwpm_get_remote_info() instead of the
> mapped address of the new child connection.
> 
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
>  drivers/infiniband/hw/cxgb4/cm.c |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
> index bb95a6c..3ad8dc7 100644
> --- a/drivers/infiniband/hw/cxgb4/cm.c
> +++ b/drivers/infiniband/hw/cxgb4/cm.c
> @@ -583,18 +583,18 @@ static void c4iw_record_pm_msg(struct c4iw_ep *ep,
>  		sizeof(ep->com.mapped_remote_addr));
>  }
>  
> -static int get_remote_addr(struct c4iw_ep *ep)
> +static int get_remote_addr(struct c4iw_ep *parent_ep, struct c4iw_ep *child_ep)
>  {
>  	int ret;
>  
> -	print_addr(&ep->com, __func__, "get_remote_addr");
> +	print_addr(&parent_ep->com, __func__, "get_remote_addr parent_ep ");
> +	print_addr(&child_ep->com, __func__, "get_remote_addr child_ep ");
>  
> -	ret = iwpm_get_remote_info(&ep->com.mapped_local_addr,
> -				   &ep->com.mapped_remote_addr,
> -				   &ep->com.remote_addr, RDMA_NL_C4IW);
> +	ret = iwpm_get_remote_info(&parent_ep->com.mapped_local_addr,
> +				   &child_ep->com.mapped_remote_addr,
> +				   &child_ep->com.remote_addr, RDMA_NL_C4IW);
>  	if (ret)
> -		pr_info(MOD "Unable to find remote peer addr info - err %d\n",
> -			ret);
> +		PDBG("Unable to find remote peer addr info - err %d\n", ret);
>  
>  	return ret;
>  }
> @@ -2420,7 +2420,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
>  	}
>  	memcpy(&child_ep->com.remote_addr, &child_ep->com.mapped_remote_addr,
>  	       sizeof(child_ep->com.remote_addr));
> -	get_remote_addr(child_ep);
> +	get_remote_addr(parent_ep, child_ep);
>  
>  	c4iw_get_ep(&parent_ep->com);
>  	child_ep->parent_ep = parent_ep;
> 

Seems sane.
Nikolova, Tatyana E May 7, 2015, 3:43 p.m. UTC | #2
UmV2aWV3ZWQtYnk6IFRhdHlhbmEgTmlrb2xvdmEgPFRhdHlhbmEuRS5OaWtvbG92YUBpbnRlbC5j
b20+IA0KDQotLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJvbTogbGludXgtcmRtYS1vd25l
ckB2Z2VyLmtlcm5lbC5vcmcgW21haWx0bzpsaW51eC1yZG1hLW93bmVyQHZnZXIua2VybmVsLm9y
Z10gT24gQmVoYWxmIE9mIFN0ZXZlIFdpc2UNClNlbnQ6IFRodXJzZGF5LCBNYXkgMDcsIDIwMTUg
OTo1MiBBTQ0KVG86IGRsZWRmb3JkQHJlZGhhdC5jb20NCkNjOiBsaW51eC1yZG1hQHZnZXIua2Vy
bmVsLm9yZw0KU3ViamVjdDogW1BBVENIXSBpd19jeGdiNDogdXNlIHdpbGRjYXJkIG1hcHBpbmcg
Zm9yIGdldHRpbmcgcmVtb3RlIGFkZHIgaW5mbw0KDQpGb3IgbGlzdGVuaW5nIGVuZHBvaW50cyBi
b3VuZC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QogCW1lbWNweSgmY2hp
bGRfZXAtPmNvbS5yZW1vdGVfYWRkciwgJmNoaWxkX2VwLT5jb20ubWFwcGVkX3JlbW90ZV9hZGRy
LA0KIAkgICAgICAgc2l6ZW9mKGNoaWxkX2VwLT5jb20ucmVtb3RlX2FkZHIpKTsNCi0JZ2V0X3Jl
bW90ZV9hZGRyKGNoaWxkX2VwKTsNCisJZ2V0X3JlbW90ZV9hZGRyKHBhcmVudF9lcCwgY2hpbGRf
ZXApOw0KIA0KIAljNGl3X2dldF9lcCgmcGFyZW50X2VwLT5jb20pOw0KIAljaGlsZF9lcC0+cGFy
ZW50X2VwID0gcGFyZW50X2VwOw0KDQotLQ0KVG8gdW5zdWJzY3JpYmUgZnJvbSB0aGlzIGxpc3Q6
IHNlbmQgdGhlIGxpbmUgInVuc3Vic2NyaWJlIGxpbnV4LXJkbWEiIGluIHRoZSBib2R5IG9mIGEg
bWVzc2FnZSB0byBtYWpvcmRvbW9Admdlci5rZXJuZWwub3JnIE1vcmUgbWFqb3Jkb21vIGluZm8g
YXQgIGh0dHA6Ly92Z2VyLmtlcm5lbC5vcmcvbWFqb3Jkb21vLWluZm8uaHRtbA0K
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nikolova, Tatyana E May 7, 2015, 8:23 p.m. UTC | #3
Reviewed-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>

On Thu, May 07, 2015 at 09:52:24AM -0500, Steve Wise wrote:
> For listening endpoints bound to the wildcard address, we need to pass
> the wildcard address mapping to iwpm_get_remote_info() instead of the
> mapped address of the new child connection.
> 
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
>  drivers/infiniband/hw/cxgb4/cm.c |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
> index bb95a6c..3ad8dc7 100644
> --- a/drivers/infiniband/hw/cxgb4/cm.c
> +++ b/drivers/infiniband/hw/cxgb4/cm.c
> @@ -583,18 +583,18 @@ static void c4iw_record_pm_msg(struct c4iw_ep *ep,
>  		sizeof(ep->com.mapped_remote_addr));
>  }
>  
> -static int get_remote_addr(struct c4iw_ep *ep)
> +static int get_remote_addr(struct c4iw_ep *parent_ep, struct c4iw_ep *child_ep)
>  {
>  	int ret;
>  
> -	print_addr(&ep->com, __func__, "get_remote_addr");
> +	print_addr(&parent_ep->com, __func__, "get_remote_addr parent_ep ");
> +	print_addr(&child_ep->com, __func__, "get_remote_addr child_ep ");
>  
> -	ret = iwpm_get_remote_info(&ep->com.mapped_local_addr,
> -				   &ep->com.mapped_remote_addr,
> -				   &ep->com.remote_addr, RDMA_NL_C4IW);
> +	ret = iwpm_get_remote_info(&parent_ep->com.mapped_local_addr,
> +				   &child_ep->com.mapped_remote_addr,
> +				   &child_ep->com.remote_addr, RDMA_NL_C4IW);
>  	if (ret)
> -		pr_info(MOD "Unable to find remote peer addr info - err %d\n",
> -			ret);
> +		PDBG("Unable to find remote peer addr info - err %d\n", ret);
>  
>  	return ret;
>  }
> @@ -2420,7 +2420,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
>  	}
>  	memcpy(&child_ep->com.remote_addr, &child_ep->com.mapped_remote_addr,
>  	       sizeof(child_ep->com.remote_addr));
> -	get_remote_addr(child_ep);
> +	get_remote_addr(parent_ep, child_ep);
>  
>  	c4iw_get_ep(&parent_ep->com);
>  	child_ep->parent_ep = parent_ep;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe May 7, 2015, 8:45 p.m. UTC | #4
On Thu, May 07, 2015 at 09:52:24AM -0500, Steve Wise wrote:
> For listening endpoints bound to the wildcard address, we need to pass
> the wildcard address mapping to iwpm_get_remote_info() instead of the
> mapped address of the new child connection.

It would be nice to see a discussion about what bug this fixes in the
commit message...

So we can answer the question: Does this need to go to -stable?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Wise May 7, 2015, 9 p.m. UTC | #5
On 5/7/2015 3:45 PM, Jason Gunthorpe wrote:
> On Thu, May 07, 2015 at 09:52:24AM -0500, Steve Wise wrote:
>> For listening endpoints bound to the wildcard address, we need to pass
>> the wildcard address mapping to iwpm_get_remote_info() instead of the
>> mapped address of the new child connection.
> It would be nice to see a discussion about what bug this fixes in the
> commit message...
>
> So we can answer the question: Does this need to go to -stable?
>

Without this fix, and with iwarp port mapping enabled, each iw_cxgb4 
connection that is spawned from a listening endpoint bound to the 
wildcard address, will generate an annoying dmesg entry about failing to 
find the remote address mapping info, and the connection state displayed 
in debugfs under /sys/kernel/debug/iw_cxgb4/<pci-slot-no>/eps  will not 
have the peer's address/port mapping info.  The connection still works 
though.

This does not need to hit stable because the remote_info logic was just 
added in 4.1 with:
---
commit 5b6b8fe64053b2649660ded2f3c5be25ebddbfdb
Author: Steve Wise <swise@opengridcomputing.com>
Date:   Tue Apr 21 16:28:41 2015 -0400

     RDMA/cxgb4: Report the actual address of the remote connecting peer
---


Doug, shall I resend the patch with an updated comment?

Steve.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe May 7, 2015, 9:09 p.m. UTC | #6
On Thu, May 07, 2015 at 04:00:50PM -0500, Steve Wise wrote:

> This does not need to hit stable because the remote_info logic was
> just added in 4.1 with:

> commit 5b6b8fe64053b2649660ded2f3c5be25ebddbfdb
> Author: Steve Wise <swise@opengridcomputing.com>
> Date:   Tue Apr 21 16:28:41 2015 -0400
> 
>     RDMA/cxgb4: Report the actual address of the remote connecting peer
> 
> 
> Doug, shall I resend the patch with an updated comment?

I would, you also need to supply a Fixes tag anyhow, and there should
have been a brief note after '--' that this is a bug fix for 4.1 so it
gets prioritized and doesn't wait for the next merge window.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index bb95a6c..3ad8dc7 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -583,18 +583,18 @@  static void c4iw_record_pm_msg(struct c4iw_ep *ep,
 		sizeof(ep->com.mapped_remote_addr));
 }
 
-static int get_remote_addr(struct c4iw_ep *ep)
+static int get_remote_addr(struct c4iw_ep *parent_ep, struct c4iw_ep *child_ep)
 {
 	int ret;
 
-	print_addr(&ep->com, __func__, "get_remote_addr");
+	print_addr(&parent_ep->com, __func__, "get_remote_addr parent_ep ");
+	print_addr(&child_ep->com, __func__, "get_remote_addr child_ep ");
 
-	ret = iwpm_get_remote_info(&ep->com.mapped_local_addr,
-				   &ep->com.mapped_remote_addr,
-				   &ep->com.remote_addr, RDMA_NL_C4IW);
+	ret = iwpm_get_remote_info(&parent_ep->com.mapped_local_addr,
+				   &child_ep->com.mapped_remote_addr,
+				   &child_ep->com.remote_addr, RDMA_NL_C4IW);
 	if (ret)
-		pr_info(MOD "Unable to find remote peer addr info - err %d\n",
-			ret);
+		PDBG("Unable to find remote peer addr info - err %d\n", ret);
 
 	return ret;
 }
@@ -2420,7 +2420,7 @@  static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
 	}
 	memcpy(&child_ep->com.remote_addr, &child_ep->com.mapped_remote_addr,
 	       sizeof(child_ep->com.remote_addr));
-	get_remote_addr(child_ep);
+	get_remote_addr(parent_ep, child_ep);
 
 	c4iw_get_ep(&parent_ep->com);
 	child_ep->parent_ep = parent_ep;