From patchwork Fri Jan 11 12:24:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 155348 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp517807jaa; Fri, 11 Jan 2019 04:27:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN6IMbtbgJo4UWnoHOfeF3dcut/EMj3nfiYlQ4XdOhc8QHScwJTT8+xgVmNtkdrcB0d3Ft83 X-Received: by 2002:a5d:66c1:: with SMTP id k1mr13010433wrw.132.1547209621789; Fri, 11 Jan 2019 04:27:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547209621; cv=none; d=google.com; s=arc-20160816; b=jGJQBcugPeMtP1njFt3eRhq7hRUP3HBdW+ED8R5e4c7uVgPWAoz5YsDMm11X86cjGD izSsMxcgyVq1xrbcpD1Dyc1lujuUwBcH72BFVR0nV7AITH0KGAjl+Tu3F5I3ytFlksqU 3U01143c32wAKStYQydYWHDpVnRC/+S4lb50RTHwAOPTYzHiPvFfCRKiiq5YuQ2yChog Wv5liAFdWDZq6AEIpBnJS6es6JcGNH4h+HzaJgzoYrOXtzxiyBj+YwYgHRLHFbCBLy3W o74js/aQ38paqa3oS2yKJyizHb8T81uSFohEKrcDS4auXQ2OAhMBvb0kba5IsVhCz7cW KE9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=9q55Feyxk3PPmMigXFOKyK/svdTV1hC/yIK2lv7Mj/A=; b=n99sDQ7v4ENFIvYLgn42XdVD/H18swmCqTPXN7bpPqOj7gxb9ENBZd87EjTELM0x3Z doiw2IIZbayq1vtTkkfn9Ljkzt0rl82AuOgkwDgl9HhaNtFz0OdOQLEDKnap2G1jMbOi mfJ6S/BbfYfOvc3SRTmTPOD8rj40+ycNwdQNpXTzbitlmuTsyxK5tNBPdnaS2TJy6Cet Eu753Mv1y0bbEWsxyvswM4Fqu14eKe5uQhvY92DkOHzkPsgFKtSm3MMAdMHKm7e4ZjUG LHUZppI8j1Gm/K/vut5qQZgC9yNknlnsKTNHL6ElzyewEKhLjUPwCWI0/svHgBQmGdEx om7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b="j2TK/PVA"; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id p11si47694534wrg.237.2019.01.11.04.27.01; Fri, 11 Jan 2019 04:27:01 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b="j2TK/PVA"; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 369AE1BC74; Fri, 11 Jan 2019 13:24:58 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130047.outbound.protection.outlook.com [40.107.13.47]) by dpdk.org (Postfix) with ESMTP id 4D2001BC73 for ; Fri, 11 Jan 2019 13:24:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9q55Feyxk3PPmMigXFOKyK/svdTV1hC/yIK2lv7Mj/A=; b=j2TK/PVAm4pR52YCgD1y6CtzdADpXNMcL93r4vlTK/CRmnpbEqESU7gA2gUNvRToTj5QCEcz0B6QfgAA6lRyrf85Z6TV2+lQo/JGEZJdNVWNw3t0dLddzgaxUYXMTOLGKsK959TNYOYXKlhnSrRIkRjSZHu4HYgvt8pR99J8XSk= Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (20.177.56.80) by VI1PR04MB5455.eurprd04.prod.outlook.com (20.178.121.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.14; Fri, 11 Jan 2019 12:24:55 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::b1eb:7e7e:7b90:7b4]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::b1eb:7e7e:7b90:7b4%4]) with mapi id 15.20.1516.016; Fri, 11 Jan 2019 12:24:55 +0000 From: Shreyansh Jain To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Nipun Gupta Thread-Topic: [PATCH v3 15/19] net/dpaa2: add dpdmux initialization and configuration Thread-Index: AQHUqaipatMqzC/pK0mpuiYuRBxF9g== Date: Fri, 11 Jan 2019 12:24:55 +0000 Message-ID: <20190111122305.7133-16-shreyansh.jain@nxp.com> References: <20190111115712.6482-1-shreyansh.jain@nxp.com> <20190111122305.7133-1-shreyansh.jain@nxp.com> In-Reply-To: <20190111122305.7133-1-shreyansh.jain@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.254.130] x-mailer: git-send-email 2.17.1 x-clientproxiedby: TY2PR01CA0017.jpnprd01.prod.outlook.com (2603:1096:404:a::29) To VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:71::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR04MB5455; 6:Hn34q84GiccXjnrIGvelS+41ILponl4tj+DoMZInTGQlip5m8fhX8XuJhRdganPyPbPfoWh8H1A046jqe4mXGcDc/gqi1iARREoJ1XP35bLw5sHwgx3S/2mFQL/f7oWtEMN3scgjg7Rp4bSD9z2DlsQW3bmT2l3hEyEju0EPnDiG6Q91vxZucDJwExjC0OWE++mP/G78f7DsUEF8Sg2ehzCeJJG4sbDmmj28W9k0VW0p1xU6Q0IgZ2HBqQumv0MDe1SrhKf33tY1oZe1xcHpFG35/c4IgJaDMTJTFzdiOFYb6hk+S7t3U2CDEZ2T85EbGIQyu1W0BxRK61n0DWyvPn8Ah/mEWxmci6v/HpgaJ7zbPbXCQTVChtmk6xvGbYZntdNHoCCbg4XxsVpCDocXHwHR2Qi/U4qD6AselRM6lljrJTKDAd9r49czShsWnU7gRjynrH/L5Eri5uZoQ3rOMA==; 5:4YnTRJrjPLlDbHC9UL112zsy/xKvW9FSw/oC9iL0JKuesSYC5ZsHEzXJo7X97TP7farqia3PUFK3v+T4RpS1z6ls5tN35Kk04mU2QUWFtaWg9TnZsNL61/5RmsLEw0xydLI5yFkNVsFj3Rx4ng4b3RHzgXmw1GGB5dOAvHIKABs3NNZuz39QRE2zjjKh/Ez2TdKeW4w6jep0Z6ip1KTqAw==; 7:/KbzQ5mCt2Dif7CYKZ3omP8A8QeGGD/4a7UEnoCpJ2sknv1D4Y7fAtbIvcjHWYyxsQxJ6D/Y1NxnKQix78GI/IjGbZh9MGPj5FQEskmv8ynVWD279ZORpfvQB6eNdBArOe8kyj9jBBfGv6HoHlIn5A== x-ms-office365-filtering-correlation-id: 84ecc27b-937e-4250-8ded-08d677bfcb5b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB5455; x-ms-traffictypediagnostic: VI1PR04MB5455: x-microsoft-antispam-prvs: x-forefront-prvs: 09144DB0F7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(39860400002)(396003)(346002)(189003)(199004)(66066001)(186003)(86362001)(71200400001)(2351001)(71190400001)(55236004)(386003)(36756003)(6506007)(26005)(99286004)(105586002)(6116002)(14444005)(106356001)(102836004)(2906002)(54906003)(5660300001)(3846002)(256004)(8936002)(97736004)(78486014)(50226002)(2501003)(6486002)(305945005)(6436002)(14454004)(7736002)(8676002)(316002)(1730700003)(81166006)(81156014)(5640700003)(4326008)(2616005)(446003)(6916009)(478600001)(1076003)(52116002)(6512007)(44832011)(486006)(76176011)(53936002)(11346002)(68736007)(476003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB5455; H:VI1PR04MB4688.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: vWI168rHr6BLoT0S6Tk5Yn78RAuaGnO4yGJg0PYeaKfgbAxSRrw80LrdwiUYp/h9+hSHJQX0RR7N0IT2RaSpb4E+Bndqg220BlG5cDGvfPiJOcMyjroki6XE8NC2snOjsuQBbRpmMp6UEGAMt7hhYLjaPPbv9MeEMBqBWpRNo3RVWvfZg17IUJi2dgtO//cYNFdCN1rkJIReW8UcsjHD6K6UNqPNjIAmRy8Ke7KLa/5K811Gqz9qe0vVtKIrgxX08NDj75iMIFz+QpYdM+w+vjflu/adXXiTGssjm3fEnIsWOCWN0TQ/cx/RMOtLDP3uSnYY2vyMaIK3WayGCLviVWF4K0EwhHgRG7EqozYKb8eW+7AVpbiTSmuH8UmyTCy3AoHEGu+w8hAO5O2qDmbJM+hCG2EsiWxZmpbt1smMTvI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84ecc27b-937e-4250-8ded-08d677bfcb5b X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2019 12:24:53.0181 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5455 Subject: [dpdk-dev] [PATCH v3 15/19] net/dpaa2: add dpdmux initialization and configuration 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" From: Nipun Gupta This patch introduces an rte pmd API to configure dpdmux from the application. dpdmux can work in association with dpni as an additional distribution capability on the NIC. Signed-off-by: Nipun Gupta --- drivers/net/dpaa2/Makefile | 1 + drivers/net/dpaa2/dpaa2_ethdev.h | 2 + drivers/net/dpaa2/dpaa2_mux.c | 222 ++++++++++++++++++++ drivers/net/dpaa2/meson.build | 1 + drivers/net/dpaa2/rte_pmd_dpaa2.h | 23 ++ drivers/net/dpaa2/rte_pmd_dpaa2_version.map | 1 + 6 files changed, 250 insertions(+) create mode 100644 drivers/net/dpaa2/dpaa2_mux.c -- 2.17.1 diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile index c58a39725..562551175 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -33,6 +33,7 @@ CFLAGS += -DALLOW_EXPERIMENTAL_API SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += base/dpaa2_hw_dpni.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_rxtx.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_mux.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpni.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpkg.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpdmux.c diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 7cf6e4191..420ad6446 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -11,6 +11,8 @@ #include #include +#include + #include #include diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c new file mode 100644 index 000000000..1d043dcdc --- /dev/null +++ b/drivers/net/dpaa2/dpaa2_mux.c @@ -0,0 +1,222 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +struct dpaa2_dpdmux_dev { + TAILQ_ENTRY(dpaa2_dpdmux_dev) next; + /**< Pointer to Next device instance */ + struct fsl_mc_io dpdmux; /** handle to DPDMUX portal object */ + uint16_t token; + uint32_t dpdmux_id; /*HW ID for DPDMUX object */ + uint8_t num_ifs; /* Number of interfaces in DPDMUX */ +}; + +struct rte_flow { + struct dpdmux_rule_cfg rule; +}; + +TAILQ_HEAD(dpdmux_dev_list, dpaa2_dpdmux_dev); +static struct dpdmux_dev_list dpdmux_dev_list = + TAILQ_HEAD_INITIALIZER(dpdmux_dev_list); /*!< DPDMUX device list */ + +static struct dpaa2_dpdmux_dev *get_dpdmux_from_id(uint32_t dpdmux_id) +{ + struct dpaa2_dpdmux_dev *dpdmux_dev = NULL; + + /* Get DPBP dev handle from list using index */ + TAILQ_FOREACH(dpdmux_dev, &dpdmux_dev_list, next) { + if (dpdmux_dev->dpdmux_id == dpdmux_id) + break; + } + + return dpdmux_dev; +} + +struct rte_flow * +rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, + struct rte_flow_item *pattern[], + struct rte_flow_action *actions[]) +{ + struct dpaa2_dpdmux_dev *dpdmux_dev; + struct dpkg_profile_cfg kg_cfg; + const struct rte_flow_item_ipv4 *spec; + const struct rte_flow_action_vf *vf_conf; + struct dpdmux_cls_action dpdmux_action; + struct rte_flow *flow = NULL; + void *key_iova, *mask_iova, *key_cfg_iova = NULL; + int ret; + + if (pattern[0]->type != RTE_FLOW_ITEM_TYPE_IPV4) { + DPAA2_PMD_ERR("Not supported pattern type: %d", + pattern[0]->type); + return NULL; + } + + /* Find the DPDMUX from dpdmux_id in our list */ + dpdmux_dev = get_dpdmux_from_id(dpdmux_id); + if (!dpdmux_dev) { + DPAA2_PMD_ERR("Invalid dpdmux_id: %d", dpdmux_id); + return NULL; + } + + key_cfg_iova = rte_zmalloc(NULL, DIST_PARAM_IOVA_SIZE, + RTE_CACHE_LINE_SIZE); + if (!key_cfg_iova) { + DPAA2_PMD_ERR("Unable to allocate flow-dist parameters"); + return NULL; + } + + /* Currently taking only IP protocol as an extract type. + * This can be exended to other fields using pattern->type. + */ + memset(&kg_cfg, 0, sizeof(struct dpkg_profile_cfg)); + kg_cfg.extracts[0].extract.from_hdr.prot = NET_PROT_IP; + kg_cfg.extracts[0].extract.from_hdr.field = NH_FLD_IP_PROTO; + kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_HDR; + kg_cfg.extracts[0].extract.from_hdr.type = DPKG_FULL_FIELD; + kg_cfg.num_extracts = 1; + + ret = dpkg_prepare_key_cfg(&kg_cfg, key_cfg_iova); + if (ret) { + DPAA2_PMD_ERR("dpkg_prepare_key_cfg failed: err(%d)", ret); + goto creation_error; + } + + ret = dpdmux_set_custom_key(&dpdmux_dev->dpdmux, CMD_PRI_LOW, + dpdmux_dev->token, + (uint64_t)(DPAA2_VADDR_TO_IOVA(key_cfg_iova))); + if (ret) { + DPAA2_PMD_ERR("dpdmux_set_custom_key failed: err(%d)", ret); + goto creation_error; + } + + /* As now our key extract parameters are set, let us configure + * the rule. + */ + flow = rte_zmalloc(NULL, sizeof(struct rte_flow) + + (2 * DIST_PARAM_IOVA_SIZE), RTE_CACHE_LINE_SIZE); + if (!flow) { + DPAA2_PMD_ERR( + "Memory allocation failure for rule configration\n"); + goto creation_error; + } + key_iova = (void *)((size_t)flow + sizeof(struct rte_flow)); + mask_iova = (void *)((size_t)key_iova + DIST_PARAM_IOVA_SIZE); + + spec = (const struct rte_flow_item_ipv4 *)pattern[0]->spec; + memcpy(key_iova, (const void *)&spec->hdr.next_proto_id, + sizeof(uint8_t)); + memcpy(mask_iova, pattern[0]->mask, sizeof(uint8_t)); + + flow->rule.key_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(key_iova)); + flow->rule.mask_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(mask_iova)); + flow->rule.key_size = sizeof(uint8_t); + + vf_conf = (const struct rte_flow_action_vf *)(actions[0]->conf); + if (vf_conf->id == 0 || vf_conf->id > dpdmux_dev->num_ifs) { + DPAA2_PMD_ERR("Invalid destination id\n"); + goto creation_error; + } + dpdmux_action.dest_if = vf_conf->id; + + ret = dpdmux_add_custom_cls_entry(&dpdmux_dev->dpdmux, CMD_PRI_LOW, + dpdmux_dev->token, &flow->rule, + &dpdmux_action); + if (ret) { + DPAA2_PMD_ERR("dpdmux_add_custom_cls_entry failed: err(%d)", + ret); + goto creation_error; + } + + return flow; + +creation_error: + rte_free((void *)key_cfg_iova); + rte_free((void *)flow); + return NULL; +} + +static int +dpaa2_create_dpdmux_device(int vdev_fd __rte_unused, + struct vfio_device_info *obj_info __rte_unused, + int dpdmux_id) +{ + struct dpaa2_dpdmux_dev *dpdmux_dev; + struct dpdmux_attr attr; + int ret; + + PMD_INIT_FUNC_TRACE(); + + /* Allocate DPAA2 dpdmux handle */ + dpdmux_dev = rte_malloc(NULL, sizeof(struct dpaa2_dpdmux_dev), 0); + if (!dpdmux_dev) { + DPAA2_PMD_ERR("Memory allocation failed for DPDMUX Device"); + return -1; + } + + /* Open the dpdmux object */ + dpdmux_dev->dpdmux.regs = rte_mcp_ptr_list[MC_PORTAL_INDEX]; + ret = dpdmux_open(&dpdmux_dev->dpdmux, CMD_PRI_LOW, dpdmux_id, + &dpdmux_dev->token); + if (ret) { + DPAA2_PMD_ERR("Unable to open dpdmux object: err(%d)", ret); + goto init_err; + } + + ret = dpdmux_get_attributes(&dpdmux_dev->dpdmux, CMD_PRI_LOW, + dpdmux_dev->token, &attr); + if (ret) { + DPAA2_PMD_ERR("Unable to get dpdmux attr: err(%d)", ret); + goto init_err; + } + + ret = dpdmux_if_set_default(&dpdmux_dev->dpdmux, CMD_PRI_LOW, + dpdmux_dev->token, 1); + if (ret) { + DPAA2_PMD_ERR("setting default interface failed in %s", + __func__); + goto init_err; + } + + dpdmux_dev->dpdmux_id = dpdmux_id; + dpdmux_dev->num_ifs = attr.num_ifs; + + TAILQ_INSERT_TAIL(&dpdmux_dev_list, dpdmux_dev, next); + + return 0; + +init_err: + if (dpdmux_dev) + rte_free(dpdmux_dev); + + return -1; +} + +static struct rte_dpaa2_object rte_dpaa2_dpdmux_obj = { + .dev_type = DPAA2_MUX, + .create = dpaa2_create_dpdmux_device, +}; + +RTE_PMD_REGISTER_DPAA2_OBJECT(dpdmux, rte_dpaa2_dpdmux_obj); diff --git a/drivers/net/dpaa2/meson.build b/drivers/net/dpaa2/meson.build index c7c2df417..801cbf5d7 100644 --- a/drivers/net/dpaa2/meson.build +++ b/drivers/net/dpaa2/meson.build @@ -9,6 +9,7 @@ endif deps += ['mempool_dpaa2'] sources = files('base/dpaa2_hw_dpni.c', + 'dpaa2_mux.c', 'dpaa2_ethdev.c', 'dpaa2_rxtx.c', 'mc/dpkg.c', diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2.h b/drivers/net/dpaa2/rte_pmd_dpaa2.h index f9303acad..57de27f21 100644 --- a/drivers/net/dpaa2/rte_pmd_dpaa2.h +++ b/drivers/net/dpaa2/rte_pmd_dpaa2.h @@ -36,4 +36,27 @@ enum pmd_dpaa2_ts { __rte_experimental void rte_pmd_dpaa2_set_timestamp(enum pmd_dpaa2_ts); +/** + * @warning + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + * Create a flow rule to demultiplex ethernet traffic to separate network + * interfaces. + * + * @param dpdmux_id + * ID of the DPDMUX MC object. + * @param[in] pattern + * Pattern specification. + * @param[in] actions + * Associated actions. + * + * @return + * A valid handle in case of success, NULL otherwise. + */ +__rte_experimental +struct rte_flow * +rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, + struct rte_flow_item *pattern[], + struct rte_flow_action *actions[]); + #endif /* _RTE_PMD_DPAA2_H */ diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2_version.map b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map index de95a03cd..1661c5fb5 100644 --- a/drivers/net/dpaa2/rte_pmd_dpaa2_version.map +++ b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map @@ -14,5 +14,6 @@ DPDK_17.11 { EXPERIMENTAL { global: + rte_pmd_dpaa2_mux_flow_create; rte_pmd_dpaa2_set_timestamp; } DPDK_17.11;