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=-0.8 required=3.0 tests=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 76855C41514 for ; Wed, 21 Aug 2019 14:28:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5657E21655 for ; Wed, 21 Aug 2019 14:28:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729262AbfHUO2w convert rfc822-to-8bit (ORCPT ); Wed, 21 Aug 2019 10:28:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:39348 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727949AbfHUO2v (ORCPT ); Wed, 21 Aug 2019 10:28:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 89345AD94; Wed, 21 Aug 2019 14:28:49 +0000 (UTC) Date: Wed, 21 Aug 2019 16:28:47 +0200 From: Thomas Bogendoerfer To: Jakub Kicinski Cc: Jonathan Corbet , Ralf Baechle , Paul Burton , James Hogan , Dmitry Torokhov , Lee Jones , "David S. Miller" , Srinivas Kandagatla , Alessandro Zummo , Alexandre Belloni , Greg Kroah-Hartman , Jiri Slaby , Evgeniy Polyakov , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH v5 10/17] net: sgi: ioc3-eth: rework skb rx handling Message-Id: <20190821162847.479c9967d4dc8026fe65fa0e@suse.de> In-Reply-To: <20190819165522.451f2ea2@cakuba.netronome.com> References: <20190819163144.3478-1-tbogendoerfer@suse.de> <20190819163144.3478-11-tbogendoerfer@suse.de> <20190819165522.451f2ea2@cakuba.netronome.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org On Mon, 19 Aug 2019 16:55:22 -0700 Jakub Kicinski wrote: > On Mon, 19 Aug 2019 18:31:33 +0200, Thomas Bogendoerfer wrote: > > Buffers alloacted by alloc_skb() are already cache aligned so there > > is no need for an extra align done by ioc3_alloc_skb. And instead > > of skb_put/skb_trim simply use one skb_put after frame size is known > > during receive. > [...] > > -/* We use this to acquire receive skb's that we can DMA directly into. */ > > - > > -#define IOC3_CACHELINE 128UL > > Is the cache line on the platform this driver works on 128B? right now yes, in theory IOC3 CAD DUO cards might work in SGI O2 systems, but the current Linux PCI implementation for O2 will not detect that card. On X86 usually the BIOS will choke up on that cards. > This looks like a DMA engine alignment requirement, more than an > optimization. that true, there are two constraints for the rx buffers, start must be aligned to 128 bytes and a buffer must not cross a 16kbyte boundary. I was already thinking of allocating pages and chop them up. Is there a Linux API available, which could help for implementing this ? I'll probably drop this patch or only change the skb_put stuff plus RX_BUF_SIZE define. Thomas. -- SUSE Linux GmbH GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)