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