From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0043.outbound.protection.outlook.com [104.47.33.43]) by dpdk.org (Postfix) with ESMTP id E1A7E2BB9 for ; Fri, 16 Jun 2017 07:33:34 +0200 (CEST) Received: from BN6PR03CA0067.namprd03.prod.outlook.com (10.173.137.29) by BN1PR0301MB0595.namprd03.prod.outlook.com (10.160.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Fri, 16 Jun 2017 05:33:32 +0000 Received: from BY2FFO11FD015.protection.gbl (2a01:111:f400:7c0c::181) by BN6PR03CA0067.outlook.office365.com (2603:10b6:404:4c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14 via Frontend Transport; Fri, 16 Jun 2017 05:33:32 +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 BY2FFO11FD015.mail.protection.outlook.com (10.1.14.131) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1157.12 via Frontend Transport; Fri, 16 Jun 2017 05:33:31 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v5G5WNFY001003; Thu, 15 Jun 2017 22:33:29 -0700 From: Shreyansh Jain To: CC: , Date: Fri, 16 Jun 2017 11:11:05 +0530 Message-ID: <1497591668-3320-36-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497591668-3320-1-git-send-email-shreyansh.jain@nxp.com> References: <1497591668-3320-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131420648118086456; (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)(336005)(39380400002)(39400400002)(39410400002)(39850400002)(39840400002)(39450400003)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(104016004)(8676002)(8936002)(36756003)(77096006)(2906002)(6916009)(2950100002)(105606002)(106466001)(86362001)(4326008)(50986999)(81166006)(5660300001)(76176999)(85426001)(47776003)(53936002)(5003940100001)(33646002)(356003)(38730400002)(498600001)(305945005)(50466002)(54906002)(189998001)(8656002)(2351001)(48376002)(6666003)(50226002)(110136004)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0595; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD015; 1:mbOlMwR8s7JKftsIdMYgid8yBc/4EzonRH41qFcvnFmWdeUBffwzhdFEWob9DuT+hTxE6rwHEk9+IltHtmit0GMpLDIvihUZuniY11j2IxsdkiVuZbnD7gt9Qz45Ph9jEGD317H92KlPB9EC6TOgxy8c/ObZ0avo43c77QOchNmMahMTpBTPb5Y6m4U4uOVGhadm8XRMElMolW3sMvgjHp3cnd3HBin9qv+4WkC+ncc6l2wT6yUolX+SMqMOVBBS/lBiQ4+/bdsf2HvXrQkSKUh/1/ixwHytlv2sgDZ2crXtAFW41GrQwjCU3AeC/bRv8bgiQaJPmzsOwstJabhNR/T4DRPwt005y0KykyDO1ie+l6B70ggNZ2fwkDPI0e0TM9abi4O4MMCWccCstboH1PSxIItwG0RoVKigthBeTdZYrdpwuNTUVj9VljX0fhkHGsk16IG0j3vTPPxzKPSiUSwfSuupYR1AjMIsySLPhfzW50iW5OHEu+UPrRNGhGXdVoMSBaBmBBJCW3OiJ/LPu2e8HYFjzDT7pq1wINHZGsKXc2/Xp6i+n+bmo83i6eNsrED2KFt1T9A6TxepFh0wsgYsIA4MSOo0diBm2mxekupuGfQkaP/+k3GKUmRvB4WrVP4XXWC6OvmrXRsR3Jg4zaymtJTs8PUQsPUWC/Kcf0+6vFiZEfspEiYif0N+FeBWi/MBwltkavSS6mnCpio5va9Lmbw3LEGrU9cwUn+MlVE= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PR0301MB0595: X-MS-Office365-Filtering-Correlation-Id: 36f7cd81-0eb6-4b7e-7ec6-08d4b479399c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BN1PR0301MB0595; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0595; 3:eY/9+XuQpuV3RLe4fM9cW4QcAlllx21fN1woEORjlYrnVnst0eh/nXbaxuZKJck51BKxIWxRlfoqv84EWB20piaMEG/oRV4sZP34tGzhSab6ufdfnAn0Q4KgqY7Mn0dMkQmK4pO2KrHZos7NwNw2KGSp2zMyi+Zd5BiqqbJmty2W4/+2GDfOIjr5VtGih7mWBCQw985NpiEo+7Jh/QWm5eK+r7MB6+5e+F2bsVFOj7jQMEmKaJq+uCaG4/cCyHPOw06JFx7BW8fGfmowUdOM+qLOgRRRG15F7QIdPr6kokBtg6EQfo9NZaoq8QYYgp1/zU9uVLu9rJ6bzLjqgoNPOD6iQAEl2uqk6XkUlccYGz99Vi78QM0bA4rWFwk5wIGqVtmFOHg3bR8tu7Lwbab48qVuJ7xN/920yv4mU56GARpUwXea9RmNZ/NNEtohpyks; 25:tmEEwopDjwhjMD3FZx6G3jYEIFY+K6mM0o9BR9ftroXv06wrf9Eht2ZIgOcI+9Y2EDmj2DJJay1k9dwjbzSIm7Q7VzvFVk+8MEwdHVh8UjqB0z16NxlXoFlsCma5xaEeFQE4RKmynFMnjNf2mBVYgP7pJTZhzTykCerBGIu042fgBQVh1YuwqNb2e7yqUIar/2gQz4/GCqByPs8cFOdwfIe3iCLnJ3wUMQ/gMFXG2uy96mWZ5ydwC6fNnfN/ghLO6tmrvUcfFP2Kb+RA50ypaCcSWyHQcCmi93RIj6k6mTNMVN05JKcyLfssNEc3jAZYANN4v+qBdhJgXpbv9r8zcPf1GHE8gooJY1dwQZZ1DUKnfj2DZti3XeKAQU+HUCj94TSYNhyadr3ueaUzQ+rPmseC8yzKIt/HfDdVW/zm1ytgbBa5OAH/z3M1o8LotEbvQE/f/esXPqWeE8/3JHstWMKYn6fP2++PQ8VXFVUDqQQ= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0595; 31:XruE2CH4MNDcTNqR6MIdaLr+gWNmG9hAMX/B4f2WedyBKkSrmbMFgw5a+hldjHKLKXc3Bn+t0utJ/uG36tyPBvUfhjqP+GLiZ/eKyEfJ8kWJo/tZLe+yGcGEM0OeoXEsLHR4TMyhWL3BTmTcx5WIbgAAG4+QM6o9rXskWUhfV6mWs+lSCHx61yJk2iHE+mhfwdNBjnMfdPWaBYF597D5V6py8DysFnPo37T8+s1xVkNRGlnWEa6BJwKLpnp+/AW4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13016025)(8121501046)(13018025)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123561025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123559100)(20161123556025)(20161123563025)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN1PR0301MB0595; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN1PR0301MB0595; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0595; 4:g7u5pHESLHPmddb+Zuz8PPC85aKSnmWG8dFktKax?= =?us-ascii?Q?titBL89zYvkUKhGdZCvTa/6Y5AOR67pBe3MCmotGq6rYjGcpg86SAhNd0NHQ?= =?us-ascii?Q?+BxCOdsNN+/9xJZlIoadDk1kUxnsVd0WlTkpJWzokCDIEPq1US8xaEU5BmV+?= =?us-ascii?Q?xUlAdVqrFDPT42n3pdHg4uTxadq286NvIz0PqUGk254LWyscKrFn9wVaRa9w?= =?us-ascii?Q?14eGshdQtSnz8ydLnHgy/Ur5hMXdhhhRFv74rDA8sAAYaEuV6DfwFM3xO3bF?= =?us-ascii?Q?MWpqLKeAACWzPYtowuTULZXSwH111ldRYHgqfV0mUfhwoI+AwHIgoEv6Vn5d?= =?us-ascii?Q?eD6G0huzXQwtsffZEmdhF01haaF1fqOqImetLF1ZHQ03PVaRZXJ6w6ySSR4i?= =?us-ascii?Q?sXeDnpEy8sriJNIPfIIOJQi/OKUxZ9tgQBv/8IOHmux3W11B/Dv1bSImjYJs?= =?us-ascii?Q?r5syzkrQ4NGsVtTKRF0Y+lD/Du2WwaoaFMTpEhGIbqtsRwFKFJ9d/2s5tldg?= =?us-ascii?Q?srfsfQrkQY2KK7FG7MqMk0iJTeGoPKRLxLtmmSmhK6EXZnNcMGRm+39lHTka?= =?us-ascii?Q?Locq0w6rb0edTSATwm1R60Ywx9GnVzIpCKciQBK3/N4e8lTUvRn3U/3CvRNn?= =?us-ascii?Q?TI9RUXdrByQoDNZyLFOBR4SohZRmnBtzWZKSWYNn0K+lqIuMO88AfPDQPl8U?= =?us-ascii?Q?Ml1agC0BR7DHdbR6tRshXbGYv0quLjG+oJr0u7buodETRSrFRxBe/TrthnUX?= =?us-ascii?Q?6m3vAR9OVIFn+cKTsyIOj4qPmlOOP5DBIO7OmI9JM1b2NttUyn3yZJngdGFp?= =?us-ascii?Q?lDo5Sad0kcTaGWY0HwG1MM7jh4PKqxEdvF0B8TehuhfJbzlEPbuVEZvUY1e0?= =?us-ascii?Q?4A8e8JjHUPN6kVh1T5n9a4qiHvzOSu1z+IRUashj1nNKT4aQ1oaVNYts+a+Z?= =?us-ascii?Q?YDxU7gfRaG3abhtKEJ8BLiDALy6vnwj313VfHpyA7xdIEee96NDIAP5DBYUj?= =?us-ascii?Q?FnHXL9xT82ga2lwwk103+pv9BaTNLN1ujOjB9jQ7ucL4stjlOwvwb5OhIXwz?= =?us-ascii?Q?cN3DDOS9olx2724aBHchUqRckkzk7FhGJ/7UaC8dsyIfELbP7ibUYkFGK8/a?= =?us-ascii?Q?UD/OL2N/Vpxozc4E4pCAjJmqhMxvS3kP5sZBMkVPr1WTjFPFgASHc3yJATzW?= =?us-ascii?Q?MPMf3f20P0yR73ZgyVRsAGhOocNbDxiwJ6w2xR4pVVyVoM4KTpRV2rBhtf03?= =?us-ascii?Q?9Op0VXbzLX0zTFw08Q8LPPam9BKQaMt717/3mF6p?= X-Forefront-PRVS: 0340850FCD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0595; 23:H83AyiFVqEmUVgFx4nZO6F6t2FyEIBKtw0cSigk?= =?us-ascii?Q?GHszJTaeEQsqepHvo+JWcx8wEZnqp1i/ZYSc3bB2RUaTchDuURTLbVEUGbW0?= =?us-ascii?Q?EZgg3+XXnulr1eGvjNz+Jciis5o5m/BjeC0UtMih/Zj8E0nxTBQy9dQsDTc2?= =?us-ascii?Q?xV0wkq3+TvRtxmhyYHygR+BJV0ylmSSsuyIu81rGGvHBZT+tDwYKyneig4Nu?= =?us-ascii?Q?7FR5SHJZVzCH/g1TxTCGfM9lLFPxExVooeZEfB7VwNHVCH3/oVhxNU7M6mIT?= =?us-ascii?Q?t0P55Qi8q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vpKrS9pqx22x7ADMQstnW4dGRDPygGtohrm4twWIoZLqnHzfPo33MxZROR5GsvLWxLe9mChm9kMrOEGHjhIiskEsep1PIFyZ57OFLrkS0OhO/83p3Phnoztn47vpMsOiDbVnvuEQMjVOLYvlDNzN5Lx0z+lQTt+DdYmoNyVcX99LF12iqv+2+E5w==; 24:D+oULStuEQsvLpxu0QRZEx3uM2dHds0T0+i4DO0Fs8L9fFd/jR8FwtdL4zAikl/L7W9QbJhYmZrG7UYd67QKJpy/j4C4zui120TswDeWjBM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0595; 7:iqZXHVqX3w9DEG3TNzBtpnAeIhfFPf6LMtuBGNWPXdgc7ip+hH2e2fpnzmg+ilafsDoAH+R4fcEl5s6FsRTkxMKTr5ooNRDRNTR7wmX4z1+5yH8nPdydsx7zKgOwHBrNR6mjKChZGW3EzJN1VwGf0AFLDSytGDNXrbpgxoMAOOWhTGcMh+oliLHxHzxEXXpJM3qRr9D2D36HnT5+IG5Fm/AzgrqoOi8jL9p9phPGpiQ5CpllEkIH4xzFKDKJ4puXpHD4K1TZpK6CRujjXpZYK7Yis3Lr1/jLmIOxWAQLQO00J+b6P2cD8OEUN+5eo2ouV8QvgVzCqvaw1VGXBcyEJQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 05:33:31.4654 (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: BN1PR0301MB0595 Subject: [dpdk-dev] [PATCH 35/38] net/dpaa: add support for packet type parsing 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: Fri, 16 Jun 2017 05:33:35 -0000 Signed-off-by: Hemant Agrawal Signed-off-by: Shreyansh Jain --- doc/guides/nics/features/dpaa.ini | 1 + drivers/net/dpaa/dpaa_ethdev.c | 26 ++++++ drivers/net/dpaa/dpaa_rxtx.c | 111 ++++++++++++++++++++++++ drivers/net/dpaa/dpaa_rxtx.h | 174 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 312 insertions(+) diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini index adb8458..2e19664 100644 --- a/doc/guides/nics/features/dpaa.ini +++ b/doc/guides/nics/features/dpaa.ini @@ -14,6 +14,7 @@ Allmulticast mode = Y Unicast MAC filter = Y RSS hash = Y Flow control = Y +Packet type parsing = Y Basic stats = Y ARMv8 = Y Usage doc = Y diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index fa664d8..4d2bae0 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -112,6 +112,27 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) return 0; } +static const uint32_t * +dpaa_supported_ptypes_get(struct rte_eth_dev *dev) +{ + static const uint32_t ptypes[] = { + /*todo -= add more types */ + RTE_PTYPE_L2_ETHER, + RTE_PTYPE_L3_IPV4, + RTE_PTYPE_L3_IPV4_EXT, + RTE_PTYPE_L3_IPV6, + RTE_PTYPE_L3_IPV6_EXT, + RTE_PTYPE_L4_TCP, + RTE_PTYPE_L4_UDP, + RTE_PTYPE_L4_SCTP + }; + + PMD_INIT_FUNC_TRACE(); + + if (dev->rx_pkt_burst == dpaa_eth_queue_rx) + return ptypes; + return NULL; +} static int dpaa_eth_dev_start(struct rte_eth_dev *dev) { @@ -159,6 +180,10 @@ static void dpaa_eth_dev_info(struct rte_eth_dev *dev, dev_info->max_vfs = 0; dev_info->max_vmdq_pools = ETH_16_POOLS; dev_info->flow_type_rss_offloads = DPAA_RSS_OFFLOAD_ALL; + dev_info->rx_offload_capa = + (DEV_RX_OFFLOAD_IPV4_CKSUM | + DEV_RX_OFFLOAD_UDP_CKSUM | + DEV_RX_OFFLOAD_TCP_CKSUM); } static int dpaa_eth_link_update(struct rte_eth_dev *dev, @@ -465,6 +490,7 @@ static struct eth_dev_ops dpaa_devops = { .dev_stop = dpaa_eth_dev_stop, .dev_close = dpaa_eth_dev_close, .dev_infos_get = dpaa_eth_dev_info, + .dev_supported_ptypes_get = dpaa_supported_ptypes_get, .rx_queue_setup = dpaa_eth_rx_queue_setup, .tx_queue_setup = dpaa_eth_tx_queue_setup, diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index d2ef513..e2db3cc 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -85,6 +85,116 @@ (_fd)->bpid = _bpid; \ } while (0) +static inline void dpaa_slow_parsing(struct rte_mbuf *m __rte_unused, + uint64_t prs __rte_unused) +{ + PMD_RX_LOG(DEBUG, " Slow parsing"); + /*TBD:XXX: to be implemented*/ +} + +static inline void dpaa_eth_packet_info(struct rte_mbuf *m, + uint64_t fd_virt_addr) +{ + struct annotations_t *annot = GET_ANNOTATIONS(fd_virt_addr); + uint64_t prs = *((uint64_t *)(&annot->parse)) & DPAA_PARSE_MASK; + + PMD_RX_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; + break; + case DPAA_PKT_TYPE_IPV6: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV6; + break; + case DPAA_PKT_TYPE_IPV4_FRAG: + case DPAA_PKT_TYPE_IPV4_FRAG_UDP: + case DPAA_PKT_TYPE_IPV4_FRAG_TCP: + case DPAA_PKT_TYPE_IPV4_FRAG_SCTP: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_FRAG; + break; + case DPAA_PKT_TYPE_IPV6_FRAG: + case DPAA_PKT_TYPE_IPV6_FRAG_UDP: + case DPAA_PKT_TYPE_IPV6_FRAG_TCP: + case DPAA_PKT_TYPE_IPV6_FRAG_SCTP: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_FRAG; + break; + case DPAA_PKT_TYPE_IPV4_EXT: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV4_EXT; + break; + case DPAA_PKT_TYPE_IPV6_EXT: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV6_EXT; + break; + case DPAA_PKT_TYPE_IPV4_TCP: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_TCP; + break; + case DPAA_PKT_TYPE_IPV6_TCP: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_TCP; + break; + case DPAA_PKT_TYPE_IPV4_UDP: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_UDP; + break; + case DPAA_PKT_TYPE_IPV6_UDP: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP; + break; + case DPAA_PKT_TYPE_IPV4_EXT_UDP: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_UDP; + break; + case DPAA_PKT_TYPE_IPV6_EXT_UDP: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_UDP; + break; + case DPAA_PKT_TYPE_IPV4_EXT_TCP: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_TCP; + break; + case DPAA_PKT_TYPE_IPV6_EXT_TCP: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_TCP; + break; + case DPAA_PKT_TYPE_IPV4_SCTP: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_SCTP; + break; + case DPAA_PKT_TYPE_IPV6_SCTP: + m->packet_type = RTE_PTYPE_L2_ETHER | + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_SCTP; + break; + /* More switch cases can be added */ + default: + dpaa_slow_parsing(m, prs); + } + + m->tx_offload = annot->parse.ip_off[0]; + m->tx_offload |= (annot->parse.l4_off - annot->parse.ip_off[0]) + << 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; + + /* Check if Vlan is present */ + if (prs & DPAA_PARSE_VLAN_MASK) + m->ol_flags |= PKT_RX_VLAN_PKT; +} + static inline struct rte_mbuf *dpaa_eth_fd_to_mbuf(struct qm_fd *fd, uint32_t ifid) { @@ -117,6 +227,7 @@ static inline struct rte_mbuf *dpaa_eth_fd_to_mbuf(struct qm_fd *fd, mbuf->ol_flags = 0; mbuf->next = NULL; rte_mbuf_refcnt_set(mbuf, 1); + dpaa_eth_packet_info(mbuf, (uint64_t)mbuf->buf_addr); return mbuf; } diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index 09f1aa4..f688934 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -44,6 +44,7 @@ #define DPAA_MAX_DEQUEUE_NUM_FRAMES 63 /**