From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0077.outbound.protection.outlook.com [104.47.36.77]) by dpdk.org (Postfix) with ESMTP id 62C7F1B1C5 for ; Tue, 9 Jan 2018 14:24:43 +0100 (CET) Received: from BN6PR03CA0090.namprd03.prod.outlook.com (10.164.122.156) by DM5PR03MB2698.namprd03.prod.outlook.com (10.168.197.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:41 +0000 Received: from BY2FFO11FD025.protection.gbl (2a01:111:f400:7c0c::154) by BN6PR03CA0090.outlook.office365.com (2603:10b6:405:6f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:41 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; 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 BY2FFO11FD025.mail.protection.outlook.com (10.1.15.214) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:08 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVt017638; Tue, 9 Jan 2018 06:24:36 -0700 From: Hemant Agrawal To: CC: , , Nipun Gupta Date: Tue, 9 Jan 2018 18:52:59 +0530 Message-ID: <1515504186-13587-12-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778503477117; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(39860400002)(346002)(39380400002)(376002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(2906002)(53936002)(296002)(316002)(106466001)(8936002)(97736004)(77096006)(105606002)(50466002)(48376002)(8656006)(2351001)(59450400001)(47776003)(2950100002)(6916009)(36756003)(6666003)(81166006)(76176011)(4326008)(51416003)(498600001)(16586007)(81156014)(68736007)(86362001)(356003)(305945005)(50226002)(8676002)(5660300001)(85426001)(54906003)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2698; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD025; 1:UYPc2Oh0PQtoD3o2/s+dbkm7jA5WJZS/J4xkWDgs3evKzSPUa2UEMO1p9OFgen0mP0kvtyCSLvLf/EQFQ+7uGb8kzbb4GLZXhvqtpZfcK0Un7CLf4cJLtuE/jsVg3PHk MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc73aca4-7029-4873-477d-08d5576444af X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:DM5PR03MB2698; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2698; 3:OYWImeUjSLGxSvbHfJhLsDXBmZz/EU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kBSa2oI9WNjCssdOrVhx3qIB7hSM/YDAV2rFvDyyAe03OlvfhDF3iBfACvidit1ZGQlF5ekIAcM+r9FACV+wF76vmEgLb/Nw6nAS2zRmIfkRwaXcbn0X46NyN7lIS7UNwmhHqhWML7SL2Odtp2CaLF7W4zuUGyEFmW1+ud1KKjhFhmh4miHM5kShVVwnJ1Al3itCCwm9ZiL9FVeNs1rbYc7tzKX7lygtS3tWb4EYww0bIj2YqvLNdh8od X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3231023)(944510075)(944921075)(946801075)(946901075)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123559100)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123556025)(20161123561025)(20161123563025)(201708071742011); SRVR:DM5PR03MB2698; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:DM5PR03MB2698; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2698; 23:nKZWfQXqP5szbCZ/d1w3DN6olvP49Xofv+2mmt4oL?= =?us-ascii?Q?9g6HGCSEYYOncahCDaoZ5gR3oGos35NokDpgDMNDD7kVyGI6bITlJFaRdPl3?= =?us-ascii?Q?tEMpS9pj/4TuxwTADcJvAdTxkZLWIFk9d0oU7n6LdbXwqoQ6nz4U/yD+r/22?= =?us-ascii?Q?eP+3Azghi3rZe1Yca9VajbGVR+rnwbpqOYc7Dgxdrc5lphka528bRDWkQdcH?= =?us-ascii?Q?yaEpYbML+Lxfs9E0jXe/3AiJPjU6uhDoy0PbOXhb+ISOpPe8CXM4dZEBlly5?= =?us-ascii?Q?7cZDiRiexkCSMmMYepnlN7VZWWhfhG48qoiD+r36LVJYwPHbuZDOzkJl2Egm?= =?us-ascii?Q?k2SMqj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eFJMxKnxkXm/9pQSS27G3If1WPd6ca5WTA+lPGGebonRiW2OeUlBY1eSa6tI++94gnCDYA0Ss+xZg1ZbKWXgWem/2VF8RhmRr8REqc6ZmMv1R14KJzNafiOfsGY171u8v8PaRGmemfOoq6IJ6eEpiROPHcmc/C4mBlLSXSJh14vN5xtB55rxm57DxujO4BelDN8/oVGhPDeQvgcQeNpXH/A6GMH4tTs7s8e9iOqCERQTBUv0t1b8/ZgcYJ5G3Fc9IH1WZhd7fQcSlgHNEjM4gbRyWSnMOs9Y+FV/id0JhwkyyCaNT1tc=; 5:TZct2sfLMBAsmMMdYmxCfGgKC/ujZtJ6LYN3Znj3BBwWixfEi3SBhorPZUOt2XzrOIZKXo5x8FAOL5PckM0XGLQevQrKFkUeuQ9QpBRG69iz2cM0AGe4w1Wr1a/OGv/2q503+s/emUIgOGXyPx8C6CosR5Zl/TJgfaFpM8HFCw0=; 24:5QTIcNKyd3jUxui0/C7QY7esfQPhAH1kg5lYD1bf6rDLejmUUdaMF4xwakbBG+pUnEL+AOgI+S0c7tR3XuBAX2FG+Gy72SEJSfEBHZO7EqI=; 7:JIekgwj9bfwezGeQveeAFfS32S80cDSmkzejq+8RqUiw9Xob2ecEApkquR8FRrhLp29uVLs7xWW9gjL6UUzKuK3LkYRFjDOsj5LBSR+2rwZKP/FcqAHBtTJHRM6OFEAQBvrFbJ2syxdGMgUkdPcbNlmMv1XG1mWICDBkjcJWo6wKzcehwP4OWPAb95IZQ62GYqyCoTmlHb3DDkj0wGIUu1MqDdytYVzrAqPok5cJoj4gd2VO+SnWTm0cCOVk9pEj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:08.3041 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc73aca4-7029-4873-477d-08d5576444af 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: DM5PR03MB2698 Subject: [dpdk-dev] [PATCH v2 11/18] net/dpaa: optimize Rx path 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: Tue, 09 Jan 2018 13:24:43 -0000 From: Nipun Gupta Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_rxtx.c | 48 ++++++++++++++++++++------------------------ drivers/net/dpaa/dpaa_rxtx.h | 2 +- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 148f265..98671fa 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -97,12 +97,6 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, DPAA_DP_LOG(DEBUG, " Parsing mbuf: %p with annotations: %p", m, annot); switch (prs) { - case DPAA_PKT_TYPE_NONE: - m->packet_type = 0; - break; - case DPAA_PKT_TYPE_ETHER: - m->packet_type = RTE_PTYPE_L2_ETHER; - break; case DPAA_PKT_TYPE_IPV4: m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4; @@ -111,6 +105,9 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6; break; + case DPAA_PKT_TYPE_ETHER: + m->packet_type = RTE_PTYPE_L2_ETHER; + break; case DPAA_PKT_TYPE_IPV4_FRAG: case DPAA_PKT_TYPE_IPV4_FRAG_UDP: case DPAA_PKT_TYPE_IPV4_FRAG_TCP: @@ -173,6 +170,9 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_SCTP; break; + case DPAA_PKT_TYPE_NONE: + m->packet_type = 0; + break; /* More switch cases can be added */ default: dpaa_slow_parsing(m, prs); @@ -183,12 +183,11 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, << DPAA_PKT_L3_LEN_SHIFT; /* Set the hash values */ - m->hash.rss = (uint32_t)(rte_be_to_cpu_64(annot->hash)); - m->ol_flags = PKT_RX_RSS_HASH; + m->hash.rss = (uint32_t)(annot->hash); /* All packets with Bad checksum are dropped by interface (and * corresponding notification issued to RX error queues). */ - m->ol_flags |= PKT_RX_IP_CKSUM_GOOD; + m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_GOOD; /* Check if Vlan is present */ if (prs & DPAA_PARSE_VLAN_MASK) @@ -297,7 +296,7 @@ dpaa_unsegmented_checksum(struct rte_mbuf *mbuf, struct qm_fd *fd_arr) } struct rte_mbuf * -dpaa_eth_sg_to_mbuf(struct qm_fd *fd, uint32_t ifid) +dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid) { struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid); struct rte_mbuf *first_seg, *prev_seg, *cur_seg, *temp; @@ -355,34 +354,31 @@ dpaa_eth_sg_to_mbuf(struct qm_fd *fd, uint32_t ifid) return first_seg; } -static inline struct rte_mbuf *dpaa_eth_fd_to_mbuf(struct qm_fd *fd, - uint32_t ifid) +static inline struct rte_mbuf * +dpaa_eth_fd_to_mbuf(const struct qm_fd *fd, uint32_t ifid) { - struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid); struct rte_mbuf *mbuf; - void *ptr; + struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid); + void *ptr = rte_dpaa_mem_ptov(qm_fd_addr(fd)); uint8_t format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> DPAA_FD_FORMAT_SHIFT; - uint16_t offset = - (fd->opaque & DPAA_FD_OFFSET_MASK) >> DPAA_FD_OFFSET_SHIFT; - uint32_t length = fd->opaque & DPAA_FD_LENGTH_MASK; + uint16_t offset; + uint32_t length; DPAA_DP_LOG(DEBUG, " FD--->MBUF"); if (unlikely(format == qm_fd_sg)) return dpaa_eth_sg_to_mbuf(fd, ifid); + rte_prefetch0((void *)((uint8_t *)ptr + DEFAULT_RX_ICEOF)); + + offset = (fd->opaque & DPAA_FD_OFFSET_MASK) >> DPAA_FD_OFFSET_SHIFT; + length = fd->opaque & DPAA_FD_LENGTH_MASK; + /* Ignoring case when format != qm_fd_contig */ dpaa_display_frame(fd); - ptr = rte_dpaa_mem_ptov(fd->addr); - /* Ignoring case when ptr would be NULL. That is only possible incase - * of a corrupted packet - */ mbuf = (struct rte_mbuf *)((char *)ptr - bp_info->meta_data_size); - /* Prefetch the Parse results and packet data to L1 */ - rte_prefetch0((void *)((uint8_t *)ptr + DEFAULT_RX_ICEOF)); - rte_prefetch0((void *)((uint8_t *)ptr + offset)); mbuf->data_off = offset; mbuf->data_len = length; @@ -462,11 +458,11 @@ static struct rte_mbuf *dpaa_get_dmable_mbuf(struct rte_mbuf *mbuf, if (!dpaa_mbuf) return NULL; - memcpy((uint8_t *)(dpaa_mbuf->buf_addr) + mbuf->data_off, (void *) + memcpy((uint8_t *)(dpaa_mbuf->buf_addr) + RTE_PKTMBUF_HEADROOM, (void *) ((uint8_t *)(mbuf->buf_addr) + mbuf->data_off), mbuf->pkt_len); /* Copy only the required fields */ - dpaa_mbuf->data_off = mbuf->data_off; + dpaa_mbuf->data_off = RTE_PKTMBUF_HEADROOM; dpaa_mbuf->pkt_len = mbuf->pkt_len; dpaa_mbuf->ol_flags = mbuf->ol_flags; dpaa_mbuf->packet_type = mbuf->packet_type; diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index 9308b3a..78e804f 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -262,7 +262,7 @@ uint16_t dpaa_eth_tx_drop_all(void *q __rte_unused, struct rte_mbuf **bufs __rte_unused, uint16_t nb_bufs __rte_unused); -struct rte_mbuf *dpaa_eth_sg_to_mbuf(struct qm_fd *fd, uint32_t ifid); +struct rte_mbuf *dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid); int dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, struct qm_fd *fd, -- 2.7.4