From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0070.outbound.protection.outlook.com [157.56.110.70]) by dpdk.org (Postfix) with ESMTP id 881E85A9B for ; Sun, 29 May 2016 18:48:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=abT8A+5eaKPfYRdnEGXHhrC5hGtPeQwni25WOFWtZJs=; b=dyMcfQ62/lBlji4dVtYFjfKn5IgepHJa6jf+aTdS2Yj2MvRSFc/GCye3kAPhWyaGWVmS3V7GFL1UwoX8j3UofWL6HxJwfNb/GrWR8VRdsQ4R7yWmo/gIIUWuCokgXggAjb74na4UcE92U+yM0AUJM+ZI5wyV+u2NCtB20Evqtzg= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain.localdomain (122.167.187.184) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (TLS) id 15.1.506.9; Sun, 29 May 2016 16:48:24 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Sun, 29 May 2016 22:16:49 +0530 Message-ID: <1464540424-12631-6-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464540424-12631-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1462634198-2289-1-git-send-email-jerin.jacob@caviumnetworks.com> <1464540424-12631-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.187.184] X-ClientProxiedBy: BM1PR01CA0003.INDPRD01.PROD.OUTLOOK.COM (10.163.198.138) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-Office365-Filtering-Correlation-Id: 7ea19f20-a3f7-49a7-4cd1-08d387e10f59 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 2:WwmG/bxWnIs37urM3CuZnuivqsEps1pm9hSMPJxHz8osfLHWKLBg/jQxRzWfT9OezcIk9ElCR35BHqlp/BjO8CA6MAFVlPAaM8Pho/kDqJhgQvJTu9tceh8MssFDDgwUH0LGx0B3rddqdRg0UZT3zWpCfqL8ugiKvcICQ4StY3KBondSYn6Fx2ESQRRxA4O1; 3:6pIv4yMj4d8v0fHrLiukTs8zNTEyERIYnZPisgbKr59atChRoYM1PrX6kMMtdiJ8MzUG/Wr3Ml5ngmJWrKJJ0wz6NJNtIji+MtqPuT0NO5vlV65iEZCfKr6fy8eK/CwE; 25:ccV4pIChBW7amh7qPKtwEW3Y4I9hm9rQEmGLQy7RLD9w8622bC283FtyrxJMpMCQlSIWeenl2DQH8Tg/6/BclJC3Jw09nhk1CtdHFN42EDoUZTGedTdlH19nHyOorb1k1eJl8fb3ln3wjN2U/Ywow4YWy1BgrD9qzX8IYb/kzcoD9P/tg5bERlaM5iGZpQsU6PcpPTknkSR1mkOoIcxP3KcFsbi8LFnHny4lSG/7CE2wV/KQD1nq/O5Um1BVAU5Q/hjezVNx56Rw7Ww2KEt+P+yHdhSGiEuuyzs9AhF6bG26R5o1I549ix5r/gJZe/7fCZ+GBcq3hpHrCgeMVpBanER+Gdw1yDRZp0PKzequrrnV9rPO3whzQU0JPFGAcU46iajDNwPi8aMNaqVqTa/Ilg6MlXlP93HkNoCQlKgYNEw= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 20:f/4x6JqWcM9r6Rh+ApWmWN7/WAZbUw+uDVB3fNIxmJKq7+3ZEfxsaxGWm68YsjlKtMY7ggRAEHssrtfsGlktU6Yn9O+t9MtuSC8zdFeurGzHHbbK7Eytm98yzIHZCnenuDQuGXHrfwq4uhWuVDlR8RNHW8WB79O3ec+2qa78olIyjU8kG950PYtCBU8OdQEK4/2v8TY0VPku8JiEIRcCckKokrilkmlcEfrAkFfak83h9LXibV9klUiwHNSYlNNM9qL1xqAd89abYq9raQ63E9Ic3wVQOH6qNxw0hEugHonS2Pf55K2hGUU0VxVIkjCZFiNe3mKRuXlB2cm/9jrmD/OB1H2F9VSZLifVOt08HTGOIjynt0bpUfavGFLjAv9hiOsK51uJvG2sC1vXoBjctHZQI6ZpSr8/Hhi0OQyJrpRkbbobKRH3D/Tn0oju9Gv1nKYlpLq9xuQ/wmIGjiURD8QIjgZMEVgb2gpu7wOH83KRfprKFG2+IFJncS0u3YHt8qp5W+8EqfqZJbaJTsle7wB701kDpTSKkCYTuJE0n98qgrQVPbXV6NaHVX9zPdX9KKiBU/NFlJzUm4GRqzkvmMEcmuVk1u9gePr/4p6YZss= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 4:hNkoJu/Ecqq2HuRL5bKGslh29187Hn0u8VRwIObPsJ0qHhiow/l6i/ZekB2177GfQpjDeJjqfyOoGa7Vll9dqpmzseKvRmWyLEj77/519wG2ZU+WbGs+BEYYEtwSgSws7w92mMQmWT9e10B57WoGvB15RfzL/kh+MPfcsrZHjCtrp0ChJJEpl9qvIBo63+bNYNRkLkrxv3azJuFI11Q38Epj7r+GcinI7jrhaR1CRrDq+yCHUzIx8jijRFZTFu1tltNgd5e34/N+duz3rAXfO9j1jQfZQVBQmU5WaqkBstRPuGORemTWLPXfYKBjvHtVXQwYCzn4w2mJKb98qQ4bY7e1lNeaoQTW5P9Z7FWZpwq/MLkx9sZ4KQhWH3+6JsNZ X-Forefront-PRVS: 0957AD37A0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(4326007)(92566002)(189998001)(2351001)(81166006)(33646002)(76176999)(229853001)(2950100001)(50986999)(19580405001)(19580395003)(36756003)(50466002)(110136002)(8676002)(2906002)(586003)(3846002)(77096005)(5004730100002)(5003940100001)(50226002)(66066001)(47776003)(48376002)(42186005)(5008740100001)(6116002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 23:ku8bx9Iuj4pOkwrzUZg3zzHUpjVq/cu9bTLccLH6sQSrJi2wto1QYxOB446jWxas00a/JiTaWPNNy4y7Rzm94UAiBaRvgo332G1sPfpOtM/LdUq4nmbb75uhwAdhT9xmUdEMKKyg654RtkFj37D370gsBT9YEPr5/EtOshJwefzbj8MTQwlwY2etTaD/+OwTXMWdvcL4SIze2VHA0nP+ZpWzkkojbEOE5GI1rTv9d/hrXAkm4FL0PqqLFy5TSSgDSFxI2Vq14Ve23EtkU1Dq6U7ych6Juwy5Ms4uJKpbOPaEauaEgdUgt9TA8Uy4lp0e2K/3lwXQjirj7HdA+58IChPpMp0hXbMs6Yiep6okI2CDgR/4nE6GYNhhmWkMVZ8v9AGXkwc1EBvOMj/0clVG5Enu5Eza1KNtKGkUQox17kMmikKShEAx9bXxBjEPn3iNfzWj+RXfMM30U6G+PjJoveBFKSO+ddj7ZiBBT7UzC+i4vV4EJ1QDfFPjLv8xLemBQfEvMwFCu6tJhJH8Hs63hj+8EU+JGPJ+3Hlq5F/fLtJ3NN+FGSzOeWNKNSSlyViCjKWxMk8lA2UUNF5rTbB8vuyV0YwiJfekZOPezeX1UXFIShP7rrjWR9VDw0ecj8Y4jLI+NZvR3BkU0RvgtcvGZWtS2rg6UOdJEakUQAmmBlmGS8PARNJDKVMbi6UwU3K71W7urdzS0bdYMTIpXfC0ayGxwuwouMA41EuMPgf7KDbDndpqrFiU8vCbWmvuHA7vGersQ9dyIL3RwvcegiZQVCdNr0YXbglCWPHYISpFw9iy1sdhFrCdvG5HKfWovme7x0LYabaMZ4xp9sMM7GBZ+al/2/zZstAWZTMRLteCLiOfCxyO3gPdMp5NwCvd3QOx X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 5:/mZwik7V8A+ouKaEejMYTzj51omeYRIaGyAcFEOVR2deN2lKp8bbUjxyMICWNEU2m0g6WigWwlL2v6dFcbE9WQeNYnCjxDyxMFrK9WEdkE0xtW0UumCj8XiW9b/AFQXLq2cTkADJQw3P1c8kQi/A4Q==; 24:ZoPIdpIwJiifY2WOVaFuCcVSaJnYGSGbHU4p9zWMAw6LSAkM+BzDWGkn1vGSc7rHFqpDdGnV0ys/srr/gWE0lZnrWK09pkjP8Egt7gI3PwQ=; 7:gbfuu6C5LB1xPRhBEj/uVPWhNQEVdPQKbwjtmanytMpXYrdt9GtysTpBz0WQBx1OQpXG3M2yiFgfj13SseFuJ9yDCyspsRV7W63f+Z7pmRfogyvh14kVGZe106TBXcAzvlt8dGyDO/D65/fdrH1908dpk5LymaRTpiAF3zQM9CahVP3AqJjmcm1r2e3N6VMQ SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2016 16:48:24.8647 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: [dpdk-dev] [PATCH v2 05/20] thunderx/nicvf: 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: Sun, 29 May 2016 16:48:30 -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 | 79 +++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 96ab1b6..887cf8e 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -69,6 +69,7 @@ #include "nicvf_logs.h" +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 int nicvf_dev_get_reg_length(struct rte_eth_dev *dev); static int nicvf_dev_get_regs(struct rte_eth_dev *dev, @@ -195,8 +196,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