Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3436324ybi; Tue, 2 Jul 2019 07:45:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJelWlW0nHTG7UPHszyrCB7m2VfiSuvmH3whU8MsBm7Phl86rOxALyTemBO5qm/7iKX9kZ X-Received: by 2002:a17:902:d81:: with SMTP id 1mr2190414plv.323.1562078748408; Tue, 02 Jul 2019 07:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562078748; cv=none; d=google.com; s=arc-20160816; b=mYOZeGBR+xPgAG5Yx519xR/fmPKM6IhKoCFJV4GDDyoglad4NZ3d0fL8iYUL5CAH0e LwRk5oav2NWGPnfhOlVDa8p3lsS+YVu8m6d5tD3LZldZuQX9Qkr8ZjQ2PKG7PJYMhX6i 5y3gePNWfrEk4CJ5HkgwIRjbNkTCFXterNumB56dzeY/UqMOCAN0+Jv1p4BrrAmFO7pQ jgDEwSnlIrwkEgtQyphZsfjvmSimu9YLq8YyWTfJxCIm1oQquL6Y6/EhFpckJ4lPtOQ4 EjMNO53eMK4dn4Olw40I5ApU+H3OI++fKo6lmtbfhLBm6JgcPI11S6KXX0LavqfUXvMJ o/pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=WjQyJp2iY5fGQc+V5V9CzoNmpSilM+nwtjmuAYauCEg=; b=hlWP/CM544+yGVqyCWBDnz1Hw8Ad4K5U+JalaKb0XGt8EUeEnmRGdvf9LVdxk84/Iq EPcwmonG1kHoNatxNFNUAyM2gRzMEZEiUKi7g+Jn3low3HRxM6+nD//rDmAbKdd6tlgt hXB2KdgqE5UuE4cqHzALB/wt/CWhtJeqG6TR3fWCp5StKHCN+J2eUoSuTzxL224iHDPp uVdEqHYgyfhG7Oks+F94LDTJREPXKnIglWuH/Boy/3v1IfafGg3IqNFr8pUJksp2Nl8D kt/D1zf+VmkCsWMOvC376q1WDQngMFJaqQbs2ksGitGpyvyx4RAZqApJnzxIOE4BwRQW ygww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NiF3piWS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si12399705pgs.397.2019.07.02.07.45.31; Tue, 02 Jul 2019 07:45:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NiF3piWS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726765AbfGBOoe (ORCPT + 99 others); Tue, 2 Jul 2019 10:44:34 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:42594 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726605AbfGBOoc (ORCPT ); Tue, 2 Jul 2019 10:44:32 -0400 Received: by mail-lf1-f67.google.com with SMTP id x144so11580887lfa.9 for ; Tue, 02 Jul 2019 07:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=WjQyJp2iY5fGQc+V5V9CzoNmpSilM+nwtjmuAYauCEg=; b=NiF3piWStntZFsAy372v0MM1GMImhKld5gDip0Lu1PLdyy6+Ltl6+a2jJU5tTmYId9 8jZ85ljZHm/Bpx3imlNI+faosGx7aI2iRRrJiM5V+sj0CV6CX1wIYNmXGiEY981UNrxO hf8yWMUWJOFuRXFWZ+dmcoS5Gk704pP5LQwI3JsKuHQrZ7x3sfjvw597qSs8xEaES7oM hpqzKPmzVUxa0Z7jiwBzpTrtulmisvOdcmKjTaOkdj0lrwULUL/oMw4WWU5HNrxnq/O8 QVwG8w9rbhVvPmzIPIiOmh5pw20NMIIUgjXgIlRIinWcl9CqWcCz6+i7ZHYeqoCmWlpa 5c4A== 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=WjQyJp2iY5fGQc+V5V9CzoNmpSilM+nwtjmuAYauCEg=; b=XcuhdXoYCuJC39THMVpn/4A9aBZlTIi+72hs/HcXxlAW42+hSTOpik6d+leTXcQ8yW 4hDFncEVyYUro+c3F+zBoWR4txFxaqZStUPT2v5mOsJzzVs2KgFGOJoeCDJlc90+4gRG XYWD+fGALd3cw1D5VHakRoUFOZ6WITOMj2IH0LAFs3LbiYfRLz0qdbXe2xIfh4lIaiVo t5KNPTivPQbbu5dX38b8RfysnhWCyIaTelX631VuIOWIAYLP/unXYW+LAtIOcLkidaxi 0S9HeREUDQOKauc15jDigQ3pX8/6XdN9AoOAJ0RFmcbplfcLKXvItpwpKZWkwndknwLE 8/Mg== X-Gm-Message-State: APjAAAUY8XyM/LAuj9UNh+KhbqMkzNUhB88B3vUoK1uPqJ8n+WxIZwxw IXS5P9hSWEEVuFBx8qZV65cocg== X-Received: by 2002:ac2:51a3:: with SMTP id f3mr13273142lfk.125.1562078670487; Tue, 02 Jul 2019 07:44:30 -0700 (PDT) Received: from khorivan (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id 11sm3821577ljc.66.2019.07.02.07.44.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Jul 2019 07:44:30 -0700 (PDT) Date: Tue, 2 Jul 2019 17:44:27 +0300 From: Ivan Khoronzhuk To: Jesper Dangaard Brouer Cc: netdev@vger.kernel.org, Ilias Apalodimas , grygorii.strashko@ti.com, jakub.kicinski@netronome.com, daniel@iogearbox.net, john.fastabend@gmail.com, ast@kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: Re: [PATCH] net: core: page_pool: add user refcnt and reintroduce page_pool_destroy Message-ID: <20190702144426.GD4510@khorivan> Mail-Followup-To: Jesper Dangaard Brouer , netdev@vger.kernel.org, Ilias Apalodimas , grygorii.strashko@ti.com, jakub.kicinski@netronome.com, daniel@iogearbox.net, john.fastabend@gmail.com, ast@kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org References: <20190702153902.0e42b0b2@carbon> <156207778364.29180.5111562317930943530.stgit@firesoul> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <156207778364.29180.5111562317930943530.stgit@firesoul> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 02, 2019 at 04:31:39PM +0200, Jesper Dangaard Brouer wrote: >From: Ivan Khoronzhuk > >Jesper recently removed page_pool_destroy() (from driver invocation) and >moved shutdown and free of page_pool into xdp_rxq_info_unreg(), in-order to >handle in-flight packets/pages. This created an asymmetry in drivers >create/destroy pairs. > >This patch add page_pool user refcnt and reintroduce page_pool_destroy. >This serves two purposes, (1) simplify drivers error handling as driver now >drivers always calls page_pool_destroy() and don't need to track if >xdp_rxq_info_reg_mem_model() was unsuccessful. (2) allow special cases >where a single RX-queue (with a single page_pool) provides packets for two >net_device'es, and thus needs to register the same page_pool twice with two >xdp_rxq_info structures. As I tend to use xdp level patch there is no more reason to mention (2) case here. XDP patch serves it better and can prevent not only obj deletion but also pool flush, so, this one patch I could better leave only for (1) case. -- Regards, Ivan Khoronzhuk