Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp348791ybi; Fri, 24 May 2019 04:56:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9yQqfVMAop9dwgRK7EjsAMSkx+aj6odAXkdxCtZzm6u8YItlhYaH4h9/MC6Tqyl0DovBS X-Received: by 2002:a17:902:ac90:: with SMTP id h16mr41719539plr.162.1558698981189; Fri, 24 May 2019 04:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558698981; cv=none; d=google.com; s=arc-20160816; b=sS69oOJ02/Vtjeon6QkRpAk5Wn/xaZzlxxK1B0m4dhGIzIjjhOpc/3xqR6Bil+5+pP KJJjsQ0VgB8lH7k8MnwLecE8tOhQq9uQfDTv3g7tdRQkhkI15W6oY+A4JrHLEBLkHcfx g5Ez/f8HB16nWJnnJD//OSCYiqSrmt48z+lYCXrly9pBHsNCkiBGCEvSKFg6RMfi+i9U aneOhLVMaIi8xyI41Y1LiLNplyASmdCmq7jht/oJCApmO3VRcc+Tytvm2vJzz1+Me04I gy3ArPsbqctVweYikOU/C66J52vk4vhgNauToVLmoIuqYZg1enTyXPjJBhumWK2w1P26 PIEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=7niiFiSeMaLJ7zPkASdNXGkvzK1XF8QqBm0uhE/LCDc=; b=oq23cl5i4tYqR+Y2ZiM1YmsYBoIoQmV8qFglYTpVU5RCtAAmBNwZkDxQIW0ioCk3q6 She9n/O2U80EN40Z70YPdRuLDNb3OQxPKi9gSU7whQqWdYkYhpOVLZMvF8w3fVCDsMtz hBAiMCFR4OdAnoLLBJrQdrIe8e8xltDBscb7hiJKz9So3sX6VPKjINckY0qRagrNpc2o KwOJUS+jxFcT28CilL7o/+06B3D9EHiCvDseU7/9mjWK/CT5wYK1a/PyZZnIW79Da9RL CCyWRJ9eQh1w2P9eGPX7ENBcOnyGtK+WsEt5WCn3aEPk4vFUfXpX7aCK9l8ZThrp+rD1 Q0tw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si3924945pla.406.2019.05.24.04.56.05; Fri, 24 May 2019 04:56:21 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391421AbfEXLyb (ORCPT + 99 others); Fri, 24 May 2019 07:54:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34796 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391271AbfEXLyb (ORCPT ); Fri, 24 May 2019 07:54:31 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 88D033087950; Fri, 24 May 2019 11:54:29 +0000 (UTC) Received: from carbon (ovpn-200-45.brq.redhat.com [10.40.200.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id D13E91001E6C; Fri, 24 May 2019 11:54:20 +0000 (UTC) Date: Fri, 24 May 2019 13:54:18 +0200 From: Jesper Dangaard Brouer To: Ivan Khoronzhuk 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, brouer@redhat.com, Tariq Toukan Subject: Re: [PATCH net-next 3/3] net: ethernet: ti: cpsw: add XDP support Message-ID: <20190524135418.5408591e@carbon> In-Reply-To: <20190523182035.9283-4-ivan.khoronzhuk@linaro.org> References: <20190523182035.9283-1-ivan.khoronzhuk@linaro.org> <20190523182035.9283-4-ivan.khoronzhuk@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 24 May 2019 11:54:31 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). 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. 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 -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer