diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-02-22 00:22:00 +0100 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-02-22 21:48:08 +0100 |
commit | c92aaff18e0a48f693678105343160e0bd032dfa (patch) | |
tree | 363bbef1367573f47e9bf93e67e1d1d6daf22b2c | |
parent | sfc: Correct validation of peer_page_count in efx_vfdi_set_status_page() (diff) | |
download | linux-c92aaff18e0a48f693678105343160e0bd032dfa.tar.xz linux-c92aaff18e0a48f693678105343160e0bd032dfa.zip |
sfc: Reverse initial buffer table allocation to allow for later resizing
We have a very simple way of allocating buffer table entries to
queues, which is just to take the next one available. The extra
channels are the highest numbered channels but they need to be
allocated the lowest entries so that the traffic channels can be
allocated new entries without any collisions.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r-- | drivers/net/ethernet/sfc/efx.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index ac571cf14485..c7004dcb5838 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -585,7 +585,12 @@ static int efx_probe_channels(struct efx_nic *efx) /* Restart special buffer allocation */ efx->next_buffer_table = 0; - efx_for_each_channel(channel, efx) { + /* Probe channels in reverse, so that any 'extra' channels + * use the start of the buffer table. This allows the traffic + * channels to be resized without moving them or wasting the + * entries before them. + */ + efx_for_each_channel_rev(channel, efx) { rc = efx_probe_channel(channel); if (rc) { netif_err(efx, probe, efx->net_dev, |