]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/sfc/efx.c
sfc: Reverse initial buffer table allocation to allow for later resizing
[karo-tx-linux.git] / drivers / net / ethernet / sfc / efx.c
index ac571cf144853c77d50dd9081a1886d0324bbf9f..c7004dcb58380bb2c7e2518755041160235be4f7 100644 (file)
@@ -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,