netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* skge - no traffic and oops after ifdown - 3.3-rc1 main tree
@ 2012-01-27 11:05 Alban Browaeys
       [not found] ` <20120127091831.49ba7e68@nehalam.linuxnetplumber.net>
  0 siblings, 1 reply; 4+ messages in thread
From: Alban Browaeys @ 2012-01-27 11:05 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

I opened https://bugzilla.kernel.org/show_bug.cgi?id=42665 namely oops
attachement and :

skge crash after attempt to setup as dhcp then ifdown

commit d0249e44432aa0ffcf710b64449b8eaa3722547e
Author: stephen hemminger <shemminger@vyatta.com>
Date:   Thu Jan 19 14:37:18 2012 +0000

    skge: check for PCI dma mapping errors

    Driver should check for mapping errors.
    Machines with limited DMA maps may return an error when a PCI map is
    requested (not an issue on standard x86).

    Also use upper/lower 32 bits macros for clarity.

    Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>


leads to failure to ifup <skge interface> if this one is setup as dhcp (static
"works" but no traffic) then an ifdown leads to the attached oops.

Reverting this commit fixes both issues (traffic and ifdown) at least until
mainline tree commit 87f71ae2dd7471c1b4c94100be1f218e91dc64c3 .


  *-network:2
       description: Ethernet interface
       produit: 88E8001 Gigabit Ethernet Controller
       fabriquant: Marvell Technology Group Ltd.
       identifiant matériel: d
       information bus: pci@0000:01:0d.0
       nom logique: eth0
       version: 13
       numéro de série: 00:18:f3:02:33:79
       taille: 100Mbit/s
       capacité: 1Gbit/s
       bits: 32 bits
       horloge: 66MHz
       fonctionnalités: bus_master cap_list rom ethernet physical tp 10bt
10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=skge
driverversion=1.14 duplex=full latency=64 maxlatency=31 mingnt=23 multicast=yes
port=twisted pair promiscuous=yes speed=100Mbit/s
       ressources: irq:23 mémoire:fbff8000-fbffbfff portE/S:d400(taille=256)
mémoire:fbfa0000-fbfbffff



01:0d.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit
Ethernet Controller (rev 13)
    Subsystem: ASUSTeK Computer Inc. Marvell 88E8001 Gigabit Ethernet
Controller (Asus)
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr-
Stepping- SERR+ FastB2B- DisINTx-
    Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
    Latency: 64 (5750ns min, 7750ns max), Cache Line Size: 16 bytes
    Interrupt: pin A routed to IRQ 23
    Region 0: Memory at fbff8000 (32-bit, non-prefetchable) [size=16K]
    Region 1: I/O ports at d400 [size=256]
    Expansion ROM at fbfa0000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel driver in use: skge

01:0d.0 0200: 11ab:4320 (rev 13)
    Subsystem: 1043:811a

arch i686.



Best regards,
Alban

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: skge - no traffic and oops after ifdown - 3.3-rc1 main tree (resend)
       [not found] ` <20120127091831.49ba7e68@nehalam.linuxnetplumber.net>
@ 2012-02-03  0:56   ` Alban Browaeys
  2012-02-07  1:04     ` PATCH] Revert "skge: check for PCI dma mapping errors" Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Alban Browaeys @ 2012-02-03  0:56 UTC (permalink / raw)
  To: Stephen Hemminger

