From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0069.outbound.protection.outlook.com [207.46.100.69]) by dpdk.org (Postfix) with ESMTP id 5E3045A30 for ; Sat, 7 May 2016 17:18:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7wt79LFG4oFOikt379zWbr3uBGtFGIWffhF8sg9kb2w=; b=R0sHhvSn8U4hTndKzrHib2hfQbmvyknuGZzALQlZcpyqyHqyY0Tna7gUZ3Z2P1MwySK4g+zYWCrLke3u1H3F7kvQJxRV365vcKwpthMDMK7r9Yh+Y/CsixvdJxqPcXudGfG0vAW0unF0I9rB1AZQ/P0Syj3FawsBBdzudrKeRFM= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain.localdomain (122.167.10.92) by BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) with Microsoft SMTP Server (TLS) id 15.1.492.11; Sat, 7 May 2016 15:18:47 +0000 From: Jerin Jacob To: CC: , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Sat, 7 May 2016 20:46:32 +0530 Message-ID: <1462634198-2289-15-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1462634198-2289-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1462634198-2289-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.10.92] X-ClientProxiedBy: PN1PR01CA0050.INDPRD01.PROD.OUTLOOK.COM (10.164.136.150) To BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) X-MS-Office365-Filtering-Correlation-Id: b644bf42-b905-47ec-3e4a-08d3768ae55e X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 2:T+Fp2MWTTvUkdfRdTVlsyk5cwg+p7obpLGzCjsjId/Nd+t9e5MwvYP5m7+uu0vhB9/Nh9yAvLIXBsUK9b56eqq4aloBhYm2qAKeAh5gMXH+82kgb+nR7kTvRZsVjrk2Ht08IYWdBF8s+hp9n3TGab5wh+jSAM79haZJZFLPL4XHJrEpT9vZzXMNB5IfMjRYS; 3:j7IuG1+xdKjn/OmZPlGOs6BIVIy66f2bOh5LkhHX27w/LTFtWktam5b7RNcjLt1CCICzdJdYFbuvawiRoiNh65Us07Et2UuxAgH/s5t5xDpM7m1CX7SLSr0bnIwX52O+ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 25:rBv1FlmCwvwNEofq4PXW4tE9V720Ouc4nfQHJ3PWfzBRnQR5xkjZpLz4Bt1x0GtFo11D28iVvULf0TTObvDrm2fgaBJBobm6qD5DXjKS+aodpnh4APp7FswtHU88b1dwgMHWGGhrZko0l6Atfv0mN71BXFvc92UpR1DQLhMLQ1eujjEq/iDqgOp3da6/k1NDkT2kd24oRmMnLS7H5VlvYZ4BqmKOvLr0zw0YD05+6KRgOeNobwBrMpsp7e/afD7cfzoPtQrIqanUKXepsVJUWGCVPtKZ3o71CHkt94Dr57ih4C4hDzUgw7ioZ1WQece9h7TSixcjbzZM4hrArbVvyhSPHemr6AJ81/oOrAbrh1TQmSd00diwkkNmK8/D1OpMdsfdM5yrSdEX3bvpJ+y9bDwhvfFPVEhMNeKkX+6+2bw3T89Xag7Bwb3rQBvmuxEII6ha7wGyg9Jpxww82GG/cahT6awFmOf7ce2iqBsKlBXapb3sMC06OnV6G1x4I+7qPJKRpS2JA+S/YC5NwkLcSg1LdS7HI+08X3UyUOZULIhdHfxXieBO9H9q8b/Z/Ax7btvr2gsqysIWK5DPOVyk/aEB1DFqavqv4ppc3pNeSIQ4a3rksDIP9GKVWxlncbypGTSSWxul4rwHK4gBvloMapGfpxUm+WoZTRTGDgYHpUl8MZGHUqSjztiKGvWuibeihJe0qzSNNyz0My9eXNPoOZT/MKBP5lefGzoE3RjJRbg= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 20:7hSgdJAZhVvDSjjJAWdL01JCPhcGesMBh2tAglb5oNbG0EZR4qFxftSW1cNEmytThsoYXy350VV5maIeEhXDdAp3RwykGN0evxEMrt9Gh6rV3F4mEqwKjtHhaJ2YAuNLtyM4lJkIAe3EWg+xPTm5m4SM/h+Jc6bJCHyRKBWvgxi/cI+MM79GREliUkUegIA1giGaJexKy6ClnSQp4fgq7o4pvys+5x60JT3Ee6GdWDwvJ+mP0Dw50gu9N5qPRZhgsiHf0sGAXIBMhC1bq3T9r/bukVt4vZSQtSQWtriNJjhFV+teowiv495nXkbWDpdugf3SMBMBuKJ+YAIqEA/sIw9FnshMDTEpogup6IhVQbTedSpMh0wQhqF6pmYDzWwDK1Q/tI8jSjEfCyLl6rNN2ri9NSR+hBLjVIRy2AVoIynYvMYptu+QnftJmP518epQ13JRwEpGBGGhuUvKH7XXA7MbwSPcZOyRXQ/toX7peLQIN1VTjfUqPcnRlcOgY4b5YtiHSwfpT3kQ5m35TuYAMh1PLSZ8SqkCuS9sgJn+u28IdnUmrDXcBHUWOWgrLZatyc4v1dLNDigzDAKSf8T0NkK3ofbQpYuU9PB2WNTZAZQ= 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:CFmelo5ZN4i98o3qUo13qiadldk/PXosWaLKrqj4dpinfX0zizldAehL5bi6InNtn8K3Yy3eyouNpA5G4XUDm6fXcK5XSjG3auJpkA2mEfN0bK8bGwD0iZA/OlcrVClc4vHS89CTSBOUKVDKaVajFthapgGc1MeVlQrJyujjdhQ+kqdxcGrnVMG8pTT6YUff7rSX4h3U5cQNFggNk34ts4k3B+PNlve0baNL6XdJtZtTLV6H1Z45TNNlMW1TaydsvGSnVl7Pj/tAcY930KUFwoQebPL2Il0+pNqnKK7paInD1GXDb65d6rD20ySnBXdXJqb5gIoe1CwcKLOPMzMrLxrnPXqR5hR8/bJ6gYq4G5+/BZr5frsI+YkF69iDDPLT X-Forefront-PRVS: 09352FD734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(50226002)(77096005)(2950100001)(48376002)(81166005)(50466002)(66066001)(47776003)(92566002)(5003940100001)(4326007)(2906002)(110136002)(50986999)(2351001)(33646002)(586003)(3846002)(6116002)(229853001)(5004730100002)(76176999)(19580395003)(19580405001)(189998001)(5008740100001)(42186005)(36756003)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1718; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 23:yjbmZ28D7n95eDoUW7RkAyRIKLTRhARIrG0P8Y8HQX+8yhINlLZqRUrl6HxhyGY0KohnaINeKueIt2VGSYKj9bB9l6jKlQszXNyWybDmd43vRuRCY5Zv4WVYbJM9xHv6yuahLgtBRymtZ1gAuP59RQyYS4ffMyDCS4qBAaUe9GdT+VTwWEd/6XvwpFfJ43zqTf13JTO5iQS7ZolDiuGBk5MeEmXIM1XaDhPEtheGX3M3kI8Ax2FZ6jW5Nof9XxN7uHTTB9K2W3wDg+qXRcJifnpHO5utoSY+wT5O7Akjtep7ia4OuWxBpTS3S1sis6Tkb14HbRitBE3dblgmQ9FKh4GLK8kAt488itUCZTBZzkFi/QVIgxD419J9h9FeY+TgI+sAP5jOXyTCDz8c+gmYWXfUjTgjsTG15vsrwevvw4j46ax/+GvSkscdQIRrqATWC/B2kEup0d3RoEHXStEKV9W++VVhEKYAeU/aXDmTJTMYr+zSTq+dLV4WRTSUHepcmv+7hkSO/e0VW95AWWRcsGXg1NWy5MH9q2gEhP95BkwlySGVnfcTNuWfO1JS7+hzJTjB/a1HZZIfixy6iQEFbv5FA/hGLO3Q1KkokXpwDBVqcE9JlwSRvxvOCyV11Pr3gmWd4L0UBskAZkTe036eI5+jfaE1yDifsgngs1ozYLph4c+1K+M2qrBdCbTdXUVSBt3eTvvnQU0gA2AhYHu+swiT4L9XSEceJQbTGlWPRLO2QEMIFq61/mtHS7FZjRx9Gr70/JpPBxqNFhTDKwpVzYcGtxiszj1mC2Qd9X4xGn4n4Ucqkw5wBvGhVQMXCKql0G20gk4Ow/typCk+0+dET0BS4S3oo6z0QTnNrfWAbt7sNns4dRkIxY3qOvEc3jnT X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 5:fYHC2hWu5saXjGE/sGpVK3gP31By6wcbIzNEQ9jNhhbukfnJgJuoEzQTeq3rmi36uAGSEELfInAthjrz0WdIv8MZ1f41WwbMRLzY/QTYDypIkbPAJEVStQPapLfuld+2W6I+MMWIt9xWz3RWosJoqA==; 24:vvfQiM0B/jz6mxYRJh5yEYJ25VkLM/GynbN70ZwU47DxlQuQQHF8nkl4F6TZ5DQlBktdIxfzM9viPLmebcaRKGTzv5Cdx5J1MvvIg36MsFs=; 7:LJMIaZ9UuntgVoho9OIrlNyid8yNQ0LsPqC5fLD5d0ahNFbZmT2GbnBjsBtCV3q7IwmBi6J42wRsWU7IngI0wZycDznQeQhbp0or841t/DEiYiD+xKirF7GM3t9yhpRZGbcU91y3vBuMCHUrQGSc/hs8Ypa70rRCzqH0ZKVl/X7mLBNeD621FgW0ctL5nPNS SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2016 15:18:47.1031 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1718 Subject: [dpdk-dev] [PATCH 14/20] thunderx/nicvf: 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: Sat, 07 May 2016 15:18:55 -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 | 43 ++++++++++++++++++++++++++++++++++++- drivers/net/thunderx/nicvf_rxtx.c | 9 ++++++++ drivers/net/thunderx/nicvf_rxtx.h | 2 ++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 23325d6..0c72201 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -66,7 +66,7 @@ #include "base/nicvf_plat.h" #include "nicvf_ethdev.h" - +#include "nicvf_rxtx.h" #include "nicvf_logs.h" static int nicvf_dev_configure(struct rte_eth_dev *dev); @@ -314,6 +314,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) { @@ -939,6 +978,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, @@ -946,6 +986,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 8d8442f..27e5e1c 100644 --- a/drivers/net/thunderx/nicvf_rxtx.c +++ b/drivers/net/thunderx/nicvf_rxtx.c @@ -595,3 +595,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 = (struct nicvf_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 0f2dc70..10f4bf9 100644 --- a/drivers/net/thunderx/nicvf_rxtx.h +++ b/drivers/net/thunderx/nicvf_rxtx.h @@ -52,6 +52,8 @@ nicvf_frag_num(uint16_t i) #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.1.0