diff options
Diffstat (limited to 'drivers/net/sfc/falcon.c')
-rw-r--r-- | drivers/net/sfc/falcon.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 61ddd2c6e750..734fcfb52e85 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2005-2006 Fen Systems Ltd. | 3 | * Copyright 2005-2006 Fen Systems Ltd. |
4 | * Copyright 2006-2009 Solarflare Communications Inc. | 4 | * Copyright 2006-2010 Solarflare Communications Inc. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License version 2 as published | 7 | * under the terms of the GNU General Public License version 2 as published |
@@ -1478,36 +1478,26 @@ static void falcon_init_rx_cfg(struct efx_nic *efx) | |||
1478 | /* RX control FIFO thresholds (32 entries) */ | 1478 | /* RX control FIFO thresholds (32 entries) */ |
1479 | const unsigned ctrl_xon_thr = 20; | 1479 | const unsigned ctrl_xon_thr = 20; |
1480 | const unsigned ctrl_xoff_thr = 25; | 1480 | const unsigned ctrl_xoff_thr = 25; |
1481 | /* RX data FIFO thresholds (256-byte units; size varies) */ | ||
1482 | int data_xon_thr = efx_nic_rx_xon_thresh >> 8; | ||
1483 | int data_xoff_thr = efx_nic_rx_xoff_thresh >> 8; | ||
1484 | efx_oword_t reg; | 1481 | efx_oword_t reg; |
1485 | 1482 | ||
1486 | efx_reado(efx, ®, FR_AZ_RX_CFG); | 1483 | efx_reado(efx, ®, FR_AZ_RX_CFG); |
1487 | if (efx_nic_rev(efx) <= EFX_REV_FALCON_A1) { | 1484 | if (efx_nic_rev(efx) <= EFX_REV_FALCON_A1) { |
1488 | /* Data FIFO size is 5.5K */ | 1485 | /* Data FIFO size is 5.5K */ |
1489 | if (data_xon_thr < 0) | ||
1490 | data_xon_thr = 512 >> 8; | ||
1491 | if (data_xoff_thr < 0) | ||
1492 | data_xoff_thr = 2048 >> 8; | ||
1493 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_DESC_PUSH_EN, 0); | 1486 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_DESC_PUSH_EN, 0); |
1494 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_USR_BUF_SIZE, | 1487 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_USR_BUF_SIZE, |
1495 | huge_buf_size); | 1488 | huge_buf_size); |
1496 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_MAC_TH, data_xon_thr); | 1489 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_MAC_TH, 512 >> 8); |
1497 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_MAC_TH, data_xoff_thr); | 1490 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_MAC_TH, 2048 >> 8); |
1498 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_TX_TH, ctrl_xon_thr); | 1491 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_TX_TH, ctrl_xon_thr); |
1499 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_TX_TH, ctrl_xoff_thr); | 1492 | EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_TX_TH, ctrl_xoff_thr); |
1500 | } else { | 1493 | } else { |
1501 | /* Data FIFO size is 80K; register fields moved */ | 1494 | /* Data FIFO size is 80K; register fields moved */ |
1502 | if (data_xon_thr < 0) | ||
1503 | data_xon_thr = 27648 >> 8; /* ~3*max MTU */ | ||
1504 | if (data_xoff_thr < 0) | ||
1505 | data_xoff_thr = 54272 >> 8; /* ~80Kb - 3*max MTU */ | ||
1506 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_DESC_PUSH_EN, 0); | 1495 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_DESC_PUSH_EN, 0); |
1507 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_USR_BUF_SIZE, | 1496 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_USR_BUF_SIZE, |
1508 | huge_buf_size); | 1497 | huge_buf_size); |
1509 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_MAC_TH, data_xon_thr); | 1498 | /* Send XON and XOFF at ~3 * max MTU away from empty/full */ |
1510 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_MAC_TH, data_xoff_thr); | 1499 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_MAC_TH, 27648 >> 8); |
1500 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_MAC_TH, 54272 >> 8); | ||
1511 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_TX_TH, ctrl_xon_thr); | 1501 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_TX_TH, ctrl_xon_thr); |
1512 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_TX_TH, ctrl_xoff_thr); | 1502 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_TX_TH, ctrl_xoff_thr); |
1513 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1); | 1503 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1); |