From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0074.outbound.protection.outlook.com [104.47.36.74]) by dpdk.org (Postfix) with ESMTP id C06B7D47E for ; Sat, 25 Mar 2017 07:27:29 +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=Ic3YuwRDJADUmtC4jEvYGvzkqglm/40ii2n+bC2atPg=; b=i8Q3hdMUrAW9PNZ6y52fwB+MK6w4J5VdrIiAu+fFsleFJApIpD5GpUjLW9WMQE1evxezYGOaOr4gy70LnVP+3XfKyYo6WeBsZQ8WhDSQMfFSggkSFL3OFgWVFwoEhfZ1rNDW/fXmAXACYGW0aAFxB6F9qndnS+2A7uPOm+hpfDE= 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:25 +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:22 +0530 Message-Id: <1490423097-6797-12-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: 76f12b47-d277-4e8a-5e86-08d473480261 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:XtIEHQDLxsY7Yxjj9yL9DVnhO6vQlsFTmlqjE9/aHM5sXTRwvzhjeCydTfu05wvsXcJFu84PcwV3WJ9H4KexuMEcmh02rj2dwVs2aet22+0oTgqVrORwHG5Lvu1aNf8er5uurhcWCHOtHSTpD1vvnndOPNctnXHYTK2xj+U/CM1quD/QIEKgTkH4Qy6dVaQDlJhCcygYmtzxDPWPJVgj5sb+3TuC4hU9wdwH2uuT8s7SgXQ3M3MI3+DAJf0yKnKCCGIG04z4wcRNgTe7CrDSCg==; 25:ii6VepoBJrUkKpZN3hwfmtRSkPe5P49rGgsfGPnKXeHFPGDmBrd1j/ztbMPx/tLSSU7pzn2SvAYwVP3yiS8rvqL2X7NbYDieQNmgf6ty/CBjWYMw8ktwZZe9etlnN6EcUqXi7E9BLP7D1+tngKVI0pW9gJcQ9OvA/Vodi3DbnCO5s5Txnfjm6YK6v4ZY//5GiDcBRLrYK/+bhqaKuwSD/hd01dKSue7y+A0T1MEazBxrFpD6mzcDTwpbAEx7P0xdviqVN7fO7Wk8Gb2nKQYYY8DeiBX+tbYIDMB5s6Y40ajIWok/D0788pnY0yJ31WZW4JgWblfMerBj+2lAcAHfQ/Pv+X0rkYJKUcLsdbtnzoDYVUF/O1MtWiIFKhCC6bExcdC56ibZrZEWU/NPaH4+4B6fCcctOo8MM62wwcOZEF7fCCogFKd1IVnwLwaI7XAnDnpyc71UdOhyRScflM6ZGw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:N+E6R9bNZp1/DVv5YHYISFBneYYfAAcUUBZjy1NNpBhiU0V5FDTLTydnXWeYDKrYJ4rpSAovRKpYBr9RFc1dzfXJk4pL78QKkjAQrxY1girOBRaeGAjgrdS32iRlKJM32e3knMCyN9uWoSl2TbI3+m5wsn5xCuvuwQ8UEh8GAitekcF0X3UkHCTSBCogbhp6ZLb9lILVu9XIU54hopLcPrczFFTI2iup9U7OQuM/b4qSDzIRte63z4s1cEl9ftVL; 20:neoGgwB/9vfaLy8WqLxhZUXQPeiQt6wnoeu2MMYfyxn9W2aQqd/vMEUDgrNw8WWCwmsDJERJqt0rBx6AKD0sMpIB9ITDujO45ubkDY+9Z4EkxjqMpcgaITKlak6OmFOxoOYMxMIv2t6ss6S1OcQpiAJkL0B2Q07nBuRzg69IO2DuFfra9b0a3KNUcxkAQ0EGQ6Aq/n4eBmN7cgAQzaF8jD9mPpEJfJJntfs4bs9aCQCS9Ur2Lgx57ABFk8mdNKyE2WAL6SdT0i/vLXS9pf6zZUKrO5oPlsveWln8lOEN4kYUYic5VCycaOfgkRkxNxrY1mJ/AY9iGGio/ppjtIJVFKXv6MtIxIoP6ZDSDKTuITTFraKJL6WqDIXmhyu4o/iFPyyC2Sm649teB2E0EygVvydYqUuDzxq8VROMchLUqHF6xd9sZ6iVLOS75YWyV0mFjhOF2X3qpuP5TgbxZA0ormQ/yYh5SB7doyjqNTOE8pla0/pRKZWUdcVp4qDnZdxTB2qiINUX3O9UcxNdDTslETrRJgjZ2IuiN+8S+e/ao19R2sWmlX+snZBRWqFRxk6NJFBMcvjcWGtzpxUZyYIs1wkBMLLMxX0dHFxHnOiv0yQ= 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:QJ1cNOgda2p2u0f1i/ftSdy7C6bWrBKEMCZLiq1/Q/YNy7Oe6urA5rNFDGaYXmyB0hD5EJ3afhen0uDL1+WLHWZ/anBRl1q2wdIGYft1aqNx8d6jSRsUM3LWZs1rWBYK99LFAMqmvB/xWtsgy03FNihyMu6ByOQL33RDcGvvyeA69vXW/yD+RKOm1SGYct0sz9jNUR+nNE+j1ZwfFgMV5G5W++ukRdmBw2QjtzUlhLKV7Zcm/PVJiF+juwxfhfDe/QfSB/VadsOmaR+ePlLH7bttfKXYqK1mpi0g/N8jaI085FgIlG/S3wX43NZqF+7vtBUFsz+guarqtBjecTNoK0x+Dv2oHLsZQsDD4GOONv8XOBQb3eR5RxV2GBaXy1HVougutEHtAO3w/QSzDj/tdswoRR4/qHYeZoH6b4Dnxfth8L4EGFyfO2MAkiaWiguCYBvVu80rs/p5Fx43llI9OfxKnbBwWKLQPqebw4RJj57qvdIu5QAGD78lIURV0cUnmnuDXbXB8j2LrIEVxz+WfYrF0vhHjSDxyFVFnnIKbxryv0sDAqrN9YDqM4i6BTQYTp6nw7d6v4/o3BQZPfm8Q2wmGsiwXEvJAbHQg7Vxrjc= 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:mqrEp9of1QvW7o0h8u1Mkw4LR8QnxPNLLP1vpozZ9?= =?us-ascii?Q?WgOM6RNN6w4KgOOxZiqCMAVA+UOyz3ylmOzVdKLDIPoMqgUSLeHHOHO/O4GI?= =?us-ascii?Q?7TqTqobGzdqMjtSECfkVkOkW6AZnYE6dEDNbM/vPyVsdVscr8X5QzcpqZlhw?= =?us-ascii?Q?CUqB/4I4J2get6FYlScXWYj/c+UmfFQUc3ZL9466eBURwUorjzaBxlZbe89m?= =?us-ascii?Q?qUlAijH/W2tv1S6+D3vvB7QRDHa9E+9DpP9UKlyHIIgbDNL3RLEOey18grjl?= =?us-ascii?Q?db+umigZN9JuTLJW7G6cSamADH4hWlXDEFhrLWXYo+qGOoRPX0Ky2IOGMLHu?= =?us-ascii?Q?ve1M3s3aAfj301Cz1o1OkJv0Vx8YmLT36o+ixrarpEecM8dTFyUfGWmpMEzU?= =?us-ascii?Q?YR8MxcxBzff/FhqpIAVaFnupsTQlKWHwyIdDBRLJPyL5YyQ8jHBwAsScScLa?= =?us-ascii?Q?apkMPiUptaitJXgv7CgtdT2cVOZ+dVHDl+PtXfOdpDVPVdY1rLmKhycgIgS9?= =?us-ascii?Q?XZaGaE3GHXj/kq2lFTYtMxBVrONKoq7V3YMZxYI6Wsw62yUhgwJ6748RNS+l?= =?us-ascii?Q?LkbgheHn9b5rKwpZQLRwd5V0gwpIaCs5J1yvz9YW9/Xqi6P9W4N4Bp+3dMrq?= =?us-ascii?Q?ucG83tpBY2xayfPzcg2QgodC9TemAisQlP7PwbIMjllUoB311vQfOEgZg9PB?= =?us-ascii?Q?O+zbxiFHAiM3rmeO5K12kKOnP7E8aNjUWzIVcp525pkk63W7SFwqk3Og9dzr?= =?us-ascii?Q?cxIRfkZrg39Ndw4a8jjPLJ6ia9L0GnLq8OsK8v84R2ZfKq/HNzm9EqWfQqRF?= =?us-ascii?Q?Np5TxUvz0CpzzSBFa8/NzBtkZYYcmAVU0HYP9iYqOgN3FJN+HFSjdA21M8dw?= =?us-ascii?Q?mGi/8YiWikk9eJzrjn7McTSHkCLzS+GWT2u3qFE0uuweK3eQ7B02m7FZoRqk?= =?us-ascii?Q?lBdIw7g/0CiSPsB5TEIjphV6Jn1KXV/q1RBA9dck0mcpc10C4e11LR/A2Qx3?= =?us-ascii?Q?9M6wj54nPkWXquA0bQPMgidq8enPeqDe+xTQlbNEQU1tw29ptNfSPMrrj9YL?= =?us-ascii?Q?6LoNKgUhEkr484F+i1g5c1d6x00ofqsShpBUe5WIKGDlYmHJg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 6:DjK08LoU6rsqu7aH0poVKWvaaw8gjFkznf2BPrMqhCzqMndR562NWowrKUOpmRDg+crRoo8+XX4BZfZLveY0EV+e19kHODqdtiY+Xcy3MvDUXaTETsaEY0/xHaSofNteNvlI3EmkEppuzNGKJZzhkso1RQxoD9fhVpfmOJ9561FbSEIz+xn2SjyPJB90//o9SSXD0SHJbJ8Qly3PIbnLunet6o0lqTQAU9HHeiBZgxF0l7HZFPNkku5qeer8jLawMiKd6PRSri+CooftPMEmUe4CpkTevh4WXiGVxRLLbqqqsspaOsgdL81BQRXuZOEWDo7qz+Ve2X0E/iLP2FlJ8M7mWhhdLTYhmnPbEpMMADGcOJVCm/sVi30lAzi3K+kexX+4Lv+JSfXxeVDUR3V5vw==; 5:9aty3YnurMUilLl0ddhSk4+C181ecdPCa0J9rLTznD7vOO5XNaqj81NxzNWb4Mcv+RbN9872U4rMl0n0xZyLKyhpIyQb0V1NQLH3bMTPBGXIeXqkWIMzQMMUzW/pgEi6VrYIfUkOlvc3KsActAdM/g==; 24:77GhfONfTT/jeYpEZufgMboHXyN9RafH6Q3SYk8cXcXQ7aVfeiIEnQeuEfcWWYAsNhlfuq6jk0A/4ppJRRiRcmoclHdJyV6UY7rBYoErCiE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 7:jk/hGCI+QDAGkV9GRy/PZ2WSvOwAwkadobBLS1VaI7i2m2FSS7+TR1J1kdvhUdxQYFbqs71BUXE+CuxqYXdv1XRVSo6yiu4uRV8DVcQGKpAQOPOTRfz7D1qgHm1+r4IvJAyWhmHAsSTI7Q7Imgv3YQjOjn5b6a3rx1t+AZRT5hb7R1veDe6DIwjnEYEJeMKw07ej3cwh1MJ83bFh1ojKd7gBJuCsVFPVkcMRBq2pElofup7KYyZqQl1c3XNEXdHX5THlnZDq6MxFEltyOlaWTSgjwGH/UlMhNY+4h2Ld0c9mZVOz8IPUaYy6qGV1HhBA0ZmzLO1qBgSSvxc3mQTCkg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:27:25.5067 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 11/46] net/liquidio: add API for PF VF 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: Sat, 25 Mar 2017 06:27:30 -0000 Handshake with PF kernel driver to check 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: Srisivasubramanian S 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 a2654cd..9282068 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 5ee1bb5..bebe0e8 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