From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 53075A057B; Wed, 1 Apr 2020 20:41:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 32AC51C128; Wed, 1 Apr 2020 20:41:09 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 38FF31C11A for ; Wed, 1 Apr 2020 20:41:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585766466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e1Sw9AkULtQqpsBEsQaZJF7BZzZBlx70MVMOC2pzFG4=; b=IZ4RaV8mHVpUAXCQfivZ4QRY/5QZVDjaEIrwp34LuRbbqRlkAr4afovZp1FH54ccelmN+b OfXUhGOqo0dTOW8YiusBUGZaGqB1J8PipN9tF72BNl2Ve6YGknDguvSnsji14Kf8kODQiS ULh9DpvUjzAycsMl3YcsZ2/9FF8vn9Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-197-w8PexNXpPKyeij6DaWyhuQ-1; Wed, 01 Apr 2020 14:41:04 -0400 X-MC-Unique: w8PexNXpPKyeij6DaWyhuQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 281D418FF660; Wed, 1 Apr 2020 18:41:02 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-116-136.phx2.redhat.com [10.3.116.136]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8FA8C60BEC; Wed, 1 Apr 2020 18:41:01 +0000 (UTC) From: Aaron Conole To: Matteo Croce Cc: dev@dpdk.org, stable@dpdk.org References: <20200401131044.7259-1-mcroce@redhat.com> Date: Wed, 01 Apr 2020 14:40:59 -0400 In-Reply-To: <20200401131044.7259-1-mcroce@redhat.com> (Matteo Croce's message of "Wed, 1 Apr 2020 15:10:44 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH] net/dpdkoin: add new driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Matteo Croce writes: > DPDK polls the packet in a busy loop. This means that CPU constantly spin= s > looking for packets, regardless of the network traffic. > DPDK does this to reduce latency and avoid using interrupts, at expense o= f > efficiency: this might consume more processing power and generate more he= at > than needed, potentially increasing the TCO of a DPDK appliance. > > Here comes DPDKoin. DPDKoin is a DPDK PMD, which instead of moving > packets, mines cryptocurrencies. > DPDKoin just does a few calculations to every poll cycle, this means that > when the network is loaded, DPDKoin consumes just a few cycles, but when > there is no traffic, DPDKoin mines currencies in a busy loop. > The coins are mined with no extra consumption, as the CPU would spin > anyway. > > This is a system running with two 10G cards running with DPDK: > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMM= AND > 8223 root 10 -10 260.6g 597516 19100 S 199.8 0.5 0:17.89 test= pmd > > And this is the same system with a DPDKoin port added: > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMM= AND > 9438 root 10 -10 260.6g 598892 19800 S 199.8 0.5 0:19.43 test= pmd > > As you can see, we don't observe any change in the CPU usage, and besides= , > the earned coins lowers the appliance TCO. > > Just for reference, a test run log follows: > > $ sudo testpmd --no-huge -m 1024 --no-pci --vdev eth_dpdkoin0 --vdev eth_= dpdkoin1 > EAL: Detected 8 lcore(s) > EAL: Detected 1 NUMA nodes > EAL: Multi-process socket /var/run/dpdk/rte/mp_socket > EAL: Selected IOVA mode 'VA' > EAL: Probing VFIO support... > testpmd: create a new mbuf pool : n 3456, size!76, so= cket=3D0 > testpmd: preferred mempool ops selected: ring_mp_mc > Configuring Port 0 (socket 0) > Port 0: 4A:50:3C:33:55:21 > Configuring Port 1 (socket 0) > Port 1: BA:BB:0A:BB:0C:CA > Checking link statuses... > Done > No commandline core given, start packet forwarding > io packet forwarding - ports=3D2 - cores=3D1 - streams=3D2 - NUMA support= enabled, MP allocation mode: native > Logical Core 1 (socket 0) forwards packets on 2 streams: > RX P=3D0/Q=3D0 (socket 0) -> TX P=3D1/Q=3D0 (socket 0) peer:00:00:00:00= :01 > RX P=3D1/Q=3D0 (socket 0) -> TX P=3D0/Q=3D0 (socket 0) peer:00:00:00:00= :00 > > io packet forwarding packets/burst2 > nb forwarding cores=3D1 - nb forwarding ports=3D2 > port 0: RX queue number: 1 Tx queue number: 1 > Rx offloads=3D0x0 Tx offloads=3D0x0 > RX queue: 0 > RX desc=3D0 - RX free threshold=3D0 > RX threshold registers: pthresh=3D0 hthresh=3D0 wthresh=3D0 > RX Offloads=3D0x0 > TX queue: 0 > TX desc=3D0 - TX free threshold=3D0 > TX threshold registers: pthresh=3D0 hthresh=3D0 wthresh=3D0 > TX offloads=3D0x0 - TX RS bit threshold=3D0 > port 1: RX queue number: 1 Tx queue number: 1 > Rx offloads=3D0x0 Tx offloads=3D0x0 > RX queue: 0 > RX desc=3D0 - RX free threshold=3D0 > RX threshold registers: pthresh=3D0 hthresh=3D0 wthresh=3D0 > RX Offloads=3D0x0 > TX queue: 0 > TX desc=3D0 - TX free threshold=3D0 > TX threshold registers: pthresh=3D0 hthresh=3D0 wthresh=3D0 > TX offloads=3D0x0 - TX RS bit threshold=3D0 > libbitcoin 0.1: mining on CPU2 > libbitcoin 0.1: mining on CPU4 > --- > config/common_base | 5 + > drivers/net/Makefile | 1 + > drivers/net/dpdkoin/Makefile | 23 + > drivers/net/dpdkoin/meson.build | 3 + > drivers/net/dpdkoin/rte_eth_dpdkoin.c | 696 ++++++++++++++++++ > .../net/dpdkoin/rte_pmd_dpdkoin_version.map | 3 + > mk/rte.app.mk | 1 + > 7 files changed, 732 insertions(+) > create mode 100644 drivers/net/dpdkoin/Makefile > create mode 100644 drivers/net/dpdkoin/meson.build > create mode 100644 drivers/net/dpdkoin/rte_eth_dpdkoin.c > create mode 100644 drivers/net/dpdkoin/rte_pmd_dpdkoin_version.map > Is it possible to have a unit test for this PMD? We could have the robot run some quick tests for us... ;-)