diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/amso1100/c2.c | 6 | ||||
-rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_cm.c | 17 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_cm.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 2 |
4 files changed, 15 insertions, 12 deletions
diff --git a/drivers/infiniband/hw/amso1100/c2.c b/drivers/infiniband/hw/amso1100/c2.c index 59243d9aedd6..58bc272bd407 100644 --- a/drivers/infiniband/hw/amso1100/c2.c +++ b/drivers/infiniband/hw/amso1100/c2.c | |||
@@ -439,7 +439,8 @@ static void c2_rx_error(struct c2_port *c2_port, struct c2_element *elem) | |||
439 | } | 439 | } |
440 | 440 | ||
441 | /* Setup the skb for reuse since we're dropping this pkt */ | 441 | /* Setup the skb for reuse since we're dropping this pkt */ |
442 | elem->skb->tail = elem->skb->data = elem->skb->head; | 442 | elem->skb->data = elem->skb->head; |
443 | skb_reset_tail_pointer(elem->skb); | ||
443 | 444 | ||
444 | /* Zero out the rxp hdr in the sk_buff */ | 445 | /* Zero out the rxp hdr in the sk_buff */ |
445 | memset(elem->skb->data, 0, sizeof(*rxp_hdr)); | 446 | memset(elem->skb->data, 0, sizeof(*rxp_hdr)); |
@@ -521,9 +522,8 @@ static void c2_rx_interrupt(struct net_device *netdev) | |||
521 | * "sizeof(struct c2_rxp_hdr)". | 522 | * "sizeof(struct c2_rxp_hdr)". |
522 | */ | 523 | */ |
523 | skb->data += sizeof(*rxp_hdr); | 524 | skb->data += sizeof(*rxp_hdr); |
524 | skb->tail = skb->data + buflen; | 525 | skb_set_tail_pointer(skb, buflen); |
525 | skb->len = buflen; | 526 | skb->len = buflen; |
526 | skb->dev = netdev; | ||
527 | skb->protocol = eth_type_trans(skb, netdev); | 527 | skb->protocol = eth_type_trans(skb, netdev); |
528 | 528 | ||
529 | netif_rx(skb); | 529 | netif_rx(skb); |
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index 2d2de9b8b729..3b4b0acd707f 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c | |||
@@ -477,7 +477,7 @@ static void send_mpa_req(struct iwch_ep *ep, struct sk_buff *skb) | |||
477 | BUG_ON(skb_cloned(skb)); | 477 | BUG_ON(skb_cloned(skb)); |
478 | 478 | ||
479 | mpalen = sizeof(*mpa) + ep->plen; | 479 | mpalen = sizeof(*mpa) + ep->plen; |
480 | if (skb->data + mpalen + sizeof(*req) > skb->end) { | 480 | if (skb->data + mpalen + sizeof(*req) > skb_end_pointer(skb)) { |
481 | kfree_skb(skb); | 481 | kfree_skb(skb); |
482 | skb=alloc_skb(mpalen + sizeof(*req), GFP_KERNEL); | 482 | skb=alloc_skb(mpalen + sizeof(*req), GFP_KERNEL); |
483 | if (!skb) { | 483 | if (!skb) { |
@@ -507,7 +507,7 @@ static void send_mpa_req(struct iwch_ep *ep, struct sk_buff *skb) | |||
507 | */ | 507 | */ |
508 | skb_get(skb); | 508 | skb_get(skb); |
509 | set_arp_failure_handler(skb, arp_failure_discard); | 509 | set_arp_failure_handler(skb, arp_failure_discard); |
510 | skb->h.raw = skb->data; | 510 | skb_reset_transport_header(skb); |
511 | len = skb->len; | 511 | len = skb->len; |
512 | req = (struct tx_data_wr *) skb_push(skb, sizeof(*req)); | 512 | req = (struct tx_data_wr *) skb_push(skb, sizeof(*req)); |
513 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)); | 513 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)); |
@@ -559,7 +559,7 @@ static int send_mpa_reject(struct iwch_ep *ep, const void *pdata, u8 plen) | |||
559 | skb_get(skb); | 559 | skb_get(skb); |
560 | skb->priority = CPL_PRIORITY_DATA; | 560 | skb->priority = CPL_PRIORITY_DATA; |
561 | set_arp_failure_handler(skb, arp_failure_discard); | 561 | set_arp_failure_handler(skb, arp_failure_discard); |
562 | skb->h.raw = skb->data; | 562 | skb_reset_transport_header(skb); |
563 | req = (struct tx_data_wr *) skb_push(skb, sizeof(*req)); | 563 | req = (struct tx_data_wr *) skb_push(skb, sizeof(*req)); |
564 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)); | 564 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)); |
565 | req->wr_lo = htonl(V_WR_TID(ep->hwtid)); | 565 | req->wr_lo = htonl(V_WR_TID(ep->hwtid)); |
@@ -610,7 +610,7 @@ static int send_mpa_reply(struct iwch_ep *ep, const void *pdata, u8 plen) | |||
610 | */ | 610 | */ |
611 | skb_get(skb); | 611 | skb_get(skb); |
612 | set_arp_failure_handler(skb, arp_failure_discard); | 612 | set_arp_failure_handler(skb, arp_failure_discard); |
613 | skb->h.raw = skb->data; | 613 | skb_reset_transport_header(skb); |
614 | len = skb->len; | 614 | len = skb->len; |
615 | req = (struct tx_data_wr *) skb_push(skb, sizeof(*req)); | 615 | req = (struct tx_data_wr *) skb_push(skb, sizeof(*req)); |
616 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)); | 616 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)); |
@@ -821,7 +821,8 @@ static void process_mpa_reply(struct iwch_ep *ep, struct sk_buff *skb) | |||
821 | /* | 821 | /* |
822 | * copy the new data into our accumulation buffer. | 822 | * copy the new data into our accumulation buffer. |
823 | */ | 823 | */ |
824 | memcpy(&(ep->mpa_pkt[ep->mpa_pkt_len]), skb->data, skb->len); | 824 | skb_copy_from_linear_data(skb, &(ep->mpa_pkt[ep->mpa_pkt_len]), |
825 | skb->len); | ||
825 | ep->mpa_pkt_len += skb->len; | 826 | ep->mpa_pkt_len += skb->len; |
826 | 827 | ||
827 | /* | 828 | /* |
@@ -940,7 +941,8 @@ static void process_mpa_request(struct iwch_ep *ep, struct sk_buff *skb) | |||
940 | /* | 941 | /* |
941 | * Copy the new data into our accumulation buffer. | 942 | * Copy the new data into our accumulation buffer. |
942 | */ | 943 | */ |
943 | memcpy(&(ep->mpa_pkt[ep->mpa_pkt_len]), skb->data, skb->len); | 944 | skb_copy_from_linear_data(skb, &(ep->mpa_pkt[ep->mpa_pkt_len]), |
945 | skb->len); | ||
944 | ep->mpa_pkt_len += skb->len; | 946 | ep->mpa_pkt_len += skb->len; |
945 | 947 | ||
946 | /* | 948 | /* |
@@ -1619,7 +1621,8 @@ static int terminate(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) | |||
1619 | PDBG("%s ep %p\n", __FUNCTION__, ep); | 1621 | PDBG("%s ep %p\n", __FUNCTION__, ep); |
1620 | skb_pull(skb, sizeof(struct cpl_rdma_terminate)); | 1622 | skb_pull(skb, sizeof(struct cpl_rdma_terminate)); |
1621 | PDBG("%s saving %d bytes of term msg\n", __FUNCTION__, skb->len); | 1623 | PDBG("%s saving %d bytes of term msg\n", __FUNCTION__, skb->len); |
1622 | memcpy(ep->com.qp->attr.terminate_buffer, skb->data, skb->len); | 1624 | skb_copy_from_linear_data(skb, ep->com.qp->attr.terminate_buffer, |
1625 | skb->len); | ||
1623 | ep->com.qp->attr.terminate_msg_len = skb->len; | 1626 | ep->com.qp->attr.terminate_msg_len = skb->len; |
1624 | ep->com.qp->attr.is_terminate_local = 0; | 1627 | ep->com.qp->attr.is_terminate_local = 0; |
1625 | return CPL_RET_BUF_DONE; | 1628 | return CPL_RET_BUF_DONE; |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index da7e10230cf8..0c4e59b906cd 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c | |||
@@ -406,7 +406,7 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc) | |||
406 | skb_put_frags(skb, IPOIB_CM_HEAD_SIZE, wc->byte_len, newskb); | 406 | skb_put_frags(skb, IPOIB_CM_HEAD_SIZE, wc->byte_len, newskb); |
407 | 407 | ||
408 | skb->protocol = ((struct ipoib_header *) skb->data)->proto; | 408 | skb->protocol = ((struct ipoib_header *) skb->data)->proto; |
409 | skb->mac.raw = skb->data; | 409 | skb_reset_mac_header(skb); |
410 | skb_pull(skb, IPOIB_ENCAP_LEN); | 410 | skb_pull(skb, IPOIB_ENCAP_LEN); |
411 | 411 | ||
412 | dev->last_rx = jiffies; | 412 | dev->last_rx = jiffies; |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index c17e777cdc47..1bdb9101911a 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -216,7 +216,7 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc) | |||
216 | if (wc->slid != priv->local_lid || | 216 | if (wc->slid != priv->local_lid || |
217 | wc->src_qp != priv->qp->qp_num) { | 217 | wc->src_qp != priv->qp->qp_num) { |
218 | skb->protocol = ((struct ipoib_header *) skb->data)->proto; | 218 | skb->protocol = ((struct ipoib_header *) skb->data)->proto; |
219 | skb->mac.raw = skb->data; | 219 | skb_reset_mac_header(skb); |
220 | skb_pull(skb, IPOIB_ENCAP_LEN); | 220 | skb_pull(skb, IPOIB_ENCAP_LEN); |
221 | 221 | ||
222 | dev->last_rx = jiffies; | 222 | dev->last_rx = jiffies; |