1 /* SPDX-License-Identifier: BSD-3-Clause 2 * 3 * Copyright(c) 2019-2021 Xilinx, Inc. 4 * Copyright(c) 2019 Solarflare Communications Inc. 5 * 6 * This software was jointly developed between OKTET Labs (under contract 7 * for Solarflare) and Solarflare Communications, Inc. 8 */ 9 10 #ifndef _SFC_SWITCH_H 11 #define _SFC_SWITCH_H 12 13 #include <stdint.h> 14 15 #include "efx.h" 16 17 #include "sfc.h" 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 /** Options for MAE switch port type */ 24 enum sfc_mae_switch_port_type { 25 /** 26 * The switch port is operated by a self-sufficient RTE ethdev 27 * and thus refers to its underlying PCIe function 28 */ 29 SFC_MAE_SWITCH_PORT_INDEPENDENT = 0, 30 }; 31 32 struct sfc_mae_switch_port_request { 33 enum sfc_mae_switch_port_type type; 34 const efx_mport_sel_t *entity_mportp; 35 const efx_mport_sel_t *ethdev_mportp; 36 uint16_t ethdev_port_id; 37 }; 38 39 int sfc_mae_assign_switch_domain(struct sfc_adapter *sa, 40 uint16_t *switch_domain_id); 41 42 int sfc_mae_assign_switch_port(uint16_t switch_domain_id, 43 const struct sfc_mae_switch_port_request *req, 44 uint16_t *switch_port_id); 45 46 int sfc_mae_switch_port_by_ethdev(uint16_t switch_domain_id, 47 uint16_t ethdev_port_id, 48 efx_mport_sel_t *mport_sel); 49 50 #ifdef __cplusplus 51 } 52 #endif 53 #endif /* _SFC_SWITCH_H */ 54