qede.h (3a37471551cd3b287ce7f02ed25bcf8ec37a191d) qede.h (89e1afc44765d8b9f509d15df096494f14463e17)
1/* QLogic qede NIC Driver
2 * Copyright (c) 2015-2017 QLogic Corporation
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 36 unchanged lines hidden (view full) ---

45#include <linux/qed/eth_common.h>
46#include <linux/qed/qed_if.h>
47#include <linux/qed/qed_chain.h>
48#include <linux/qed/qed_eth_if.h>
49
50#define QEDE_MAJOR_VERSION 8
51#define QEDE_MINOR_VERSION 10
52#define QEDE_REVISION_VERSION 10
1/* QLogic qede NIC Driver
2 * Copyright (c) 2015-2017 QLogic Corporation
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 36 unchanged lines hidden (view full) ---

45#include <linux/qed/eth_common.h>
46#include <linux/qed/qed_if.h>
47#include <linux/qed/qed_chain.h>
48#include <linux/qed/qed_eth_if.h>
49
50#define QEDE_MAJOR_VERSION 8
51#define QEDE_MINOR_VERSION 10
52#define QEDE_REVISION_VERSION 10
53#define QEDE_ENGINEERING_VERSION 20
53#define QEDE_ENGINEERING_VERSION 21
54#define DRV_MODULE_VERSION __stringify(QEDE_MAJOR_VERSION) "." \
55 __stringify(QEDE_MINOR_VERSION) "." \
56 __stringify(QEDE_REVISION_VERSION) "." \
57 __stringify(QEDE_ENGINEERING_VERSION)
58
59#define DRV_MODULE_SYM qede
60
54#define DRV_MODULE_VERSION __stringify(QEDE_MAJOR_VERSION) "." \
55 __stringify(QEDE_MINOR_VERSION) "." \
56 __stringify(QEDE_REVISION_VERSION) "." \
57 __stringify(QEDE_ENGINEERING_VERSION)
58
59#define DRV_MODULE_SYM qede
60
61struct qede_stats {
61struct qede_stats_common {
62 u64 no_buff_discards;
63 u64 packet_too_big_discard;
64 u64 ttl0_discard;
65 u64 rx_ucast_bytes;
66 u64 rx_mcast_bytes;
67 u64 rx_bcast_bytes;
68 u64 rx_ucast_pkts;
69 u64 rx_mcast_pkts;

--- 15 unchanged lines hidden (view full) ---

85
86 /* port */
87 u64 rx_64_byte_packets;
88 u64 rx_65_to_127_byte_packets;
89 u64 rx_128_to_255_byte_packets;
90 u64 rx_256_to_511_byte_packets;
91 u64 rx_512_to_1023_byte_packets;
92 u64 rx_1024_to_1518_byte_packets;
62 u64 no_buff_discards;
63 u64 packet_too_big_discard;
64 u64 ttl0_discard;
65 u64 rx_ucast_bytes;
66 u64 rx_mcast_bytes;
67 u64 rx_bcast_bytes;
68 u64 rx_ucast_pkts;
69 u64 rx_mcast_pkts;

--- 15 unchanged lines hidden (view full) ---

