From patchwork Thu Aug 4 16:58:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Dumitrescu X-Patchwork-Id: 114644 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F3AE2A00C4; Thu, 4 Aug 2022 19:01:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7907D42CB6; Thu, 4 Aug 2022 18:59:19 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 1A1E842C93 for ; Thu, 4 Aug 2022 18:59:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659632358; x=1691168358; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=soDfUIsL6Hn8tyVJG90ZJY+owP6/vBB+tJeR7FDESoQ=; b=m2/Ce86qOJazKSeHLmT8ixa6pqOPl4iDjyj/sTUg9urLvQqlykxcwG8u vx9O1UHQWYVwSfJBbhq7xkxYbkViNyO3cy28vqmQEROcIi/g1HZ+VMwYQ J39GiCoccXTid8Krorq42gNe7FsGYOOB+4QArmo2m9eYLQVIeoNFgV5wa HU0p9y21UzJJlZQfn0RkqtV9Gm04CSYyRJ8a/z1E0+S1AyqmzbPsJuvpz JLFS3lpZ+kBAQCnqkqF7d52qBBGF+O1mA4/OF0jm0FbsIbpjRhD4FdApY nLgMRXL1MKjs9cTHF62xoFt8GnsIBgkQcRoiY871AunuLmIB7rfXAmoBn g==; X-IronPort-AV: E=McAfee;i="6400,9594,10429"; a="290000228" X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="290000228" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2022 09:59:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="636163288" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com) ([10.237.223.157]) by orsmga001.jf.intel.com with ESMTP; 04 Aug 2022 09:59:16 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Cc: jasvinder.singh@intel.com, yogesh.jangra@intel.com Subject: [PATCH 21/21] net/softnic: update the default device program Date: Thu, 4 Aug 2022 16:58:39 +0000 Message-Id: <20220804165839.1074817-22-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220804165839.1074817-1-cristian.dumitrescu@intel.com> References: <20220804165839.1074817-1-cristian.dumitrescu@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Update the default device program. Signed-off-by: Cristian Dumitrescu Signed-off-by: Yogesh Jangra --- drivers/net/softnic/firmware.cli | 51 ++++++++++++++++++++---------- drivers/net/softnic/firmware.spec | 19 +++++++++++ drivers/net/softnic/firmware_rx.io | 30 ++++++++++++++++++ drivers/net/softnic/firmware_tx.io | 30 ++++++++++++++++++ 4 files changed, 114 insertions(+), 16 deletions(-) create mode 100644 drivers/net/softnic/firmware.spec create mode 100644 drivers/net/softnic/firmware_rx.io create mode 100644 drivers/net/softnic/firmware_tx.io diff --git a/drivers/net/softnic/firmware.cli b/drivers/net/softnic/firmware.cli index 300cf6e33f..8f1ff3bbb7 100644 --- a/drivers/net/softnic/firmware.cli +++ b/drivers/net/softnic/firmware.cli @@ -1,21 +1,40 @@ ; SPDX-License-Identifier: BSD-3-Clause -; Copyright(c) 2018 Intel Corporation +; Copyright(c) 2022 Intel Corporation -link LINK dev 0000:02:00.0 +# Example command line for the DPDK test-pmd application. Out of the 3 application cores (see the +# -c argument), core 0 is running the master thread doing configuration and CLI, core 1 +# is running the forwarding thread, and core 2 is setup as service core (see the -s +# argument) for the purpose of running the Soft NIC device: +# +# ./build/app/dpdk-testpmd -c 7 -s 4 --vdev 'net_softnic0,firmware=./drivers/net/softnic/firmware.cli,cpu_id=0,conn_port=8086' -- -i +# +# Commands from within the DPDK test-pmd application: +# +# testpmd> set portlist +# testpmd> show config fwd +# testpmd> start +# +# To setup the CLI prompt to the Soft NIC device, the DPDK test-pmd application needs to be modified +# to call the rte_pmd_softnic_manage() function. Once the Soft NIC device is started, the command to +# get the CLI prompt is: +# +# telnet 0.0.0.0 8086 -pipeline RX period 10 offset_port_id 0 -pipeline RX port in bsz 32 link LINK rxq 0 -pipeline RX port out bsz 32 swq RXQ0 -pipeline RX table match stub -pipeline RX port in 0 table 0 -pipeline RX table 0 rule add match default action fwd port 0 +; +; Pipeline code generation & shared object library build. +; +pipeline codegen ./drivers/net/softnic/firmware.spec /tmp/firmware.c +pipeline libbuild /tmp/firmware.c /tmp/firmware.so -pipeline TX period 10 offset_port_id 0 -pipeline TX port in bsz 32 swq TXQ0 -pipeline TX port out bsz 32 link LINK txq 0 -pipeline TX table match stub -pipeline TX port in 0 table 0 -pipeline TX table 0 rule add match default action fwd port 0 +; +; List of pipelines. +; +pipeline RX build lib /tmp/firmware.so io ./drivers/net/softnic/firmware_rx.io numa 0 +pipeline TX build lib /tmp/firmware.so io ./drivers/net/softnic/firmware_tx.io numa 0 -thread 1 pipeline RX enable -thread 1 pipeline TX enable +; +; Pipelines-to-threads mapping. For the Soft NIC devices, the pipelines can be mapped to any of the +; application service cores (see the -s argument): +; +thread 2 pipeline RX enable +thread 2 pipeline TX enable diff --git a/drivers/net/softnic/firmware.spec b/drivers/net/softnic/firmware.spec new file mode 100644 index 0000000000..106caae735 --- /dev/null +++ b/drivers/net/softnic/firmware.spec @@ -0,0 +1,19 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +// +// Meta-data. +// +struct metadata_t { + bit<32> port +} + +metadata instanceof metadata_t + +// +// Pipeline. +// +apply { + rx m.port + tx m.port +} diff --git a/drivers/net/softnic/firmware_rx.io b/drivers/net/softnic/firmware_rx.io new file mode 100644 index 0000000000..9baa4612b1 --- /dev/null +++ b/drivers/net/softnic/firmware_rx.io @@ -0,0 +1,30 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline input ports. +; +; Syntax: +; +; port in ethdev rxq bsz +; port in ring bsz +; port in source mempool file loop packets +; port in fd mtu mempool bsz +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ethdev 0000:18:00.0 rxq 0 bsz 32 + +; +; Pipeline output ports. +; +; Syntax: +; +; port out ethdev txq bsz +; port out ring bsz +; port out sink file | none +; port out fd bsz +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ring RXQ0 bsz 32 diff --git a/drivers/net/softnic/firmware_tx.io b/drivers/net/softnic/firmware_tx.io new file mode 100644 index 0000000000..4c4608b105 --- /dev/null +++ b/drivers/net/softnic/firmware_tx.io @@ -0,0 +1,30 @@ +; SPDX-License-Identifier: BSD-3-Clause +; Copyright(c) 2022 Intel Corporation + +; +; Pipeline input ports. +; +; Syntax: +; +; port in ethdev rxq bsz +; port in ring bsz +; port in source mempool file loop packets +; port in fd mtu mempool bsz +; +; Note: Customize the parameters below to match your setup. +; +port in 0 ring TXQ0 bsz 32 + +; +; Pipeline output ports. +; +; Syntax: +; +; port out ethdev txq bsz +; port out ring bsz +; port out sink file | none +; port out fd bsz +; +; Note: Customize the parameters below to match your setup. +; +port out 0 ethdev 0000:18:00.0 txq 0 bsz 32