From patchwork Thu Dec 27 06:23:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154560 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6605758ljp; Wed, 26 Dec 2018 22:25:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN45LtL8CvLBZyDgpHWiNC8dxtUDbxiYrZ8HFuJVcCm985PNr64erCRDtmEnLTExHkL9USc4 X-Received: by 2002:a5d:694d:: with SMTP id r13mr20156970wrw.323.1545891935683; Wed, 26 Dec 2018 22:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891935; cv=none; d=google.com; s=arc-20160816; b=XAHTlKOk3XwlfmD5ZgqURO7Hvh/4pGSx25h+T+R514oltHXV0aZDlMvzVSLoUMHLx2 dZWA+4HO6AuGHVWmHTq94BglSIhQaCJwGnJ2EkEwDsR+mlWHV+u0EeqA5gLRDW21bGNn J++/cq5N0l1A52dOOsfmG0SiTM3RYlYVUFjgEcYR5CdX5dXN9wMv8PfyzZb+a5WpjNoJ XzvxGsJHG/eGG4Bvf8MpSFzVRrJUxUMTMOwigUj3l9ckfohDeFB04D82fmgds9/aj+vK pcB0ZB4M1M1UPfkoYaFv1OmP/WDQDRycUwaCh+gHclMKBEYtqH6QY7a152tT9GPjMNoZ tcWw== 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=CMgciSNoOsFSfmEV9jUSOGgc1tJl4vXlmyX4m9PKyzavG1H5VV7o2Xezqb+sdq/lHe dVpr7M/PE0s7gTMbZ/HPlN9bY018UqV4FhYjcGXLkRYpD76I4gJKM08kZM6Z9kHmn+Do H7R80HPtmsRXBboHmCuWvkhVoaqdRJtXkeQkIVDSpdjsbtaSvIqIAJwbY5M7+6sIpOcV Tuhe5V9S7D7fJVEkslDIhnYr7LykPj9vknrH+XxszY7o165ZogFp3bEcVtZZhqQhzHmE PtvEMSYYX411Ghk2COELQ6WpHY3C4GW/b/oILdCLIblzItRg+mfKtShYMaBJhCZMUgBW rUqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=qcJqhbFR; 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 z2si12960126wmb.141.2018.12.26.22.25.35; Wed, 26 Dec 2018 22:25:35 -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=qcJqhbFR; 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 80D2F5F24; Thu, 27 Dec 2018 07:23:27 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140040.outbound.protection.outlook.com [40.107.14.40]) by dpdk.org (Postfix) with ESMTP id 220454C8D for ; Thu, 27 Dec 2018 07:23:16 +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=qcJqhbFRaddKXLvVxeFGAsvhmOlN6qq4znFacDiafq/3fCm/ad9adLwKP0eEaj85t3vQBblAIj8/Z68DWV870xbOzr/AesWHmSmY4AM/dRO0hdpjdK5jj5JO7KLn+v12aVk1TaLheK5ksSSTdpemEW3EPGdOQzdPEnpIf61L8ik= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:14 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:14 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Nipun Gupta Thread-Topic: [PATCH 15/20] net/dpaa2: add dpdmux initialization and configuration Thread-Index: AQHUnaylmBB19FCKv0qy9Bt41yLG+g== Date: Thu, 27 Dec 2018 06:23:14 +0000 Message-ID: <20181227062233.30781-16-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:Eg1CzGny/PdGWypEmSI4jlhIbBENkl5jeY68OcW5kARmanc7fqmpwY6TB7ZJD07HpUV23jkvkHghcnsnocINq0rMov2FY+csYTcpNHKRQ+4UO9cvPDVzTxS3SToAem4GXA3ahiBtWTCpqP+kabI9Gj910Fys9hhVBbOXLe8g4c3KUEyffA1uRQveNJsoYhaBgQFT9OCnXoAA2sigY40Fs+IlzbVxpoVx1qZOneb6j4K//AwTWnSTzymNsL1DdDJ1/asCN8JXKcCdXHCbc5K+fRpPYRu32tXcTfNpD1zaZMkAKQ21XjHD9qEaafJ8iA2UcW+LMNFzXw9OTYzhr8ORkSqgZPnK15y6QYYEd4yESz9kkjUm9aqlpI90YEMYnCohd4dxVTLuo+qpokWhEUnqncMzN+UUCyesMINgtNKS9PGrOrTtUdpSlPWvaRpIVqi7EDgWwX9eLJoHyB813/cgow==; 5:b/e2AToMaaEl9jx+T9Vw6+oON5y92ezGT/AUkEAZ7EuCsUR9FRgZaOKQFa7JqpgtMxUOxh+k9ed9GeXene/VGr1vT7ocVwC4Q7MVYfqbe1luRvHq82hJZgXpepvia9wyRRrzih8640+TMFXS4cumIfWHnFZDlaLab2g3bFfDUus=; 7:80I7IonU27bOCoMzlSLnmBN74rc1UqnM30wDzJ33PyDajEf8E7s2Qw6qtaQWYoArD2ViX3aDzi8j3Ep30EcxbJ2BwThwB8iVBQRJvvrKXtrAJ6orswg/DwE4XdbzQaCQIT92VDqE1DPyGyCw7Kjprw== x-ms-office365-filtering-correlation-id: bb85b745-3675-46f4-133f-08d66bc3c82f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: RALMt04P3wEUk/sXn8OIMv6j5FsCt2dlcSNQVIu+AYOerlZipTEsy11yUkPsXO8FKCfL8dWLrp4NIC+GjQ+3URKh0NSSwH8yn67X6eEvOgG8EL/spPgDVgMZLp6TlZxA1hdY6ty60KYNS0UGHxpl9vl9wOSp84u+/xVjwC+l0thI2C3u9UM16MYmgDR3XcYnm77wiZU4dxRMdKiUJYVC2mvOYyKdrANR7jzhD2iM+K60b6NuoeBLMhTE4suEjglzDHP6VpZDOA1UW7QZcnOJWEChygSZZgpc+Ab90A84VEpgqkoGCYMgttjMv7XJanaj spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb85b745-3675-46f4-133f-08d66bc3c82f X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:14.4889 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 15/20] 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;