From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0063.outbound.protection.outlook.com [157.56.110.63]) by dpdk.org (Postfix) with ESMTP id B860FD06F for ; Fri, 17 Jun 2016 15:31:39 +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=NqHLQiWhlAq1ZQTV2PUWg8u7Ocs/BfVL9F9mk+GOyow=; b=UEZa/5PMiAMJStfCft0HFNQcd0+xCgSWSF9NEP94t4MnB/2ADsvt6p+fNbLbwTC4vrfNRxSM9jWOWw3SoZVb2DYX0l/tfkqiI8BM6u00LWIzIt/I6PGtbCc6m7PJG6CjFKKjWpmA8Sw4mh7MlxHJ2i/nCix2h9wNPFDYdPt+rDk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (171.48.17.70) by BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) with Microsoft SMTP Server (TLS) id 15.1.517.8; Fri, 17 Jun 2016 13:31:34 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Fri, 17 Jun 2016 18:59:39 +0530 Message-ID: <1466170194-28393-13-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1466170194-28393-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1465931200-23912-1-git-send-email-jerin.jacob@caviumnetworks.com> <1466170194-28393-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.48.17.70] X-ClientProxiedBy: BM1PR01CA0028.INDPRD01.PROD.OUTLOOK.COM (10.163.198.163) To BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) X-MS-Office365-Filtering-Correlation-Id: a4693a37-68d3-4e49-b3ec-08d396b3b5f4 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 2:lgNvNyPG2ltDYUQF5VpNSN1EmE9g6ezpjyPZ+ptK5hDg43axQFn4QlFgni/+Bf0BHviue3m/cC+9trZ63sk/UBGzLkDYoH5GYyiUV3BqQM0BqtVJRWbIQzagOZC3SMf74T85KQVm8fvwpmhh0SFzm9Zd46hO4lc87zF3Hp6H/ssc/pzfGOrUT0ruIKZIeJCe; 3:385+1zkaymBaTLq7fCm7GTBRKoc1+UjLcRjCwHvxyYlyqj7kZiMBP9/rEBUMGlr4G0kYL7WsRZxAFxXFRNKg0v/7nHZpeKaSi0uzNmJJ5nyp6HL2XUx4m/BtDavFJijR; 25:VpEKQn6Ju/sRAbv/gbFs0DgFuEt7Wdi+k5lA7yYv1UB4m75HHj0g+/6C2JzEcVPVGeDuDImEudfs9S+1ZaLQn5kKO5U46OSGKyRh/262juc/cu5wNPrYzZCMkEZzCN4rJgHrQDocvyJ1UBmpxJxtU8pLTzXNQ0vDNb8BEYPT8dz7Ai0HptnHvK2obCKNxUnENVRSm9rscgixaCce04ruWoirDadL4NwLyXrp+9CGmeoa27hDpx0tnt4KgbyqFWgSfl3ZJMymy0qhdZQh1YgNTzOW07VLocb7X/wa19/qjrXvY5TTGEZbmazrA10YonxdF+Kh2VydbQ8Bkz96tRwdWgW3KQiQ6gU4qFGXPP9adzXPzl/cNyNMYZ7ue/5Hi41HCbNAqgc8jCdLJOjtRt9dzw7FasUT/QE8PxVo9v/PQXc= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 20:Rl1r/H+7vNoaMxDRFaLTAbhEaQcYOAbLb/MWH6d57u1UGDb0BZwL4HAHkMgCAwrNcX8tH64l0IH3GDKzS4oIvgn9qYbBBMMJoHqFiZrvNoEYUIktqJrN9AUjkc3ckH+kbGaFAYIUmuuM2aFvGMM90568UYBS/qV9CjQAa0Fdq8Tz6knYRI4OjU/cTfqp5n72dyShNZhn77+GJXNyAXsgCQTb8UNxaFgphEYovy6+2f7ANdtJnmOCSJSLd0tzRkeD+SSz7VWtk76U2xWi+Q4eYWB8fW7/1u8UCXHRz7RlXugO6zE45+LPnxx1giuv8Lnq5hw3r/qxt5XxPAGHQqQZnIg4yMDpnENRY41ydfu1SNpiMT6EpR8PmT0eXsl3vOsCCQ5118zQuWTJyCp34nUTD3HfdvqIhH1y83FDvgl5++KgCEAxrTwn8MAK7sUNqLyCxqq4Mk4D/8kaupHHytbV2oGJuDVFiHo51m4FbZWr6RcmT4mGo6WR/FQwzSPoJxgdyrwsJ+uQMM5vmjYXwHvDma2LyQGuGrpdK8wj2C9cZZj76u1nbHrI7lHZzHhxbfcioGO7L2hQ9bvNgpYm2pP3qVZjYGXlrvKPagIPE5QHXqo= 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:BN3PR0701MB1718; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 4:AfCDqMLf7EcYWn7oIIhFmuIMlS4iLdvnw/3AiYYKaKNsZJ5Qjaue8CEVbULwzHfS74KHO25nK9DKacg7x6/43wY5VDK3XR48LJBmBOZfUMXJxZlZKHFsHREeqo3WxvhhEM7cmg0/kf8mF1AyajtfqaGc1gc43Xq2GgfzJ/ZD4S4SVMCnb3SGiONvhnuYoSHV8CRH5IU7mJ5ssXewyZSEDj3mhwkCGMWjvvfo1Jq8jfw5N4RhdWNysNt7hcjw12ycTwsIeA5JLD133Rvp0lKBYTVeTnWHh1SMGL73QnZ3cdpRkG7+gPiPMy8uNqYRWm8Vu+gsbQfGqE4DR6l6auRmic1TVtMCgTzFKlZvnFsDBfsFYWlL11gYSDcWLedOvisiYRtJZHTTwTMfcc4DNa7qigIfxpnzxLe9JjlDRMk4yoM= X-Forefront-PRVS: 09760A0505 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(199003)(189002)(48376002)(19580395003)(68736007)(2351001)(47776003)(229853001)(97736004)(19580405001)(586003)(50986999)(110136002)(36756003)(3846002)(66066001)(92566002)(105586002)(189998001)(76176999)(33646002)(42186005)(81156014)(5004730100002)(101416001)(50466002)(2950100001)(5003940100001)(4326007)(5008740100001)(50226002)(2906002)(6116002)(77096005)(81166006)(8676002)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1718; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; CAT:NONE; LANG:en; CAT:NONE; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1718; 23:K6+9A+GhuEOnrI5psNayZLM8Zn9sH5NMXZna89M?= =?us-ascii?Q?Z5fJ3P5XGoBL92uBnfr23dDPl8H1dbq9QMtKPDl0K+iLT623lMz4r0NqocPx?= =?us-ascii?Q?hemYQU/icNF5eW4cR1IIKXKmygV2aj0INfYziJYsBcNXzy4opCca+nJudxLk?= =?us-ascii?Q?NhPT22amig3abtq3hFQgJ6+Cb/GpBgeAefyMTusfN3mC81tJNCAzlI0ru48d?= =?us-ascii?Q?4+csMRpv/n+zivKj/2Cwv1fv1ogiL1X1IVek2mJzW3/SaOtq6PtDOjYbhbFM?= =?us-ascii?Q?0sJBIFS8wxCb+kSpDO8Mfwv7q1MZFYXAy43CVZFCSaKWHdEkq5fpDQt8W6qK?= =?us-ascii?Q?38p0D4edsVE90FqOir6GUkZBKHEGWHgh7AjwJYjGOg74gmZK9WnkxbgMssXW?= =?us-ascii?Q?ai5Uc+cv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QRHa4mnrAvNP3ogsjHlHp2ctnspBamBADNKEkqPpbQzpye4IXYAq5CqjN41xWprQnkQqCz1gU3+9496C3LpjeBb7nx2Pk=; 5:ezNyYRnPvk8xbgwGaWM5XqhNN2818iDJoIrMdBZR6wCSkCiK2KJdFYN594HHvqFGSJkvmC5YwDbg71QbNz+Pm3qPk2kNjaktPAviUo8h5l0RxY9m7bsRVmI42ZYgWNqysjfQohgO5KUI8PXgWqr/EQ==; 24:kRtRVQoXnx/L85ZjIbYRx4t5kYeQRvFTdbFc1YmB5o2BNs10s5xoxPKfJT6M0TVn1NOO66io9xtrD8hpTiVQC+zEi2HS02e8uxNUPm4ickk=; 7:9d4Doluyu2j/a1SF2+lllIdJH+IMruiToQ+zFebzUc9vIDPq0Cs6x6PFfBvxHXmqJdUDVCrihEJpHrCPxs7VeJKAi2e5/cwUX+ftRpqZH9yGfuIS2KhtMbgaJCoIfzUW1FuL/B3wJ0V628AESp+uMVpJRiXf1xrmrwcScUiodxe91MV4Po4gOtukg5jHav32XtJ4u+nIRy0c20CmGdNjIQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2016 13:31:34.6958 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1718 Subject: [dpdk-dev] [PATCH v6 12/27] 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: Fri, 17 Jun 2016 13:31:40 -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 33344fd..1bea851 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