Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217727
b: refs/heads/master
c: da411ba
h: refs/heads/master
i:
  217725: 1af3928
  217723: eda78d6
  217719: 580bfec
  217711: 7c667f1
  217695: 65ad167
  217663: a4f540d
  217599: 478c209
v: v3
  • Loading branch information
Steve Wise authored and Roland Dreier committed Oct 23, 2010
1 parent 587fd91 commit 22b7726
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 42 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: de5dd81b49c27c7818492be0746bfed6ac3b1c8d
refs/heads/master: da411ba1daf895bdae9420101e8e2741d6633342
42 changes: 1 addition & 41 deletions trunk/drivers/infiniband/hw/cxgb4/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,46 +454,6 @@ static void *c4iw_uld_add(const struct cxgb4_lld_info *infop)
return dev;
}

static struct sk_buff *t4_pktgl_to_skb(const struct pkt_gl *gl,
unsigned int skb_len,
unsigned int pull_len)
{
struct sk_buff *skb;
struct skb_shared_info *ssi;

if (gl->tot_len <= 512) {
skb = alloc_skb(gl->tot_len, GFP_ATOMIC);
if (unlikely(!skb))
goto out;
__skb_put(skb, gl->tot_len);
skb_copy_to_linear_data(skb, gl->va, gl->tot_len);
} else {
skb = alloc_skb(skb_len, GFP_ATOMIC);
if (unlikely(!skb))
goto out;
__skb_put(skb, pull_len);
skb_copy_to_linear_data(skb, gl->va, pull_len);

ssi = skb_shinfo(skb);
ssi->frags[0].page = gl->frags[0].page;
ssi->frags[0].page_offset = gl->frags[0].page_offset + pull_len;
ssi->frags[0].size = gl->frags[0].size - pull_len;
if (gl->nfrags > 1)
memcpy(&ssi->frags[1], &gl->frags[1],
(gl->nfrags - 1) * sizeof(skb_frag_t));
ssi->nr_frags = gl->nfrags;

skb->len = gl->tot_len;
skb->data_len = skb->len - pull_len;
skb->truesize += skb->data_len;

/* Get a reference for the last page, we don't own it */
get_page(gl->frags[gl->nfrags - 1].page);
}
out:
return skb;
}

static int c4iw_uld_rx_handler(void *handle, const __be64 *rsp,
const struct pkt_gl *gl)
{
Expand All @@ -518,7 +478,7 @@ static int c4iw_uld_rx_handler(void *handle, const __be64 *rsp,
c4iw_ev_handler(dev, qid);
return 0;
} else {
skb = t4_pktgl_to_skb(gl, 128, 128);
skb = cxgb4_pktgl_to_skb(gl, 128, 128);
if (unlikely(!skb))
goto nomem;
}
Expand Down

0 comments on commit 22b7726

Please sign in to comment.