85
86 /* port */
87 u64 rx_64_byte_packets;
88 u64 rx_65_to_127_byte_packets;
89 u64 rx_128_to_255_byte_packets;
90 u64 rx_256_to_511_byte_packets;
91 u64 rx_512_to_1023_byte_packets;
92 u64 rx_1024_to_1518_byte_packets;
93 u64 rx_1519_to_1522_byte_packets;
94 u64 rx_1519_to_2047_byte_packets;
95 u64 rx_2048_to_4095_byte_packets;
96 u64 rx_4096_to_9216_byte_packets;
97 u64 rx_9217_to_16383_byte_packets;
98 u64 rx_crc_errors;
99 u64 rx_mac_crtl_frames;
100 u64 rx_pause_frames;
101 u64 rx_pfc_frames;
102 u64 rx_align_errors;
103 u64 rx_carrier_errors;
104 u64 rx_oversize_packets;
105 u64 rx_jabbers;
106 u64 rx_undersize_packets;
107 u64 rx_fragments;
108 u64 tx_64_byte_packets;
109 u64 tx_65_to_127_byte_packets;
110 u64 tx_128_to_255_byte_packets;
111 u64 tx_256_to_511_byte_packets;
112 u64 tx_512_to_1023_byte_packets;
113 u64 tx_1024_to_1518_byte_packets;
93 u64 rx_crc_errors;
94 u64 rx_mac_crtl_frames;
95 u64 rx_pause_frames;
96 u64 rx_pfc_frames;
97 u64 rx_align_errors;
98 u64 rx_carrier_errors;
99 u64 rx_oversize_packets;
100 u64 rx_jabbers;
101 u64 rx_undersize_packets;
102 u64 rx_fragments;
103 u64 tx_64_byte_packets;
104 u64 tx_65_to_127_byte_packets;
105 u64 tx_128_to_255_byte_packets;
106 u64 tx_256_to_511_byte_packets;
107 u64 tx_512_to_1023_byte_packets;
108 u64 tx_1024_to_1518_byte_packets;
109 u64 tx_pause_frames;
110 u64 tx_pfc_frames;
111 u64 brb_truncates;
112 u64 brb_discards;
113 u64 tx_mac_ctrl_frames;
114};
115
116struct qede_stats_bb {
117 u64 rx_1519_to_1522_byte_packets;
118 u64 rx_1519_to_2047_byte_packets;
119 u64 rx_2048_to_4095_byte_packets;
120 u64 rx_4096_to_9216_byte_packets;
121 u64 rx_9217_to_16383_byte_packets;
114 u64 tx_1519_to_2047_byte_packets;
115 u64 tx_2048_to_4095_byte_packets;
116 u64 tx_4096_to_9216_byte_packets;
117 u64 tx_9217_to_16383_byte_packets;
122 u64 tx_1519_to_2047_byte_packets;
123 u64 tx_2048_to_4095_byte_packets;
124 u64 tx_4096_to_9216_byte_packets;
125 u64 tx_9217_to_16383_byte_packets;
118 u64 tx_pause_frames;
119 u64 tx_pfc_frames;
120 u64 tx_lpi_entry_count;
121 u64 tx_total_collisions;
126 u64 tx_lpi_entry_count;
127 u64 tx_total_collisions;
122 u64 brb_truncates;
123 u64 brb_discards;
124 u64 tx_mac_ctrl_frames;
125};
126
128};
129
130struct qede_stats_ah {
131 u64 rx_1519_to_max_byte_packets;
132 u64 tx_1519_to_max_byte_packets;
133};
134
135struct qede_stats {
136 struct qede_stats_common common;
137
138 union {
139 struct qede_stats_bb bb;
140 struct qede_stats_ah ah;
141 };
142};
143
127struct qede_vlan {
128 struct list_head list;
129 u16 vid;
130 bool configured;
131};
132
133struct qede_rdma_dev {
134 struct qedr_dev *qedr_dev;

--- 18 unchanged lines hidden (view full) ---

153#define QEDE_TX_TIMESTAMPING_EN BIT(1)
154
155 const struct qed_eth_ops *ops;
156 struct qede_ptp *ptp;
157
158 struct qed_dev_eth_info dev_info;
159#define QEDE_MAX_RSS_CNT(edev) ((edev)->dev_info.num_queues)
160#define QEDE_MAX_TSS_CNT(edev) ((edev)->dev_info.num_queues)
144struct qede_vlan {
145 struct list_head list;
146 u16 vid;
147 bool configured;
148};
149
150struct qede_rdma_dev {
151 struct qedr_dev *qedr_dev;

--- 18 unchanged lines hidden (view full) ---

170#define QEDE_TX_TIMESTAMPING_EN BIT(1)
171
172 const struct qed_eth_ops *ops;
173 struct qede_ptp *ptp;
174
175 struct qed_dev_eth_info dev_info;
176#define QEDE_MAX_RSS_CNT(edev) ((edev)->dev_info.num_queues)
177#define QEDE_MAX_TSS_CNT(edev) ((edev)->dev_info.num_queues)
178#define QEDE_IS_BB(edev) \
179 ((edev)->dev_info.common.dev_type == QED_DEV_TYPE_BB)
180#define QEDE_IS_AH(edev) \
181 ((edev)->dev_info.common.dev_type == QED_DEV_TYPE_AH)
161
162 struct qede_fastpath *fp_array;
163 u8 req_num_tx;
164 u8 fp_num_tx;
165 u8 req_num_rx;
166 u8 fp_num_rx;
167 u16 req_queues;
168 u16 num_queues;

--- 154 unchanged lines hidden (view full) ---

323
324struct sw_tx_bd {
325 struct sk_buff *skb;
326 u8 flags;
327/* Set on the first BD descriptor when there is a split BD */
328#define QEDE_TSO_SPLIT_BD BIT(0)
329};
330
182
183 struct qede_fastpath *fp_array;
184 u8 req_num_tx;
185 u8 fp_num_tx;
186 u8 req_num_rx;
187 u8 fp_num_rx;
188 u16 req_queues;
189 u16 num_queues;

--- 154 unchanged lines hidden (view full) ---

344
345struct sw_tx_bd {
346 struct sk_buff *skb;
347 u8 flags;
348/* Set on the first BD descriptor when there is a split BD */
349#define QEDE_TSO_SPLIT_BD BIT(0)
350};
351
352struct sw_tx_xdp {
353 struct page *page;
354 dma_addr_t mapping;
355};
356
331struct qede_tx_queue {
332 u8 is_xdp;
333 bool is_legacy;
334 u16 sw_tx_cons;
335 u16 sw_tx_prod;
336 u16 num_tx_buffers; /* Slowpath only */
337
338 u64 xmit_pkts;

--- 7 unchanged lines hidden (view full) ---

346 void __iomem *doorbell_addr;
347 union db_prod tx_db;
348 int index; /* Slowpath only */
349#define QEDE_TXQ_XDP_TO_IDX(edev, txq) ((txq)->index - \
350 QEDE_MAX_TSS_CNT(edev))
351#define QEDE_TXQ_IDX_TO_XDP(edev, idx) ((idx) + QEDE_MAX_TSS_CNT(edev))
352
353 /* Regular Tx requires skb + metadata for release purpose,
357struct qede_tx_queue {
358 u8 is_xdp;
359 bool is_legacy;
360 u16 sw_tx_cons;
361 u16 sw_tx_prod;
362 u16 num_tx_buffers; /* Slowpath only */
363
364 u64 xmit_pkts;

--- 7 unchanged lines hidden (view full) ---

372 void __iomem *doorbell_addr;
373 union db_prod tx_db;
374 int index; /* Slowpath only */
375#define QEDE_TXQ_XDP_TO_IDX(edev, txq) ((txq)->index - \
376 QEDE_MAX_TSS_CNT(edev))
377#define QEDE_TXQ_IDX_TO_XDP(edev, idx) ((idx) + QEDE_MAX_TSS_CNT(edev))
378
379 /* Regular Tx requires skb + metadata for release purpose,
354 * while XDP requires only the pages themselves.
380 * while XDP requires the pages and the mapped address.
355 */
356 union {
357 struct sw_tx_bd *skbs;
381 */
382 union {
383 struct sw_tx_bd *skbs;
358 struct page **pages;
384 struct sw_tx_xdp *xdp;
359 } sw_tx_ring;
360
361 struct qed_chain tx_pbl;
362
363 /* Slowpath; Should be kept in end [unless missing padding] */
364 void *handle;
365};
366

--- 122 unchanged lines hidden ---
385 } sw_tx_ring;
386
387 struct qed_chain tx_pbl;
388
389 /* Slowpath; Should be kept in end [unless missing padding] */
390 void *handle;
391};
392

--- 122 unchanged lines hidden ---