From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0064.outbound.protection.outlook.com [157.56.111.64]) by dpdk.org (Postfix) with ESMTP id BF73A9AD1 for ; Tue, 7 Jun 2016 18:42:18 +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=57P/667ltk52/IMZLPNlZnr74mbeJun0R5NIPh1YqXg=; b=FHxG28ac9pv8qh5CLslJybaO26kvPI6qXICkX9C1SiTdYThlo00mKJ9+iXTY+5Q0wbiFa7CtL0bG37QJl3loMmDr07XQtJmMkv4mXynfATvQN9rSdAY23ptlbKQ7o/gjnNPprI4et07vzx8vJHq40vSqet/edvq2hlJzAPPfQ/A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.caveonetworks.com (111.93.218.67) by BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) with Microsoft SMTP Server (TLS) id 15.1.511.8; Tue, 7 Jun 2016 16:42:13 +0000 From: Jerin Jacob To: CC: , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Tue, 7 Jun 2016 22:10:26 +0530 Message-ID: <1465317632-11471-15-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465317632-11471-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1464540424-12631-1-git-send-email-jerin.jacob@caviumnetworks.com> <1465317632-11471-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MAXPR01CA0054.INDPRD01.PROD.OUTLOOK.COM (10.164.146.154) To BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) X-MS-Office365-Filtering-Correlation-Id: 0aa6bcc1-f0b8-48ac-4df2-08d38ef2af67 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 2:cznwZjkjh21loqmTRWdQdybQnBppKmzwjcLM81ZfZNCG5BViYiBHOcyO4OTXCiA9IMstcWQCdfaqaquMqYSdUcHS2ZisPXn06/G9sbz2fcVmr9wytlJz6vvUFoscQDi4TvHTykYkbaUmdD/MUvh/QyZSiJgd/WbpwrtjWYY/xHIDA4DS5n/PN7e4gPzcTPzR; 3:s0PpqEDnWScXPoWILik0eht1wwxYhVPdZHVa6yPYapPiTXPZ/aHS+94+5pfqgP2aaswY2hAnUvMP53LHjyNAkQBedArr+LF9QBPOSVqMjy0k0DlhZdPb4q5t491Ul5UB; 25:0me/BAnIxxa5I67M8SYtNXN5/eGcuUeHclDMKHNhfgkhPY3GJomIgPZtYz8Jr3Q9+Y4bV5dpO6JxoJUfGsLX2UNPwNMGJgw2zaXzT7Q2ea+acW+ejE16NCPv5YNrU8nsHB6vd4T7D5aaW89Sb/yUoFvtUs6zbPG8TxWxGWzclw8NQDUQQKLQJ182nLV5MOtBosJn4+mrWYNCBD+t9p0NliNQbJ4BrPJKM/yrYcWgpX8GHmf91NE84F04GntUlr9ArYSxAsy2wchuiku/e9/Fz+U5Vg1Taq/4Yb/qkhzmj2xhekVBWKZYThn9hs+uU9uUZscVI5/AJSQmIvGV2W2cloXOMOsdFOE8PLLT1kd5x/ecA6w0+IMiH+mehcaHiDYiC5Aryevy2jGeLn0cRFtgeeBQq7dXohRz5iKNgLSf7Ho= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 20:o9abd++Lsv1bkXHJle+vnXIkvaGcKgoU8rFfOSL0jikA3b1Rq4dODdpi6PM5b0luauyZ65vqnrQll6euzL8bii2DzFmCrIXgD2vV07bs1puK6nVN6YwciRd6jh3OOYRCoK/UNj2tfiBG6dmd8GHOx64KAK1O5UDk5uYPSoRGoPZKuDpdeInvoGjB2dQ4c/QM5DCJ1QiOK+rBjvuFO3LL2IUiH1Eq6wqzwfFosgfHRAf8IquaBaLdBJU21NyIrowGXg9+YcaMWCXg9SC5XeLefNugZO1XJYOwP9JIV3d5yVc7Uavtjcba+fuvr0lnUZdR4R97hzL7EFs/QWqnrV5bRKTC/5EkSK0Fktz6tiWbq2SRcGOmw7JvznYD60iaBld6l2//6A7Tqo6Pq4tIrFlRgQDyaqw7WXFkYV149d41/cOwBnsBD9Qc3V0vQ5PCsXC8Km7M4Zvr6AoPSIc61mmw2LKzACCDFWnDfSkcHToOR4dDrkoV8kkS6Y+57ReGgEw0ec4t5nzcTEOiAlGdgIOLVVsu8N0A+WG+3ulvOC+rT80QX2F7qnUpPo8cfiq2mD8Tk9BNjB/F5M8GjLCJHKU8YmEI6RAi+HNR5hBtpQW77bQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:SySH1bHoiboxn298nsZeVZR3+b67o+4bP/i2hVtwHnOcstIYTSFtfl+WsQbw+kcq6GZgi9LTt4/+Ye9dLsytVHnWss2VOSOdM0s4tP8JuDXp39ZRjbJNtpTksCgI8Lau+GG3fd3ku08wnjI/bfA5xP53FcQTJf5bIq45T4pj6kkhrFU1NBH7F91R1kuX61H2CEg/bVKyD6c3zw/m9JoDJv0KaiYtBUdx9a+OWXyiFCsOXhYfZtDy5SqVpKMUsB7IE6a+onmeyhXWr7FUdlkZHDW6ToydU2IZZ+oRWdJOvxbbtHi6aChqhvL67nt9d26QkDqoPEjwPweJysbdRKMa6pAn7HiXyxAv6wCcFz+ApkozfMDsb75bLwWiaEErMhHd X-Forefront-PRVS: 09669DB681 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(199003)(189002)(81166006)(8676002)(81156014)(47776003)(66066001)(36756003)(92566002)(2950100001)(586003)(2351001)(48376002)(76506005)(42186005)(50466002)(4326007)(77096005)(3846002)(6116002)(5003940100001)(53416004)(5004730100002)(105586002)(97736004)(2906002)(5008740100001)(106356001)(189998001)(19580395003)(69596002)(101416001)(110136002)(19580405001)(68736007)(33646002)(76176999)(50986999)(229853001)(50226002)(5009440100003)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1719; H:localhost.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1719; 23:tQgVuilbgVVivCvVu6CpONBbnmufEBvETu8mlUR?= =?us-ascii?Q?2IbDnq2JHeUTYdYKlmu/fPlx0blbjVtiYdX6e8vZEeyoEHU2DpbL50ZJlxZ5?= =?us-ascii?Q?jlsZxg859ukj11Jr+4Ig5olLiwR/xRzaWsxLzTS0kgpgkLM4hzXUl9v5Ev+6?= =?us-ascii?Q?B6iYFqVph9XOY3BwsqAlo0dvJwmX9/sJ6ylX5TDSETfYcNUUYLlCMiA8QQrn?= =?us-ascii?Q?VLPFFkT48cag0oIw3frU9npcNh+7+zuOYnLCOQBbqbNe4JG8QAo29wPizfiS?= =?us-ascii?Q?Fbe6PoOhIR+rVxQqnEx7CROD3h7vtWOQwd0setWWfA9+IQ/W1kb8J059mLpU?= =?us-ascii?Q?EIhLNeIalY3bFNBKOktiZ/aJlFK/i8lRi6vIISrCszi6wV83nfxcHBfyc3RS?= =?us-ascii?Q?+9wxBQnTiDux7lhb8x3DixOMuu05Rsuvqi34wsLf7uADKSBDBV8A5tTD7YRO?= =?us-ascii?Q?bLaN2hrQYG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:R7ENuEMFKgggersfujT7VucWiMpVmodco0d/5lL6v6EiDB0nI5WRtfG3O2+walAXmUQ9LpoYUV4gHW6C5RV0A2qCHn0KKBjLJJJQUS71onQ=; 7:soZ7QxbsCOPQSJsA2mRLj0hJFXI8Su9+UcgleCxZvQpzg+GDRZsE1uvNfBSQy/QI+u4ojXpi02ZgSkskSe27TaQuRjE6Q6ZkEMsjSijq0u/djW9VEfSNIF7w43mAYsSZ7XrD8WS2izWNUv1KCeOMB4wPlc1wpQ2dmmbbikbNIpFVRrNf4eARrhRgTvFKzY4PyAStCYIScrSyEvUTgRtxNQGkIEeOIdk3p83RmToAF98= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2016 16:42:13.6773 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH v3 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: Tue, 07 Jun 2016 16:42:19 -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 b273149..5da07da 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -292,6 +292,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) { @@ -920,6 +959,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, @@ -927,6 +967,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 80c0018..8031685 100644 --- a/drivers/net/thunderx/nicvf_rxtx.c +++ b/drivers/net/thunderx/nicvf_rxtx.c @@ -571,3 +571,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 1e355b6..44cef06 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