From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30067.outbound.protection.outlook.com [40.107.3.67]) by dpdk.org (Postfix) with ESMTP id DD3301BE8D for ; Wed, 4 Jul 2018 11:45:43 +0200 (CEST) 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=knsbvMTCuA0ZS5MYChTXetVDL9hzN5trC0SDaJ3lhBA=; b=qFX8VhRHjgDFRoZk4K3kFIw9Occ+IYa6R0qpx7Ro/V0+149SY1f6usaV2lGumHMJzq97KeCq7nT0yjb8mbDOZXzBdtM8lujkfTDQc3QvFhKzjoeHqrhkvHctdid5esq+M6g56F7Jxi/e3dZaPpgYeKFte3Ini0fySZBHOSkWow0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by DB4PR04MB0765.eurprd04.prod.outlook.com (2a01:111:e400:984d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.25; Wed, 4 Jul 2018 09:45:41 +0000 From: Hemant Agrawal To: dev@dpdk.org Date: Wed, 4 Jul 2018 15:13:51 +0530 Message-Id: <1530697431-1244-16-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530697431-1244-1-git-send-email-hemant.agrawal@nxp.com> References: <1529574244-18997-1-git-send-email-hemant.agrawal@nxp.com> <1530697431-1244-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR0101CA0008.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::18) To DB4PR04MB0765.eurprd04.prod.outlook.com (2a01:111:e400:984d::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 94f6368f-e512-4b50-7eab-08d5e192e85d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:DB4PR04MB0765; X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 3:FsU1lM8Syv3xv+4Cb9MpIAihuX6yLdMlMXjfp6/6nJlpZ08Y3Pf2pa274zQAjkTc6xlS99AWIVPO8qP0Y8+Xvi/n9mTSQSU1gAZelcJGmXUlMY1x4PMYLjt0cwxKVGazAdhCgp2uzF8krSBvcvyOIqUavfqMQo5TZNUWFs0Iu5ID/N6ZRTSirEROd+egdy7eOPl4zeZbMnq7ibV2UoRlZr/GDAGt2iPMwCEomlDK7skreJLKoG8y6oF/1XX3dPE5; 25:cAkcNRN2Ah+1AmdlN30JF7M5edoEDSlimqxhF8VrNO9iV//EkEjqu0szQNMD+mTXhka4HASiyk6iKLgTK9ZbZcTi0ibzetmRL2WF0zX0mJQRDl2IRaSxIGbpJOvcFrdUAGamLuDkERb1skelrtW3m9dTc7Q31ax3qXRvgceyHmADgnhF2vvLPTbFZd0dgfiroQbOWv3zthbePvOx8wrB4xZOzpwP/QJ53PiqiuDwz0z4ZUaqHta26gZueTUIfZjPlNmflNVmAb96esy6xB5pTn8KHX8HcWq9QqnQ4DL8ezSpR03oSSBi1E10QfpsJVFYsHb8r3s3evh1zY6Uyzba+w==; 31:QM6g23huWlTVTpzxDGKuMdwvk1hBu4TQTvI7VcY5bjW2hvqGs7LR2qilero5ZBxXD3HwYfHeWe/A5ot0/E0cgphdiOqL1KQwJAi8LJ0PLYoDEOwRuSiopLX9ePWu1mz5rW4rFnWVMIkpTSJ5bgDxAVvtUTxINaZTbl1LoPeg8xGyKJnKEVH5hJT94Y/igqDz7+6yjxJnH5hm3GcfxLE1XRpojmbEfrjIcNpNe1cXyaY= X-MS-TrafficTypeDiagnostic: DB4PR04MB0765: X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 20:BV0F0mLp4ok8ZkwWY1zj6ckgdO7aYCt0uCIcB3iNVnFu+ap7MdyTUJYNxI1XN2Vn6BIfgAsjR4dsDk7mPqJC7VbnHPaSVSjbc7sy5Ajewim7FdAaPA/OyoOdSVJaGKzMyXUqTPNwmG61NJ7TLdr/aSGajrNSkgIiPqTK1kvGTmae4281N2ADv+PBtFrYp3oCS6TeeqZLeB2uho6c9wM8gVYQTlJfs3Wl6tMNZJsZsEyFH7islrKS8dRLM0Omvbm4mA/fB29ke8DrRSviM1Ulumv0NSjGQixMrN4It3N9K4Cp1ioBgxVSnL4D9ya8t2QZFOZfwIVjYlh5MInH8lYyxWcDuuiVb38MJzdSPJ0gqQXbkixYHMFT3mjP6UEiKy/b0z4mC7YTAdYZobaDpHkwuK7PGXfrqQzuGzTj8+S98tYzWrEFppsn+cbupUBDdXGOHg9IzbrBaHdpgJRy9E55cEWAb5OfaA2yYmRM3rYNJBRyXMmDXewfCFSsDb2zVJWN; 4:bGwsiqGMbdwdRNpToJhEmEzhVb9UIgKVTtVyAZ7zrf4PIEIOm2HkeVa6JlA//ImiRAqP3/mHfwj70HyKmB2X8h4Ky30oB4i8bcQoBFilyUlpqa4N0WoK6Xy7I4n+6g/Q+eXzYql5NF4OfdSekP5c5Ey4mIf93F44bTQzdCyTzeMkU0vjgblKiY+RkdSYNF0sDMKbQYwEe+yi7LjKmT6246fZ0P7qQZBfJZgYxGuLO87pMkCozn1nCguewJPuGASBA1di7feeP9Ueu8LpAThZT/KB+4nvve6jnr4y2FD+klLyo58DWI6ttvLdQx/T6SaN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DB4PR04MB0765; BCL:0; PCL:0; RULEID:; SRVR:DB4PR04MB0765; X-Forefront-PRVS: 0723A02764 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(396003)(39860400002)(376002)(136003)(346002)(366004)(199004)(189003)(6512007)(11346002)(476003)(386003)(6506007)(55236004)(956004)(2616005)(5660300001)(44832011)(105586002)(575784001)(68736007)(16526019)(53936002)(446003)(50226002)(316002)(6666003)(5009440100003)(36756003)(16586007)(2351001)(6916009)(106356001)(14444005)(186003)(86362001)(26005)(6486002)(97736004)(305945005)(81166006)(7736002)(8936002)(66066001)(8676002)(478600001)(25786009)(51416003)(486006)(76176011)(3846002)(6116002)(81156014)(48376002)(50466002)(52116002)(2906002)(47776003)(2361001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB4PR04MB0765; H:bf-netperf1.ap.freescale.net; 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-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB4PR04MB0765; 23:R7+XjrVHoXfxzN4vj9fseGpmmp0L7T34+QZq61py0?= =?us-ascii?Q?5Wi2qIUBlbZhvHsDPzqvy8Zsc5m2LFd84QdBnPXFKKF6C/CSp5YBjElYlfp2?= =?us-ascii?Q?1xEZ9CBeO0KOKAkGEoBW5gSc7641ZsrpnP703PEkjH7LtKazHHQ0PR81GDyL?= =?us-ascii?Q?mclkIrWRY4kcoMoWy2dbDc0onfPxXjTYUKG8LdqXtHxrCpM0fN8w5Cs9KMbk?= =?us-ascii?Q?hT8WguAguFx4dJMOFPX1uZcmJwdeT5EAg6gcxq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GAnc3T9xTS4zuMU4fa7scNIbe7d695AXhlYwCWpnFTeJIOG6F6hAJlt6NTen+HE/BcpopdYjPjmD240e+PlXj/363FAlC2T2Rrl6BRRcGnfw==; 5:gdY7t0lL9cpPdhM+I8NRUS3HANTETJVDdsLpaMocbckcPDzAP8VAX11cPDq8h90ZXal9zfe7xM5EzRH0RIAJRMD9rmXuoorTouNaTb5qWZ+nRuNv1hFwu5DfgMkYL2854QtEVp5GpM27qQD7AXNBVehtG1ndUTmhxfDY4BQ7T74=; 24:gtjxshIMoAbHWN++0I9lN2fh0Se+pCjO7WnmSqjAcP16ovz6uji4l+es0AgPdKRTHtDIXMbVtKoomYspwInZ8w0o31xDJ3ze63wzidM3jwM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 7:4/yo8iGpi98cYjQH34CRR8oCMVBezXSpaoX3RpoC9uXKC0RBgg7hvTbCwZUxjTaoqCvt3q8m8lDKwlxWjGD7wnB2U7ENWe+Wa3JSFo6J7fpTGsethPsars7qsY9S86JWRvtcu/yEwlHNE7Jn0kPbC/aj5cUWikoNtmlTh43yMd2K0PVhdZ48g6ZJ5YQDMZuu0zQNI4Utd2AVbwb/8VeasGhaaNL2F0zPf55kdtZxEfeMZ5pEhJ/vWbtuC6nkDTVK X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2018 09:45:41.8165 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 94f6368f-e512-4b50-7eab-08d5e192e85d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR04MB0765 Subject: [dpdk-dev] [PATCH v2 16/16] net/dpaa: implement scatter offload support 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: Wed, 04 Jul 2018 09:45:44 -0000 Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 75 +++++++++++++++++++++++++++++++++++++----- drivers/net/dpaa/dpaa_ethdev.h | 3 +- drivers/net/dpaa/dpaa_rxtx.c | 4 +-- drivers/net/dpaa/dpaa_rxtx.h | 2 -- 4 files changed, 70 insertions(+), 14 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 5c0aafb..c49d3a5 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -47,7 +47,8 @@ /* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = - DEV_RX_OFFLOAD_JUMBO_FRAME; + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_SCATTER; /* Rx offloads which cannot be disabled */ static uint64_t dev_rx_offloads_nodis = @@ -55,8 +56,7 @@ static uint64_t dev_rx_offloads_nodis = DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | - DEV_RX_OFFLOAD_CRC_STRIP | - DEV_RX_OFFLOAD_SCATTER; + DEV_RX_OFFLOAD_CRC_STRIP; /* Supported Tx offloads */ static uint64_t dev_tx_offloads_sup; @@ -148,11 +148,30 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) struct dpaa_if *dpaa_intf = dev->data->dev_private; uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + VLAN_TAG_SIZE; + uint32_t buffsz = dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM; PMD_INIT_FUNC_TRACE(); if (mtu < ETHER_MIN_MTU || frame_size > DPAA_MAX_RX_PKT_LEN) return -EINVAL; + /* + * Refuse mtu that requires the support of scattered packets + * when this feature has not been enabled before. + */ + if (dev->data->min_rx_buf_size && + !dev->data->scattered_rx && frame_size > buffsz) { + DPAA_PMD_ERR("SG not enabled, will not fit in one buffer"); + return -EINVAL; + } + + /* check * >= max_frame */ + if (dev->data->min_rx_buf_size && dev->data->scattered_rx && + (frame_size > buffsz * DPAA_SGT_MAX_ENTRIES)) { + DPAA_PMD_ERR("Too big to fit for Max SG list %d", + buffsz * DPAA_SGT_MAX_ENTRIES); + return -EINVAL; + } + if (frame_size > ETHER_MAX_LEN) dev->data->dev_conf.rxmode.offloads &= DEV_RX_OFFLOAD_JUMBO_FRAME; @@ -196,13 +215,24 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= DPAA_MAX_RX_PKT_LEN) { + DPAA_PMD_DEBUG("enabling jumbo"); fman_if_set_maxfrm(dpaa_intf->fif, dev->data->dev_conf.rxmode.max_rx_pkt_len); - return 0; + dev->data->mtu = + dev->data->dev_conf.rxmode.max_rx_pkt_len - + ETHER_HDR_LEN - ETHER_CRC_LEN - VLAN_TAG_SIZE; } else { - return -1; + DPAA_PMD_ERR("enabling jumbo err conf max len=%d " + "supported is %d", + dev->data->dev_conf.rxmode.max_rx_pkt_len, + DPAA_MAX_RX_PKT_LEN); } } + if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { + DPAA_PMD_DEBUG("enabling scatter mode"); + fman_if_set_sg(dpaa_intf->fif, 1); + dev->data->scattered_rx = 1; + } return 0; } @@ -300,7 +330,6 @@ static void dpaa_eth_dev_info(struct rte_eth_dev *dev, dev_info->max_rx_queues = dpaa_intf->nb_rx_queues; dev_info->max_tx_queues = dpaa_intf->nb_tx_queues; - dev_info->min_rx_bufsize = DPAA_MIN_RX_BUF_SIZE; dev_info->max_rx_pktlen = DPAA_MAX_RX_PKT_LEN; dev_info->max_mac_addrs = DPAA_MAX_MAC_FILTER; dev_info->max_hash_mac_addrs = 0; @@ -514,6 +543,7 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, struct qm_mcc_initfq opts = {0}; u32 flags = 0; int ret; + u32 buffsz = rte_pktmbuf_data_room_size(mp) - RTE_PKTMBUF_HEADROOM; PMD_INIT_FUNC_TRACE(); @@ -527,6 +557,27 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, DPAA_PMD_INFO("Rx queue setup for queue index: %d fq_id (0x%x)", queue_idx, rxq->fqid); + /* Max packet can fit in single buffer */ + if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= buffsz) { + ; + } else if (dev->data->dev_conf.rxmode.enable_scatter) { + if (dev->data->dev_conf.rxmode.max_rx_pkt_len > + buffsz * DPAA_SGT_MAX_ENTRIES) { + DPAA_PMD_ERR("max RxPkt size %d too big to fit " + "MaxSGlist %d", + dev->data->dev_conf.rxmode.max_rx_pkt_len, + buffsz * DPAA_SGT_MAX_ENTRIES); + rte_errno = EOVERFLOW; + return -rte_errno; + } + } else { + DPAA_PMD_WARN("The requested maximum Rx packet size (%u) is" + " larger than a single mbuf (%u) and scattered" + " mode has not been requested", + dev->data->dev_conf.rxmode.max_rx_pkt_len, + buffsz - RTE_PKTMBUF_HEADROOM); + } + if (!dpaa_intf->bp_info || dpaa_intf->bp_info->mp != mp) { struct fman_if_ic_params icp; uint32_t fd_offset; @@ -553,10 +604,13 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, fman_if_set_bp(dpaa_intf->fif, mp->size, dpaa_intf->bp_info->bpid, bp_size); dpaa_intf->valid = 1; - DPAA_PMD_INFO("if =%s - fd_offset = %d offset = %d", - dpaa_intf->name, fd_offset, - fman_if_get_fdoff(dpaa_intf->fif)); + DPAA_PMD_DEBUG("if:%s fd_offset = %d offset = %d", + dpaa_intf->name, fd_offset, + fman_if_get_fdoff(dpaa_intf->fif)); } + DPAA_PMD_DEBUG("if:%s sg_on = %d, max_frm =%d", dpaa_intf->name, + fman_if_get_sg_enable(dpaa_intf->fif), + dev->data->dev_conf.rxmode.max_rx_pkt_len); /* checking if push mode only, no error check for now */ if (dpaa_push_mode_max_queue > dpaa_push_queue_idx) { dpaa_push_queue_idx++; @@ -1304,6 +1358,9 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) fman_if_reset_mcast_filter_table(fman_intf); /* Reset interface statistics */ fman_if_stats_reset(fman_intf); + /* Disable SG by default */ + fman_if_set_sg(fman_intf, 0); + fman_if_set_maxfrm(fman_intf, ETHER_MAX_LEN + VLAN_TAG_SIZE); return 0; diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index c79b9f8..1e7a656 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -39,9 +39,10 @@ /* Alignment to use for cpu-local structs to avoid coherency problems. */ #define MAX_CACHELINE 64 -#define DPAA_MIN_RX_BUF_SIZE 512 #define DPAA_MAX_RX_PKT_LEN 10240 +#define DPAA_SGT_MAX_ENTRIES 16 /* maximum number of entries in SG Table */ + /* RX queue tail drop threshold (CGR Based) in frame count */ #define CGR_RX_PERFQ_THRESH 256 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 168b77e..6e96a80 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -306,8 +306,6 @@ dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid) int i = 0; uint8_t fd_offset = fd->offset; - DPAA_DP_LOG(DEBUG, "Received an SG frame"); - vaddr = DPAA_MEMPOOL_PTOV(bp_info, qm_fd_addr(fd)); if (!vaddr) { DPAA_PMD_ERR("unable to convert physical address"); @@ -349,6 +347,8 @@ dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid) } prev_seg = cur_seg; } + DPAA_DP_LOG(DEBUG, "Received an SG frame len =%d, num_sg =%d", + first_seg->pkt_len, first_seg->nb_segs); dpaa_eth_packet_info(first_seg, vaddr); rte_pktmbuf_free_seg(temp); diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index d3e6351..6de70a7 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -32,8 +32,6 @@ /* L4 Type field: TCP */ #define DPAA_L4_PARSE_RESULT_TCP 0x20 -#define DPAA_SGT_MAX_ENTRIES 16 /* maximum number of entries in SG Table */ - #define DPAA_MAX_DEQUEUE_NUM_FRAMES 63 /**