From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0081.outbound.protection.outlook.com [157.56.111.81]) by dpdk.org (Postfix) with ESMTP id 4F18B9AC7 for ; Tue, 7 Jun 2016 18:41:39 +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=kShctA7ivWilvCbbZr0e6HdOHZA6+5MTLw5DEF//lCw=; b=Sdaz0OLv8P57VsfCTMd0NhjvERYxwQ/bu1xUGjv0TciHol1sZ3F+jJNBMBew5HuKJ0yCyY4c6J0qQofVBEci5pqQB+iOu8WiF1jRMoF6q96librR0V22nvdsrsQkj22xj6XdKrkEadc4GcDsNXSH7QZFcWDVqJsifIW5DqJ3oNA= 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:35 +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:17 +0530 Message-ID: <1465317632-11471-6-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: 57754f09-b0ab-46fc-934c-08d38ef29873 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 2:xyhVQtDntGhBLWXlzZepvtraWD1q+qjZJsT8kkk++hA0n+3k6J9s5VhcGVOQMP9GWjmQTC8n6YY5+aHq9RlzlHBZVHdSJ1Re1TCYhxAFOawvjEYkeJXKZVxbeBnRqvDnS1I9W6fOsr25p02F6jBrlGCVPaxATVEl9Ho+gru3cid+4H9HnmsMKMg+PVuXrSHR; 3:rV8BbkkVUdO3XLuvb0HvDmw+mE2CmTVtXPWdwghoUM2CV7OkDu7Ur8k9r3wQXAU4hBgI/ajv9wF2rsfQOAMxMXTg3lZTPAE5WpoD9OGowGhImmftSG8bny35xHSA6VNV X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 25:LfEGHijQ1ujk9NAKOxp3R4CDvVZoG1NLjIrSSGUhcOSrrMWDTIyK7YeioyfESqExpFqdxMJCwEky64G4tYwlhocnWO9LSCif5KiJrkxXJxkfJe5xpysRRaB+/+NMucaGUfLAdVyTZXLH6jWK/bDA4lEUrRGKGQ4kj3wKGInrBT9Xd+QMEZl4gjpmeJ6tj4L3IDfYivCYLCzbvJYLb6X506KJtWGJxUTdMSLeO5z06e2WNB39Q9u6gQmmT6HiWUKkd+Y513UTeTfZH5aZL3lIWzoNdo7M2Riv2Cki+gu2SMnbnZ4cUVbDXR9k/ZTLqOdAGUsBWrwFIPmUtbB2wERJZMt2YiHjkqdm3G0Qxwl3XiHdgZAqdHriXm/aOhzhDsiNm/Ke3sM/jDCiNvffVmVCVwXqHIMFxK2q71YAaAMkr9uHMTlVMNSDSdBjGGoLwc01/ZET+g9+V5T9G5Pl19JwkWwa/nswQS4E/D54nAE4ERRX/Ig0z30OYybaNzzhqPLS7nPNFfrDq6y1O86vUj5W1KPFAI7nVl6pWc2g6G3S3x9LeBJCxCNgkl784S5nCRkYy943mpcst506cEcIPva24m54YyLM83PtbvRzLIF7IzL7NqXSV2k4gqbhIlltIYw8gvdATDpBqVQWsSSHxb5a5olcL+T31RRGMolXDE8Ea4OC4ljLFjScEpqSi32y/SSbwbpothKC5OpP6fo0R9NeLvVnfi4t8ie/husg/6Xeiek= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 20:OFk+mZ9gGZzyDFSc5qiLn2vTjttUae0hb7xob2uvGqCtILoceOafBWvlyoarx+td/AG5HeobSj8BnpGBhcSz4NY4gRiOgbpqOxQqEKIxs0D8QSqdqYZ7MQYYInpXjd58DOwHDaD3ExFK3x9ULBc+7+noER2tKhBxxI6760YH8l2vApA9WUuTOjZ7UV9UlK/Wc1xa6gb0nSHh9VwxTuqad44Enp+KM6AimXhD/i/TAYT9egsFEydMQIkLuLjJdQL+OUpNNZ14lnXqaRUJS0J31KE8rnrcYEeeQQRgApa5ysgZOVc34PrHVDRz0q5UZ9jree6t/+6HDjqN72uUvIKc2ArvF1c8HTOBcF03FJms0ht7gxMTq4XrP0rwYJM/FKV6Yc3bqzm3tJ/f3lxb2Y3GLEGwNwLICBZLU3dHo1sEX0ktKBodMyrwNk4KVkK+yMPvuDdBPFSDlFTf2vEnn6oIfr85z646kBV7Of439sS61lxLKEP/vsM4l9xnqWJr1mh4pV4kMhQ2CPv5saLgTkXGTMl/c5BjvjYK/eyaSMWC4llTPyXNXWxC+ICx5yaqKwyn3HtGanXA2x7+7S4wY9a+vpvNv+BWJTyySfKTmtKnJe4= 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:w9YANdm92QTkXwEUnOCS4Y+w4sPDxpIACPV5/JSmwjsBZvFBYLrjFe+Ns9EqfJAxDTdRTrDxr471rZboxK7iflbidJPvckxRwF2y4vy3Bz+OFgoSXjrCWZ+s/O3wHEGtOOJj9dN+ZJbQ/0zMDOH5alAL0KcF/3pDf4f6MzojKrg6vPbGker3pqzwfhk/xwpZsE1RD8KdK7gFg5/c1iaQixAn7GHk0jkukA5uLYYL3y5T2zCutnHx9kExmquIRsK+rnYZwCpkt7prODScfi/LdaIR1nodOrUl+tw0DCDPyb8vNUf+CrWH10RyuJmGgwacHqVp/mCY2m45Brj8qnJo2aPGrqnH+bK/NVLZEQ2e1kOK+ZonWnADa4WHZ9ALQEF1 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:VZ4FetG0/TXbN+Oow6dD6d+2HIzN5lfTmZYx8vY?= =?us-ascii?Q?6e9BLM79EH/c9QngveINiCduBBGhvAMaqFHP7WFAfuU+6j1Sedw3K+u2/y68?= =?us-ascii?Q?7B/qu0XRx4GIAKagRKms1vnQP7WHY+IAD58ogKX3SBIfDSD/tXvDz1flVZGp?= =?us-ascii?Q?jPLbAoPy+gaH7H/3Mxf9Onx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kaKVkG3hZz8z8SPNLPxZa72/s/JpY2Z+DSHCSw9wLXCcfmRmDFWonbdFvj?= =?us-ascii?Q?hSlDV8rn0a4Uz6gCgNQEoX4y8m07LelI4+3Mh6UACGsJfSjp2euJ59w=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 5:LTcVxaopFfMXXuJqe6T/Bi7tHIAeftbSBj8mo2wHnmQrd2oGoxhXpPLqLsNrS2/dCUoNIZOmesHCASC2MliplNn6Bvl2Mlgv6gd3NfYPu7afdJVzTMSALuqhFoSzHSaEM1l6b+FqVL6ooS1KaYJbyw==; 24:nFI3BZE5Ar1sTyHLNWO+8GLuTgtg7WT97KePhornT2mbYzCg43sULO7uPBi5L1+eJykX0tF3EF4xmz8ZGbDPokezEh0WCV8xdeAw3adAG2I=; 7:uEvg+iTS6H2XDQ2DZeWDDDYBScH9ohZ/86QX3DnILxkSq3wOZ96Z3vdMcYe2J40UO0kD5xBTghMcP7/xVK0BWHr+nx8Vvwbd4diIZgAJSAogyIEdIXfuKBOx9+gBIc103bGvSVH1GaDC4imV2FC2JBeqt7mZNqw1VZFeXTOUSqa6N0YS8uGF5gAe5DgrAEsnET90A3p8ZwDEzy33xiOfhddCGgnbkArAInmY56t0wik= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2016 16:41:35.1702 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH v3 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: Tue, 07 Jun 2016 16:41:39 -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 34b4735..37cc7f4 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, @@ -173,8 +174,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