Commit 886d7f44 authored by David S. Miller's avatar David S. Miller
parents b7e2041e 5b874e25
...@@ -1153,6 +1153,9 @@ static int efx_wanted_channels(void) ...@@ -1153,6 +1153,9 @@ static int efx_wanted_channels(void)
int count; int count;
int cpu; int cpu;
if (rss_cpus)
return rss_cpus;
if (unlikely(!zalloc_cpumask_var(&core_mask, GFP_KERNEL))) { if (unlikely(!zalloc_cpumask_var(&core_mask, GFP_KERNEL))) {
printk(KERN_WARNING printk(KERN_WARNING
"sfc: RSS disabled due to allocation failure\n"); "sfc: RSS disabled due to allocation failure\n");
...@@ -1266,27 +1269,18 @@ static void efx_remove_interrupts(struct efx_nic *efx) ...@@ -1266,27 +1269,18 @@ static void efx_remove_interrupts(struct efx_nic *efx)
efx->legacy_irq = 0; efx->legacy_irq = 0;
} }
struct efx_tx_queue *
efx_get_tx_queue(struct efx_nic *efx, unsigned index, unsigned type)
{
unsigned tx_channel_offset =
separate_tx_channels ? efx->n_channels - efx->n_tx_channels : 0;
EFX_BUG_ON_PARANOID(index >= efx->n_tx_channels ||
type >= EFX_TXQ_TYPES);
return &efx->channel[tx_channel_offset + index]->tx_queue[type];
}
static void efx_set_channels(struct efx_nic *efx) static void efx_set_channels(struct efx_nic *efx)
{ {
struct efx_channel *channel; struct efx_channel *channel;
struct efx_tx_queue *tx_queue; struct efx_tx_queue *tx_queue;
unsigned tx_channel_offset =
efx->tx_channel_offset =
separate_tx_channels ? efx->n_channels - efx->n_tx_channels : 0; separate_tx_channels ? efx->n_channels - efx->n_tx_channels : 0;
/* Channel pointers were set in efx_init_struct() but we now /* Channel pointers were set in efx_init_struct() but we now
* need to clear them for TX queues in any RX-only channels. */ * need to clear them for TX queues in any RX-only channels. */
efx_for_each_channel(channel, efx) { efx_for_each_channel(channel, efx) {
if (channel->channel - tx_channel_offset >= if (channel->channel - efx->tx_channel_offset >=
efx->n_tx_channels) { efx->n_tx_channels) {
efx_for_each_channel_tx_queue(tx_queue, channel) efx_for_each_channel_tx_queue(tx_queue, channel)
tx_queue->channel = NULL; tx_queue->channel = NULL;
......
...@@ -735,6 +735,7 @@ struct efx_nic { ...@@ -735,6 +735,7 @@ struct efx_nic {
unsigned next_buffer_table; unsigned next_buffer_table;
unsigned n_channels; unsigned n_channels;
unsigned n_rx_channels; unsigned n_rx_channels;
unsigned tx_channel_offset;
unsigned n_tx_channels; unsigned n_tx_channels;
unsigned int rx_buffer_len; unsigned int rx_buffer_len;
unsigned int rx_buffer_order; unsigned int rx_buffer_order;
...@@ -929,8 +930,13 @@ efx_get_channel(struct efx_nic *efx, unsigned index) ...@@ -929,8 +930,13 @@ efx_get_channel(struct efx_nic *efx, unsigned index)
_channel = (_channel->channel + 1 < (_efx)->n_channels) ? \ _channel = (_channel->channel + 1 < (_efx)->n_channels) ? \
(_efx)->channel[_channel->channel + 1] : NULL) (_efx)->channel[_channel->channel + 1] : NULL)
extern struct efx_tx_queue * static inline struct efx_tx_queue *
efx_get_tx_queue(struct efx_nic *efx, unsigned index, unsigned type); efx_get_tx_queue(struct efx_nic *efx, unsigned index, unsigned type)
{
EFX_BUG_ON_PARANOID(index >= efx->n_tx_channels ||
type >= EFX_TXQ_TYPES);
return &efx->channel[efx->tx_channel_offset + index]->tx_queue[type];
}
static inline struct efx_tx_queue * static inline struct efx_tx_queue *
efx_channel_get_tx_queue(struct efx_channel *channel, unsigned type) efx_channel_get_tx_queue(struct efx_channel *channel, unsigned type)
......
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