Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/111563/?format=api
https://patches.dpdk.org/api/patches/111563/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220520223125.2036-2-cristian.dumitrescu@intel.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20220520223125.2036-2-cristian.dumitrescu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220520223125.2036-2-cristian.dumitrescu@intel.com", "date": "2022-05-20T22:31:25", "name": "[V5,2/2] examples/pipeline: support hash functions", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "0a8a1bc37e17271e71a816958e91ed0a0d283360", "submitter": { "id": 19, "url": "https://patches.dpdk.org/api/people/19/?format=api", "name": "Cristian Dumitrescu", "email": "cristian.dumitrescu@intel.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220520223125.2036-2-cristian.dumitrescu@intel.com/mbox/", "series": [ { "id": 23073, "url": "https://patches.dpdk.org/api/series/23073/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=23073", "date": "2022-05-20T22:31:24", "name": "[V5,1/2] pipeline: support hash functions", "version": 5, "mbox": "https://patches.dpdk.org/series/23073/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/111563/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/111563/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 5EF40A0093;\n\tSat, 21 May 2022 00:31:35 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 13BBC41611;\n\tSat, 21 May 2022 00:31:33 +0200 (CEST)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by mails.dpdk.org (Postfix) with ESMTP id A6D8740156\n for <dev@dpdk.org>; Sat, 21 May 2022 00:31:29 +0200 (CEST)", "from orsmga007.jf.intel.com ([10.7.209.58])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 20 May 2022 15:31:28 -0700", "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by orsmga007.jf.intel.com with ESMTP; 20 May 2022 15:31:27 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1653085889; x=1684621889;\n h=from:to:subject:date:message-id:in-reply-to:references;\n bh=212w5a94Vw4iYfV8zY16JS8fqAc2jzu3ICEt3rBEZSI=;\n b=gggYSNR5gnuf6QY7f7e3mcN1Cof6feu8WMpVn6hgcZXGbwq4nZEkLYg4\n bbevkm505xUBNB9PiKtVTUvnUd2fdJ4IUqgb0HlSCqsXCm/597Ny3Ziy3\n zkyTEE61/cmCz63rbIyrDqfgBXc3m34OvPdeOcathXCaqBtHutylV2fcM\n OS678nqHq2FhfKOGsOjhxXuECOafmKOT+TxrvKSGsNDy9N+9uuUe0NoTF\n aX/T2AJTzrrRIhJQLDbe0k4wxNGayFc9k04V5ZSnGisRiz8l9GRKabaS/\n cfJMs3UyHXpx+6gQH6LhlmZEmzTZ3C5YFT4/xMAfWfk/+Gq2k+B9Iu90Q Q==;", "X-IronPort-AV": [ "E=McAfee;i=\"6400,9594,10353\"; a=\"253272121\"", "E=Sophos;i=\"5.91,240,1647327600\"; d=\"scan'208\";a=\"253272121\"", "E=Sophos;i=\"5.91,240,1647327600\"; d=\"scan'208\";a=\"571055061\"" ], "X-ExtLoop1": "1", "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>", "To": "dev@dpdk.org", "Subject": "[PATCH V5 2/2] examples/pipeline: support hash functions", "Date": "Fri, 20 May 2022 23:31:25 +0100", "Message-Id": "<20220520223125.2036-2-cristian.dumitrescu@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20220520223125.2036-1-cristian.dumitrescu@intel.com>", "References": "<20220504112343.21723-1-cristian.dumitrescu@intel.com>\n <20220520223125.2036-1-cristian.dumitrescu@intel.com>", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "Add example for hash function operation.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\nChange log:\n\nV4:\n-Removed redundant line in the CLI file.\n-Added comment on the crc32 hash function in the .spec file.\n\n examples/pipeline/examples/hash_func.cli | 34 +++++++\n examples/pipeline/examples/hash_func.spec | 107 ++++++++++++++++++++++\n 2 files changed, 141 insertions(+)\n create mode 100644 examples/pipeline/examples/hash_func.cli\n create mode 100644 examples/pipeline/examples/hash_func.spec", "diff": "diff --git a/examples/pipeline/examples/hash_func.cli b/examples/pipeline/examples/hash_func.cli\nnew file mode 100644\nindex 0000000000..d65cd62d17\n--- /dev/null\n+++ b/examples/pipeline/examples/hash_func.cli\n@@ -0,0 +1,34 @@\n+; SPDX-License-Identifier: BSD-3-Clause\n+; Copyright(c) 2022 Intel Corporation\n+\n+;\n+; Customize the LINK parameters to match your setup.\n+;\n+mempool MEMPOOL0 buffer 2304 pool 32K cache 256 cpu 0\n+\n+link LINK0 dev 0000:18:00.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on\n+link LINK1 dev 0000:18:00.1 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on\n+link LINK2 dev 0000:3b:00.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on\n+link LINK3 dev 0000:3b:00.1 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on\n+\n+;\n+; PIPELINE0 setup.\n+;\n+pipeline PIPELINE0 create 0\n+\n+pipeline PIPELINE0 port in 0 link LINK0 rxq 0 bsz 32\n+pipeline PIPELINE0 port in 1 link LINK1 rxq 0 bsz 32\n+pipeline PIPELINE0 port in 2 link LINK2 rxq 0 bsz 32\n+pipeline PIPELINE0 port in 3 link LINK3 rxq 0 bsz 32\n+\n+pipeline PIPELINE0 port out 0 link LINK0 txq 0 bsz 32\n+pipeline PIPELINE0 port out 1 link LINK1 txq 0 bsz 32\n+pipeline PIPELINE0 port out 2 link LINK2 txq 0 bsz 32\n+pipeline PIPELINE0 port out 3 link LINK3 txq 0 bsz 32\n+\n+pipeline PIPELINE0 build ./examples/pipeline/examples/hash_func.spec\n+\n+;\n+; Pipelines-to-threads mapping.\n+;\n+thread 1 pipeline PIPELINE0 enable\ndiff --git a/examples/pipeline/examples/hash_func.spec b/examples/pipeline/examples/hash_func.spec\nnew file mode 100644\nindex 0000000000..a3275a17da\n--- /dev/null\n+++ b/examples/pipeline/examples/hash_func.spec\n@@ -0,0 +1,107 @@\n+; SPDX-License-Identifier: BSD-3-Clause\n+; Copyright(c) 2022 Intel Corporation\n+\n+; This simple example illustrates how to compute a hash signature over an n-tuple set of fields read\n+; from the packet headers and/or the packet meta-data by using the \"hash\" instruction. In this\n+; specific example, the n-tuple is the classical DiffServ 5-tuple.\n+\n+//\n+// Headers\n+//\n+struct ethernet_h {\n+\tbit<48> dst_addr\n+\tbit<48> src_addr\n+\tbit<16> ethertype\n+}\n+\n+struct ipv4_h {\n+\tbit<8> ver_ihl\n+\tbit<8> diffserv\n+\tbit<16> total_len\n+\tbit<16> identification\n+\tbit<16> flags_offset\n+\tbit<8> ttl\n+\tbit<8> protocol\n+\tbit<16> hdr_checksum\n+\tbit<32> src_addr\n+\tbit<32> dst_addr\n+}\n+\n+struct udp_h {\n+\tbit<16> src_port\n+\tbit<16> dst_port\n+\tbit<16> length\n+\tbit<16> checksum\n+}\n+\n+header ethernet instanceof ethernet_h\n+header ipv4 instanceof ipv4_h\n+header udp instanceof udp_h\n+\n+//\n+// Meta-data.\n+//\n+struct metadata_t {\n+\tbit<32> port\n+\tbit<32> src_addr\n+\tbit<32> dst_addr\n+\tbit<8> protocol\n+\tbit<16> src_port\n+\tbit<16> dst_port\n+\tbit<32> hash\n+}\n+\n+metadata instanceof metadata_t\n+\n+//\n+// Pipeline.\n+//\n+apply {\n+\t//\n+\t// RX and parse.\n+\t//\n+\trx m.port\n+\textract h.ethernet\n+\textract h.ipv4\n+\textract h.udp\n+\n+\t//\n+\t// Prepare the n-tuple to be hashed in meta-data.\n+\t//\n+\t// This is required when:\n+\t// a) The n-tuple fields are part of different headers;\n+\t// b) Some n-tuple fields come from headers and some from meta-data.\n+\t//\n+\tmov m.src_addr h.ipv4.src_addr\n+\tmov m.dst_addr h.ipv4.dst_addr\n+\tmov m.protocol h.ipv4.protocol\n+\tmov m.src_port h.udp.src_port\n+\tmov m.dst_port h.udp.dst_port\n+\n+\t//\n+\t// Compute the hash over the n-tuple.\n+\t//\n+\t// Details:\n+\t// a) Hash function: jhash. Another available option is crc32.\n+\t// b) Destination (i.e. hash result): m.hash;\n+\t// c) Source (i.e. n-tuple to be hashed): The 5-tuple formed by the meta-data fields\n+\t// (m.src_addr, m.dst_addr, m.protocol, m.src_port, m.dst_port). Only the first and\n+\t// the last n-tuple fields are specified in the hash instruction, but all the fields\n+\t// in between are part of the n-tuple to be hashed.\n+\t//\n+\thash jhash m.hash m.src_addr m.dst_port\n+\n+\t//\n+\t// Use the computed hash to create a uniform distribution of pkts across the 4 output ports.\n+\t//\n+\tand m.hash 3\n+\tmov m.port m.hash\n+\n+\t//\n+\t// De-parse and TX.\n+\t//\n+\temit h.ethernet\n+\temit h.ipv4\n+\temit h.udp\n+\ttx m.port\n+}\n", "prefixes": [ "V5", "2/2" ] }{ "id": 111563, "url": "