From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0079.outbound.protection.outlook.com [157.56.111.79]) by dpdk.org (Postfix) with ESMTP id E8A4B6CBD for ; Tue, 7 Jun 2016 18:41:43 +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=r98OEBAlzulb7Jvg6lFO++t4anM8OA/uBf8/FfpdD8I=; b=lB4h0g5sQRe/ypUraMUhpOC22bTdEc4G9N8ixUODSkBrdYIxhWpsEvLF4QWMGI67kiEkvFRqEYVCXOLolsJs2SemRthXImtI0dbmVVN2byjO6XIliXmR7iFj0lBhw3H2NK3VHbCMLJ3H6YyzkpG3hISc1GoAuMmx8ZqkEnjO+WE= 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:41:39 +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:18 +0530 Message-ID: <1465317632-11471-7-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: d8e1acc2-7b24-46e3-ea74-08d38ef29af2 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 2:wxfjvLRA1xskz0+pYrvQC8CsSyecStXVdSN4EmRezVW7t34Pf5Lag1czzouD2F429s2V9GDDyssujenkaKUhexAnEaCPli4pVhZdYK9g4fN3i197jUYs9A8vLcf1JMA8J670bGRQGfis6KZzTpjNW+flFqA7Fjlw8T9Gv8EYc3tFb1y6cyusEBeGlqLq1g1M; 3:b0l/IgEDEniO1xoLYBZR0HGMfm3ehAYMby6jmnFWbPgkKf2yw1A0XUrEitEAbZiWaV4h8NpiNDVrA1k+DW2A/va4NVA4xGumwIyqdNaoVoOnZmU2wFeVgI8udRWliqJt X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 25:8lejmC9tr3NAipA74eA9xNTc5GElVNwMX4l6vcnHbWwfhjHfOZlVpb7uzRj3e+e8eK4fxRlTknh3Eu//sJ+4cgh2ODu+1yQoSjuNTbQ4OfeHwYYriTmI13eQeHvrTPwpWaVgBjZ4wQEvQufj3kgWNIpDStDR/UiN5MrudtoiuTNz9j3dPYUV9Cx9ZcTjz3wajIxhy1WBIypYUKyTObQAkWdw2RR2UyMs+UhK6AqXPTWDUjtsIPxtEBSGIHreYmMGEGjfCNa+7Gvg/0rxJ8gURVmm/Iec1Le0eRRj/45Ilhr7SHHgTAjQebUrNBw9LNuPn81WlGv9xDmFA71KeY086sj9FFmtCXkr6NHoWSeSgJOkeP83+GfljtJgMZ2hNhw92nugIvoFUt2HaZy2ttZMi70gvANZP3z8JHbpkbs/ydw9GfVCmgW3qKvGcyoXDs4GsGksaKjDxWKMqMU3sFQksYdOiFooug8Hee+ltSljSTg79H3Oaq3bTIDtLT/TLHTEQrs1CBO0UVMRN7aWVl7y3kMrd1iEwkyQZiMvrTcrgQu20g1ovKE4PP0DJEOglWWRCt5AfBpXfBFuBx9nEtdU44ma4PCTfSuxr3AwlyrYA/TRBRrUDv5CzgI5ddiwEJEeAZO2FwKyRN2mvpm3dKeKRpkWyxvlHM18pwiZ9zxnFQKzvmO8EOaSHS5EPRY1aFsxodH5Vo/HW4RlTtZbwZcZ1fT8mT9LRBLO3l2aABCT0kc= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 20:Usgi2ofWgyqHhM7JUIhtk56EkjPJxcvQIydh2YqlQQjX7m274y6AAzeyz/JY5Lk4dYBhSk+rjDZfIGWKZKS8a3xL6WP6xrOM4bH1pjxEHT12eiw07g4p6QSDIhrzcaN+3UMurVVAHIMceUBBF+Ual/V138bBRsRslNIuAxWFD3OFM2QsbFrohoGgx3bnBBbtHplNAqosJEKEFx6wg6RkzzNd0B8OaGynkevOvYf4cHZ8gSfSO46ntKhhz79FN3VDz2NDLAng+/1txmDE5zdJUdcPmSy/ZlHRqmPzZcwkdRy7/oehV61CW31U+bRGIlPV9vtAg9vLM/0YobmSXjpHKIR572lMx1a7SfsFLbYP2k20Gh7ONP5SYTmI9fnlZXwlqF8+h6bpGel9LU85MFPnV2VNffajF90Pj4dFZgvQCtMD7DAWY6lPclF1mhGYl0JJRuqvThhrGeIHc2ULFVzgiWAfV6Wyw2WqUryhbSggSKagw1iA7+1IE2xaKrEh2LJn5BNqzG1etQUog64ec0F+iVGCJ6XJNFfaWowScmTAf7l8Az0yQ5e1b1IYZchkuKl4BtxGJkugxtUCoBxuNJO2/bnm4hwnQb8bCnzdoK/Y9pk= 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:3e5ebTrk+5Es42be6fOd8Q6v6mTWZR7YPL6wuFWAa3lB/8Ln65O1RY3Upal1Hx3jeGdEqMtJrJAuroH5rj0zk+tvetvsaSTp1Ch8A5Drrxoc1C61KZG34tK3MBO07W+TK1Amw+/NYLQZVT7bs8B+bztKjM1SHDrpuT5HIaGx2r3lU9GLOEpDwy6jSpAeoHHH9eac7XWUSICkRz8T0iKTFGF87uVpBvIYjmgZRS/b4qgXjtOHZJBwckgrmje3DmT3LCRF5r9g3o4eRQjoj/XbQb7NqFrvoDSLMzg4+nsXxDQ//TAsfCllTDzmG0sHv0hy6ZOIDGYOHg4pHoJsQwMgxdC0BNwyZVQ3KWmzQ49K7SffgoA6A87jSCI1Uxrhtv2H 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:fuikkx/RQdyw5+/UyzLvqB3bbJ+RqeOcA4bTG/0?= =?us-ascii?Q?BUw+x3qSdA7XImNlWvm9+gu0El/WQeIeKEBSg8VGobgc/UdGgvf50+uXuGHa?= =?us-ascii?Q?frScAAhKFeKLlqArSn30pyofENXDz9dpSk9jde3YhHx1l0UIP6kW4S/YFu3x?= =?us-ascii?Q?kOfJcjct3qiqchm1Cwa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ascii?Q?kJGUq2oLmRyPeorP0/su38wiMsy4vtZvH1In5VPbg7Lvhv+VC5U8f+kMxMOK?= =?us-ascii?Q?Pxi9871M768qux0WENQQf32cFk8rcCWozkhr8NnEISN4UnGuL4LJdVQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 5:Yzoig2n1OiDY5e+aQhz+71ekVXPKwyquUk8hxR1MheyrEf2QZ06iAbXeFb9L+f0S0idjgabJX+hpYVZetL0PE+xFfDZMwhXeBoTJl74QLjsUhiIfGnGD9YPv2MrC1wlNe82IEON0CXajrK8Zw78TFQ==; 24:v5+utv18oR+hADXd74AZDsNZLOdQ0fbgSE8Ei2tDYV1gpmrPvjOQDX0Cc5aLaPe4MozayEZ00CMfpIUH7dbp70QIiZmBgfRhQxRN3pTtJCQ=; 7:JiGRyZZrkNcqZoBoTwdG2vmyQ8lUSKXnvpBDLjhHWbtZ1/q5ae4yq0dtqNJ4bPvoS413XV3UMRwohXMqDU/UC1A/V3AJyYado0uSAQwg4Z0vgsjtS0aDghfWoiNGHlxcvFWDpkkuzJtQ3ZF+bFhJ52j5tShN7FupBShGf6ZrZnC/J0ySJrlHc9dklOwsaS5ZL3IV1qfiAbCNv9OZyMO73l1jI1of3her9bWCRv0q3m0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2016 16:41:39.2194 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH v3 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: Tue, 07 Jun 2016 16:41:44 -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 37cc7f4..5d91cfd 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); @@ -174,6 +176,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) { @@ -255,6 +301,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