diff options
Diffstat (limited to 'drivers/net/chelsio/sge.c')
-rw-r--r-- | drivers/net/chelsio/sge.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index 326d4a665123..e4f874a70fe5 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c | |||
@@ -1062,7 +1062,7 @@ static inline struct sk_buff *get_packet(struct pci_dev *pdev, | |||
1062 | pci_unmap_addr(ce, dma_addr), | 1062 | pci_unmap_addr(ce, dma_addr), |
1063 | pci_unmap_len(ce, dma_len), | 1063 | pci_unmap_len(ce, dma_len), |
1064 | PCI_DMA_FROMDEVICE); | 1064 | PCI_DMA_FROMDEVICE); |
1065 | memcpy(skb->data, ce->skb->data, len); | 1065 | skb_copy_from_linear_data(ce->skb, skb->data, len); |
1066 | pci_dma_sync_single_for_device(pdev, | 1066 | pci_dma_sync_single_for_device(pdev, |
1067 | pci_unmap_addr(ce, dma_addr), | 1067 | pci_unmap_addr(ce, dma_addr), |
1068 | pci_unmap_len(ce, dma_len), | 1068 | pci_unmap_len(ce, dma_len), |
@@ -1379,12 +1379,11 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len) | |||
1379 | } | 1379 | } |
1380 | __skb_pull(skb, sizeof(*p)); | 1380 | __skb_pull(skb, sizeof(*p)); |
1381 | 1381 | ||
1382 | skb->dev = adapter->port[p->iff].dev; | ||
1383 | skb->dev->last_rx = jiffies; | 1382 | skb->dev->last_rx = jiffies; |
1384 | st = per_cpu_ptr(sge->port_stats[p->iff], smp_processor_id()); | 1383 | st = per_cpu_ptr(sge->port_stats[p->iff], smp_processor_id()); |
1385 | st->rx_packets++; | 1384 | st->rx_packets++; |
1386 | 1385 | ||
1387 | skb->protocol = eth_type_trans(skb, skb->dev); | 1386 | skb->protocol = eth_type_trans(skb, adapter->port[p->iff].dev); |
1388 | if ((adapter->flags & RX_CSUM_ENABLED) && p->csum == 0xffff && | 1387 | if ((adapter->flags & RX_CSUM_ENABLED) && p->csum == 0xffff && |
1389 | skb->protocol == htons(ETH_P_IP) && | 1388 | skb->protocol == htons(ETH_P_IP) && |
1390 | (skb->data[9] == IPPROTO_TCP || skb->data[9] == IPPROTO_UDP)) { | 1389 | (skb->data[9] == IPPROTO_TCP || skb->data[9] == IPPROTO_UDP)) { |
@@ -1866,14 +1865,14 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1866 | 1865 | ||
1867 | ++st->tx_tso; | 1866 | ++st->tx_tso; |
1868 | 1867 | ||
1869 | eth_type = skb->nh.raw - skb->data == ETH_HLEN ? | 1868 | eth_type = skb_network_offset(skb) == ETH_HLEN ? |
1870 | CPL_ETH_II : CPL_ETH_II_VLAN; | 1869 | CPL_ETH_II : CPL_ETH_II_VLAN; |
1871 | 1870 | ||
1872 | hdr = (struct cpl_tx_pkt_lso *)skb_push(skb, sizeof(*hdr)); | 1871 | hdr = (struct cpl_tx_pkt_lso *)skb_push(skb, sizeof(*hdr)); |
1873 | hdr->opcode = CPL_TX_PKT_LSO; | 1872 | hdr->opcode = CPL_TX_PKT_LSO; |
1874 | hdr->ip_csum_dis = hdr->l4_csum_dis = 0; | 1873 | hdr->ip_csum_dis = hdr->l4_csum_dis = 0; |
1875 | hdr->ip_hdr_words = skb->nh.iph->ihl; | 1874 | hdr->ip_hdr_words = ip_hdr(skb)->ihl; |
1876 | hdr->tcp_hdr_words = skb->h.th->doff; | 1875 | hdr->tcp_hdr_words = tcp_hdr(skb)->doff; |
1877 | hdr->eth_type_mss = htons(MK_ETH_TYPE_MSS(eth_type, | 1876 | hdr->eth_type_mss = htons(MK_ETH_TYPE_MSS(eth_type, |
1878 | skb_shinfo(skb)->gso_size)); | 1877 | skb_shinfo(skb)->gso_size)); |
1879 | hdr->len = htonl(skb->len - sizeof(*hdr)); | 1878 | hdr->len = htonl(skb->len - sizeof(*hdr)); |
@@ -1913,7 +1912,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1913 | 1912 | ||
1914 | if (!(adapter->flags & UDP_CSUM_CAPABLE) && | 1913 | if (!(adapter->flags & UDP_CSUM_CAPABLE) && |
1915 | skb->ip_summed == CHECKSUM_PARTIAL && | 1914 | skb->ip_summed == CHECKSUM_PARTIAL && |
1916 | skb->nh.iph->protocol == IPPROTO_UDP) { | 1915 | ip_hdr(skb)->protocol == IPPROTO_UDP) { |
1917 | if (unlikely(skb_checksum_help(skb))) { | 1916 | if (unlikely(skb_checksum_help(skb))) { |
1918 | pr_debug("%s: unable to do udp checksum\n", dev->name); | 1917 | pr_debug("%s: unable to do udp checksum\n", dev->name); |
1919 | dev_kfree_skb_any(skb); | 1918 | dev_kfree_skb_any(skb); |
@@ -1926,7 +1925,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1926 | */ | 1925 | */ |
1927 | if ((unlikely(!adapter->sge->espibug_skb[dev->if_port]))) { | 1926 | if ((unlikely(!adapter->sge->espibug_skb[dev->if_port]))) { |
1928 | if (skb->protocol == htons(ETH_P_ARP) && | 1927 | if (skb->protocol == htons(ETH_P_ARP) && |
1929 | skb->nh.arph->ar_op == htons(ARPOP_REQUEST)) { | 1928 | arp_hdr(skb)->ar_op == htons(ARPOP_REQUEST)) { |
1930 | adapter->sge->espibug_skb[dev->if_port] = skb; | 1929 | adapter->sge->espibug_skb[dev->if_port] = skb; |
1931 | /* We want to re-use this skb later. We | 1930 | /* We want to re-use this skb later. We |
1932 | * simply bump the reference count and it | 1931 | * simply bump the reference count and it |
@@ -2096,10 +2095,14 @@ static void espibug_workaround_t204(unsigned long data) | |||
2096 | 0x0, 0x7, 0x43, 0x0, 0x0, 0x0 | 2095 | 0x0, 0x7, 0x43, 0x0, 0x0, 0x0 |
2097 | }; | 2096 | }; |
2098 | 2097 | ||
2099 | memcpy(skb->data + sizeof(struct cpl_tx_pkt), | 2098 | skb_copy_to_linear_data_offset(skb, |
2100 | ch_mac_addr, ETH_ALEN); | 2099 | sizeof(struct cpl_tx_pkt), |
2101 | memcpy(skb->data + skb->len - 10, | 2100 | ch_mac_addr, |
2102 | ch_mac_addr, ETH_ALEN); | 2101 | ETH_ALEN); |
2102 | skb_copy_to_linear_data_offset(skb, | ||
2103 | skb->len - 10, | ||
2104 | ch_mac_addr, | ||
2105 | ETH_ALEN); | ||
2103 | skb->cb[0] = 0xff; | 2106 | skb->cb[0] = 0xff; |
2104 | } | 2107 | } |
2105 | 2108 | ||
@@ -2126,10 +2129,14 @@ static void espibug_workaround(unsigned long data) | |||
2126 | if (!skb->cb[0]) { | 2129 | if (!skb->cb[0]) { |
2127 | u8 ch_mac_addr[ETH_ALEN] = | 2130 | u8 ch_mac_addr[ETH_ALEN] = |
2128 | {0x0, 0x7, 0x43, 0x0, 0x0, 0x0}; | 2131 | {0x0, 0x7, 0x43, 0x0, 0x0, 0x0}; |
2129 | memcpy(skb->data + sizeof(struct cpl_tx_pkt), | 2132 | skb_copy_to_linear_data_offset(skb, |
2130 | ch_mac_addr, ETH_ALEN); | 2133 | sizeof(struct cpl_tx_pkt), |
2131 | memcpy(skb->data + skb->len - 10, ch_mac_addr, | 2134 | ch_mac_addr, |
2132 | ETH_ALEN); | 2135 | ETH_ALEN); |
2136 | skb_copy_to_linear_data_offset(skb, | ||
2137 | skb->len - 10, | ||
2138 | ch_mac_addr, | ||
2139 | ETH_ALEN); | ||
2133 | skb->cb[0] = 0xff; | 2140 | skb->cb[0] = 0xff; |
2134 | } | 2141 | } |
2135 | 2142 | ||