Skip to content

Commit 883a9cc

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
fm10k: Add support for SR-IOV to driver
This patch combines the recently added VF messaging and configuration functionality with the interfaces provided by the kernel to allow for configuration and management of SR-IOV. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent c265386 commit 883a9cc

File tree

5 files changed

+614
-2
lines changed

5 files changed

+614
-2
lines changed

drivers/net/ethernet/intel/fm10k/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ obj-$(CONFIG_FM10K) += fm10k.o
2929

3030
fm10k-objs := fm10k_main.o fm10k_common.o fm10k_pci.o \
3131
fm10k_netdev.o fm10k_ethtool.o fm10k_pf.o fm10k_vf.o \
32-
fm10k_mbx.o fm10k_tlv.o
32+
fm10k_mbx.o fm10k_iov.o fm10k_tlv.o

drivers/net/ethernet/intel/fm10k/fm10k.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,13 @@ struct fm10k_ring_feature {
218218
u16 offset; /* offset to start of feature */
219219
};
220220

221+
struct fm10k_iov_data {
222+
unsigned int num_vfs;
223+
unsigned int next_vf_mbx;
224+
struct rcu_head rcu;
225+
struct fm10k_vf_info vf_info[0];
226+
};
227+
221228
#define fm10k_vxlan_port_for_each(vp, intfc) \
222229
list_for_each_entry(vp, &(intfc)->vxlan_port, list)
223230
struct fm10k_vxlan_port {
@@ -277,6 +284,9 @@ struct fm10k_intfc {
277284
int num_q_vectors; /* current number of q_vectors for device */
278285
struct fm10k_ring_feature ring_feature[RING_F_ARRAY_SIZE];
279286

287+
/* SR-IOV information management structure */
288+
struct fm10k_iov_data *iov_data;
289+
280290
struct fm10k_hw_stats stats;
281291
struct fm10k_hw hw;
282292
u32 __iomem *uc_addr;
@@ -441,4 +451,20 @@ int fm10k_close(struct net_device *netdev);
441451

442452
/* Ethtool */
443453
void fm10k_set_ethtool_ops(struct net_device *dev);
454+
455+
/* IOV */
456+
s32 fm10k_iov_event(struct fm10k_intfc *interface);
457+
s32 fm10k_iov_mbx(struct fm10k_intfc *interface);
458+
void fm10k_iov_suspend(struct pci_dev *pdev);
459+
int fm10k_iov_resume(struct pci_dev *pdev);
460+
void fm10k_iov_disable(struct pci_dev *pdev);
461+
int fm10k_iov_configure(struct pci_dev *pdev, int num_vfs);
462+
s32 fm10k_iov_update_pvid(struct fm10k_intfc *interface, u16 glort, u16 pvid);
463+
int fm10k_ndo_set_vf_mac(struct net_device *netdev, int vf_idx, u8 *mac);
464+
int fm10k_ndo_set_vf_vlan(struct net_device *netdev,
465+
int vf_idx, u16 vid, u8 qos);
466+
int fm10k_ndo_set_vf_bw(struct net_device *netdev, int vf_idx, int rate,
467+
int unused);
468+
int fm10k_ndo_get_vf_config(struct net_device *netdev,
469+
int vf_idx, struct ifla_vf_info *ivi);
444470
#endif /* _FM10K_H_ */

0 commit comments

Comments
 (0)