Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/110545/?format=api
https://patches.dpdk.org/api/patches/110545/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220430134059.80255-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": "<20220430134059.80255-2-cristian.dumitrescu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220430134059.80255-2-cristian.dumitrescu@intel.com", "date": "2022-04-30T13:40:59", "name": "[V3,2/2] examples/pipeline: support hash functions", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "cce4a9dca6b4e34b0e8b4201bbe9d8eced3f4dfa", "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/20220430134059.80255-2-cristian.dumitrescu@intel.com/mbox/", "series": [ { "id": 22748, "url": "https://patches.dpdk.org/api/series/22748/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=22748", "date": "2022-04-30T13:40:58", "name": "[V3,1/2] pipeline: support hash functions", "version": 3, "mbox": "https://patches.dpdk.org/series/22748/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/110545/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/110545/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 4C4D6A0507;\n\tSat, 30 Apr 2022 15:41:08 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 45C94410E6;\n\tSat, 30 Apr 2022 15:41:04 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id B170A4069D\n for <dev@dpdk.org>; Sat, 30 Apr 2022 15:41:02 +0200 (CEST)", "from orsmga003.jf.intel.com ([10.7.209.27])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 30 Apr 2022 06:41:01 -0700", "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by orsmga003.jf.intel.com with ESMTP; 30 Apr 2022 06:41:00 -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=1651326062; x=1682862062;\n h=from:to:subject:date:message-id:in-reply-to:references;\n bh=LW2rvRnIbEG748B3X1gxMmKEh76nSL5fhqyN5vCwykM=;\n b=gEOqqAXJfbQ/ZY9YbOolRUK0P7gbBfedAwsY9XC0dCmoUN0uHiclW1+3\n hwpEyTGVNhTFASxPH2XWUhrg4kM1UZi0cEaiLlcp+Mue0TvbIUFcN5++N\n nF+HuJZiYa0sj1w3iASPC8KFtv6JAFtppbZZMKTzeWKXCJkOJ1Li4tAas\n RaYfAb/6ZdfLqxvWV91S70F2a/1ROs5TsEFEIIQk9JSY4tXlzeQGxsa/a\n he/ifRMTciuIgD8ti4khuIbxTbN3u0jqiIcb/E2GdzQio7Q21i4fdhHuj\n BAsvXu5M3fChlNWrH2vPWIILjO1WbsDDJ1LezsN0u7tDTnlesf10BddYj Q==;", "X-IronPort-AV": [ "E=McAfee;i=\"6400,9594,10332\"; a=\"265728720\"", "E=Sophos;i=\"5.91,188,1647327600\"; d=\"scan'208\";a=\"265728720\"", "E=Sophos;i=\"5.91,188,1647327600\"; d=\"scan'208\";a=\"515302450\"" ], "X-ExtLoop1": "1", "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>", "To": "dev@dpdk.org", "Subject": "[PATCH V3 2/2] examples/pipeline: support hash functions", "Date": "Sat, 30 Apr 2022 14:40:59 +0100", "Message-Id": "<20220430134059.80255-2-cristian.dumitrescu@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20220430134059.80255-1-cristian.dumitrescu@intel.com>", "References": "<20220430133349.80152-1-cristian.dumitrescu@intel.com>\n <20220430134059.80255-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---\n examples/pipeline/examples/hash_func.cli | 35 +++++++\n examples/pipeline/examples/hash_func.spec | 107 ++++++++++++++++++++++\n 2 files changed, 142 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..df6e6e6205\n--- /dev/null\n+++ b/examples/pipeline/examples/hash_func.cli\n@@ -0,0 +1,35 @@\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+pipeline PIPELINE0 mirror slots 4 sessions 16\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..22c9e13411\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;\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": [ "V3", "2/2" ] }{ "id": 110545, "url": "