Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97326
b: refs/heads/master
c: f7f13b0
h: refs/heads/master
v: v3
  • Loading branch information
Ben Hutchings authored and Jeff Garzik committed May 22, 2008
1 parent c6109d3 commit 60641a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 91ad757c2fc35ec79dd2c909dc6dc721b9c257f3
refs/heads/master: f7f13b0b9253e21557ad090144a44f20860332f1
29 changes: 8 additions & 21 deletions trunk/drivers/net/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,26 +317,6 @@ static void efx_remove_eventq(struct efx_channel *channel)
*
*************************************************************************/

/* Setup per-NIC RX buffer parameters.
* Calculate the rx buffer allocation parameters required to support
* the current MTU, including padding for header alignment and overruns.
*/
static void efx_calc_rx_buffer_params(struct efx_nic *efx)
{
unsigned int order, len;

len = (max(EFX_PAGE_IP_ALIGN, NET_IP_ALIGN) +
EFX_MAX_FRAME_LEN(efx->net_dev->mtu) +
efx->type->rx_buffer_padding);

/* Calculate page-order */
for (order = 0; ((1u << order) * PAGE_SIZE) < len; ++order)
;

efx->rx_buffer_len = len;
efx->rx_buffer_order = order;
}

static int efx_probe_channel(struct efx_channel *channel)
{
struct efx_tx_queue *tx_queue;
Expand Down Expand Up @@ -387,7 +367,14 @@ static int efx_init_channels(struct efx_nic *efx)
struct efx_channel *channel;
int rc = 0;

efx_calc_rx_buffer_params(efx);
/* Calculate the rx buffer allocation parameters required to
* support the current MTU, including padding for header
* alignment and overruns.
*/
efx->rx_buffer_len = (max(EFX_PAGE_IP_ALIGN, NET_IP_ALIGN) +
EFX_MAX_FRAME_LEN(efx->net_dev->mtu) +
efx->type->rx_buffer_padding);
efx->rx_buffer_order = get_order(efx->rx_buffer_len);

/* Initialise the channels */
efx_for_each_channel(channel, efx) {
Expand Down

0 comments on commit 60641a0

Please sign in to comment.