DPDK  17.08.2
rte_pmd_ixgbe.h
Go to the documentation of this file.
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 
39 #ifndef _PMD_IXGBE_H_
40 #define _PMD_IXGBE_H_
41 
42 #include <rte_ethdev.h>
43 
56 int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf);
57 
72 int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf,
73  struct ether_addr *mac_addr);
74 
90 int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on);
91 
107 int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on);
108 
125 int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf,
126  uint16_t vlan_id);
127 
142 int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on);
143 
158 int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on);
159 
177 int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on);
178 
196 int
197 rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
198 
215 int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp);
216 
228 
241 int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac);
242 
257 int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi);
258 
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 
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 
325 int
326 rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on);
327 
344 int
345 rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on);
346 
363 int
364 rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on);
365 
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 
405 int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk);
406 
427  uint8_t tc_num,
428  uint8_t *bw_weight);
429 
430 
442 int rte_pmd_ixgbe_bypass_init(uint8_t port);
443 
459 int rte_pmd_ixgbe_bypass_state_show(uint8_t port, uint32_t *state);
460 
476 int rte_pmd_ixgbe_bypass_state_set(uint8_t port, uint32_t *new_state);
477 
501  uint32_t event,
502  uint32_t *state);
503 
527  uint32_t event,
528  uint32_t state);
529 
550 int rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port, uint32_t timeout);
551 
564 int rte_pmd_ixgbe_bypass_ver_show(uint8_t port, uint32_t *ver);
565 
586 int rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout);
587 
599 
600 
609 };
610 
615  uint16_t vfid;
616  uint16_t msg_type;
617  uint16_t retval;
618  void *msg;
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_ */