aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/netiucv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/net/netiucv.c')
-rw-r--r--drivers/s390/net/netiucv.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 594320ca1b7c..e10e85e85c84 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -635,7 +635,7 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
635 return; 635 return;
636 } 636 }
637 skb_put(pskb, header->next); 637 skb_put(pskb, header->next);
638 pskb->mac.raw = pskb->data; 638 skb_reset_mac_header(pskb);
639 skb = dev_alloc_skb(pskb->len); 639 skb = dev_alloc_skb(pskb->len);
640 if (!skb) { 640 if (!skb) {
641 PRINT_WARN("%s Out of memory in netiucv_unpack_skb\n", 641 PRINT_WARN("%s Out of memory in netiucv_unpack_skb\n",
@@ -645,8 +645,9 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
645 privptr->stats.rx_dropped++; 645 privptr->stats.rx_dropped++;
646 return; 646 return;
647 } 647 }
648 memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len); 648 skb_copy_from_linear_data(pskb, skb_put(skb, pskb->len),
649 skb->mac.raw = skb->data; 649 pskb->len);
650 skb_reset_mac_header(skb);
650 skb->dev = pskb->dev; 651 skb->dev = pskb->dev;
651 skb->protocol = pskb->protocol; 652 skb->protocol = pskb->protocol;
652 pskb->ip_summed = CHECKSUM_UNNECESSARY; 653 pskb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -689,7 +690,8 @@ static void conn_action_rx(fsm_instance *fi, int event, void *arg)
689 msg->length, conn->max_buffsize); 690 msg->length, conn->max_buffsize);
690 return; 691 return;
691 } 692 }
692 conn->rx_buff->data = conn->rx_buff->tail = conn->rx_buff->head; 693 conn->rx_buff->data = conn->rx_buff->head;
694 skb_reset_tail_pointer(conn->rx_buff);
693 conn->rx_buff->len = 0; 695 conn->rx_buff->len = 0;
694 rc = iucv_message_receive(conn->path, msg, 0, conn->rx_buff->data, 696 rc = iucv_message_receive(conn->path, msg, 0, conn->rx_buff->data,
695 msg->length, NULL); 697 msg->length, NULL);
@@ -735,14 +737,17 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg)
735 } 737 }
736 } 738 }
737 } 739 }
738 conn->tx_buff->data = conn->tx_buff->tail = conn->tx_buff->head; 740 conn->tx_buff->data = conn->tx_buff->head;
741 skb_reset_tail_pointer(conn->tx_buff);
739 conn->tx_buff->len = 0; 742 conn->tx_buff->len = 0;
740 spin_lock_irqsave(&conn->collect_lock, saveflags); 743 spin_lock_irqsave(&conn->collect_lock, saveflags);
741 while ((skb = skb_dequeue(&conn->collect_queue))) { 744 while ((skb = skb_dequeue(&conn->collect_queue))) {
742 header.next = conn->tx_buff->len + skb->len + NETIUCV_HDRLEN; 745 header.next = conn->tx_buff->len + skb->len + NETIUCV_HDRLEN;
743 memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, 746 memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header,
744 NETIUCV_HDRLEN); 747 NETIUCV_HDRLEN);
745 memcpy(skb_put(conn->tx_buff, skb->len), skb->data, skb->len); 748 skb_copy_from_linear_data(skb,
749 skb_put(conn->tx_buff, skb->len),
750 skb->len);
746 txbytes += skb->len; 751 txbytes += skb->len;
747 txpackets++; 752 txpackets++;
748 stat_maxcq++; 753 stat_maxcq++;
@@ -1164,8 +1169,8 @@ static int netiucv_transmit_skb(struct iucv_connection *conn,
1164 * Copy the skb to a new allocated skb in lowmem only if the 1169 * Copy the skb to a new allocated skb in lowmem only if the
1165 * data is located above 2G in memory or tailroom is < 2. 1170 * data is located above 2G in memory or tailroom is < 2.
1166 */ 1171 */
1167 unsigned long hi = 1172 unsigned long hi = ((unsigned long)(skb_tail_pointer(skb) +
1168 ((unsigned long)(skb->tail + NETIUCV_HDRLEN)) >> 31; 1173 NETIUCV_HDRLEN)) >> 31;
1169 int copied = 0; 1174 int copied = 0;
1170 if (hi || (skb_tailroom(skb) < 2)) { 1175 if (hi || (skb_tailroom(skb) < 2)) {
1171 nskb = alloc_skb(skb->len + NETIUCV_HDRLEN + 1176 nskb = alloc_skb(skb->len + NETIUCV_HDRLEN +