From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id DB4FF1075 for ; Tue, 14 Mar 2017 17:11:15 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id n11so574624wma.0 for ; Tue, 14 Mar 2017 09:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=50nuj740AULmCYb96ZtAliI9vyyi6bQvj7Xwf1nwXuw=; b=PwQI4y0de7pt7CSvefspHsHT8iWAvLjLZOA5wUZcahk7Am/jU7ZoGMNn6lc1T2iQkx DzuSHeiEoQjIYnGYZ+70fMOhb4XTwTm6eD399hv+Yqh304lFjS3+0Pq5FvFlkOjz76AY dGjiuirCaToFraI/GZBMY5T0N7J8FoOisG3DOa4uYMGftG7k0EMDYjSX11FrDa+/iY8j LLC/TMBeqQ+iKojaYcqTiTE7rDrhOSaGEQRELz5+i1SteU0V94jgPGGBSPkNee+3uGvN +G2VzfkHOyV3BgNQK9BIu37hiD1v4PqxaPpZ4iI+0ha1aJJfe914K+tGWlRiK5q2ejGl 9fIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=50nuj740AULmCYb96ZtAliI9vyyi6bQvj7Xwf1nwXuw=; b=Pd2bHAlR8SknuD3OCjHAJO4kNSw1jatrw8ZRYhYfjP3x9QzADP6OCLUfVFKKFWqrMq Eaw7t8DGSt+ZOSaP3mrKlFQwJ74xpozSgWv7EUyoX4VCTVBqN+2zislQ7/GnI9bX4Rra jMryldUQPRA9KI09gkN0/XWSqMMahVA09yiKup3I9OL8EGqJJMjdgIt9BYDz1pjVDr0h AAZEavuIJvL+QLpQ6062Nkn/RGTyKc6lXUtAIIuikkBT4v79+b6W3QklJWIW6/dVQXv4 wPWKw4ML9ad5X/sQ9IiD+jhWDaqfndHGDQ68dyoavpw9FVkuKdSyPpruPlYJ0QoQMkPE 2IxQ== X-Gm-Message-State: AFeK/H359Ab46p+QVuhofRtIzczqSTzp62mBX+WQiV31foEBmZx6VWpoZ58O3XtWWX0PDCK0jk5duneT/tN3uA== X-Received: by 10.28.135.82 with SMTP id j79mr15386009wmd.19.1489507875595; Tue, 14 Mar 2017 09:11:15 -0700 (PDT) MIME-Version: 1.0 Sender: jblunck@gmail.com Received: by 10.28.211.20 with HTTP; Tue, 14 Mar 2017 09:11:15 -0700 (PDT) In-Reply-To: <1489444915-3660-1-git-send-email-ciwillia@brocade.com> References: <1489444915-3660-1-git-send-email-ciwillia@brocade.com> From: Jan Blunck Date: Tue, 14 Mar 2017 17:11:15 +0100 X-Google-Sender-Auth: SZvDtXtETJ5RzsyNw0aUsAbhfFo Message-ID: To: "Charles (Chas) Williams" Cc: dev , yongwang@vmware.com Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [PATCH] net/vmxnet3: fix queue size changes 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: , X-List-Received-Date: Tue, 14 Mar 2017 16:11:16 -0000 On Mon, Mar 13, 2017 at 11:41 PM, Charles (Chas) Williams wrote: > If the user reconfigures the queues size, then the previosly allocated > memzone may potentially be too small. Instead, always free the old > memzone and allocate a new one. > > Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation") > > Signed-off-by: Chas Williams > --- > drivers/net/vmxnet3/vmxnet3_rxtx.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c > index 6649c3f..104e040 100644 > --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c > +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c > @@ -893,8 +893,8 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) > > /* > * Create memzone for device rings. malloc can't be used as the physical address is > - * needed. If the memzone is already created, then this function returns a ptr > - * to the old one. > + * needed. If the memzone already exists, we free it since it may have been created > + * with a different size. > */ > static const struct rte_memzone * > ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name, > @@ -909,7 +909,7 @@ ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name, > > mz = rte_memzone_lookup(z_name); > if (mz) > - return mz; > + rte_memzone_free(mz); > > return rte_memzone_reserve_aligned(z_name, ring_size, > socket_id, 0, VMXNET3_RING_BA_ALIGN); Chas, Thanks for hunting this one down. Wouldn't the rte_memzone_free() better fit into vmxnet3_cmd_ring_release() ? Also the ring_dma_zone_reserve() could get replaced by rte_eth_dma_zone_reserve() (see also http://dpdk.org/dev/patchwork/patch/21432/).