From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D61E3A0350 for ; Thu, 25 Jun 2020 17:53:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BAD1CCF3; Thu, 25 Jun 2020 17:53:38 +0200 (CEST) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 4C682CF3 for ; Thu, 25 Jun 2020 17:53:37 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id f139so6453982wmf.5 for ; Thu, 25 Jun 2020 08:53:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oGzHleBsxS56CTVrBbqh/U3Ckwi9yJNSV2N8Y1NQlTo=; b=BgaV2xtukMbfE9roswBGJQia6lbbu1c6DcTugLtGtStHGcCEAcMphQwG7fGgPs1oXz VWUtdrw1ZeKDrIf9tZNvMclb7FmNrs5AybyMTJx90Ohs9EoYcOTxaIoCXH/tuMbc9Vea 7WKRhAXduDMMiaiRSp8qOrW3O1JbPvi+FCk8hMOOqfbfRzQyP6JzjOuDe3W1Zr4vugMD c+ddUvrpBOj4GRScn+pNLDkQMisb8RGfnlv1bm5mC9kNd6zhgja3zfxVCRHG71fmnIPH ZKVMeZcya4aSc7Tysr0+1P3MTLBz+BtsllC8Tz7ePmNkRoHB+5EgyOqTKC7ERmg+cl/i EYdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oGzHleBsxS56CTVrBbqh/U3Ckwi9yJNSV2N8Y1NQlTo=; b=SWQofDnk+1czUScTVoM6eP6LanOPErjir2BtLvCWZe7C6rp5monwk7eq4HIfHDDjEH yJdN6oNnHfsYUWcNjT7iVtJL+2Bnh5pEIWyOSNU/5yQzNP8gZBfru1AIED+LI78SfSyj jECvOq+Pknv+zolxQxCXWv05k7M3bpxAQ7psBef8ec9q1maJKJIRAnA2qy1Z+dJ2kI9k EaDCRtFViVA2cigX3xFEqV3mfoplTo/OPvlHfTg1NnqywU+izmZobjVDDb/SJOM+5xff JrGwaPWPVh3EsKDQdrO5tkYP8g4qTUDjh1B92FrW2cEZ7bjwpkuIp3OcFzp8q5p83pjS 4tUQ== X-Gm-Message-State: AOAM532nAlsH8VB+hoJeVF/SqLmsyjd38PdP3Ln9dDyRljR3biProYRC rN7qRjN/f7t3GM/I/nnfOB1dZA== X-Google-Smtp-Source: ABdhPJyCggN2KS2c8raO3F8N2A7ZwAA3+2wMNEDndN023lT99noJklCS+m2vFF71XCaxXBYmlyg8nQ== X-Received: by 2002:a1c:48d:: with SMTP id 135mr4202442wme.102.1593100417008; Thu, 25 Jun 2020 08:53:37 -0700 (PDT) Received: from 6wind.com (2a01cb0c0005a600345636f7e65ed1a0.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:3456:36f7:e65e:d1a0]) by smtp.gmail.com with ESMTPSA id g144sm15294200wme.2.2020.06.25.08.53.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 08:53:36 -0700 (PDT) Date: Thu, 25 Jun 2020 17:53:36 +0200 From: Olivier Matz To: Xiaolong Ye Cc: Thomas Monjalon , Konstantin Ananyev , dev@dpdk.org, stable@dpdk.org Message-ID: <20200625155336.GR12564@platinum> References: <20200613154922.42379-1-xiaolong.ye@intel.com> <20200613154922.42379-4-xiaolong.ye@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200613154922.42379-4-xiaolong.ye@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-stable] [PATCH 3/5] mbuf: fix free_space setting for dynamic field X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 Acked-by: Olivier Matz Thanks!