Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1001458ybl; Wed, 21 Aug 2019 08:38:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqynrhNrSvsrMVspW44OBcnsra0ggBgjuxyvxpmv2OUsOd9Uf9aHqrl8F1yTsayiwd821gHQ X-Received: by 2002:a63:3006:: with SMTP id w6mr29958656pgw.440.1566401922529; Wed, 21 Aug 2019 08:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566401922; cv=none; d=google.com; s=arc-20160816; b=LNEirhhEeZc0KFicEW+JHi/TKnRkykWWe8F+5LpsJhe7O+RlMQEYssUojt/3f4Xnuu dW9DHwr3/Jkwr8cBheuE5V5QO8ipmu33JlbCh148mXVsW2T7bjW4t8OnWmwcXnLjWM2o OMxoNL3NM0Hoh5i601qoFzQObNa1h/fbhuIzUoJefL52q4ypWEfCwFsqil+Rb5nE+APj dMVk1r7ibQijONoUKI4IY+HomliNRKmOYXaDgOGlLx8oQ63XmyI3DPuxdn3p2/5VqCln HdjIVC28omQfUBmLN4OLot2TrU4wQEaIYkOc8GBzUOU1/gMI+DIPWcB5e/ZnhNuzMsvm Vdgw== 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=4pEaRWJsIEELjMMOqb0v47gWq4b1zlxhgP9ht2KpyoY=; b=pNvsIHMoGYOoUzcVa1SRy0Z462sF9t+DC4IZuFIUDoZTW3Zc6I6pO0hiAtVLWiaJRF ccVnocJR2bP8eDe6uI9HAkVH66UEcrflldD5IOGCYhbGyNvRBWW0QtQpZO8vxD2ZRJT+ gnCSZdb/mb7qA0zeIxAhWpE6FMDwl1OlHfdsHLbMtsiA/oXUvN6jBD0Rn//58bU33YMK nYfcePZ7TpHoIFWOcNRQg16XNq8nzpgM4Qy7ZTG/90y4wcZVZLnHYcXs7nev2k0N1YqQ kbbNjyT0duhH8EeOu1EL/9GyzIDrp9orQ+Xj34Zz5R6dR2UxuH91cpGRODBUWktiAH95 jV+A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15si14259914pgm.413.2019.08.21.08.38.27; Wed, 21 Aug 2019 08:38:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729339AbfHUO2w convert rfc822-to-8bit (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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)