-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shradha Shah says: ==================== sfc: Nic specific sriov functions, netdev_ops and sriov_configure First two patches among the series of patches to support SRIOV on EF10. First patch declares nic specific sriov functions in nic specific headers, creates only one instance of the netdev_ops, removes sriov functionality from Falcon code. Second patch adds support for sriov_configure. The Virtual Functions can be enabled but they do not bind to the SFC driver just yet. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Showing
16 changed files
with
454 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/**************************************************************************** | ||
* Driver for Solarflare network controllers and boards | ||
* Copyright 2015 Solarflare Communications Inc. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 as published | ||
* by the Free Software Foundation, incorporated herein by reference. | ||
*/ | ||
#include <linux/pci.h> | ||
#include <linux/module.h> | ||
#include "net_driver.h" | ||
#include "efx.h" | ||
#include "nic.h" | ||
#include "mcdi_pcol.h" | ||
|
||
#ifdef CONFIG_SFC_SRIOV | ||
static int efx_ef10_pci_sriov_enable(struct efx_nic *efx, int num_vfs) | ||
{ | ||
int rc = 0; | ||
struct pci_dev *dev = efx->pci_dev; | ||
|
||
efx->vf_count = num_vfs; | ||
rc = pci_enable_sriov(dev, num_vfs); | ||
if (rc) { | ||
efx->vf_count = 0; | ||
netif_err(efx, probe, efx->net_dev, | ||
"Failed to enable SRIOV VFs\n"); | ||
} | ||
return rc; | ||
} | ||
|
||
static int efx_ef10_pci_sriov_disable(struct efx_nic *efx) | ||
{ | ||
struct pci_dev *dev = efx->pci_dev; | ||
|
||
efx->vf_count = 0; | ||
pci_disable_sriov(dev); | ||
return 0; | ||
} | ||
#endif | ||
|
||
int efx_ef10_sriov_configure(struct efx_nic *efx, int num_vfs) | ||
{ | ||
#ifdef CONFIG_SFC_SRIOV | ||
if (num_vfs == 0) | ||
return efx_ef10_pci_sriov_disable(efx); | ||
else | ||
return efx_ef10_pci_sriov_enable(efx, num_vfs); | ||
#else | ||
return -EOPNOTSUPP; | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/**************************************************************************** | ||
* Driver for Solarflare network controllers and boards | ||
* Copyright 2015 Solarflare Communications Inc. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 as published | ||
* by the Free Software Foundation, incorporated herein by reference. | ||
*/ | ||
|
||
#ifndef EF10_SRIOV_H | ||
#define EF10_SRIOV_H | ||
|
||
#include "net_driver.h" | ||
|
||
static inline bool efx_ef10_sriov_wanted(struct efx_nic *efx) | ||
{ | ||
return false; | ||
} | ||
|
||
int efx_ef10_sriov_configure(struct efx_nic *efx, int num_vfs); | ||
|
||
static inline int efx_ef10_sriov_init(struct efx_nic *efx) | ||
{ | ||
return -EOPNOTSUPP; | ||
} | ||
|
||
static inline void efx_ef10_sriov_mac_address_changed(struct efx_nic *efx) {} | ||
static inline void efx_ef10_sriov_reset(struct efx_nic *efx) {} | ||
static inline void efx_ef10_sriov_fini(struct efx_nic *efx) {} | ||
static inline void efx_ef10_sriov_flr(struct efx_nic *efx, unsigned vf_i) {} | ||
|
||
#ifdef CONFIG_SFC_SRIOV | ||
static inline int efx_ef10_sriov_set_vf_mac(struct efx_nic *efx, int vf, | ||
u8 *mac) | ||
{ | ||
return -EOPNOTSUPP; | ||
} | ||
|
||
static inline int efx_ef10_sriov_set_vf_vlan(struct efx_nic *efx, int vf, | ||
u16 vlan, u8 qos) | ||
{ | ||
return -EOPNOTSUPP; | ||
} | ||
|
||
static inline int efx_ef10_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf, | ||
bool spoofchk) | ||
{ | ||
return -EOPNOTSUPP; | ||
} | ||
|
||
static inline int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf, | ||
struct ifla_vf_info *ivf) | ||
{ | ||
return -EOPNOTSUPP; | ||
} | ||
#endif /* CONFIG_SFC_SRIOV */ | ||
|
||
#endif /* EF10_SRIOV_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.