Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1212186ybi; Fri, 31 May 2019 16:02:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwswh4ukAWhpiJkA/DG1DEZqplKZ3GN6u/yb6Q1S7BJWWInNxr+B47exKQaxDBdHvJ3Isj2 X-Received: by 2002:a62:68c4:: with SMTP id d187mr13569817pfc.245.1559343752383; Fri, 31 May 2019 16:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559343752; cv=none; d=google.com; s=arc-20160816; b=zfqeCmA07V+83rhcbOxwBxYmKuQKx+SLSYOZtuNfq7t/buvtxagr48JdFYCOqqhNiD EAAUo+dVdz5zgf3am2B7w19x+GUK3PQ9H8/jdpcuuZuy6Qyjjd4tPqSVCaqZYm5hOxFM 0uh587xvcIrh/m0tCSJxSDu1VA4l0Z6uxLu8jPavg4U+6I+gEkEaujtStv9EjSWrH6pt gQUKmb7pb6VWW6FLgCX6BGVKL/KHlzYK4Uc+lG14ZgDwYx8Aldo+2ouEAnXgeQ5S8QPc H1osBQETO5XsRqoPKcPWVZnseVVMxlR4SJEy0fQ355yc++jEfw9CE3YCDuru1CoSAK1Y SH0g== 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=R6AakFEfT07RKGQjtU57G+Mi06fjxrW46LtUHEWscX4=; b=qVaeWWGO2gj7bJZzxW/B3dacvmV/PFEPNBZaLy/eCqawLoYtmJcalcuEOiGpv4MdP4 Dd+4G4alXxSCQRaeF/1W9hX9rANiFwCCizaN4k+d9D/zqEg389CTiO4wjBr2XaX8gtRU VIr5igP4AlcNOz6AjMIFDhuWFGacBtYSsvJFWzitDEvgycV3B5tsdtUw+SbCiyOyqmw0 lVLMc+NOfCIXk4srT7ECN/FSIGGYWK2iPkQx4AEkPo6NiauDSB26xulcSIwV4NNBYF7F RdWi8ursz9KxrxH7ggQBtk4DXcQt4fcjw6PJEAjv3k9N0cK89mJPOvSY3TB3X3+fuf/m +GHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UdqZ6v0x; 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 y12si7593157pgr.329.2019.05.31.16.02.04; Fri, 31 May 2019 16:02:32 -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=UdqZ6v0x; 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 S1726713AbfEaXAQ (ORCPT + 99 others); Fri, 31 May 2019 19:00:16 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:37637 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbfEaXAQ (ORCPT ); Fri, 31 May 2019 19:00:16 -0400 Received: by mail-lj1-f193.google.com with SMTP id h19so11083817ljj.4 for ; Fri, 31 May 2019 16:00:14 -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=R6AakFEfT07RKGQjtU57G+Mi06fjxrW46LtUHEWscX4=; b=UdqZ6v0xW/ZPZI7rfZNyoQWpFuu/Dvj8IN2xtnDAPTX97Ifm9GE29ZZGLxyqa/iYZ4 rcW2doIiMnJjEYD8YHPZeBmeYw+/pF+7ufxy43Ajo6/T1K3jr+2pVZMH3vAfYHucEpi5 8KaToYGMYAnolAxiqpavrhqxAujTLEgOy5wYLdGxZU6GLfatAVHJQ2Tg01q8q0X6qGNd cvMdOyIrYD4kp5dHSVPpHRvmnPayZKvtxCSI1aZfKMsjl1X/eLrDLMuyr0pSD8N/+0W1 /DJb6GKmvK2DjPvRgAoWeRBJylaxDlUW6HBWawCb3DzMx8wad8MxyX9f6zHog+XwZFvd oQtQ== 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=R6AakFEfT07RKGQjtU57G+Mi06fjxrW46LtUHEWscX4=; b=A/JxJEG1Oxb96oKUrrYybYYWNyaPEQPoXnzDd/akwS+GTGzQQQUbfxW0/X3JIDEmWJ fseMqP+3pnWNrUy0KRoL84R0NOUUtM3OA4rIQnXbHKE6TX8+PdUOEsWjMezPma3uYh/w bmBpVGlhs8O7t2d/Q6kNJ9P/wftoCOKaObHB564d2PDYjOBdQ3I08PiGtIUXKEXrsOVH xyVxvsrh0sB/3zWa5qEv+23v3hLNGU7MuWgBzbLZYRG7IQ0W988VZwcLQ5Ocip5ydK1l tbbTdrsHevk+sSLr2Q8t07xoHXnuh6ipLF02W48vYEJSlseHL4OQX2UHVKpvGPEBPkQR wBgA== X-Gm-Message-State: APjAAAUdbR465ZW3eeJA7dGlesmXi3rjqsuUzoxnwlT4VuIcRYTw3X1H sbGoBPuj0tOYw1YqhG7iXfCc2w== X-Received: by 2002:a2e:2b8d:: with SMTP id r13mr7429874ljr.162.1559343613223; Fri, 31 May 2019 16:00:13 -0700 (PDT) Received: from khorivan (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id r14sm1468168lff.44.2019.05.31.16.00.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 31 May 2019 16:00:12 -0700 (PDT) Date: Sat, 1 Jun 2019 02:00:10 +0300 From: Ivan Khoronzhuk To: Saeed Mahameed Cc: "brouer@redhat.com" , "daniel@iogearbox.net" , "xdp-newbies@vger.kernel.org" , "davem@davemloft.net" , "john.fastabend@gmail.com" , "ilias.apalodimas@linaro.org" , "grygorii.strashko@ti.com" , "linux-kernel@vger.kernel.org" , "linux-omap@vger.kernel.org" , "ast@kernel.org" , "hawk@kernel.org" , "netdev@vger.kernel.org" , "jakub.kicinski@netronome.com" Subject: Re: [PATCH v2 net-next 7/7] net: ethernet: ti: cpsw: add XDP support Message-ID: <20190531230008.GA15675@khorivan> Mail-Followup-To: Saeed Mahameed , "brouer@redhat.com" , "daniel@iogearbox.net" , "xdp-newbies@vger.kernel.org" , "davem@davemloft.net" , "john.fastabend@gmail.com" , "ilias.apalodimas@linaro.org" , "grygorii.strashko@ti.com" , "linux-kernel@vger.kernel.org" , "linux-omap@vger.kernel.org" , "ast@kernel.org" , "hawk@kernel.org" , "netdev@vger.kernel.org" , "jakub.kicinski@netronome.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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: 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 Fri, May 31, 2019 at 10:08:03PM +0000, Saeed Mahameed wrote: >On Fri, 2019-05-31 at 20:03 +0300, Ivan Khoronzhuk wrote: >> On Fri, May 31, 2019 at 06:32:41PM +0200, Jesper Dangaard Brouer >> wrote: >> > On Fri, 31 May 2019 19:25:24 +0300 Ivan Khoronzhuk < >> > ivan.khoronzhuk@linaro.org> wrote: >> > >> > > On Fri, May 31, 2019 at 05:46:43PM +0200, Jesper Dangaard Brouer >> > > wrote: >> > > > From below code snippets, it looks like you only allocated 1 >> > > > page_pool >> > > > and sharing it with several RX-queues, as I don't have the full >> > > > context >> > > > and don't know this driver, I might be wrong? >> > > > >> > > > To be clear, a page_pool object is needed per RX-queue, as it >> > > > is >> > > > accessing a small RX page cache (which protected by >> > > > NAPI/softirq). >> > > >> > > There is one RX interrupt and one RX NAPI for all rx channels. >> > >> > So, what are you saying? >> > >> > You _are_ sharing the page_pool between several RX-channels, but it >> > is >> > safe because this hardware only have one RX interrupt + NAPI >> > instance?? >> >> I can miss smth but in case of cpsw technically it means: >> 1) RX interrupts are disabled while NAPI is scheduled, >> not for particular CPU or channel, but at all, for whole cpsw >> module. >> 2) RX channels are handled one by one by priority. > >Hi Ivan, I got a silly question.. > >What is the reason behind having multiple RX rings and one CPU/NAPI >handling all of them ? priority ? how do you priorities ? Several. One of the reason, from what I know, it can handle for several cpus/napi but because of errata on some SoCs or for all of them it was discarded, but idea was it can. Second it uses same davinci_cpdma API as tx channels that can be rate limited, and it's used not only by cpsw but also by other driver, so can't be modified easily and no reason. And third one, h/w has ability to steer some filtered traffic to rx queues and can be potentially configured with ethtool ntuples or so, but it's not implemented....yet. > >> 3) After all of them handled and no more in budget - interrupts are >> enabled. >> 4) If page is returned to the pool, and it's within NAPI, no races as >> it's >> returned protected by softirq. If it's returned not in softirq >> it's protected >> by producer lock of the ring. >> >> 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. >> >> > -- >> > Best regards, >> > Jesper Dangaard Brouer >> > MSc.CS, Principal Kernel Engineer at Red Hat >> > LinkedIn: http://www.linkedin.com/in/brouer -- Regards, Ivan Khoronzhuk