From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0064.outbound.protection.outlook.com [157.56.110.64]) by dpdk.org (Postfix) with ESMTP id 0BE215AB5 for ; Sun, 29 May 2016 18:48:34 +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=hn+rRqGh9VPqcAB0dz50jTojkVYC7doj6z/LI1A9VM0=; b=RHl79Xuln7s3J/HMN4bUi0UsIcPsxcCg+l38OV2RevNLwIA7z1KZM93FMoSP7/y6mNMhqRkXNFna1uCIsJMB0Yj4c0Bw8EjgKpMhrI7gVW266GBzM3K9upQQZ6diaSV0qX4ddsVgYyZy2jXmuDVmmicf3N20LioK6MIFOnZ/7qA= 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.187.184) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (TLS) id 15.1.506.9; Sun, 29 May 2016 16:48:29 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Sun, 29 May 2016 22:16:50 +0530 Message-ID: <1464540424-12631-7-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464540424-12631-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1462634198-2289-1-git-send-email-jerin.jacob@caviumnetworks.com> <1464540424-12631-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.187.184] X-ClientProxiedBy: BM1PR01CA0003.INDPRD01.PROD.OUTLOOK.COM (10.163.198.138) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-Office365-Filtering-Correlation-Id: 187cb8ab-1494-4828-6e9a-08d387e111df X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 2:fn1BBIgMfJBh7+ykcgdHEwhls2UpAAScaCV5fKMt+LexIPtGXAsj7nAbPaOjvtsMbIM2Ueir8NwhIZiz39ksk+PcJ9MJ7zvXrZtgxh57Myck/cEQkbLfkJ2j7UdCUTJw4hCDTrkIfssiY3ZWdF2wRr1L45FWJf8CsqDNCLNasdoRNSrRhCQFyFU2gooyLo9H; 3:6zHbBnprP2FOboRDzpghslkcJH5OWPdoAMLp0DJeDPRcppMJux/CJn4Dl4ZmZPocHKAOPKkk9m3b6KQ7FrebIHmzKu35g3P3R1FE3KFoO0BIWWTqwUVnGHQYJTbUuhVd X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 25:LhaaHFDPr1NaXCcmb3Z9crmIHygeXNtLxQMHRI6IED23j9QMOHRPghjWoUVRvI1JHHLHpKZG5ByOktgiVhwiv1GbGYB76peHOwTUCSqKYhp7SLwxLZcLgLNLvQAhpYuiu20T4DvHx8v3d7k4FuOP1hKpS8RtQrejEbp/WPqY0YiV+CAglvkOEJ5+z3RvOpPx124IApaxeTND3OhfbpiwIw611PRCdf91H3fSW+ONX+wQlmarCLJLSa/JNCLtNsC7MQIgPTQYq6abZtVv7SoXd2H5caWPqh8S3PCW9hv1R0neDUCb0i3DpQZU1fLtledgH5BQ5DqwAvRQU9WwDq1HGVKc5DLEU+Ak/sE7sJnH2+xqNNpBUafO+8PArErvPC3I6+bsDS8AlpOo03boKVhYZo1yktW2nA3kLVALZMeVSMC+4Waksi9wmqtj1lhKFyxvaZllLAjVZ8CpMuOgk7ekNEKo3QucAbOjuxJYzTIewUxQmFx6AONE6i4M8mwSC07z7CjCoAbCXvxwqV8cVJF0oskl5Jvq0ON5TG2bkkM9Nicj+MuiGvtvzzw0Dr7RQhrGFfb4QOKBcPLPjyL6MRfZlUkTn7XQS+KcBXDs5D4c0HjpUqBD+6U5wano29UAfBcyDNpeVuPgeJ2vdC/CojQaRvG2KGnVNPRh4KNlWYVz/sywMc0sldZF82kmYYRQhLFtBhBsB8AdBm+ZJFcokjGsJhk21zXa1yr4064xEUQeUUnKzmjlAkF9GhIErrlykkLZ X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 20:cSwd+WiaLoBUBdmmmGAzehVnsEIEyTcUWsDT/H55v11S382wUX7o/yBaQlmdbBouqL/4rUpdi5c5FmejrHORi1nvYjwuQxvhKX76OtEHwQDbTw2lkijQdnGQxfiPLwP36JJpvkO261AdIbOtrRdrAkWsyj6OgbI/lTQ1nYBt9qvkVQK9kFI+pFTSOvQFnHoPE1/5DbLqMWHW3pg8LJnXK91Ysq7DvYLin9/FHze/pzpmqrDAiidvCiRA4tSNzNXvHUytMW4tDRZY17Y6WYP0g95S+e7sn18KkZM1ZtIhGstSsGDvxAFhdXlWff+42eLBEslvb6JdYotIazaV2wlIcFNPk40lAIwoJLQeY1KjawSurOdYz+S/193Z0vhEtlltW8nRGqpL1NYrlefr0VBgakspne5mDRSpaMPaBW9SUYqJcxHxpZ2c/BQLRPNliIesAuGQrwo4rkjVFVGXbLs5gKvG87v7/wtaE5OvuxW30yY21Fsn2J4mHSuqf9KavttqYmIkI7AA2CAr2sJcnBrmx7SqB+L1zD+lVWqSq/3K8hIHOWU+4fDvzb/qvTOD8EDp+yetkN4AWBHJcWNWmbAIonUAvTjwSz+15dVaMZJzR0w= 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)(10201501046)(3002001); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 4:HdYG3MTHXBQxOIPYIaSJ2xP/kYn0qRlgugHwdz2yyaK8rwoEoO44UR7MuXpHjfrwX+vGZNvDL19hkDVQxyyJlba1o7o3tfwQZnyoYp+EhuoiteT09ZASIAaU8g573/wFi1H9OoLqgbC9kp+qnnaz38ffnLHFmiwBSEm8ISRXviH0Cu79Ihbj8rmf+//+Z94tkcfd9sytDi21pmKHTxsG+Y5DMv4LZfe+poZZ+ArKTQhRogJbT41K8CZua++K9H51TSX5qVsvEYEsnuSjB5sjE/cMmVAiAmOGAKIJMfSw6vmv0+ei7hG3iAllaC1iGK4waptpHD8qk4esHaEfY/bxpWEH4+U2LPS01KejDLRXypVFGew0NySDmnOCrxVEYOrq X-Forefront-PRVS: 0957AD37A0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(4326007)(92566002)(189998001)(2351001)(81166006)(33646002)(76176999)(229853001)(2950100001)(50986999)(19580405001)(19580395003)(36756003)(50466002)(110136002)(8676002)(2906002)(586003)(3846002)(77096005)(5004730100002)(5003940100001)(50226002)(66066001)(47776003)(48376002)(42186005)(5008740100001)(6116002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 23:uxpJZBS1VX2Tk50dOQJNxaGIl4prAcEZa05z2IFBp9RUElbof7BxrMgVF58a6mPZSufnpQr+pk6bb9IYUcvdKWqT37xmWyo4IA+R1BX8+6SmYV51P7pcprAyu/SNfvbcXZsyTWrpPOV+GdGOQMOKHuJxgYg58KAwvoVR5vazSTOVfY2drFq0wp352XU45m9x+yU4pketkjwiIU/XY0W3biSrKTbAcIhPtRePTH+sQXyL9Xr+8R92LpyeoJDJVgXBlq0ZckmFpvCtbB4wIM5ybS7ET0e76FtVDXpUlDasAiUtHUEIMG1rXkmbeSA0F+8ayLTcciDSJLwhJeVVRyRg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nosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2016 16:48:29.0836 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: [dpdk-dev] [PATCH v2 06/20] thunderx/nicvf: add dev_infos_get 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: Sun, 29 May 2016 16:48:34 -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 | 47 +++++++++++++++++++++++++++++++++++++ drivers/net/thunderx/nicvf_ethdev.h | 17 ++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 887cf8e..f5858af 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -71,6 +71,8 @@ static int nicvf_dev_configure(struct rte_eth_dev *dev); static int nicvf_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete); +static void nicvf_dev_info_get(struct rte_eth_dev *dev, + struct rte_eth_dev_info *dev_info); static int nicvf_dev_get_reg_length(struct rte_eth_dev *dev); static int nicvf_dev_get_regs(struct rte_eth_dev *dev, struct rte_dev_reg_info *regs); @@ -196,6 +198,50 @@ nicvf_dev_get_regs(struct rte_eth_dev *dev, struct rte_dev_reg_info *regs) return -ENOTSUP; } +static void +nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) +{ + struct nicvf *nic = nicvf_pmd_priv(dev); + + PMD_INIT_FUNC_TRACE(); + + dev_info->min_rx_bufsize = ETHER_MIN_MTU; + dev_info->max_rx_pktlen = NIC_HW_MAX_FRS; + dev_info->max_rx_queues = (uint16_t)MAX_RCV_QUEUES_PER_QS; + dev_info->max_tx_queues = (uint16_t)MAX_SND_QUEUES_PER_QS; + dev_info->max_mac_addrs = 1; + dev_info->max_vfs = dev->pci_dev->max_vfs; + + dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP; + dev_info->tx_offload_capa = + DEV_TX_OFFLOAD_IPV4_CKSUM | + DEV_TX_OFFLOAD_UDP_CKSUM | + DEV_TX_OFFLOAD_TCP_CKSUM | + DEV_TX_OFFLOAD_TCP_TSO | + DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM; + + dev_info->reta_size = nic->rss_info.rss_size; + dev_info->hash_key_size = RSS_HASH_KEY_BYTE_SIZE; + dev_info->flow_type_rss_offloads = NICVF_RSS_OFFLOAD_PASS1; + if (nicvf_hw_cap(nic) & NICVF_CAP_TUNNEL_PARSING) + dev_info->flow_type_rss_offloads |= NICVF_RSS_OFFLOAD_TUNNEL; + + dev_info->default_rxconf = (struct rte_eth_rxconf) { + .rx_free_thresh = NICVF_DEFAULT_RX_FREE_THRESH, + .rx_drop_en = 0, + }; + + dev_info->default_txconf = (struct rte_eth_txconf) { + .tx_free_thresh = NICVF_DEFAULT_TX_FREE_THRESH, + .txq_flags = + ETH_TXQ_FLAGS_NOMULTSEGS | + ETH_TXQ_FLAGS_NOREFCOUNT | + ETH_TXQ_FLAGS_NOMULTMEMP | + ETH_TXQ_FLAGS_NOVLANOFFL | + ETH_TXQ_FLAGS_NOXSUMSCTP, + }; +} + static int nicvf_dev_configure(struct rte_eth_dev *dev) { @@ -277,6 +323,7 @@ nicvf_dev_configure(struct rte_eth_dev *dev) static const struct eth_dev_ops nicvf_eth_dev_ops = { .dev_configure = nicvf_dev_configure, .link_update = nicvf_dev_link_update, + .dev_infos_get = nicvf_dev_info_get, .get_reg_length = nicvf_dev_get_reg_length, .get_reg = nicvf_dev_get_regs, }; diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h index 8189856..e31657d 100644 --- a/drivers/net/thunderx/nicvf_ethdev.h +++ b/drivers/net/thunderx/nicvf_ethdev.h @@ -42,6 +42,23 @@ #define NICVF_FULL_DUPLEX 0x01 #define NICVF_UNKNOWN_DUPLEX 0xff +#define NICVF_RSS_OFFLOAD_PASS1 ( \ + ETH_RSS_PORT | \ + ETH_RSS_IPV4 | \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_NONFRAG_IPV6_UDP) + +#define NICVF_RSS_OFFLOAD_TUNNEL ( \ + ETH_RSS_VXLAN | \ + ETH_RSS_GENEVE | \ + ETH_RSS_NVGRE) + +#define NICVF_DEFAULT_RX_FREE_THRESH 224 +#define NICVF_DEFAULT_TX_FREE_THRESH 224 +#define NICVF_TX_FREE_MPOOL_THRESH 16 static inline struct nicvf * nicvf_pmd_priv(struct rte_eth_dev *eth_dev) -- 2.5.5