From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-eopbgr700046.outbound.protection.outlook.com [40.107.70.46]) by dpdk.org (Postfix) with ESMTP id BB91DAA37 for ; Tue, 14 Jun 2016 21:07:53 +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=Yt6W8D6F3cewEBzOs1FPtlsnPCXeZDVlUKDUZ8trBmw=; b=MdoWS+OY4dwMNwG2an8FeiYrTAzVI3vUSknURsmRe0NI0bjfwIt3ambYY7PpCVBGyIcij4qnbPq0aHn5I0GEsT12o1HbjZ4lmCLQj3G3UF+yYfLR7ofLVdCBNX2cAGuP+BfeUBUaJjJbNJfqCOKxcRIAiDuGSNuTCn7wepKYiDo= 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:49 +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:26 +0530 Message-ID: <1465931200-23912-12-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: 153e2647-a9a8-4587-923a-08d394872ecd X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 2:zuZakr9lHwDFkcLt/93M9RcoPXjhpfO2xlXY34tsK8SowfMFQfQA3kRh3u+CxJ9XCgOKzXjkHcj1p4EpyVm1dKHqX2piw4DjnZKGwRXHIo/0ePVE6fY+xvGYNP7Czw76g2ou5RTrL27654fnk7jfb5jlbDjSnhijX++hgbLfiN1aDLVNel5OWHQTXFB7DdgH; 3:+HapWMc/koL1wD+fpJGEvGJiNHjS8vsBFxPfbQ/3bH3TX84mEMnYK4bZq0qhMX2286lWT0dgWVVSb8Z8Ak2Br4AQrCWwyBQayMAN1gdZ/TodWZQdCn2IMurB3ShkzoVn X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 25:F9n8NrJpS9YxtDy5EPdRmZjkYOViSj8V/icK36oqZ7zjun+ZPTiRN8l60qV4qArC6dFg+6tWh6lHzY9xOWU3132pHguvckoxL4/jDvqlxgHeEa8gtJFY/kAeClYmRNGFyf5OmzWueUw9fd7GvC8nR2Lc64traWdUEfwnlFylStFHhJdfu8xp0nWg3FltV08A4KoTBVRth9BrAgHqBjyExwXMAJe+CBgoavdhB9linON/iGqyYFJKnR6CndOCVLtETzvLAO30N8Pmgnh6jKxn0Fv4q6fHcwkcB7qwpBaaYg/lsHUOtLho9wysJfdHm5DYYY9jLC83Q5obLBUunrHNEqjm80m5Gen4vMTF0rOMuq9X8nG1g9eBJT3w/MrAwnk+fBvYGGqftDkzVlJHd6AMPCrBbeHx6G/CrT30EbZy21AlzP4Zn0PeSo6XOqm7O2zp34RPM4zCrKFA76e7AWYjrs8zBPR/IMt3Y9YPrr1bWbfQWDTBIk7Gzc9Dx8I/YKDWphJ3ra9s1SJgw6tM3oI8kBBEZmWzxgIw55OzcAzlKyjKH+cii30CacCHGQM56y+K1LR8z2u/PhXYddquCyhpumHADf90NbT+59EVN2d30HnqScQ+iVZdbxjxFGV+Y8l1eh/UKt757Wj3mUmVSeGuOp32G1Ke7F/QZk0Ez6D+xXjA6+qni9yNy5TUK+iCriqnV5rBg8nQsxEbgBk4S49IBVWhcFPAKhmKlKRkiaIs1+ECtqJtJ6ww8O2X3AX8LzfZ X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 20:blYLCooqmfk3MUlnA3LtSrC0gA8Q5b70HdnN014X6Hcd6fFt/A0EOO5Mzve3PZRPwGfAopGe3fwqS84BGwL4QV+fLv47Yw7wXGdIsj/PkP4WYarO2p6T12yaDHu5ZIIMa3hK1vUXFcABFumpflc/FernI3x6I9FDJlMRmCcBMRwb1cfZWsWJnnUsPyP7vP+N16vSnHfeJ7wSU4pmQHjAm+jEsLETijTO4rZKiwFSKmhjkKam9zuNk8HWbNqb+mHVPXts6hLIPqZWeAtfJTBdcxDLSqUzyy0rqNz802TCtOdFd/QPItHqoM/WFZcXVAbPiDoxrhBgXLPGXlS3idDCc6VfCPTK52JuVgpNffRp+ScptGREd1QH6JkD5sTD7EHABYMCr2Vf6+mUZ0htPxHj82n+J5iXiOZ5yfoz+5CQf+3llC0lSTML/SpjCaEFBQYZaDNlH1jC1HbRREYDPM1vWxYQBzPK8uWVp61UpA11ZT0Tskaysoa5xsq3w7tO/9XokUqahIc4a0MI7eMthdwdS6UJrQu0Hd/82sYNf4ED5bkBRrxV1drQdoT97J8SjvDXuwmeOBcKj3H/hcfVUpRdhuj8p2r6RrxhZAJRD0W8txM= 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:fV7yZrtxYlbEeHTYKpjXBznobI2wHoyRwYyn9jxOEBVpYriBVqkdUJW01mRmNg61us69H5SBin3RT+izyv65CEKl7Tndyqv+Czifx3B1qStKB+nnyeJHsx4S6F9aOK0p2Fp6kzNzs30q79I2olMX6aM1D6JAKTI4vWasJ4NVg6v88keA0RJP9WiHzZhnLRDCKsCFakGBG3QH3h9gylNOqAPnTNn3CNEXjAoRed+WYJzk7hrx7y9r1ozN+t8lYcA0TJNro4Pc39BjEGIDDZHeT+BD+869n1E2PIuE/XWkU6lohykBLkcnFH9ZzdTKxbHJVEwjfX2yOnN0/f/Wioe3kLPcloi47tkgLfT/f0Z0gRu1m3e2GMbdqKvQeNSH3/TlK2X8Q1hMwkJeSAyzyu6yFRxAYi+KCJy0OX+Iw91XrNc= 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:PWS/yoqE9eQG/0xCsd7lzLxQdbLO5GA6z0/nUEB?= =?us-ascii?Q?xgaAvJNz++99IYhQmeVkdM/Zn+7xdwehe2sBSvn1AS1KReM3ob62nW1FQoKr?= =?us-ascii?Q?1c+Di3UCxpfIYDH1Kjd+zokHF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ascii?Q?Oo2Zwj0Y68VgD+Ny4hJFqbobGzunPDNYLCxeMRwyaW1IiPArMVXKepCfOsSQ?= =?us-ascii?Q?WsrpbvATrwz3DmuohTrZk2qK2d4GkntRDvLcNN2lNWdQ06sid8AxlOj0ox4x?= =?us-ascii?Q?qu9kqltvP8o4Pu/qGHICGreZmSFW9u/gjSn+Da+aI7BeSxufKjF79YdhktvZ?= =?us-ascii?Q?jAMqRY17aISf/Zj0=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 5:ArrRYjCJg6/2x29RpaDYhQsZYzN1qIhGRURVDbDCcsqmdd/cCzx0mWB9C1KC/3W3kaJGXpE1nVWML5bsxjWgzC/rmzzxyfd6Jc80V2SqdUBm5z+tL4zRTs1MH9bBbONIlAd35Sy6xq+qXFNAtXnyOw==; 24:M23ZIW/gCGXKARjjdCMepz008BSiQOwADRPW6eSJgCK6fmmlMOqzEMFjw1Imf+nz1ZIVs0BphzJu7ZQ725pWvbj9+moKplSsBaMwTYEij7g=; 7:nyq2FsQGyoTqmBhXm5cAHNw21B4ei0jfQJN3QFdTlIJHevhfQF5n4AHuB1wifylCca629zdeTkazAELALBvqFWgDaHdKeSedR+KG5gAFq8qJq9/LHvbSTpJL9/Uatiu+zVypSSqQxlqauepyOaZj9jbdUYEnixf0Te5qAIInKosRG5zQFvQvoumERZyiG52bU8cmKDK42LCjIU4ZbDx4Pw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2016 19:07:49.0153 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v5 11/25] net/thunderx: add ethdev configure 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:54 -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 | 78 +++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 5c066e2..1814341 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -168,8 +168,86 @@ nicvf_dev_get_regs(struct rte_eth_dev *dev, struct rte_dev_reg_info *regs) return -ENOTSUP; } +static int +nicvf_dev_configure(struct rte_eth_dev *dev) +{ + struct rte_eth_conf *conf = &dev->data->dev_conf; + struct rte_eth_rxmode *rxmode = &conf->rxmode; + struct rte_eth_txmode *txmode = &conf->txmode; + struct nicvf *nic = nicvf_pmd_priv(dev); + + PMD_INIT_FUNC_TRACE(); + + if (!rte_eal_has_hugepages()) { + PMD_INIT_LOG(INFO, "Huge page is not configured"); + return -EINVAL; + } + + if (txmode->mq_mode) { + PMD_INIT_LOG(INFO, "Tx mq_mode DCB or VMDq not supported"); + return -EINVAL; + } + + if (rxmode->mq_mode != ETH_MQ_RX_NONE && + rxmode->mq_mode != ETH_MQ_RX_RSS) { + PMD_INIT_LOG(INFO, "Unsupported rx qmode %d", rxmode->mq_mode); + return -EINVAL; + } + + if (!rxmode->hw_strip_crc) { + PMD_INIT_LOG(NOTICE, "Can't disable hw crc strip"); + rxmode->hw_strip_crc = 1; + } + + if (rxmode->hw_ip_checksum) { + PMD_INIT_LOG(NOTICE, "Rxcksum not supported"); + rxmode->hw_ip_checksum = 0; + } + + if (rxmode->split_hdr_size) { + PMD_INIT_LOG(INFO, "Rxmode does not support split header"); + return -EINVAL; + } + + if (rxmode->hw_vlan_filter) { + PMD_INIT_LOG(INFO, "VLAN filter not supported"); + return -EINVAL; + } + + if (rxmode->hw_vlan_extend) { + PMD_INIT_LOG(INFO, "VLAN extended not supported"); + return -EINVAL; + } + + if (rxmode->enable_lro) { + PMD_INIT_LOG(INFO, "LRO not supported"); + return -EINVAL; + } + + if (conf->link_speeds & ETH_LINK_SPEED_FIXED) { + PMD_INIT_LOG(INFO, "Setting link speed/duplex not supported"); + return -EINVAL; + } + + if (conf->dcb_capability_en) { + PMD_INIT_LOG(INFO, "DCB enable not supported"); + return -EINVAL; + } + + if (conf->fdir_conf.mode != RTE_FDIR_MODE_NONE) { + PMD_INIT_LOG(INFO, "Flow director not supported"); + return -EINVAL; + } + + PMD_INIT_LOG(DEBUG, "Configured ethdev port%d hwcap=0x%" PRIx64, + dev->data->port_id, nicvf_hw_cap(nic)); + + return 0; +} + /* Initialize and register driver with DPDK Application */ static const struct eth_dev_ops nicvf_eth_dev_ops = { + .dev_configure = nicvf_dev_configure, .link_update = nicvf_dev_link_update, .get_reg_length = nicvf_dev_get_reg_length, .get_reg = nicvf_dev_get_regs, -- 2.5.5