From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0043.outbound.protection.outlook.com [104.47.36.43]) by dpdk.org (Postfix) with ESMTP id 90F52D466 for ; Sat, 25 Mar 2017 07:28:46 +0100 (CET) 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=l32E2No4om86KsG714YiExT3tsG4YZkYHlE/gTCovGA=; b=nQl0EvgLvYZ+pNgZ78g9UjZSePKuM99MNoEzrXQ2fAaJDLrU5rWC7kY5YUkGJEjKg3UAm4xaejd3j4GO4coIpBfmLHrXUSNj07VdcADVqTS6j5u3CehouEpGVtMr9db/jGr0+rxeo46Q54iasBklGGxtIRpXlsTcJ6YLrMWY3oA= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Sat, 25 Mar 2017 06:28:42 +0000 From: Shijith Thotton To: Ferruh Yigit Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Sat, 25 Mar 2017 11:54:47 +0530 Message-Id: <1490423097-6797-37-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0117.INDPRD01.PROD.OUTLOOK.COM (10.174.208.33) To CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) X-MS-Office365-Filtering-Correlation-Id: 6135f45e-f3ea-4a09-9851-08d473483025 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:CCJmsEQuesWBtBcwXFGIHTWNNn7JMhR7VzvHPQLCsIc7BAQ8cXOvKSrnin/pIRdPwnzHEhidFmZn6qMSNVkOFeAT5X+J7fGHuxYgUl5DgIownBe7suEuLURQoHT1D/aVEwS2ldNf6MvBHTEE5cVM4HhnNIhBIeVkwzxHG57hCJ5iIC1BkWArYJfdPocSQaXlRPu1b5osQCZmXEJJGZWgjQMRweyeCdz6zxp4E2dt1jnaY056TW46MO3mn7j9y+xrW1SYYttDeqz4XQSApRIzTg==; 25:0ZjovIUwGBQJJNE6p041zDdnXNa4OR4Ar810r6174xARyBi73vfZxDLSlJRH3cMaXq0n7tluKPQDAXAfi00B3xc2x4wKDNYyKFYhTygYs3WgjrR3kvEJVdbPdXwRVFlEpr/bLRVrOqI3Y1xh0WbTKfcNiXYR1oK5yueGuVXfmZZQ+5xUkl7otv3eTAciluNovjRxwA22hq6ugaw2C4qomCmJsS5H3kmkcE1RXC7ucKgMZt356sCLvzoiQJJMghKy60cWcti7BgRJXvKzjQvMt7zQiqgEDh5NywqoBRGDycV5nwdfqJe1DNUx+sLoItS56MUqH0vpVwchuZHHOZotq83FhwLa9SnjcFs7jcm86N1XEirCuudUM6CsAUpqpl9PVm+W8xNuoSbGoajSIV8jOJJdu/Bmaapzm1MIKKYaEDzzVrdl/5Se0PSAT5KC/1Y+D7Rbbjt+pujEOFRTdO6RPw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:cuJUABoYBwRMG9YVR6pj0tEwyr4IzeMIQd/Gc36RUYZOdvkqzzUnsnYAts5HXxQkBNBspKIobwrG9AtqIGfiq8K977k3s0xgI22K+9tDofcwgn4F4zN17cdRikdFSwojwvsDvUpX3PvJJfMSTuAxfwAhIhUrn2RMvZcapGgpoU9pbhxKtK/kncO7E/+D/BT9Wuo3OMArQRC7o0k3glHQESKKYT+RFpsnjpvHPxpxEvw=; 20:6p80Dg3cqbCt2SV5lW+TMwnVP1JuurU+f4/M1/qvUMwb0yya7QzB2iL3LJGmlLwNpe2tOYskq2sb9OfXZ257I9yY/+PI4Oos3NpGOaqPQmAgq3CX7JX34yhoIZvebDMfAox23y2eYMI9uZr1d7kkSrwlfrlkcvlIdm7hI82etVlKWWeFcdKOffOr2EZzjvJh99uLYACLc1SdnZualGg4Ei5VMs+Xj9CA14kJmZK15gEuQc0kTjXaT1uyrU9hho2ez+uB6VD5m+Q/juRfUv8DE2ta+VYbiR8ZrgD9YEeeAfslIMMrCuAaEpYH+Z3fJlFT2/zlzvX//JxpzTLpnkysvKZlr+wP9mZNGaKKcDhdEI5l08Ly0DGiWXGE9M41dJTaVDZPDgV48Ph/32j7eZB67ZKn6M9ciJbkzYKeJAXiChaeizsiKkLqrQi64ARa2jihwqdC9Ely8S6jNe9m/Xj6CKo+SYRncURhMtr0WHavaxaK8cMoL39ja/6cxqrlHh2nQHWH3xQ906liMuJdMGxbk5kGTeucyC/qfyMa0M6mqLJBdHhCB8WLyVoBzcBVEYJymheUEL2i9E6sNdZdU0LI1nXzC/4IOdXqO+N7RAGQQlI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123558025)(20161123555025)(6072148); SRVR:CY1PR07MB2280; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 4:fQRRSywiU6L2aiMxw10F7RgilArdjbEZ82FdXjkiRIhuketSlj/ME614cFHRedNv5eF06icdABvHoD5r4NrHzARJVKmYcCP6Qcl7eWbOMROesdOs/k8ws9tmCaxzT/BNpzvI6pTlOgRVEebdcky8BwEf/ZeCl5L2u72iLrf77xmqsTmi6xo3ep54FxjlwI8om07I9Er9/6TkfhldUscXyTKGyfJXjjtEQe6/0hTfLL4Oca/omsVpjPs5aJAwGSAYwBWulo3tV2aOzyCJq5mYExSIytIOSUxTFyrIy15eU+nETzE5gzlTsQIvuKkxwU2vufTM5DB+YiJVJmv6AhT4ypfEsFbiM4LVKZyYfeobkQaR0F/bnKxq2dqTYMqxxIub1gBQVokCfne/tETuWXiNmt+3+vlMS8BshTnsPW8PoTcSlRah5qVVCtaewAzA5QT42fgmNd8RvgXfSjDZFn+4333z8VtlrObsRDcoEAEXnCpNjybhah+V5GcGWAzIRhrSAV8s5s1IxuJlIRydf1fp58HsAqHnS2uuBBGX71ZUepArgKkpawCDOC4j1ByjhPc5RyB5+mAlO4Ue3Vpa8Y+LbrlqSDMpezYJLwB9Yu3Sq8I= X-Forefront-PRVS: 025796F161 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39830400002)(2906002)(2950100002)(5003940100001)(66066001)(42882006)(6916009)(50466002)(48376002)(47776003)(42186005)(53936002)(6512007)(68736007)(5009440100003)(54906002)(50226002)(38730400002)(6486002)(25786009)(305945005)(81166006)(7736002)(6116002)(3846002)(4326008)(8676002)(6506006)(189998001)(36756003)(50986999)(76176999)(33646002)(4720700003)(5660300001)(110136004)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2280; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2280; 23:UjbBO/T6K6+VRH3Br2Te9iq4C5zrIX+d7TviErDQ/?= =?us-ascii?Q?Gnu7XjX07tofocCmSZ1cC5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Q?TDo6mbvCpQIQBU0W9MoqKaAcAiKWfz+sEL80ZpdW9exBBSpKXqT/BVLBL33R?= =?us-ascii?Q?Q6KbeMlXCXqyToX600+YkWbv+wWHcH2tVFKtnnQAG/9o2PKouvXxGGJQqW1L?= =?us-ascii?Q?y+yORc=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 6:depv60hc78BEyit8b8ksmfmz7Gmh7drTGoV7LVhVLNivxHdPRpnhb431lv4+cuZ6+HtSVioispIrXHaUqzal2s074315cMy6dmGPoTTsbsQabvmPWjpy66uEHZmToYlqTGkfNFdnS3ixl6g1sqV7hUTUjTQjo/hc3ws+bphm45hRcaYYuKtlOu8VBNweHf00ThXwXw8+duqDaYmKk5KZ4yfr54ZARAqC2uOm5p3818vQFXhFLxbe/GJTYrW+VylnGlEVYDF6+V0MSM+gbq6txfHy5t43a+wSidVn10kPCBSDhqQai4GfsEz5r14LX28ZYHTw/d9r0zLg7gnrCWl+GFqHTgxgXjfxlVRqZH0/1F+jPkWelCYPZebmtkUfmc1a0FI5FYzahHpS5eSUIu2zVg==; 5:svtJsIjSDF25S4QXL02jRD8Wt90il0hYjAAuwVTqKVA1NcKZqbFt89e/DhMWQrc9ldZuAlxKqBln1BNYHGSgMT9/McGlLJdk2lQ2odr3rQx6oEq9TKwJnMnDMw3vL9RhzLWS5wuieocVvIg+Wcd+wQ==; 24:prLHp6TJUIsOsYNt0/Sq+wLZfiKygrptLavnjjG4pXVRgAXQChrba58KFFn/hff3vb1PCCCuqT4IvjuRCYpXTG055ict+KYUO0/DOLAPVrg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 7:MovVQ8untySFEpfXSmaPnWLnB+W2NHTCER7oLpCLTEDoEiPteJyRD6AnPFy4g9vUTq/JUEELbaf1SVb50LQt3WhjgjOX+HHiNEhXDibXPRztwXgHS0AXAMw9epFkX/ohlEJRIuS6aU6FRRrLGmP2+h/bnZro1/sUoOL3h3MKZ1rVTleubpqZL88ohSaTQdoONCMSeXId5aVcL3+UC5Dksw/EWVtNugsQ7UpAZ/qccignq5Ha/zZt504/txKTPc0f1NCDMeqvkGDpIxAr68ogu8P7e8P3SiHhFPRhquu2cq1ILddYVRj/SGWFs3VcX4ckNXdLwieFC6LJ+eIxyUgumg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:28:42.4823 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 36/46] net/liquidio: add API to validate VF MTU X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Mar 2017 06:28:47 -0000 Signed-off-by: Shijith Thotton Signed-off-by: Jerin Jacob Signed-off-by: Derek Chickles Signed-off-by: Venkat Koppula Signed-off-by: Srisivasubramanian S Signed-off-by: Mallesham Jatharakonda --- drivers/net/liquidio/lio_ethdev.c | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index e2040b9..560f195 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -152,6 +152,33 @@ } static int +lio_dev_validate_vf_mtu(struct rte_eth_dev *eth_dev, uint16_t new_mtu) +{ + struct lio_device *lio_dev = LIO_DEV(eth_dev); + + PMD_INIT_FUNC_TRACE(); + + if (!lio_dev->intf_open) { + lio_dev_err(lio_dev, "Port %d down, can't check MTU\n", + lio_dev->port_id); + return -EINVAL; + } + + /* Limit the MTU to make sure the ethernet packets are between + * ETHER_MIN_MTU bytes and PF's MTU + */ + if ((new_mtu < ETHER_MIN_MTU) || + (new_mtu > lio_dev->linfo.link.s.mtu)) { + lio_dev_err(lio_dev, "Invalid MTU: %d\n", new_mtu); + lio_dev_err(lio_dev, "Valid range %d and %d\n", + ETHER_MIN_MTU, lio_dev->linfo.link.s.mtu); + return -EINVAL; + } + + return 0; +} + +static int lio_dev_rss_reta_update(struct rte_eth_dev *eth_dev, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) @@ -824,7 +851,9 @@ static int lio_dev_start(struct rte_eth_dev *eth_dev) { + uint16_t mtu = eth_dev->data->dev_conf.rxmode.max_rx_pkt_len; struct lio_device *lio_dev = LIO_DEV(eth_dev); + uint16_t timeout = LIO_MAX_CMD_TIMEOUT; int ret = 0; lio_dev_info(lio_dev, "Starting port %d\n", eth_dev->data->port_id); @@ -852,8 +881,25 @@ goto dev_lsc_handle_error; } + while ((lio_dev->linfo.link.link_status64 == 0) && (--timeout)) + rte_delay_ms(1); + + if (lio_dev->linfo.link.link_status64 == 0) { + ret = -1; + goto dev_mtu_check_error; + } + + if (lio_dev->linfo.link.s.mtu != mtu) { + ret = lio_dev_validate_vf_mtu(eth_dev, mtu); + if (ret) + goto dev_mtu_check_error; + } + return 0; +dev_mtu_check_error: + rte_eal_alarm_cancel(lio_sync_link_state_check, eth_dev); + dev_lsc_handle_error: lio_dev->intf_open = 0; lio_send_rx_ctrl_cmd(eth_dev, 0); -- 1.8.3.1