From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0073.outbound.protection.outlook.com [104.47.42.73]) by dpdk.org (Postfix) with ESMTP id 64B20F965 for ; Thu, 2 Mar 2017 12:38:33 +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=Quz5F1AAYByMoGpQhnoDzN3cuP3zQAnNS2n370fWo6+z18MbXSNf2j5DMH8/kIV/vZGP/kMdIB5aAj8iWjp1pzd6fIceH29yDtkLnpZkLZSYsErK7FN20Rj4BSu6tqZ0Oqt4qlcv8xUk7rL4Q+fivOHhOBNRlSin8Gg9uIOcnBY= 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 CY1PR07MB2277.namprd07.prod.outlook.com (10.164.112.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Thu, 2 Mar 2017 11:38:29 +0000 From: Shijith Thotton To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Thu, 2 Mar 2017 17:02:17 +0530 Message-Id: <1488454371-3342-13-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> <1488454371-3342-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: BM1PR01CA0021.INDPRD01.PROD.OUTLOOK.COM (10.163.198.156) To CY1PR07MB2277.namprd07.prod.outlook.com (10.164.112.155) X-MS-Office365-Filtering-Correlation-Id: 64b4051c-0c40-40de-cec7-08d46160a76d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 3:ZUAMxbeXwjbUK69P+kjhy3cFCy61KE4bwX+auCPrKzJUTLaHlu5L1K+e/ikf/wTNKl8CicNYXUxFwPiaCpHxKCde9BXD4NHL2luI5NC50U07EYZkF00mZCs8I1xvb6fHIKeWglQ1nILabBy+RWLk4AsZawe+T0lqqBn2DoHdYFbr0S3jI8Ahagrfc172HuOTu7CdoafbJfe4ItAacmEtd8v+rS4bTI1dBfVjpebaI/9ZQTfZwMqyc7W8Umwpf2nfuYHQ/aZ4YZKljyeuNZNVIw==; 25:ku4oDEa+4TzySNLmSYTxKfc2wdJUQ9xvyTxm+Ze5Z7vVRLkfZOKzlCNe1TXq79TJClRd35MQyvxLK7UPMmCfmQdRu4hoz9daH0rRWRF13vgiKAg6Z3Meb1gxcb5cjHRqblzdu6a3EUqkncmL4GemW5cPXPiUBNxF6DHCpT8uTmeKSiJvDHZzBbkydG1A6l6Z4ZJ5hOmGOwUbE2Mf0uS/WR0ugG2OW9qTivczpS3o0EeU2sVkPtbATssKIDweuh0bv+by6subdcx8YFGaWFpXG5mLxPhMeoJ2bTXdqc8vaiGWocf1qUD98jjdfPhhLknIBWSYqSHWCMCHd6J7B8mGN/e0IP+G9xb/yu+r+bFyBeCzPaS9i+g4WQJiJuG2ATbymnCnCfAHoY1lfOklWf6Y1tngK6z4BeyRoCg7Y9pgaV3fdVerUJETPvsWckfjNU4d0f9c7eLQ6pLcj/NaHjhFcA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 31:SAVI0Q9kWahjhJzzNu7IDe1Te5xmvJkCL4R25rs7MHW3cd5pQaduGmR0D/2APpZUX+3qkDfYTP4d+zP5IABUYZzRsGOxeT1Vb3rIq6LDIcsYsIMyrA36fvzmKqNx1QeDTNPMsAZbPGw9GfaP0YZaHMYFncaRUIUdv6UBgCxDkINLvUzksjYF/HW07nOOoq4ZVUmJvCp+yo10kCAxZk6QdHp16odWLNWJHplgpVTMd0M=; 20:TJs2rR2vmNMMD0NCYf9017ba6BY8K2WybBQ7LXg1vmVp+mUbKHTe31cSpVMFgtf99esb0VJ64BPtFPiilNk6pZSYZ40EC80w2vXUMby3YMceY7cAF2XsQxcjoCIpmXOMvKzWZPcfbaV19zOJcy9098HL0cQhl+//ORXGvpcBmxNCjJHO5iFDB61WZxo7Hzl6vu7w61P+6vNtN/xUzFJgAFuiBi8kZMqwGzy+l/Uveh6Eg+QsfoGV2V2oBDQxr0/+3qLKoEPODa1kaXKg1DY+tW5uanHWGm/u86E2ewQi325psZLokhKGgDien8FR0ixdgwnEwwI6m7Xb5vtPkRR1xylWh8QNv9hEOUwyKSPSXOkTz432Oc2FdjvKPSv+CgsQHiootXwQE0p3+rx8fJAneq95keT35cGCwS1uDwGMHQRsuHLmYgNuRn6EQmI+dGi9oxbw73oN+nqprnoyxZ+UGMWrxaIIA/SzKpELEFjbtT3yniZU+Bxe8/TakTc7NABpF4xwa4LiYLRyasDzdfoFqbx5ekCDiSMDgDrmw56kyK+4YMJ3yWBtOjVv8kAchQDluCaaj+LJQJw06qiUzJX5DN0ddiTP1U7CmdMJx2t0Q6I= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123558025)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:CY1PR07MB2277; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 4:MgRTkD6rfo52y4zz2TP2stcGp9o6g79Sv+gX1WGsCRUPVEsz6tQkyuviqjKCJapatWPzZUb5r4wA6kWK9Bis0gQJcKqUwK8LOAx4yCibwvDwLVUbh1jmCRplxAK9d6y+MCNxLsxfGiCtO2atLEAKGHy7CuhbeLGtNyProLTJgWMphkVPQxO+2DJvqXUWaRsshxxkK9xU99KE6E3Zg2zM8eKKHm3Wq9llfQkHTr0Q0vOx3QG13D4bg0Nc/v7CI75hpNi1CanZ82c5eXCpTsJblX0JCBDZJi1jdbQwhTIRRkR1G0A/Y/qiMG35TMAUCv/SJ5JruqAmAmRcMXXaMZoyFvYoEW6ZVw8bsu6pPnU7k7EOeylXm5rgEtjCOk7N9KbImbBrXJJLMTJ/Se/g8rsU3gwNuMp4NU629OhnY8s4cfHyMT1SLm98xf4MuP2wcRgOdcpzTL/KriO6EyTBZ8wB8SRC+VN0DYU+lwMBK54QzK9yvo5yUN2HzJm5HIj9Smb04Cdy8p/9Y4rFVKcRWYo/0Kb1vBxfprv9lvgm43v7oMTyfE1ZXwzy9BMHT9R54EahgzEZbrtVtHZjHwknjhwUl1y5yLwr41djf9m+U1DxhQo= X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(2950100002)(6916009)(42882006)(575784001)(5660300001)(92566002)(4720700003)(33646002)(48376002)(50226002)(6666003)(2906002)(5003940100001)(36756003)(8676002)(50466002)(81166006)(110136004)(38730400002)(4326008)(305945005)(2361001)(53936002)(2351001)(25786008)(6512007)(189998001)(54906002)(47776003)(6506006)(6486002)(66066001)(6116002)(3846002)(50986999)(76176999)(5009440100003)(42186005)(7736002)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2277; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2277; 23:CDwYpv+/dD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MBJGLobT5i1IXSBpWwfuR5nvuTPw3Sk5EZr3C3aru1N51ozU7Kv7?= =?us-ascii?Q?VsDl+heMBl0kNyOsrEXQhx9Qa/JgigvEtyl79pnIDBx0COXcZ4Z++iw6qSBY?= =?us-ascii?Q?HDzNSSczNcEKvemDzLlLq3YB8gMxUcdh+oYsvITowyHNksVIytpM3BNl3G+p?= =?us-ascii?Q?Kps5oyjSO1mnl5K5qxXah6RQsRE34cbGsMU6S46lzgvowFf7IZ+k3oQ8LG5B?= =?us-ascii?Q?CH0bKULCDc=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 6:y62lajstqqwht4YkeD6sPR/ELzg1sTKc2UY2KQ6pw8oRyd83Sv9wc/OKKryxMe2ZF9IV6jyFwSN1HgQn/0C52PbuhNeDwsaT0GW/9J14Nm+Penzb1jRDs5Ef+x1cPtZbdoQ6qREEBCtJNew5sIaum/kRYVvZXo0Zp/9zH6uC+747w3rAlc3qWWCQ2BII2BGMHU47Cm3mGBw2XVvjLEaHMnabjjiv7ihwWGAj4ISkSRmaMEe4GxDxBPuBQX81+EYj7IAHa/yHzWvPR0Kx4HMo4mWcHczlCELkbtomkqtdHdvSkXjhZcJBk+LesNRl34+kgPKs/M6E/K6Iq/yQUFNkcltfAc+glIxYx3j0arF9Nlsucl4SxACQbpJBmgoNOLTeqxADlAo/xLyHSdn7siLNhw==; 5:ms1EpD1Li5wTh3l3V+WUigzmAB7MNlpucBspf0PbprSaALiDNHN7Sb7timtZZE5aSZ8AvFnu6A9C/aKziG9qDOPeYm7f5im7MCDdHtgj8vw+O59jhIsVwdyOqJ0gzbKgOK81FE2HcR6NJX+JsKR09Q==; 24:R8d+ae+lTIBD2w586QQrmKDuCjMX5TR95O3RL1uD5xNTLOHuiVfSrAIQZgAkifquMkyaIPR/1DWaJjaYsApnEaBh17GRbZy1j85Mc9c5/TE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 7:HCPFye/bi+8kSqs1kQOC/Kf/b3eEwO3p0gGyRcpoTq7HkM+02abqs6tRz6ZWBu94OibxnKleHbEZ93m+o6/tUzQPMXec8hyQX0FjEEaDoWVhvobINCOrBq+GajxrA/O46fJh2z394w4Ee+c3uidTKgvnY/VPEdZbstCuSqi/DUjZZs7NYn3mj8fh6Niq/ct8/snLHtYwXkq6JqQyImiCuT22o+9Jp/B9e7riTGmQr6a4J4eCNCUQID/BS8OzGCwIKixOTMNjdj/GIPMz50ck51+0UVl4BbShpFCdDMLlLQvnoINxtytN6pOPuLq3A7V6ujzSTm84O6eCFMaMzUquuA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 11:38:29.5452 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2277 Subject: [dpdk-dev] [PATCH v2 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: Thu, 02 Mar 2017 11:38:34 -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