Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4104732ybi; Mon, 27 May 2019 11:12:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxA8G1vNW/se/MCtZbeouDihnjm09wfOexpkipoa6AKvGmLSEaeSXaYnV6iiSVquqaVas+C X-Received: by 2002:aa7:87ca:: with SMTP id i10mr111099196pfo.157.1558980731998; Mon, 27 May 2019 11:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558980731; cv=none; d=google.com; s=arc-20160816; b=LPXVv3+z0AzLn19NR/yg8+dv8bQFGIYnzxEKuGBQ62t/dh0Z4i/ILj1ROSv5fcqijH mkK7WujW+I/U1rI0XAQ2O4ubxsBAgb8JOEuGR8U2Da/E+m7IWmCZtA2P4uf0PcB3NCd+ Wp1MlSkKZi8DLzdyb6v22Z0R3y2cb/hsBv3O8TI57D8hMtKUM336kGdxZS9utXTCBk7f 4lYLcWul2Kl3R9x9l7FeYNMTgpM0tcem8mcmo3zKnN5SsgCcdeO+1BxxQpgOWGXUhKq0 Am3IIapTGLf8FtPkgPsU1gK+cjeAhBASRWs7I6f1fi0YGvyqqb+Hs03y/QCWuSgDldls 8TRQ== 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=OPxJbzxj8XRuMP1HaHwQ8HvvmExLWsTd5Jne2FrvM2s=; b=eYNaj8CMXWCrx2RUNVtv+ZegAdzXK387vbKcncBdPccYblW4iTyguIuKPVkLtWeDuk uzV2aHkvbVN36LNbGdjm/xdRSEtwZH+2sO8UWi3nXG2637qjwavnojcDgaMw/Gym28xA 31La9fWyZX9sCjuxpAKstIPmkvtzhgW6CiswmTA7pMN9NoYzdq4DSVVgS+aTg6XXHmPF ksVxPiPM8pMDFhVV6MNCG2dgEl67g3zGbNHId7gc6ZMhTq4gkEJVRGYF1ONzOa/l5cR/ cWo0XJaR3zTkUBgepQAhWMFEELTZ0f9wlt17Qcw7gA+Qky7PAGlqBXQsvMYI7q0UZveT zxNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ukaGmu7n; 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 s1si167145pjb.23.2019.05.27.11.11.56; Mon, 27 May 2019 11:12:11 -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=ukaGmu7n; 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 S1727130AbfE0SKv (ORCPT + 99 others); Mon, 27 May 2019 14:10:51 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:34837 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726346AbfE0SKu (ORCPT ); Mon, 27 May 2019 14:10:50 -0400 Received: by mail-lf1-f68.google.com with SMTP id a25so2809622lfg.2 for ; Mon, 27 May 2019 11:10:49 -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=OPxJbzxj8XRuMP1HaHwQ8HvvmExLWsTd5Jne2FrvM2s=; b=ukaGmu7nRGCEMmSYCwuppXI41vUKroOyV3rNIbjLFxOrrlI04GeRpz3vt0TXj9V74r NyReSdiC79Bv2WZRleICXZBo7O73fqXldrUjyv/IsqTvpngs+4vnc3AAJzw2IHE+NNih Bbd9zNJhxOZX5bNRILoh/FHs+mIHyXpl7iaBAMq3sZIREjkXfOxWaDaRTkjQvj5n/+WV 3BUZB1PrqP91qroqJIFTk3jTDCBNJ4WjJWs+qlZ95ljylT7z5Znvgv4zks0k1FFJE6c3 cm6C01KxRr3GcZ8PODwWByX5GLvDvwA25ANlbWXqP4un7p5+BSrvhOr6GMMT1RzuMs4F 2Q/w== 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=OPxJbzxj8XRuMP1HaHwQ8HvvmExLWsTd5Jne2FrvM2s=; b=eQc0cGSd6Gnyvjvrs2k52NCww7DZu2ZQuJjHXXlXCcYu3DoQ1CS640hsF9UWdQPh5j u97JnPOChmpwVeHKXHrx2Ec0NmsRdPqWEwrJu0oitzgNQ0PVftSv09Q4oF+WQydHleuK XFT0dso8ByQQIR/tPk0tp5QxNVZ5sJ1NDkeBfGI13sQDmKT9pWqfV6GETWzOv9CmVL1l XS5uMFxcI9n9rr6LKHhNFh6oBdDyTkMyDhDuBgTJGJUtOK0vQGIRbgj6bKNs/6rVlrWq 4yP6eiUdcMlNqfNb9GiLMV0Mls79ydX1QAm/y8269guiVkegrAT90gHlbyS3SCeeVjoD vncQ== X-Gm-Message-State: APjAAAVsBB1aE0VrN5asRads0FdrpRu5k+RkRuMBcye/8AKO3BLJsqzQ gbXn4tXm+bHEe22b5vb6V2ONaA== X-Received: by 2002:a05:6512:144:: with SMTP id m4mr1975972lfo.114.1558980648865; Mon, 27 May 2019 11:10:48 -0700 (PDT) Received: from khorivan (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id d18sm2432493lfl.95.2019.05.27.11.10.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 May 2019 11:10:48 -0700 (PDT) Date: Mon, 27 May 2019 21:10:46 +0300 From: Ivan Khoronzhuk To: Jesper Dangaard Brouer Cc: grygorii.strashko@ti.com, 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, Tariq Toukan Subject: Re: [PATCH net-next 3/3] net: ethernet: ti: cpsw: add XDP support Message-ID: <20190527181043.GA4246@khorivan> Mail-Followup-To: Jesper Dangaard Brouer , grygorii.strashko@ti.com, 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, Tariq Toukan References: <20190523182035.9283-1-ivan.khoronzhuk@linaro.org> <20190523182035.9283-4-ivan.khoronzhuk@linaro.org> <20190524135418.5408591e@carbon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190524135418.5408591e@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 Fri, May 24, 2019 at 01:54:18PM +0200, Jesper Dangaard Brouer wrote: >On Thu, 23 May 2019 21:20:35 +0300 >Ivan Khoronzhuk wrote: > >> Add XDP support based on rx page_pool allocator, one frame per page. >> Page pool allocator is used with assumption that only one rx_handler >> is running simultaneously. DMA map/unmap is reused from page pool >> despite there is no need to map whole page. > >When using page_pool for DMA-mapping, your XDP-memory model must use >1-page per packet, which you state you do. This is because >__page_pool_put_page() fallback mode does a __page_pool_clean_page() >unmapping the DMA. Ilias and I are looking at options for removing this >restriction as Mlx5 would need it (when we extend the SKB to return >pages to page_pool). Thank for what you do, it can simplify a lot... > >Unfortunately, I've found another blocker for drivers using the DMA >mapping feature of page_pool. We don't properly handle the case, where >a remote TX-driver have xdp_frame's in-flight, and simultaneously the >sending driver is unloaded and take down the page_pool. Nothing crash, >but we end-up calling put_page() on a page that is still DMA-mapped. Seems so, ... for generic solution, but looks like in case of cpsw there is no issue due to "like direct" dma map by adding offset, so whether page_pool dma map or dma map/unmap per rx/xmit, shouldn't be big difference. Not sure about all SoCs thought... Despite of it, for cpsw I keep page_pool while down/up that I'm going to change in v2. > >I'm working on different solutions for fixing this, see here: > https://github.com/xdp-project/xdp-project/blob/master/areas/mem/page_pool03_shutdown_inflight.org Hope there will be no changes in page_pool API. >-- Best regards, > Jesper Dangaard Brouer > MSc.CS, Principal Kernel Engineer at Red Hat > LinkedIn: http://www.linkedin.com/in/brouer -- Regards, Ivan Khoronzhuk