[-- Attachment #1: Type: text/plain, Size: 3290 bytes --]

Le vendredi 27 janvier 2012 à 09:18 -0800, Stephen Hemminger a écrit :
> On Fri, 27 Jan 2012 12:05:57 +0100
> Alban Browaeys <prahal@yahoo.com> wrote:
> 
> > I opened https://bugzilla.kernel.org/show_bug.cgi?id=42665 namely oops
> > attachement and :
> > 
> > skge crash after attempt to setup as dhcp then ifdown
> > 
> > commit d0249e44432aa0ffcf710b64449b8eaa3722547e
> > Author: stephen hemminger <shemminger@vyatta.com>
> > Date:   Thu Jan 19 14:37:18 2012 +0000
> > 
> >     skge: check for PCI dma mapping errors
> > 
> >     Driver should check for mapping errors.
> >     Machines with limited DMA maps may return an error when a PCI map is
> >     requested (not an issue on standard x86).
> > 
> >     Also use upper/lower 32 bits macros for clarity.
> > 
> >     Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >     Signed-off-by: David S. Miller <davem@davemloft.net>
> > 
> > 
> > leads to failure to ifup <skge interface> if this one is setup as dhcp (static
> > "works" but no traffic) then an ifdown leads to the attached oops.
> > 
> > Reverting this commit fixes both issues (traffic and ifdown) at least until
> > mainline tree commit 87f71ae2dd7471c1b4c94100be1f218e91dc64c3 .
> > 
> > 
> >   *-network:2
> >        description: Ethernet interface
> >        produit: 88E8001 Gigabit Ethernet Controller
> >        fabriquant: Marvell Technology Group Ltd.
> >        identifiant matériel: d
> >        information bus: pci@0000:01:0d.0
> >        nom logique: eth0
> >        version: 13
> >        numéro de série: 00:18:f3:02:33:79
> >        taille: 100Mbit/s
> >        capacité: 1Gbit/s
> >        bits: 32 bits
> >        horloge: 66MHz
> >        fonctionnalités: bus_master cap_list rom ethernet physical tp 10bt
> > 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
> >        configuration: autonegotiation=on broadcast=yes driver=skge
> > driverversion=1.14 duplex=full latency=64 maxlatency=31 mingnt=23 multicast=yes
> > port=twisted pair promiscuous=yes speed=100Mbit/s
> >        ressources: irq:23 mémoire:fbff8000-fbffbfff portE/S:d400(taille=256)
> > mémoire:fbfa0000-fbfbffff
> > 
> > 
> > 
> > 01:0d.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit
> > Ethernet Controller (rev 13)
> >     Subsystem: ASUSTeK Computer Inc. Marvell 88E8001 Gigabit Ethernet
> > Controller (Asus)
> >     Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr-
> > Stepping- SERR+ FastB2B- DisINTx-
> >     Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
> > <MAbort- >SERR- <PERR- INTx-
> >     Latency: 64 (5750ns min, 7750ns max), Cache Line Size: 16 bytes
> >     Interrupt: pin A routed to IRQ 23
> >     Region 0: Memory at fbff8000 (32-bit, non-prefetchable) [size=16K]
> >     Region 1: I/O ports at d400 [size=256]
> >     Expansion ROM at fbfa0000 [disabled] [size=128K]
> >     Capabilities: <access denied>
> >     Kernel driver in use: skge
> > 
> > 01:0d.0 0200: 11ab:4320 (rev 13)
> >     Subsystem: 1043:811a
> > 
> > arch i686.
> > 
> > 
> > 
> > Best regards,
> > Alban
> > 
> 
> Could you send me the backtrace from the OOPS?
> 
it was in the bug report :) Here it is . Looking at objdump -S output
this happens in skge_rx_clean call to dev_kfree_skb.

BR,
Alban

