Skip to content

Commit

Permalink
fm10k: Add support for SR-IOV to driver
Browse files Browse the repository at this point in the history
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 <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Alexander Duyck authored and Jeff Kirsher committed Sep 23, 2014
1 parent c265386 commit 883a9cc
Show file tree
Hide file tree
Showing 5 changed files with 614 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/fm10k/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ obj-$(CONFIG_FM10K) += fm10k.o

fm10k-objs := fm10k_main.o fm10k_common.o fm10k_pci.o \
fm10k_netdev.o fm10k_ethtool.o fm10k_pf.o fm10k_vf.o \
fm10k_mbx.o fm10k_tlv.o
fm10k_mbx.o fm10k_iov.o fm10k_tlv.o
26 changes: 26 additions & 0 deletions drivers/net/ethernet/intel/fm10k/fm10k.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ struct fm10k_ring_feature {
u16 offset; /* offset to start of feature */
};

struct fm10k_iov_data {
unsigned int num_vfs;
unsigned int next_vf_mbx;
struct rcu_head rcu;
struct fm10k_vf_info vf_info[0];
};

#define fm10k_vxlan_port_for_each(vp, intfc) \
list_for_each_entry(vp, &(intfc)->vxlan_port, list)
struct fm10k_vxlan_port {
Expand Down Expand Up @@ -277,6 +284,9 @@ struct fm10k_intfc {
int num_q_vectors; /* current number of q_vectors for device */
struct fm10k_ring_feature ring_feature[RING_F_ARRAY_SIZE];

/* SR-IOV information management structure */
struct fm10k_iov_data *iov_data;

struct fm10k_hw_stats stats;
struct fm10k_hw hw;
u32 __iomem *uc_addr;
Expand Down Expand Up @@ -441,4 +451,20 @@ int fm10k_close(struct net_device *netdev);

/* Ethtool */
void fm10k_set_ethtool_ops(struct net_device *dev);

/* IOV */
s32 fm10k_iov_event(struct fm10k_intfc *interface);
s32 fm10k_iov_mbx(struct fm10k_intfc *interface);
void fm10k_iov_suspend(struct pci_dev *pdev);
int fm10k_iov_resume(struct pci_dev *pdev);
void fm10k_iov_disable(struct pci_dev *pdev);
int fm10k_iov_configure(struct pci_dev *pdev, int num_vfs);
s32 fm10k_iov_update_pvid(struct fm10k_intfc *interface, u16 glort, u16 pvid);
int fm10k_ndo_set_vf_mac(struct net_device *netdev, int vf_idx, u8 *mac);
int fm10k_ndo_set_vf_vlan(struct net_device *netdev,
int vf_idx, u16 vid, u8 qos);
int fm10k_ndo_set_vf_bw(struct net_device *netdev, int vf_idx, int rate,
int unused);
int fm10k_ndo_get_vf_config(struct net_device *netdev,
int vf_idx, struct ifla_vf_info *ivi);
#endif /* _FM10K_H_ */
Loading

0 comments on commit 883a9cc

Please sign in to comment.