From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0050.outbound.protection.outlook.com [104.47.42.50]) by dpdk.org (Postfix) with ESMTP id DFDDCF965 for ; Mon, 23 Jan 2017 13:01:23 +0100 (CET) Received: from CY1PR03CA0034.namprd03.prod.outlook.com (10.174.128.44) by CY4PR03MB2472.namprd03.prod.outlook.com (10.168.165.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Mon, 23 Jan 2017 12:01:22 +0000 Received: from BY2FFO11FD004.protection.gbl (2a01:111:f400:7c0c::126) by CY1PR03CA0034.outlook.office365.com (2603:10b6:600::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Mon, 23 Jan 2017 12:01:22 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD004.mail.protection.outlook.com (10.1.14.158) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Mon, 23 Jan 2017 12:01:21 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0NC07ej019311; Mon, 23 Jan 2017 05:01:18 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Mon, 23 Jan 2017 17:29:51 +0530 Message-ID: <1485172803-17288-22-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> References: <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131296464815960152; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39450400003)(39850400002)(39410400002)(39400400002)(39380400002)(39860400002)(39840400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(110136003)(305945005)(356003)(33646002)(5660300001)(50986999)(76176999)(6916009)(54906002)(97736004)(8656002)(5890100001)(77096006)(2950100002)(189998001)(6666003)(626004)(5003940100001)(38730400001)(4326007)(106466001)(2906002)(2351001)(53936002)(68736007)(85426001)(104016004)(86362001)(48376002)(36756003)(47776003)(105606002)(8676002)(50466002)(50226002)(8936002)(81156014)(92566002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2472; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD004; 1:D6wQwqNXe5nZ9yTmGZXtnkygykPzMPGEjAEn3nRFQoG/4kvH17H6D1R08v1WrF+LfBUbdWyJdcYCXeWndfg1x3wyYL4dFRGiJUMfGeesjQv2D2EYzze2Bhp6PUxq0zpHiMk+g4ZvWMRFBxEAVjtMq7qVIVdVhXlYuU+fbozmiYDjhANcLxGGnr3/VSjlwQ/OeGduISe/br1GdpcxhF0xH4EkX2V15belHhoERRytM9stpgyF6leH5x11hR1w0HlQGW6Ggf6l0rkg5UBa8FlIDGLRVby+LruJ26bSPSi04erS4PZVSdvDcxqgLSG/DPNf2YG9Nf41RDS/n7bw4hWq1fTsUnom8S+Q6F5WDUk2S7NwFKW11TVuc/PyzCi0XyTiEQoqA+UnOe/W8kgQWlGndrm6JOBo4+sVDSz095R22o15Ap+eRj8t5kGbEaA5wpy73MjDZaY9Tj0Y/RS3e66kMlV29qSCEiq9NmZwrX5x2rNyhpzRc2XeAeK7T2jsiwEPRdzrMdLwI3DDP29ip1CmRPk8M2RPt8rfw/inDgqOpeDZABWXhjvMgQgbOvj0kztgcxKr1Q7OhLVDWgAiuqCfL2Qu/HtFBNE5XsEzrPUSzsuSz0NwDYK/rpGVmBkQVT2iDe4msq2eszApstZ3KmWp6gn/tSVC23+xwKQgVcSS1FqAKCxs2ct2Te++uujTJ82V8SaMSnGcWwwoSF0fFYI/u1NsyCUg10cxPxKOyyXYc2nNsxOIlgBwNZgX+LQl/7Hw MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 33146667-4648-4854-441c-08d443878c00 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2472; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 3:N01bAnfQ2szNt/fYD15go+zkG3cIh/tTPSMGkiIT3DKP4MXYx1Acwd2c82cNuNcdowGGDVQ+ledlzpANPFKPUj2tEZ4EgKAQZsyIBBKBCTLeICQGVvBqfIlZuLQO41N/4dqSVrTYbdbNLWjZdo7+k1ihr5PJ5TzOLz5fEvA+7HXrvZYs2F0NeTXBsf2WwyAs3JW35K9aBt6860HVVtYSwSCjFSVwt/IPC2hqzBbeMPUD8JVCsi9GurHY5NH7YUV3HPAiOPfQ0+fOFw5zxfkRTg5os37ccBbMowYC7p+I5yX64ZNsnRmyl/cVzEob4Oti9b+h530Fhr7ZS2KeWWou6bdXKS3O9mEbPpTovIW0aBBFogTZdiGZiGM6a3nX8VJt X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 25:PekvUV6PMfUXizw3CiPNyqaFMM7tUhaqX50anoy11SPmCG1r8lTzqNkokcm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I9p3s+Q/YsST9m6e0vZ1wKp8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13023025)(13017025)(13015025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123563025)(20161123565025); SRVR:CY4PR03MB2472; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2472; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 4:VRIYNzkhXuYRteP3Uzknc7he8gzKtiHwEyTCCgL5BL/UKlh9s6prwVj58fkFQyK2g6z2zc8FmjZVDJIuav5lyEERQq/NPe+hV8/ypucZtDQS6MYc9co6/AiwEKle7o4SW0m8fG3Hm5/uoxYz9OYNrU0QkvekwyaLPwxxpuUXhk71uJs1EVaNQPTWNJD+yP8uabVajH5zBHfV5hRMmjpJnfSwgNzSHdhtl2EfNw/k9xBVfxq5FphVuvBfk6vriO8oW55RgXuqGG6PE5h6ssQ1w0dXL370i0+BkXe9M2aNYTyUj3JgMDf82qOyNYrJuDSxmlqcPTMLMc87GsIz7q1Ed/GxoXwmIhzhm/c2EKLgwDMX4esiiV58q/2OCITqJaix+bqcz0LXOq12DPDanD6CZ0nIJDlqsxfUCTaMV7LmDUvYiI6ZRCiJIeIWMYoa9l3M4b0IEdV01Fa3+UvhamAxHbzWfia/D0tipbUxYa6trx0ayjkT13L6swOuCXLSy5TVElqrolJnE5FRYIfGPhCxAAIz8AWlm09CFArwB5GF7xA1wBpTONiVdbTre7GG7Ad1vAAw2Mji44dpNu+ZiHZ7DbxN9GxTu9rTJnXRgd2mw01kLhve8xSGK3wKvYvUpgmAitygv7B+kTMJrNPPVlZPckDYk6xYtteGFNAi0xXdaz0rmpVVAPwr1NjRJ66bDEyYSDqu8FE7AhypmFgDHoRJ+4JpvZWp4vaRpt2XN9FLqvGsGXHqMBS7EfNnDGNTNTigjvvI2TfxJ47mFzuAtqeJPA== X-Forefront-PRVS: 0196A226D1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2472; 23:ImFglvweHOUb98uVMuX9bEovUkTLANAY9H2quCljB?= =?us-ascii?Q?CfbZz2+5i4UwP8zPAd2M+IciO+KL0moMHPCpu9uHtXQi7HRZLt44OBJ4Bycp?= =?us-ascii?Q?gDcrvjFhF5j+oda0cpKSRRI1UC+MziNQUD4bex7qZJtBJXta1fI3OKjk85XN?= =?us-ascii?Q?y9RPeTvK3+Vd3ST++o1p+On2AsXAQB1y52gbwzJvYvT0fsBEpUKtKYv3KMTu?= =?us-ascii?Q?8EOCCBVO6emjFR9kQaKHxyymSu4xQTbff5Fob9Ge7siEzQKV6TBa5jYjMhue?= =?us-ascii?Q?D60evAYI/HOfdljcX2pmOgEhEtP6FTIAu9YSelR4jPOkhFJQqY3piD9XTIcb?= =?us-ascii?Q?NSFUXg96zIYuoFKJ8iJHFwcTu1CjDyU7jOM2Hm3FkniPDqF/Zl3wt17983oG?= =?us-ascii?Q?LHlTzUGEBKtI/Syl26TXrVRLor9uUVUlStvRft2zNm5pRSfrpFuqxJ/1c+xx?= =?us-ascii?Q?YXRE4rz9BvIIP5YMDvQ8KOXRSA8ZM7mZCNSuWcxbPzqAA0nbSYaBSUFUqqMT?= =?us-ascii?Q?unh7JC3yYkH4nxmeWznLEvrt0yZf+AG8SJO87TSRTu7y1YVw/h3FgVHNtHOu?= =?us-ascii?Q?0jC3J3WVSaQO1JcyacNIg4lRa6iQu5scqVd5ti9mcUfK9QJf/vOLRGKvrqvc?= =?us-ascii?Q?1LHfN1PIa0BuxERvNmESmS12pkmkdPRa06jKYdRiHrphEU+F0f7+oGhGiMKG?= =?us-ascii?Q?sPR6wsNna739c4R8TTa478OzFJU7e3OcL9ftPuMlyr9XlsI5RZpY23/xCs39?= =?us-ascii?Q?zmYxX/eswKrt1PT15FaTCM+KCG/Te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zXbymhY5zyjvWI614UmNBZom/Ez0HMjAxXNpL8iZQ/V4u7+sraB+SmQQebbAcNW9VSzfyHj+i7ChEnGfia05qiAQFerU; 5:tWu+9ABLkthwoXRrGzF7rVa3lwjz9/ybqbr4Qukl7p6/y9mYWwrsLOv/7dZK7LUhJ7sMI4zbX1if7xVcAwD/drhHaNcONFMQNN2fXC/uTqp2X5CGbNfc2jSNJI6llIozHdhcNtrGwyBgF5vpLzyZShTjJn0Xn6pXrMKo1vZHLpzNbY82ZrdCVqAEf9jFfynb; 24:QG/Z3jUd4ni5hwWkSs+amD/J16o2cIGfxjrId5R8oRcHKK6T4wvw6ndeTaLBSsVpR8n2w6Nd+IBlWO+70bbuTp2gDKB3RLQ8Z1IsZ1P9Fac= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 7:imo6VD+/pDmKPG34L5LdSLdMYq0NN3TMogSVptFrzv83F3qj4vKSQj2SLfwahtGpfo4Bua0pRhp2gKhrUZecqwV5Bl8YQqKsOug4AqkoTEUg4+h2iVWy7Ma0EcDiAJmNX5gQDmOfdAJNEiO5sEoGxPnra+BPGc52QHT2saf9ZyBVJWhZmVgGEH2M+Nq5F/lrT+LBydI8pfFgdJ1onnmZwvm01Xo3WTXBpcuosbIm+R5+kv5HXLwBJbgwApQKoExClhwKaVzG7xqKbxYry098cgQkCr8AtT6aHkBFoq1VZGpQI5nicEEyIh1krOyegDjgGICTnMmSlImftnRmAN3CBsaNvRgDwBDYQjhXk7VZesCQhpPcoBqC0qK0iLgSfZ66lyj8G0BMi8YNYjAnKYF4+JlNg443N4ObybWadaOYUj0MTwrD9ATmX4c/mMMbE8FalrHDGjdRzSLM4Qn+juyjog== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2017 12:01:21.2684 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2472 Subject: [dpdk-dev] [PATCHv6 21/33] net/dpaa2: attach the buffer pool to dpni 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: , X-List-Received-Date: Mon, 23 Jan 2017 12:01:24 -0000 This patch configures a MC-DPNI based DPAA2 PMD network port with a DPBP based buffer pool. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 10 ++++++ drivers/net/dpaa2/Makefile | 3 ++ drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 57 ++++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_ethdev.c | 62 +++++++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_ethdev.h | 6 ++++ 5 files changed, 138 insertions(+) diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 42c5517..8efac2d 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -50,6 +50,16 @@ #define DPAA2_MBUF_MAX_ACQ_REL 7 #define MAX_BPID 256 +#define DPAA2_MBUF_HW_ANNOTATION 64 +#define DPAA2_FD_PTA_SIZE 64 + +#if (DPAA2_MBUF_HW_ANNOTATION + DPAA2_FD_PTA_SIZE) > RTE_PKTMBUF_HEADROOM +#error "Annotation requirement is more than RTE_PKTMBUF_HEADROOM" +#endif + +/* we will re-use the HEADROOM for annotation in RX */ +#define DPAA2_HW_BUF_RESERVE 0 +#define DPAA2_PACKET_LAYOUT_ALIGN 64 /*changing from 256 */ struct dpaa2_dpio_dev { TAILQ_ENTRY(dpaa2_dpio_dev) next; diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile index 7d62f1e..fadabb5 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -49,6 +49,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/portal CFLAGS += -I$(RTE_SDK)/drivers/common/dpaa2/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/pool/dpaa2 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal # versioning export map @@ -62,7 +63,9 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_ethdev.c # library dependencies DEPDIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += lib/librte_eal lib/librte_ether +DEPDIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += lib/librte_mempool lib/librte_mbuf DEPDIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += lib/librte_common_dpaa2_qbman DEPDIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += lib/librte_bus_fslmc +DEPDIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += lib/librte_pmd_dpaa2_pool include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index c95c083..08f53b3 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -46,6 +46,7 @@ #include #include +#include #include "../dpaa2_ethdev.h" @@ -285,3 +286,59 @@ int dpaa2_remove_flow_dist( } kg_cfg->num_extracts = i; } + +int +dpaa2_attach_bp_list(struct dpaa2_dev_priv *priv, + void *blist) +{ + /* Function to attach a DPNI with a buffer pool list. Buffer pool list + * handle is passed in blist. + */ + int32_t retcode; + struct fsl_mc_io *dpni = priv->hw; + struct dpni_pools_cfg bpool_cfg; + struct dpaa2_bp_list *bp_list = (struct dpaa2_bp_list *)blist; + struct dpni_buffer_layout layout; + int tot_size; + + /* ... rx buffer layout . + * Check alignment for buffer layouts first + */ + + /* ... rx buffer layout ... */ + tot_size = DPAA2_HW_BUF_RESERVE + RTE_PKTMBUF_HEADROOM; + tot_size = RTE_ALIGN_CEIL(tot_size, + DPAA2_PACKET_LAYOUT_ALIGN); + + memset(&layout, 0, sizeof(struct dpni_buffer_layout)); + layout.options = DPNI_BUF_LAYOUT_OPT_DATA_HEAD_ROOM; + + layout.data_head_room = + tot_size - DPAA2_FD_PTA_SIZE - DPAA2_MBUF_HW_ANNOTATION; + retcode = dpni_set_buffer_layout(dpni, CMD_PRI_LOW, priv->token, + DPNI_QUEUE_RX, &layout); + if (retcode) { + PMD_INIT_LOG(ERR, "Err(%d) in setting rx buffer layout\n", + retcode); + return retcode; + } + + /*Attach buffer pool to the network interface as described by the user*/ + bpool_cfg.num_dpbp = 1; + bpool_cfg.pools[0].dpbp_id = bp_list->buf_pool.dpbp_node->dpbp_id; + bpool_cfg.pools[0].backup_pool = 0; + bpool_cfg.pools[0].buffer_size = + RTE_ALIGN_CEIL(bp_list->buf_pool.size, + 256 /*DPAA2_PACKET_LAYOUT_ALIGN*/); + + retcode = dpni_set_pools(dpni, CMD_PRI_LOW, priv->token, &bpool_cfg); + if (retcode != 0) { + PMD_INIT_LOG(ERR, "Error in attaching the buffer pool list" + " bpid = %d Error code = %d\n", + bpool_cfg.pools[0].dpbp_id, retcode); + return retcode; + } + + priv->bp_list = bp_list; + return 0; +} diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 979dba4..6de571a 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -48,6 +48,7 @@ #include #include #include +#include #include "dpaa2_ethdev.h" @@ -63,6 +64,8 @@ dev_info->if_index = priv->hw_id; dev_info->max_mac_addrs = priv->max_mac_filters; + dev_info->max_rx_pktlen = DPAA2_MAX_RX_PKT_LEN; + dev_info->min_rx_bufsize = DPAA2_MIN_RX_BUF_SIZE; dev_info->max_rx_queues = (uint16_t)priv->nb_rx_queues; dev_info->max_tx_queues = (uint16_t)priv->nb_tx_queues; @@ -187,6 +190,7 @@ struct dpni_queue cfg; uint8_t options = 0; uint8_t flow_id; + uint32_t bpid; int ret; PMD_INIT_FUNC_TRACE(); @@ -194,6 +198,13 @@ PMD_INIT_LOG(DEBUG, "dev =%p, queue =%d, pool = %p, conf =%p", dev, rx_queue_id, mb_pool, rx_conf); + if (!priv->bp_list || priv->bp_list->mp != mb_pool) { + bpid = mempool_to_bpid(mb_pool); + ret = dpaa2_attach_bp_list(priv, + rte_dpaa2_bpid_info[bpid].bp_list); + if (ret) + return ret; + } dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[rx_queue_id]; dpaa2_q->mb_pool = mb_pool; /**< mbuf pool to populate RX ring. */ @@ -388,7 +399,9 @@ struct fsl_mc_io *dpni_dev; struct dpni_attr attr; struct dpaa2_dev_priv *priv = eth_dev->data->dev_private; + struct dpni_buffer_layout layout; int i, ret, hw_id; + int tot_size; PMD_INIT_FUNC_TRACE(); @@ -477,6 +490,55 @@ return -ret; } + /* ... rx buffer layout ... */ + tot_size = DPAA2_HW_BUF_RESERVE + RTE_PKTMBUF_HEADROOM; + tot_size = RTE_ALIGN_CEIL(tot_size, + DPAA2_PACKET_LAYOUT_ALIGN); + + memset(&layout, 0, sizeof(struct dpni_buffer_layout)); + layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS | + DPNI_BUF_LAYOUT_OPT_PARSER_RESULT | + DPNI_BUF_LAYOUT_OPT_DATA_HEAD_ROOM | + DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE; + + layout.pass_frame_status = 1; + layout.data_head_room = tot_size + - DPAA2_FD_PTA_SIZE - DPAA2_MBUF_HW_ANNOTATION; + layout.private_data_size = DPAA2_FD_PTA_SIZE; + layout.pass_parser_result = 1; + PMD_INIT_LOG(DEBUG, "Tot_size = %d, head room = %d, private = %d", + tot_size, layout.data_head_room, layout.private_data_size); + ret = dpni_set_buffer_layout(dpni_dev, CMD_PRI_LOW, priv->token, + DPNI_QUEUE_RX, &layout); + if (ret) { + PMD_INIT_LOG(ERR, "Err(%d) in setting rx buffer layout", ret); + return -1; + } + + /* ... tx buffer layout ... */ + memset(&layout, 0, sizeof(struct dpni_buffer_layout)); + layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS; + layout.pass_frame_status = 1; + ret = dpni_set_buffer_layout(dpni_dev, CMD_PRI_LOW, priv->token, + DPNI_QUEUE_TX, &layout); + if (ret) { + PMD_INIT_LOG(ERR, "Error (%d) in setting tx buffer" + " layout", ret); + return -1; + } + + /* ... tx-conf and error buffer layout ... */ + memset(&layout, 0, sizeof(struct dpni_buffer_layout)); + layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS; + layout.pass_frame_status = 1; + ret = dpni_set_buffer_layout(dpni_dev, CMD_PRI_LOW, priv->token, + DPNI_QUEUE_TX_CONFIRM, &layout); + if (ret) { + PMD_INIT_LOG(ERR, "Error (%d) in setting tx-conf buffer" + " layout", ret); + return -1; + } + eth_dev->dev_ops = &dpaa2_ethdev_ops; eth_dev->data->drv_name = rte_dpaa2_pmd.driver.name; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 2d13137..a56b525 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -37,6 +37,9 @@ #include #include +#define DPAA2_MIN_RX_BUF_SIZE 512 +#define DPAA2_MAX_RX_PKT_LEN 10240 /*WRIOP support*/ + #define MAX_TCS DPNI_MAX_TC #define MAX_RX_QUEUES 16 #define MAX_TX_QUEUES 16 @@ -57,6 +60,7 @@ struct dpaa2_dev_priv { void *rx_vq[MAX_RX_QUEUES]; void *tx_vq[MAX_TX_QUEUES]; + struct dpaa2_bp_list *bp_list; /**