From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0080.outbound.protection.outlook.com [207.46.100.80]) by dpdk.org (Postfix) with ESMTP id A8A9F37AF for ; Mon, 13 Jun 2016 15:57:11 +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=fsb0V2UYca9ED52RatzqJtffd3bNMFnfh11Fp2ELJ99+LepNStmDiV1llokn8wXBB/A9pNQUObaA6ZFfmJP6TssLc41L1VYVlqFXuRg9//ZQGmXT6hKX0+9it0meBhfzpQ26A9FvBWnAOKBg4/ZGc4Dt6u2Wn18/xop0OCmearI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (171.48.21.3) by BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) with Microsoft SMTP Server (TLS) id 15.1.517.8; Mon, 13 Jun 2016 13:56:59 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Mon, 13 Jun 2016 19:25:30 +0530 Message-ID: <1465826143-22159-7-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465826143-22159-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1465317632-11471-2-git-send-email-jerin.jacob@caviumnetworks.com> <1465826143-22159-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.48.21.3] X-ClientProxiedBy: BM1PR01CA0031.INDPRD01.PROD.OUTLOOK.COM (10.163.198.166) To BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) X-MS-Office365-Filtering-Correlation-Id: b37e6b55-8c3e-4ea8-152c-08d393929937 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 2:SyMPZKTaEBoD8MOt7Iql6nDMmRzBKHNhEZOkf+xJXmul6l43TIqenbL22Ld2HzpT7Y4aMbklyZiTJzv+5ApgcHdWFJ54tzOfO88BwpNBwV9IFIw/nNUJLkGhHXunETqWjq9p4C0JWv1M1dJMbGJZdNztAjGusc3AJ5gFo8yzTUkZSt3cIVn6tK7UpBEL7HqQ; 3:nzG80S3ggMXMlTru7dFmiROtJi/wPzH60du+J9U6wLlJaCgtmPeU79HBa1wJsGQnih04DfP1VyXIlFDmM+QuwXGeaxEZah/hStmT9rL23QunsTtslYma3EX1b9heRaWu; 25:EnWEGEUFm8I7/e+Kbp350qNCZJH8cd2jDj410KiWLQ0ejKAkLQ6m3da9bLu4rIbj/W8OvL9q8KvZBAs97/mJ686aBxm8yYV1QoqdhdHAS0SfBIFxAi8rAp5z5ZET8e3AWgkCRzUSxPe4y2QXQDSxer0Bx8Q93eTEKnKqNw+ZO9h+nWwYJk2bFjVpR4hqthka75TeGsN3wK6AtneVJznSJDzgLF0skn8gvxp5tnlfiarMyN6RxUakOFaZDi6D7nQPRjagxIq9ZV/6y1rB7T1j2+RoaIm65qVYc7GWw9TRe24JdT8La6NiVAUhFskTR9GBAllps2rbSFvWYtMY1QbpTVeWn0W0o9/uaHyesOllMeE0NSadurBpRgHZSLP32k7EScwDtzXK/aiDbJvdS8yMdo8Egaus46kFIhb+py3A3Pw= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 20:AlQ1E8+/H6l3M459UCJZCVOmhrxDNkTk0DUG6bGITEMuXeCi+Dg53qNzLzPvW45eTuQRhE3M3bESjDyQdddqAQ1QflrILnosQUObSE6/YUhyfZjYejviBDhIkhDtMcInF2a92bXiZxeEKW3ZHVuz+6/FFz791ngDCb9kx7WjKy/x5Hjr8Ee3ZAfsuqF8cXLy/gY6qQJDZRp9IxWZ+f4f4WrD8qV/73euU6mISGf9xe12HGu5Ig1JctYSfD4n7ECZ+mmHtJz96WffsMUu0Ix5KFKxyILxbrA+gU+pHdL7VXPbblbdghCMwqZXQVGrKNYffjn1baUIcXOna/mGVz16XxFZVMRmR/n/5ddQv62jNUUCdc2wQpq/G06WpHlbkXMMkBF+XMQJYlN5LKkJvQvD3Z41rddRqwQoO5pUTCgTLSmUa0n/eMqdcVCL94FgcdBFmk2oWF/MEof41ZD4QjexrGgyLm4S2AkM1PiGMxwYS4IQm1WHCekcBatvL249WgbN5fMn+1GD41pV/Pnc625c5uhSa6ScwPYBr0qjpUm/QhZbu/DDRVN++lxtu+cFc4ao11Duasw2ibfx4FBuxEguvyfMu9HOMguIiKsDC0FrynY= 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:BN3PR0701MB1717; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 4:B3ivoeLdGQGS9Rz0dBKljRUpDprD4hoBmMXRxPlXrNmoje/ILMcicV1fG2VmPqCuDMQnxL9D7KknBvUu5G5uOQZ8WDjsM6PUiied7iqaIz9BVHLDVkoeIKt9g1fe2XAuz6RdpH1GKFXyU4w4KOjOYbggl7zyDHyaiA6RHvz6GDyQyrIJY/xsztpn7Yz5gmjqAyUTiNDF4JuQkjWC0XzJAcuL7Wn0fM2b1TmBtuCNhbDcDPoeUSgJiS32snDRdfV0XkAEJsWi59p3mR6uZU2cZSCPR1C6W9V+dfzPUia5ZckJHh7IRgoJPgqZRYLDJKllWoRw4dIqxATzxjXgxXxb7BHVpoHDzFPwLwhjM9aPDudZEJYbJ8X/1hUr+3nZIxrm5gtsUqqY9YYWV+kCzYnKDZr+kFTIqy3OK6Y+SSprL2U= X-Forefront-PRVS: 0972DEC1D9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(50466002)(48376002)(101416001)(42186005)(50986999)(92566002)(76176999)(105586002)(106356001)(33646002)(2351001)(5004730100002)(47776003)(66066001)(36756003)(586003)(3846002)(6116002)(19580405001)(19580395003)(77096005)(8676002)(2906002)(81156014)(81166006)(4326007)(189998001)(97736004)(2950100001)(110136002)(5008740100001)(229853001)(5003940100001)(50226002)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1717; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; BN3PR0701MB1717; 23:QivsDKtUa4D/qmYil385essMGxJBX49ZlTmv/Yo?= =?us-ascii?Q?qAgNAR31ePPe7Z56ZqoDYFB1DJQFot7zOWzCLU+tg2xgArzHXbKfb0I1rLvs?= =?us-ascii?Q?r3++ERn697cBg++Yn4/G+Rq0+l3nqprnNqbPU8rkiCDraeOvyRnq/thgKJRU?= =?us-ascii?Q?TD4ej6ymE4ta3X2ymT8s3EzpHTLCrgJKHWzXWfwCsS3XKE1qHgEn9ca9o9rM?= =?us-ascii?Q?7QUXJBk8T285smV8YhTlTDN2J3NG7o6nLp9c+MkLdQUt/zxevcOgTz8hkFft?= =?us-ascii?Q?iGOjgQmyQZZhxeeZW6cBjVwpaToquEyRNq2jVy36h9ZnFSUWsVKrnk6XtPFY?= =?us-ascii?Q?uvVfeLhaW2soq0n8GahscmfgThfvWvSv4lH+IrUiaNenWGvHPpEcBQqa6xvl?= =?us-ascii?Q?EsMoGJ1caD7bxDGsAK4cahRlqJoWW71AOt4FQkKyv6P3bumq2AD/a9AvKV96?= =?us-ascii?Q?Yl2eA5+zf5bDV3G+ut/2ojK104akNqt+4NV6NTvrLmDkRW0Z6yETop90W1pG?= =?us-ascii?Q?2wAj/onRY0TpXjKLOMjiR77ueShBnvrOWd6NPGTuV8whDMjp3cKpIYQzif++?= =?us-ascii?Q?6e64PdUXSJDu5Sde9879FPv653PXXr0N+h26+nvzOrrMdjeZ2YJaJjePeXj3?= =?us-ascii?Q?goPYHhiH/PlVbpYDSYfHsXIFvGfP4JshRLRbDlF/GOM1FqkhL+GtOQeyp3oj?= =?us-ascii?Q?tPV4yMLLJhsi5jPKwJ5bJUIfO5D1jLHn1sF7cBhzY7qDgTPgt+kuNTIEo+t/?= =?us-ascii?Q?WeLeJUuoJyp0aooHOM/ITo3B87pcjU265pdm0xqOOqDkuVEikqbA6qnDaFgy?= =?us-ascii?Q?pwDAvcMXWb71H1t7BGaJf6kwr8R2NcMW7QXsmJdTbQhKlBtDpSsu/vaFjzh2?= =?us-ascii?Q?uKwgtWA75Cj1UneMr6OHk/SRC3XT/qZN7rXmVKN8QHENONlZusu5J1AdXUKv?= =?us-ascii?Q?0OzOCuji8Fscc9QBR5MQ9rv31iPA0BHAlBpe7ISQM3wERal2qhY71mx6wMO1?= =?us-ascii?Q?22In5/h4xVuUZB0P9dj+pAeoZBvE90aglPQo+0RPyY3NkRHiThBDpT1KG1o2?= =?us-ascii?Q?Zg3y8XYkps0mksJSymZ8LejZE/iNp?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 6:hMGuqKU03uDOR13iIXw/o1w4qGXJuQEX3R4jpUtvKZaQfhzm9TUk/LfeMQcJNtanx1LiV8xu+aIr3jPJk6Gx2/T5aGCvt7hxCoosSxwJRuCMzVZMv5rZYD56XfLAcMyUMZMF8jWc/7TztotHv3HzDjmuYwry57efcrPjek+JzW44q7hWgN9CvSwFPqTwGrg/OnH566/JrqXE4dFdR/Drik4t+Ga/p2eqoZIAUe9t+oe+VJILwP7F58pl2TMNiuyc80+nzG36noPp/wleoXUTwOXYeRuM34Wv41uNpfLAWW4=; 5:cbrCX60rti0aCq5RoHXbkcnP2JBs2+jgG/MDE5c76TGaHrzorMyr7aw+rDKIIVu/doNTfkHCKJfeTU/CpiyFZkIIPsPCEQTDjeEm0GtPGEyuLSSLHya+228hKT4GB4EnPApNPpae60AYS97AmJw2gA==; 24:ji8ZtRXMuMN2szj1RITfDGrDOILcuV13R+PbbhFAux3hjDpD8D2VyC6R8ivl8suTRuZmv0xlHcP72eyQ0VjwbUnyWsK9E74UluJj0ZN3EE8=; 7:M3Dgmop9yvqdWzd5IJOTc03eustVPvgIow2PxErT0JlXODs7WiEgv7DhciYK1LcROwds6AL561TtciwGNvl4vkxtl0PHfCkN5FAYDNdfFA1j7AZvTAWN79A94B/sYRcrljG1BQuqxkRLg0Z2X/Q+9qLaok//lqUkN6ARZN0Frwp9RU/juW8mgBvkKoajdWVg2+Pr+9XzdJ0urRwkUwBrworkBuT1cfd9a0FO9LpkbOU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2016 13:56:59.5032 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1717 Subject: [dpdk-dev] [PATCH v4 06/19] net/thunderx: 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: Mon, 13 Jun 2016 13:57:12 -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