[-- Attachment #2: skge_oops_cleanup.log --]
[-- Type: text/x-log, Size: 8309 bytes --]

Jan 26 21:51:08 argos kernel: [   48.008701] skge 0000:01:0d.0: eth0: enabling interface
Jan 26 21:51:08 argos kernel: [   48.016621] ADDRCONF(NETDEV_UP): eth0: link is not ready
Jan 26 21:51:08 argos kernel: [   49.699046] skge 0000:01:0d.0: eth0: Link is up at 100 Mbps, full duplex, flow control none
Jan 26 21:51:08 argos kernel: [   49.699260] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Jan 26 21:51:08 argos kernel: [  111.867228] r8169 0000:02:00.0: eth2: link down
Jan 26 21:51:08 argos kernel: [  111.867645] ADDRCONF(NETDEV_UP): eth2: link is not ready
Jan 26 21:51:08 argos kernel: [  116.304445] fuse init (API version 7.18)
Jan 26 21:51:08 argos kernel: [  116.331325] microcode: CPU0 sig=0xf49, pf=0x10, revision=0x3
Jan 26 21:51:08 argos kernel: [  116.450048] microcode: CPU1 sig=0xf49, pf=0x10, revision=0x3
Jan 26 21:51:08 argos kernel: [  116.525728] microcode: Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
Jan 26 21:51:08 argos kernel: [  117.307287] ip6_tables: (C) 2000-2006 Netfilter Core Team
Jan 26 21:51:08 argos kernel: [  120.331326] Netfilter messages via NETLINK v0.30.
Jan 26 21:51:08 argos kernel: [  120.424883] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
Jan 26 21:51:08 argos kernel: [  121.305848] NF_TPROXY: Transparent proxy support initialized, version 4.1.0
Jan 26 21:51:08 argos kernel: [  121.305858] NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd.
Jan 26 21:51:08 argos kernel: [  121.415848] xt_time: kernel timezone is -0000
Jan 26 21:51:08 argos kernel: [  121.625482] ctnetlink v0.93: registering with nfnetlink.
Jan 26 21:51:08 argos kernel: [  121.910017] ip_set: protocol 6
Jan 26 21:51:08 argos kernel: [  122.540480] ipt_CLUSTERIP: ClusterIP Version 0.8 loaded successfully
Jan 26 21:51:08 argos kernel: [  126.868419] u32 classifier
Jan 26 21:51:08 argos kernel: [  126.868426]     Performance counters on
Jan 26 21:51:08 argos kernel: [  126.868432]     input device check on
Jan 26 21:51:08 argos kernel: [  126.868436]     Actions configured
Jan 26 21:51:30 argos kernel: [  213.759071] NOHZ: local_softirq_pending 08
Jan 26 21:54:24 argos kernel: [  386.872163] skge 0000:01:0d.0: eth0: disabling interface
Jan 26 21:54:24 argos kernel: [  386.874682] BUG: unable to handle kernel NULL pointer dereference at 00000114
Jan 26 21:54:24 argos kernel: [  386.876036] IP: [<c10ad7d6>] put_page+0x6/0x28
Jan 26 21:54:24 argos kernel: [  386.876036] *pdpt = 000000002215e001 *pde = 0000000000000000 
Jan 26 21:54:24 argos kernel: [  386.876036] Oops: 0000 [#1] SMP 
Jan 26 21:54:24 argos kernel: [  386.888522] Modules linked in: snd_hrtimer mperf cpufreq_userspace cpufreq_powersave cpufreq_conservative parport_pc parport act_police cls_basic cls_flow cls_fw cls_u32 sch_tbf sch_prio sch_hfsc sch_htb sch_ingress sch_sfq xt_realm xt_addrtype xt_connlimit iptable_raw xt_comment ipt_ULOG xt_recent ipt_REJECT ipt_REDIRECT ipt_NETMAP ipt_MASQUERADE ipt_ECN ipt_CLUSTERIP ipt_ah nf_nat_tftp nf_nat_snmp_basic nf_conntrack_snmp nf_nat_sip nf_nat_pptp nf_nat_proto_gre ip6_queue nf_nat_irc nf_nat_h323 nf_nat_ftp xt_set nf_nat_amanda ip_set nf_conntrack_tftp nf_conntrack_sip nf_conntrack_sane nf_conntrack_proto_udplite nf_conntrack_proto_sctp nf_conntrack_pptp nf_conntrack_proto_gre nf_conntrack_netlink nf_conntrack_netbios_ns nf_conntrack_broadcast ts_kmp nf_conntrack_amanda nf_conntrack_irc nf_conntrack_h323 xt_time nf_conntrack_ftp xt_TCPMSS xt_sctp xt_TPROXY nf_tproxy_core xt_tcpmss xt_policy xt_pkttype xt_physdev xt_owner xt_NFQUEUE xt_NFLOG nfnetlink_log xt_multiport xt_mark xt_mac xt_limit xt_length xt_iprange xt_helper xt_hashlimit xt_DSCP xt_dscp xt_dccp xt_connmark xt_CLASSIFY xt_AUDIT ip6t_LOG ipt_LOG ip6t_REJECT xt_tcpudp xt_state iptable_nat nf_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack ip6table_raw nf_conntrack ip6table_mangle iptable_mangle nfnetlink ip6table_filter ip6_tables microcode fuse iptable_filter ip_tables x_tables openvswitch_mod(O) deflate ctr twofish_generic twofish_i586 twofish_common camellia serpent_generic cast5 des_generic cbc aes_i586 aes_generic xcbc rmd160 sha512_generic sha256_generic sha1_generic hmac crypto_null af_key thermal ac eeprom w83781d i2c_dev w83627ehf hwmon_vid 8021q garp stp dm_crypt snd_intel8x0 snd_ac97_codec arc4 ac97_bus snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_midi snd_rawmidi r8169 ath5k snd_seq_midi_event ath mac80211 joydev snd_seq pcmcia snd_timer snd_seq_device yenta_socket pcmcia_rsrc snd cfg80211 pcmcia_core psmouse rfkill pcspkr soundcore snd_page_alloc shpchp serio_raw pci_hotplug iTCO_wdt iTCO_vendor_support processor evdev ext3 jbd mbcache btrfs zlib_deflate crc32c libcrc32c dm_mod hid_logitech ff_memless usbhid hid power_supply sd_mod crc_t10dif sr_mod cdrom ata_generic i915 drm_kms_helper drm ata_piix uhci_hcd libata ehci_hcd via_rhine skge mii scsi_mod usbcore i2c_algo_bit button i2c_core video usb_common thermal_sys [last unloaded: scsi_wait_scan]
Jan 26 21:54:24 argos kernel: [  386.888522] 
Jan 26 21:54:24 argos kernel: [  386.888522] Pid: 6246, comm: ifconfig Tainted: G           O 3.3.0-rc1+ #56 System manufacturer System Product Name/P5PE-VM
Jan 26 21:54:24 argos kernel: [  386.888522] EIP: 0060:[<c10ad7d6>] EFLAGS: 00010203 CPU: 1
Jan 26 21:54:24 argos kernel: [  386.888522] EIP is at put_page+0x6/0x28
Jan 26 21:54:24 argos kernel: [  386.888522] EAX: 00000114 EBX: 00000114 ECX: 00000088 EDX: 00000002
Jan 26 21:54:24 argos kernel: [  386.888522] ESI: 00000001 EDI: f56eab80 EBP: e217dddc ESP: e217ddd8
Jan 26 21:54:24 argos kernel: [  386.888522]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
Jan 26 21:54:24 argos kernel: [  386.888522] Process ifconfig (pid: 6246, ti=e217c000 task=ef473010 task.ti=e217c000)
Jan 26 21:54:24 argos kernel: [  386.888522] Stack:
Jan 26 21:54:24 argos kernel: [  386.888522]  f4604780 e217ddec c122feda f4604780 f50eddc0 e217ddf8 c122ff42 f4604780
Jan 26 21:54:24 argos kernel: [  386.888522]  e217de08 c122ffed f4c9e060 f50eddc0 e217de1c f9ade5f2 f56eab80 f50ed800
Jan 26 21:54:24 argos kernel: [  386.888522]  f50eddc0 e217de44 f9adf5d9 f5ea21c0 00000000 00000000 000006b4 00000434
Jan 26 21:54:24 argos kernel: [  386.888522] Call Trace:
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c122feda>] skb_release_data+0x49/0x9f
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c122ff42>] __kfree_skb+0x12/0x6f
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c122ffed>] consume_skb+0x4e/0x52
Jan 26 21:54:24 argos kernel: [  386.888522]  [<f9ade5f2>] skge_rx_clean+0x34/0x4a [skge]
Jan 26 21:54:24 argos kernel: [  386.888522]  [<f9adf5d9>] skge_down+0x430/0x47c [skge]
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c12360f0>] __dev_close_many+0x6f/0x91
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c1236133>] __dev_close+0x21/0x32
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c1239adc>] __dev_change_flags+0x97/0x10e
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c1239bb7>] dev_change_flags+0x13/0x3f
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c127d62a>] devinet_ioctl+0x23a/0x4df
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c127dd5c>] inet_ioctl+0x82/0x9b
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c1228a7e>] sock_ioctl+0x1ce/0x1f0
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c12288b0>] ? sock_fasync+0x6a/0x6a
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c10e8abc>] do_vfs_ioctl+0x44b/0x47f
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c10488c7>] ? up_read+0x16/0x29
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c12e63d7>] ? do_page_fault+0x2bd/0x2ea
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c10e8b31>] sys_ioctl+0x41/0x64
Jan 26 21:54:24 argos kernel: [  386.888522]  [<c12e7edf>] sysenter_do_call+0x12/0x38
Jan 26 21:54:24 argos kernel: [  386.888522] Code: c3 55 ba 29 d8 0a c1 89 e5 51 8d 4d fc c7 45 fc 00 00 00 00 e8 3d ff ff ff 8b 45 fc 64 01 05 dc 5e 65 c1 c9 c3 55 89 e5 53 89 c3 <f7> 03 00 c0 00 00 74 07 e8 2d fd ff ff eb 10 e8 a8 f8 ff ff 85 
Jan 26 21:54:24 argos kernel: [  386.888522] EIP: [<c10ad7d6>] put_page+0x6/0x28 SS:ESP 0068:e217ddd8
Jan 26 21:54:24 argos kernel: [  386.888522] CR2: 0000000000000114
Jan 26 21:54:24 argos kernel: [  387.049739] ---[ end trace 6905458423055527 ]---


