Linux-RDMA Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH for next] RDMA/rxe: Fix small problem in network_type patch
@ 2020-10-16 20:26 Bob Pearson
  2020-10-16 20:33 ` Jason Gunthorpe
  0 siblings, 1 reply; 3+ messages in thread
From: Bob Pearson @ 2020-10-16 20:26 UTC (permalink / raw)
  To: jgg, zyjzyj2000, linux-rdma; +Cc: Bob Pearson

The patch referenced below has a typo that results in using the wrong
L2 header size for outbound traffic. (V4 <-> V6).

It also breaks RC traffic because they use AVs that use RDMA_NETWORK_XXX
enums instead of RXE_NETWORK_TYPE_XXX enums. Fis this by making the
encodings the same between these different types.

Fixes: e0d696d201dd ("RDMA/rxe: Move the definitions for rxe_av.network_type to
		       uAPI")
Signed-off-by: Bob Pearson <rpearson@hpe.com>
---
 drivers/infiniband/sw/rxe/rxe_net.c | 2 +-
 include/uapi/rdma/rdma_user_rxe.h   | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index 575e1a4ec821..34bef7d8e6b4 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -442,7 +442,7 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
 	if (IS_ERR(attr))
 		return NULL;
 
-	if (av->network_type == RXE_NETWORK_TYPE_IPV6)
+	if (av->network_type == RXE_NETWORK_TYPE_IPV4)
 		hdr_len = ETH_HLEN + sizeof(struct udphdr) +
 			sizeof(struct iphdr);
 	else
diff --git a/include/uapi/rdma/rdma_user_rxe.h b/include/uapi/rdma/rdma_user_rxe.h
index e591d8c1f3cf..ce430d3dceaf 100644
--- a/include/uapi/rdma/rdma_user_rxe.h
+++ b/include/uapi/rdma/rdma_user_rxe.h
@@ -40,8 +40,9 @@
 #include <linux/in6.h>
 
 enum {
-	RXE_NETWORK_TYPE_IPV4 = 1,
-	RXE_NETWORK_TYPE_IPV6 = 2,
+	/* good reasons to make same as RDMA_NETWORK_XXX */
+	RXE_NETWORK_TYPE_IPV4 = 2,
+	RXE_NETWORK_TYPE_IPV6 = 3,
 };
 
 union rxe_gid {
-- 
2.25.1


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

* Re: [PATCH for next] RDMA/rxe: Fix small problem in network_type patch
  2020-10-16 20:26 [PATCH for next] RDMA/rxe: Fix small problem in network_type patch Bob Pearson
@ 2020-10-16 20:33 ` Jason Gunthorpe
  2020-10-16 21:14   ` Bob Pearson
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2020-10-16 20:33 UTC (permalink / raw)
  To: Bob Pearson; +Cc: zyjzyj2000, linux-rdma, Bob Pearson

On Fri, Oct 16, 2020 at 03:26:46PM -0500, Bob Pearson wrote:
> The patch referenced below has a typo that results in using the wrong
> L2 header size for outbound traffic. (V4 <-> V6).
> 
> It also breaks RC traffic because they use AVs that use RDMA_NETWORK_XXX
> enums instead of RXE_NETWORK_TYPE_XXX enums. Fis this by making the
> encodings the same between these different types.
> 
> Fixes: e0d696d201dd ("RDMA/rxe: Move the definitions for rxe_av.network_type to
> 		       uAPI")

Don't word wrap these

> Signed-off-by: Bob Pearson <rpearson@hpe.com>
>  drivers/infiniband/sw/rxe/rxe_net.c | 2 +-
>  include/uapi/rdma/rdma_user_rxe.h   | 5 +++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
> index 575e1a4ec821..34bef7d8e6b4 100644
> +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> @@ -442,7 +442,7 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
>  	if (IS_ERR(attr))
>  		return NULL;
>  
> -	if (av->network_type == RXE_NETWORK_TYPE_IPV6)
> +	if (av->network_type == RXE_NETWORK_TYPE_IPV4)
>  		hdr_len = ETH_HLEN + sizeof(struct udphdr) +
>  			sizeof(struct iphdr);
>  	else
> diff --git a/include/uapi/rdma/rdma_user_rxe.h b/include/uapi/rdma/rdma_user_rxe.h
> index e591d8c1f3cf..ce430d3dceaf 100644
> +++ b/include/uapi/rdma/rdma_user_rxe.h
> @@ -40,8 +40,9 @@
>  #include <linux/in6.h>
>  
>  enum {
> -	RXE_NETWORK_TYPE_IPV4 = 1,
> -	RXE_NETWORK_TYPE_IPV6 = 2,
> +	/* good reasons to make same as RDMA_NETWORK_XXX */
> +	RXE_NETWORK_TYPE_IPV4 = 2,
> +	RXE_NETWORK_TYPE_IPV6 = 3,
>  };

No just transcode them in the only place that matters, we still can't
break userspace

Jason

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

* Re: [PATCH for next] RDMA/rxe: Fix small problem in network_type patch
  2020-10-16 20:33 ` Jason Gunthorpe
