| .. | .. |
|---|
| 1 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | | -/* Copyright(c) 2013 - 2018 Intel Corporation. */ |
|---|
| 2 | +/* Copyright(c) 2013 - 2019 Intel Corporation. */ |
|---|
| 3 | 3 | |
|---|
| 4 | 4 | #ifndef _FM10K_H_ |
|---|
| 5 | 5 | #define _FM10K_H_ |
|---|
| .. | .. |
|---|
| 41 | 41 | u16 count; |
|---|
| 42 | 42 | u16 dglort; |
|---|
| 43 | 43 | struct rcu_head rcu; |
|---|
| 44 | | - struct net_device *macvlan[0]; |
|---|
| 44 | + struct net_device *macvlan[]; |
|---|
| 45 | 45 | }; |
|---|
| 46 | 46 | |
|---|
| 47 | 47 | enum fm10k_ring_state_t { |
|---|
| .. | .. |
|---|
| 177 | 177 | #define MIN_Q_VECTORS 1 |
|---|
| 178 | 178 | enum fm10k_non_q_vectors { |
|---|
| 179 | 179 | FM10K_MBX_VECTOR, |
|---|
| 180 | | -#define NON_Q_VECTORS_VF NON_Q_VECTORS_PF |
|---|
| 181 | | - NON_Q_VECTORS_PF |
|---|
| 180 | + NON_Q_VECTORS |
|---|
| 182 | 181 | }; |
|---|
| 183 | 182 | |
|---|
| 184 | | -#define NON_Q_VECTORS(hw) (((hw)->mac.type == fm10k_mac_pf) ? \ |
|---|
| 185 | | - NON_Q_VECTORS_PF : \ |
|---|
| 186 | | - NON_Q_VECTORS_VF) |
|---|
| 187 | | -#define MIN_MSIX_COUNT(hw) (MIN_Q_VECTORS + NON_Q_VECTORS(hw)) |
|---|
| 183 | +#define MIN_MSIX_COUNT(hw) (MIN_Q_VECTORS + NON_Q_VECTORS) |
|---|
| 188 | 184 | |
|---|
| 189 | 185 | struct fm10k_q_vector { |
|---|
| 190 | 186 | struct fm10k_intfc *interface; |
|---|
| .. | .. |
|---|
| 202 | 198 | struct rcu_head rcu; /* to avoid race with update stats on free */ |
|---|
| 203 | 199 | |
|---|
| 204 | 200 | /* for dynamic allocation of rings associated with this q_vector */ |
|---|
| 205 | | - struct fm10k_ring ring[0] ____cacheline_internodealigned_in_smp; |
|---|
| 201 | + struct fm10k_ring ring[] ____cacheline_internodealigned_in_smp; |
|---|
| 206 | 202 | }; |
|---|
| 207 | 203 | |
|---|
| 208 | 204 | enum fm10k_ring_f_enum { |
|---|
| .. | .. |
|---|
| 222 | 218 | unsigned int num_vfs; |
|---|
| 223 | 219 | unsigned int next_vf_mbx; |
|---|
| 224 | 220 | struct rcu_head rcu; |
|---|
| 225 | | - struct fm10k_vf_info vf_info[0]; |
|---|
| 226 | | -}; |
|---|
| 227 | | - |
|---|
| 228 | | -struct fm10k_udp_port { |
|---|
| 229 | | - struct list_head list; |
|---|
| 230 | | - sa_family_t sa_family; |
|---|
| 231 | | - __be16 port; |
|---|
| 221 | + struct fm10k_vf_info vf_info[]; |
|---|
| 232 | 222 | }; |
|---|
| 233 | 223 | |
|---|
| 234 | 224 | enum fm10k_macvlan_request_type { |
|---|
| .. | .. |
|---|
| 374 | 364 | u32 rssrk[FM10K_RSSRK_SIZE]; |
|---|
| 375 | 365 | |
|---|
| 376 | 366 | /* UDP encapsulation port tracking information */ |
|---|
| 377 | | - struct list_head vxlan_port; |
|---|
| 378 | | - struct list_head geneve_port; |
|---|
| 367 | + __be16 vxlan_port; |
|---|
| 368 | + __be16 geneve_port; |
|---|
| 379 | 369 | |
|---|
| 380 | 370 | /* MAC/VLAN update queue */ |
|---|
| 381 | 371 | struct list_head macvlan_requests; |
|---|
| .. | .. |
|---|
| 480 | 470 | |
|---|
| 481 | 471 | /* main */ |
|---|
| 482 | 472 | extern char fm10k_driver_name[]; |
|---|
| 483 | | -extern const char fm10k_driver_version[]; |
|---|
| 484 | 473 | int fm10k_init_queueing_scheme(struct fm10k_intfc *interface); |
|---|
| 485 | 474 | void fm10k_clear_queueing_scheme(struct fm10k_intfc *interface); |
|---|
| 486 | 475 | __be16 fm10k_tx_encap_offload(struct sk_buff *skb); |
|---|
| .. | .. |
|---|
| 538 | 527 | int fm10k_iov_resume(struct pci_dev *pdev); |
|---|
| 539 | 528 | void fm10k_iov_disable(struct pci_dev *pdev); |
|---|
| 540 | 529 | int fm10k_iov_configure(struct pci_dev *pdev, int num_vfs); |
|---|
| 530 | +void fm10k_iov_update_stats(struct fm10k_intfc *interface); |
|---|
| 541 | 531 | s32 fm10k_iov_update_pvid(struct fm10k_intfc *interface, u16 glort, u16 pvid); |
|---|
| 542 | 532 | int fm10k_ndo_set_vf_mac(struct net_device *netdev, int vf_idx, u8 *mac); |
|---|
| 543 | 533 | int fm10k_ndo_set_vf_vlan(struct net_device *netdev, |
|---|
| .. | .. |
|---|
| 546 | 536 | int __always_unused min_rate, int max_rate); |
|---|
| 547 | 537 | int fm10k_ndo_get_vf_config(struct net_device *netdev, |
|---|
| 548 | 538 | int vf_idx, struct ifla_vf_info *ivi); |
|---|
| 539 | +int fm10k_ndo_get_vf_stats(struct net_device *netdev, |
|---|
| 540 | + int vf_idx, struct ifla_vf_stats *stats); |
|---|
| 549 | 541 | |
|---|
| 550 | 542 | /* DebugFS */ |
|---|
| 551 | 543 | #ifdef CONFIG_DEBUG_FS |
|---|