summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sfc/siena_sriov.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-04-08 23:30:01 +0300
committerDavid S. Miller <davem@davemloft.net>2015-04-08 23:30:01 +0300
commit51df60f5a428c249cd458451e0b56269417f3cda (patch)
treebcf1d233e996d9d884964e9f8385e0a7a1f01bbc /drivers/net/ethernet/sfc/siena_sriov.c
parentc1f866767777d1c6abae0ec57effffcb72017c00 (diff)
downloadlinux-51df60f5a428c249cd458451e0b56269417f3cda.tar.xz
sfc: Revert SRIOV changes.
This reverts commits: d92916f71a57582ce7276547510cedb2c10b6bd6 ("sfc: Own header for nic-specific sriov functions,") 25672dba9535b804331145379c79f835ba2205c5 ("sfc: Enable VF's via a write to the sysfs file sriov_numvfs") As they break the build with SRIOV disabled and there is no easy way to fix it the way things are arranged. Reported-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/siena_sriov.c')
-rw-r--r--drivers/net/ethernet/sfc/siena_sriov.c58
1 files changed, 9 insertions, 49 deletions
diff --git a/drivers/net/ethernet/sfc/siena_sriov.c b/drivers/net/ethernet/sfc/siena_sriov.c
index 9366756e6101..fe83430796fd 100644
--- a/drivers/net/ethernet/sfc/siena_sriov.c
+++ b/drivers/net/ethernet/sfc/siena_sriov.c
@@ -16,7 +16,6 @@
#include "filter.h"
#include "mcdi_pcol.h"
#include "farch_regs.h"
-#include "siena_sriov.h"
#include "vfdi.h"
/* Number of longs required to track all the VIs in a VF */
@@ -1051,7 +1050,6 @@ static const struct efx_channel_type efx_siena_sriov_channel_type = {
void efx_siena_sriov_probe(struct efx_nic *efx)
{
-#ifdef CONFIG_SFC_SRIOV
unsigned count;
if (!max_vfs)
@@ -1066,10 +1064,8 @@ void efx_siena_sriov_probe(struct efx_nic *efx)
efx->vf_count = count;
efx->extra_channel_type[EFX_EXTRA_CHANNEL_IOV] = &efx_siena_sriov_channel_type;
-#endif
}
-#ifdef CONFIG_SFC_SRIOV
/* Copy the list of individual addresses into the vfdi_status.peers
* array and auxiliary pages, protected by %local_lock. Drop that lock
* and then broadcast the address list to every VF.
@@ -1280,11 +1276,9 @@ fail:
efx_siena_sriov_vfs_fini(efx);
return rc;
}
-#endif
int efx_siena_sriov_init(struct efx_nic *efx)
{
-#ifdef CONFIG_SFC_SRIOV
struct net_device *net_dev = efx->net_dev;
struct siena_nic_data *nic_data = efx->nic_data;
struct vfdi_status *vfdi_status;
@@ -1363,14 +1357,10 @@ fail_status:
efx_siena_sriov_cmd(efx, false, NULL, NULL);
fail_cmd:
return rc;
-#else /* CONFIG_SFC_SRIOV */
- return -EOPNOTSUPP;
-#endif
}
void efx_siena_sriov_fini(struct efx_nic *efx)
{
-#ifdef CONFIG_SFC_SRIOV
struct efx_vf *vf;
unsigned int pos;
struct siena_nic_data *nic_data = efx->nic_data;
@@ -1401,12 +1391,10 @@ void efx_siena_sriov_fini(struct efx_nic *efx)
kfree(efx->vf);
efx_nic_free_buffer(efx, &nic_data->vfdi_status);
efx_siena_sriov_cmd(efx, false, NULL, NULL);
-#endif /* CONFIG_SFC_SRIOV*/
}
void efx_siena_sriov_event(struct efx_channel *channel, efx_qword_t *event)
{
-#ifdef CONFIG_SFC_SRIOV
struct efx_nic *efx = channel->efx;
struct efx_vf *vf;
unsigned qid, seq, type, data;
@@ -1460,12 +1448,10 @@ error:
/* Reset the request and sequence number */
vf->req_type = VFDI_EV_TYPE_REQ_WORD0;
vf->req_seqno = seq + 1;
-#endif /* CONFIG_SFC_SRIOV */
}
void efx_siena_sriov_flr(struct efx_nic *efx, unsigned vf_i)
{
-#ifdef CONFIG_SFC_SRIOV
struct efx_vf *vf;
if (vf_i > efx->vf_init_count)
@@ -1479,12 +1465,10 @@ void efx_siena_sriov_flr(struct efx_nic *efx, unsigned vf_i)
efx_vfdi_flush_clear(vf);
vf->evq0_count = 0;
-#endif /* CONFIG_SFC_SRIOV */
}
void efx_siena_sriov_mac_address_changed(struct efx_nic *efx)
{
-#ifdef CONFIG_SFC_SRIOV
struct siena_nic_data *nic_data = efx->nic_data;
struct vfdi_status *vfdi_status = nic_data->vfdi_status.addr;
@@ -1493,12 +1477,10 @@ void efx_siena_sriov_mac_address_changed(struct efx_nic *efx)
ether_addr_copy(vfdi_status->peers[0].mac_addr,
efx->net_dev->dev_addr);
queue_work(vfdi_workqueue, &nic_data->peer_work);
-#endif /* CONFIG_SFC_SRIOV */
}
void efx_siena_sriov_tx_flush_done(struct efx_nic *efx, efx_qword_t *event)
{
-#ifdef CONFIG_SFC_SRIOV
struct efx_vf *vf;
unsigned queue, qid;
@@ -1514,12 +1496,10 @@ void efx_siena_sriov_tx_flush_done(struct efx_nic *efx, efx_qword_t *event)
if (efx_vfdi_flush_wake(vf))
wake_up(&vf->flush_waitq);
-#endif /* CONFIG_SFC_SRIOV */
}
void efx_siena_sriov_rx_flush_done(struct efx_nic *efx, efx_qword_t *event)
{
-#ifdef CONFIG_SFC_SRIOV
struct efx_vf *vf;
unsigned ev_failed, queue, qid;
@@ -1540,13 +1520,11 @@ void efx_siena_sriov_rx_flush_done(struct efx_nic *efx, efx_qword_t *event)
}
if (efx_vfdi_flush_wake(vf))
wake_up(&vf->flush_waitq);
-#endif /* CONFIG_SFC_SRIOV */
}
/* Called from napi. Schedule the reset work item */
void efx_siena_sriov_desc_fetch_err(struct efx_nic *efx, unsigned dmaq)
{
-#ifdef CONFIG_SFC_SRIOV
struct efx_vf *vf;
unsigned int rel;
@@ -1558,13 +1536,11 @@ void efx_siena_sriov_desc_fetch_err(struct efx_nic *efx, unsigned dmaq)
"VF %d DMA Q %d reports descriptor fetch error.\n",
vf->index, rel);
queue_work(vfdi_workqueue, &vf->reset_work);
-#endif /* CONFIG_SFC_SRIOV */
}
/* Reset all VFs */
void efx_siena_sriov_reset(struct efx_nic *efx)
{
-#ifdef CONFIG_SFC_SRIOV
unsigned int vf_i;
struct efx_buffer buf;
struct efx_vf *vf;
@@ -1586,12 +1562,10 @@ void efx_siena_sriov_reset(struct efx_nic *efx)
}
efx_nic_free_buffer(efx, &buf);
-#endif /* CONFIG_SFC_SRIOV */
}
int efx_init_sriov(void)
{
-#ifdef CONFIG_SFC_SRIOV
/* A single threaded workqueue is sufficient. efx_siena_sriov_vfdi() and
* efx_siena_sriov_peer_work() spend almost all their time sleeping for
* MCDI to complete anyway
@@ -1599,20 +1573,18 @@ int efx_init_sriov(void)
vfdi_workqueue = create_singlethread_workqueue("sfc_vfdi");
if (!vfdi_workqueue)
return -ENOMEM;
-#endif
+
return 0;
}
void efx_fini_sriov(void)
{
-#ifdef CONFIG_SFC_SRIOV
destroy_workqueue(vfdi_workqueue);
-#endif
}
-#ifdef CONFIG_SFC_SRIOV
-int efx_siena_sriov_set_vf_mac(struct efx_nic *efx, int vf_i, u8 *mac)
+int efx_siena_sriov_set_vf_mac(struct net_device *net_dev, int vf_i, u8 *mac)
{
+ struct efx_nic *efx = netdev_priv(net_dev);
struct efx_vf *vf;
if (vf_i >= efx->vf_init_count)
@@ -1627,9 +1599,10 @@ int efx_siena_sriov_set_vf_mac(struct efx_nic *efx, int vf_i, u8 *mac)
return 0;
}
-int efx_siena_sriov_set_vf_vlan(struct efx_nic *efx, int vf_i,
+int efx_siena_sriov_set_vf_vlan(struct net_device *net_dev, int vf_i,
u16 vlan, u8 qos)
{
+ struct efx_nic *efx = netdev_priv(net_dev);
struct efx_vf *vf;
u16 tci;
@@ -1646,9 +1619,10 @@ int efx_siena_sriov_set_vf_vlan(struct efx_nic *efx, int vf_i,
return 0;
}
-int efx_siena_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf_i,
+int efx_siena_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf_i,
bool spoofchk)
{
+ struct efx_nic *efx = netdev_priv(net_dev);
struct efx_vf *vf;
int rc;
@@ -1669,9 +1643,10 @@ int efx_siena_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf_i,
return rc;
}
-int efx_siena_sriov_get_vf_config(struct efx_nic *efx, int vf_i,
+int efx_siena_sriov_get_vf_config(struct net_device *net_dev, int vf_i,
struct ifla_vf_info *ivi)
{
+ struct efx_nic *efx = netdev_priv(net_dev);
struct efx_vf *vf;
u16 tci;
@@ -1691,18 +1666,3 @@ int efx_siena_sriov_get_vf_config(struct efx_nic *efx, int vf_i,
return 0;
}
-#endif /* CONFIG_SFC_SRIOV */
-
-bool efx_siena_sriov_wanted(struct efx_nic *efx)
-{
-#ifdef CONFIG_SFC_SRIOV
- return efx->vf_count != 0;
-#else
- return false;
-#endif
-}
-
-int efx_siena_sriov_configure(struct efx_nic *efx, int num_vfs)
-{
- return 0;
-}