d33c285dbf0a37e665291f78a80adab27f995c2e
[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(uint8_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(uint8_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(uint8_t port, uint16_t vf, uint8_t on);
91
92 /**
93  * Enable/Disable VF MAC anti spoofing.
94  *
95  * @param port
96  *    The port identifier of the Ethernet device.
97  * @param vf
98  *    VF on which to set MAC anti spoofing.
99  * @param on
100  *    1 - Enable VFs MAC anti spoofing.
101  *    0 - Disable VFs MAC anti spoofing.
102  * @return
103  *   - (0) if successful.
104  *   - (-ENODEV) if *port* invalid.
105  *   - (-EINVAL) if bad parameter.
106  */
107 int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on);
108
109 /**
110  * Enable/Disable vf vlan insert
111  *
112  * @param port
113  *    The port identifier of the Ethernet device.
114  * @param vf
115  *    ID specifying VF.
116  * @param vlan_id
117  *    0 - Disable VF's vlan insert.
118  *    n - Enable; n is inserted as the vlan id.
119  *
120  * @return
121  *   - (0) if successful.
122  *   - (-ENODEV) if *port* invalid.
123  *   - (-EINVAL) if bad parameter.
124  */
125 int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf,
126                 uint16_t vlan_id);
127
128 /**
129  * Enable/Disable tx loopback
130  *
131  * @param port
132  *    The port identifier of the Ethernet device.
133  * @param on
134  *    1 - Enable tx loopback.
135  *    0 - Disable tx loopback.
136  *
137  * @return
138  *   - (0) if successful.
139  *   - (-ENODEV) if *port* invalid.
140  *   - (-EINVAL) if bad parameter.
141  */
142 int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on);
143
144 /**
145  * set all queues drop enable bit
146  *
147  * @param port
148  *    The port identifier of the Ethernet device.
149  * @param on
150  *    1 - set the queue drop enable bit for all pools.
151  *    0 - reset the queue drop enable bit for all pools.
152  *
153  * @return
154  *   - (0) if successful.
155  *   - (-ENODEV) if *port* invalid.
156  *   - (-EINVAL) if bad parameter.
157  */
158 int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on);
159
160 /**
161  * set drop enable bit in the VF split rx control register
162  *
163  * @param port
164  *    The port identifier of the Ethernet device.
165  * @param vf
166  *    ID specifying VF.
167  * @param on
168  *    1 - set the drop enable bit in the split rx control register.
169  *    0 - reset the drop enable bit in the split rx control register.
170  *
171  * @return
172  *   - (0) if successful.
173  *   - (-ENODEV) if *port* invalid.
174  *   - (-EINVAL) if bad parameter.
175  */
176
177 int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on);
178
179 /**
180  * Enable/Disable vf vlan strip for all queues in a pool
181  *
182  * @param port
183  *    The port identifier of the Ethernet device.
184  * @param vf
185  *    ID specifying VF.
186  * @param on
187  *    1 - Enable VF's vlan strip on RX queues.
188  *    0 - Disable VF's vlan strip on RX queues.
189  *
190  * @return
191  *   - (0) if successful.
192  *   - (-ENOTSUP) if hardware doesn't support this feature.
193  *   - (-ENODEV) if *port* invalid.
194  *   - (-EINVAL) if bad parameter.
195  */
196 int
197 rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
198
199 /**
200  * Enable MACsec offload.
201  *
202  * @param port
203  *   The port identifier of the Ethernet device.
204  * @param en
205  *    1 - Enable encryption (encrypt and add integrity signature).
206  *    0 - Disable encryption (only add integrity signature).
207  * @param rp
208  *    1 - Enable replay protection.
209  *    0 - Disable replay protection.
210  * @return
211  *   - (0) if successful.
212  *   - (-ENODEV) if *port* invalid.
213  *   - (-ENOTSUP) if hardware doesn't support this feature.
214  */
215 int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp);
216
217 /**
218  * Disable MACsec offload.
219  *
220  * @param port
221  *   The port identifier of the Ethernet device.
222  * @return
223  *   - (0) if successful.
224  *   - (-ENODEV) if *port* invalid.
225  *   - (-ENOTSUP) if hardware doesn't support this feature.
226  */
227 int rte_pmd_ixgbe_macsec_disable(uint8_t port);
228
229 /**
230  * Configure Tx SC (Secure Connection).
231  *
232  * @param port
233  *   The port identifier of the Ethernet device.
234  * @param mac
235  *   The MAC address on the local side.
236  * @return
237  *   - (0) if successful.
238  *   - (-ENODEV) if *port* invalid.
239  *   - (-ENOTSUP) if hardware doesn't support this feature.
240  */
241 int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac);
242
243 /**
244  * Configure Rx SC (Secure Connection).
245  *
246  * @param port
247  *   The port identifier of the Ethernet device.
248  * @param mac
249  *   The MAC address on the remote side.
250  * @param pi
251  *   The PI (port identifier) on the remote side.
252  * @return
253  *   - (0) if successful.
254  *   - (-ENODEV) if *port* invalid.
255  *   - (-ENOTSUP) if hardware doesn't support this feature.
256  */
257 int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi);
258
259 /**
260  * Enable Tx SA (Secure Association).
261  *
262  * @param port
263  *   The port identifier of the Ethernet device.
264  * @param idx
265  *   The SA to be enabled (0 or 1).
266  * @param an
267  *   The association number on the local side.
268  * @param pn
269  *   The packet number on the local side.
270  * @param key
271  *   The key on the local side.
272  * @return
273  *   - (0) if successful.
274  *   - (-ENODEV) if *port* invalid.
275  *   - (-ENOTSUP) if hardware doesn't support this feature.
276  *   - (-EINVAL) if bad parameter.
277  */
278 int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an,
279                 uint32_t pn, uint8_t *key);
280
281 /**
282  * Enable Rx SA (Secure Association).
283  *
284  * @param port
285  *   The port identifier of the Ethernet device.
286  * @param idx
287  *   The SA to be enabled (0 or 1)
288  * @param an
289  *   The association number on the remote side.
290  * @param pn
291  *   The packet number on the remote side.
292  * @param key
293  *   The key on the remote side.
294  * @return
295  *   - (0) if successful.
296  *   - (-ENODEV) if *port* invalid.
297  *   - (-ENOTSUP) if hardware doesn't support this feature.
298  *   - (-EINVAL) if bad parameter.
299  */
300 int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an,
301                 uint32_t pn, uint8_t *key);
302
303 /**
304 * Set RX L2 Filtering mode of a VF of an Ethernet device.
305 *
306 * @param port
307 *   The port identifier of the Ethernet device.
308 * @param vf
309 *   VF id.
310 * @param rx_mask
311 *    The RX mode mask, which is one or more of accepting Untagged Packets,
312 *    packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
313 *    ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
314 *    ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
315 *    in rx_mode.
316 * @param on
317 *    1 - Enable a VF RX mode.
318 *    0 - Disable a VF RX mode.
319 * @return
320 *   - (0) if successful.
321 *   - (-ENOTSUP) if hardware doesn't support.
322 *   - (-ENODEV) if *port_id* invalid.
323 *   - (-EINVAL) if bad parameter.
324 */
325 int
326 rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on);
327
328 /**
329 * Enable or disable a VF traffic receive of an Ethernet device.
330 *
331 * @param port
332 *   The port identifier of the Ethernet device.
333 * @param vf
334 *   VF id.
335 * @param on
336 *    1 - Enable a VF traffic receive.
337 *    0 - Disable a VF traffic receive.
338 * @return
339 *   - (0) if successful.
340 *   - (-ENOTSUP) if hardware doesn't support.
341 *   - (-ENODEV) if *port_id* invalid.
342 *   - (-EINVAL) if bad parameter.
343 */
344 int
345 rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on);
346
347 /**
348 * Enable or disable a VF traffic transmit of the Ethernet device.
349 *
350 * @param port
351 *   The port identifier of the Ethernet device.
352 * @param vf
353 *   VF id.
354 * @param on
355 *    1 - Enable a VF traffic transmit.
356 *    0 - Disable a VF traffic transmit.
357 * @return
358 *   - (0) if successful.
359 *   - (-ENODEV) if *port_id* invalid.
360 *   - (-ENOTSUP) if hardware doesn't support.
361 *   - (-EINVAL) if bad parameter.
362 */
363 int
364 rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on);
365
366 /**
367 * Enable/Disable hardware VF VLAN filtering by an Ethernet device of
368 * received VLAN packets tagged with a given VLAN Tag Identifier.
369 *
370 * @param port
371 *   The port identifier of the Ethernet device.
372 * @param vlan
373 *   The VLAN Tag Identifier whose filtering must be enabled or disabled.
374 * @param vf_mask
375 *    Bitmap listing which VFs participate in the VLAN filtering.
376 * @param vlan_on
377 *    1 - Enable VFs VLAN filtering.
378 *    0 - Disable VFs VLAN filtering.
379 * @return
380 *   - (0) if successful.
381 *   - (-ENOTSUP) if hardware doesn't support.
382 *   - (-ENODEV) if *port_id* invalid.
383 *   - (-EINVAL) if bad parameter.
384 */
385 int
386 rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on);
387
388 /**
389  * Set the rate limitation for a vf on an Ethernet device.
390  *
391  * @param port
392  *   The port identifier of the Ethernet device.
393  * @param vf
394  *   VF id.
395  * @param tx_rate
396  *   The tx rate allocated from the total link speed for this VF id.
397  * @param q_msk
398  *   The queue mask which need to set the rate.
399  * @return
400  *   - (0) if successful.
401  *   - (-ENOTSUP) if hardware doesn't support this feature.
402  *   - (-ENODEV) if *port_id* invalid.
403  *   - (-EINVAL) if bad parameter.
404  */
405 int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk);
406
407 /**
408  * Set all the TCs' bandwidth weight.
409  *
410  * The bw_weight means the percentage occupied by the TC.
411  * It can be taken as the relative min bandwidth setting.
412  *
413  * @param port
414  *    The port identifier of the Ethernet device.
415  * @param tc_num
416  *    Number of TCs.
417  * @param bw_weight
418  *    An array of relative bandwidth weight for all the TCs.
419  *    The summary of the bw_weight should be 100.
420  * @return
421  *   - (0) if successful.
422  *   - (-ENODEV) if *port* invalid.
423  *   - (-EINVAL) if bad parameter.
424  *   - (-ENOTSUP) not supported by firmware.
425  */
426 int rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port,
427                                   uint8_t tc_num,
428                                   uint8_t *bw_weight);
429
430
431 /**
432  * Initialize bypass logic. This function needs to be called before
433  * executing any other bypass API.
434  *
435  * @param port
436  *   The port identifier of the Ethernet device.
437  * @return
438  *   - (0) if successful.
439  *   - (-ENOTSUP) if hardware doesn't support.
440  *   - (-EINVAL) if bad parameter.
441  */
442 int rte_pmd_ixgbe_bypass_init(uint8_t port);
443
444 /**
445  * Return bypass state.
446  *
447  * @param port
448  *   The port identifier of the Ethernet device.
449  * @param state
450  *   The return bypass state.
451  *   - (1) Normal mode
452  *   - (2) Bypass mode
453  *   - (3) Isolate mode
454  * @return
455  *   - (0) if successful.
456  *   - (-ENOTSUP) if hardware doesn't support.
457  *   - (-EINVAL) if bad parameter.
458  */
459 int rte_pmd_ixgbe_bypass_state_show(uint8_t port, uint32_t *state);
460
461 /**
462  * Set bypass state
463  *
464  * @param port
465  *   The port identifier of the Ethernet device.
466  * @param new_state
467  *   The current bypass state.
468  *   - (1) Normal mode
469  *   - (2) Bypass mode
470  *   - (3) Isolate mode
471  * @return
472  *   - (0) if successful.
473  *   - (-ENOTSUP) if hardware doesn't support.
474  *   - (-EINVAL) if bad parameter.
475  */
476 int rte_pmd_ixgbe_bypass_state_set(uint8_t port, uint32_t *new_state);
477
478 /**
479  * Return bypass state when given event occurs.
480  *
481  * @param port
482  *   The port identifier of the Ethernet device.
483  * @param event
484  *   The bypass event
485  *   - (1) Main power on (power button is pushed)
486  *   - (2) Auxiliary power on (power supply is being plugged)
487  *   - (3) Main power off (system shutdown and power supply is left plugged in)
488  *   - (4) Auxiliary power off (power supply is being unplugged)
489  *   - (5) Display or set the watchdog timer
490  * @param state
491  *   The bypass state when given event occurred.
492  *   - (1) Normal mode
493  *   - (2) Bypass mode
494  *   - (3) Isolate mode
495  * @return
496  *   - (0) if successful.
497  *   - (-ENOTSUP) if hardware doesn't support.
498  *   - (-EINVAL) if bad parameter.
499  */
500 int rte_pmd_ixgbe_bypass_event_show(uint8_t port,
501                                     uint32_t event,
502                                     uint32_t *state);
503
504 /**
505  * Set bypass state when given event occurs.
506  *
507  * @param port
508  *   The port identifier of the Ethernet device.
509  * @param event
510  *   The bypass event
511  *   - (1) Main power on (power button is pushed)
512  *   - (2) Auxiliary power on (power supply is being plugged)
513  *   - (3) Main power off (system shutdown and power supply is left plugged in)
514  *   - (4) Auxiliary power off (power supply is being unplugged)
515  *   - (5) Display or set the watchdog timer
516  * @param state
517  *   The assigned state when given event occurs.
518  *   - (1) Normal mode
519  *   - (2) Bypass mode
520  *   - (3) Isolate mode
521  * @return
522  *   - (0) if successful.
523  *   - (-ENOTSUP) if hardware doesn't support.
524  *   - (-EINVAL) if bad parameter.
525  */
526 int rte_pmd_ixgbe_bypass_event_store(uint8_t port,
527                                      uint32_t event,
528                                      uint32_t state);
529
530 /**
531  * Set bypass watchdog timeout count.
532  *
533  * @param port
534  *   The port identifier of the Ethernet device.
535  * @param timeout
536  *   The timeout to be set.
537  *   - (0) 0 seconds (timer is off)
538  *   - (1) 1.5 seconds
539  *   - (2) 2 seconds
540  *   - (3) 3 seconds
541  *   - (4) 4 seconds
542  *   - (5) 8 seconds
543  *   - (6) 16 seconds
544  *   - (7) 32 seconds
545  * @return
546  *   - (0) if successful.
547  *   - (-ENOTSUP) if hardware doesn't support.
548  *   - (-EINVAL) if bad parameter.
549  */
550 int rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port, uint32_t timeout);
551
552 /**
553  * Get bypass firmware version.
554  *
555  * @param port
556  *   The port identifier of the Ethernet device.
557  * @param ver
558  *   The firmware version
559  * @return
560  *   - (0) if successful.
561  *   - (-ENOTSUP) if hardware doesn't support.
562  *   - (-EINVAL) if bad parameter.
563  */
564 int rte_pmd_ixgbe_bypass_ver_show(uint8_t port, uint32_t *ver);
565
566 /**
567  * Return bypass watchdog timeout in seconds
568  *
569  * @param port
570  *   The port identifier of the Ethernet device.
571  * @param wd_timeout
572  *   The return watchdog timeout. "0" represents timer expired
573  *   - (0) 0 seconds (timer is off)
574  *   - (1) 1.5 seconds
575  *   - (2) 2 seconds
576  *   - (3) 3 seconds
577  *   - (4) 4 seconds
578  *   - (5) 8 seconds
579  *   - (6) 16 seconds
580  *   - (7) 32 seconds
581  * @return
582  *   - (0) if successful.
583  *   - (-ENOTSUP) if hardware doesn't support.
584  *   - (-EINVAL) if bad parameter.
585  */
586 int rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout);
587
588 /**
589  * Reset bypass watchdog timer
590  *
591  * @param port
592  *   The port identifier of the Ethernet device.
593  * @return
594  *   - (0) if successful.
595  *   - (-ENOTSUP) if hardware doesn't support.
596  *   - (-EINVAL) if bad parameter.
597  */
598 int rte_pmd_ixgbe_bypass_wd_reset(uint8_t port);
599
600
601 /**
602  * Response sent back to ixgbe driver from user app after callback
603  */
604 enum rte_pmd_ixgbe_mb_event_rsp {
605         RTE_PMD_IXGBE_MB_EVENT_NOOP_ACK,  /**< skip mbox request and ACK */
606         RTE_PMD_IXGBE_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */
607         RTE_PMD_IXGBE_MB_EVENT_PROCEED,  /**< proceed with mbox request  */
608         RTE_PMD_IXGBE_MB_EVENT_MAX       /**< max value of this enum */
609 };
610
611 /**
612  * Data sent to the user application when the callback is executed.
613  */
614 struct rte_pmd_ixgbe_mb_event_param {
615         uint16_t vfid;     /**< Virtual Function number */
616         uint16_t msg_type; /**< VF to PF message type, defined in ixgbe_mbx.h */
617         uint16_t retval;   /**< return value */
618         void *msg;         /**< pointer to message */
619 };
620 enum {
621         RTE_PMD_IXGBE_BYPASS_MODE_NONE,
622         RTE_PMD_IXGBE_BYPASS_MODE_NORMAL,
623         RTE_PMD_IXGBE_BYPASS_MODE_BYPASS,
624         RTE_PMD_IXGBE_BYPASS_MODE_ISOLATE,
625         RTE_PMD_IXGBE_BYPASS_MODE_NUM,
626 };
627
628 #define RTE_PMD_IXGBE_BYPASS_MODE_VALID(x)        \
629         ((x) > RTE_PMD_IXGBE_BYPASS_MODE_NONE &&  \
630         (x) < RTE_PMD_IXGBE_BYPASS_MODE_NUM)
631
632 enum {
633         RTE_PMD_IXGBE_BYPASS_EVENT_NONE,
634         RTE_PMD_IXGBE_BYPASS_EVENT_START,
635         RTE_PMD_IXGBE_BYPASS_EVENT_OS_ON = RTE_PMD_IXGBE_BYPASS_EVENT_START,
636         RTE_PMD_IXGBE_BYPASS_EVENT_POWER_ON,
637         RTE_PMD_IXGBE_BYPASS_EVENT_OS_OFF,
638         RTE_PMD_IXGBE_BYPASS_EVENT_POWER_OFF,
639         RTE_PMD_IXGBE_BYPASS_EVENT_TIMEOUT,
640         RTE_PMD_IXGBE_BYPASS_EVENT_NUM
641 };
642
643 #define RTE_PMD_IXGBE_BYPASS_EVENT_VALID(x)       \
644         ((x) > RTE_PMD_IXGBE_BYPASS_EVENT_NONE && \
645         (x) < RTE_PMD_IXGBE_BYPASS_MODE_NUM)
646
647 enum {
648         RTE_PMD_IXGBE_BYPASS_TMT_OFF,     /* timeout disabled. */
649         RTE_PMD_IXGBE_BYPASS_TMT_1_5_SEC, /* timeout for 1.5 seconds */
650         RTE_PMD_IXGBE_BYPASS_TMT_2_SEC,   /* timeout for 2 seconds */
651         RTE_PMD_IXGBE_BYPASS_TMT_3_SEC,   /* timeout for 3 seconds */
652         RTE_PMD_IXGBE_BYPASS_TMT_4_SEC,   /* timeout for 4 seconds */
653         RTE_PMD_IXGBE_BYPASS_TMT_8_SEC,   /* timeout for 8 seconds */
654         RTE_PMD_IXGBE_BYPASS_TMT_16_SEC,  /* timeout for 16 seconds */
655         RTE_PMD_IXGBE_BYPASS_TMT_32_SEC,  /* timeout for 32 seconds */
656         RTE_PMD_IXGBE_BYPASS_TMT_NUM
657 };
658
659 #define RTE_PMD_IXGBE_BYPASS_TMT_VALID(x)       \
660         ((x) == RTE_PMD_IXGBE_BYPASS_TMT_OFF || \
661         ((x) > RTE_PMD_IXGBE_BYPASS_TMT_OFF &&  \
662         (x) < RTE_PMD_IXGBE_BYPASS_TMT_NUM))
663
664 #endif /* _PMD_IXGBE_H_ */