aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/3com
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-09-22 21:23:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-09-22 21:23:33 -0400
commit98f75b8291a89ba6bf73e322ee467ce0bfeb91c1 (patch)
treec9f61617d49973d2d8fc684183be0ce1820a0338 /drivers/net/ethernet/3com
parent9478303619bc87c575e894d867049b25f33bf124 (diff)
parente18b7faae15dbd47e5811ed748bd5b500dcfaa2d (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) If the user gives us a msg_namelen of 0, don't try to interpret anything pointed to by msg_name. From Ani Sinha. 2) Fix some bnx2i/bnx2fc randconfig compilation errors. The gist of the issue is that we firstly have drivers that span both SCSI and networking. And at the top of that chain of dependencies we have things like SCSI_FC_ATTRS and SCSI_NETLINK which are selected. But since select is a sledgehammer and ignores dependencies, everything to select's SCSI_FC_ATTRS and/or SCSI_NETLINK has to also explicitly select their dependencies and so on and so forth. Generally speaking 'select' is supposed to only be used for child nodes, those which have no dependencies of their own. And this whole chain of dependencies in the scsi layer violates that rather strongly. So just make SCSI_NETLINK depend upon it's dependencies, and so on and so forth for the things selecting it (either directly or indirectly). From Anish Bhatt and Randy Dunlap. 3) Fix generation of blackhole routes in IPSEC, from Steffen Klassert. 4) Actually notice netdev feature changes in rtl_open() code, from Hayes Wang. 5) Fix divide by zero in bond enslaving, from Nikolay Aleksandrov. 6) Missing memory barrier in sunvnet driver, from David Stevens. 7) Don't leave anycast addresses around when ipv6 interface is destroyed, from Sabrina Dubroca. 8) Don't call efx_{arch}_filter_sync_rx_mode before addr_list_lock is initialized in SFC driver, from Edward Cree. 9) Fix missing DMA error checking in 3c59x, from Neal Horman. 10) Openvswitch doesn't emit OVS_FLOW_CMD_NEW notifications accidently, fix from Samuel Gauthier. 11) pch_gbe needs to select NET_PTP_CLASSIFY otherwise we can get a build error. 12) Fix macvlan regression wherein we stopped emitting broadcast/multicast frames over software devices. From Nicolas Dichtel. 13) Fix infiniband bug due to unintended overflow of skb->cb[], from Eric Dumazet. And add an assertion so this doesn't happen again. 14) dm9000_parse_dt() should return error pointers, not NULL. From Tobias Klauser. 15) IP tunneling code uses this_cpu_ptr() in preemptible contexts, fix from Eric Dumazet. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (87 commits) net: bcmgenet: call bcmgenet_dma_teardown in bcmgenet_fini_dma net: bcmgenet: fix TX reclaim accounting for fragments ipv4: do not use this_cpu_ptr() in preemptible context dm9000: Return an ERR_PTR() in all error conditions of dm9000_parse_dt() r8169: fix an if condition r8152: disable ALDPS ipoib: validate struct ipoib_cb size net: sched: shrink struct qdisc_skb_cb to 28 bytes tg3: Work around HW/FW limitations with vlan encapsulated frames macvlan: allow to enqueue broadcast pkt on virtual device pch_gbe: 'select' NET_PTP_CLASSIFY. scsi: Use 'depends' with LIBFC instead of 'select'. openvswitch: restore OVS_FLOW_CMD_NEW notifications genetlink: add function genl_has_listeners() lib: rhashtable: remove second linux/log2.h inclusion net: allow macvlans to move to net namespace 3c59x: Fix bad offset spec in skb_frag_dma_map 3c59x: Add dma error checking and recovery sparc: bpf_jit: fix support for ldx/stx mem and SKF_AD_VLAN_TAG can: at91_can: add missing prepare and unprepare of the clock ...
Diffstat (limited to 'drivers/net/ethernet/3com')
-rw-r--r--drivers/net/ethernet/3com/3c59x.c50
1 files changed, 41 insertions, 9 deletions
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index 3fe45c705933..8ca49f04acec 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -2129,6 +2129,7 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
2129 int entry = vp->cur_tx % TX_RING_SIZE; 2129 int entry = vp->cur_tx % TX_RING_SIZE;
2130 struct boom_tx_desc *prev_entry = &vp->tx_ring[(vp->cur_tx-1) % TX_RING_SIZE]; 2130 struct boom_tx_desc *prev_entry = &vp->tx_ring[(vp->cur_tx-1) % TX_RING_SIZE];
2131 unsigned long flags; 2131 unsigned long flags;
2132 dma_addr_t dma_addr;
2132 2133
2133 if (vortex_debug > 6) { 2134 if (vortex_debug > 6) {
2134 pr_debug("boomerang_start_xmit()\n"); 2135 pr_debug("boomerang_start_xmit()\n");
@@ -2163,24 +2164,48 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
2163 vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded | AddTCPChksum | AddUDPChksum); 2164 vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded | AddTCPChksum | AddUDPChksum);
2164 2165
2165 if (!skb_shinfo(skb)->nr_frags) { 2166 if (!skb_shinfo(skb)->nr_frags) {
2166 vp->tx_ring[entry].frag[0].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, 2167 dma_addr = pci_map_single(VORTEX_PCI(vp), skb->data, skb->len,
2167 skb->len, PCI_DMA_TODEVICE)); 2168 PCI_DMA_TODEVICE);
2169 if (dma_mapping_error(&VORTEX_PCI(vp)->dev, dma_addr))
2170 goto out_dma_err;
2171
2172 vp->tx_ring[entry].frag[0].addr = cpu_to_le32(dma_addr);
2168 vp->tx_ring[entry].frag[0].length = cpu_to_le32(skb->len | LAST_FRAG); 2173 vp->tx_ring[entry].frag[0].length = cpu_to_le32(skb->len | LAST_FRAG);
2169 } else { 2174 } else {
2170 int i; 2175 int i;
2171 2176
2172 vp->tx_ring[entry].frag[0].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, 2177 dma_addr = pci_map_single(VORTEX_PCI(vp), skb->data,
2173 skb_headlen(skb), PCI_DMA_TODEVICE)); 2178 skb_headlen(skb), PCI_DMA_TODEVICE);
2179 if (dma_mapping_error(&VORTEX_PCI(vp)->dev, dma_addr))
2180 goto out_dma_err;
2181
2182 vp->tx_ring[entry].frag[0].addr = cpu_to_le32(dma_addr);
2174 vp->tx_ring[entry].frag[0].length = cpu_to_le32(skb_headlen(skb)); 2183 vp->tx_ring[entry].frag[0].length = cpu_to_le32(skb_headlen(skb));
2175 2184
2176 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 2185 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
2177 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 2186 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
2178 2187
2188 dma_addr = skb_frag_dma_map(&VORTEX_PCI(vp)->dev, frag,
2189 0,
2190 frag->size,
2191 DMA_TO_DEVICE);
2192 if (dma_mapping_error(&VORTEX_PCI(vp)->dev, dma_addr)) {
2193 for(i = i-1; i >= 0; i--)
2194 dma_unmap_page(&VORTEX_PCI(vp)->dev,
2195 le32_to_cpu(vp->tx_ring[entry].frag[i+1].addr),
2196 le32_to_cpu(vp->tx_ring[entry].frag[i+1].length),
2197 DMA_TO_DEVICE);
2198
2199 pci_unmap_single(VORTEX_PCI(vp),
2200 le32_to_cpu(vp->tx_ring[entry].frag[0].addr),
2201 le32_to_cpu(vp->tx_ring[entry].frag[0].length),
2202 PCI_DMA_TODEVICE);
2203
2204 goto out_dma_err;
2205 }
2206
2179 vp->tx_ring[entry].frag[i+1].addr = 2207 vp->tx_ring[entry].frag[i+1].addr =
2180 cpu_to_le32(skb_frag_dma_map( 2208 cpu_to_le32(dma_addr);
2181 &VORTEX_PCI(vp)->dev,
2182 frag,
2183 frag->page_offset, frag->size, DMA_TO_DEVICE));
2184 2209
2185 if (i == skb_shinfo(skb)->nr_frags-1) 2210 if (i == skb_shinfo(skb)->nr_frags-1)
2186 vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(skb_frag_size(frag)|LAST_FRAG); 2211 vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(skb_frag_size(frag)|LAST_FRAG);
@@ -2189,7 +2214,10 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
2189 } 2214 }
2190 } 2215 }
2191#else 2216#else
2192 vp->tx_ring[entry].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, skb->len, PCI_DMA_TODEVICE)); 2217 dma_addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, skb->len, PCI_DMA_TODEVICE));
2218 if (dma_mapping_error(&VORTEX_PCI(vp)->dev, dma_addr))
2219 goto out_dma_err;
2220 vp->tx_ring[entry].addr = cpu_to_le32(dma_addr);
2193 vp->tx_ring[entry].length = cpu_to_le32(skb->len | LAST_FRAG); 2221 vp->tx_ring[entry].length = cpu_to_le32(skb->len | LAST_FRAG);
2194 vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded); 2222 vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded);
2195#endif 2223#endif
@@ -2217,7 +2245,11 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
2217 skb_tx_timestamp(skb); 2245 skb_tx_timestamp(skb);
2218 iowrite16(DownUnstall, ioaddr + EL3_CMD); 2246 iowrite16(DownUnstall, ioaddr + EL3_CMD);
2219 spin_unlock_irqrestore(&vp->lock, flags); 2247 spin_unlock_irqrestore(&vp->lock, flags);
2248out:
2220 return NETDEV_TX_OK; 2249 return NETDEV_TX_OK;
2250out_dma_err:
2251 dev_err(&VORTEX_PCI(vp)->dev, "Error mapping dma buffer\n");
2252 goto out;
2221} 2253}
2222 2254
2223/* The interrupt handler does all of the Rx thread work and cleans up 2255/* The interrupt handler does all of the Rx thread work and cleans up