New upstream version 17.11-rc3
[deb_dpdk.git] / drivers / net / ixgbe / rte_pmd_ixgbe.h
1 /*-
2  *   BSD LICENSE
3  *
4  *   Copyright (c) 2016 Intel Corporation. All rights reserved.
5  *
6  *   Redistribution and use in source and binary forms, with or without
7  *   modification, are permitted provided that the following conditions
8  *   are met:
9  *
10  *     * Redistributions of source code must retain the above copyright
11  *       notice, this list of conditions and the following disclaimer.
12  *     * Redistributions in binary form must reproduce the above copyright
13  *       notice, this list of conditions and the following disclaimer in
14  *       the documentation and/or other materials provided with the
15  *       distribution.
16  *     * Neither the name of Intel Corporation nor the names of its
17  *       contributors may be used to endorse or promote products derived
18  *       from this software without specific prior written permission.
19  *
20  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32
33 /**
34  * @file rte_pmd_ixgbe.h
35  * ixgbe PMD specific functions.
36  *
37  **/
38
39 #ifndef _PMD_IXGBE_H_
40 #define _PMD_IXGBE_H_
41
42 #include <rte_ethdev.h>
43
44 /**
45  * Notify VF when PF link status changes.
46  *
47  * @param port
48  *   The port identifier of the Ethernet device.
49  * @param vf
50  *   VF id.
51  * @return
52  *   - (0) if successful.
53  *   - (-ENODEV) if *port* invalid.
54  *   - (-EINVAL) if *vf* invalid.
55  */
56 int rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf);
57
58 /**
59  * Set the VF MAC address.
60  *
61  * @param port
62  *   The port identifier of the Ethernet device.
63  * @param vf
64  *   VF id.
65  * @param mac_addr
66  *   VF MAC address.
67  * @return
68  *   - (0) if successful.
69  *   - (-ENODEV) if *port* invalid.
70  *   - (-EINVAL) if *vf* or *mac_addr* is invalid.
71  */
72 int rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf,
73                 struct ether_addr *mac_addr);
74
75 /**
76  * Enable/Disable VF VLAN anti spoofing.
77  *
78  * @param port
79  *    The port identifier of the Ethernet device.
80  * @param vf
81  *    VF on which to set VLAN anti spoofing.
82  * @param on
83  *    1 - Enable VFs VLAN anti spoofing.
84  *    0 - Disable VFs VLAN anti spoofing.
85  * @return
86  *   - (0) if successful.
87  *   - (-ENODEV) if *port* invalid.
88  *   - (-EINVAL) if bad parameter.
89  */
90 int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf,
91                                          uint8_t on);
92
93 /**
94  * Enable/Disable VF MAC anti spoofing.
95  *
96  * @param port
97  *    The port identifier of the Ethernet device.
98  * @param vf
99  *    VF on which to set MAC anti spoofing.
100  * @param on
101  *    1 - Enable VFs MAC anti spoofing.
102  *    0 - Disable VFs MAC anti spoofing.
103  * @return
104  *   - (0) if successful.
105  *   - (-ENODEV) if *port* invalid.
106  *   - (-EINVAL) if bad parameter.
107  */
108 int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on);
109
110 /**
111  * Enable/Disable vf vlan insert
112  *
113  * @param port
114  *    The port identifier of the Ethernet device.
115  * @param vf
116  *    ID specifying VF.
117  * @param vlan_id
118  *    0 - Disable VF's vlan insert.
119  *    n - Enable; n is inserted as the vlan id.
120  *
121  * @return
122  *   - (0) if successful.
123  *   - (-ENODEV) if *port* invalid.
124  *   - (-EINVAL) if bad parameter.
125  */
126 int rte_pmd_ixgbe_set_vf_vlan_insert(uint16_t port, uint16_t vf,
127                 uint16_t vlan_id);
128
129 /**
130  * Enable/Disable tx loopback
131  *
132  * @param port
133  *    The port identifier of the Ethernet device.
134  * @param on
135  *    1 - Enable tx loopback.
136  *    0 - Disable tx loopback.
137  *
138  * @return
139  *   - (0) if successful.
140  *   - (-ENODEV) if *port* invalid.
141  *   - (-EINVAL) if bad parameter.
142  */
143 int rte_pmd_ixgbe_set_tx_loopback(uint16_t port, uint8_t on);
144
145 /**
146  * set all queues drop enable bit
147  *
148  * @param port
149  *    The port identifier of the Ethernet device.
150  * @param on
151  *    1 - set the queue drop enable bit for all pools.
152  *    0 - reset the queue drop enable bit for all pools.
153  *
154  * @return
155  *   - (0) if successful.
156  *   - (-ENODEV) if *port* invalid.
157  *   - (-EINVAL) if bad parameter.
158  */
159 int rte_pmd_ixgbe_set_all_queues_drop_en(uint16_t port, uint8_t on);
160
161 /**
162  * set drop enable bit in the VF split rx control register
163  *
164  * @param port
165  *    The port identifier of the Ethernet device.
166  * @param vf
167  *    ID specifying VF.
168  * @param on
169  *    1 - set the drop enable bit in the split rx control register.
170  *    0 - reset the drop enable bit in the split rx control register.
171  *
172  * @return
173  *   - (0) if successful.
174  *   - (-ENODEV) if *port* invalid.
175  *   - (-EINVAL) if bad parameter.
176  */
177
178 int rte_pmd_ixgbe_set_vf_split_drop_en(uint16_t port, uint16_t vf, uint8_t on);
179
180 /**
181  * Enable/Disable vf vlan strip for all queues in a pool
182  *
183  * @param port
184  *    The port identifier of the Ethernet device.
185  * @param vf
186  *    ID specifying VF.
187  * @param on
188  *    1 - Enable VF's vlan strip on RX queues.
189  *    0 - Disable VF's vlan strip on RX queues.
190  *
191  * @return
192  *   - (0) if successful.
193  *   - (-ENOTSUP) if hardware doesn't support this feature.
194  *   - (-ENODEV) if *port* invalid.
195  *   - (-EINVAL) if bad parameter.
196  */
197 int
198 rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on);
199
200 /**
201  * Enable MACsec offload.
202  *
203  * @param port
204  *   The port identifier of the Ethernet device.
205  * @param en
206  *    1 - Enable encryption (encrypt and add integrity signature).
207  *    0 - Disable encryption (only add integrity signature).
208  * @param rp
209  *    1 - Enable replay protection.
210  *    0 - Disable replay protection.
211  * @return
212  *   - (0) if successful.
213  *   - (-ENODEV) if *port* invalid.
214  *   - (-ENOTSUP) if hardware doesn't support this feature.
215  */
216 int rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp);
217
218 /**
219  * Disable MACsec offload.
220  *
221  * @param port
222  *   The port identifier of the Ethernet device.
223  * @return
224  *   - (0) if successful.
225  *   - (-ENODEV) if *port* invalid.
226  *   - (-ENOTSUP) if hardware doesn't support this feature.
227  */
228 int rte_pmd_ixgbe_macsec_disable(uint16_t port);
229
230 /**
231  * Configure Tx SC (Secure Connection).
232  *
233  * @param port
234  *   The port identifier of the Ethernet device.
235  * @param mac
236  *   The MAC address on the local side.
237  * @return
238  *   - (0) if successful.
239  *   - (-ENODEV) if *port* invalid.
240  *   - (-ENOTSUP) if hardware doesn't support this feature.
241  */
242 int rte_pmd_ixgbe_macsec_config_txsc(uint16_t port, uint8_t *mac);
243
244 /**
245  * Configure Rx SC (Secure Connection).
246  *
247  * @param port
248  *   The port identifier of the Ethernet device.
249  * @param mac
250  *   The MAC address on the remote side.
251  * @param pi
252  *   The PI (port identifier) on the remote side.
253  * @return
254  *   - (0) if successful.
255  *   - (-ENODEV) if *port* invalid.
256  *   - (-ENOTSUP) if hardware doesn't support this feature.
257  */
258 int rte_pmd_ixgbe_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi);
259
260 /**
261  * Enable Tx SA (Secure Association).
262  *
263  * @param port
264  *   The port identifier of the Ethernet device.
265  * @param idx
266  *   The SA to be enabled (0 or 1).
267  * @param an
268  *   The association number on the local side.
269  * @param pn
270  *   The packet number on the local side.
271  * @param key
272  *   The key on the local side.
273  * @return
274  *   - (0) if successful.
275  *   - (-ENODEV) if *port* invalid.
276  *   - (-ENOTSUP) if hardware doesn't support this feature.
277  *   - (-EINVAL) if bad parameter.
278  */
279 int rte_pmd_ixgbe_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an,
280                 uint32_t pn, uint8_t *key);
281
282 /**
283  * Enable Rx SA (Secure Association).
284  *
285  * @param port
286  *   The port identifier of the Ethernet device.
287  * @param idx
288  *   The SA to be enabled (0 or 1)
289  * @param an
290  *   The association number on the remote side.
291  * @param pn
292  *   The packet number on the remote side.
293  * @param key
294  *   The key on the remote side.
295  * @return
296  *   - (0) if successful.
297  *   - (-ENODEV) if *port* invalid.
298  *   - (-ENOTSUP) if hardware doesn't support this feature.
299  *   - (-EINVAL) if bad parameter.
300  */
301 int rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an,
302                 uint32_t pn, uint8_t *key);
303
304 /**
305 * Set RX L2 Filtering mode of a VF of an Ethernet device.
306 *
307 * @param port
308 *   The port identifier of the Ethernet device.
309 * @param vf
310 *   VF id.
311 * @param rx_mask
312 *    The RX mode mask, which is one or more of accepting Untagged Packets,
313 *    packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
314 *    ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
315 *    ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
316 *    in rx_mode.
317 * @param on
318 *    1 - Enable a VF RX mode.
319 *    0 - Disable a VF RX mode.
320 * @return
321 *   - (0) if successful.
322 *   - (-ENOTSUP) if hardware doesn't support.
323 *   - (-ENODEV) if *port_id* invalid.
324 *   - (-EINVAL) if bad parameter.
325 */
326 int
327 rte_pmd_ixgbe_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask,
328                              uint8_t on);
329
330 /**
331 * Enable or disable a VF traffic receive of an Ethernet device.
332 *
333 * @param port
334 *   The port identifier of the Ethernet device.
335 * @param vf
336 *   VF id.
337 * @param on
338 *    1 - Enable a VF traffic receive.
339 *    0 - Disable a VF traffic receive.
340 * @return
341 *   - (0) if successful.
342 *   - (-ENOTSUP) if hardware doesn't support.
343 *   - (-ENODEV) if *port_id* invalid.
344 *   - (-EINVAL) if bad parameter.
345 */
346 int
347 rte_pmd_ixgbe_set_vf_rx(uint16_t port, uint16_t vf, uint8_t on);
348
349 /**
350 * Enable or disable a VF traffic transmit of the Ethernet device.
351 *
352 * @param port
353 *   The port identifier of the Ethernet device.
354 * @param vf
355 *   VF id.
356 * @param on
357 *    1 - Enable a VF traffic transmit.
358 *    0 - Disable a VF traffic transmit.
359 * @return
360 *   - (0) if successful.
361 *   - (-ENODEV) if *port_id* invalid.
362 *   - (-ENOTSUP) if hardware doesn't support.
363 *   - (-EINVAL) if bad parameter.
364 */
365 int
366 rte_pmd_ixgbe_set_vf_tx(uint16_t port, uint16_t vf, uint8_t on);
367
368 /**
369 * Enable/Disable hardware VF VLAN filtering by an Ethernet device of
370 * received VLAN packets tagged with a given VLAN Tag Identifier.
371 *
372 * @param port
373 *   The port identifier of the Ethernet device.
374 * @param vlan
375 *   The VLAN Tag Identifier whose filtering must be enabled or disabled.
376 * @param vf_mask
377 *    Bitmap listing which VFs participate in the VLAN filtering.
378 * @param vlan_on
379 *    1 - Enable VFs VLAN filtering.
380 *    0 - Disable VFs VLAN filtering.
381 * @return
382 *   - (0) if successful.
383 *   - (-ENOTSUP) if hardware doesn't support.
384 *   - (-ENODEV) if *port_id* invalid.
385 *   - (-EINVAL) if bad parameter.
386 */
387 int
388 rte_pmd_ixgbe_set_vf_vlan_filter(uint16_t port, uint16_t vlan,
389                                  uint64_t vf_mask, uint8_t vlan_on);
390
391 /**
392  * Set the rate limitation for a vf on an Ethernet device.
393  *
394  * @param port
395  *   The port identifier of the Ethernet device.
396  * @param vf
397  *   VF id.
398  * @param tx_rate
399  *   The tx rate allocated from the total link speed for this VF id.
400  * @param q_msk
401  *   The queue mask which need to set the rate.
402  * @return
403  *   - (0) if successful.
404  *   - (-ENOTSUP) if hardware doesn't support this feature.
405  *   - (-ENODEV) if *port_id* invalid.
406  *   - (-EINVAL) if bad parameter.
407  */
408 int rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf,
409                                      uint16_t tx_rate, uint64_t q_msk);
410
411 /**
412  * Set all the TCs' bandwidth weight.
413  *
414  * The bw_weight means the percentage occupied by the TC.
415  * It can be taken as the relative min bandwidth setting.
416  *
417  * @param port
418  *    The port identifier of the Ethernet device.
419  * @param tc_num
420  *    Number of TCs.
421  * @param bw_weight
422  *    An array of relative bandwidth weight for all the TCs.
423  *    The summary of the bw_weight should be 100.
424  * @return
425  *   - (0) if successful.
426  *   - (-ENODEV) if *port* invalid.
427  *   - (-EINVAL) if bad parameter.
428  *   - (-ENOTSUP) not supported by firmware.
429  */
430 int rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port,
431                                   uint8_t tc_num,
432                                   uint8_t *bw_weight);
433
434
435 /**
436  * Initialize bypass logic. This function needs to be called before
437  * executing any other bypass API.
438  *
439  * @param port
440  *   The port identifier of the Ethernet device.
441  * @return
442  *   - (0) if successful.
443  *   - (-ENOTSUP) if hardware doesn't support.
444  *   - (-EINVAL) if bad parameter.
445  */
446 int rte_pmd_ixgbe_bypass_init(uint16_t port);
447
448 /**
449  * Return bypass state.
450  *
451  * @param port
452  *   The port identifier of the Ethernet device.
453  * @param state
454  *   The return bypass state.
455  *   - (1) Normal mode
456  *   - (2) Bypass mode
457  *   - (3) Isolate mode
458  * @return
459  *   - (0) if successful.
460  *   - (-ENOTSUP) if hardware doesn't support.
461  *   - (-EINVAL) if bad parameter.
462  */
463 int rte_pmd_ixgbe_bypass_state_show(uint16_t port, uint32_t *state);
464
465 /**
466  * Set bypass state
467  *
468  * @param port
469  *   The port identifier of the Ethernet device.
470  * @param new_state
471  *   The current bypass state.
472  *   - (1) Normal mode
473  *   - (2) Bypass mode
474  *   - (3) Isolate mode
475  * @return
476  *   - (0) if successful.
477  *   - (-ENOTSUP) if hardware doesn't support.
478  *   - (-EINVAL) if bad parameter.
479  */
480 int rte_pmd_ixgbe_bypass_state_set(uint16_t port, uint32_t *new_state);
481
482 /**
483  * Return bypass state when given event occurs.
484  *
485  * @param port
486  *   The port identifier of the Ethernet device.
487  * @param event
488  *   The bypass event
489  *   - (1) Main power on (power button is pushed)
490  *   - (2) Auxiliary power on (power supply is being plugged)
491  *   - (3) Main power off (system shutdown and power supply is left plugged in)
492  *   - (4) Auxiliary power off (power supply is being unplugged)
493  *   - (5) Display or set the watchdog timer
494  * @param state
495  *   The bypass state when given event occurred.
496  *   - (1) Normal mode
497  *   - (2) Bypass mode
498  *   - (3) Isolate mode
499  * @return
500  *   - (0) if successful.
501  *   - (-ENOTSUP) if hardware doesn't support.
502  *   - (-EINVAL) if bad parameter.
503  */
504 int rte_pmd_ixgbe_bypass_event_show(uint16_t port,
505                                     uint32_t event,
506                                     uint32_t *state);
507
508 /**
509  * Set bypass state when given event occurs.
510  *
511  * @param port
512  *   The port identifier of the Ethernet device.
513  * @param event
514  *   The bypass event
515  *   - (1) Main power on (power button is pushed)
516  *   - (2) Auxiliary power on (power supply is being plugged)
517  *   - (3) Main power off (system shutdown and power supply is left plugged in)
518  *   - (4) Auxiliary power off (power supply is being unplugged)
519  *   - (5) Display or set the watchdog timer
520  * @param state
521  *   The assigned state when given event occurs.
522  *   - (1) Normal mode
523  *   - (2) Bypass mode
524  *   - (3) Isolate mode
525  * @return
526  *   - (0) if successful.
527  *   - (-ENOTSUP) if hardware doesn't support.
528  *   - (-EINVAL) if bad parameter.
529  */
530 int rte_pmd_ixgbe_bypass_event_store(uint16_t port,
531                                      uint32_t event,
532                                      uint32_t state);
533
534 /**
535  * Set bypass watchdog timeout count.
536  *
537  * @param port
538  *   The port identifier of the Ethernet device.
539  * @param timeout
540  *   The timeout to be set.
541  *   - (0) 0 seconds (timer is off)
542  *   - (1) 1.5 seconds
543  *   - (2) 2 seconds
544  *   - (3) 3 seconds
545  *   - (4) 4 seconds
546  *   - (5) 8 seconds
547  *   - (6) 16 seconds
548  *   - (7) 32 seconds
549  * @return
550  *   - (0) if successful.
551  *   - (-ENOTSUP) if hardware doesn't support.
552  *   - (-EINVAL) if bad parameter.
553  */
554 int rte_pmd_ixgbe_bypass_wd_timeout_store(uint16_t port, uint32_t timeout);
555
556 /**
557  * Get bypass firmware version.
558  *
559  * @param port
560  *   The port identifier of the Ethernet device.
561  * @param ver
562  *   The firmware version
563  * @return
564  *   - (0) if successful.
565  *   - (-ENOTSUP) if hardware doesn't support.
566  *   - (-EINVAL) if bad parameter.
567  */
568 int rte_pmd_ixgbe_bypass_ver_show(uint16_t port, uint32_t *ver);
569
570 /**
571  * Return bypass watchdog timeout in seconds
572  *
573  * @param port
574  *   The port identifier of the Ethernet device.
575  * @param wd_timeout
576  *   The return watchdog timeout. "0" represents timer expired
577  *   - (0) 0 seconds (timer is off)
578  *   - (1) 1.5 seconds
579  *   - (2) 2 seconds
580  *   - (3) 3 seconds
581  *   - (4) 4 seconds
582  *   - (5) 8 seconds
583  *   - (6) 16 seconds
584  *   - (7) 32 seconds
585  * @return
586  *   - (0) if successful.
587  *   - (-ENOTSUP) if hardware doesn't support.
588  *   - (-EINVAL) if bad parameter.
589  */
590 int rte_pmd_ixgbe_bypass_wd_timeout_show(uint16_t port, uint32_t *wd_timeout);
591
592 /**
593  * Reset bypass watchdog timer
594  *
595  * @param port
596  *   The port identifier of the Ethernet device.
597  * @return
598  *   - (0) if successful.
599  *   - (-ENOTSUP) if hardware doesn't support.
600  *   - (-EINVAL) if bad parameter.
601  */
602 int rte_pmd_ixgbe_bypass_wd_reset(uint16_t port);
603
604
605 /**
606  * Response sent back to ixgbe driver from user app after callback
607  */
608 enum rte_pmd_ixgbe_mb_event_rsp {
609         RTE_PMD_IXGBE_MB_EVENT_NOOP_ACK,  /**< skip mbox request and ACK */
610         RTE_PMD_IXGBE_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */
611         RTE_PMD_IXGBE_MB_EVENT_PROCEED,  /**< proceed with mbox request  */
612         RTE_PMD_IXGBE_MB_EVENT_MAX       /**< max value of this enum */
613 };
614
615 /**
616  * Data sent to the user application when the callback is executed.
617  */
618 struct rte_pmd_ixgbe_mb_event_param {
619         uint16_t vfid;     /**< Virtual Function number */
620         uint16_t msg_type; /**< VF to PF message type, defined in ixgbe_mbx.h */
621         uint16_t retval;   /**< return value */
622         void *msg;         /**< pointer to message */
623 };
624 enum {
625         RTE_PMD_IXGBE_BYPASS_MODE_NONE,
626         RTE_PMD_IXGBE_BYPASS_MODE_NORMAL,
627         RTE_PMD_IXGBE_BYPASS_MODE_BYPASS,
628         RTE_PMD_IXGBE_BYPASS_MODE_ISOLATE,
629         RTE_PMD_IXGBE_BYPASS_MODE_NUM,
630 };
631
632 #define RTE_PMD_IXGBE_BYPASS_MODE_VALID(x)        \
633         ((x) > RTE_PMD_IXGBE_BYPASS_MODE_NONE &&  \
634         (x) < RTE_PMD_IXGBE_BYPASS_MODE_NUM)
635
636 enum {
637         RTE_PMD_IXGBE_BYPASS_EVENT_NONE,
638         RTE_PMD_IXGBE_BYPASS_EVENT_START,
639         RTE_PMD_IXGBE_BYPASS_EVENT_OS_ON = RTE_PMD_IXGBE_BYPASS_EVENT_START,
640         RTE_PMD_IXGBE_BYPASS_EVENT_POWER_ON,
641         RTE_PMD_IXGBE_BYPASS_EVENT_OS_OFF,
642         RTE_PMD_IXGBE_BYPASS_EVENT_POWER_OFF,
643         RTE_PMD_IXGBE_BYPASS_EVENT_TIMEOUT,
644         RTE_PMD_IXGBE_BYPASS_EVENT_NUM
645 };
646
647 #define RTE_PMD_IXGBE_BYPASS_EVENT_VALID(x)       \
648         ((x) > RTE_PMD_IXGBE_BYPASS_EVENT_NONE && \
649         (x) < RTE_PMD_IXGBE_BYPASS_MODE_NUM)
650
651 enum {
652         RTE_PMD_IXGBE_BYPASS_TMT_OFF,     /* timeout disabled. */
653         RTE_PMD_IXGBE_BYPASS_TMT_1_5_SEC, /* timeout for 1.5 seconds */
654         RTE_PMD_IXGBE_BYPASS_TMT_2_SEC,   /* timeout for 2 seconds */
655         RTE_PMD_IXGBE_BYPASS_TMT_3_SEC,   /* timeout for 3 seconds */
656         RTE_PMD_IXGBE_BYPASS_TMT_4_SEC,   /* timeout for 4 seconds */
657         RTE_PMD_IXGBE_BYPASS_TMT_8_SEC,   /* timeout for 8 seconds */
658         RTE_PMD_IXGBE_BYPASS_TMT_16_SEC,  /* timeout for 16 seconds */
659         RTE_PMD_IXGBE_BYPASS_TMT_32_SEC,  /* timeout for 32 seconds */
660         RTE_PMD_IXGBE_BYPASS_TMT_NUM
661 };
662
663 #define RTE_PMD_IXGBE_BYPASS_TMT_VALID(x)       \
664         ((x) == RTE_PMD_IXGBE_BYPASS_TMT_OFF || \
665         ((x) > RTE_PMD_IXGBE_BYPASS_TMT_OFF &&  \
666         (x) < RTE_PMD_IXGBE_BYPASS_TMT_NUM))
667
668 #endif /* _PMD_IXGBE_H_ */