diff options
author | Hariprasad Shenai <hariprasad@chelsio.com> | 2015-05-05 12:29:51 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-06 02:31:48 +0300 |
commit | 1343299727e99230156ddb0dbac0f84e8e0a1d1e (patch) | |
tree | 06d5b508cb6cb09db9d8ec8050f70cb1442cded9 /drivers/net/ethernet/chelsio/cxgb4vf | |
parent | 6decd63acacb3b8de81ccc435cf9acea8b6bdfeb (diff) | |
download | linux-1343299727e99230156ddb0dbac0f84e8e0a1d1e.tar.xz |
cxgb4: Make sure that Freelist size is larger than Egress Congestion Threshold
We need to make sure that the Free List Size, in pointers, is at
least 2 Egress Queue Units (8 pointers/each) larger than the SGE's Egress
Congestion Threshold (in pointers).
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4vf')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4vf/sge.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c index 482f6de6817d..cc92c6984737 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c @@ -2243,8 +2243,12 @@ int t4vf_sge_alloc_rxq(struct adapter *adapter, struct sge_rspq *rspq, * Allocate the ring for the hardware free list (with space * for its status page) along with the associated software * descriptor ring. The free list size needs to be a multiple - * of the Egress Queue Unit. + * of the Egress Queue Unit and at least 2 Egress Units larger + * than the SGE's Egress Congrestion Threshold + * (fl_starve_thres - 1). */ + if (fl->size < s->fl_starve_thres - 1 + 2 * FL_PER_EQ_UNIT) + fl->size = s->fl_starve_thres - 1 + 2 * FL_PER_EQ_UNIT; fl->size = roundup(fl->size, FL_PER_EQ_UNIT); fl->desc = alloc_ring(adapter->pdev_dev, fl->size, sizeof(__be64), sizeof(struct rx_sw_desc), |