From patchwork Wed Dec 13 12:05:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121750 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5384912qgn; Wed, 13 Dec 2017 04:09:21 -0800 (PST) X-Google-Smtp-Source: ACJfBovBfcOHfvaODPtj3Q4qTca3+4EwGZUKqzg2xjFp1KVhR6hzYemSksF9M7EaVhELcq2JVN/L X-Received: by 10.223.146.167 with SMTP id 36mr2048495wrn.102.1513166960986; Wed, 13 Dec 2017 04:09:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166960; cv=none; d=google.com; s=arc-20160816; b=RzAK+ZeUL4J+HgNYGPTwKz93mri6i/7vMFQHawY6mmIEyNFkApjBmacwJbl7mKxNCK /w4Q+L6aGDls3pR42U0kI+gTvJQeJUBDqltWz2K24S+pox3HgKD7b96/KM0xTi9kme7w mbWwfEqPt/DxzftoiCDSrmiWec4OPJ8NSxHWSg5ej/aYd4dQVDFYDDcOz1+todxX1swM auSABD6lW5bK8ASdZTC+I/SX/vu8fa/PZb26B4HGvJB6SeaZeiLQmuKIDU6e0O7Fs4fy scbpEMZjQ7LUaP27qa5IC6WXjaUL7oupGw110rycGKQQoneYo0xLcNsvI3GklVHEfSMU PkHw== 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:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=m6/1jF2/OmdGg0jYhBjBJUQGilx3bSobzEqRQ0Pm/MM=; b=z2L3AFt9Sz0DU2h+b2O0LF8tYIjg1XgySHH9W5YHRb2BUmblMae3pKA7TzeSyBhS9Y DYq7lz/qrqc+SXSVWHmpQzf+b9M9L1ZFAifWHlr+eoD2GgMzkZ9HwTtukS1sDS+PXkft 9dmhUhaFlExHasn0H18FbKmGuOAAdhz08WPkrtI/kvcAeycBWZ8GD+hWjUJsn+RySKeF 145Up7dYnoQOPgamG6/MNME+A5DrNdDiCqJGnu8x30yVGs8JAwQYo27EyS/Ecl+cMbko 8XYWQXS0tAfEifgmFHbWwu7bf6mghZacqk2BeuW2duqQaF4Nscf9RjK/Cb27omfE+KqF wB1Q== ARC-Authentication-Results: i=1; mx.google.com; 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 x109si1390492wrb.430.2017.12.13.04.09.20; Wed, 13 Dec 2017 04:09:20 -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; 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 480601B1C4; Wed, 13 Dec 2017 13:07:25 +0100 (CET) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0046.outbound.protection.outlook.com [104.47.41.46]) by dpdk.org (Postfix) with ESMTP id CC5871B1B9 for ; Wed, 13 Dec 2017 13:07:20 +0100 (CET) Received: from BLUPR0301CA0011.namprd03.prod.outlook.com (10.162.113.149) by BN3PR03MB2354.namprd03.prod.outlook.com (10.166.74.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:19 +0000 Received: from BY2FFO11FD029.protection.gbl (2a01:111:f400:7c0c::167) by BLUPR0301CA0011.outlook.office365.com (2a01:111:e400:5259::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:19 +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; 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 BY2FFO11FD029.mail.protection.outlook.com (10.1.14.212) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:12 +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 vBDC6t9W008652; Wed, 13 Dec 2017 05:07:17 -0700 From: Hemant Agrawal To: CC: , Nipun Gupta Date: Wed, 13 Dec 2017 17:35:53 +0530 Message-ID: <1513166759-13466-13-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404323532363; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(39380400002)(39860400002)(346002)(376002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(54906003)(2906002)(86362001)(76176011)(316002)(2351001)(106466001)(105606002)(16586007)(50226002)(47776003)(8656006)(8936002)(59450400001)(77096006)(85426001)(51416003)(81166006)(48376002)(50466002)(68736007)(36756003)(104016004)(5660300001)(498600001)(6666003)(81156014)(97736004)(305945005)(53936002)(4326008)(356003)(2950100002)(6916009)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2354; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD029; 1:YykogDFfvd7Vzwhn7A1rVIr7PK8KceWQ0nYVcFJBCcn9qtkQwDADzasXyxDu3kJkFUGagr49WIR1cqBo3W48cxfZMuCO2w8OjdhFEjqDTSlFnRiF6FYM4PcVqjm2jcDt MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 62dc33ff-1357-4ea8-fe4b-08d542220afd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN3PR03MB2354; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 3:cv8SlTcRr30p265MBnRpPEZC3IJ0hPn/CO8rNvUaKrMfD9EjZzfna6si3ygXMHLHSqhMsv16s88XAyE6seq0X9T7VSdAhWwFyfYAEgq2MRfBccrtUR6UjgJxsPU79mGRlJWnr8DaLpY4laXnoStqtaGAECqK3EZDbC4nzE28kSnBmImCODn1K9RjR7M71LwQg0hLfR4d521vkfUZuMLe688qz2RMmuUNe1XtLPhFWq4n4DTo//HRpdjmkTT5yK3qlrjZAH7IIO6OCCU+O9/OKyVhTj0AI+wKcP9iBW/Kp93pfcsKoHF/dXnpFTYnNXPOOXdgCgdY/g1U6VWTQMbzi8tnbgc5O/twc7ZRvfNTdzQ=; 25:0t+XrjzSOSNZ9fLYZTX4cmpEETTG+QNEEopjDcFCZjSrbmWAC9a8VO3MhVIjP8r1SZyOF2OrfcDizTXpMSFpGyl31eZu3CPujtApU/PLcXbqa3E8P9/UTbhN67JZF3Ecepuls8D43jG6Py4XWDwtUI+O+n5O2oCn0N/0ggwdhf4VXC99HspmSP6jM4TA3Yhm+9wowRb3lsjk1ozsPWnCQy4d8Fz9soO/hMXhKWygtG7mFIrdQESWlI6gnbbLvGWpG00CpA81+BTiN08fIDDJAaHKafAeYqwUo9BwwK9YMvzrZpwt44JYPDFkvyCS+Y2IMrKEsjZiD3oSlW25cWKJJQ== X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR03MB2354: X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 31:SBwfyL9k315hI9Joo3svHno0pocSC832QlXFSYCJEf4lyHab1KYTTZ2tUVZoRT/Rgrx49ekwAH09N6AMEAst3NuoMOq665yXDj68/0cLn6Uqhvw6hmKXlAq4bXwiDIA3j3SJZvjWSnu2BBGz0hTrLDG1s0teutc8cBAwCeT+SM8/EOAI3slJKK43N2HLVw1lTmrfB7U81PpYadzGRszaCNJjbf64pfzEoWO3KuTBrOw=; 4:qh4RGSK8XJ+UWit6P2Qwl/5Hh2tcO8geTATTi6HKMH07RGllDF4v7rzLIOBF7aLW2MV1QFcCn5nOv51yxD0JyOV/oxPLbEoZ11vwNGsTmDbGY9BCEuVpcB/5XxCwPNfo9oLdsDZ3ScvlGwu4eGbNZLwlJEM6Gp2fgGfugpVGQq5nBNFsBWRVwypQ3D7SZK4WXJdzWQhZD3CUbONguJsZIoXdcEncvWkKIwTECxt5sFZ4OI+pHlIl5HKR9cjf560V4jcWfDxADUJ43Q92D3R7dxnatBWJnWVK1MifLb4wj6iFLEH6bWTWjRLbpPLB7RZ6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231023)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123559100)(20161123556025)(20161123563025)(20161123565025)(20161123561025)(201708071742011); SRVR:BN3PR03MB2354; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB2354; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2354; 23:uidcoZ0WteZUierC/4fXl5zv6DEUfXSaRByi5J+yG?= EmYi6CnLsUZJnD9lFxNyfwU2t+tl649MYcp5AIZGUa5fkhmXNcTm9J9qJpW5XYxUUEd9hWEn4llKyzUx1cVzdhTVSpSW0mNS5NYGKBI8D9PIl2zACHQD3HfYHUk7MVPGxOayoxBH7cCdeTG6yfJfk4WkLNNoNyoc8ptKVSo13Vo9/Hhu/DZymhlJmkUV8O9LFdyYLF/h3hPG7aV6kVgYEg5W9buMDzB+ML9xOFP6TlWORWOXmEW0g5D0pSXG6QaQUheHOAZsWNewZPVVlSKVP4Lzb+kIfHL7TdRM8b0Le/MDUkJHHnoIyNybA6RtLBpLfFXnTJ5X71oNyT2jtHnhVA6749OkQX4s8X5PHzfBDxFqIRoOihGCHmzFLdhJyqXlADIPxgW0vxrXWlNNRu4ny9CDm34D8DIBZrk39V9CGExQ9gfVMD2+u0dUXqV/TPJxnT0z5uv5Gy3F8bXhsaSMi0xxpXK5Z+Kf5V8fMi+owoY/riOFUM0KjuvkZ4Px4cpDZPNw+IVO7raU24gfyqAolBovmr0qKIN2OrzC7aRW2d0NgWlqbucmvJhRRI3Bfz5ciX76/qoEkBcXUne/iO6tKBvqzvj/ahA8QSqsikRSLOOoDp3kBaz4w88sIPFLc6SGQDHX0D+/aybRv2H6/ty30dGGUIYYAywiKqFifjHYJAVG0T6qUqV3hwX6xVnyRiBXXbUERxx+CipYMzwvM6LRyyIA+Te/JsKTQBhgtdxDT26A/S36VHR5m2z177MvQJacPTGrSvJfIPT1o93C/LzG4nwqwiyggPL4sglU2N0YfU4KaHSGSK+9/30KCJBP7YTacQgphzPL0VCBx41xruFjjj6jFTYXoKFrzAevVz9Qn35WrC4vc5d7lSLHeCbj7530Dis6O51Bc5B1D4BWCwUBlVs7/6Qyxz0DpJc41FqGjhGuOmnHV1ELKs4bcjiSzMBM7F3dxhpD0aGHfuUAKKP3NuDTVupSnMlfafesxGNxh1X5gSsRiV2jjHSxW+P/MB32KNazCAE8uyPyrwPBKq3FyrrIy17454nv60UBlKf3m0PrA== X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 6:GfoB84cVaGfLxqvgC3u8igGbH5s3zGsPmou/MuTzcGeuLHm9By4TmASnqFKeWMN1toPU27VYEJNJK2R5BuKTQ1ShkumfQjA25VqoeKNtzIcvst7B0lugT4SHcDVfnwQE6i0qZlHqXYexnXzcZIYC22/XsjoIZzRlMprzJuqXfAlrGRQi3BksiObcLu5K0T3l+HNRGFwTGx3axmfehIcMhCj6YtxqTReWet3TPanA3ZWwLePAU8i86ho+Xct9ZITQQ1YqwJshyZJlotlEw8dPEcsqOMZ4w7+IX9PGXekKOYxNURdpfF3EPpHAkTzZYQuPcQ2X2ajSuYhuBobX4baN8OYgyPIPWK/dZLcA976kHpo=; 5:T+y8gktBOfQ5taFeTRGO8Zv7qpPFY4Xnm2gs1Z6+4NQVY+9yFYWUDG8FI4FEbj1SQuugCTN5UqmR3s0vDHizklIlKrdNSSHOdBOtZCGCU1MwM+ANBLio+jCAmip3f2Nw3zyLC5FX9ZAQSKgW8WW229NtS4zDJGoubELR12n2A8M=; 24:ur8nxt5LNyE1rJqt/M5ArzBDrTmvVB9BLU0mt/uSDfh6IQYC+0xdCwyZprhDZglQ0DizBBqJdU3ktcBaqFh5bhAoHFkxUtgHghSFcSSEpiE=; 7:TGBeaZXDsWX7TWUDNFZ94es4H9tFYlZNDRu1Z61qOluJSiPaUYmaDMhPpj+fTYo2H2qQX4qSq+eFs/xC4PC8bOvj+JBR+5azLEP8XPcUL9MsBrchiLcgvccWrUsWhozpvAHjjmRbqEfCBB54Enk+AGyrpf/yg8StXD/h7z2APTM3oJLqVELSqFtp3c2z8vHrwOMXnq9AXHZfB7k+2IhXhpkfB9dm0GtQ42LeJm/Z9AkWBQvnJ16mBlTZe1X0eiQF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:12.1504 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62dc33ff-1357-4ea8-fe4b-08d542220afd 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: BN3PR03MB2354 Subject: [dpdk-dev] [PATCH 12/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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 33cc412..2609953 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -123,12 +123,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; @@ -137,6 +131,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: @@ -199,6 +196,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); @@ -209,12 +209,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) @@ -323,7 +322,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; @@ -381,34 +380,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; @@ -488,11 +484,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 2ffc4ff..b434b6d 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -288,7 +288,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,