From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0067.outbound.protection.outlook.com [104.47.32.67]) by dpdk.org (Postfix) with ESMTP id 35811F96C for ; Tue, 21 Feb 2017 10:28:53 +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=kt/WpH1nz2g2y9DLai/U4mM/MfCsw0VsrNvKM1Gjb24=; b=e7Jin/tRYPO6TcPK1hI/9OkA7vm1YBQBOIIybkMQvMXhcCyvDwTimMHGqEqe0mIUpnTLrbdtOQG5f/lU/BcEGfZQcc3ME9EDvE+31m9S+ckqBuWPVLRxKEO655FL1cM6YYyCWV/vLDSZRJjrGvn4Yu7U+AnaKli1hGvarI46MgY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Shijith.Thotton@cavium.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Tue, 21 Feb 2017 09:28:49 +0000 From: Shijith Thotton To: dev@dpdk.org Cc: Jerin Jacob , Derek Chickles , Venkat Koppula , Mallesham Jatharakonda Date: Tue, 21 Feb 2017 14:56:30 +0530 Message-Id: <1487669225-30091-16-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-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: MA1PR01CA0089.INDPRD01.PROD.OUTLOOK.COM (10.174.56.29) To SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) X-MS-Office365-Filtering-Correlation-Id: 941eead1-fbc1-4207-daff-08d45a3c0c53 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 3:3z0+XWXeQLFiaUNOLboVlNqq3kQwz8WK8JGK1uG9xS9768EdInQsB0DUDvdbcDn5yXwMjpTRvZs9qlHPPmR2tNlNZkERhPWB9B7STZ8/VPmiV801HoiJm5eP+mJZoH2QamZmL1wyl81q3NhY3DWh41hvfA+R3xEH5ZIOdEd0cBtO6PpGSNzJqPRZrStghJ3FHQDrBY8JGoBLzfvPQZhJ0HR+XNpxcIM/U04CAVH1VCCmXnoT981rjax2vc910pFJLJd+73+/YWM7dVExstFCIQ==; 25:fl3dBBiiEt5uKjWKWlns57VHp4e20DY8knFBIzZOl9kNcs4eRCI90M6M+I5YvKvLXtKq6rtYhz6vOZhWy2UVpb22z0DtLw43I9d1KKeKdGv6rKvHVV2Cg6B31cB25FYYKKzSO8OOS7hrXj2ufoUiAx78JRhkHPq5Qf81bcRL63vu4GyIaEYdmD1cv9vsLiTdEuMOYginAlPvqyk97kv6heOxW2UX/bHs1kKfs2BoQuXhxqTg81jewzHwHjf5WZJy3wFQKAiHyeInw0jAEtmTn+rJm8JQexZ45+stODozzJHyUZ/vakXp7bHqQPXmA+gYtEXTLOinmZ7CQqOmhAsELjeZJwKCISgHgeBg32II5X4TIqFB8Fjepaauqzc+keq3alp9wKemQUYKiOnxJ2iJP97u0+4XDa5xgQgpEHJUJTRbO0e/YntTf7Atkb5gIwIxPF+k98bHt7njqpTdApY0hQ== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 31:QL4FCpR7hSisfnXsMFZWAc0plA4NmaYmrdro+2BmgAo86oKTZpHY+tp77oD9ihmtehv9qSVnTPoPghX+KXvByJMupp+sQEPB1QRQ+Eqod79OcMN56f6CF2+Pnlfu3oFshfY2Aeqv+pCOxM0nBim2y6Vno04E5f6Lkeu+HMWKk46Nwn1LB79k7k/gt5BQvuQguMkj2uktszM4PImjc72/ak/r1MXBz56IC4O1VUksgYw=; 20:3lq1gwBableqUSNjqHIWmzRIkKXyI1PiEnso6bTMVaLfx2uiWNxUwRNP7tSbttQnjHhgRPGv7FAf0MGV+ed99DGAgMAFbpGgA/P7FEmks8f+/aGLbs7eo3dP4QN2qYvNkAXjzbON6f/Iw4FVh1WJevDkc9QyWdTHp2zej/5vAUVSJWIrIqm3D7YpeCfF+I1J8b11+nKf1jtuTGtC4bBpRqUCgUIkOz/7qIT/4tOw6Wx0nq2ckxdKRBdk/Udu6s4O///dtpgqeRY2+2LUEfWS0JtbyvwEYUdfONG2JVaO8ltbHr2gcKKR+0HfM8ZW8UCPld5/siXFH/cw0rSRXdPGPk3tvYUwT4d5cv575r5Ef6GmkGU6SiIV+v9fGert0eGLjGKqxcmCNUiVGkR2hWAmSMwrsh1zyNgU2a3I2Q3o61XUA95GtM++xH2U2/J0dbdVRnHcX3cbJLmTd7KDhPSqyv7dGzPi5MqazgRO5VSpkbuQ4WGQIBUSqryaY+3VhcYPRJRkMl9VlIPXI2IxfMHf48kJ0qFMpwo5asx+9mmaz/7UEDezDK6DptZ8/g/X8VMPKiORXNc/xBISgMRmsC2U+IctjlVj+PCGO8khrHn6/mI= 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)(3002001)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(20161123558025)(6072148); SRVR:SN1PR07MB2285; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 4:DiGwluHQtSfzHN/l/yYCOFZXR08/rjE/Oa3+rpJ9SuY5MyBDeAJ5jON/CcoBtXU8L/9PNHoMkjdPHMrpgFq/HTqAkwPGbomyJe5u3mnxbVJ5Afk9EiMp/lE3MCI+0Vb1FI/cckB/fl/Yj8LbaSiwWM9wKRcNINsBPYopZzN+Yz7SpWtUL4iEJ7t71bLC7Cl0etupi8SED5G1R7qgNBXAdDN3KTX7Q18EYUasUxS0lmFiVX+8SB1jzuf+mewEHWOXMSP/AZevR2KPQYPi7Z5pfDXGulyCrVEPCxn4EJyA8NRB53Kkvf812+qFtQypG2IISjCXsgvcWD2lTaQ3yAZVYEwKfbDYTPuk8i1wypQzshrXWfieJkEESrC7qlRgPeRoWuEsT7wlbc1lTOjq/qRwQUFks9T6ryLTeOW1fDElil3R8LCpmq8IPuhMEhiLdXZyaZdqeynHo0uumZ5kSkJm0zoYB0E5LpzSatbiUU9d4nIeSPdOcWizaWAVobN6+B5QXtBDNNNQdRjqInOjeAyhGACBLBEeYe6SGmtNoyfugs7N5+gdun3uiybvTahikiDeYiR+d3VCzyb2uBMD0HYT+kfh6saydCDgg8Qx+0W1IPM= X-Forefront-PRVS: 0225B0D5BC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39410400002)(39830400002)(189002)(199003)(50226002)(81166006)(42186005)(2361001)(575784001)(101416001)(81156014)(305945005)(3846002)(6116002)(5009440100003)(8676002)(105586002)(7736002)(53936002)(36756003)(110136004)(106356001)(6506006)(25786008)(38730400002)(2351001)(92566002)(48376002)(6486002)(97736004)(50466002)(5003940100001)(189998001)(68736007)(2906002)(4326007)(33646002)(76176999)(54906002)(5660300001)(6666003)(6916009)(50986999)(2950100002)(6512007)(4720700003)(42882006)(66066001)(47776003)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2285; H:lio357.in.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; SN1PR07MB2285; 23:RIZhDAcM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EunmYkMQ2DmgtTnzPjGK3KnEufHjDy1xBEm3luvESvrBNPZ8sRgVy05lr2vmHwxpcO8iZaXto6xhhD9zTKaFzwsLaEoBOl2ydUA7yYtEhr+j62ODrqdIQ==; 24:jRmyngd4zRnUBLIyY8fVNL/ljsGcVOYukAjpZx/tsxzxZwN4DL4JrzEM4j/zS5Ri+b2/5OJzQVtRhudZKVZvRD54FhvCO8J+57xSXuIRQXU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 7:AmDeq8ZEpfq/9r45Cw1aKwE6cSEBTZMloryMqbUtlfRiHNqWmYRHZpp/iVyGP9/K10NaWz9rJBdhEyc1AsPOVcBkTTg3Wn7UvByDXHcGN0GzI5iSdzJYATAzoqXhRzZt1z5maREm1IcNi7qXiJ+Csd8vKP8NgGBTGqhgpfHlPeCOD3Kv50+dPdiJuQVI5Wph/A1YGvs/NWcvfTrtfLd4BJyETb4REs/ddYK2xJatlAQIh78g2vKdcN20WbErVqRKc8IUCtJrDTAiD7Rg+8VtwmpGU6GAqz1vLIkm2SUjuR1WQWb9c2gNRey6zeEz+1tL9jehcYiMdfb19r30hl/LGw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2017 09:28:49.2441 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2285 Subject: [dpdk-dev] [PATCH 15/50] 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: Tue, 21 Feb 2017 09:28:54 -0000 Add API to perform Function Level Reset. VF sends FLR 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: 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 7318bf5..23dfa43 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