From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0071.outbound.protection.outlook.com [207.46.100.71]) by dpdk.org (Postfix) with ESMTP id 2B3AA5A72 for ; Sat, 7 May 2016 17:18:10 +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=8ip4VKVAKNvnBjCRp0ksM6B2pHIsC2yzrj95ki02Xew=; b=NAYo6E21kCwlk2XOEx0OYI+4GIOiYD8w3XLmfjcTZ81IUvjYbCF1323l2GPEYqq+dGHEoESd7gba1EMPQuYW/ZJS4QX9F6Qdn4V2PYJtwYqWoPs2fD53DprwqHPgXANaCfvdUEtX7jdZZLElirsNwgqI0BH213dilrfCKA2n8X0= 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:04 +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:24 +0530 Message-ID: <1462634198-2289-7-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: c431e9e7-f8e9-4d05-bd71-08d3768acbfa X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 2:uyCR4RluHJ77urhOdLBzMhuwhHS4tOC8reT//CMLSblfFBYGHjGgWRaKusRnPeC95J3v0nV7lKnc8UKEmRt/4ZI0CqJ20H16vr+N5hDGMJ6WIA4+rx+xWrap/4R0GICB4uBwLKS6AToP4vIF4AQGVs4ATW09H8DZsKhujPOWNv9QlsAJjc7PzTgj1n+LKTM9; 3:AydgN4gSPNUbMYoj1bxoSxEyR3/PSros8eqrWd8drrg7B9C6pmjXs0UD48ioCqUPDz4LwJSK+v0iYVALPM/gOtQXBk4pj81zgyqykIdmQ6NvfrPOowOSvz1KpywEYhE0; 25:yEXoCmzaI3FS8VO4dc8kZIj7pLdL/2m0QWW9AJOwYF0R+6+VYdLcmi5MnMTmLDuY/PfDPbso+vCZyOXoNocWj0VE4AMpR3q/mPeyP3VYRJaD31CZZVuoJ8CXp0+kpu031gY3eXhbUq6YxZ5bwTgRKTGvJppfmG5ZQO3gxBbf7gmEio3528NZJRbK0XwpQ4ibXKdxDVKuPC8mETWzekdtfX6EzRHa0BVzvwoX8EpumAdUWOKYTLfVf+pGBLUHi0lbf9fCVOeudKlR+CzX57uJcTvUV7rgUMB5/yd/oUlsg/qzlx1uSGUnG7zW68T9Gc8xN4Qr5GDf/ypaGDH8/Sxqg5bUpjIJaVU4kNuRxc+8pMiYiZJkxteixzTpGhxrt7oDXGz4gnyvaZbx/5mz5bVX/g== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 20:qUVnu5YIxHZIUq2G7JlYU1yZJ9XRXp7LoHhVtt3FLT+wNlNLTzW2mj97k7/Unx2983yKB2QtJa5vZh1uCSlkv1OqimnGNlFvg1OSVegoQBcNWTLYgAJL5lNzrej3W6BtXv5WvSNnrpc7XSVzSE4hz5tz3NvtNGbsz1tuo7UehpvPFZiSxSffMX9N1qCS+gSOWmaw7lwoccGOtZxY4SEX8JCNBLWq9LKfQWvIqoGvBf6JCi0eFhwjFzwHwhtpPxNDynqxtpQsGMEcIqIpj2lO/CD3+BqCS6Des2yY+xO9btKutWC6ryGpDFnLNkkXmOnSwvsMTBX/BlOTBgOy64wtNu4ZF66xgBobhamZFqNRGndTZkW/isoL6glO7lmXKV27EECPalJMgY9XB3fUgfKPHSXDj4iqAkBFu6Wf+f8ueaVwUF1aB+BZjaNVY3FAyYXdu+UEwY5L1T+DLruUsfV7CxCWCCWwifaUC8Wr2i9cceiNdNhGLFxKriFV5VQBbMHvHlB0Ow1jzioK5aCkd967rCLK7QXQFot5iT3Jy5vyRri/yVa1l8xJ+i1KNd/tz8zpY0PEqdSoPRu5eD8f9IqSRNb9Hoe711rTRGuVyriQ7j8= 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:s9wk/m01DVbbvnZy3JB0xcn7PZgDrIlJ1gMK3G1yqIznv2/h0vcgekhJw/mXWNB9Vwv84U34LxBEcFSNgpSfBH0jgWpxSW8JLT9piDlqU6TT5r1oAbMeWZEFMjC9G30xFwe8HioYs7TqYMF/84PtHSl5mmAA4WQ1JWVUq9QaqIgw6UaMlNNeRqFXWhCxrlX85MpJXSniIZAj5+lCiu9mdCPCEh1UwM0QoKCQ6imJgXTR9Fs1SPofEPabkKhDEP+Y0UY0ldo0OGCMTCN9YYLehAbPBu92PQC16QAEbHS4nCCuB+1trigvUW4Vwaod44aIIJE7NdCVuTYAVxgQSaPwJ0w7YxwgHyP4+MXSSYqwCyvdNMi0C1LbUsZccc4U7PRl 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:2wr84XTeoAZfXWVZfhrDINqmF1kEVXluDxcLWcuNFwQFX3uW1zQgTcSKOStXYOeUTXhyY/Yvwm39o4hVkzGD95em8lx6vZXgEy2p0GqjpF84Kbse5iQ5odmbaKUdy9A4xCkIzl1Hsg7EDRz5X8PMIbEW1WHlesDtY9oD7ohQSmgCYv8tfcN3uolmMFNU544GqamBZ4ZKBcvRhCP/ITdfTJJqIFLXj73MA+fZpTJYR5uygK8wzBquGokDk50Uj9vd85zJnX2ZGQAecpYdfA63E+6AllzfNPPTnp75niuspGCS38vqqmGrHxD5Did/DLpbuCJ6w6Gu1XPLH9RzqaYb75veWaZ8V7OXSsZp7sAEltxDW31w8bS8b42qFPFimC2nkLm9S234vfNisK0MMFcOEggwVTNutJqTUoKjTQS/G+ht4M3f6wg8wfq82214bP7gRDspOH/sjdoXKRv1AYAJgketZt6Xo6sTbvUopX35GNfFa7D/GisJhBBOPMryPtr9xchSFwS7sxshbSMMnbIZROSxEMpW+jjjIi47Zj8ZHW6jbKDEa6eTt8q8G5yM1NLnsDaNHjnRgVEWbMoJjJFqHuG9ebxCh0zb7g6S3I/ymKt1fOhkuOAfIKmv6YdZkQDsGVTdbLiDrgWrAQRrfcvFWBY+siS7ffMKxl4XdUm1vCIhWsCnawhYcRtKT+Kz9EMHGmM49GFM0dedc8ImKRUu4xxPpnKGGy6Uma6mzC14dJ5Zk2+jQ2C/CBtR6ngLRJhSI9chfVYaU3s8yNCdbOtgTsf0tYL1sVff+CzTscSsTOXnJjg4+wIKL2wr46/9I5Vy7zt6fIMn8+4I5xWfYtxJSPEzwlUxa3A340QfcLtb0Nryy09KdMW2sSYJes+tQ6qv X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 5:n4C+ikPACBNU5wwT3krzYxrLS+5TBHbit/QHsmB3Z575afCdBrhYgI3cWXGITA8udnAHkWjQfpOdOYz9mlxAfk62EjuGVhxb/cKF3ksfr3Tav+JIHOYb7rdA4Q8a2sCSs7/k5E2AHrEaNvvYPK3Jkw==; 24:47EeJoQyuo5mHViIYbCwjnrCqNHWawoDqGzE5gHkN/n+r8p+R2n4Ox0GW/rQ0NCrff5FU6A3nsK9JrOSAKFF89U2GJGu9xbpJ8QHpisVfGw=; 7:NK5FPuhkYMFOlMVRDRv3o2bheULaPT3mYb+V6a9HArUQCVt0CQcsqcol4o6ooHh0LxeWf69fdJaiASs1p9bhswWDKPllB6ErAZX3h8njVz9O7ATEi/3rUqhWyzt3go8UyWbFz7C61/0tr7K0jxwlQLkAmNjTSmo9W6hFbdoQhwVoZfjdVtGjZ/c/YwX0LLYu SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2016 15:18:04.6173 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1718 Subject: [dpdk-dev] [PATCH 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: Sat, 07 May 2016 15:18:11 -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 6a153e7..1269672 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 = DEFAULT_RX_FREE_THRESH, + .rx_drop_en = 0, + }; + + dev_info->default_txconf = (struct rte_eth_txconf) { + .tx_free_thresh = 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 cc19da5..da6fdcf 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 DEFAULT_RX_FREE_THRESH 224 +#define DEFAULT_TX_FREE_THRESH 224 +#define DEFAULT_TX_FREE_MPOOL_THRESH 16 static inline struct nicvf* nicvf_pmd_priv(struct rte_eth_dev *eth_dev) -- 2.1.0