Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1234004ybi; Fri, 31 May 2019 16:29:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGS7TcCuQg49Z8vqyrhzh4PDGyYH/Y1SDTII819uA2CQmmchEW3518CMV7Id7NEjEO7DCB X-Received: by 2002:a17:902:934a:: with SMTP id g10mr576337plp.18.1559345344640; Fri, 31 May 2019 16:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559345344; cv=none; d=google.com; s=arc-20160816; b=A1aodx8KeuL5gyKwkrwtOFTJgVWXSD+PrSHc2E4ncQwZkdB1Z1GmTT/jqERIjmRTE3 oDVOvkOxa7GAgriCAaAJdN5eHpQ+J81apqNC6q3vjDQAazuYM8+vNkTooJUs9DQrpYsw LmmdXZsRN6MRkKnqtc8HE4ZNtM9D9UO1TzBsbq8Pw0txEEtkTv67mwUfTORZ3on3i5qt 0kXRWCwQnErj5wm7okpq1ZMTi7Tr8LT6WPtX+eYV8vVkJqay5F99kRDQVyOfKBdhyw6b NThOLXjmq2bmuKYZ+9zERG5+r8OFUkE+oJs8hS581jmmGdCBtFnxIQ0KkVxFqWUyvBmk EJcg== 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=/CnFI/Gplfb8sUNP8cdDqVeMfZ2XFe8YBzOqCLpB94A=; b=KaBd5sx/zvJQTLS7mPupBpcjenIe4wNsSrztFC/qn66gGYTjtsAlsc1rGQbXFILeUR ccfBPvR29YgYjMu3/RkL3I04Ttm45wv/h6ihdlzRi+clwPifgCwicVA62LVUEDE2kl0S jAiPKUJ6zw0jveCCOtNTEKKnFYnEvyXAZeI0ekkqJpU1vgLC6QiWq49kuafdLWgPII5W KwuS8MEn8gk6lLD1yx74inZjuOCMmo+Q2iFooZ33DXdh7n95M7r/Lln6kHpHTwINNvqg rbRJHHUtQfRg7Ai/An5Ttkujsy9Vlq86Ncp+mvByoMweDgyz9AhDycesD6aZAJ7WMG21 TuWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zRB3kJXb; 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 h34si8526791pld.187.2019.05.31.16.28.49; Fri, 31 May 2019 16:29:04 -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=zRB3kJXb; 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 S1726869AbfEaX1f (ORCPT + 99 others); Fri, 31 May 2019 19:27:35 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:39498 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbfEaX1d (ORCPT ); Fri, 31 May 2019 19:27:33 -0400 Received: by mail-lf1-f65.google.com with SMTP id p24so2749522lfo.6 for ; Fri, 31 May 2019 16:27:32 -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=/CnFI/Gplfb8sUNP8cdDqVeMfZ2XFe8YBzOqCLpB94A=; b=zRB3kJXbFOYoNSwjaQOpmRSldudJn+Df4uOo0m22Btl5w47IUgSF1V3KT9/1YBYqT2 oQwMa8lZ8u1ftVKKwEjJSWoMnlGmoYsGw+g5M3W/zbFQvnxeX13U8hIMfcgwhGXYLtj3 a4x+sk4uvlBpZvKG4WRkc2vdpY+N/iVAFAMGFeBGW8bWww4AgMd6wECsZe/Vj+ClsQ94 LkRpa/iRwq3UCuhIW1BKIfW5E7Y6SE+Z+ibxlllm8+Lju9f67/TsPJ5y3DSY5dK0lK7Y tdEXFDHpC3dWaDw2Z25AarWFlmKDxvgKg01+1gdBP7eMcTnSIwX7WL0QC7vwnc7xCKdz xGDg== 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=/CnFI/Gplfb8sUNP8cdDqVeMfZ2XFe8YBzOqCLpB94A=; b=PRnx6c/js/CcBNA9eD//niX/MzCMX1V10FcsbUem+7y7oM+QppIkB5ghZMuBLYGDhP 4kjzpL4D7VqLJ/FkIqyTIFQN1Q6U0dOLvOh+Bnik7hUyTYUuNPJwq7+0t30bn/sL4LLx QJKKEWPXVmLMHttcT11/VkQdXr+ImnvNjQ2L5YXUGB4Zie4a+vXDXX6Pcs9FpgRDG8lZ XARcOF06jdAVyFDDdSzGqABZiRLP5klwrfp5TwkIs118LEUaC3x71mL9b0qPJzCObbMl hlnysk/ksq3/gYrM7OvXroMwvgdmyrRW8ZC9/WIUQ4yz0kEg4mD5q6TzYudJZOk7Ehdo ln2w== X-Gm-Message-State: APjAAAX7YQMUMZw7n0pwmT5x1fifFlhRd6NzgWuNp4kaKq34Et3yUf6O BFg53JHMLC2EUmuq8FkKAipMbw== X-Received: by 2002:a19:f806:: with SMTP id a6mr3164054lff.102.1559345251665; Fri, 31 May 2019 16:27:31 -0700 (PDT) Received: from khorivan (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id y6sm1462951ljj.20.2019.05.31.16.27.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 31 May 2019 16:27:31 -0700 (PDT) Date: Sat, 1 Jun 2019 02:27:28 +0300 From: Ivan Khoronzhuk To: Jesper Dangaard Brouer Cc: grygorii.strashko@ti.com, hawk@kernel.org, davem@davemloft.net, ast@kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, xdp-newbies@vger.kernel.org, ilias.apalodimas@linaro.org, netdev@vger.kernel.org, daniel@iogearbox.net, jakub.kicinski@netronome.com, john.fastabend@gmail.com Subject: Re: [PATCH v2 net-next 7/7] net: ethernet: ti: cpsw: add XDP support Message-ID: <20190531232727.GB15675@khorivan> Mail-Followup-To: Jesper Dangaard Brouer , grygorii.strashko@ti.com, hawk@kernel.org, davem@davemloft.net, ast@kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, xdp-newbies@vger.kernel.org, ilias.apalodimas@linaro.org, netdev@vger.kernel.org, daniel@iogearbox.net, jakub.kicinski@netronome.com, john.fastabend@gmail.com References: <20190530182039.4945-1-ivan.khoronzhuk@linaro.org> <20190530182039.4945-8-ivan.khoronzhuk@linaro.org> <20190531174643.4be8b27f@carbon> <20190531162523.GA3694@khorivan> <20190531183241.255293bc@carbon> <20190531170332.GB3694@khorivan> <20190601003736.65cb6a61@carbon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190601003736.65cb6a61@carbon> 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 Sat, Jun 01, 2019 at 12:37:36AM +0200, Jesper Dangaard Brouer wrote: >On Fri, 31 May 2019 20:03:33 +0300 >Ivan Khoronzhuk wrote: > >> Probably it's not good example for others how it should be used, not >> a big problem to move it to separate pools.., even don't remember why >> I decided to use shared pool, there was some more reasons... need >> search in history. > >Using a shared pool is makes it a lot harder to solve the issue I'm >currently working on. That is handling/waiting for in-flight frames to >complete, before removing the mem ID from the (r)hashtable lookup. I >have working code, that basically remove page_pool_destroy() from >public API, and instead lets xdp_rxq_info_unreg() call it when >in-flight count reach zero (and delay fully removing the mem ID). Frankly, not see reason why it can block smth, it can be considered like not shared pool. But Ok, anyway it can look more logical and can be reused by another SoC. I will add it per channel not a problem, at least for now no blockers. Adding pool per channel will create more page_pool_destroy() calls, per each pool, that I can be dropped once you decided to remove it form the API. This API is called along with xdp_rxq_info_unreg(), and seems like not a problem to just remove page_pool_destroy(), except one case that worries me... cpsw has one interesting feature, share same h/w with 2 network devices like dual mac, basically it's 3 port switch, but used as 2 separate interfaces. So that, both of them share same queues/channels/rings. XDP rxq requires network device to be set in rxq info, wich is used in the code as a pointer and is shared between xdp buffers, so can't be changed in flight. That's why each network interface has it's own instances of rxq, but page pools per each network device is common, so when I call xdp_rxq_info_unreg() per net device it doesn't mean I want to delete page pool....But seems I can avoid it calling xdp_rxq_info_unreg() for both when delete page pools... > >-- >Best regards, > Jesper Dangaard Brouer > MSc.CS, Principal Kernel Engineer at Red Hat > LinkedIn: http://www.linkedin.com/in/brouer -- Regards, Ivan Khoronzhuk