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 F10CCAA39 for ; Tue, 14 Jun 2016 21:07:56 +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=kTeJfahBeCHBWwfGLPEziQfdl9NDyaWaVIj/ZISevss=; b=WyWlLHAOMZFDiM4Ow82NUi4Jcvt14mzLnR5jlea4MiLbFGL++1lIBAJ25OiYAqxASDzOpS99OClgTwK+SRNUHIifHWUEd9wz5V5tQYn46sP0Wv5MysD55rCuoKwP+dykz/SflAEKOJlndMpne/BprKBcGXK5Wvy+o/n0/e5/RmY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.caveonetworks.com (111.93.218.67) by BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) with Microsoft SMTP Server (TLS) id 15.1.511.8; Tue, 14 Jun 2016 19:07:52 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Wed, 15 Jun 2016 00:36:27 +0530 Message-ID: <1465931200-23912-13-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465931200-23912-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1465826143-22159-1-git-send-email-jerin.jacob@caviumnetworks.com> <1465931200-23912-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: MA1PR01CA0040.INDPRD01.PROD.OUTLOOK.COM (10.164.116.140) To BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) X-MS-Office365-Filtering-Correlation-Id: 3443d0af-5480-4e81-ccbc-08d394873109 X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 2:OtW/6xJnJFR2AFp6cszA3VH9nwGgb0YgRo6uhkIxV+rXfWck7J74J4hfihQfPSlhfXm3mzVUneX3P5jX1tP+SdO21c659bAio088u+z5HLyJv14Hp8qJDms8BSjYCgccPfmvjCQQjNwUuauwdDj5XAbZ2v9wq2sE8CbaxhgHfx2qjhJFaP7MdvId/VBhKrpi; 3:Ae76t7mJrOZoLxM2GvVEdsKR1RcVpKXALXD0/1C9Q7g39qqtb6QX2DB8clJT7Xe7V11sdXlyBCr2a/E11/X4K4D40RopxPcwxqEvmqOF2MFD1UT3v5uTxg6nUkdzFnv9 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 25:59hjMQVwSFbwU3G3ZOe86u+g5IZxcjYyGJDDZVcM9BYHwdBvckuNOgWn9w2OptGKmACHkarYk8bHXOlJZWN0/+oHYgjYdn1JC8pc2t66mYPJrlQ0+kE1YzG+6ky6Zh9Cgi8888SdgrzfyDVm5t6k6RLXo4RUDuoYkLjg7XHLpzDyeR4U7M7l7AOET78fdpZfxEAmxsJbDDL+O1pAq9vI7+eJ5YHB5AhLSS2cdiEO2GU2lXuu+yjg0KaJL2nYXCznWE3zcO/Ck1uzHDJ1N/KRzCHG7GldOyJEOSROag7LUpHC00AKTgnITDiFTmHqFYB6NGljz/edUKovzhChpcn9UmTlmU+QGAXL3FKcp9BIHyNE5JFtPT0UU9DePb0m7Uc5Ie2qKo8mSihPqmO5w+ycTDoAthcLgcI1UyilRwCUYVvP2fQPo0ouYqum6j+o3ioqyRUSOcRysCaE+wwdGwPy73rcXwv5GzrheSox5SMFXjwVZmuCem36vpNnuUCCAdqKhHskpJq7xZbQICp8aymPHo27tEbCWgqF2mp2v96VeO6ycb37goXnVoRmorr+9if+sV72YoEfwHaKSvHoSwoCxps78Gu1OiYWDY91FW5nphG6+tkOMn5+YbSIdQ2Ek54jsrq3NNPKlYU0t8+WLArvJwrgnubPK8afLjnGUSFa6kOddj/1nVZYYAWTvdttcg02VbGPCSM01aH9AghptetUxsucHweJuMBTifSsjL5gkRiWnrBkO/IVjYlccJ1XhF0q X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 20:Lx/lEXslcCc59cbRRT2v660+Y4NvpFJ+vI7LZYiX6w6fkCzvpMahaARCTH79NdW2IfnzxeWbfHkyCgjvjzdaSkmr3QrXEf0afVf5V3iKcOXo7GS27xkjuhrcz9/J8PUFwI29RXtdS07FdeG4eY7TcFkMa1CeKgAfIVtyzV1QxEgpBJ7MclsnHxkmkkimm3Ej/CmJhwujGxDZDlEKbOnq2I06BbID/CZw7qTB2GOQ8vL4VDtpZGF2pXFLNzoAacCXHsHPm39kWvbIKpdYuWp2srYo2f/ajrUnYQjfvUTlSbwqYC1MTH9UMmA0lqJvSeoU8xo6BX+0fCnt2ey70NLKt88e5lHZNh0l9h/OMFjZPrc0ViDldz+4+eddCiYjpGbsIn6KmEQ5OA/eF9ssJSHw6/SMyT0eaUe6pYMBxfKr8IS+aTdyi4dDzQIVWGq/OBpQkCiWQFTJUJCqxFeeSk5QXrK/QVu9C0FEFLIP9qFSQmS4XqZAFZLnjI7bEvteKWGqd9PjywQgn8bCALGZSjyMY+bpibtmccBYxmFJ+bZgRhQTEDLCTbvzC4uWPknUuMVbOVuOy1c+z1qrtVCMHyApfxa+r652TeavxiwymZnXiCw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:BY1PR0701MB1723; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 4:IKS3b+H4LDi4Z5hA/4eev/wPgnS6j/hyfGbxjEletj7OXLHQqfxlpqbDqeoV8+uHGe0HPfl4qApmNNpAw8DZvPgcDYT3oUxzXOyBxmyjxGJe93XPoh8btHub4wTUW0PdYqtNJ3xSvQY3Rvnd9wHaleOMSGby+Y+fly3h+hEM16YrQfFh+GEu15KTXY+yIpTWsToN9y1bqwUUvh3Um2Iq6KqbEOMjYKxi1sHoS9Jspf05yHdlyt1YzcAI9KIi2v/4tcg0VTugb27/Kywj7YLebXZC6unchx1QLFDifoi78hzblKISJyt404dog2wXslelOeQ8O5FTbUyrOLgwamjXHn9wZNSsilgT4nt36hGL8YsKEaqfrhy64k/XwbIOOQVAe4m13vAfk3CGms65E1Wwkjyx/Tj4grtK17vjxo/8GRk= X-Forefront-PRVS: 09730BD177 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(189002)(199003)(69596002)(189998001)(2950100001)(48376002)(77096005)(36756003)(19580405001)(5004730100002)(19580395003)(76176999)(5009440100003)(50986999)(97736004)(5003940100001)(68736007)(110136002)(92566002)(101416001)(5008740100001)(81166006)(8676002)(229853001)(81156014)(66066001)(4326007)(50466002)(2906002)(105586002)(106356001)(2351001)(47776003)(53416004)(76506005)(42186005)(33646002)(586003)(3846002)(6116002)(50226002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1723; H:localhost.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; BY1PR0701MB1723; 23:MMj+VTHcxYhLKZ84K1Z9SkWiwE5t7bmc8qpZIWc?= =?us-ascii?Q?bg+e7eTZCxskTJYPfUhEb1SSWXIv/RClkhQdiqWzlvBtO1lDGIHJxgxs+G3Q?= =?us-ascii?Q?CsXZpbjbJx2gxiY388F+V0WSsGavjOv0pk9cczSq0Zw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fd245Ampe5DFOcaX1q+sCLXhZj18BdZ+6UkIAQCCbOZ?= =?us-ascii?Q?kd0v5yCuE1Y4Cb+cL0LOsXCcYuvETkRA8Bo+AMjoFP6qhT9yJK/25blsmtnA?= =?us-ascii?Q?sLsNSJFPKufyRDMHF86XxUNGdI89ZmZjXd877RoP06bYuybmToZGwutTyo6y?= =?us-ascii?Q?lfX9S8Q/Y9HANLUw=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 5:GoAK4287Y495CIB3KxMgtLnEwzOlnPnV63TK59SxQS0eF3xlkoG+Ebs51AgMu8VV865otXaMWD9i2mz4B293gQhSarFa1yjy8s1M+vM6bpI0dI0AFZWSH2bQDQhW2Ys+NmJWJODzAZvyv2dJ4kiExQ==; 24:SUnd4NM0NqsfbAEAE6+Y+8kPWAU/siUjce7OuJsFJRpZw/HSt+HqgHjK5ZR5BXZy1CJ/Fi7kPfgYrjmNn/nhTQGAB9+WZUC1VsEcaizDP9g=; 7:8UgIWkgAQ62jTvF5HKmKOVo5GmdQwbmLD+ydAdeFbfP+EBMQXkT7L8QR/Z/XhuaxAmpmG2PPpIXnp6lJru4xhMUdyCDs2xaKyFQek9STodhdWlkNVnqjHl8hCh5ijLsU6L3Gw2QcU4xhce5HbdS3T9Ufg4g+3LklMBphUSwYNtZ/m8ro0NWGOge8wRfxuWakN2CAdXK3w5rMOF09fwjwpg== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2016 19:07:52.7654 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v5 12/25] net/thunderx: add get device info 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, 14 Jun 2016 19:07:57 -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 Reviewed-by: Ferruh Yigit --- drivers/net/thunderx/nicvf_ethdev.c | 45 +++++++++++++++++++++++++++++++++++++ drivers/net/thunderx/nicvf_ethdev.h | 17 ++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 1814341..109c6cb 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -168,6 +168,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) { @@ -249,6 +293,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