Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347313
b: refs/heads/master
c: d23e946
h: refs/heads/master
i:
  347311: faad943
v: v3
  • Loading branch information
Sathya Perla authored and David S. Miller committed Dec 19, 2012
1 parent 68f024c commit 5c0c712
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 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: a323d9bf835e27d5e72eae86b5a41747d98bd9d2
refs/heads/master: d23e946cb67e5011226bcbd1597a632ac7a48c35
2 changes: 1 addition & 1 deletion trunk/drivers/net/ethernet/emulex/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ static inline bool be_error(struct be_adapter *adapter)
return adapter->eeh_error || adapter->hw_error || adapter->fw_timeout;
}

static inline bool be_crit_error(struct be_adapter *adapter)
static inline bool be_hw_error(struct be_adapter *adapter)
{
return adapter->eeh_error || adapter->hw_error;
}
Expand Down
38 changes: 32 additions & 6 deletions trunk/drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1689,15 +1689,41 @@ static void be_rx_cq_clean(struct be_rx_obj *rxo)
struct be_queue_info *rxq = &rxo->q;
struct be_queue_info *rx_cq = &rxo->cq;
struct be_rx_compl_info *rxcp;
struct be_adapter *adapter = rxo->adapter;
int flush_wait = 0;
u16 tail;

/* First cleanup pending rx completions */
while ((rxcp = be_rx_compl_get(rxo)) != NULL) {
be_rx_compl_discard(rxo, rxcp);
be_cq_notify(rxo->adapter, rx_cq->id, false, 1);
/* Consume pending rx completions.
* Wait for the flush completion (identified by zero num_rcvd)
* to arrive. Notify CQ even when there are no more CQ entries
* for HW to flush partially coalesced CQ entries.
* In Lancer, there is no need to wait for flush compl.
*/
for (;;) {
rxcp = be_rx_compl_get(rxo);
if (rxcp == NULL) {
if (lancer_chip(adapter))
break;

if (flush_wait++ > 10 || be_hw_error(adapter)) {
dev_warn(&adapter->pdev->dev,
"did not receive flush compl\n");
break;
}
be_cq_notify(adapter, rx_cq->id, true, 0);
mdelay(1);
} else {
be_rx_compl_discard(rxo, rxcp);
be_cq_notify(adapter, rx_cq->id, true, 1);
if (rxcp->num_rcvd == 0)
break;
}
}

/* Then free posted rx buffer that were not used */
/* After cleanup, leave the CQ in unarmed state */
be_cq_notify(adapter, rx_cq->id, false, 0);

/* Then free posted rx buffers that were not used */
tail = (rxq->head + rxq->len - atomic_read(&rxq->used)) % rxq->len;
for (; atomic_read(&rxq->used) > 0; index_inc(&tail, rxq->len)) {
page_info = get_rx_page_info(rxo, tail);
Expand Down Expand Up @@ -2157,7 +2183,7 @@ void be_detect_error(struct be_adapter *adapter)
u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0;
u32 i;

if (be_crit_error(adapter))
if (be_hw_error(adapter))
return;

if (lancer_chip(adapter)) {
Expand Down

0 comments on commit 5c0c712

Please sign in to comment.