@ 2020-10-16 21:14   ` Bob Pearson
  0 siblings, 0 replies; 3+ messages in thread
From: Bob Pearson @ 2020-10-16 21:14 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: zyjzyj2000, linux-rdma, Bob Pearson

On 10/16/20 3:33 PM, Jason Gunthorpe wrote:
> On Fri, Oct 16, 2020 at 03:26:46PM -0500, Bob Pearson wrote:
>> The patch referenced below has a typo that results in using the wrong
>> L2 header size for outbound traffic. (V4 <-> V6).
>>
>> It also breaks RC traffic because they use AVs that use RDMA_NETWORK_XXX
>> enums instead of RXE_NETWORK_TYPE_XXX enums. Fis this by making the
>> encodings the same between these different types.
>>
>> Fixes: e0d696d201dd ("RDMA/rxe: Move the definitions for rxe_av.network_type to
>> 		       uAPI")
> 
> Don't word wrap these
> 
>> Signed-off-by: Bob Pearson <rpearson@hpe.com>
>>  drivers/infiniband/sw/rxe/rxe_net.c | 2 +-
>>  include/uapi/rdma/rdma_user_rxe.h   | 5 +++--
>>  2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
>> index 575e1a4ec821..34bef7d8e6b4 100644
>> +++ b/drivers/infiniband/sw/rxe/rxe_net.c
>> @@ -442,7 +442,7 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
>>  	if (IS_ERR(attr))
>>  		return NULL;
>>  
>> -	if (av->network_type == RXE_NETWORK_TYPE_IPV6)
>> +	if (av->network_type == RXE_NETWORK_TYPE_IPV4)
>>  		hdr_len = ETH_HLEN + sizeof(struct udphdr) +
>>  			sizeof(struct iphdr);
>>  	else
>> diff --git a/include/uapi/rdma/rdma_user_rxe.h b/include/uapi/rdma/rdma_user_rxe.h
>> index e591d8c1f3cf..ce430d3dceaf 100644
>> +++ b/include/uapi/rdma/rdma_user_rxe.h
>> @@ -40,8 +40,9 @@
>>  #include <linux/in6.h>
>>  
>>  enum {
>> -	RXE_NETWORK_TYPE_IPV4 = 1,
>> -	RXE_NETWORK_TYPE_IPV6 = 2,
>> +	/* good reasons to make same as RDMA_NETWORK_XXX */
>> +	RXE_NETWORK_TYPE_IPV4 = 2,
>> +	RXE_NETWORK_TYPE_IPV6 = 3,
>>  };
> 
> No just transcode them in the only place that matters, we still can't
> break userspace
> 
> Jason
> 

done. You should have it.

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16 20:26 [PATCH for next] RDMA/rxe: Fix small problem in network_type patch Bob Pearson
2020-10-16 20:33 ` Jason Gunthorpe
2020-10-16 21:14   ` Bob Pearson

Linux-RDMA Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rdma/0 linux-rdma/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rdma linux-rdma/ https://lore.kernel.org/linux-rdma \
		linux-rdma@vger.kernel.org
	public-inbox-index linux-rdma

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rdma


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git