From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0070.outbound.protection.outlook.com [207.46.100.70]) by dpdk.org (Postfix) with ESMTP id 3899C567B for ; Mon, 13 Jun 2016 15:56:59 +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=A3BQV4ntVSH1hsDpEL1mWKT4zTn0zqfKdb5z9JgeJvu+2ZqHHVeA3rzUO0Etk7duMw86NP3wlei/ojHwRT7SGn0vKBbAyroqb+fdoZfXgIH33b70kgoo33fdbei7ikHoHECs2pSP301mFUc3xzEeDUb00vyb532NkoG06GbpqRA= 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:53 +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:29 +0530 Message-ID: <1465826143-22159-6-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: b068f602-8272-4b69-2dcd-08d3939295ce X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 2:VFpBNjqAKdPGNQC9RLN+n3Q85u8wglxCrY0i8U9ooumDjelEp6w+6b2ZLtex1Ibke71DL1quCj102mfKyS1Oln8a9M6NmUo4s9lBSjvzzr/21uUdImgsFkmpCBjqxMhCrbc7P8pOwOymAPhXhiAqTQJAP1gG68cdDGEGGDvU440kOBRrc+zsDkeMoCLhFzMi; 3:ZyKgPxFC6ta0UJ2/ZlD70jO2kMpIoerPDvK8ov4LdYaA6+HrHpqhuOSrekrjMcx1P5CL6jgGTNe13BuxICm12Z2pNtgleOMw5Ku3BN37sGrb/2DfG90KFz6ic/mKMYLb X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 25:toWxkZDQ9aPwvpKDwlD0/xyKIOG110+d96NMyYu6yXqSCw9cME4W67ggpVBiwy7jMv/UtpfSbw4UEoq8BbDIedI9rxoGUBCalDCoKXA7d7/8f36KQHDctoMLEEFBIFieDleNPduEypm4xP5OtDyWMjnmZp9nN4+pbxz090yl+Cv0Rzbr3DJIBIKrltkAafov+5Gg9FEaEUs6B5f1ES57cMHPOwSyC3k8CFvsRlXOpez2bWtjEdmv29QCa7FINWjzxwF+m/2a0ihJG+R3z5cxKFffRTkFyfw52C0qXIfonaMyix2HZujBCjtiCYTDpfA+7UTSJwrBBeC5lNprdRLt9wOR59SBoLPonYbuJdSjPai4aDPP84S9AroUSUgLIFFIgCyp53qSSgD1dxl1yi3UKWbZim4FMbubwyI+uK18I2g6nGVlxNgePlVEqL8wiExexoGBfCvgba3IPgnRKZzFMUHF4f1X2anadmVIfOr1rbMnxn2cnPJ5KChJ4nM1XoLF8xSW2lXV3GYK+hjEwCTcEWlEdP/ZCf0459MRxLciYKWst9cN5Arv2Nzt8tkl21QtuwaQMD5M1V/EgfZvhWnCwmVtPd014xGglTjdxq9RROnAm2OHO3lbfhXfJE9a6GOXIEseQAlae9QWq0X3XdgvFygR59Uz086Je96WgIQ+Hj9ArDZOctJLsuC2PkJXnWj15Q80V0cvM1gSUAPdua0nqEUzBBpJxYukhN5r1IEHHHegx0EyQRn/NTegze+Rjaod X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 20:sZYNyyH1j2MbImXq385iuPi51nATKSje3cEQ5Qgzw/fSA7efLVewOEgiS4bBlqvMtKMB54ouaa0r3OLRNDFqebg2MJ2CZNBmfjGqu1Z5J5WygEYccJ+Q5vLSrTFpGeUibvxHuHhDYqTBRQhfqOLG7Vc09GGbxe9xXwVu6wxv6XItiH0mrxZrpovOe+sog6NDA1x6exZu1pzp6J1iRkNB7olwK2M1xKb5zgamFwZdr3yJ6MO8FMIciCCxNjBLIT1X4vAC0NIroPtxpAamZgo74zPpSGoiWY3IIBOHkYdc3lzj9buFHdgIBwjDV9PK70FmKqH6Wfc8HTEVxnEoPl8tFPdfgZMuDc69AUa8xyyUBFQ+4IbiIXmMCi2vO+N6pJgZ8PQ7rZwrSGwtuIDMkLkuI8Jcv3pOn//t2sE30JCdzWgW6bupWoPboLbe3/JlH8UAEKn/xCr8H1OO690BwSXYHTM3dVTS2hIKWymbATmIk+G3R8rPU2EKJahjByIZoJzYPls3KQOnZbjbmpYPS1rplFGzrn48LYUZtSlSz8KCSVNtcHluNNR7PZOHCdS2PYxf/UzbwnAFqe4MHAubwfiefM+5S0BHc3DwFtCFk7po6uw= 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:Z6qJVGKQL5UcdXGlmwZ/zE77Iw7b/ZMJ6rtGeX05jqfinSTEh9ziKY7viteYLDGA9ILJOvM0heC750fU6zn1wZ9yObnQf2Kfv4zmwNGaMFk/Hm1wRGxyzUxm1r+sTYtv1zO7xNNwes7zXVBAffXhw1Vvk5q9t4Z00Biq0BzdvdzEBXRzt2EMIJD0W1BUCqs1Q6j7zjYhs8Tlc0bdKvSduL1jTSGcKWYHImylqzjBfg3fihI8J8pvealGgQ2pToO6rbFen0rVMfva6jzrKXfWMhwvG1EtvLeGYF6Fvxqcv7DLm7a1oN5gH7UaB7KUDxs5aVrHJROnLHAUsqjNMKbex7XN/unhTLiY27DbBYJhTw8nPGR8BY78gWOPOY3PM7zxU8P25FS9qS2RehnenwTuDClxKNK/n8gpANvHLp6dc+A= 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:UYdoaXhE26mw4AcX/Iqmqm/S2NyWJTFI/H9py7z?= =?us-ascii?Q?oFT55ie6+p5DMytfgs1rCac0Xba7AqqKeEBH3aPgbhZNA8FJfLcckq/y81S5?= =?us-ascii?Q?irDOMaMeZttywkw+o/RMxQASMtn8enxdGHGPEF5kS6LqI8wRp8xWCNJwSBW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7qEY5ljyehYap1K9k77SNrmy9IULnD1RaijNqiQHo?= =?us-ascii?Q?E2EN8BjooujUvM5RTXE0V3ZJxBTlh?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 6:CMYOzbheiLZoSc3orZuFCcDe35LplpLXR0mOp2TjDnILeKvUCnJHW2QxR+9fsMpxKP3IBG8Scc7IDZOKr7mhXXkZAqu4qqfkDvHdxSdrKQVC1deeTqIqTgBkcstmJyLDBoQmRo1p+3MvwF7eTABX0aF6MY0b+43h12YbcRwwO+8kZtMo+rZUzp/NEPezJcUF3mJjYvLrrjv0C1lGZ+sZlAN5oCk+jXll6+aIoX8kdxwlkX1giMy8vPnS2ww5sSQ33+r9+szXJqUuZDfkVpX8t26Szzk2v5A8U23Pnf5ncZM=; 5:DV4dAYc4J1HgplfGwcWjspdD5HG3dtxpiHPTqyZjW4FhEg0pO+wHr8ADgQPSLxScbYuCVtC0OiIR2YD7xlQsVtmLkVNg7yR2k3/kDmyrhtxgrnIW6lNyVN20QL2gL0OtfzgQZaRqxDVbz9d7ayDteA==; 24:kqpvLGwt7TXA03xkC0y4iMes0RslHiQ52nW+L7esfqT60Mx7yoM8LfK5Z6otv1aZH/UdpIGpJR+seguoZaPz4PE9KXCQ5dH4k9NiTQ0oZWw=; 7:BuLTFq6eefVlX8yBZW9/8CBb2eNDtOkQbg2rHp/0PQe1YnhgKcw6q8DLHcLquesFDuwIEF4f1ww/4W0j6q9e/jN5pLVaIuO3FAWfhxNj5lqS+opmeWtyjzVqDu+x9pWBpx+ti9DHy1VFPe/NDwCHsKB2va1hlMkYSPw8IzJYgcwVSAI9PglBv8Tkj6b76cW9FFyuh/K+RP2LLqtqkBTFICWpk0LTRpB9aZrbjXKuFO4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2016 13:56:53.8425 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1717 Subject: [dpdk-dev] [PATCH v4 05/19] net/thunderx: add dev_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: Mon, 13 Jun 2016 13:57:00 -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