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 2CC92A00BE; Mon, 8 Jun 2020 09:50:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C3D3A1BE8A; Mon, 8 Jun 2020 09:50:14 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 942601BE81 for ; Mon, 8 Jun 2020 09:50:12 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id j10so16256597wrw.8 for ; Mon, 08 Jun 2020 00:50:12 -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=GO+7wiX4DF1syIShkGDlTq2rer/hI9yBExQwew/Jx48=; b=URNU1lm6SVK9rmZ3qiXCX1BvRH5LKI+Aha5QVQcFopAP+cA7W9EdWbQbadVugAufA4 hUhqWyp/hVslUeLAROr7ZAluudmAiLodnYNQ1s7ZO4wjwKgsdFw7QGJgLEx6HCGIqQx3 a6CYoykuWRFqnEXkBXb3fIxYJTUM1mGBVJFXaIWdOw75dcVlyR5rqRwmdkZ87nzTX/FN SGOxdlc9r42p/VyXOus9bPMkc2Cih+aI/jVP25h6H5Mbigm1ticKxs4gOkOj52DhowXk hMGpnd179FmDCzRD71bX131A80pg6PNp5qe939aRST3JIQWmj80mooBGyal2EuwTWTJ5 F3/A== 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=GO+7wiX4DF1syIShkGDlTq2rer/hI9yBExQwew/Jx48=; b=HsFianU9cP4m/notFE14lEC1XrCG3/OQYtMaR9KSq3qJADbOXQDgQuc2gLT2tfXWk2 Iysub6B4LQsOfcMaNPsW9bNdddZ6BsSOrof6bLjdO9jGebEeBmWFtNwIdjK98gZqJFTH A8cdNke6SXqVDq3ti1YJmGU345GFvBVDC+bxM3HZ1GOa0FGtQLVN2WPHs40ZhIbVvDQW 7zBSKpveiUy4xgrzqx1VQfEqs5TPs0ckGoEgu9AvzruNKrd9sAxezXZJifUCGrAMODXG mPuc7/ZnDI7cIlpK8e+8WrILLM0rVUiJ60sjl36TIEpyPhrB4tdvvjhR1qrZRvtq+CKH tfYQ== X-Gm-Message-State: AOAM530VKQvUM8hcAZSMVe6NKYe3sEct9inc/0q0QdDREUmjnPax+ufN mK6txKx/0rDg89229Z+4HYWovg== X-Google-Smtp-Source: ABdhPJyeuuKF1AYs0VAzAesy4wW56+QRYjNAJXlpwKo2i2ijADYGzsYOKqlJjZzCByfg5NfKpfa97A== X-Received: by 2002:adf:f64e:: with SMTP id x14mr23122792wrp.426.1591602612272; Mon, 08 Jun 2020 00:50:12 -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 o9sm21362907wmh.37.2020.06.08.00.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 00:50:11 -0700 (PDT) Date: Mon, 8 Jun 2020 09:50:11 +0200 From: Olivier Matz To: Alexander Kozyrev Cc: dev@dpdk.org, stable@dpdk.org, rasland@mellanox.com, viacheslavo@mellanox.com Message-ID: <20200608075011.GN12564@platinum> References: <1591025056-16031-1-git-send-email-akozyrev@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1591025056-16031-1-git-send-email-akozyrev@mellanox.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH] mbuf: fix external mbufs pool boundaries X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Jun 01, 2020 at 03:24:16PM +0000, Alexander Kozyrev wrote: > Memzones are created in testpmd in order to test external data > buffers functionality. Each memzone is 2Mb in size and divided among > the pool of external memory buffers. > > Memzone may not always be fully utilized because mbufs size can vary > and some space can be left unused at the tail of a memzone. This is > not handled properly and mbuf can get the address of this leftover > space since this address is still valid (part of memzone), but there > is not enough space to fit the whole packet data. As a result packet > data may overflow and cause the memory corruption. > > Take mbuf size into account when distributing memory addresses from > a memzone to external mbufs. Skip the remaining tail in case there > is not enough room for a packet and move to a next memzone instead. > > Fixes: 6c8e50c2e5 ("mbuf: create pool with external memory buffers") > Cc: stable@dpdk.org > Signed-off-by: Alexander Kozyrev > Acked-by: Viacheslav Ovsiienko Acked-by: Olivier Matz Thanks!