From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0062.outbound.protection.outlook.com [207.46.100.62]) by dpdk.org (Postfix) with ESMTP id 782005A41 for ; Mon, 13 Jun 2016 15:57:42 +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=L05nR9KKPJuzzjLDqRZiDgYZgAfs0tlUP4G6b6sM+98=; b=NK9e17fDenM1Rs6H4/HzAyXdJjbg7/GGNm3qfxNokU4a4vKY7P3oiiGRCwkNliWfh+NIKvk85G0SZsR4fNjjeg8lsNs944QW5A9wrYvY78g7QMrb2/Myf21pac0UXnhmFqz3a8LBQLwDYD8Lnc14Vn6A497u4eYJWe36sCb7OL8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (171.48.21.3) by BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) with Microsoft SMTP Server (TLS) id 15.1.517.8; Mon, 13 Jun 2016 13:57:37 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Mon, 13 Jun 2016 19:25:38 +0530 Message-ID: <1465826143-22159-15-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465826143-22159-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1465317632-11471-2-git-send-email-jerin.jacob@caviumnetworks.com> <1465826143-22159-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.48.21.3] X-ClientProxiedBy: BM1PR01CA0031.INDPRD01.PROD.OUTLOOK.COM (10.163.198.166) To BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) X-MS-Office365-Filtering-Correlation-Id: d77f6525-9dd0-4c9b-566a-08d39392af95 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 2:7VscRjxoXnx4dCeVDMKOPf52ytI7vZCUvZTgtJNLyYd6ROfUuhjCn5o8iMFWa+Zbj4OU16TFnQcSHT2Vj1DufRcqUiReD/X0r2KnjB/vB3llgQ9fqcuK9nKXxh9iCyCL2cifLpCx8sGb+HL4AgCD+z6yO6njsALao8awUHEUKOSRUo8iO83HFVHmtXPkcCLG; 3:hS4L3NgKdFDxVq3ElcxroPStlvcHV0ql2ebFOno7uWln2eXnPf49lHs63ZWAjtQUC/Jg+ViplenH9oP9I606iNnikd6AaelODU91dW3nEXrRt5a0GwowWy94KfZBWK/k X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 25:wGUyMmOhYGLhVD0507/buIS8JHUvjPZQ663VulSNxVaf/A5yukgNAK5mo6O5hBmYWV8aKzucTpLKM1JOKOtoLFi30l4V+LaLx3l73deZfmwNWfUxlzs4Z9zngnux4hemYBn4GNNvL+LxjHT1gCbyhZp66lTyJy95k0X7MWTqFDcecGWzTw1QDiJ5MVYE9S6SZnNWoUV6/Mqh9k9Akl8QaeZsmlq/EOUMIRCm4WKxeDxuRyoDV5DDEXvHc5G1WqGEci4ysU3a+OdZLLIzE9clMlQzat1k7eQYb9/+wYuUr75ntsPxIYzxaiABnTOycjLt+R9uQ+H5JyslRnUdP/xjBN/iFxmgfs2JMB1b3Tj8NJljMv/oh6tcTEA+YiM46O5QSBsGYMWK4rm75HqI4ZoYFdvqKSUAHYKVl+gEGfrR+DKnw2wGaDQYYv1A/iVh/BaznlB2KY6yHFVW5vq16R2SE2rvUdKiYM2DCq5erniJdEXDNx92QIcg6zXezVq2BSS31BoSZsD6rga+EpcWiFTz6S6Fug6ZAj3mKEZN3ICHIT+Ny+3JA+ZHMXLlLXAXreheiwvm+LqXoQjp4qvfjo9MzuXesmioLz0w/IOqCWekVFSvmbYbIFXrvjirZ+b8zsJIhGjLZk3MarA+enb3o4CdzZhtGy1FivTAsYOp2fmEkh/mHbqgfWi82H1hO4AO1WQKeCdqXs0y9lxMiE/oBPVrZAyBNm4sUPfsDvMJBDCpEPozPQ4jj2OnKhjIVKItVFx/ X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 20:dSwvlVTlJkQo+21fbB+FqRYRbWGJUfdw8Bx62KsgYj2/YnMnnNAdUPqo5Vf/jem/ZkSDtSqfiQK4b+Ku3bdNJwwvbGdhyaOjLB36YuFaLAZMa+ST7uzLfZidd/Vbg6MNfQWOWXso82yHCM+m28nN1/X+Xrb26Y45CdOEddHIfIqqDjnmeH1dyaQ6woNdqM880tmK1A3dV2o7IvnDFFpFEZJoQ2Z5Id+4toSnV+cLo/xgtfw9G3iiEKbS4mRlm1VR2zFVLFnnKfLLT4/TACxkvSLUOA2s/R1leGh1HNUNqwfXgU/uO93vi5CXYEv3r31fFcrnsNYud/rqnkgtdvc76Ml90LUUVz618ndcPJSAsPGoHzeOgzC6kIQfg+lU7l87AvKCQCgbZHPE9qe5LGy18bJRKfMmOec1+UAdx4pX/PqZEmHaXy8hZdJ93IQ932S0o0woWLxAe5LtDK79SNkPg37OM3A5dgh6gK9eNwvyth50ZlV+/Co3WwH2FL6XIoML/4jZlblTENBMDY5SPW1OfN6ukLe8ba0F6j3qShr948x8/WNY/bvCRA8iPd/14Ax2volApXjjzyWoAiBMiiXvauEFtQx16nWn5HNDDYwr6tU= 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:BN3PR0701MB1717; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 4:MJVWNGj89xXEZlpYoAOyhlhvRijp0gOEGN+1lJ39zHePnR5W6t7rnfPZ4U8WI508UWrqBSaOjY7Njy/UGpHxTF6JUBpFSEiZ2vJKlDbVsXii5p9Lt6ImPYTmV4c4fV/pAE1IWyjAO+J+CFDFs8kz13rqN7OFeOK8N+9pMsgJWN8laVTibwxN/Bf6i+0+NjEP6LlFBacCic2sTgRhnFwSW4Ffc2epdt1Zp+6kvtxNwD1xeRhVw4eRzeSLg2XGkRp0CowsFBQkjzHfCFhfHxPL4V2P89nRbxADc8hnIOEXeN76jEIIqxGY2Jg7Ia7WBg5hz7MvM5MamKtq/B4Db1M11/Zz9w3m86mD3S+JSlXqWM0F2mTAQ4Y8QnxdJFhsvBVL X-Forefront-PRVS: 0972DEC1D9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(50466002)(48376002)(101416001)(42186005)(50986999)(92566002)(76176999)(105586002)(106356001)(33646002)(2351001)(5004730100002)(47776003)(66066001)(36756003)(586003)(3846002)(6116002)(19580405001)(19580395003)(77096005)(8676002)(2906002)(81156014)(81166006)(4326007)(189998001)(97736004)(2950100001)(110136002)(5008740100001)(229853001)(5003940100001)(50226002)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1717; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; BN3PR0701MB1717; 23:xMM2gGMqLgXAp9HO7RAUKESuyteVIEQK1UQPFla?= =?us-ascii?Q?2+pne1YNgK5AemChOVfmgeYQhhBvKaorFZPPcLNkGqdWF+f9B06ck7aH8Ml9?= =?us-ascii?Q?FSobklxOlV0eVuzrJmoDD4rQZeC6OYG206PS/p/Lw1DAUXZcS0YyW21swf6t?= =?us-ascii?Q?8XwRFUE7GHH839H1u5eTCQ4M8y3KvVPvoGqeyei6qlLrPxfwz1in0WdigXve?= =?us-ascii?Q?lPCQ4+aaiRXpxbAoCGzP3GkmgFJDJZe92+mSfxUBIApG/zxytrH8hxgR3/BF?= =?us-ascii?Q?UhkkecIjs8BcykTRK4dNeG6TSMbmJEVDcjugxLOQ/gBx2TtFXQQimY/WcptR?= =?us-ascii?Q?CnXX5q3naR8eS3aey4LSAWVKAj3TpyY9xFtJLKoBLOsKWGCPBpVQ0kSNDs+e?= =?us-ascii?Q?FSizOwijCKeGHCCVDfQfA2EcmbTouDng8HezWAU3U8Bb1uG8bpguW+6qjV05?= =?us-ascii?Q?1NCtacuQ9eRMTYLMFgW+kl2xe5ghdGb+HAOOviuZsYzEhyNgNmZVhWBoBrin?= =?us-ascii?Q?okNV0DgmazwQn+F0FaDHg25FkkyLBIOKmpx86xF3PMt8AZdohuGdFef7qS3S?= =?us-ascii?Q?+MV27BNxfvL7o9cKZkAYHTm5qnAank92k6VlZ2w6yiu+E4qgavkgB/5b45mT?= =?us-ascii?Q?+IjjsIRiH++5iEKyehtBhi3bi9KY48c5B0k9lOYMflHBNTXU82lkz/HTZ8Ma?= =?us-ascii?Q?lcwLi8YBKUI9vt2EXFGR8mP0QKQazh2JcBZuclR87xtxhz/t9JLoIL84YzMg?= =?us-ascii?Q?62uo53vcm48Dv00QI0E3504VUNTsa/zMtvOnGEdVCO3znvU7/CviAgH788aC?= =?us-ascii?Q?RTt1/pP2jUoIUsMlOWK6+Wirt7UlLgwPNtvMdXpQISA65ojOrG7LD/zotpnl?= =?us-ascii?Q?TzzPJ0crFeywaiO4GchCqzSReoPPxsAPkMR/3179/9kq76cvX/9KNCedMtAW?= =?us-ascii?Q?BqdHsnwV2z2PnAgW3Pz1kFhq2CULYiTfEprwHR+4vP8bK92KGEtWwSUT3kI0?= =?us-ascii?Q?oC5EL5p0s86dSgSqMNSMNuSx4gqDuc4wd/7ucrZZs44HkCkM0O1G9UflsVym?= =?us-ascii?Q?XTd9JiLC6hkNXFOS4zzeHIAKzF2SI?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 6:IwaNtfcVQZ4ueDpY8CjcQbYe1guhf9oBy1q27W+Fxzb+b0yC9Vn4TUlrjX88M2gh4SKUkxYFc2y5r0Lb7t4diGbmZfikzVt/nKwcZHj4jYDCowKuan9NLceT6JctsUhawcqnWV8SfYptffZ0iw6mzeN6XvgCnO1q4YZlrTzSEbbKCcPzOkhiVJabAcIhAhQEvBmQoC33RhP6H8u07MidSBc3+k2m15HN/p8dv73mHCTuRfgKR/VrgDWjslF3sTAObFmzZ16YdY2PeFgDTQRR4GJaXwfH7w/rGLoMD0Mhn0g=; 5:aTxfAIr+EsTxBAqrlrzzP7zcNbfdtfSyF3G0XMZ3d/M4wv5cZoQzZxlftX8njH4kD3CXpMg3kkKOVGeCORz9l6zXkgzSm4b34bbV+N9hSIvhRQwYODdIUkCk9zp3Mmjd+BDpNv9tdVUUSSSbJL3rWA==; 24:eU8Hnl5NKIwXxELGDdoQqRwoBeHK+jl5sIsJ1pxewtrnT9htqWyP9fmWovz+38ihHpqjUCe6m78dCwPB74Db2Zu98eee+GkwaBOUNceuR0o=; 7:G1VbkHf7d8UUTjLMPvhepOSG7RBhvUK9a0KXq/ThdtJ/0J4kFz0BLFMPv9XCMpYgR+lgprgpDVhxOidMR+HxjwLuJVA82qdb9r/vZijaCdKtOReNJA7pl1Ai2Me/1OrQbCd1V0PgH8Gn7Gk10ShSrH16vMK+SFPB2eiv/ubA1R9G3BuqjyTThFTTgdCQTG/DrwjGYVnW4Lv6xKGJl7Gze4P+akISl4wKfehmSCZRznU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2016 13:57:37.1058 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1717 Subject: [dpdk-dev] [PATCH v4 14/19] net/thunderx: add dev_supported_ptypes_get and rx_queue_count support 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: Mon, 13 Jun 2016 13:57:43 -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 | 41 +++++++++++++++++++++++++++++++++++++ drivers/net/thunderx/nicvf_rxtx.c | 9 ++++++++ drivers/net/thunderx/nicvf_rxtx.h | 2 ++ 3 files changed, 52 insertions(+) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 15f5cfc..8b8d9d9 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, @@ -895,6 +935,7 @@ static const struct eth_dev_ops nicvf_eth_dev_ops = { .rss_hash_conf_get = nicvf_dev_rss_hash_conf_get, .rx_queue_setup = nicvf_dev_rx_queue_setup, .rx_queue_release = nicvf_dev_rx_queue_release, + .rx_queue_count = nicvf_dev_rx_queue_count, .tx_queue_setup = nicvf_dev_tx_queue_setup, .tx_queue_release = nicvf_dev_tx_queue_release, .get_reg_length = nicvf_dev_get_reg_length, diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c index fed0859..1c6d6a8 100644 --- a/drivers/net/thunderx/nicvf_rxtx.c +++ b/drivers/net/thunderx/nicvf_rxtx.c @@ -570,3 +570,12 @@ nicvf_recv_pkts_multiseg(void *rx_queue, struct rte_mbuf **rx_pkts, return to_process; } + +uint32_t +nicvf_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t queue_idx) +{ + struct nicvf_rxq *rxq; + + rxq = dev->data->rx_queues[queue_idx]; + return nicvf_addr_read(rxq->cq_status) & NICVF_CQ_CQE_COUNT_MASK; +} diff --git a/drivers/net/thunderx/nicvf_rxtx.h b/drivers/net/thunderx/nicvf_rxtx.h index d2ca2c9..ded87f3 100644 --- a/drivers/net/thunderx/nicvf_rxtx.h +++ b/drivers/net/thunderx/nicvf_rxtx.h @@ -84,6 +84,8 @@ fill_sq_desc_gather(union sq_entry_t *entry, struct rte_mbuf *pkt) } #endif +uint32_t nicvf_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t queue_idx); + uint16_t nicvf_recv_pkts(void *rxq, struct rte_mbuf **rx_pkts, uint16_t pkts); uint16_t nicvf_recv_pkts_multiseg(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); -- 2.5.5