Commit 327c685e authored by Shradha Shah's avatar Shradha Shah Committed by David S. Miller

sfc: Rename implementations in siena_sriov.c to have a 'siena' prefix

Patch in preparation for the upcoming EF10 sriov support.
Signed-off-by: default avatarShradha Shah <sshah@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2dc313ec
...@@ -1314,7 +1314,7 @@ static unsigned int efx_wanted_parallelism(struct efx_nic *efx) ...@@ -1314,7 +1314,7 @@ static unsigned int efx_wanted_parallelism(struct efx_nic *efx)
/* If RSS is requested for the PF *and* VFs then we can't write RSS /* If RSS is requested for the PF *and* VFs then we can't write RSS
* table entries that are inaccessible to VFs * table entries that are inaccessible to VFs
*/ */
if (efx_sriov_wanted(efx) && efx_vf_size(efx) > 1 && if (efx_siena_sriov_wanted(efx) && efx_vf_size(efx) > 1 &&
count > efx_vf_size(efx)) { count > efx_vf_size(efx)) {
netif_warn(efx, probe, efx->net_dev, netif_warn(efx, probe, efx->net_dev,
"Reducing number of RSS channels from %u to %u for " "Reducing number of RSS channels from %u to %u for "
...@@ -1426,7 +1426,8 @@ static int efx_probe_interrupts(struct efx_nic *efx) ...@@ -1426,7 +1426,8 @@ static int efx_probe_interrupts(struct efx_nic *efx)
} }
/* RSS might be usable on VFs even if it is disabled on the PF */ /* RSS might be usable on VFs even if it is disabled on the PF */
efx->rss_spread = ((efx->n_rx_channels > 1 || !efx_sriov_wanted(efx)) ? efx->rss_spread = ((efx->n_rx_channels > 1 ||
!efx_siena_sriov_wanted(efx)) ?
efx->n_rx_channels : efx_vf_size(efx)); efx->n_rx_channels : efx_vf_size(efx));
return 0; return 0;
...@@ -2166,7 +2167,7 @@ static int efx_set_mac_address(struct net_device *net_dev, void *data) ...@@ -2166,7 +2167,7 @@ static int efx_set_mac_address(struct net_device *net_dev, void *data)
} }
ether_addr_copy(net_dev->dev_addr, new_addr); ether_addr_copy(net_dev->dev_addr, new_addr);
efx_sriov_mac_address_changed(efx); efx_siena_sriov_mac_address_changed(efx);
/* Reconfigure the MAC */ /* Reconfigure the MAC */
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
...@@ -2210,10 +2211,10 @@ static const struct net_device_ops efx_farch_netdev_ops = { ...@@ -2210,10 +2211,10 @@ static const struct net_device_ops efx_farch_netdev_ops = {
.ndo_set_rx_mode = efx_set_rx_mode, .ndo_set_rx_mode = efx_set_rx_mode,
.ndo_set_features = efx_set_features, .ndo_set_features = efx_set_features,
#ifdef CONFIG_SFC_SRIOV #ifdef CONFIG_SFC_SRIOV
.ndo_set_vf_mac = efx_sriov_set_vf_mac, .ndo_set_vf_mac = efx_siena_sriov_set_vf_mac,
.ndo_set_vf_vlan = efx_sriov_set_vf_vlan, .ndo_set_vf_vlan = efx_siena_sriov_set_vf_vlan,
.ndo_set_vf_spoofchk = efx_sriov_set_vf_spoofchk, .ndo_set_vf_spoofchk = efx_siena_sriov_set_vf_spoofchk,
.ndo_get_vf_config = efx_sriov_get_vf_config, .ndo_get_vf_config = efx_siena_sriov_get_vf_config,
#endif #endif
#ifdef CONFIG_NET_POLL_CONTROLLER #ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = efx_netpoll, .ndo_poll_controller = efx_netpoll,
...@@ -2433,7 +2434,7 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok) ...@@ -2433,7 +2434,7 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok)
if (rc) if (rc)
goto fail; goto fail;
efx_restore_filters(efx); efx_restore_filters(efx);
efx_sriov_reset(efx); efx_siena_sriov_reset(efx);
mutex_unlock(&efx->mac_lock); mutex_unlock(&efx->mac_lock);
...@@ -2826,7 +2827,7 @@ static void efx_pci_remove(struct pci_dev *pci_dev) ...@@ -2826,7 +2827,7 @@ static void efx_pci_remove(struct pci_dev *pci_dev)
efx_disable_interrupts(efx); efx_disable_interrupts(efx);
rtnl_unlock(); rtnl_unlock();
efx_sriov_fini(efx); efx_siena_sriov_fini(efx);
efx_unregister_netdev(efx); efx_unregister_netdev(efx);
efx_mtd_remove(efx); efx_mtd_remove(efx);
...@@ -3023,7 +3024,7 @@ static int efx_pci_probe(struct pci_dev *pci_dev, ...@@ -3023,7 +3024,7 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
if (rc) if (rc)
goto fail4; goto fail4;
rc = efx_sriov_init(efx); rc = efx_siena_sriov_init(efx);
if (rc) if (rc)
netif_err(efx, probe, efx->net_dev, netif_err(efx, probe, efx->net_dev,
"SR-IOV can't be enabled rc %d\n", rc); "SR-IOV can't be enabled rc %d\n", rc);
......
...@@ -240,7 +240,7 @@ static int efx_alloc_special_buffer(struct efx_nic *efx, ...@@ -240,7 +240,7 @@ static int efx_alloc_special_buffer(struct efx_nic *efx,
buffer->index = efx->next_buffer_table; buffer->index = efx->next_buffer_table;
efx->next_buffer_table += buffer->entries; efx->next_buffer_table += buffer->entries;
#ifdef CONFIG_SFC_SRIOV #ifdef CONFIG_SFC_SRIOV
BUG_ON(efx_sriov_enabled(efx) && BUG_ON(efx_siena_sriov_enabled(efx) &&
nic_data->vf_buftbl_base < efx->next_buffer_table); nic_data->vf_buftbl_base < efx->next_buffer_table);
#endif #endif
...@@ -670,7 +670,7 @@ static int efx_farch_do_flush(struct efx_nic *efx) ...@@ -670,7 +670,7 @@ static int efx_farch_do_flush(struct efx_nic *efx)
* the firmware (though we will still have to poll for * the firmware (though we will still have to poll for
* completion). If that fails, fall back to the old scheme. * completion). If that fails, fall back to the old scheme.
*/ */
if (efx_sriov_enabled(efx)) { if (efx_siena_sriov_enabled(efx)) {
rc = efx_mcdi_flush_rxqs(efx); rc = efx_mcdi_flush_rxqs(efx);
if (!rc) if (!rc)
goto wait; goto wait;
...@@ -1198,13 +1198,13 @@ efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event) ...@@ -1198,13 +1198,13 @@ efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event)
netif_vdbg(efx, hw, efx->net_dev, "channel %d TXQ %d flushed\n", netif_vdbg(efx, hw, efx->net_dev, "channel %d TXQ %d flushed\n",
channel->channel, ev_sub_data); channel->channel, ev_sub_data);
efx_farch_handle_tx_flush_done(efx, event); efx_farch_handle_tx_flush_done(efx, event);
efx_sriov_tx_flush_done(efx, event); efx_siena_sriov_tx_flush_done(efx, event);
break; break;
case FSE_AZ_RX_DESCQ_FLS_DONE_EV: case FSE_AZ_RX_DESCQ_FLS_DONE_EV:
netif_vdbg(efx, hw, efx->net_dev, "channel %d RXQ %d flushed\n", netif_vdbg(efx, hw, efx->net_dev, "channel %d RXQ %d flushed\n",
channel->channel, ev_sub_data); channel->channel, ev_sub_data);
efx_farch_handle_rx_flush_done(efx, event); efx_farch_handle_rx_flush_done(efx, event);
efx_sriov_rx_flush_done(efx, event); efx_siena_sriov_rx_flush_done(efx, event);
break; break;
case FSE_AZ_EVQ_INIT_DONE_EV: case FSE_AZ_EVQ_INIT_DONE_EV:
netif_dbg(efx, hw, efx->net_dev, netif_dbg(efx, hw, efx->net_dev,
...@@ -1243,7 +1243,7 @@ efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event) ...@@ -1243,7 +1243,7 @@ efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event)
ev_sub_data); ev_sub_data);
efx_schedule_reset(efx, RESET_TYPE_DMA_ERROR); efx_schedule_reset(efx, RESET_TYPE_DMA_ERROR);
} else } else
efx_sriov_desc_fetch_err(efx, ev_sub_data); efx_siena_sriov_desc_fetch_err(efx, ev_sub_data);
break; break;
case FSE_BZ_TX_DSC_ERROR_EV: case FSE_BZ_TX_DSC_ERROR_EV:
if (ev_sub_data < EFX_VI_BASE) { if (ev_sub_data < EFX_VI_BASE) {
...@@ -1253,7 +1253,7 @@ efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event) ...@@ -1253,7 +1253,7 @@ efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event)
ev_sub_data); ev_sub_data);
efx_schedule_reset(efx, RESET_TYPE_DMA_ERROR); efx_schedule_reset(efx, RESET_TYPE_DMA_ERROR);
} else } else
efx_sriov_desc_fetch_err(efx, ev_sub_data); efx_siena_sriov_desc_fetch_err(efx, ev_sub_data);
break; break;
default: default:
netif_vdbg(efx, hw, efx->net_dev, netif_vdbg(efx, hw, efx->net_dev,
...@@ -1318,7 +1318,7 @@ int efx_farch_ev_process(struct efx_channel *channel, int budget) ...@@ -1318,7 +1318,7 @@ int efx_farch_ev_process(struct efx_channel *channel, int budget)
efx_farch_handle_driver_event(channel, &event); efx_farch_handle_driver_event(channel, &event);
break; break;
case FSE_CZ_EV_CODE_USER_EV: case FSE_CZ_EV_CODE_USER_EV:
efx_sriov_event(channel, &event); efx_siena_sriov_event(channel, &event);
break; break;
case FSE_CZ_EV_CODE_MCDI_EV: case FSE_CZ_EV_CODE_MCDI_EV:
efx_mcdi_process_event(channel, &event); efx_mcdi_process_event(channel, &event);
...@@ -1685,7 +1685,7 @@ void efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw) ...@@ -1685,7 +1685,7 @@ void efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw)
vi_count = max(efx->n_channels, efx->n_tx_channels * EFX_TXQ_TYPES); vi_count = max(efx->n_channels, efx->n_tx_channels * EFX_TXQ_TYPES);
#ifdef CONFIG_SFC_SRIOV #ifdef CONFIG_SFC_SRIOV
if (efx_sriov_wanted(efx)) { if (efx_siena_sriov_wanted(efx)) {
unsigned vi_dc_entries, buftbl_free, entries_per_vf, vf_limit; unsigned vi_dc_entries, buftbl_free, entries_per_vf, vf_limit;
nic_data->vf_buftbl_base = buftbl_min; nic_data->vf_buftbl_base = buftbl_min;
......
...@@ -1035,7 +1035,7 @@ void efx_mcdi_process_event(struct efx_channel *channel, ...@@ -1035,7 +1035,7 @@ void efx_mcdi_process_event(struct efx_channel *channel,
/* MAC stats are gather lazily. We can ignore this. */ /* MAC stats are gather lazily. We can ignore this. */
break; break;
case MCDI_EVENT_CODE_FLR: case MCDI_EVENT_CODE_FLR:
efx_sriov_flr(efx, MCDI_EVENT_FIELD(*event, FLR_VF)); efx_siena_sriov_flr(efx, MCDI_EVENT_FIELD(*event, FLR_VF));
break; break;
case MCDI_EVENT_CODE_PTP_RX: case MCDI_EVENT_CODE_PTP_RX:
case MCDI_EVENT_CODE_PTP_FAULT: case MCDI_EVENT_CODE_PTP_FAULT:
......
...@@ -540,61 +540,65 @@ struct efx_ef10_nic_data { ...@@ -540,61 +540,65 @@ struct efx_ef10_nic_data {
#ifdef CONFIG_SFC_SRIOV #ifdef CONFIG_SFC_SRIOV
static inline bool efx_sriov_wanted(struct efx_nic *efx) static inline bool efx_siena_sriov_wanted(struct efx_nic *efx)
{ {
return efx->vf_count != 0; return efx->vf_count != 0;
} }
static inline bool efx_sriov_enabled(struct efx_nic *efx)
static inline bool efx_siena_sriov_enabled(struct efx_nic *efx)
{ {
return efx->vf_init_count != 0; return efx->vf_init_count != 0;
} }
static inline unsigned int efx_vf_size(struct efx_nic *efx) static inline unsigned int efx_vf_size(struct efx_nic *efx)
{ {
return 1 << efx->vi_scale; return 1 << efx->vi_scale;
} }
int efx_init_sriov(void); int efx_init_sriov(void);
void efx_sriov_probe(struct efx_nic *efx); void efx_siena_sriov_probe(struct efx_nic *efx);
int efx_sriov_init(struct efx_nic *efx); int efx_siena_sriov_init(struct efx_nic *efx);
void efx_sriov_mac_address_changed(struct efx_nic *efx); void efx_siena_sriov_mac_address_changed(struct efx_nic *efx);
void efx_sriov_tx_flush_done(struct efx_nic *efx, efx_qword_t *event); void efx_siena_sriov_tx_flush_done(struct efx_nic *efx, efx_qword_t *event);
void efx_sriov_rx_flush_done(struct efx_nic *efx, efx_qword_t *event); void efx_siena_sriov_rx_flush_done(struct efx_nic *efx, efx_qword_t *event);
void efx_sriov_event(struct efx_channel *channel, efx_qword_t *event); void efx_siena_sriov_event(struct efx_channel *channel, efx_qword_t *event);
void efx_sriov_desc_fetch_err(struct efx_nic *efx, unsigned dmaq); void efx_siena_sriov_desc_fetch_err(struct efx_nic *efx, unsigned dmaq);
void efx_sriov_flr(struct efx_nic *efx, unsigned flr); void efx_siena_sriov_flr(struct efx_nic *efx, unsigned flr);
void efx_sriov_reset(struct efx_nic *efx); void efx_siena_sriov_reset(struct efx_nic *efx);
void efx_sriov_fini(struct efx_nic *efx); void efx_siena_sriov_fini(struct efx_nic *efx);
void efx_fini_sriov(void); void efx_fini_sriov(void);
#else #else
static inline bool efx_sriov_wanted(struct efx_nic *efx) { return false; } static inline bool efx_siena_sriov_wanted(struct efx_nic *efx) { return false; }
static inline bool efx_sriov_enabled(struct efx_nic *efx) { return false; } static inline bool efx_siena_sriov_enabled(struct efx_nic *efx) { return false; }
static inline unsigned int efx_vf_size(struct efx_nic *efx) { return 0; } static inline unsigned int efx_vf_size(struct efx_nic *efx) { return 0; }
static inline int efx_init_sriov(void) { return 0; } static inline int efx_init_sriov(void) { return 0; }
static inline void efx_sriov_probe(struct efx_nic *efx) {} static inline void efx_siena_sriov_probe(struct efx_nic *efx) {}
static inline int efx_sriov_init(struct efx_nic *efx) { return -EOPNOTSUPP; } static inline int efx_siena_sriov_init(struct efx_nic *efx) { return -EOPNOTSUPP; }
static inline void efx_sriov_mac_address_changed(struct efx_nic *efx) {} static inline void efx_siena_sriov_mac_address_changed(struct efx_nic *efx) {}
static inline void efx_sriov_tx_flush_done(struct efx_nic *efx, static inline void efx_siena_sriov_tx_flush_done(struct efx_nic *efx,
efx_qword_t *event) {} efx_qword_t *event) {}
static inline void efx_sriov_rx_flush_done(struct efx_nic *efx, static inline void efx_siena_sriov_rx_flush_done(struct efx_nic *efx,
efx_qword_t *event) {} efx_qword_t *event) {}
static inline void efx_sriov_event(struct efx_channel *channel, static inline void efx_siena_sriov_event(struct efx_channel *channel,
efx_qword_t *event) {} efx_qword_t *event) {}
static inline void efx_sriov_desc_fetch_err(struct efx_nic *efx, unsigned dmaq) {} static inline void efx_siena_sriov_desc_fetch_err(struct efx_nic *efx,
static inline void efx_sriov_flr(struct efx_nic *efx, unsigned flr) {} unsigned dmaq) {}
static inline void efx_sriov_reset(struct efx_nic *efx) {} static inline void efx_siena_sriov_flr(struct efx_nic *efx, unsigned flr) {}
static inline void efx_sriov_fini(struct efx_nic *efx) {} static inline void efx_siena_sriov_reset(struct efx_nic *efx) {}
static inline void efx_siena_sriov_fini(struct efx_nic *efx) {}
static inline void efx_fini_sriov(void) {} static inline void efx_fini_sriov(void) {}
#endif #endif
int efx_sriov_set_vf_mac(struct net_device *dev, int vf, u8 *mac); int efx_siena_sriov_set_vf_mac(struct net_device *dev, int vf, u8 *mac);
int efx_sriov_set_vf_vlan(struct net_device *dev, int vf, u16 vlan, u8 qos); int efx_siena_sriov_set_vf_vlan(struct net_device *dev, int vf,
int efx_sriov_get_vf_config(struct net_device *dev, int vf, u16 vlan, u8 qos);
int efx_siena_sriov_get_vf_config(struct net_device *dev, int vf,
struct ifla_vf_info *ivf); struct ifla_vf_info *ivf);
int efx_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf, int efx_siena_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf,
bool spoofchk); bool spoofchk);
struct ethtool_ts_info; struct ethtool_ts_info;
......
...@@ -307,7 +307,7 @@ static int siena_probe_nic(struct efx_nic *efx) ...@@ -307,7 +307,7 @@ static int siena_probe_nic(struct efx_nic *efx)
if (rc) if (rc)
goto fail5; goto fail5;
efx_sriov_probe(efx); efx_siena_sriov_probe(efx);
efx_ptp_defer_probe_with_channel(efx); efx_ptp_defer_probe_with_channel(efx);
return 0; return 0;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment