All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 net-next] mlx5: Set AF_XDP data pointer correctly.
@ 2019-04-17 19:56 Jonathan Lemon
  2019-04-17 19:56 ` [PATCH 2/2 net-next] mlx5: Adjust handle based on xdp values Jonathan Lemon
  2019-04-18  9:11 ` [PATCH 1/2 net-next] mlx5: Set AF_XDP data pointer correctly Maxim Mikityanskiy
  0 siblings, 2 replies; 4+ messages in thread
From: Jonathan Lemon @ 2019-04-17 19:56 UTC (permalink / raw)
  To: netdev; +Cc: maximmi, kernel-team

data starts at handle + headroom, so adjust appropriately.

Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
index 2f0b5fd1ee97..e758f1015022 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
@@ -290,7 +290,8 @@ int mlx5e_xsk_page_alloc_umem(struct mlx5e_rq *rq,
 		return -ENOMEM;
 
 	dma_info->xsk.handle = handle + rq->buff.umem_headroom;
-	dma_info->xsk.data = xdp_umem_get_data(umem, handle);
+	dma_info->xsk.data = xdp_umem_get_data(umem, handle) +
+			     rq->buff.umem_headroom;
 
 	/* No need to add headroom to the DMA address. In striding RQ case, we
 	 * just provide pages for UMR, and headroom is counted at the setup
-- 
2.17.1


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

* [PATCH 2/2 net-next] mlx5: Adjust handle based on xdp values.
  2019-04-17 19:56 [PATCH 1/2 net-next] mlx5: Set AF_XDP data pointer correctly Jonathan Lemon
@ 2019-04-17 19:56 ` Jonathan Lemon
  2019-04-18  9:11 ` [PATCH 1/2 net-next] mlx5: Set AF_XDP data pointer correctly Maxim Mikityanskiy
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Lemon @ 2019-04-17 19:56 UTC (permalink / raw)
  To: netdev; +Cc: maximmi, kernel-team

bpf_prog_run_xdp() may change the start/length values in xdp.
Adjust the umem handle so it reflects the possibly updated values.

Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
index 78f39af8541f..9ae1eb8239e7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
@@ -115,7 +115,7 @@ bool mlx5e_xdp_handle(struct mlx5e_rq *rq, struct mlx5e_dma_info *di,
 
 	act = bpf_prog_run_xdp(prog, &xdp);
 	if (xsk)
-		xdp.handle = di->xsk.handle + *rx_headroom;
+		xdp.handle += xdp.data - xdp.data_hard_start;
 	switch (act) {
 	case XDP_PASS:
 		*rx_headroom = xdp.data - xdp.data_hard_start;
-- 
2.17.1


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

* Re: [PATCH 1/2 net-next] mlx5: Set AF_XDP data pointer correctly.
  2019-04-17 19:56 [PATCH 1/2 net-next] mlx5: Set AF_XDP data pointer correctly Jonathan Lemon
  2019-04-17 19:56 ` [PATCH 2/2 net-next] mlx5: Adjust handle based on xdp values Jonathan Lemon
@ 2019-04-18  9:11 ` Maxim Mikityanskiy
  2019-04-18 16:07   ` Jonathan Lemon
  1 sibling, 1 reply; 4+ messages in thread
From: Maxim Mikityanskiy @ 2019-04-18  9:11 UTC (permalink / raw)
  To: Jonathan Lemon, netdev; +Cc: kernel-team

On 2019-04-17 22:56, Jonathan Lemon wrote:
> data starts at handle + headroom, so adjust appropriately.
> 
> Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
> ---
>   drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
> index 2f0b5fd1ee97..e758f1015022 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
> @@ -290,7 +290,8 @@ int mlx5e_xsk_page_alloc_umem(struct mlx5e_rq *rq,
>   		return -ENOMEM;
>   
>   	dma_info->xsk.handle = handle + rq->buff.umem_headroom;
> -	dma_info->xsk.data = xdp_umem_get_data(umem, handle);
> +	dma_info->xsk.data = xdp_umem_get_data(umem, handle) +
> +			     rq->buff.umem_headroom;
>   
>   	/* No need to add headroom to the DMA address. In striding RQ case, we
>   	 * just provide pages for UMR, and headroom is counted at the setup
> 

This code is not upstreamed yet, please hold on with sending patches to 
netdev. You are not even working with the latest codebase. You shouldn't 
have exposed it before the submission. Please refrain from doing it for now.

If you have fixes like this, I'm happy to hear from you, but please 
provide your feedback internally. Your fixes may not apply cleanly, 
because I'm constantly updating the code, or these issues may be already 
fixed in the code that you haven't seen yet, so let's sync internally 
before it goes upstream.

Thanks,
Max

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

* Re: [PATCH 1/2 net-next] mlx5: Set AF_XDP data pointer correctly.
  2019-04-18  9:11 ` [PATCH 1/2 net-next] mlx5: Set AF_XDP data pointer correctly Maxim Mikityanskiy
@ 2019-04-18 16:07   ` Jonathan Lemon
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Lemon @ 2019-04-18 16:07 UTC (permalink / raw)
  To: Maxim Mikityanskiy; +Cc: netdev, kernel-team



On 18 Apr 2019, at 2:11, Maxim Mikityanskiy wrote:

> On 2019-04-17 22:56, Jonathan Lemon wrote:
>> data starts at handle + headroom, so adjust appropriately.
>>
>> Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
>> ---
>>   drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c 
>> b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
>> index 2f0b5fd1ee97..e758f1015022 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
>> @@ -290,7 +290,8 @@ int mlx5e_xsk_page_alloc_umem(struct mlx5e_rq 
>> *rq,
>>   		return -ENOMEM;
>>
>>   	dma_info->xsk.handle = handle + rq->buff.umem_headroom;
>> -	dma_info->xsk.data = xdp_umem_get_data(umem, handle);
>> +	dma_info->xsk.data = xdp_umem_get_data(umem, handle) +
>> +			     rq->buff.umem_headroom;
>>
>>   	/* No need to add headroom to the DMA address. In striding RQ 
>> case, we
>>   	 * just provide pages for UMR, and headroom is counted at the 
>> setup
>>
>
> This code is not upstreamed yet, please hold on with sending patches 
> to
> netdev. You are not even working with the latest codebase. You 
> shouldn't
> have exposed it before the submission. Please refrain from doing it 
> for now.
>
> If you have fixes like this, I'm happy to hear from you, but please
> provide your feedback internally. Your fixes may not apply cleanly,
> because I'm constantly updating the code, or these issues may be 
> already
> fixed in the code that you haven't seen yet, so let's sync internally
> before it goes upstream.

This was my mistake - unintentionally generated from the wrong tree.
Please ignore, and I'll change my workflow to prevent this from 
happening again.
-- 
Jonathan

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

end of thread, other threads:[~2019-04-18 16:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17 19:56 [PATCH 1/2 net-next] mlx5: Set AF_XDP data pointer correctly Jonathan Lemon
2019-04-17 19:56 ` [PATCH 2/2 net-next] mlx5: Adjust handle based on xdp values Jonathan Lemon
2019-04-18  9:11 ` [PATCH 1/2 net-next] mlx5: Set AF_XDP data pointer correctly Maxim Mikityanskiy
2019-04-18 16:07   ` Jonathan Lemon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.