aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb4
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2010-10-18 11:16:45 -0400
committerRoland Dreier <rolandd@cisco.com>2010-10-23 00:58:50 -0400
commitda411ba1daf895bdae9420101e8e2741d6633342 (patch)
tree20ba7a4742c8fe2fa8283b2d98017031ced8d70f /drivers/infiniband/hw/cxgb4
parentde5dd81b49c27c7818492be0746bfed6ac3b1c8d (diff)
RDMA/cxgb4: Use cxgb4 service for packet gl to skb
Remove the local service t4_pktgl_to_skb() and use cxgb4_pktgl_to_skb() exported by cxgb4. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/cxgb4')
-rw-r--r--drivers/infiniband/hw/cxgb4/device.c42
1 files changed, 1 insertions, 41 deletions
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index 22a290d0d5bf..54fbc1118abe 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -454,46 +454,6 @@ out:
454 return dev; 454 return dev;
455} 455}
456 456
457static struct sk_buff *t4_pktgl_to_skb(const struct pkt_gl *gl,
458 unsigned int skb_len,
459 unsigned int pull_len)
460{
461 struct sk_buff *skb;
462 struct skb_shared_info *ssi;
463
464 if (gl->tot_len <= 512) {
465 skb = alloc_skb(gl->tot_len, GFP_ATOMIC);
466 if (unlikely(!skb))
467 goto out;
468 __skb_put(skb, gl->tot_len);
469 skb_copy_to_linear_data(skb, gl->va, gl->tot_len);
470 } else {
471 skb = alloc_skb(skb_len, GFP_ATOMIC);
472 if (unlikely(!skb))
473 goto out;
474 __skb_put(skb, pull_len);
475 skb_copy_to_linear_data(skb, gl->va, pull_len);
476
477 ssi = skb_shinfo(skb);
478 ssi->frags[0].page = gl->frags[0].page;
479 ssi->frags[0].page_offset = gl->frags[0].page_offset + pull_len;
480 ssi->frags[0].size = gl->frags[0].size - pull_len;
481 if (gl->nfrags > 1)
482 memcpy(&ssi->frags[1], &gl->frags[1],
483 (gl->nfrags - 1) * sizeof(skb_frag_t));
484 ssi->nr_frags = gl->nfrags;
485
486 skb->len = gl->tot_len;
487 skb->data_len = skb->len - pull_len;
488 skb->truesize += skb->data_len;
489
490 /* Get a reference for the last page, we don't own it */
491 get_page(gl->frags[gl->nfrags - 1].page);
492 }
493out:
494 return skb;
495}
496
497static int c4iw_uld_rx_handler(void *handle, const __be64 *rsp, 457static int c4iw_uld_rx_handler(void *handle, const __be64 *rsp,
498 const struct pkt_gl *gl) 458 const struct pkt_gl *gl)
499{ 459{
@@ -518,7 +478,7 @@ static int c4iw_uld_rx_handler(void *handle, const __be64 *rsp,
518 c4iw_ev_handler(dev, qid); 478 c4iw_ev_handler(dev, qid);
519 return 0; 479 return 0;
520 } else { 480 } else {
521 skb = t4_pktgl_to_skb(gl, 128, 128); 481 skb = cxgb4_pktgl_to_skb(gl, 128, 128);
522 if (unlikely(!skb)) 482 if (unlikely(!skb))
523 goto nomem; 483 goto nomem;
524 } 484 }