From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0050.outbound.protection.outlook.com [104.47.33.50]) by dpdk.org (Postfix) with ESMTP id 173A7D492 for ; Sat, 25 Mar 2017 07:27:32 +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=629A/eJQttkR8/niIv3M8OFI9NQdr5qI6fj+o4HBSaM=; b=DfHpYf/YFuduo3W8UYX+J1owXCIbKx3vzkG8gX1RMwFoHtTe+QX8JMxjaRH/Qp9pQOZ/vCZSKnQHqLrwZjXfZHp5y6lT3fS5+PX43+bxl1ffkAhZG3M0oM7SNblfxqGMz6lZVq+s2hvgRc1r/dFdirC1FS0EZ0yDaDio9EhAObQ= 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:27:28 +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:23 +0530 Message-Id: <1490423097-6797-13-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: 87445f51-bdae-49a9-28ea-08d47348043a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:UDXPG3G01FuOHCeOoSIVEIqNgafDSWCGl49Jkpc2rok7ShTdCkB1YID0pJaD8Q+NP21z8NYVWHQaAZjg0OnUn3pLFVXL+WGPy+c8t6o8ztORzWpY0EoWVLg0CD240OtPZ13FdCNPDm96CCUigjaJWwY7MhyuuFZBdmIY0jPpftrvciwBPHyWZdkxDkwLc2fpDe4YIbs88hU74vZdP2TB0fYfZteRle3j7NdCu0NrGPD3NZu/gNh11iEMdD62L7S5b2xTdLlvFOs5ck7EWUUrvg==; 25:F22q8weV4AswTVgUT9DBzAFDdq9ljQ2tTpkMbltH7m+DNRHaxqOmg7yniZgNFTUfZhI7uuuM5gLuyDSu8wBUVFmhcfQhU+eEYTN3KdVIxx7gJdYQY5aHfWCCwBi/v07WzIIR+pNWIvPVNghXzUucX2nUNtEoEbbxob+WslCInuqnNIcC9MpriISUnkoUAzbWgT+Pl6QeRW3jMcSxxIOPzVIcS2NAbqb+qmqdj77KEECFZ3tCqqhv8TCi9gH/Z/77J4m5PEu0U9JAK1mojDXFbzCo+5DeQv4owweLBjXNR9hndF9hDZxil4NuW3OUp0x9wAARtEtB+bTDUMcLXXhduXwQpXi9TrT5xvc6ML2QGoHjMS+LuIcgv/mJO5eQ5Iz3eu+GLTWm6SPq2ILn5SUXXMDwShc0PS/RGcosO7VaRb/fKQxDzYtmuq7OPW8v/7xvvVGmSQXjlBtVNXUF3nOAgQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:Q5m8tPsOfHGhQ3+PJcTEJN+zc0j4HwyzKPVlAk24pB80uElWjHIUJZoyjS/Hma+X5po0jEMMG9TwfqqTUpOzbrMnmilslt4qwxsGSZkInli/UauHaTL7iwoz1UsyRb3+RpXH1MgagNzmz70rJnKtz5pAHFgXRdyHRjBvtRA3LIEpt3+PYMDKq5skdy7tIGAAPWbArNpgWPPvK3G2Hog/px+uneKMap5m8FHYT6I6IWmS08yXuJTNC20oIrrVk839; 20:7/sUowWUQ9kPoEgI0+d55elNCE2a6z8PTpUuWcjvi0dJgest8swHRL1kHycz8Fuor/qsDct7T+MQVq6OMVPmv13+YDdxRojPfddydxAhvEntzLMUkB+sCvRjYxHYJ8hdG25Q2XjdTkSppYf3k+uN+UBMg8ArHFB0bkODEoA6SVR8y+NzmqBUFNsFyKoKKg1yAOIZl71vwEC7z0plNiku3MMwbs7VsMlfBkE2sfhGBKGqfSFMjUJeSh7EJ7mFABxoiMgqnp38VZdHATB0WPMm0+qNF/ZrCiSX/kEUveDJ+aiaJehrUNleKetNEyu6mwSFRJ7v2j0Hf1DDWzkfrWYhCqW8iRaoplleAaG4pjg06x7u20+yCTRkqv57n4ABA+EplXsNUM1GMaDqDEuemANCnleRPswDeouokf+GCA/GbhRviNEGhVGLyMxgoEQdUYY+fREMPJkx2RUtZMSkmfHNh4ohATPrAJH5Mc5cIGbe/iAefP7JYso9wbzhC278bduqBzbeU6gwGvQc+lfNAOgMz2G6nZ+CDOOKAzOQ8d2GvGlGWyHC1RmBW7CuQzpjUKZlAAnvo6FiBY1adZbCXkiXeEN5AmmVRqb+RAOJLSouIn4= 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:QTAjWbvVJBekMxv9S2eNAPvqSkqItb5Ja4SiYKkN4MRvQaY3iu5g+LNFQuEVTv1av4preUMKIDA4X+Z75w+RNVmbNilrom/3H1HBf0UL3UBNU7P7DuR++97CcWJQ5F9YMtxZzOCgu7ohrxKmTlp6zZNjNobsFdaU/vr6WhUSeKNoGejqKrhbUX+raUNrTceuLTEjLZ+CoQrNs1nfjHcdis2tmnQRpvzp8IU5Zs0VV/priOoA6rWR0TTMwXAOANWtLxk45WD4jfVbhkUSt+9ebttyEezyOO5+af5CcDxABPWlozq9oSayVoBkgBhgGThE30sxHK6BLb0RGPxL6Dw6k7HcPcz+9UeiYdqEAW6uf/xmbcV9u0ss/hlzH/t5EA4jS/sG7bATcUaXSa5ygVEg2V9t4cXH0qbhWvWfiOFraNdukG+uxnxP4vJxoCxmr3c6J3cIUm+OnQQjTjZQ3p5y/kBuah3hMS8ezXTBMPcPM1hnzxCu85lCWfOsCzz6BaEWahSJ9W5nwn7Fo8jpDtZ5/iWYfpWSn2ZBge4O+t1ySfGPtxKiAXthacCpK94tK3OsShD1RLZP7lSyQr9U3tAcb2EbaPn7qvrLh7pZREWAC+k= X-Forefront-PRVS: 025796F161 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39830400002)(2906002)(2950100002)(5003940100001)(66066001)(575784001)(42882006)(6916009)(50466002)(48376002)(47776003)(42186005)(53936002)(6512007)(68736007)(5009440100003)(54906002)(50226002)(38730400002)(6486002)(6666003)(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:QmUpENEW59tIf/wk3JvyOR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j1ROyc5CJFrzlTFwregfCZ2ZExd+zL8jPwzSk?= =?us-ascii?Q?wC/jawlExYrwNM1IDITXPd4iOVyz5kfZhD9yxhcW9RVLufcHnixcURcoCwoh?= =?us-ascii?Q?vb886SEnKJ8ppnI2dJhIJkrJdWklvPt/pWzs1cylksgl8Oce5VRDDDtAJ26R?= =?us-ascii?Q?DH9tjRa2kkJO4qfRL1sSyDodN635XWobEdsB2I/MkxsqHQkZA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 6:7u27n7/eDdJ/cbzoAZZA44Njt97VGRyF6l4dz8O+cohLxaukqY9oY1M6vvcVD8EKGJzCTwIWXg+UdZr1iZEqloh7si6Q4eOfQYAs0+qLnNGQ2xvrxc39xEpnPjzmuTKg3DdDGyVvr305rDjEh/deL0pYFZBkDk7sMupmuVz4HKMxPOfDQULNjSAC7qsZql6LGq386YCkUGc+k8jncA+fKfOWpvPFnQFmGnuHeucTtR2EtNESH7N09aKRJF2efovWkJ+Itkb6E447rEeiiP7mWY9SBnGhsxpeRp+sfypZj2i0znqd3Pcka+ZZLN623C6xzXfHJ/wWfbW153QqDnzZSk70FvBI3mhXlV6N2Pd6fB19g1cqCr+NtVOmwqISM/NflXnKk4IFcJnnP2kpExPNpA==; 5:3YcGvPrvrln3faEYTXYYJeNb7A2qjLXWlMIsV12BXtHefBo5szBrfjmL8/G1ahsmHF/EFEBOLhjQ3/fb817l/1S3Z0VlyP7rmfzsFuLBzxkZbPgry5IiftTu+wIeT3VIra9HVgg20Tzi+EZmicRBZg==; 24:CUHW02DKcbdhNnAWT95dPfoHCAGgjKnrRWLBB4eo5zvXuUewlWIN3ZwS1eX9+QtT/XYtJQQUAAegLTf8slhprloNfy0LLFGMgzb4RnZSV5M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 7:JxIqqi0RXyV2gNr9LqMFbi8LDNaAUmK3686q4KLHbUORmyM62Sz/p54n8J6JRwl6FGd93yJ/PD9r7iRk1LPc1jVTGq6ZVm6lZbbeZ/GuvxDX39tq/7APXb2PUQReyxkFnNkzA1s+GuLFeNL4Cojv0exbIom7Hl3Y6rS+j+utdy4uD/YXaR09n1zJA4JXLJLK1ueCY0MneLdgjKwoSJ/SOEhJcJaCjzkq6wED5CU37IGgFu4Zt1Fqrc8zKvZO+1X4jr/pZDPh+OOEKfkUz2nloc/h48HCRTeTtbRXpJCD8FwIYcnfW6F7ckJ6qnaJVS7CBGMP+pQHiFK9TtdkABGgxw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:27:28.7533 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 12/46] net/liquidio: add API for VF FLR 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:27:33 -0000 VF sends Function Level Reset request to PF using mbox and PF does the reset. 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/base/lio_23xx_vf.c | 19 +++++++++++++++++++ drivers/net/liquidio/base/lio_23xx_vf.h | 2 ++ drivers/net/liquidio/base/lio_mbox.h | 1 + drivers/net/liquidio/lio_ethdev.c | 5 +++++ 4 files changed, 27 insertions(+) diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c index 6270af5..ed5b830 100644 --- a/drivers/net/liquidio/base/lio_23xx_vf.c +++ b/drivers/net/liquidio/base/lio_23xx_vf.c @@ -255,6 +255,25 @@ return 0; } +void +cn23xx_vf_ask_pf_to_do_flr(struct lio_device *lio_dev) +{ + struct lio_mbox_cmd mbox_cmd; + + mbox_cmd.msg.mbox_msg64 = 0; + mbox_cmd.msg.s.type = LIO_MBOX_REQUEST; + mbox_cmd.msg.s.resp_needed = 0; + mbox_cmd.msg.s.cmd = LIO_VF_FLR_REQUEST; + mbox_cmd.msg.s.len = 1; + mbox_cmd.q_no = 0; + mbox_cmd.recv_len = 0; + mbox_cmd.recv_status = 0; + mbox_cmd.fn = NULL; + mbox_cmd.fn_arg = 0; + + lio_mbox_write(lio_dev, &mbox_cmd); +} + static void cn23xx_pfvf_hs_callback(struct lio_device *lio_dev, struct lio_mbox_cmd *cmd, void *arg) diff --git a/drivers/net/liquidio/base/lio_23xx_vf.h b/drivers/net/liquidio/base/lio_23xx_vf.h index 83dc053..ad8db0d 100644 --- a/drivers/net/liquidio/base/lio_23xx_vf.h +++ b/drivers/net/liquidio/base/lio_23xx_vf.h @@ -87,6 +87,8 @@ #define CN23XX_VF_BUSY_READING_REG_LOOP_COUNT 100000 +void cn23xx_vf_ask_pf_to_do_flr(struct lio_device *lio_dev); + int cn23xx_pfvf_handshake(struct lio_device *lio_dev); int cn23xx_vf_setup_device(struct lio_device *lio_dev); diff --git a/drivers/net/liquidio/base/lio_mbox.h b/drivers/net/liquidio/base/lio_mbox.h index f1c5b8e..b0875d6 100644 --- a/drivers/net/liquidio/base/lio_mbox.h +++ b/drivers/net/liquidio/base/lio_mbox.h @@ -43,6 +43,7 @@ #define LIO_MBOX_DATA_MAX 32 #define LIO_VF_ACTIVE 0x1 +#define LIO_VF_FLR_REQUEST 0x2 #define LIO_CORES_CRASHED 0x3 /* Macro for Read acknowledgment */ diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index bebe0e8..5aae105 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -112,6 +112,11 @@ if (cn23xx_pfvf_handshake(lio_dev)) goto error; + /* Initial reset */ + cn23xx_vf_ask_pf_to_do_flr(lio_dev); + /* Wait for FLR for 100ms per SRIOV specification */ + rte_delay_ms(100); + if (cn23xx_vf_set_io_queues_off(lio_dev)) { lio_dev_err(lio_dev, "Setting io queues off failed\n"); goto error; -- 1.8.3.1