diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-14 16:25:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-14 16:25:30 -0500 |
commit | d018b6f4f1539f3679fbdc2d02d58d09e76be84a (patch) | |
tree | 317b9e04d8e7a73a4d07c69a5cb5455ec34f47e5 /drivers/net/sfc | |
parent | 18bce371ae09af6c20ee62c1092a4d1d0e84dd49 (diff) | |
parent | 0f73f2c5a3ebb957ee66718c903c17ed71a4fc2e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (47 commits)
GRETH: resolve SMP issues and other problems
GRETH: handle frame error interrupts
GRETH: avoid writing bad speed/duplex when setting transfer mode
GRETH: fixed skb buffer memory leak on frame errors
GRETH: GBit transmit descriptor handling optimization
GRETH: fix opening/closing
GRETH: added raw AMBA vendor/device number to match against.
cassini: Fix build bustage on x86.
e1000e: consistent use of Rx/Tx vs. RX/TX/rx/tx in comments/logs
e1000e: update Copyright for 2011
e1000: Avoid unhandled IRQ
r8169: keep firmware in memory.
netdev: tilepro: Use is_unicast_ether_addr helper
etherdevice.h: Add is_unicast_ether_addr function
ks8695net: Use default implementation of ethtool_ops::get_link
ks8695net: Disable non-working ethtool operations
USB CDC NCM: Don't deref NULL in cdc_ncm_rx_fixup() and don't use uninitialized variable.
vxge: Remember to release firmware after upgrading firmware
netdev: bfin_mac: Remove is_multicast_ether_addr use in netdev_for_each_mc_addr
ipsec: update MAX_AH_AUTH_LEN to support sha512
...
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/efx.c | 18 | ||||
-rw-r--r-- | drivers/net/sfc/net_driver.h | 10 |
2 files changed, 14 insertions, 14 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 711449c6e675..002bac743843 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -1153,6 +1153,9 @@ static int efx_wanted_channels(void) | |||
1153 | int count; | 1153 | int count; |
1154 | int cpu; | 1154 | int cpu; |
1155 | 1155 | ||
1156 | if (rss_cpus) | ||
1157 | return rss_cpus; | ||
1158 | |||
1156 | if (unlikely(!zalloc_cpumask_var(&core_mask, GFP_KERNEL))) { | 1159 | if (unlikely(!zalloc_cpumask_var(&core_mask, GFP_KERNEL))) { |
1157 | printk(KERN_WARNING | 1160 | printk(KERN_WARNING |
1158 | "sfc: RSS disabled due to allocation failure\n"); | 1161 | "sfc: RSS disabled due to allocation failure\n"); |
@@ -1266,27 +1269,18 @@ static void efx_remove_interrupts(struct efx_nic *efx) | |||
1266 | efx->legacy_irq = 0; | 1269 | efx->legacy_irq = 0; |
1267 | } | 1270 | } |
1268 | 1271 | ||
1269 | struct efx_tx_queue * | ||
1270 | efx_get_tx_queue(struct efx_nic *efx, unsigned index, unsigned type) | ||
1271 | { | ||
1272 | unsigned tx_channel_offset = | ||
1273 | separate_tx_channels ? efx->n_channels - efx->n_tx_channels : 0; | ||
1274 | EFX_BUG_ON_PARANOID(index >= efx->n_tx_channels || | ||
1275 | type >= EFX_TXQ_TYPES); | ||
1276 | return &efx->channel[tx_channel_offset + index]->tx_queue[type]; | ||
1277 | } | ||
1278 | |||
1279 | static void efx_set_channels(struct efx_nic *efx) | 1272 | static void efx_set_channels(struct efx_nic *efx) |
1280 | { | 1273 | { |
1281 | struct efx_channel *channel; | 1274 | struct efx_channel *channel; |
1282 | struct efx_tx_queue *tx_queue; | 1275 | struct efx_tx_queue *tx_queue; |
1283 | unsigned tx_channel_offset = | 1276 | |
1277 | efx->tx_channel_offset = | ||
1284 | separate_tx_channels ? efx->n_channels - efx->n_tx_channels : 0; | 1278 | separate_tx_channels ? efx->n_channels - efx->n_tx_channels : 0; |
1285 | 1279 | ||
1286 | /* Channel pointers were set in efx_init_struct() but we now | 1280 | /* Channel pointers were set in efx_init_struct() but we now |
1287 | * need to clear them for TX queues in any RX-only channels. */ | 1281 | * need to clear them for TX queues in any RX-only channels. */ |
1288 | efx_for_each_channel(channel, efx) { | 1282 | efx_for_each_channel(channel, efx) { |
1289 | if (channel->channel - tx_channel_offset >= | 1283 | if (channel->channel - efx->tx_channel_offset >= |
1290 | efx->n_tx_channels) { | 1284 | efx->n_tx_channels) { |
1291 | efx_for_each_channel_tx_queue(tx_queue, channel) | 1285 | efx_for_each_channel_tx_queue(tx_queue, channel) |
1292 | tx_queue->channel = NULL; | 1286 | tx_queue->channel = NULL; |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index bdce66ddf93a..28df8665256a 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -735,6 +735,7 @@ struct efx_nic { | |||
735 | unsigned next_buffer_table; | 735 | unsigned next_buffer_table; |
736 | unsigned n_channels; | 736 | unsigned n_channels; |
737 | unsigned n_rx_channels; | 737 | unsigned n_rx_channels; |
738 | unsigned tx_channel_offset; | ||
738 | unsigned n_tx_channels; | 739 | unsigned n_tx_channels; |
739 | unsigned int rx_buffer_len; | 740 | unsigned int rx_buffer_len; |
740 | unsigned int rx_buffer_order; | 741 | unsigned int rx_buffer_order; |
@@ -929,8 +930,13 @@ efx_get_channel(struct efx_nic *efx, unsigned index) | |||
929 | _channel = (_channel->channel + 1 < (_efx)->n_channels) ? \ | 930 | _channel = (_channel->channel + 1 < (_efx)->n_channels) ? \ |
930 | (_efx)->channel[_channel->channel + 1] : NULL) | 931 | (_efx)->channel[_channel->channel + 1] : NULL) |
931 | 932 | ||
932 | extern struct efx_tx_queue * | 933 | static inline struct efx_tx_queue * |
933 | efx_get_tx_queue(struct efx_nic *efx, unsigned index, unsigned type); | 934 | efx_get_tx_queue(struct efx_nic *efx, unsigned index, unsigned type) |
935 | { | ||
936 | EFX_BUG_ON_PARANOID(index >= efx->n_tx_channels || | ||
937 | type >= EFX_TXQ_TYPES); | ||
938 | return &efx->channel[efx->tx_channel_offset + index]->tx_queue[type]; | ||
939 | } | ||
934 | 940 | ||
935 | static inline struct efx_tx_queue * | 941 | static inline struct efx_tx_queue * |
936 | efx_channel_get_tx_queue(struct efx_channel *channel, unsigned type) | 942 | efx_channel_get_tx_queue(struct efx_channel *channel, unsigned type) |