From patchwork Wed Jan 10 10:46:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 124050 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5161308qgn; Wed, 10 Jan 2018 03:36:20 -0800 (PST) X-Google-Smtp-Source: ACJfBovcbZx+WWlYhQ824lCtQtZs8lwruxUGpJmWnRkVj+cATz6cWDnKIh+NSwN3ptWXmSyZhiIZ X-Received: by 10.223.151.219 with SMTP id t27mr9316571wrb.276.1515584180319; Wed, 10 Jan 2018 03:36:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515584180; cv=none; d=google.com; s=arc-20160816; b=aBy84B6nqa6E4Tixa+ff52uNG9FGHBFBUx6Elnc60sO13If/CoAovF8oPpBFlTVKVh IuiULvoX0hmS2ViaOQ463b4DgkcBIoak1bzRlp3cLzdj1rFQl20PIA0uiwheugnihHvn cCpvzr8eK/X9QS2OWpAfHECrADG15eS4HqU9STx6f9DXnX2xGhqciFhrF1ckMsXghX98 5DsyMOaO/dw1yYC01Sht6Ld/DeXix08+tvvtHDwXkWhyojZAMS1P8DHsyoOdAzaOKc5d CfF8kuuwi8mpg0yW+0OHsrQa5m3MK8JaPv8vUyzwxKBTkr8sKy/0FKLQmyf1IxhKMCzE mXaA== 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=dP2iTPQPyU3N6tIXg903qokdi5fH+A6wH9acG7cDk4Y=; b=0OE5Byk7R1pQYkCeKGHY2guZtYNZpUO6JYQrQx6An35fS6KVoAP85strPSXVgDvUHe 73x/uHPOSJS2IYsTgE8EB5IMENJB1t+5CC6813FVZQaxi3u0PFafpNLt4Ooc/pjYDuvL 76MkTLYXbJvRpW+usrMFRMp2bVKNeDOXdoq+eCVRHhBM47ZptY+DdxWpEYF4OP+bTnDN uMEJaBgPqC8aIAlulk0Bp8J9xRb26hY80Dkz7QkISka1edr7w68AMP90uLDxGDxskzMc KB8IQQqQfJYQQisqI2wO3YOJkqHCkqrnPlk8dBI+abCSECuBqDT/ye+QvbeaCD5CJK5w QwyA== 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 g66si11149879wmi.254.2018.01.10.03.36.20; Wed, 10 Jan 2018 03:36: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 E3B831B1C6; Wed, 10 Jan 2018 12:36:10 +0100 (CET) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0058.outbound.protection.outlook.com [104.47.41.58]) by dpdk.org (Postfix) with ESMTP id 4F3CA1B1A3 for ; Wed, 10 Jan 2018 11:48:20 +0100 (CET) Received: from MWHPR03CA0018.namprd03.prod.outlook.com (2603:10b6:300:117::28) by BN1PR0301MB0723.namprd03.prod.outlook.com (2a01:111:e400:4c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 10:48:18 +0000 Received: from BN1AFFO11FD027.protection.gbl (2a01:111:f400:7c10::115) by MWHPR03CA0018.outlook.office365.com (2603:10b6:300:117::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; Wed, 10 Jan 2018 10:48:18 +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 BN1AFFO11FD027.mail.protection.outlook.com (10.58.52.87) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Wed, 10 Jan 2018 10:47:45 +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 w0AAljSU007124; Wed, 10 Jan 2018 03:48:14 -0700 From: Hemant Agrawal To: CC: , , Nipun Gupta Date: Wed, 10 Jan 2018 16:16:34 +0530 Message-ID: <1515581201-29784-13-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> References: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131600548657876176; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(346002)(396003)(376002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(36756003)(85426001)(2950100002)(498600001)(8656006)(6916009)(97736004)(51416003)(59450400001)(47776003)(6666003)(54906003)(356003)(305945005)(16586007)(68736007)(50466002)(86362001)(296002)(316002)(4326008)(77096006)(2351001)(5660300001)(53936002)(81166006)(81156014)(8676002)(76176011)(50226002)(2906002)(106466001)(105606002)(48376002)(8936002)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0723; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD027; 1:jhyMjwSrNIZUVrlduExVRJLACmSQN0rfaCr6BtEcxaP5hGGw6wU2DTR8HwL5UHUwU4N0eV9HhovQFgSqs7iisHDi3v4b7TX4Nr0OlbRANedzYMo3G5SriVEXf6V9PhdT MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c7d52d4-d1d1-4e22-ccd0-08d558179576 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN1PR0301MB0723; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0723; 3:ChIz025sg6FfKKu1E2382qqyhHpzli6LF38aSGx34CNKelFCFgM2SElHCrYXp3nUg4xFC9c92iBdAK0/QUKzNfDQq8QrwndwDiw+9KP2BSvgbgaVdCJUviCnkgDMuRk1Hy4kGeVIcE7hb1u2AW734tsGPQxrXGipeUG2X1Eqi/opcr3f2MwsHXSFAr/wlTPBhTdorwDiZMNW7JxvBgsNa0Q7Sf4DQ5cfawfJxGVWAwiUqDqaEnVazRRUx00ZjBbxtxyLc+U2eHy+rXAXiY5kG+30OdVJgPKlaGi/4zbtcW00jI0rctwWE1lGYWDkmtOJJSKBnN85VtAv7awgyux8SFN1MHNU0tgNi44rIUQG7dU=; 25:PO2x9I6SvlqUEyGvxvFC56LILja86UYK+Xb/SLKnF1fuqTizvrE+x0lpgsDwAGemWONTGcNRU+prAXeIvO2JG/YZzsJ8vP0Bwk2XcnL906/6+gMRHmVEc7h08tAdPS4G/BiRCGn9n0mmOVfQrIoFjKPEExYGVQfg4DnvLPLKlwcok/VPcaTB8sB6PLZPR1j/7hgjK3FF7D4Qpb5SiEqoHuAn0CT7Y+hUD4/uUA0AKQZCUNZte/AuDFQqTrjWi5HYtpPvftm6hOG31Q1nQP+4qaqWu/zZh5uaTtLti6hTmvBRhOCW7Q8k/gAfH6fvGxzOQznV43qUaB0brIue8JtlZ8xhSReX9sg5KbS7N7T9ED4= X-MS-TrafficTypeDiagnostic: BN1PR0301MB0723: X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0723; 31:kpuvttEZjcwuKSjco2ZE4GkQKP8cH129LLncWBR4Y7DxAuwHd0ACuN5yYPgbjq8fwmjVWuMnafVAtYPKsMVd9dnAvd6lRQnCiQDBDP7vqiES8reFD6ckb9GsLXN0+o5RfqvTAsiPpTOWs7LTmn0vc2haBtoPY/JbfNy7Wbe93sNO8GHX07va1ezg9LXST5p0R9Gad28X+6H0RUXp7y76skC4KU2tD1msuXuF7pThiII=; 4:8dWzndI6w0lfKhrq2wd2cbNmHsZCRUGsl5IzBE+TcG46xkA7Kx2jGelEjdUwcJ5Faso6TYGCRt51kIA8xZUGh9WO4+4LsTQXd2VNp1XTIuM12bQQHxc/hum8QRUPUkYK2d9W8GG/O2CfaozyXjyskQ2T03xXMuJ2RV9nwfbKltS4wHdRzCcPJBrC+6/JxKxY9yTpil89VsLn1vAEJIhdw+/X6RK3LKQbYzBWySyR6gfNeD19HroaJ8M+fsulEJDyOadSqK+OEjD/b7aYE4Qq76s8UlIMSI5OzopdCwv1m/Wf3T/jXDnDhMJEYfrnMRHP 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)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123561025)(20161123559100)(20161123565025)(20161123563025)(20161123556025)(201708071742011); SRVR:BN1PR0301MB0723; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN1PR0301MB0723; X-Forefront-PRVS: 0548586081 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0723; 23:cFXigjPGh1k3lRqz2d934fhHxgoIAFloxju1Cdu?= NSTlrzIwslC+2dB1+Zv8h5klwxHSvZQTv4kfWRm27o9oAPU5ht2WyP34AfRfyQzSzwTsk1zAaLGZQqwcjs0+llpXS69YRq4D/kY779dDCwR2bpnwj2KuH+jUwu0HYVf4Os3qdU7CLBvnjkcopat2MIDn7iFST0TdlFGGPxcnAg2DW9GFubbh55SSnfsDGI02FsyydVnq21ysbEgI+0e8oGiKhS6SC/1fjxYKYP31fITx/i53rRVcIcicpsiGjkJG8MTd4hDdkqQe83e9R/xme8GvLTFIiTIFouWfSSMbtcY8z8tZQwsWcY/ZTTW5Bu7ojXmpWikJHhMGejm674B8cGthyFopd2LtVZ3BJlB4K/cvOyRVVgCbw73RwreVNZG5wZFRhJYAwjYdL+Hi3vNAPM2MGJ382qo8o5HxhWpBoovJq+8jf8/tvVqEMafpZcdGLK/ZxDnsshT/5Gq01jYDE1dLH4ZDeIlIBA29FefqEPbHoS2ilWzLtJqSf4eq9ttwb4hsK/pNLdkbFap6wrWN2EgWxvlCP6quIcrbjMRDNaxAyiKJIQSF2Nvjx32umdj+5HFb7acgG1TCaMj+3bR8nEhT/sfR5HN2W3WhoL5SpCejPH4SRHpI5IzpsElFYQZMf1NSV9DQak0aRjehvYTq5ErFM2ycVFigPmBpOMkTCJjS+9V92l6AipVncMVT01Au08RiPGAjaClKUtF2frc+OwdBZgvrKdzypuvEAmg6e+z5D6mqrq3bto5aX5qPNBAR6f2oU1wKF4lf0OcMfX+X6w0BdZ97Ddn4FXeGS71ghO19TO+NOXhnMijugeSd41q6N++M54rzutkt3STWx3WXD7zcvzNPZq0FdB0hEeCU9qJmo220Be820aChZcIS5Os34QxTpv6VoJC6meZz0jVa2iX847+oc306IXBpVBSxCxl/OaxenH5NzrgQYC9CtHBbj582KM6umRryEtJo82Gz4cwhTsqzAAByy1PddXqoogVLuXhXA2IA7smj+iwH7WVE54L6DyDLAHn7WRjKoOEx+9SsKJpSj/5SXAcct55dIrez33v+fGaAnrmvTVFfJp/TJSUY= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0723; 6:CkkE0/AqyE+FV+/fQRi87TF61aNZOXCY0xHAG+VW9v7GfY7AUios5RwhSsc2EfgGkuxQCNJUDGFDdaO/HqpF9mOn2iZayCms4HpCgB08L7FaSoDq0RYIDc8ZlJEn9HUHznP/zNj1OwbbbVUVDZy/W7kigkau0tYoWFWcN2fCRq9sssLwG9J5ecrtDzAEap0hvJQdznINjXxJ6SQgiTseelKsYR1C2bY7dQaMC0vmEdrg6FApd9hifHI+wmz0HYSk8RTMyOJIafwL9gJJTtYZJetILjaL3RDkuVcLobZBw4JZtFXVrRYIQ1n4Eziv99AHSV0JYbs/uaKp3oEIMgGghI32NXd3a4d8T11IX9pgzi4=; 5:S31utf+5xNMh8b+tw14GbD5FbC+6Amyj4JiXj7c8JnokNNskXGtu/hbWFrCoFKIfw/4fQFXoJGCmP99tI8dk/ja1FmrF0PI5mjtJZId4TeIZdp1haNa63+obUl0tX0/KNuYzddkAqSLm9L32qiaw46i31jYtRrlY8sLKoDmLXvA=; 24:cXaJMJv4YkGFN32j3jFE4LXZ2teR8zUZEMps7P+EpLSQTCh8gRQieawUXv3YyjuD+x/zHb8dxSz5tgShBz9zrwCcsysaS/xt81+pqYQo/5c=; 7:Uk4/pZ1w6tZvNjw4VtrufxFkmTBAZLU7X/8ua0toKoffAGe77RvNUa2wOMNjCzuKMp74YkgafGlblPUwfDDZ3aNXz1vc0t2APwUwwvV/p4z8iRI1+GKAS+HcUB7KcPcJe4HbwE6KTySLuEt+pfXATgMMQVAsrY/HQ9qzYtkuN71mIJVKtT0E7SEwaLP65yZfSmJAtsIUZhD5YFE5i9/FM9fyi0XfOOn06IL1GeSc+VVcDa0uh0JJLZTHhyGNZ5ro SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 10:47:45.6160 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c7d52d4-d1d1-4e22-ccd0-08d558179576 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: BN1PR0301MB0723 Subject: [dpdk-dev] [PATCH v3 12/19] 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 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,