public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: e.kubanski <e.kubanski@partner.samsung.com>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<bjorn@kernel.org>, <magnus.karlsson@intel.com>,
	<jonathan.lemon@gmail.com>
Subject: Re: [PATCH] xsk: Fix offset calculation in unaligned mode
Date: Thu, 10 Apr 2025 14:50:25 +0200	[thread overview]
Message-ID: <Z/e+kei/tJfDkjN4@boxer> (raw)
In-Reply-To: <20250409131913.65179-1-e.kubanski@partner.samsung.com>

On Wed, Apr 09, 2025 at 03:19:13PM +0200, e.kubanski wrote:
> Offset calculation in unaligned mode didn't
> match previous behaviour.
> 
> Unaligned mode should pass offset only in
> upper 16 bits, lower 48 bits should pass
> only specific chunk location in umem.
> 
> pool->headroom was duplicated into offset
> and address of the umem chunk.

Thanks! Same what Magnus commented, you need to target the patch to bpf
tree and provide a fixes tag. Here's the format that we expect:

Fixes: bea14124bacb ("xsk: Get rid of xdp_buff_xsk::orig_addr")

and it actually is the blamed commit for this fix, so just paste it to
commit message.

Also, we prefer to use imperative mood in commit descriptions. Go through
https://docs.kernel.org/process/submitting-patches.html.

> 
> Signed-off-by: Eryk Kubanski <e.kubanski@partner.samsung.com>
> ---
>  include/net/xsk_buff_pool.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/net/xsk_buff_pool.h b/include/net/xsk_buff_pool.h
> index 7f0a75d6563d..b3699a848844 100644
> --- a/include/net/xsk_buff_pool.h
> +++ b/include/net/xsk_buff_pool.h
> @@ -232,8 +232,8 @@ static inline u64 xp_get_handle(struct xdp_buff_xsk *xskb,
>  		return orig_addr;
>  
>  	offset = xskb->xdp.data - xskb->xdp.data_hard_start;
> -	orig_addr -= offset;
>  	offset += pool->headroom;
> +	orig_addr -= offset;
>  	return orig_addr + (offset << XSK_UNALIGNED_BUF_OFFSET_SHIFT);
>  }
>  
> -- 
> 2.34.1
> 

      reply	other threads:[~2025-04-10 12:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250409131930eucas1p22b304bf5924a9b3bc43a442d738ebef3@eucas1p2.samsung.com>
2025-04-09 13:19 ` [PATCH] xsk: Fix offset calculation in unaligned mode e.kubanski
2025-04-10 12:50   ` Maciej Fijalkowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z/e+kei/tJfDkjN4@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=bjorn@kernel.org \
    --cc=e.kubanski@partner.samsung.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox