.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Huawei HiNIC PCI Express Linux driver |
---|
3 | 4 | * Copyright(c) 2017 Huawei Technologies Co., Ltd |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify it |
---|
6 | | - * under the terms and conditions of the GNU General Public License, |
---|
7 | | - * version 2, as published by the Free Software Foundation. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
---|
10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
---|
12 | | - * for more details. |
---|
13 | | - * |
---|
14 | 5 | */ |
---|
15 | 6 | |
---|
16 | 7 | #ifndef HINIC_DEV_H |
---|
.. | .. |
---|
25 | 16 | #include "hinic_hw_dev.h" |
---|
26 | 17 | #include "hinic_tx.h" |
---|
27 | 18 | #include "hinic_rx.h" |
---|
| 19 | +#include "hinic_sriov.h" |
---|
28 | 20 | |
---|
29 | 21 | #define HINIC_DRV_NAME "hinic" |
---|
| 22 | + |
---|
| 23 | +#define LP_PKT_CNT 64 |
---|
30 | 24 | |
---|
31 | 25 | enum hinic_flags { |
---|
32 | 26 | HINIC_LINK_UP = BIT(0), |
---|
33 | 27 | HINIC_INTF_UP = BIT(1), |
---|
| 28 | + HINIC_RSS_ENABLE = BIT(2), |
---|
| 29 | + HINIC_LINK_DOWN = BIT(3), |
---|
| 30 | + HINIC_LP_TEST = BIT(4), |
---|
34 | 31 | }; |
---|
35 | 32 | |
---|
36 | 33 | struct hinic_rx_mode_work { |
---|
37 | 34 | struct work_struct work; |
---|
38 | 35 | u32 rx_mode; |
---|
| 36 | +}; |
---|
| 37 | + |
---|
| 38 | +struct hinic_rss_type { |
---|
| 39 | + u8 tcp_ipv6_ext; |
---|
| 40 | + u8 ipv6_ext; |
---|
| 41 | + u8 tcp_ipv6; |
---|
| 42 | + u8 ipv6; |
---|
| 43 | + u8 tcp_ipv4; |
---|
| 44 | + u8 ipv4; |
---|
| 45 | + u8 udp_ipv6; |
---|
| 46 | + u8 udp_ipv4; |
---|
| 47 | +}; |
---|
| 48 | + |
---|
| 49 | +enum hinic_rss_hash_type { |
---|
| 50 | + HINIC_RSS_HASH_ENGINE_TYPE_XOR, |
---|
| 51 | + HINIC_RSS_HASH_ENGINE_TYPE_TOEP, |
---|
| 52 | + HINIC_RSS_HASH_ENGINE_TYPE_MAX, |
---|
| 53 | +}; |
---|
| 54 | + |
---|
| 55 | +struct hinic_intr_coal_info { |
---|
| 56 | + u8 pending_limt; |
---|
| 57 | + u8 coalesce_timer_cfg; |
---|
| 58 | + u8 resend_timer_cfg; |
---|
| 59 | +}; |
---|
| 60 | + |
---|
| 61 | +enum hinic_dbg_type { |
---|
| 62 | + HINIC_DBG_SQ_INFO, |
---|
| 63 | + HINIC_DBG_RQ_INFO, |
---|
| 64 | + HINIC_DBG_FUNC_TABLE, |
---|
| 65 | +}; |
---|
| 66 | + |
---|
| 67 | +struct hinic_debug_priv { |
---|
| 68 | + struct hinic_dev *dev; |
---|
| 69 | + void *object; |
---|
| 70 | + enum hinic_dbg_type type; |
---|
| 71 | + struct dentry *root; |
---|
| 72 | + int field_id[64]; |
---|
39 | 73 | }; |
---|
40 | 74 | |
---|
41 | 75 | struct hinic_dev { |
---|
.. | .. |
---|
45 | 79 | u32 msg_enable; |
---|
46 | 80 | unsigned int tx_weight; |
---|
47 | 81 | unsigned int rx_weight; |
---|
| 82 | + u16 num_qps; |
---|
| 83 | + u16 max_qps; |
---|
48 | 84 | |
---|
49 | 85 | unsigned int flags; |
---|
50 | 86 | |
---|
.. | .. |
---|
56 | 92 | |
---|
57 | 93 | struct hinic_txq *txqs; |
---|
58 | 94 | struct hinic_rxq *rxqs; |
---|
| 95 | + u16 sq_depth; |
---|
| 96 | + u16 rq_depth; |
---|
59 | 97 | |
---|
60 | | - struct hinic_txq_stats tx_stats; |
---|
61 | | - struct hinic_rxq_stats rx_stats; |
---|
| 98 | + u8 rss_tmpl_idx; |
---|
| 99 | + u8 rss_hash_engine; |
---|
| 100 | + u16 num_rss; |
---|
| 101 | + u16 rss_limit; |
---|
| 102 | + struct hinic_rss_type rss_type; |
---|
| 103 | + u8 *rss_hkey_user; |
---|
| 104 | + s32 *rss_indir_user; |
---|
| 105 | + struct hinic_intr_coal_info *rx_intr_coalesce; |
---|
| 106 | + struct hinic_intr_coal_info *tx_intr_coalesce; |
---|
| 107 | + struct hinic_sriov_info sriov_info; |
---|
| 108 | + int lb_test_rx_idx; |
---|
| 109 | + int lb_pkt_len; |
---|
| 110 | + u8 *lb_test_rx_buf; |
---|
| 111 | + |
---|
| 112 | + struct dentry *dbgfs_root; |
---|
| 113 | + struct dentry *sq_dbgfs; |
---|
| 114 | + struct dentry *rq_dbgfs; |
---|
| 115 | + struct dentry *func_tbl_dbgfs; |
---|
| 116 | + struct hinic_debug_priv *dbg; |
---|
| 117 | + struct devlink *devlink; |
---|
| 118 | + bool cable_unplugged; |
---|
| 119 | + bool module_unrecognized; |
---|
| 120 | +}; |
---|
| 121 | + |
---|
| 122 | +struct hinic_devlink_priv { |
---|
| 123 | + struct hinic_hwdev *hwdev; |
---|
| 124 | + struct devlink_health_reporter *hw_fault_reporter; |
---|
| 125 | + struct devlink_health_reporter *fw_fault_reporter; |
---|
62 | 126 | }; |
---|
63 | 127 | |
---|
64 | 128 | #endif |
---|