Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135153
b: refs/heads/master
c: 9bb2b31
h: refs/heads/master
i:
  135151: cd6fd38
v: v3
  • Loading branch information
Divy Le Ray authored and David S. Miller committed Mar 13, 2009
1 parent b94ebb4 commit 3dc0cea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 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: 26b3871d2c82b7c733a3b6d631a6e48c9ebf1c5a
refs/heads/master: 9bb2b31e6f87dba06b81429af91362a9127f5bf2
26 changes: 14 additions & 12 deletions trunk/drivers/net/cxgb3/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,18 @@ static inline int should_restart_tx(const struct sge_txq *q)
return q->in_use - r < (q->size >> 1);
}

static void clear_rx_desc(const struct sge_fl *q, struct rx_sw_desc *d)
{
if (q->use_pages) {
if (d->pg_chunk.page)
put_page(d->pg_chunk.page);
d->pg_chunk.page = NULL;
} else {
kfree_skb(d->skb);
d->skb = NULL;
}
}

/**
* free_rx_bufs - free the Rx buffers on an SGE free list
* @pdev: the PCI device associated with the adapter
Expand All @@ -355,14 +367,7 @@ static void free_rx_bufs(struct pci_dev *pdev, struct sge_fl *q)

pci_unmap_single(pdev, pci_unmap_addr(d, dma_addr),
q->buf_size, PCI_DMA_FROMDEVICE);
if (q->use_pages) {
if (d->pg_chunk.page)
put_page(d->pg_chunk.page);
d->pg_chunk.page = NULL;
} else {
kfree_skb(d->skb);
d->skb = NULL;
}
clear_rx_desc(q, d);
if (++cidx == q->size)
cidx = 0;
}
Expand Down Expand Up @@ -475,10 +480,7 @@ nomem: q->alloc_failed++;
err = add_one_rx_buf(buf_start, q->buf_size, d, sd, q->gen,
adap->pdev);
if (unlikely(err)) {
if (!q->use_pages) {
kfree_skb(sd->skb);
sd->skb = NULL;
}
clear_rx_desc(q, sd);
break;
}

Expand Down

0 comments on commit 3dc0cea

Please sign in to comment.