From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0075.outbound.protection.outlook.com [157.56.110.75]) by dpdk.org (Postfix) with ESMTP id BA971D009 for ; Fri, 17 Jun 2016 15:32:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=mrQbx6cB3QHI5cii4iFhPwyqaqs3LW22gLbplM3ZzWM=; b=GVC+beyiUKKLeGofKWCKx7rwbeKxEk2nxJdhCgDAR2aWYAdo2R5gxkMv+1/6L0w+ECXrmyMKuU8own0wLshSt1YntisMTAYX51rj5AkQPLxqgBcCsRjJf2Bi0QGrSce3JtBUwP+/QaCS0+SAU5JOvRCWssHJu3Xc7bW8RNUFMtc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (171.48.17.70) by BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) with Microsoft SMTP Server (TLS) id 15.1.517.8; Fri, 17 Jun 2016 13:32:29 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Fri, 17 Jun 2016 18:59:48 +0530 Message-ID: <1466170194-28393-22-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1466170194-28393-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1465931200-23912-1-git-send-email-jerin.jacob@caviumnetworks.com> <1466170194-28393-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.48.17.70] X-ClientProxiedBy: BM1PR01CA0028.INDPRD01.PROD.OUTLOOK.COM (10.163.198.163) To BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) X-MS-Office365-Filtering-Correlation-Id: 5e0fcfac-b3e2-48b2-1566-08d396b3d6c2 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 2:h8VJSV8dhmZC/hvptVk9L2vYS+5vnYlg239EIDnQfAA77pqhFi0cTHIm+Th3Ju98DB1WMlojUbLwDRVAOLNUJNIA9PhhfEt3vmOy5l3HWOpi0UGa1QVQd0nTBeHjqJQ2bmlrDyNnqtg3VFr0KCG/oATcKpGglKevqxwsqBfl2uSbgeS3y+QhULIug2jvr1Mf; 3:DMkCVs+IdJrlBMSjVQkKzF8QN3X94D+vRH7rsy7vfj49h7qda8KfURZsadHn09PavBGZE/27dItZgPrs3SY3G5ch0Mt8LzCjCClaAYBg1cVJO8zsaYarY/rN1IBCLABM X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 25:03xDkoHXezSlOk6HCbIf9xne+W86oR8uQMUujT/Iu1jLivHSK+9Mlx4I1arJcDXkKXo20FH4TDaHHXtzwwwEt/YKAsfepk++Fc5jCgQD+oAJEzVRX0nipn7Wvl5KIIsmxb2+rTVV7RDdxq3ct+ZqW2bxzr8+AeTQ7nK62B8k2t5GhxGyZN2RX2nQe9WRbqXJfcNs6tnot4cgEQeA/35iUsxEcZJ0jFtcWZomNP6WdHmKOeHWBqKVEMdPI/IHFcUxtCJRiJjiKCVGzPodxBi/WdkwlSbMdC+tZcIN8TG9zazXGxeBvk+PhQ6Ti/TdLU+NXRmyMb+QUtitm8eAT9UQXGj+nHSS3ZZ9BLl+Iu9512STWeXZqYlQfaQUIMKTpGQWPIWJ2Qg9HDBc3hDFtlEojAyUpl3CKzksNezjr0Nohxl9NrdiluGNz/u926z8iQEuri6H/lwayT/U9sgHFvJFis/f9JYh6a1w+rY+TACcqPI+qRwkPgNbI6ihe2HFE7L2TnsFlnUBl56viegiq+Y6jMKcVSBHSxBBluR7ZxHcKCCkoQkLlc8oMkiupQBEWkT087sq7DmS0uhg2yfZWrDHaXTiDPKQXav+BAph8CZM4uJ250uOR3IFlLyiYYTZmgP3UfNOJxCcgI2aRHWZVw1Cj8ktPMP35Yd9mRxA03bAkx8qf0p/PCpzXylR9YR3YtM0MwLn4kCm4bQ9bY9ks4dr2Fshg501N5dW/Xf3i5vhaLgRP83SvDjQ+oFCAM/+ahZl X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 20:LkagJUT269D43Q4dOCRij/Ad9S4nM48mUkx/XbvDOlT3Q4NcYgZialhgjS88Hbrles1eP8vbnrqHRNx5qhMcvvkMhBEYX/sO0R4lMmsKtcjhovD5Cj9sLwMPCI5zsoGdVemU34f9gqUbIsBbyeKQaA2tib7yySiiyJq2mjBs2Cf6tLU8v5NQmoqmSriHJ8h6Fw0gV/kv2G6aJYnSQaFUiFQNLFbBUM81HLS+DJdcYBcHQIcJu/pAun6cmO3osaN398meNkD0qi+cNQkB8JtqbeZMTx3BLqwLdm4RsmQr7Um4Y6QgEQBcCzkUaSUjd7hwv8HZysV+2GzNHvRRX5HLlHU+tbVW3SuO5azzlxO52MUiMzJGjvk7kS0VpATLzQMpDSpfseJGz8nEgp7J0hS/EZie24UKDIb5JKngUhp2ejNEo0N3+Db142+8G6GOlWdRjm/r9z41MQEUtm6dcJIUMIKUMik5sLraPWME6i+ugouLJCD/Q5PuZ0WNxMVOLftKufWXvRCk7HfnlRKm/6E/R0/JH2Fv7koWKso+kgA+6A1ps30RNGQ+hndSioO+mspTxMZs6iz0xUFYHM6sIcDVd1CbSgnmRdNgxZLump3X3kw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:BN3PR0701MB1718; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 4:1FTxnfnf83MtI8S2NEU6CZIKJfpcuabWRqqulZYfpbB5HKAAfMRstO81/TdPkZBrHblWbDKZhBtXJ9gBvk/ZEPpSDVO41DViBsl3xHjZjPc195mrX4TBT7R6/BaSBgOrGQKPhUQCC8+kLLtTQ7uO5MEGfisJCm3oMnkmxb96Zy5ksZaBdCwmjD2+sH/ZPvjRyn65+z09nw7dVJkzrhFhrmdSLHqXsSXNQ24/p5FiCSyJ7ptn/qhAUeQuHEgo/4O+FiV++3rKKs/1fA69vXSReQ99P0vCk/1FMq5ARikvmgXlxzpGAM2V0yj/MFQGDmIlPb9nxjVWdiiPww5ueBP1maNp9HtqV0wd23Hubl+Ws5FB1PUM/6yeEkZcIR2IQKa5 X-Forefront-PRVS: 09760A0505 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(199003)(189002)(48376002)(19580395003)(68736007)(2351001)(47776003)(229853001)(97736004)(19580405001)(586003)(50986999)(110136002)(36756003)(3846002)(66066001)(92566002)(105586002)(189998001)(76176999)(33646002)(42186005)(81156014)(575784001)(5004730100002)(101416001)(50466002)(2950100001)(5003940100001)(4326007)(5008740100001)(50226002)(2906002)(6116002)(77096005)(81166006)(8676002)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1718; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; CAT:NONE; LANG:en; CAT:NONE; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1718; 23:NEVINpG9pD+PINAIbnlNKrsRkG0pQPETX4tvHlg?= =?us-ascii?Q?jdS5BtjUA+p/0nuC/V2qMQwG64l5AjIqB4uuA5OJSHIySasi+WbEPWuLJYb+?= =?us-ascii?Q?51iSXIXWgBYV16z4yYuNfL77POz88M6yB1xLN+IOVYlpIq0lVcfbCpeQ8Ant?= =?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TsD5MI1wM8c0blHVMWACil7tARfABf?= =?us-ascii?Q?m5/crzxjM5+krIm9DZDUOLl37KbEnrAF2/h8yo6HA1qur0uQE8Q=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 6:wdpqkOwIuv545NTVge3/vYN0AxdmM2TIW7Be9kUQDGchiB9T08gF+88rgtUFPn7NnZx8RKajeVBqDoeUZZEEwf4Zv2FC69qFVWGX6Yzmv+yLUgos+7suMBgB9jMzVIZ9abpVA0+EyEFPSRjCcqTwRVtbtr86RCTmij4pRc4rdzu+fBM+lSAYMV5UMShcbvFN68glAeWzUWyLdcZ0NM4K4KWPa1MFccwSeloABfwanZwiuokZQ2DTDdy78atsjMxd7KHlIACIVY1i1wTqEZyrOwztccAdFr0KrjLUXok8ZdY=; 5:uGgBVKa98vT/9tAo6/ju5QTxEcN/pZGDpnrlvbgPKpxkZImfv5cQSbrQ++UyAZx9YjG0v7EU6p4pFvQtPvlLj1lOR35uzDJkaYpaYYLwr4ZNThyOK1k5vCdxH0y8JTPR55FdTWJLxvXxxBkv6Azwkg==; 24:vtVFI7n+lafqNVtJ/60D0+6bOHsZ8qw3po15TLfB5CESm66sMkqglKRXG6H+84n+L9RD94A1L0H9dOGMg2bPiaX8wqqVR9EKdQCI/FGXn4s=; 7:+6nKIAN46LRMURl1JzqXkACX+GdnNTwNz/6kTdUoJw8gO9h/SClvkh3ulvj8eh7Z2XUq7Zwg2ETQs7ISf7Zc97WQzjkcJcG4HkuDqHv37A0rRbewHY59+Y1MTNY5mwpEtXXzBD8WXTsjC+m/yz7birqJugo0oCNxzwqHTRxmkqzSosKgA22REiyPRPeQv5dBP+pJw/aVD/u93p0g8+ugFA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2016 13:32:29.6820 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1718 Subject: [dpdk-dev] [PATCH v6 21/27] net/thunderx: add supported packet type get X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 13:32:35 -0000 Signed-off-by: Jerin Jacob Signed-off-by: Maciej Czekaj Signed-off-by: Kamil Rytarowski Signed-off-by: Zyta Szpak Signed-off-by: Slawomir Rosek Signed-off-by: Radoslaw Biernacki --- drivers/net/thunderx/nicvf_ethdev.c | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index c727ce0..46f0d7b 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -260,6 +260,45 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->oerrors = port_stats.tx_drops; } +static const uint32_t * +nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev) +{ + size_t copied; + static uint32_t ptypes[32]; + struct nicvf *nic = nicvf_pmd_priv(dev); + static const uint32_t ptypes_pass1[] = { + 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_FRAG, + }; + static const uint32_t ptypes_pass2[] = { + RTE_PTYPE_TUNNEL_GRE, + RTE_PTYPE_TUNNEL_GENEVE, + RTE_PTYPE_TUNNEL_VXLAN, + RTE_PTYPE_TUNNEL_NVGRE, + }; + static const uint32_t ptypes_end = RTE_PTYPE_UNKNOWN; + + copied = sizeof(ptypes_pass1); + memcpy(ptypes, ptypes_pass1, copied); + if (nicvf_hw_version(nic) == NICVF_PASS2) { + memcpy((char *)ptypes + copied, ptypes_pass2, + sizeof(ptypes_pass2)); + copied += sizeof(ptypes_pass2); + } + + memcpy((char *)ptypes + copied, &ptypes_end, sizeof(ptypes_end)); + if (dev->rx_pkt_burst == nicvf_recv_pkts || + dev->rx_pkt_burst == nicvf_recv_pkts_multiseg) + return ptypes; + + return NULL; +} + static void nicvf_dev_stats_reset(struct rte_eth_dev *dev) { @@ -888,6 +927,7 @@ static const struct eth_dev_ops nicvf_eth_dev_ops = { .stats_reset = nicvf_dev_stats_reset, .promiscuous_enable = nicvf_dev_promisc_enable, .dev_infos_get = nicvf_dev_info_get, + .dev_supported_ptypes_get = nicvf_dev_supported_ptypes_get, .mtu_set = nicvf_dev_set_mtu, .reta_update = nicvf_dev_reta_update, .reta_query = nicvf_dev_reta_query, -- 2.5.5