From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-eopbgr680051.outbound.protection.outlook.com [40.107.68.51]) by dpdk.org (Postfix) with ESMTP id 2DEB65A66 for ; Sat, 7 May 2016 17:18:05 +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=WyNWWJNjWBa6ork838Qvv+81NqoiUPfnSd4PAq8osxk=; b=XUnc6vQSOthXxmcbrajmQzcURY/pqYJh58diApU9LuIsAZui7P9bwhr2bOWe+A8u36WgLdVB6KGRIEOiLAoC4l/voJSD1Fwi70pcwk31m3bYxQq6fr48oWV2ei7aZLlqW/e0cprJ0jMVkOHjo2HiujsDCYqpxd/BCA2hEdtvh/Q= 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.10.92) by BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) with Microsoft SMTP Server (TLS) id 15.1.492.11; Sat, 7 May 2016 15:17:59 +0000 From: Jerin Jacob To: CC: , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Sat, 7 May 2016 20:46:23 +0530 Message-ID: <1462634198-2289-6-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1462634198-2289-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1462634198-2289-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.10.92] X-ClientProxiedBy: PN1PR01CA0050.INDPRD01.PROD.OUTLOOK.COM (10.164.136.150) To BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) X-MS-Office365-Filtering-Correlation-Id: f0fcc822-c980-4249-01c4-08d3768ac8fb X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 2:L8S1F5J4i/u0PxY16ujf3HXqMuQBb2387SWYUXTFB2TZxndH4NceL4vi5tJcJyhykEoIv824i9v5y7RFrWvVxT3d4Doep78JOWQuJ2V/D44IDhoN+ZiPwSxOdtHPYCOkbGPBcdVmjmJBHgsIF36ayqCNeuEXL9GEd31LIX3l5kMLnOJZ84sB/uiwVEuwUf0r; 3:G+11qcWUwfiFu/s4KgJBbKNW/5wmq3HEMOTBvj5v/HYOKOOQZdjfWn20s56dqMqQIvfcqq7/fcqeL5l7U6CT0tIJeAGPmFcZ/p75FDeeoRKwNjV/8rNKrsl6QMmyZwTH X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 25:aRRdJPREgq1fRxvy3NeLzEYCm/TBx1yOqmGDbIOdZOvP7BnVMfMTbcp/9534itM/KhBOIgzmhUTIgwcT1fgSb8N1cb8arTN/9w1k6JWFStIEfw1gBQovz5wdf6DqyX2q/3zeHxxCElLE9Cfm0T9JFhAMC9uMOgm6jnChGZnrgVT9MeThqF29W8mLuwwblOc6YZfIgqzasO4CdaNkjfL52/T9Ugg7VIq5Xzfs3kqIw7nNQBLrorPLBP0zbBc3qfi1Uy0XdPlVnsMG5iOIxHyym43vZitx3lTI/aZrIyDNLU/kSGYggOlJVIND+K+Jcli7sU1aS1+NK/8H2zUe4OmQcOwiFs+YC9YiCPHLS1wKmCh/gkq+wqGxx6O3rG5yqqb/Jr9YJOMnKR2osE5Zx1xaqQuCKlIvapQDW6mGsbUtHXVm+Qtw9gNJxyfKhRc0yxdKWBD25NmHpXW/kuEYd6adHQSuUTjVJtLXSlL4mctf0Htvsocl8wb8f8JcwgI5Pf/yYLlTC9UHcr2ohTcCRmUyrtL+3DOK3LHSAbMRdgKm5HP9bnKACzYwmQtHurnSxhB7mAsY9ax270YLh9slaZRGFKUtHoxuhuxhPYEMBSCPe2nb73FSm6+DJfPMNI5JofuIxX3AvkzobsmqHDp1F8jgDpQLAlmXINdIOyiXBiX2392ODimGl7cSbisizdMpz2lo+AiaL9wfa+m5JJ56rwONEw8cz4e8UwyLD35l1U2iMeg= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 20:gOqXjEj32t0YRuSUZ6VQ75plBxtTttG3Jwq280JH9BhTdb6+t/jfZp3mO2eEfe3//fkLAk9981d/hjhatVpC7kwIjIi3fXGkeifqHvOcY8wlMXYcQM8DQgq2BKWjy12tsK0L3rkmlsfw+HyzdHaLRJomoStUIa6WsndaUySU8Ou0nGjFBUNZsfAzex6glxtYSbqcBJQMDlaOdhhf9V17t8bzbCTL3kGsz3b019D2J8e7K+1OYnjiXIngdL1HsFTSZWX2XNfprOAo/h+6S4I7XFaahLERyOKC6WwP0/J2O+THBdBSLgMg3Az8bjNMoD82U3tocI9miZciBmrugNuBP3ECbMnCIy6mbf5pYPpM2pn4VAPjUf0zpxQVJNABe38dS63nWCR4I5gfSlT4xtIZmKfxCr3Xt1NGkl0i+87RQ8oRlfU4bRgxMS4apare621J4TySZMQcW5rlStqF/joTYBwAYy5dDutPMvZyxPHm9FrSQtIIxf2F86uds96OO+2O6HxGTWFQ3jVh4t+fXUF+/ld0MReTkuxnVAuy/bDX7ob85+JK9XAMh6wWtuATeM4pM/KhpibLm0qIOod/wEyx3XsaK8kFXqHJzbsKF21No7U= 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)(3002001)(10201501046); SRVR:BN3PR0701MB1718; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 4:3zoQtiTi6AFfqkq/gY8/ZVENvWweutQGwP8wWayOjIIq9RFFvgeSemv1sZRj795AtApAHLLsUT1lulRDUOZyrkth699bN+OCHHslVZM4k+DM+qJfPhNMXGwk8b4pGTteNH/DeF1FSTTRK4dt523mTC7gdF8DEDyZmpdeVu3gkcSPEX1HheA55GTCsAdNOdYV7ixfQsXO+331ppyHBW4UwaTR2aRl2AAsgvsb0ooBT49X33gLICebzEJiifKTe0Sjr50JcKAXc0qGyPIkhnFIghrQGw2bS/SS5nmSAtTCxnu4eKJ+GXlVmiuFQKaltKbWr2vROikg1uVB3rg8lVji3ZWgKk/CaVehLcZarGcwFRMR+obbOabB7/yRDywHtrmd X-Forefront-PRVS: 09352FD734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(50226002)(77096005)(2950100001)(48376002)(81166005)(50466002)(66066001)(47776003)(92566002)(5003940100001)(4326007)(2906002)(110136002)(50986999)(2351001)(33646002)(586003)(3846002)(6116002)(229853001)(5004730100002)(76176999)(19580395003)(19580405001)(189998001)(5008740100001)(42186005)(36756003)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1718; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 23:Hpv4AVr13/hzWaKuec3+HRodGYIWslNWOXO40W77mpniRKnYCvq1vqYNgC/q5UGbe8bB8w94h275kz+Kubd0yoeWwAevb2LyLB8c1QbgYOV2/TyqjQYugTHBhTPuyRJJ6V/jzLVJ/bM7ohD9VwAh4mNAAkbt5RbetT6APQZJtFo1jWA3cbLxw81Or8zf7WHdAIdVPxov+CXixoYmTpwsq2NGi7ELSpn0PcxJRWQev8Jq7Js72W+YUaWFmJE9TBgEbfEweCykzX2owiNBSz64FobnIlFzgrvPhbYkyKaQ0XuQ8EH8FFXfQxgayxJM4YZk7lNNjbgK6WXN3qf3ULVTMdjLzhpwROv3tWDe4u8dtnVuxfdCxUUkalxjsa8ScSHOr1+ftVqnd0xjUjEWX4Rd7GBDEhrh1D+mSVEPE7SX3hXpJu9Aif1WMjUpO5INrlmA4y0BYoxH/XfBfQlRdi1BX54sd0JrN6A24kcCPDFzLD7McU1FEjFlmhoIP/4qEwZGwzaxUl9/Qq5K3fc6LUAtimTi/6k0rJVWhb2yw4xTaXF52ffzq3hwsujEAMjKKeuVmzyD18tfjc+rFCosm89WreXJN1+1DSUR6SQwL2Xl9nYV20WU7wZeqqa835wPHO5i35lexi11fEhLVB8y7clx5+C3glMyGoq+VdxhsSQQ9+7eXOsC8oxfS36jntXzeTfia/8wqwCpyyb7r11tuRYdtm/Zli4V/4z2pB18Q8hPAk7J0YY7kgvshOoAWOE8BOXqJH0aEPZbs+tWJBu3dK+9LHk3mJ7CUThiivj4nUB7m9hA2NyQLvXktyLlj6ftcREl5dr1U3gIOcEmTXfFdE3qaZqXQwGMxbZECQ7HO0Jw0JHl/pJVp5muVIvxPNntHwfI X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 5:5fHj/XiM7arSRX+PVaw/ClI+htu/NR/q4OtlR2eFmSU6CEVv/xWXvmxf2160VGNmj8lg0P6dack6QUL00sVNH+PhTGeiRSdO6DpkA2pYBsIsGwnfVmTk/w4EUkQkC7o0f0oQKutPxpFsfsuNnspwtQ==; 24:byxCa7ocV1V1JES7nAkIR+M4eUj4tqneARYeNYSC74JLycA0BvhR/5XVd1jKxN8zbIBl0Jk2hy1PORaXBYVmlob8+GTAtoYmKPhCgaRidWw=; 7:6ulhSVw2udb4BIAzZP6sqPzgFSV3IhvvvZb1sO9W9+dE2zhGK0m6K9aYBKR4I2JjERSkdGN7CCpwOPpx9+aXauMTfjCAdbu3npw1mFem6bxNe6AHPJTdQLdtlAu87c9gC6lseOfxGfNmCTZUQCyuDr0TAYmCrRGFfowdR8HH5YyPqS3X7elqTJPwQ41aCPQD SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2016 15:17:59.4921 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1718 Subject: [dpdk-dev] [PATCH 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: Sat, 07 May 2016 15:18:06 -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 92b08a5..6a153e7 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; +} + /* Initialise 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.1.0