Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3978724ybg; Mon, 28 Oct 2019 23:50:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMhKY3E8oDgOSqe/K3+jSlrnOvpvcYHqgOGLkq9663RRA3n2XiTwNh5RWmhFBgR2OqjWgp X-Received: by 2002:a17:906:9504:: with SMTP id u4mr1544565ejx.317.1572331828286; Mon, 28 Oct 2019 23:50:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572331828; cv=none; d=google.com; s=arc-20160816; b=pnt8+wkKjzRKrrhLW7cKEmOce8qNDsruWCHrtpU8c/faPX3wAPbr+ubAc3W4Y28mcY 4Hscs2hmGC+NKvzTQpe95V08CEuiM3RtllPZTSR1yYjgc5LRiKWgKFk/OMm/sQhosYUf AulDyhoe7yuL0MrKimx77K2BX1pixd5PBaUxGdFFAzsmCc2ALy6pnrgsy0RJvw2JWnUo pMQbFDqSbGucRh1uBd654nsPEPs3HcUbvr/lpbfFoYgJmBsLcug86COdtVTAibNFLwFh MOYsCh6O3WIlXX5d9FaQH3ycQexdvhchmxCJf0RUyQbfGZ7fEOunQMxAshP+A23u+2Xv sasw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NA9+Hd7H5X5LOcpY1hwwe86WzC/NhiKfrCsJYYxywpA=; b=nNqiUP7tSLGQkGUM7Pw9aX+Ks3gyfHXNNWDgIJkzAXbWHWuJKjfIgmjfsRIEVU2OdN avd203yQI2w9yQTu8cpF1fDFXLOj//OIpp9Hu3lGnjSckRJ+44yN6YxG+9AjEUMiLFWD dST/63TMQh1WDJvO5ZXw/sO+as9B/hq+d5U14x2feFIi2Q/Cgk7k+XT4XuK1Tpgxc3vv 6abSaP6JyCnWkt3q+0uQPC4zJMgTyN4SRf6yz+C6u4mJ2HcvrfhRmf+uEaj42DK2K1mV 88VGrYtzaOW3g5KTh9r6XQEEapyjSyes2PLVP7FD9gnooaF8CVGhZcqZLQ/U+io4+DHV 7jMA== 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 b52si1336104ede.287.2019.10.28.23.50.04; Mon, 28 Oct 2019 23:50:28 -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 S1732270AbfJ1UN2 (ORCPT + 99 others); Mon, 28 Oct 2019 16:13:28 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:8260 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726483AbfJ1UN2 (ORCPT ); Mon, 28 Oct 2019 16:13:28 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id x9SKDD4I027324; Mon, 28 Oct 2019 21:13:13 +0100 Date: Mon, 28 Oct 2019 21:13:13 +0100 From: Willy Tarreau To: Stephen Hemminger Cc: Andy Lutomirski , dev@dpdk.org, Thomas Gleixner , Peter Zijlstra , LKML Subject: Re: [dpdk-dev] Please stop using iopl() in DPDK Message-ID: <20191028201313.GA27316@1wt.eu> References: <20191025064225.GA22917@1wt.eu> <20191028094253.054fbf9c@hermes.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191028094253.054fbf9c@hermes.lan> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephen, On Mon, Oct 28, 2019 at 09:42:53AM -0700, Stephen Hemminger wrote: (...) > > I'd see an API more or less like this : > > > > int ioport(int op, u16 port, long val, long *ret); > > > > would take values such as INB,INW,INL to fill *, OUTB,OUTW,OUL > > to read from , possibly ORB,ORW,ORL to read, or with , write > > back and return previous value to , ANDB/W/L, XORB/W/L to do the > > same with and/xor, and maybe a TEST operation to just validate support > > at start time and replace ioperm/iopl so that subsequent calls do not > > need to check for errors. Applications could then replace : > > > > ioperm() with ioport(TEST,port,0,0) > > iopl() with ioport(TEST,0,0,0) > > outb() with ioport(OUTB,port,val,0) > > inb() with ({ char val;ioport(INB,port,0,&val);val;}) > > > > ... and so on. > > > > And then ioperm/iopl can easily be dropped. > > > > Maybe I'm overlooking something ? > > Willy > > DPDK does not want to system calls. It kills performance. > With pure user mode access it can reach > 10 Million Packets/sec > with a system call per packet that drops to 1 Million Packets/sec. I know that it would cause this on the data path, but are you *really* sure that in/out calls are performed there, because these are terribly slow already ? I'd suspect that instead it's relying on read/write of memory-mapped registers and descriptors. I really suspect that I/Os are only used for configuration purposes, which is why I proposed the stuff above (otherwise I obviously agree that syscalls in the data path are performance killers). > Also, adding new system calls might help in the long term, > but users are often kernels that are at least 5 years behind > upstream. Sure but that has never been really an issue, what matters is that backwards compatibility is long enough to let old features smoothly fade away. Some people make fun of me because I still care a bit about kernel 2.4 and openssl 0.9.7 compatibility for haproxy, so yes, I am careful about backwards compatibility and smooth upgrades ;-) Willy