From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0076.outbound.protection.outlook.com [104.47.32.76]) by dpdk.org (Postfix) with ESMTP id 3D494F96A for ; Tue, 21 Feb 2017 10:28:51 +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=QuFfm2LqNoqd2KjHCuvOqLFyi3CJduXFjhUg+SjLQ3w=; b=egQxSdBwzwk2DGjmkqyT4FiW0WzwT7zyPKcGCvqwUeh/LeMLkfXDUmt1hnXs/mLvRZArrNyzrufmr/utfYEWJftKpaJQe2hjq0EfXeNccI56lotmBGwmMuPdAVXVhnqjtF2kpWlR5zEQeO/cGTyuN4z5Nfhf2qXmsXLF0VyCSbk= 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:45 +0000 From: Shijith Thotton To: dev@dpdk.org Cc: Jerin Jacob , Derek Chickles , Venkat Koppula , Mallesham Jatharakonda Date: Tue, 21 Feb 2017 14:56:29 +0530 Message-Id: <1487669225-30091-15-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: 5fba057f-b1db-4278-661f-08d45a3c0a3b X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 3:rNAJgFVzNj7V0lM35oQLENjBvS1Zkg+DL2Qr+CN/uMVE8R53PuPVWnyF4Oacw0RnvFyKVg15nEMOAsFe9okyMRMF8RL8J8b/R+CqDKgTT0voKB+aIME9+n4P4+c9d5E3DB1M7EtpqvI1VoMubUnRAmbHsKxoNoHwy44UUb4JCi3b3MqYYM/2BK20dRf2DNYzot5E08szlu1DKllHsBCn01DRpFvFHUvuJ48C1juqeeB5ytK6o328UL+pwjwdN7hpzpTxGD9MWR0lRLog0wteog==; 25:+S6S3rbKZOjT4jiWg6cn9W1bgTikR9amfArmmo4AVFE/I4P/OTdMJRsgidQ+RW2ZWdNTcNBHqqc+CLDzFU2nAAKfct9Tc5pA7XIiS1q+VE1Ut37cin6TcFsJ2BTbUFELgdCGPMLDU95paE+8df/qBayG+obuYkGN1vNzKf0hnW7jQFVWzuE0nk/foNlGKgoL857e5Pbvh7x4e87y6VSQk9n3Eosq5QFyeDO8hXRwrYFGIGauV7K1wxWPbg/BjKJuQHzcRR4GXW99NFr4BdRZEy/5MMmeo55r2G522kUbeuTQs7/sNKf11jF/8fbNK2ZNY4ZSWEbzjbNVEnnlIyiUxbj0aPWZB5GoEUBAb12PaQvV3G1NZ977c8cOS7CA/UQeo5FroCj+paghsMS9/yprv0wGf0daFVJfDZaBntTwmXEn4ysaRdZEnAmntKZLdVBXTZUi3XEsJ0dMUPBjSMoRhw== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 31:gR6hbOHzGVr3MdbzovscY36OdERQ+W0umlfSBh4Zsiy1Vn18EGply0QBjC92fd4vUwvHyOSDuss0l6ltYuHUEnF5QaYBKUIO0TQ4moCjGP4rHjSJxIEk4Yaa138XdZoCdkCqvCtH2MGbcn94f1wDhFi9R3Ce5PnD0z7B1e1/zJJexlxMr288+VQAAEdOM2sLwEsfEn3CQZDd4zyIpv8lv5gW1mWZo0XWFTSu20SCaLk=; 20:S7+1/IKFVO4G2TGK6SYRqvKIw0UPCNnvsRXTeyyBcAYCKELEJoYbWIBc/ox9Dg2NeqgtMX7Wa9+iOXpNszTgOZwq1brsrrLLiGnAM+oC7pizqPGo9IXW3fl9CBjKDZOhYR0BC7mamfxRCdEa9IX6fqL8s9BYzZP4CX8ZCm8Iw8dSYT37xHwvgjnhuJBUWbkQvqgE89k9IjT2+6NBX7yAFRZJBjTiSC+cXTwJ7UJ2A+sPfbMWH6YmOYnmw1D13QDL33E+pxwvHLxI8NhU53x90VinmZXTVAyi7dXt3SYHCdvj5ONGLfXFOWEupapFrAsbjS8l+c+6xZm1SCw10tvLddFBB8nsbHfk7pvvKoAXFFMvvmab0/wmD4ZuH/gLt0GbhvxRmrGXTxWrdOXaG2BC0zUg+AG0IiFwFnrMQ+ZKAjRijihbXBTPVqyVDV1gcYm5+1iG1XfKDP6AFYf6RX/mN4rVRu6vbS8tztAsSjaG8pYLF9jA2COtp8WOy4dGrpIjB1W/ffUYR3Piv89F4wD7XtgqBd5UJVAUA5Y1WSgyv9f1fN/R8gttSH0KNb9GwSb0/jwzUmvcCQzrRXAL97qpCnG63LjbnIAtPVcS9xUHYVo= 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:wwmC38XCTz8rmIP6fpprAe4UPL+NJW3Wa+hPWqqlmnFBCmY2cpD2/V0OXKsg3X/aC1TeBu3VDaE2x6fgiyuP53S0s6bijYgBcWxidTPLNuR6kKhvNOEhZZRf4vKCypCTk8TdoJfZwKbTD5jQfc8BaSHY5Dbfr2zZTY01iaTTp5e1aBh9t6ua0cglF/zUSb/HAIkbmQJVRVegXEfJY+qlX25lVJlEYiiHxDUcD8oG7KDQsDYnlIwITzAJFihSD3pH18e8hbZFE9xRkoFcw6rawjPIGp2OuNhbf0Acup+YTyii+EfO2nbjHQ6qLpIdU7TV3tlWxHewkTYuu/bPaqgLUHgiuWaQCQaMhHc+YCKxmY8blxxoBsH5VXp166M+zFmtNUVGRWjVF5hcfi0onW8aGjtIALJt/BVE5vtlGlknt9uMNSPnQoQoadgrY4aTxVjmaZVbNQ3x0c5fJFDITI0iuJCaXsB9x7TvVVSBrkomMEznvUkyrNOjM4I8jcwGjR4lPqQQWhLUAoCMdbDO02SrpN8vzLlR8y4xR/BvzOySw1hTZtuVgP00Y4WzrBw9kY7V44pJ1z8edCR7cZoi3JI2SDFb9ZCOQpAKoNIBjXLG16w= X-Forefront-PRVS: 0225B0D5BC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39410400002)(39830400002)(189002)(199003)(50226002)(81166006)(42186005)(2361001)(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; S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ppSIUJQp4+HM4BTIn7ozCIa3mV84cr+vkeMCZHOkL/rXOS/RctykOQ7APgsPo/FHK0upj9OQL1gfHhLf9DFZdsyjRTHsphzwl5+Hug==; 24:OKbOG//KVoy6Q2+uuhrLfALRATCF0AY3NS9UCZkT9OIGeny0anrdHlpDh2CW5Dg19znNr0FUUyz7ah4P1Xd+vVKfDn4cKd1ilmOrTtMz2Ms= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 7:P6minY5i+IVIf8RK6KXLxkbzvVITLUzY0cOvLljNYxv2MEMa3VmkvpajpXBbiIYpf56ji7EfYGbFsOZ6N6KhMfVqx6PIH00YGzeORNyzT7xVakJ+QNKXGOjQBPAQeOgo7iuXcnlQXAgNe1ztgSSKShcc8AJ8O3cSODAPxcT92EbrXb/+bGJoskIFWH3XGzDFVMH/x0g+b77mITRu3ETzNJQgE2jkug+oXpp//nSM6VjGOxdJKXdAwNlmWlPMmiwbSx4h4cgFdrWUvLd7NI7qXbwwVctYXeURp1tVVmYbA8Joq4Tlpljf488p1mffch3WXoKtMiLAmPhwXhWzjLR8vQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2017 09:28:45.4628 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2285 Subject: [dpdk-dev] [PATCH 14/50] net/liquidio: add API for VF/PF handshake 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:51 -0000 Handshakes with PF kernel driver to verify driver version compatibility. 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 | 96 +++++++++++++++++++++++++++++++++ drivers/net/liquidio/base/lio_23xx_vf.h | 4 ++ drivers/net/liquidio/base/lio_hw_defs.h | 3 ++ drivers/net/liquidio/base/lio_mbox.h | 1 + drivers/net/liquidio/lio_ethdev.c | 21 ++++++++ drivers/net/liquidio/lio_struct.h | 45 ++++++++++++++++ 6 files changed, 170 insertions(+) diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c index 70faa9b..6270af5 100644 --- a/drivers/net/liquidio/base/lio_23xx_vf.c +++ b/drivers/net/liquidio/base/lio_23xx_vf.c @@ -255,6 +255,102 @@ return 0; } +static void +cn23xx_pfvf_hs_callback(struct lio_device *lio_dev, + struct lio_mbox_cmd *cmd, void *arg) +{ + uint32_t major = 0; + + PMD_INIT_FUNC_TRACE(); + + rte_memcpy((uint8_t *)&lio_dev->pfvf_hsword, cmd->msg.s.params, 6); + if (cmd->recv_len > 1) { + struct lio_version *lio_ver = (struct lio_version *)cmd->data; + + major = lio_ver->major; + major = major << 16; + } + + rte_atomic64_set((rte_atomic64_t *)arg, major | 1); +} + +int +cn23xx_pfvf_handshake(struct lio_device *lio_dev) +{ + struct lio_mbox_cmd mbox_cmd; + struct lio_version *lio_ver = (struct lio_version *)&mbox_cmd.data[0]; + rte_atomic64_t status; + uint32_t count = 0; + uint32_t pfmajor; + uint32_t vfmajor; + uint32_t ret; + + PMD_INIT_FUNC_TRACE(); + + /* Sending VF_ACTIVE indication to the PF driver */ + lio_dev_dbg(lio_dev, "requesting info from PF\n"); + + mbox_cmd.msg.mbox_msg64 = 0; + mbox_cmd.msg.s.type = LIO_MBOX_REQUEST; + mbox_cmd.msg.s.resp_needed = 1; + mbox_cmd.msg.s.cmd = LIO_VF_ACTIVE; + mbox_cmd.msg.s.len = 2; + mbox_cmd.data[0] = 0; + lio_ver->major = LIO_BASE_MAJOR_VERSION; + lio_ver->minor = LIO_BASE_MINOR_VERSION; + lio_ver->micro = LIO_BASE_MICRO_VERSION; + mbox_cmd.q_no = 0; + mbox_cmd.recv_len = 0; + mbox_cmd.recv_status = 0; + mbox_cmd.fn = (lio_mbox_callback)cn23xx_pfvf_hs_callback; + mbox_cmd.fn_arg = (void *)&status; + + if (lio_mbox_write(lio_dev, &mbox_cmd)) { + lio_dev_err(lio_dev, "Write to mailbox failed\n"); + return -1; + } + + rte_atomic64_set(&status, 0); + + do { + rte_delay_ms(1); + } while ((rte_atomic64_read(&status) == 0) && (count++ < 10000)); + + ret = rte_atomic64_read(&status); + if (ret == 0) { + lio_dev_err(lio_dev, "cn23xx_pfvf_handshake timeout\n"); + return -1; + } + + vfmajor = LIO_BASE_MAJOR_VERSION; + pfmajor = ret >> 16; + if (pfmajor != vfmajor) { + lio_dev_err(lio_dev, + "VF LiquidIO driver (major version %d) is not compatible with LiquidIO PF driver (major version %d)\n", + vfmajor, pfmajor); + ret = -EPERM; + } else { + lio_dev_dbg(lio_dev, + "VF LiquidIO driver (major version %d), LiquidIO PF driver (major version %d)\n", + vfmajor, pfmajor); + ret = 0; + } + + return ret; +} + +void +cn23xx_vf_handle_mbox(struct lio_device *lio_dev) +{ + uint64_t mbox_int_val; + + /* read and clear by writing 1 */ + mbox_int_val = rte_read64(lio_dev->mbox[0]->mbox_int_reg); + rte_write64(mbox_int_val, lio_dev->mbox[0]->mbox_int_reg); + if (lio_mbox_read(lio_dev->mbox[0])) + lio_mbox_process_message(lio_dev->mbox[0]); +} + int cn23xx_vf_setup_device(struct lio_device *lio_dev) { diff --git a/drivers/net/liquidio/base/lio_23xx_vf.h b/drivers/net/liquidio/base/lio_23xx_vf.h index 1af09d0..83dc053 100644 --- a/drivers/net/liquidio/base/lio_23xx_vf.h +++ b/drivers/net/liquidio/base/lio_23xx_vf.h @@ -87,5 +87,9 @@ #define CN23XX_VF_BUSY_READING_REG_LOOP_COUNT 100000 +int cn23xx_pfvf_handshake(struct lio_device *lio_dev); + int cn23xx_vf_setup_device(struct lio_device *lio_dev); + +void cn23xx_vf_handle_mbox(struct lio_device *lio_dev); #endif /* _LIO_23XX_VF_H_ */ diff --git a/drivers/net/liquidio/base/lio_hw_defs.h b/drivers/net/liquidio/base/lio_hw_defs.h index ba51d7a..890ef17 100644 --- a/drivers/net/liquidio/base/lio_hw_defs.h +++ b/drivers/net/liquidio/base/lio_hw_defs.h @@ -77,6 +77,9 @@ enum lio_card_type { #define LIO_23XX_NAME "23xx" #define LIO_DEVICE_NAME_LEN 32 +#define LIO_BASE_MAJOR_VERSION 1 +#define LIO_BASE_MINOR_VERSION 5 +#define LIO_BASE_MICRO_VERSION 1 /* Routines for reading and writing CSRs */ #ifdef RTE_LIBRTE_LIO_DEBUG_REGS diff --git a/drivers/net/liquidio/base/lio_mbox.h b/drivers/net/liquidio/base/lio_mbox.h index 28c9e1a..f1c5b8e 100644 --- a/drivers/net/liquidio/base/lio_mbox.h +++ b/drivers/net/liquidio/base/lio_mbox.h @@ -42,6 +42,7 @@ #define LIO_MBOX_DATA_MAX 32 +#define LIO_VF_ACTIVE 0x1 #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 dd5e3b7..7318bf5 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -40,6 +40,20 @@ #include "lio_23xx_vf.h" #include "lio_ethdev.h" +static void +lio_check_pf_hs_response(void *lio_dev) +{ + struct lio_device *dev = lio_dev; + + /* check till response arrives */ + if (dev->pfvf_hsword.coproc_tics_per_us) + return; + + cn23xx_vf_handle_mbox(dev); + + rte_eal_alarm_set(1, lio_check_pf_hs_response, lio_dev); +} + /** * \brief Identify the LIO device and to map the BAR address space * @param lio_dev lio device @@ -91,6 +105,13 @@ goto error; } + /* Check PF response */ + lio_check_pf_hs_response((void *)lio_dev); + + /* Do handshake and exit if incompatible PF driver */ + if (cn23xx_pfvf_handshake(lio_dev)) + goto error; + if (cn23xx_vf_set_io_queues_off(lio_dev)) { lio_dev_err(lio_dev, "Setting io queues off failed\n"); goto error; diff --git a/drivers/net/liquidio/lio_struct.h b/drivers/net/liquidio/lio_struct.h index 01b5716..e8b6e1d 100644 --- a/drivers/net/liquidio/lio_struct.h +++ b/drivers/net/liquidio/lio_struct.h @@ -43,6 +43,13 @@ #include "lio_hw_defs.h" +struct lio_version { + uint16_t major; + uint16_t minor; + uint16_t micro; + uint16_t reserved; +}; + struct lio_device; struct lio_fn_list { int (*setup_mbox)(struct lio_device *); @@ -51,6 +58,42 @@ struct lio_fn_list { int (*setup_device_regs)(struct lio_device *); }; +struct lio_pf_vf_hs_word { +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN + /** PKIND value assigned for the DPI interface */ + uint64_t pkind : 8; + + /** OCTEON core clock multiplier */ + uint64_t core_tics_per_us : 16; + + /** OCTEON coprocessor clock multiplier */ + uint64_t coproc_tics_per_us : 16; + + /** app that currently running on OCTEON */ + uint64_t app_mode : 8; + + /** RESERVED */ + uint64_t reserved : 16; + +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN + + /** RESERVED */ + uint64_t reserved : 16; + + /** app that currently running on OCTEON */ + uint64_t app_mode : 8; + + /** OCTEON coprocessor clock multiplier */ + uint64_t coproc_tics_per_us : 16; + + /** OCTEON core clock multiplier */ + uint64_t core_tics_per_us : 16; + + /** PKIND value assigned for the DPI interface */ + uint64_t pkind : 8; +#endif +}; + struct lio_sriov_info { /** Number of rings assigned to VF */ uint32_t rings_per_vf; @@ -129,6 +172,8 @@ struct lio_device { struct lio_sriov_info sriov_info; + struct lio_pf_vf_hs_word pfvf_hsword; + /** Mail Box details of each lio queue. */ struct lio_mbox **mbox; -- 1.8.3.1