108135eecSEdward Cree /* SPDX-License-Identifier: GPL-2.0-only */ 208135eecSEdward Cree /**************************************************************************** 308135eecSEdward Cree * Driver for Solarflare network controllers and boards 408135eecSEdward Cree * Copyright 2019 Solarflare Communications Inc. 508135eecSEdward Cree * Copyright 2020-2022 Xilinx Inc. 608135eecSEdward Cree * 708135eecSEdward Cree * This program is free software; you can redistribute it and/or modify it 808135eecSEdward Cree * under the terms of the GNU General Public License version 2 as published 908135eecSEdward Cree * by the Free Software Foundation, incorporated herein by reference. 1008135eecSEdward Cree */ 1108135eecSEdward Cree 1208135eecSEdward Cree /* Handling for ef100 representor netdevs */ 1308135eecSEdward Cree #ifndef EF100_REP_H 1408135eecSEdward Cree #define EF100_REP_H 1508135eecSEdward Cree 1608135eecSEdward Cree #include "net_driver.h" 1708135eecSEdward Cree 18*02443ab8SEdward Cree struct efx_rep_sw_stats { 19*02443ab8SEdward Cree atomic64_t rx_packets, tx_packets; 20*02443ab8SEdward Cree atomic64_t rx_bytes, tx_bytes; 21*02443ab8SEdward Cree atomic64_t rx_dropped, tx_errors; 22*02443ab8SEdward Cree }; 23*02443ab8SEdward Cree 2408135eecSEdward Cree /** 2508135eecSEdward Cree * struct efx_rep - Private data for an Efx representor 2608135eecSEdward Cree * 2708135eecSEdward Cree * @parent: the efx PF which manages this representor 2808135eecSEdward Cree * @net_dev: representor netdevice 2908135eecSEdward Cree * @msg_enable: log message enable flags 30da56552dSEdward Cree * @mport: m-port ID of corresponding VF 31e1479556SEdward Cree * @idx: VF index 3208135eecSEdward Cree * @list: entry on efx->vf_reps 33*02443ab8SEdward Cree * @stats: software traffic counters for netdev stats 3408135eecSEdward Cree */ 3508135eecSEdward Cree struct efx_rep { 3608135eecSEdward Cree struct efx_nic *parent; 3708135eecSEdward Cree struct net_device *net_dev; 3808135eecSEdward Cree u32 msg_enable; 39da56552dSEdward Cree u32 mport; 40e1479556SEdward Cree unsigned int idx; 4108135eecSEdward Cree struct list_head list; 42*02443ab8SEdward Cree struct efx_rep_sw_stats stats; 4308135eecSEdward Cree }; 4408135eecSEdward Cree 4508135eecSEdward Cree int efx_ef100_vfrep_create(struct efx_nic *efx, unsigned int i); 4608135eecSEdward Cree void efx_ef100_vfrep_destroy(struct efx_nic *efx, struct efx_rep *efv); 4708135eecSEdward Cree void efx_ef100_fini_vfreps(struct efx_nic *efx); 4808135eecSEdward Cree 4908135eecSEdward Cree #endif /* EF100_REP_H */ 50