From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2285DC06513 for ; Thu, 4 Jul 2019 12:15:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7CE72189E for ; Thu, 4 Jul 2019 12:15:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uqCi7e33" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7CE72189E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x9OBfyIEQpiv2q/jjRR5C8aX0pEscsnM39Tts7bXets=; b=uqCi7e33R1Xbet 8UqPPGHSiNllyQG4On3b/O9qlA/5WVpKUL60mfOv/iak0pVWGi63fCsMft1u7uvtfsIRKixeINd2u zAi4asRiji2+PH+NkhRegrdqgrRwHIhrQ06JN/Byixu9uRZMpNBaeiGb9bd1GFWu321nDWMMIWxGl ftS7LUOhPKthKichTtbq94mAyP8UBCoLRe9egt4BLYJ7G4P1zLm+QAVe/ho3XbEhEdxtx/ft/FDHm 9saJT45f//bhInq8UlfzF/b0XheBGojK/ryvc5L1gI2F8AjIyksTKdEF0rrNPFhlCa68Heae15iXS GXUeMnTVZclaP4nZ3UkQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hj0db-0000ip-Tz; Thu, 04 Jul 2019 12:14:55 +0000 Received: from mail-qk1-f193.google.com ([209.85.222.193]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hj0dY-0000hZ-Ur for linux-arm-kernel@lists.infradead.org; Thu, 04 Jul 2019 12:14:54 +0000 Received: by mail-qk1-f193.google.com with SMTP id s145so1805782qke.7 for ; Thu, 04 Jul 2019 05:14:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9cNGGl+FLilA8PMo/2823HsEW5aV7LEQGtBmo7DnFEc=; b=Vp59D7fvN+X3qHm0CV6bsbCXGZeKQO4r4DQLTvaZHU/hUGd6h1NYSvZrPVN8aeKWXL QJe1xa81ndPqZ6tZPnTvH9vzIXj0MP4NhGQ0vzxU0rnG3iaKZCgaUGp/4whQOqrD0HRS aRkz713Th3JKkQc2dUVBRicxaiPpojWhNdVIq3BrO3jVmqUEjkBg/FlGJbSzJP4oya0+ /Nxx6JcOgdPuupvkbySra+Y6NO0+zT0oD7BonCUAJbSgeWWjQ9FwpC2zO4Dhj3IOe5GN vsCTamfpCOP9Y/eJbZZzV7sg2aDNYki1j3OajULeW3J3WLdgcP1n5APMsnSjRLWvsiIu WBPA== X-Gm-Message-State: APjAAAWY5Lpc7c0wNaoOontg1iJgz12yFUh8YJs4S1d5hDyLI9TYLIj6 Y+MLkdj3f8dCuLNt8nDOS4kceClPeMzNiRV6wg4= X-Google-Smtp-Source: APXvYqzvpIz9J26dzCUH95aoNaSNG7JvaLf06oXPM82JIyYSrVI156uv/dpYNT0OS7IMkbIycWc7OMw2LwtS3sy2tBc= X-Received: by 2002:a37:76c5:: with SMTP id r188mr34670161qkc.394.1562242486886; Thu, 04 Jul 2019 05:14:46 -0700 (PDT) MIME-Version: 1.0 References: <1b254bb7fc6044c5e6e2fdd9e00088d1d13a808b.1562149883.git.joabreu@synopsys.com> <20190704120018.4523a119@carbon> <20190704103057.GA29734@apalos> In-Reply-To: <20190704103057.GA29734@apalos> From: Arnd Bergmann Date: Thu, 4 Jul 2019 14:14:28 +0200 Message-ID: Subject: Re: [PATCH net-next 3/3] net: stmmac: Introducing support for Page Pool To: Ilias Apalodimas X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190704_051452_996388_D40FA54A X-CRM114-Status: GOOD ( 12.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Joao Pinto , Alexandre Torgue , Maxime Ripard , Networking , Linux Kernel Mailing List , linux-stm32@st-md-mailman.stormreply.com, Chen-Yu Tsai , Maxime Coquelin , Jesper Dangaard Brouer , Giuseppe Cavallaro , "David S . Miller" , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jul 4, 2019 at 12:31 PM Ilias Apalodimas wrote: > > On Wed, 3 Jul 2019 12:37:50 +0200 > > Jose Abreu wrote: > 1. page pool allocs packet. The API doesn't sync but i *think* you don't have to > explicitly since the CPU won't touch that buffer until the NAPI handler kicks > in. On the napi handler you need to dma_sync_single_for_cpu() and process the > packet. > So bvottom line i *think* we can skip the dma_sync_single_for_device() on the > initial allocation *only*. If am terribly wrong please let me know :) I think you have to do a sync_single_for_device /somewhere/ before the buffer is given to the device. On a non-cache-coherent machine with a write-back cache, there may be dirty cache lines that get written back after the device DMA's data into it (e.g. from a previous memset from before the buffer got freed), so you absolutely need to flush any dirty cache lines on it first. You may also need to invalidate the cache lines in the following sync_single_for_cpu() to eliminate clean cache lines with stale data that got there when speculatively reading between the cache-invalidate and the DMA. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel