All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: Xiaolong Ye <xiaolong.ye@intel.com>
Cc: Thomas Monjalon <thomas@monjalon.net>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>,
	dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 3/5] mbuf: fix free_space setting for dynamic field
Date: Thu, 25 Jun 2020 17:53:36 +0200	[thread overview]
Message-ID: <20200625155336.GR12564@platinum> (raw)
In-Reply-To: <20200613154922.42379-4-xiaolong.ye@intel.com>

On Sat, Jun 13, 2020 at 11:49:19PM +0800, Xiaolong Ye wrote:
> The value free_space[i] is used to save the size of biggest aligned
> element that can fit in the zone, current implementation has one flaw,
> for example, if user registers dynfield1 (size = 4, align = 4, req = 124)
> first, the free_space would be as below after registration:
> 
>   0070: 08 08 08 08 08 08 08 08
>   0078: 08 08 08 08 00 00 00 00
> 
> Then if user continues to register dynfield2 (size = 4, align = 4),
> free_space would become:
> 
>   0070: 00 00 00 00 04 04 04 04
>   0078: 04 04 04 04 00 00 00 00
> 
> Further request dynfield3 (size = 8, align = 8) would fail to register
> due to alignment requirement can't be satisfied, though there is enough
> space remained in mbuf.
> 
> This patch fixes above issue by saving alignment only in aligned zone,
> after the fix, above registrations order can be satisfied, free_space
> would be like:
> 
> After dynfield1 registration:
> 
>   0070: 08 08 08 08 08 08 08 08
>   0078: 04 04 04 04 00 00 00 00
> 
> After dynfield2 registration:
> 
>   0070: 08 08 08 08 08 08 08 08
>   0078: 00 00 00 00 00 00 00 00
> 
> After dynfield3 registration:
> 
>   0070: 00 00 00 00 00 00 00 00
>   0078: 00 00 00 00 00 00 00 00
> 
> This patch also reduces iterations in process_score() by jumping align
> steps in each loop.
> 
> Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>

Acked-by: Olivier Matz <olivier.matz@6wind.com>

Thanks!

  reply	other threads:[~2020-06-25 15:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-13 15:49 [dpdk-dev] [PATCH 0/5] small fixes for mbuf's dynamic field/flag feature Xiaolong Ye
2020-06-13 15:49 ` [dpdk-dev] [PATCH 1/5] mbuf: fix out-of-bounds access at dyn field register Xiaolong Ye
2020-06-13 15:49 ` [dpdk-dev] [PATCH 2/5] mbuf: fix missing errno for dyn field/flag registration Xiaolong Ye
2020-06-25 15:31   ` Olivier Matz
2020-06-13 15:49 ` [dpdk-dev] [PATCH 3/5] mbuf: fix free_space setting for dynamic field Xiaolong Ye
2020-06-25 15:53   ` Olivier Matz [this message]
2020-06-13 15:49 ` [dpdk-dev] [PATCH 4/5] mbuf: fix a dynamic field dump log Xiaolong Ye
2020-06-25 15:54   ` Olivier Matz
2020-06-13 15:49 ` [dpdk-dev] [PATCH 5/5] mbuf: support to dump free_flags for dynamic flag Xiaolong Ye
2020-06-25 15:55   ` Olivier Matz
2020-06-25 20:40 ` [dpdk-dev] [PATCH 0/5] small fixes for mbuf's dynamic field/flag feature Thomas Monjalon

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=20200625155336.GR12564@platinum \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=xiaolong.ye@intel.com \
    /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 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.