1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /**************************************************************************** 3 * Driver for Solarflare network controllers and boards 4 * Copyright 2019 Solarflare Communications Inc. 5 * Copyright 2020-2022 Xilinx Inc. 6 * 7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License version 2 as published 9 * by the Free Software Foundation, incorporated herein by reference. 10 */ 11 12 /* Handling for ef100 representor netdevs */ 13 #ifndef EF100_REP_H 14 #define EF100_REP_H 15 16 #include "net_driver.h" 17 18 struct efx_rep_sw_stats { 19 atomic64_t rx_packets, tx_packets; 20 atomic64_t rx_bytes, tx_bytes; 21 atomic64_t rx_dropped, tx_errors; 22 }; 23 24 /** 25 * struct efx_rep - Private data for an Efx representor 26 * 27 * @parent: the efx PF which manages this representor 28 * @net_dev: representor netdevice 29 * @msg_enable: log message enable flags 30 * @mport: m-port ID of corresponding VF 31 * @idx: VF index 32 * @list: entry on efx->vf_reps 33 * @stats: software traffic counters for netdev stats 34 */ 35 struct efx_rep { 36 struct efx_nic *parent; 37 struct net_device *net_dev; 38 u32 msg_enable; 39 u32 mport; 40 unsigned int idx; 41 struct list_head list; 42 struct efx_rep_sw_stats stats; 43 }; 44 45 int efx_ef100_vfrep_create(struct efx_nic *efx, unsigned int i); 46 void efx_ef100_vfrep_destroy(struct efx_nic *efx, struct efx_rep *efv); 47 void efx_ef100_fini_vfreps(struct efx_nic *efx); 48 49 #endif /* EF100_REP_H */ 50