get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/76937/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 76937,
    "url": "http://patches.dpdk.org/api/patches/76937/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200908201830.74206-5-cristian.dumitrescu@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20200908201830.74206-5-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200908201830.74206-5-cristian.dumitrescu@intel.com",
    "date": "2020-09-08T20:17:53",
    "name": "[v3,04/41] pipeline: add SWX headers and meta-data",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c82596848cd884a8d6fad7058dfbb1dca649f6d6",
    "submitter": {
        "id": 19,
        "url": "http://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200908201830.74206-5-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 12034,
            "url": "http://patches.dpdk.org/api/series/12034/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12034",
            "date": "2020-09-08T20:17:52",
            "name": "Pipeline alignment with the P4 language",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/12034/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/76937/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/76937/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id D0490A04B1;\n\tTue,  8 Sep 2020 22:19:29 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9818B1C114;\n\tTue,  8 Sep 2020 22:19:01 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by dpdk.org (Postfix) with ESMTP id 9F4221BF8A\n for <dev@dpdk.org>; Tue,  8 Sep 2020 22:18:54 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 Sep 2020 13:18:36 -0700",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by fmsmga006.fm.intel.com with ESMTP; 08 Sep 2020 13:18:35 -0700"
        ],
        "IronPort-SDR": [
            "\n qEnCt4bSaMg1WupQOBQNbnDv2fugum27rFpsWQ7FhydlqOen7FBM6AfybLB1OISQIn2F0tL8QF\n uKfr1Sy6i8vg==",
            "\n sQChWTin4npWgud5Uu+q8nabO2svH2o46DL/3xPmw7QnG3lXPCnrB12DCf63J0zu+sEoeHQ1Ko\n 6v6o5A0r1e6A=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9738\"; a=\"145939368\"",
            "E=Sophos;i=\"5.76,407,1592895600\"; d=\"scan'208\";a=\"145939368\"",
            "E=Sophos;i=\"5.76,406,1592895600\"; d=\"scan'208\";a=\"504493368\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue,  8 Sep 2020 21:17:53 +0100",
        "Message-Id": "<20200908201830.74206-5-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200908201830.74206-1-cristian.dumitrescu@intel.com>",
        "References": "<20200907214032.95052-2-cristian.dumitrescu@intel.com>\n <20200908201830.74206-1-cristian.dumitrescu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 04/41] pipeline: add SWX headers and meta-data",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add support for dynamically-defined packet headers and meta-data to\nthe SWX pipeline. The header and meta-data format are defined by the\nstruct type they instantiate.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n lib/librte_pipeline/rte_pipeline_version.map |   3 +\n lib/librte_pipeline/rte_swx_pipeline.c       | 413 +++++++++++++++++++\n lib/librte_pipeline/rte_swx_pipeline.h       |  85 ++++\n 3 files changed, 501 insertions(+)",
    "diff": "diff --git a/lib/librte_pipeline/rte_pipeline_version.map b/lib/librte_pipeline/rte_pipeline_version.map\nindex 88fd38ca8..6a48c3666 100644\n--- a/lib/librte_pipeline/rte_pipeline_version.map\n+++ b/lib/librte_pipeline/rte_pipeline_version.map\n@@ -60,6 +60,9 @@ EXPERIMENTAL {\n \trte_swx_pipeline_port_in_config;\n \trte_swx_pipeline_port_out_type_register;\n \trte_swx_pipeline_port_out_config;\n+\trte_swx_pipeline_struct_type_register;\n+\trte_swx_pipeline_packet_header_register;\n+\trte_swx_pipeline_packet_metadata_register;\n \trte_swx_pipeline_build;\n \trte_swx_pipeline_free;\n };\ndiff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c\nindex 7aeac8cc8..cb2e32b83 100644\n--- a/lib/librte_pipeline/rte_swx_pipeline.c\n+++ b/lib/librte_pipeline/rte_swx_pipeline.c\n@@ -20,6 +20,25 @@ do {                                                                           \\\n #define CHECK_NAME(name, err_code)                                             \\\n \tCHECK((name) && (name)[0], err_code)\n \n+/*\n+ * Struct.\n+ */\n+struct field {\n+\tchar name[RTE_SWX_NAME_SIZE];\n+\tuint32_t n_bits;\n+\tuint32_t offset;\n+};\n+\n+struct struct_type {\n+\tTAILQ_ENTRY(struct_type) node;\n+\tchar name[RTE_SWX_NAME_SIZE];\n+\tstruct field *fields;\n+\tuint32_t n_fields;\n+\tuint32_t n_bits;\n+};\n+\n+TAILQ_HEAD(struct_type_tailq, struct_type);\n+\n /*\n  * Input port.\n  */\n@@ -71,24 +90,198 @@ struct port_out_runtime {\n \tvoid *obj;\n };\n \n+/*\n+ * Header.\n+ */\n+struct header {\n+\tTAILQ_ENTRY(header) node;\n+\tchar name[RTE_SWX_NAME_SIZE];\n+\tstruct struct_type *st;\n+\tuint32_t struct_id;\n+\tuint32_t id;\n+};\n+\n+TAILQ_HEAD(header_tailq, header);\n+\n+struct header_runtime {\n+\tuint8_t *ptr0;\n+};\n+\n+struct header_out_runtime {\n+\tuint8_t *ptr0;\n+\tuint8_t *ptr;\n+\tuint32_t n_bytes;\n+};\n+\n /*\n  * Pipeline.\n  */\n+struct thread {\n+\t/* Structures. */\n+\tuint8_t **structs;\n+\n+\t/* Packet headers. */\n+\tstruct header_runtime *headers; /* Extracted or generated headers. */\n+\tstruct header_out_runtime *headers_out; /* Emitted headers. */\n+\tuint8_t *header_storage;\n+\tuint8_t *header_out_storage;\n+\tuint64_t valid_headers;\n+\tuint32_t n_headers_out;\n+\n+\t/* Packet meta-data. */\n+\tuint8_t *metadata;\n+};\n+\n+#ifndef RTE_SWX_PIPELINE_THREADS_MAX\n+#define RTE_SWX_PIPELINE_THREADS_MAX 16\n+#endif\n+\n struct rte_swx_pipeline {\n+\tstruct struct_type_tailq struct_types;\n \tstruct port_in_type_tailq port_in_types;\n \tstruct port_in_tailq ports_in;\n \tstruct port_out_type_tailq port_out_types;\n \tstruct port_out_tailq ports_out;\n+\tstruct header_tailq headers;\n+\tstruct struct_type *metadata_st;\n+\tuint32_t metadata_struct_id;\n \n \tstruct port_in_runtime *in;\n \tstruct port_out_runtime *out;\n+\tstruct thread threads[RTE_SWX_PIPELINE_THREADS_MAX];\n \n+\tuint32_t n_structs;\n \tuint32_t n_ports_in;\n \tuint32_t n_ports_out;\n+\tuint32_t n_headers;\n \tint build_done;\n \tint numa_node;\n };\n \n+/*\n+ * Struct.\n+ */\n+static struct struct_type *\n+struct_type_find(struct rte_swx_pipeline *p, const char *name)\n+{\n+\tstruct struct_type *elem;\n+\n+\tTAILQ_FOREACH(elem, &p->struct_types, node)\n+\t\tif (strcmp(elem->name, name) == 0)\n+\t\t\treturn elem;\n+\n+\treturn NULL;\n+}\n+\n+int\n+rte_swx_pipeline_struct_type_register(struct rte_swx_pipeline *p,\n+\t\t\t\t      const char *name,\n+\t\t\t\t      struct rte_swx_field_params *fields,\n+\t\t\t\t      uint32_t n_fields)\n+{\n+\tstruct struct_type *st;\n+\tuint32_t i;\n+\n+\tCHECK(p, EINVAL);\n+\tCHECK_NAME(name, EINVAL);\n+\tCHECK(fields, EINVAL);\n+\tCHECK(n_fields, EINVAL);\n+\n+\tfor (i = 0; i < n_fields; i++) {\n+\t\tstruct rte_swx_field_params *f = &fields[i];\n+\t\tuint32_t j;\n+\n+\t\tCHECK_NAME(f->name, EINVAL);\n+\t\tCHECK(f->n_bits, EINVAL);\n+\t\tCHECK(f->n_bits <= 64, EINVAL);\n+\t\tCHECK((f->n_bits & 7) == 0, EINVAL);\n+\n+\t\tfor (j = 0; j < i; j++) {\n+\t\t\tstruct rte_swx_field_params *f_prev = &fields[j];\n+\n+\t\t\tCHECK(strcmp(f->name, f_prev->name), EINVAL);\n+\t\t}\n+\t}\n+\n+\tCHECK(!struct_type_find(p, name), EEXIST);\n+\n+\t/* Node allocation. */\n+\tst = calloc(1, sizeof(struct struct_type));\n+\tCHECK(st, ENOMEM);\n+\n+\tst->fields = calloc(n_fields, sizeof(struct field));\n+\tif (!st->fields) {\n+\t\tfree(st);\n+\t\tCHECK(0, ENOMEM);\n+\t}\n+\n+\t/* Node initialization. */\n+\tstrcpy(st->name, name);\n+\tfor (i = 0; i < n_fields; i++) {\n+\t\tstruct field *dst = &st->fields[i];\n+\t\tstruct rte_swx_field_params *src = &fields[i];\n+\n+\t\tstrcpy(dst->name, src->name);\n+\t\tdst->n_bits = src->n_bits;\n+\t\tdst->offset = st->n_bits;\n+\n+\t\tst->n_bits += src->n_bits;\n+\t}\n+\tst->n_fields = n_fields;\n+\n+\t/* Node add to tailq. */\n+\tTAILQ_INSERT_TAIL(&p->struct_types, st, node);\n+\n+\treturn 0;\n+}\n+\n+static int\n+struct_build(struct rte_swx_pipeline *p)\n+{\n+\tuint32_t i;\n+\n+\tfor (i = 0; i < RTE_SWX_PIPELINE_THREADS_MAX; i++) {\n+\t\tstruct thread *t = &p->threads[i];\n+\n+\t\tt->structs = calloc(p->n_structs, sizeof(uint8_t *));\n+\t\tCHECK(t->structs, ENOMEM);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static void\n+struct_build_free(struct rte_swx_pipeline *p)\n+{\n+\tuint32_t i;\n+\n+\tfor (i = 0; i < RTE_SWX_PIPELINE_THREADS_MAX; i++) {\n+\t\tstruct thread *t = &p->threads[i];\n+\n+\t\tfree(t->structs);\n+\t\tt->structs = NULL;\n+\t}\n+}\n+\n+static void\n+struct_free(struct rte_swx_pipeline *p)\n+{\n+\tstruct_build_free(p);\n+\n+\t/* Struct types. */\n+\tfor ( ; ; ) {\n+\t\tstruct struct_type *elem;\n+\n+\t\telem = TAILQ_FIRST(&p->struct_types);\n+\t\tif (!elem)\n+\t\t\tbreak;\n+\n+\t\tTAILQ_REMOVE(&p->struct_types, elem, node);\n+\t\tfree(elem->fields);\n+\t\tfree(elem);\n+\t}\n+}\n+\n /*\n  * Input port.\n  */\n@@ -413,6 +606,205 @@ port_out_free(struct rte_swx_pipeline *p)\n \t}\n }\n \n+/*\n+ * Header.\n+ */\n+static struct header *\n+header_find(struct rte_swx_pipeline *p, const char *name)\n+{\n+\tstruct header *elem;\n+\n+\tTAILQ_FOREACH(elem, &p->headers, node)\n+\t\tif (strcmp(elem->name, name) == 0)\n+\t\t\treturn elem;\n+\n+\treturn NULL;\n+}\n+\n+int\n+rte_swx_pipeline_packet_header_register(struct rte_swx_pipeline *p,\n+\t\t\t\t\tconst char *name,\n+\t\t\t\t\tconst char *struct_type_name)\n+{\n+\tstruct struct_type *st;\n+\tstruct header *h;\n+\tsize_t n_headers_max;\n+\n+\tCHECK(p, EINVAL);\n+\tCHECK_NAME(name, EINVAL);\n+\tCHECK_NAME(struct_type_name, EINVAL);\n+\n+\tCHECK(!header_find(p, name), EEXIST);\n+\n+\tst = struct_type_find(p, struct_type_name);\n+\tCHECK(st, EINVAL);\n+\n+\tn_headers_max = RTE_SIZEOF_FIELD(struct thread, valid_headers) * 8;\n+\tCHECK(p->n_headers < n_headers_max, ENOSPC);\n+\n+\t/* Node allocation. */\n+\th = calloc(1, sizeof(struct header));\n+\tCHECK(h, ENOMEM);\n+\n+\t/* Node initialization. */\n+\tstrcpy(h->name, name);\n+\th->st = st;\n+\th->struct_id = p->n_structs;\n+\th->id = p->n_headers;\n+\n+\t/* Node add to tailq. */\n+\tTAILQ_INSERT_TAIL(&p->headers, h, node);\n+\tp->n_headers++;\n+\tp->n_structs++;\n+\n+\treturn 0;\n+}\n+\n+static int\n+header_build(struct rte_swx_pipeline *p)\n+{\n+\tstruct header *h;\n+\tuint32_t n_bytes = 0, i;\n+\n+\tTAILQ_FOREACH(h, &p->headers, node) {\n+\t\tn_bytes += h->st->n_bits / 8;\n+\t}\n+\n+\tfor (i = 0; i < RTE_SWX_PIPELINE_THREADS_MAX; i++) {\n+\t\tstruct thread *t = &p->threads[i];\n+\t\tuint32_t offset = 0;\n+\n+\t\tt->headers = calloc(p->n_headers,\n+\t\t\t\t    sizeof(struct header_runtime));\n+\t\tCHECK(t->headers, ENOMEM);\n+\n+\t\tt->headers_out = calloc(p->n_headers,\n+\t\t\t\t\tsizeof(struct header_out_runtime));\n+\t\tCHECK(t->headers_out, ENOMEM);\n+\n+\t\tt->header_storage = calloc(1, n_bytes);\n+\t\tCHECK(t->header_storage, ENOMEM);\n+\n+\t\tt->header_out_storage = calloc(1, n_bytes);\n+\t\tCHECK(t->header_out_storage, ENOMEM);\n+\n+\t\tTAILQ_FOREACH(h, &p->headers, node) {\n+\t\t\tuint8_t *header_storage;\n+\n+\t\t\theader_storage = &t->header_storage[offset];\n+\t\t\toffset += h->st->n_bits / 8;\n+\n+\t\t\tt->headers[h->id].ptr0 = header_storage;\n+\t\t\tt->structs[h->struct_id] = header_storage;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static void\n+header_build_free(struct rte_swx_pipeline *p)\n+{\n+\tuint32_t i;\n+\n+\tfor (i = 0; i < RTE_SWX_PIPELINE_THREADS_MAX; i++) {\n+\t\tstruct thread *t = &p->threads[i];\n+\n+\t\tfree(t->headers_out);\n+\t\tt->headers_out = NULL;\n+\n+\t\tfree(t->headers);\n+\t\tt->headers = NULL;\n+\n+\t\tfree(t->header_out_storage);\n+\t\tt->header_out_storage = NULL;\n+\n+\t\tfree(t->header_storage);\n+\t\tt->header_storage = NULL;\n+\t}\n+}\n+\n+static void\n+header_free(struct rte_swx_pipeline *p)\n+{\n+\theader_build_free(p);\n+\n+\tfor ( ; ; ) {\n+\t\tstruct header *elem;\n+\n+\t\telem = TAILQ_FIRST(&p->headers);\n+\t\tif (!elem)\n+\t\t\tbreak;\n+\n+\t\tTAILQ_REMOVE(&p->headers, elem, node);\n+\t\tfree(elem);\n+\t}\n+}\n+\n+/*\n+ * Meta-data.\n+ */\n+int\n+rte_swx_pipeline_packet_metadata_register(struct rte_swx_pipeline *p,\n+\t\t\t\t\t  const char *struct_type_name)\n+{\n+\tstruct struct_type *st = NULL;\n+\n+\tCHECK(p, EINVAL);\n+\n+\tCHECK_NAME(struct_type_name, EINVAL);\n+\tst  = struct_type_find(p, struct_type_name);\n+\tCHECK(st, EINVAL);\n+\tCHECK(!p->metadata_st, EINVAL);\n+\n+\tp->metadata_st = st;\n+\tp->metadata_struct_id = p->n_structs;\n+\n+\tp->n_structs++;\n+\n+\treturn 0;\n+}\n+\n+static int\n+metadata_build(struct rte_swx_pipeline *p)\n+{\n+\tuint32_t n_bytes = p->metadata_st->n_bits / 8;\n+\tuint32_t i;\n+\n+\t/* Thread-level initialization. */\n+\tfor (i = 0; i < RTE_SWX_PIPELINE_THREADS_MAX; i++) {\n+\t\tstruct thread *t = &p->threads[i];\n+\t\tuint8_t *metadata;\n+\n+\t\tmetadata = calloc(1, n_bytes);\n+\t\tCHECK(metadata, ENOMEM);\n+\n+\t\tt->metadata = metadata;\n+\t\tt->structs[p->metadata_struct_id] = metadata;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static void\n+metadata_build_free(struct rte_swx_pipeline *p)\n+{\n+\tuint32_t i;\n+\n+\tfor (i = 0; i < RTE_SWX_PIPELINE_THREADS_MAX; i++) {\n+\t\tstruct thread *t = &p->threads[i];\n+\n+\t\tfree(t->metadata);\n+\t\tt->metadata = NULL;\n+\t}\n+}\n+\n+static void\n+metadata_free(struct rte_swx_pipeline *p)\n+{\n+\tmetadata_build_free(p);\n+}\n+\n /*\n  * Pipeline.\n  */\n@@ -429,11 +821,14 @@ rte_swx_pipeline_config(struct rte_swx_pipeline **p, int numa_node)\n \tCHECK(pipeline, ENOMEM);\n \n \t/* Initialization. */\n+\tTAILQ_INIT(&pipeline->struct_types);\n \tTAILQ_INIT(&pipeline->port_in_types);\n \tTAILQ_INIT(&pipeline->ports_in);\n \tTAILQ_INIT(&pipeline->port_out_types);\n \tTAILQ_INIT(&pipeline->ports_out);\n+\tTAILQ_INIT(&pipeline->headers);\n \n+\tpipeline->n_structs = 1; /* Struct 0 is reserved for action_data. */\n \tpipeline->numa_node = numa_node;\n \n \t*p = pipeline;\n@@ -446,8 +841,11 @@ rte_swx_pipeline_free(struct rte_swx_pipeline *p)\n \tif (!p)\n \t\treturn;\n \n+\tmetadata_free(p);\n+\theader_free(p);\n \tport_out_free(p);\n \tport_in_free(p);\n+\tstruct_free(p);\n \n \tfree(p);\n }\n@@ -468,12 +866,27 @@ rte_swx_pipeline_build(struct rte_swx_pipeline *p)\n \tif (status)\n \t\tgoto error;\n \n+\tstatus = struct_build(p);\n+\tif (status)\n+\t\tgoto error;\n+\n+\tstatus = header_build(p);\n+\tif (status)\n+\t\tgoto error;\n+\n+\tstatus = metadata_build(p);\n+\tif (status)\n+\t\tgoto error;\n+\n \tp->build_done = 1;\n \treturn 0;\n \n error:\n+\tmetadata_build_free(p);\n+\theader_build_free(p);\n \tport_out_build_free(p);\n \tport_in_build_free(p);\n+\tstruct_build_free(p);\n \n \treturn status;\n }\ndiff --git a/lib/librte_pipeline/rte_swx_pipeline.h b/lib/librte_pipeline/rte_swx_pipeline.h\nindex 2be83bd35..4a7b679a4 100644\n--- a/lib/librte_pipeline/rte_swx_pipeline.h\n+++ b/lib/librte_pipeline/rte_swx_pipeline.h\n@@ -147,6 +147,91 @@ rte_swx_pipeline_port_out_config(struct rte_swx_pipeline *p,\n \t\t\t\t const char *port_type_name,\n \t\t\t\t void *args);\n \n+/*\n+ * Packet headers and meta-data\n+ */\n+\n+/** Structure (struct) field. */\n+struct rte_swx_field_params {\n+\t/** Struct field name. */\n+\tconst char *name;\n+\n+\t/** Struct field size (in bits).\n+\t * Restriction: All struct fields must be a multiple of 8 bits.\n+\t * Restriction: All struct fields must be no greater than 64 bits.\n+\t */\n+\tuint32_t n_bits;\n+};\n+\n+/**\n+ * Pipeline struct type register\n+ *\n+ * Structs are used extensively in many part of the pipeline to define the size\n+ * and layout of a specific memory piece such as: headers, meta-data, action\n+ * data stored in a table entry, mailboxes for extern objects and functions.\n+ * Similar to C language structs, they are a well defined sequence of fields,\n+ * with each field having a unique name and a constant size.\n+ *\n+ * @param[in] p\n+ *   Pipeline handle.\n+ * @param[in] name\n+ *   Struct type name.\n+ * @param[in] fields\n+ *   The sequence of struct fields.\n+ * @param[in] n_fields\n+ *   The number of struct fields.\n+ * @return\n+ *   0 on success or the following error codes otherwise:\n+ *   -EINVAL: Invalid argument;\n+ *   -ENOMEM: Not enough space/cannot allocate memory;\n+ *   -EEXIST: Struct type with this name already exists.\n+ */\n+__rte_experimental\n+int\n+rte_swx_pipeline_struct_type_register(struct rte_swx_pipeline *p,\n+\t\t\t\t      const char *name,\n+\t\t\t\t      struct rte_swx_field_params *fields,\n+\t\t\t\t      uint32_t n_fields);\n+\n+/**\n+ * Pipeline packet header register\n+ *\n+ * @param[in] p\n+ *   Pipeline handle.\n+ * @param[in] name\n+ *   Header name.\n+ * @param[in] struct_type_name\n+ *   The struct type instantiated by this packet header.\n+ * @return\n+ *   0 on success or the following error codes otherwise:\n+ *   -EINVAL: Invalid argument;\n+ *   -ENOMEM: Not enough space/cannot allocate memory;\n+ *   -EEXIST: Header with this name already exists;\n+ *   -ENOSPC: Maximum number of headers reached for the pipeline.\n+ */\n+__rte_experimental\n+int\n+rte_swx_pipeline_packet_header_register(struct rte_swx_pipeline *p,\n+\t\t\t\t\tconst char *name,\n+\t\t\t\t\tconst char *struct_type_name);\n+\n+/**\n+ * Pipeline packet meta-data register\n+ *\n+ * @param[in] p\n+ *   Pipeline handle.\n+ * @param[in] struct_type_name\n+ *   The struct type instantiated by the packet meta-data.\n+ * @return\n+ *   0 on success or the following error codes otherwise:\n+ *   -EINVAL: Invalid argument.\n+ */\n+__rte_experimental\n+int\n+rte_swx_pipeline_packet_metadata_register(struct rte_swx_pipeline *p,\n+\t\t\t\t\t  const char *struct_type_name);\n+\n+\n /**\n  * Pipeline build\n  *\n",
    "prefixes": [
        "v3",
        "04/41"
    ]
}