vport.h revision 292196
1/*- 2 * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND 14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 * 25 * $FreeBSD: stable/10/sys/dev/mlx5/vport.h 292196 2015-12-14 10:31:03Z hselasky $ 26 */ 27 28#ifndef __MLX5_VPORT_H__ 29#define __MLX5_VPORT_H__ 30 31#include <dev/mlx5/driver.h> 32int mlx5_vport_alloc_q_counter(struct mlx5_core_dev *mdev, 33 int *counter_set_id); 34int mlx5_vport_dealloc_q_counter(struct mlx5_core_dev *mdev, 35 int counter_set_id); 36int mlx5_vport_query_out_of_rx_buffer(struct mlx5_core_dev *mdev, 37 int counter_set_id, 38 u32 *out_of_rx_buffer); 39 40u8 mlx5_query_vport_state(struct mlx5_core_dev *mdev, u8 opmod); 41int mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev, 42 u32 vport, u8 *addr); 43int mlx5_set_nic_vport_current_mac(struct mlx5_core_dev *mdev, int vport, 44 bool other_vport, u8 *addr); 45int mlx5_set_nic_vport_vlan_list(struct mlx5_core_dev *dev, u32 vport, 46 u16 *vlan_list, int list_len); 47int mlx5_set_nic_vport_mc_list(struct mlx5_core_dev *mdev, int vport, 48 u64 *addr_list, size_t addr_list_len); 49int mlx5_set_nic_vport_promisc(struct mlx5_core_dev *mdev, int vport, 50 bool promisc_mc, bool promisc_uc, 51 bool promisc_all); 52int mlx5_set_nic_vport_permanent_mac(struct mlx5_core_dev *mdev, int vport, 53 u8 *addr); 54int mlx5_nic_vport_enable_roce(struct mlx5_core_dev *mdev); 55int mlx5_nic_vport_disable_roce(struct mlx5_core_dev *mdev); 56int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev, 57 u64 *system_image_guid); 58int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid); 59int mlx5_query_nic_vport_port_guid(struct mlx5_core_dev *mdev, u64 *port_guid); 60int mlx5_query_nic_vport_qkey_viol_cntr(struct mlx5_core_dev *mdev, 61 u16 *qkey_viol_cntr); 62int mlx5_query_hca_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid); 63int mlx5_query_hca_vport_system_image_guid(struct mlx5_core_dev *mdev, 64 u64 *system_image_guid); 65int mlx5_query_hca_vport_context(struct mlx5_core_dev *mdev, 66 u8 port_num, u8 vport_num, u32 *out, 67 int outlen); 68int mlx5_query_hca_vport_pkey(struct mlx5_core_dev *dev, u8 other_vport, 69 u8 port_num, u16 vf_num, u16 pkey_index, 70 u16 *pkey); 71int mlx5_query_hca_vport_gid(struct mlx5_core_dev *dev, u8 port_num, 72 u16 vport_num, u16 gid_index, union ib_gid *gid); 73int mlx5_set_eswitch_cvlan_info(struct mlx5_core_dev *mdev, u8 vport, 74 u8 insert_mode, u8 strip_mode, 75 u16 vlan, u8 cfi, u8 pcp); 76int mlx5_query_vport_counter(struct mlx5_core_dev *dev, 77 u8 port_num, u16 vport_num, 78 void *out, int out_size); 79int mlx5_get_vport_counters(struct mlx5_core_dev *dev, u8 port_num, 80 struct mlx5_vport_counters *vc); 81#endif /* __MLX5_VPORT_H__ */ 82