Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp214816pxb; Wed, 4 Nov 2020 20:14:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGrIpo/Sd/YJX9zyzMXivkxxa7Y/xT0qcsd2NIQR3XDMXOd+kuenqdqXt9/ddJ1C6Q4TvU X-Received: by 2002:a05:6402:1245:: with SMTP id l5mr688485edw.68.1604549680389; Wed, 04 Nov 2020 20:14:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604549680; cv=none; d=google.com; s=arc-20160816; b=TwDz5nBQ1HMQvEAUDca7xVF34yk6mA+rZDGekCFA/F1YScoTITicofRVB6CunA8sMz RPHok2PhkdpY9z7C0a6dU71aXm/H1WLRTghxgWedoye5dIUPVsY8qzuSUk/JJc7vcAgI bV2ySqYQVGNMG+ZtkQRVUaRXQAVOT3DjEMkwUw5cM4CgXy7KkUfT+Bm33hrgWuzqh14a 5GOzTnXwGz3j99j5wnGObOyeUBuUYIxCg206s9lpQ/uC/RzRBBBClH8ESPNjh0+vYO5m 25LfCS3H7PX3BXBbWU+jrSJW0okjO1ni58B6a4TjNN/YljEUvIkLRMd6jDsenPUz/Kxl GwFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=t5E0auTe/Mpk/njdcgzmL8j3Ei0scYIkSPdFesj1A0o=; b=Mu75sf1SRU7Wubyukjg/YuJQNV5csXgNpM//HLnU94Cipj0IwwqMsvZy/P4ufZJI+u tXylr1j6A9te8GAqgVNKlf4wFN2MSQKiK2GKPqBWg5CtUkfyE2M07v5u0ibIFfyli1xs 2zetO74FyNvDWcqUBAGqyzpJput52pSgZaxSFats8NLFiJ7+vpaDRtD9EmJGNEMLfvR/ PUTRsUUh6Bo7tSJOoaYYhytmjxDBnXPRlWgepTrSsQiY1jrMpwW0Wju5mG4UF7FdyY8c +rFin9f4C8F5KEpZbfYS7NTVVg/9RZSgyNEbfMqiS3/cyyE4QRQySczMlk2BP73dRVfT 0O/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q1si288802edn.569.2020.11.04.20.14.17; Wed, 04 Nov 2020 20:14:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731236AbgKEBEr (ORCPT + 99 others); Wed, 4 Nov 2020 20:04:47 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:36188 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730543AbgKEBEm (ORCPT ); Wed, 4 Nov 2020 20:04:42 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kaThf-005JCz-HJ; Thu, 05 Nov 2020 02:04:39 +0100 Date: Thu, 5 Nov 2020 02:04:39 +0100 From: Andrew Lunn To: Ioana Ciornei Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Ioana Ciornei Subject: Re: [RFC 6/9] staging: dpaa2-switch: add .ndo_start_xmit() callback Message-ID: <20201105010439.GH933237@lunn.ch> References: <20201104165720.2566399-1-ciorneiioana@gmail.com> <20201104165720.2566399-7-ciorneiioana@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201104165720.2566399-7-ciorneiioana@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static int dpaa2_switch_build_single_fd(struct ethsw_core *ethsw, > + struct sk_buff *skb, > + struct dpaa2_fd *fd) > +{ > + struct device *dev = ethsw->dev; > + struct sk_buff **skbh; > + dma_addr_t addr; > + u8 *buff_start; > + void *hwa; > + > + buff_start = PTR_ALIGN(skb->data - DPAA2_SWITCH_TX_DATA_OFFSET - > + DPAA2_SWITCH_TX_BUF_ALIGN, > + DPAA2_SWITCH_TX_BUF_ALIGN); > + > + /* Clear FAS to have consistent values for TX confirmation. It is > + * located in the first 8 bytes of the buffer's hardware annotation > + * area > + */ > + hwa = buff_start + DPAA2_SWITCH_SWA_SIZE; > + memset(hwa, 0, 8); > + > + /* Store a backpointer to the skb at the beginning of the buffer > + * (in the private data area) such that we can release it > + * on Tx confirm > + */ > + skbh = (struct sk_buff **)buff_start; > + *skbh = skb; Where is the TX confirm which uses this stored pointer. I don't see it in this file. It can be expensive to store pointer like this in buffers used for DMA. It has to be flushed out of the cache here as part of the send. Then the TX complete needs to invalidate and then read it back into the cache. Or you use coherent memory which is just slow. It can be cheaper to keep a parallel ring in cacheable memory which never gets flushed. Andrew