^ permalink raw reply	[flat|nested] 4+ messages in thread

* PATCH] Revert "skge: check for PCI dma mapping errors"
  2012-02-03  0:56   ` skge - no traffic and oops after ifdown - 3.3-rc1 main tree (resend) Alban Browaeys
@ 2012-02-07  1:04     ` Stephen Hemminger
  2012-02-07 17:51       ` [PATCH] " David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2012-02-07  1:04 UTC (permalink / raw)
  To: David Miller; +Cc: Alban Browaeys, netdev, Guillaume Chazarain, Nick Bowler

As reported by several people...

The code in rx_clean was panic'ing so revert 
commit d0249e44432aa0ffcf710b64449b8eaa3722547e.
Will redo DMA mapping checks as new patches for a later release.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/net/ethernet/marvell/skge.c |   71 ++++++----------------------------
 1 files changed, 13 insertions(+), 58 deletions(-)

diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index edb9bda..33947ac 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -931,20 +931,17 @@ static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u32 base)
 }
 
 /* Allocate and setup a new buffer for receiving */
-static int skge_rx_setup(struct pci_dev *pdev,
-			 struct skge_element *e,
-			 struct sk_buff *skb, unsigned int bufsize)
+static void skge_rx_setup(struct skge_port *skge, struct skge_element *e,
+			  struct sk_buff *skb, unsigned int bufsize)
 {
 	struct skge_rx_desc *rd = e->desc;
-	dma_addr_t map;
+	u64 map;
 
-	map = pci_map_single(pdev, skb->data, bufsize,
+	map = pci_map_single(skge->hw->pdev, skb->data, bufsize,
 			     PCI_DMA_FROMDEVICE);
-	if (pci_dma_mapping_error(pdev, map))
-		goto mapping_error;
 
-	rd->dma_lo = lower_32_bits(map);
-	rd->dma_hi = upper_32_bits(map);
+	rd->dma_lo = map;
+	rd->dma_hi = map >> 32;
 	e->skb = skb;
 	rd->csum1_start = ETH_HLEN;
 	rd->csum2_start = ETH_HLEN;
@@ -956,13 +953,6 @@ static int skge_rx_setup(struct pci_dev *pdev,
 	rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize;
 	dma_unmap_addr_set(e, mapaddr, map);
 	dma_unmap_len_set(e, maplen, bufsize);
-	return 0;
-
-mapping_error:
-	if (net_ratelimit())
-		dev_warn(&pdev->dev, "%s: rx mapping error\n",
-			 skb->dev->name);
-	return -EIO;
 }
 
 /* Resume receiving using existing skb,
@@ -1024,11 +1014,7 @@ static int skge_rx_fill(struct net_device *dev)
 			return -ENOMEM;
 
 		skb_reserve(skb, NET_IP_ALIGN);
-		if (skge_rx_setup(skge->hw->pdev, e, skb, skge->rx_buf_size)) {
-			kfree_skb(skb);
-			return -ENOMEM;
-		}
-
+		skge_rx_setup(skge, e, skb, skge->rx_buf_size);
 	} while ((e = e->next) != ring->start);
 
 	ring->to_clean = ring->start;
@@ -2743,7 +2729,7 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
 	struct skge_tx_desc *td;
 	int i;
 	u32 control, len;
-	dma_addr_t map;
+	u64 map;
 
 	if (skb_padto(skb, ETH_ZLEN))
 		return NETDEV_TX_OK;
@@ -2757,14 +2743,11 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
 	e->skb = skb;
 	len = skb_headlen(skb);
 	map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE);
-	if (pci_dma_mapping_error(hw->pdev, map))
-		goto mapping_error;
-
 	dma_unmap_addr_set(e, mapaddr, map);
 	dma_unmap_len_set(e, maplen, len);
 
-	td->dma_lo = lower_32_bits(map);
-	td->dma_hi = upper_32_bits(map);
+	td->dma_lo = map;
+	td->dma_hi = map >> 32;
 
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
 		const int offset = skb_checksum_start_offset(skb);
@@ -2795,16 +2778,14 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
 
 			map = skb_frag_dma_map(&hw->pdev->dev, frag, 0,
 					       skb_frag_size(frag), DMA_TO_DEVICE);
-			if (dma_mapping_error(&hw->pdev->dev, map))
-				goto mapping_unwind;
 
 			e = e->next;
 			e->skb = skb;
 			tf = e->desc;
 			BUG_ON(tf->control & BMU_OWN);
 
-			tf->dma_lo = lower_32_bits(map);
-			tf->dma_hi = upper_32_bits(map);
+			tf->dma_lo = map;
+			tf->dma_hi = (u64) map >> 32;
 			dma_unmap_addr_set(e, mapaddr, map);
 			dma_unmap_len_set(e, maplen, skb_frag_size(frag));
 
@@ -2834,28 +2815,6 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
 	}
 
 	return NETDEV_TX_OK;
-
-mapping_unwind:
-	/* unroll any pages that were already mapped.  */
-	if (e != skge->tx_ring.to_use) {
-		struct skge_element *u;
-
-		for (u = skge->tx_ring.to_use->next; u != e; u = u->next)
-			pci_unmap_page(hw->pdev, dma_unmap_addr(u, mapaddr),
-				       dma_unmap_len(u, maplen),
-				       PCI_DMA_TODEVICE);
-		e = skge->tx_ring.to_use;
-	}
-	/* undo the mapping for the skb header */
-	pci_unmap_single(hw->pdev, dma_unmap_addr(e, mapaddr),
-			 dma_unmap_len(e, maplen),
-			 PCI_DMA_TODEVICE);
-mapping_error:
-	/* mapping error causes error message and packet to be discarded. */
-	if (net_ratelimit())
-		dev_warn(&hw->pdev->dev, "%s: tx mapping error\n", dev->name);
-	dev_kfree_skb(skb);
-	return NETDEV_TX_OK;
 }
 
 
@@ -3099,17 +3058,13 @@ static struct sk_buff *skge_rx_get(struct net_device *dev,
 		if (!nskb)
 			goto resubmit;
 
-		if (unlikely(skge_rx_setup(skge->hw->pdev, e, nskb, skge->rx_buf_size))) {
-			dev_kfree_skb(nskb);
-			goto resubmit;
-		}
-
 		pci_unmap_single(skge->hw->pdev,
 				 dma_unmap_addr(e, mapaddr),
 				 dma_unmap_len(e, maplen),
 				 PCI_DMA_FROMDEVICE);
 		skb = e->skb;
 		prefetch(skb->data);
+		skge_rx_setup(skge, e, nskb, skge->rx_buf_size);
 	}
 
 	skb_put(skb, len);
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "skge: check for PCI dma mapping errors"
  2012-02-07  1:04     ` PATCH] Revert "skge: check for PCI dma mapping errors" Stephen Hemminger
@ 2012-02-07 17:51       ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-02-07 17:51 UTC (permalink / raw)
  To: shemminger; +Cc: prahal, netdev, guichaz, nbowler

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 6 Feb 2012 17:04:23 -0800

> As reported by several people...
> 
> The code in rx_clean was panic'ing so revert 
> commit d0249e44432aa0ffcf710b64449b8eaa3722547e.
> Will redo DMA mapping checks as new patches for a later release.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-07 17:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-27 11:05 skge - no traffic and oops after ifdown - 3.3-rc1 main tree Alban Browaeys
     [not found] ` <20120127091831.49ba7e68@nehalam.linuxnetplumber.net>
2012-02-03  0:56   ` skge - no traffic and oops after ifdown - 3.3-rc1 main tree (resend) Alban Browaeys
2012-02-07  1:04     ` PATCH] Revert "skge: check for PCI dma mapping errors" Stephen Hemminger
2012-02-07 17:51       ` [PATCH] " David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).