* Re: WARN_ON() hit in fsl bitbanged phy driver
From: Scott Wood @ 2008-02-11 21:50 UTC (permalink / raw)
To: Rune Torgersen; +Cc: linuxppc-dev, netdev
In-Reply-To: <DCEAAC0833DD314AB0B58112AD99B93B03F931E6@ismail.innsys.innovsys.com>
Rune Torgersen wrote:
> I hit the following WARN_ON when using mii-tools agains a ethernet
> interface using a bit-banged mii interface
> It is only diplayed once, and does not seem to impact usage at all
>
> Does somebody know what is wrong, and how to fix it?
It looks like the kernel thinks it's in an interrupt, even though it
clearly isn't from the backtrace. Presumably, something slept from an
interrupt handler; try turning on sleep-in-spinlock debugging.
The root cause was probably something other than the phy code.
-Scott
^ permalink raw reply
* WARN_ON() hit in fsl bitbanged phy driver
From: Rune Torgersen @ 2008-02-11 21:28 UTC (permalink / raw)
To: linuxppc-dev, netdev
I hit the following WARN_ON when using mii-tools agains a ethernet
interface using a bit-banged mii interface
It is only diplayed once, and does not seem to impact usage at all
Does somebody know what is wrong, and how to fix it?
The PHY is an Intel LXT973
Badness at kernel/softirq.c:139
NIP: c001f8bc LR: c0121170 CTR: c01269d8
REGS: dfaa5ce0 TRAP: 0700 Tainted: P (2.6.24-cpu2)
MSR: 00021032 <ME,IR,DR> CR: 20002222 XER: 20000000
TASK = de0c2b40[825] 'mii-tool' THREAD: dfaa4000
GPR00: 00000001 dfaa5d90 de0c2b40 0000782d 00000000 00000005 00000001
0ff6a37c
GPR08: 00000000 c0250000 df86bb60 08000000 80000242 1001aa20 00000000
100aa258
GPR16: 10090000 00000000 10090000 00000000 10070000 100aa170 10010000
bff3bd94
GPR24: 00000003 00000000 00000001 c0123234 0000782d dfaa4000 00000000
df003a00
NIP [c001f8bc] local_bh_enable+0x28/0x9c
LR [c0121170] phy_read+0x5c/0x74
Call Trace:
[dfaa5d90] [dfaa4000] 0xdfaa4000 (unreliable)
[dfaa5da0] [c0121170] phy_read+0x5c/0x74
drivers/net/phy/phy.c:80
[dfaa5dc0] [c012140c] phy_mii_ioctl+0x64/0x170
drivers/net/phy/phy.c:368
[dfaa5de0] [c0125394] fs_ioctl+0x4c/0x8c
[dfaa5e00] [c0143744] dev_ifsioc+0x2e8/0x314
[dfaa5e20] [c0144eb8] dev_ioctl+0x6f4/0x8a8
[dfaa5ea0] [c0136aa8] sock_ioctl+0x1fc/0x21c
[dfaa5ec0] [c00742e0] do_ioctl+0x44/0xa8
[dfaa5ee0] [c00746e8] vfs_ioctl+0x3a4/0x3e8
[dfaa5f10] [c007476c] sys_ioctl+0x40/0x70
[dfaa5f40] [c000edc8] ret_from_syscall+0x0/0x38
--- Exception: c01 at 0xff6a37c
LR = 0xffecd58
Instruction dump:
7c0803a6 4e800020 9421fff0 7c0802a6 90010014 7c0000a6 70098000 40a2002c
3d20c025 8009d2a8 7c000034 5400d97e <0f000000> 2f800000 41be0010
38000001
(gdb) list *0xc0121170
0xc0121170 is in phy_read (drivers/net/phy/phy.c:80).
75 spin_lock_bh(&bus->mdio_lock);
76 retval = bus->read(bus, phydev->addr, regnum);
77 spin_unlock_bh(&bus->mdio_lock);
78
79 return retval;
80 }
81 EXPORT_SYMBOL(phy_read);
82
83 /**
84 * phy_write - Convenience function for writing a given PHY
register
(gdb) list *0xc012140c
0xc012140c is in phy_mii_ioctl (drivers/net/phy/phy.c:368).
363 switch (cmd) {
364 case SIOCGMIIPHY:
365 mii_data->phy_id = phydev->addr;
366 break;
367 case SIOCGMIIREG:
368 mii_data->val_out = phy_read(phydev,
mii_data->reg_num);
369 break;
370
371 case SIOCSMIIREG:
372 if (!capable(CAP_NET_ADMIN))
(gdb) list *0xc001f8bc
0xc001f8bc is in local_bh_enable (kernel/softirq.c:139).
134 #ifdef CONFIG_TRACE_IRQFLAGS
135 unsigned long flags;
136
137 WARN_ON_ONCE(in_irq());
138 #endif
139 WARN_ON_ONCE(irqs_disabled());
140
141 #ifdef CONFIG_TRACE_IRQFLAGS
142 local_irq_save(flags);
143 #endif
the relevant part of my device tree is:
ethernet@11340 {
device_type = "network";
compatible = "fsl,mpc8280-fcc-enet",
"fsl,cpm2-fcc-enet";
reg = <11340 20 8600 100 113d0 1>;
interrupts = <22 8>;
interrupt-parent = <&PIC>;
phy-handle = <&PHY1>;
linux,network-index = <1>;
fsl,cpm-command = <1a400300>;
local-mac-address = [00 00 00 00 00 00];
};
mdio@10d40 {
device_type = "mdio";
compatible = "fsl,pq2fads-mdio-bitbang",
"fsl,mpc8280-mdio-bitbang",
"fsl,cpm2-mdio-bitbang";
#address-cells = <1>;
#size-cells = <0>;
reg = <10d40 14>;
fsl,mdio-pin = <5>;
fsl,mdc-pin = <4>;
PHY1: ethernet-phy@1 {
//interrupt-parent = <&PIC>;
//interrupts = <19 2>;
reg = <1>;
device_type = "ethernet-phy";
};
};
^ permalink raw reply
* An ioctl to delete an ipv6 tunnel leads to a kernel panic
From: Natalie Protasevich @ 2008-02-11 20:49 UTC (permalink / raw)
To: David Miller, netdev; +Cc: Andrew Morton
Hello,
This bug was reported to bugzilla.kernel.org:
http://bugzilla.kernel.org/show_bug.cgi?id=8895
Hardware Environment: user mode linux and vmware
Software Environment: an evolution of mip6d (ip mobility daemon)
Problem Description: The mip6d HA was modified to make a
redondancy evolution, when an HA is interrupted, the other takes over,
this leads to some
creation/deletion of routes and tunnels.
Note: The HA ip address known by the mobile (MR) stays the same, the
slave HA takes it with an override neighbor advertisement message. So
the tunnel between
the mobile router and the HA(s) keep the same end adresses.
The problem occurs when a Ctrl C is done on the master HA, the slave
takes over but sometimes, the master gets a kernel panic.
Possible reason for this failure was identified and tested by the
submitter and several other reporters that ran into the same problem.
Can the patch be reviewed and pushed upstream if accepted (if the
problem hasn't been addressed already)?
Thanks,
--Natalie
^ permalink raw reply
* Re: [patch 2.6.24-git] net/enc28j60: oops fix, low power mode
From: David Brownell @ 2008-02-11 20:23 UTC (permalink / raw)
To: Claudio Lanconelli; +Cc: netdev
In-Reply-To: <47B03A9A.2060605@eptar.com>
On Monday 11 February 2008, Claudio Lanconelli wrote:
> I have tried your latest patch. Only after the following change it
> works fine (no more rx errors during ifconfig up).
Hmm, what chip rev do you have? Different errata and all.
ISTR mine is rev4; so, not the most current, but not the
oldest version either.
> I added enc28j60_lowpower(false) just before enc28j60_hw_init()
Hmm, I'd have expected it would go best *before* that, but
what you include below shows it going *after* ...
If there's some problem where reset doesn't work correctly
in low power mode, who knows what else would need manual
resetting.
> @@ -1318,8 +1347,9 @@
> }
> return -EADDRNOTAVAIL;
> }
> - /* Reset the hardware here */
> + /* Reset the hardware here (and take it out of low power mode) */
> enc28j60_hw_disable(priv);
> + enc28j60_lowpower(priv, false);
> if (!enc28j60_hw_init(priv)) {
> if (netif_msg_ifup(priv))
> dev_err(&dev->dev, "hw_reset() failed\n");
>
> With this addition you can add Acked-by line.
Better yet, since I can't reproduce the problem, why don't
you just update my latest patch with the relevant version
of this tweak, and then forward it as "From: " me and with
both our signoffs. That's the usual way to cope with this
type of tweaking. (Not all updates to your driver should
need your signoff, but then most patches shouldn't need
very many iterations either.)
- Dave
^ permalink raw reply
* Re: [git patches] net driver updates
From: Divy Le Ray @ 2008-02-11 20:07 UTC (permalink / raw)
To: Jeff Garzik; +Cc: David Miller, netdev, LKML
In-Reply-To: <20080211170516.GA13872@havoc.gtf.org>
Jeff Garzik wrote:
> Mostly fixes, a few cleanups (generally assisting fixes), and an
> exception for PS3 wireless because it had been posted, reviewed and
> acked for a while, just not committed.
>
> Please pull from 'upstream-davem' branch of
> master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git upstream-davem
>
> to receive the following updates:
>
>
> drivers/net/cxgb3/sge.c | 35 +-
>
>
> diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
> index 9ca8c66..979f3fc 100644
> --- a/drivers/net/cxgb3/sge.c
> +++ b/drivers/net/cxgb3/sge.c
> @@ -1059,6 +1059,14 @@ static void write_tx_pkt_wr(struct adapter *adap, struct sk_buff *skb,
> htonl(V_WR_TID(q->token)));
> }
>
> +static inline void t3_stop_queue(struct net_device *dev, struct sge_qset *qs,
> + struct sge_txq *q)
> +{
> + netif_stop_queue(dev);
> + set_bit(TXQ_ETH, &qs->txq_stopped);
> + q->stops++;
> +}
> +
> /**
> * eth_xmit - add a packet to the Ethernet Tx queue
> * @skb: the packet
> @@ -1090,31 +1098,18 @@ int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev)
> ndesc = calc_tx_descs(skb);
>
> if (unlikely(credits < ndesc)) {
> - if (!netif_queue_stopped(dev)) {
> - netif_stop_queue(dev);
> - set_bit(TXQ_ETH, &qs->txq_stopped);
> - q->stops++;
> - dev_err(&adap->pdev->dev,
> - "%s: Tx ring %u full while queue awake!\n",
> - dev->name, q->cntxt_id & 7);
> - }
> + t3_stop_queue(dev, qs, q);
> + dev_err(&adap->pdev->dev,
> + "%s: Tx ring %u full while queue awake!\n",
> + dev->name, q->cntxt_id & 7);
> spin_unlock(&q->lock);
> return NETDEV_TX_BUSY;
> }
>
> q->in_use += ndesc;
> - if (unlikely(credits - ndesc < q->stop_thres)) {
> - q->stops++;
> - netif_stop_queue(dev);
> - set_bit(TXQ_ETH, &qs->txq_stopped);
> -#if !USE_GTS
> - if (should_restart_tx(q) &&
> - test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
> - q->restarts++;
> - netif_wake_queue(dev);
> - }
> -#endif
> - }
> + if (unlikely(credits - ndesc < q->stop_thres))
> + if (USE_GTS || !should_restart_tx(q))
> + t3_stop_queue(dev, qs, q);
>
> gen = q->gen;
> q->unacked += ndesc;
>
Hi Jeff,
I thought I had NAK'ed the patch modifying sge.c from Krishna Kumar.
Looking back at my answer at the time, I was obviously unclear.
Can you please revert the drivers/net/cxgb3sge.c change ?
Cheers,
Divy
^ permalink raw reply
* RE: [Patch 2.6.24 1/3]S2io: Support for vlan_rx_kill_vid entry point
From: Ramkrishna Vepa @ 2008-02-11 20:02 UTC (permalink / raw)
To: Jeff Garzik, Sreenivasa Honnur; +Cc: netdev, support
In-Reply-To: <47B0740B.5040006@garzik.org>
Reply inline -
> Subject: Re: [Patch 2.6.24 1/3]S2io: Support for vlan_rx_kill_vid
entry
> point
>
> Sreenivasa Honnur wrote:
> > - Added s2io_vlan_rx_kill_vid entry point function for unregistering
> vlan.
> > - Fix to aggregate vlan packets. IP offset is incremented by
> > 4 bytes if the packet contains vlan header.
> > - resubmit for 2.6.24 kernel
> >
> > Signed-off-by: Surjit Reang <surjit.reang@neterion.com>
> > Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
>
> it's difficult to sort through these patches, because they clash a bit
> with the kernel development model.
>
> You always need to send against the latest kernel (generally davem's
> tree if it's during -rc bug fix cycle, or linus's otherwise).
[Ram] Got it. We thought the window was still open for 2.6.24...
>
> Once the changes are in place, then email the commit ids or backported
> patches to stable@kernel.org for inclusion in an already-released
kernel.
>
> In this case, 2.6.24 was well on its way to being released weeks ago,
> when this set of patches was last resend (and then I subsequently
> screwed up, and apparently applied a wrong patch, as discussed)
>
> So what we need are patches against the latest kernel
> (torvalds/linux-2.6.git), and after those are applied, email
> stable@kernel.org with whatever you want in 2.6.24.x.
[Ram] We will recreate these patches (with fixes and features) based on
torvalds/linux-2.6.git, and then send the fixes alone to
stable@kernel.org for 2.6.24.x.
Thanks,
Ram
>
> Jeff
>
>
^ permalink raw reply
* Re: [PATCH 1/6] [NET] replace code with FIELD_SIZEOF
From: Jeff Garzik @ 2008-02-11 19:51 UTC (permalink / raw)
To: Auke Kok; +Cc: e1000-devel, netdev
In-Reply-To: <20080211172539.29090.99369.stgit@localhost.localdomain>
Auke Kok wrote:
> From: Julia Lawall <julia@diku.dk>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
> ---
>
> drivers/net/e1000/e1000_ethtool.c | 2 +-
> drivers/net/igb/igb_ethtool.c | 2 +-
> drivers/net/ixgb/ixgb_ethtool.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
applied 1-6 to #upstream-fixes
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply
* Re: [PATCH 3/5 v3] Tsi108_eth: remove not needed code
From: Jeff Garzik @ 2008-02-11 19:50 UTC (permalink / raw)
To: Alex Bounine; +Cc: netdev, linuxppc-dev
In-Reply-To: <d5f62df20802111135q36e47070w611291b2cea2253e@mail.gmail.com>
Alex Bounine wrote:
> Code clean-up for tsi108_eth network driver.
> This patch removes not needed dummy read and the corresponding comment.
> The PHY logic requires two reads from the status register to get
> current link status. This is done correctly inside mii_check_media().
>
> Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
> ---
>
> diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
> linux-2.6.24-fix/drivers/net/tsi108_eth.c
> --- linux-2.6.24/drivers/net/tsi108_eth.c 2008-02-06 15:47:35.000000000 -0500
> +++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
> 15:54:14.000000000 -0500
> @@ -297,18 +297,11 @@ static void tsi108_check_phy(struct net_
> u32 speed;
> unsigned long flags;
>
> - /* Do a dummy read, as for some reason the first read
> - * after a link becomes up returns link down, even if
> - * it's been a while since the link came up.
> - */
> -
> spin_lock_irqsave(&phy_lock, flags);
>
> if (!data->phy_ok)
> goto out;
>
> - tsi108_read_mii(data, MII_BMSR);
> -
> duplex = mii_check_media(&data->mii_if, netif_msg_link(data),
> data->init_media);
applied all five, but each one was still corrupted according to git-am.
I was able to apply four via patch(1), which is more forgiving, but
there are still email problems.
As as you can see from the above quoted (last) line, your email client
is still word-wrapping patches.
^ permalink raw reply
* Re: [PATCH] [IPV4]: Remove warning in node_set_parent.
From: Stephen Hemminger @ 2008-02-11 19:48 UTC (permalink / raw)
To: Denis V. Lunev; +Cc: davem, netdev, devel, Denis V. Lunev
In-Reply-To: <1202719637-4925-1-git-send-email-den@openvz.org>
On Mon, 11 Feb 2008 11:47:17 +0300
"Denis V. Lunev" <den@openvz.org> wrote:
> net/ipv4/fib_trie.c: In function 'node_set_parent':
> net/ipv4/fib_trie.c:184: warning: assignment makes integer from pointer
> without a cast
>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> ---
> net/ipv4/fib_trie.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
> index f5fba3f..1753cd4 100644
> --- a/net/ipv4/fib_trie.c
> +++ b/net/ipv4/fib_trie.c
> @@ -177,10 +177,11 @@ static inline struct tnode *node_parent_rcu(struct node *node)
> return rcu_dereference(ret);
> }
>
> -static inline void node_set_parent(struct node *node, struct tnode *ptr)
> +static inline void node_set_parent(struct node *node, struct tnode *__ptr)
> {
> - rcu_assign_pointer(node->parent,
> - (unsigned long)ptr | NODE_TYPE(node));
> + struct node *ptr;
> + ptr = (struct node *)((unsigned long)__ptr | NODE_TYPE(node));
> + rcu_assign_pointer(node->parent, ptr);
> }
>
> static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i)
No, this causes new warning from assigning pointer (ptr) to integer node->parent.
Why not just change rcupdate.h to do the right thing.
>From a00f7cbf1c2f2282eced236e1e8b99b0fecd213a Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen.hemminger@vyatta.com>
Date: Mon, 11 Feb 2008 11:28:13 -0800
Subject: [PATCH] eliminate warnings when rcu_assign_pointer is used with unsigned long
It is reasonable to use RCU with non-pointer values, and describe
the optimization.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
include/linux/rcupdate.h | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 37a642c..c44ac87 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -172,14 +172,15 @@ struct rcu_head {
* structure after the pointer assignment. More importantly, this
* call documents which pointers will be dereferenced by RCU read-side
* code.
+ *
+ * If value is the NULL (constant 0), then no barrier is needed.
*/
-#define rcu_assign_pointer(p, v) \
- ({ \
- if (!__builtin_constant_p(v) || \
- ((v) != NULL)) \
- smp_wmb(); \
- (p) = (v); \
+#define rcu_assign_pointer(p, v) \
+ ({ \
+ if (!(__builtin_constant_p(v) && v)) \
+ smp_wmb(); \
+ (p) = (v); \
})
/**
--
1.5.3.8
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
^ permalink raw reply related
* Re: [BUG] bad address in twothirdsMD4Transform
From: Jiri Slaby @ 2008-02-11 19:47 UTC (permalink / raw)
To: Matt Mackall; +Cc: netdev, David S. Miller, Andrew Morton
In-Reply-To: <1202758960.12383.2.camel@cinder.waste.org>
On 02/11/2008 08:42 PM, Matt Mackall wrote:
>> BUG: unable to handle kernel paging request at ffff8102366213f8
>> IP: [<ffffffff803558f4>] twothirdsMD4Transform+0xc4/0x3b0
>
> You should mention what kernel you're using.
Kernel version is in the bug below modules and above registers.
> This bug is only in -mm
> (you didn't cc: Andrew), and it's fixed here:
>
> http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.24/2.6.24-mm1/hot-fixes/random-clean-up-checkpatch-complaints-fix.patch
I need to ask google first! Sorry.
^ permalink raw reply
* Re: [BUG] bad address in twothirdsMD4Transform
From: Matt Mackall @ 2008-02-11 19:42 UTC (permalink / raw)
To: Jiri Slaby; +Cc: netdev, David S. Miller, Andrew Morton
In-Reply-To: <47B0A220.8040400@gmail.com>
On Mon, 2008-02-11 at 20:29 +0100, Jiri Slaby wrote:
> Hi,
>
> I get this with 32 bit Firefox 3b2 and java 1.6.0_03 on 64 bit:
>
> BUG: unable to handle kernel paging request at ffff8102366213f8
> IP: [<ffffffff803558f4>] twothirdsMD4Transform+0xc4/0x3b0
You should mention what kernel you're using. This bug is only in -mm
(you didn't cc: Andrew), and it's fixed here:
http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.24/2.6.24-mm1/hot-fixes/random-clean-up-checkpatch-complaints-fix.patch
--
Mathematics is the supreme nostalgia of our time.
^ permalink raw reply
* [PATCH 5/5 v3] Tsi108_eth: Add ethtool support
From: Alex Bounine @ 2008-02-11 19:36 UTC (permalink / raw)
To: jgarzik, netdev; +Cc: linuxppc-dev, tie-fei.zang, jwboyer
Add ethtool support to tsi108_eth network driver.
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
---
diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
linux-2.6.24-fix/drivers/net/tsi108_eth.c
--- linux-2.6.24/drivers/net/tsi108_eth.c 2008-02-06 17:10:53.000000000 -0500
+++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
18:09:43.000000000 -0500
@@ -36,6 +36,7 @@
#include <linux/net.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
+#include <linux/ethtool.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
@@ -1519,12 +1520,46 @@ static void tsi108_init_mac(struct net_d
TSI_WRITE(TSI108_EC_INTMASK, ~0);
}
+static int tsi108_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+ struct tsi108_prv_data *data = netdev_priv(dev);
+ unsigned long flags;
+ int rc;
+
+ spin_lock_irqsave(&data->txlock, flags);
+ rc = mii_ethtool_gset(&data->mii_if, cmd);
+ spin_unlock_irqrestore(&data->txlock, flags);
+
+ return rc;
+}
+
+static int tsi108_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+ struct tsi108_prv_data *data = netdev_priv(dev);
+ unsigned long flags;
+ int rc;
+
+ spin_lock_irqsave(&data->txlock, flags);
+ rc = mii_ethtool_sset(&data->mii_if, cmd);
+ spin_unlock_irqrestore(&data->txlock, flags);
+
+ return rc;
+}
+
static int tsi108_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct tsi108_prv_data *data = netdev_priv(dev);
+ if (!netif_running(dev))
+ return -EINVAL;
return generic_mii_ioctl(&data->mii_if, if_mii(rq), cmd, NULL);
}
+static const struct ethtool_ops tsi108_ethtool_ops = {
+ .get_link = ethtool_op_get_link,
+ .get_settings = tsi108_get_settings,
+ .set_settings = tsi108_set_settings,
+};
+
static int
tsi108_init_one(struct platform_device *pdev)
{
@@ -1589,6 +1624,7 @@ tsi108_init_one(struct platform_device *
dev->get_stats = tsi108_get_stats;
netif_napi_add(dev, &data->napi, tsi108_poll, 64);
dev->do_ioctl = tsi108_do_ioctl;
+ dev->ethtool_ops = &tsi108_ethtool_ops;
/* Apparently, the Linux networking code won't use scatter-gather
* if the hardware doesn't do checksums. However, it's faster
^ permalink raw reply
* [PATCH 4/5 v3] Tsi108_eth: fix link recovery after disconnect
From: Alex Bounine @ 2008-02-11 19:36 UTC (permalink / raw)
To: jgarzik, netdev; +Cc: linuxppc-dev, tie-fei.zang, jwboyer
Bug fix for tsi108_eth network driver.
This patch fixes a problem with link recovery after connection was lost.
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
---
diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
linux-2.6.24-fix/drivers/net/tsi108_eth.c
--- linux-2.6.24/drivers/net/tsi108_eth.c 2008-02-06 16:16:00.000000000 -0500
+++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
16:57:41.000000000 -0500
@@ -338,22 +338,21 @@ static void tsi108_check_phy(struct net_
TSI_WRITE(TSI108_MAC_CFG2, mac_cfg2_reg);
TSI_WRITE(TSI108_EC_PORTCTRL, portctrl_reg);
+ }
- if (data->link_up == 0) {
- /* The manual says it can take 3-4 usecs for the speed change
- * to take effect.
- */
- udelay(5);
-
- spin_lock(&data->txlock);
- if (is_valid_ether_addr(dev->dev_addr) && data->txfree)
- netif_wake_queue(dev);
+ if (data->link_up == 0) {
+ /* The manual says it can take 3-4 usecs for the speed change
+ * to take effect.
+ */
+ udelay(5);
- data->link_up = 1;
- spin_unlock(&data->txlock);
- }
- }
+ spin_lock(&data->txlock);
+ if (is_valid_ether_addr(dev->dev_addr) && data->txfree)
+ netif_wake_queue(dev);
+ data->link_up = 1;
+ spin_unlock(&data->txlock);
+ }
} else {
if (data->link_up == 1) {
netif_stop_queue(dev);
@@ -1267,12 +1266,11 @@ static void tsi108_init_phy(struct net_d
* PHY_STAT register before the link up status bit is set.
*/
- data->link_up = 1;
+ data->link_up = 0;
while (!((phyval = tsi108_read_mii(data, MII_BMSR)) &
BMSR_LSTATUS)) {
if (i++ > (MII_READ_DELAY / 10)) {
- data->link_up = 0;
break;
}
spin_unlock_irqrestore(&phy_lock, flags);
^ permalink raw reply
* [PATCH 3/5 v3] Tsi108_eth: remove not needed code
From: Alex Bounine @ 2008-02-11 19:35 UTC (permalink / raw)
To: jgarzik, netdev; +Cc: linuxppc-dev, tie-fei.zang, jwboyer
Code clean-up for tsi108_eth network driver.
This patch removes not needed dummy read and the corresponding comment.
The PHY logic requires two reads from the status register to get
current link status. This is done correctly inside mii_check_media().
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
---
diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
linux-2.6.24-fix/drivers/net/tsi108_eth.c
--- linux-2.6.24/drivers/net/tsi108_eth.c 2008-02-06 15:47:35.000000000 -0500
+++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
15:54:14.000000000 -0500
@@ -297,18 +297,11 @@ static void tsi108_check_phy(struct net_
u32 speed;
unsigned long flags;
- /* Do a dummy read, as for some reason the first read
- * after a link becomes up returns link down, even if
- * it's been a while since the link came up.
- */
-
spin_lock_irqsave(&phy_lock, flags);
if (!data->phy_ok)
goto out;
- tsi108_read_mii(data, MII_BMSR);
-
duplex = mii_check_media(&data->mii_if, netif_msg_link(data),
data->init_media);
data->init_media = 0;
^ permalink raw reply
* [PATCH 2/5 v3] Tsi108_eth: fix detection of 1000Mb mode
From: Alex Bounine @ 2008-02-11 19:35 UTC (permalink / raw)
To: jgarzik, netdev; +Cc: linuxppc-dev, tie-fei.zang, jwboyer
Bug fix for tsi108_eth network driver.
This patch fixes a problem with detection of 1000Mb speed.
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
---
diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
linux-2.6.24-fix/drivers/net/tsi108_eth.c
--- linux-2.6.24/drivers/net/tsi108_eth.c 2008-02-06 15:09:19.000000000 -0500
+++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
15:34:12.000000000 -0500
@@ -1287,6 +1287,7 @@ static void tsi108_init_phy(struct net_d
spin_lock_irqsave(&phy_lock, flags);
}
+ data->mii_if.supports_gmii = mii_check_gmii_support(&data->mii_if);
printk(KERN_DEBUG "PHY_STAT reg contains %08x\n", phyval);
data->phy_ok = 1;
data->init_media = 1;
@@ -1584,7 +1585,6 @@ tsi108_init_one(struct platform_device *
data->mii_if.phy_id = einfo->phy;
data->mii_if.phy_id_mask = 0x1f;
data->mii_if.reg_num_mask = 0x1f;
- data->mii_if.supports_gmii = mii_check_gmii_support(&data->mii_if);
data->phy = einfo->phy;
data->phy_type = einfo->phy_type;
^ permalink raw reply
* [PATCH 1/5 v3] Tsi108_eth: add missing linking to driver data
From: Alex Bounine @ 2008-02-11 19:33 UTC (permalink / raw)
To: jgarzik, netdev; +Cc: linuxppc-dev, tie-fei.zang, jwboyer
Bug fix for tsi108_eth network driver.
This patch adds missing linking to driver data.
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
---
diff -pNur linux-2.6.24/drivers/net/tsi108_eth.c
linux-2.6.24-fix/drivers/net/tsi108_eth.c
--- linux-2.6.24/drivers/net/tsi108_eth.c 2008-01-24 17:58:37.000000000 -0500
+++ linux-2.6.24-fix/drivers/net/tsi108_eth.c 2008-02-06
14:30:04.000000000 -0500
@@ -1629,6 +1629,7 @@ tsi108_init_one(struct platform_device *
goto register_fail;
}
+ platform_set_drvdata(pdev, dev);
printk(KERN_INFO "%s: Tsi108 Gigabit Ethernet, MAC: %s\n",
dev->name, print_mac(mac, dev->dev_addr));
#ifdef DEBUG
^ permalink raw reply
* [BUG] bad address in twothirdsMD4Transform
From: Jiri Slaby @ 2008-02-11 19:29 UTC (permalink / raw)
To: Matt Mackall; +Cc: netdev, David S. Miller
Hi,
I get this with 32 bit Firefox 3b2 and java 1.6.0_03 on 64 bit:
BUG: unable to handle kernel paging request at ffff8102366213f8
IP: [<ffffffff803558f4>] twothirdsMD4Transform+0xc4/0x3b0
PGD 8063 PUD 0
Oops: 0000 [1] SMP
last sysfs file: /sys/devices/virtual/net/tun0/statistics/collisions
CPU 1
Modules linked in: szetest szedata2 v4l2_extension videodev v4l2_common
v4l1_compat isofs tun bitrev ipv6 arc4 ecb crypto_blkcipher cryptomgr
crypto_algapi ath5k mac80211 cfg80211 rtc_cmos sr_mod rtc_core ehci_hcd floppy
rtc_lib cdrom crc32 [last unloaded: szedata2]
Pid: 3512, comm: java_vm Not tainted 2.6.24-mm1_64 #380
RIP: 0010:[<ffffffff803558f4>] [<ffffffff803558f4>]
twothirdsMD4Transform+0xc4/0x3b0
RSP: 0000:ffff810042721c68 EFLAGS: 00010286
RAX: 0000000000004000 RBX: 0000000000000000 RCX: 000000003ffffffc
RDX: 000000007cfbfdc8 RSI: ffff810042721cd8 RDI: ffff8100435893d0
RBP: ffff810042721cc8 R08: 0000000080000000 R09: 0000000000000000
R10: ffff8101ac7c033c R11: 0000000000000000 R12: 0000000067f18b72
R13: 0000000000000000 R14: ffff8100435893b0 R15: 00000000c42802a9
FS: 0000000000000000(0000) GS:ffff81007d008500(0063) knlGS:00000000f492ab90
CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: ffff8102366213f8 CR3: 00000000426e6000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process java_vm (pid: 3512, threadinfo ffff810042720000, task ffff81002211b6b0)
Stack: ffff81007c0c62d0 000000007cfbfdc8 000000002dc63fea 0000000001000000
0000000000000000 0000000000000000 0000000000000000 0000000000000000
ffff8100435893b0 ffff810043588d80 ffff8100435893b0 ffff810042721e88
Call Trace:
[<ffffffff80356cce>] secure_tcpv6_sequence_number+0x6e/0xa0
[<ffffffff880b24ff>] :ipv6:tcp_v6_connect+0x4bf/0x650
[<ffffffff80466a89>] ? lock_sock_nested+0xc9/0xe0
[<ffffffff804b68d1>] inet_stream_connect+0x231/0x2c0
[<ffffffff804a5efe>] ? tcp_init_xmit_timers+0x1e/0x20
[<ffffffff802b96aa>] ? inotify_d_instantiate+0x1a/0x50
[<ffffffff80464171>] sys_connect+0x71/0xa0
[<ffffffff8046449a>] ? sock_map_fd+0x4a/0x70
[<ffffffff80480f56>] compat_sys_socketcall+0x86/0x1b0
[<ffffffff80224302>] ia32_sysret+0x0/0xa
Code: 56 10 c1 c8 0d 48 89 55 b0 03 0c 96 44 89 ca 44 31 c2 21 c2 44 31 c2 01 d1
8b 56 14 c1 c9 1d 48 89 55 a8 44 8b 7e 18 44 8b 66 1c <44> 03 04 96 89 c2 44 31
ca 21 ca 44 31 ca 46 03 0c be 41 01 d0
RIP [<ffffffff803558f4>] twothirdsMD4Transform+0xc4/0x3b0
RSP <ffff810042721c68>
CR2: ffff8102366213f8
---[ end trace 057610ccf9ee39f0 ]---
Reproducible, going to
https://www.mojebanka.cz/InternetBanking/JSPLogin.jsp?L=CS
triggers it.
^ permalink raw reply
* Re: AW: Problem receiving multicast/promiscuous-mode with kernel.2.6.24
From: David Stevens @ 2008-02-11 19:18 UTC (permalink / raw)
To: Reither Robert; +Cc: netdev
In-Reply-To: <BA41E8A07B73A041948C2E3A4EF6239D062F0C@av-digital-exch.avdigital.at>
Another relevant piece of information is what the socket is
bound to; "netstat -au" will tell you if you're bound to an address
that will match the incoming multicast packets.
If you suspect that the VLAN device is the problem, then it'd be
a good idea to try it on ordinary ethernet.
Re: imr_ifindex; using a "0" ifindex and INADDR_ANY interface is valid,
but it usually doesn't make sense. What it means is "I don't care what
interface I join the group on". But you'll only receive multicasts
delivered to the group on the interface the kernel picks for you, which
often won't be the one you really want.
+-DLS
^ permalink raw reply
* Re: [PATCH][PPPOL2TP]: Fix SMP oops in pppol2tp driver
From: Jarek Poplawski @ 2008-02-11 18:57 UTC (permalink / raw)
To: James Chapman; +Cc: netdev
In-Reply-To: <200802110922.m1B9MKQ4003674@quickie.katalix.com>
James Chapman wrote, On 02/11/2008 10:22 AM:
> Fix locking issues in the pppol2tp driver which can cause a kernel
> crash on SMP boxes when hundreds of L2TP sessions are created/deleted
> simultaneously (ISP environment). The driver was violating read_lock()
> and write_lock() scheduling rules so we now consistently use the _irq
> variants of the lock functions.
...
Hi,
Could you explain what exactly scheduling rules do you mean here,
and why disabling interrupts is the best solution for this?
Thanks,
Jarek P.
^ permalink raw reply
* Re: [2.6 patch] olympic_open() must be __devinit
From: Mike Phillips @ 2008-02-11 19:03 UTC (permalink / raw)
To: Adrian Bunk; +Cc: p2, jgarzik, netdev
In-Reply-To: <20080130200207.GJ29368@does.not.exist>
On Wed, Jan 30, 2008 at 10:02:07PM +0200, Adrian Bunk wrote:
> This patch fixes the following section mismatch:
>
> <-- snip -->
>
> ...
> WARNING: drivers/net/built-in.o(.text+0x155573): Section mismatch in reference from the function olympic_open() to the function .devinit.text:olympic_init()
> ...
>
> <-- snip -->
>
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
>
> ---
> fd1e6e0bb5b17dc85cd24d6263e8751e816f59e6
> diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
> index e7b4adc..433c994 100644
> --- a/drivers/net/tokenring/olympic.c
> +++ b/drivers/net/tokenring/olympic.c
> @@ -434,7 +434,7 @@ static int __devinit olympic_init(struct net_device *dev)
>
> }
>
> -static int olympic_open(struct net_device *dev)
> +static int __devinit olympic_open(struct net_device *dev)
> {
> struct olympic_private *olympic_priv=netdev_priv(dev);
> u8 __iomem *olympic_mmio=olympic_priv->olympic_mmio,*init_srb;
>
>
If __devinit marked code is still discarded after initial setup then NACK. open can be called at any time the
interface is ifup'ed. Its most definitely not adapter init code (that's all done in probe).
Mike
^ permalink raw reply
* Re: [Bugme-new] [Bug 9933] New: kernel BUG at include/linux/skbuff.h:912
From: Andrew Morton @ 2008-02-11 18:08 UTC (permalink / raw)
To: netdev; +Cc: bugme-daemon, tomas.simonaitis
In-Reply-To: <bug-9933-10286@http.bugzilla.kernel.org/>
On Mon, 11 Feb 2008 03:46:45 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=9933
>
> Summary: kernel BUG at include/linux/skbuff.h:912
> Product: Networking
> Version: 2.5
> KernelVersion: 2.6.24.2
> Platform: All
> OS/Version: Linux
> Tree: Mainline
> Status: NEW
> Severity: normal
> Priority: P1
> Component: Netfilter/Iptables
> AssignedTo: networking_netfilter-iptables@kernel-bugs.osdl.org
> ReportedBy: tomas.simonaitis@gmail.com
>
>
> Latest working kernel version: 2.6.22.3
> Earliest failing kernel version: 2.6.24.1
> Distribution: Debian etch
> Hardware Environment: x86_64, SMP
>
> If libnetfilter-queue (v. 0.0.12-1) application calls nfq_set_verdict
> and:
> - protocol is IPv4 (works fine with IPv6)
> - new packet length has been changed
> - packet contains data payload (not affected if tcp header is extended with
> options, but data payload=0)
>
> SKB_LINEAR_ASSERT is catched.
>
>
> ------------[ cut here ]------------
> kernel BUG at include/linux/skbuff.h:912!
> invalid opcode: 0000 [1] SMP
> CPU 4
> Modules linked in: nfnetlink_queue nfnetlink ip6table_mangle xt_NFQUEUE
> iptable_mangle xt_tcpudp nf_conntrack_ipv6 nf_conntrack_ipv4 xt_state
> nf_conntrack iptable_filter ip_tables ip6table_filter ip6_tables x_tables esp4
> ah4 xfrm4_mode_transport deflate zlib_deflate twofish twofish_common camellia
> serpent blowfish des_generic cbc ecb blkcipher aes_x86_64 aes_generic xcbc
> sha256_generic sha1_generic crypto_null af_key dm_crypt dm_snapshot dm_mirror
> dm_mod ipv6 ipmi_si iTCO_wdt container ipmi_msghandler button serio_raw evdev
> pcspkr ide_generic ide_cd cdrom pata_acpi ata_generic ata_piix libata scsi_mod
> usbhid piix generic ide_core ehci_hcd bnx2 uhci_hcd zlib_inflate cciss thermal
> processor fan
> Pid: 3390, comm: tcpmd5 Not tainted 2.6.24.2 #1
> RIP: 0010:[<ffffffff88258b2c>] [<ffffffff88258b2c>]
> :nfnetlink_queue:nfqnl_recv_verdict+0x179/0x227
> RSP: 0018:ffff81012d219a08 EFLAGS: 00010206
> RAX: 0000000000000100 RBX: 0000000000000000 RCX: 0000000000010001
> RDX: ffff81012e539500 RSI: ffff81012e539638 RDI: ffff81012df7ce18
> RBP: 0000000000000075 R08: ffffffff88250079 R09: ffff81012df7ce18
> R10: 00007fff576df198 R11: ffff81012d9daac0 R12: 0000000000000014
> R13: ffff81012e691e40 R14: 0000000000000001 R15: ffff81012eae3c20
> FS: 00002aab53c7a6d0(0000) GS:ffff81012f8fdb40(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> CR2: 00002aab535e6090 CR3: 000000012e06c000 CR4: 00000000000006e0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> Process tcpmd5 (pid: 3390, threadinfo ffff81012d218000, task ffff81012dafc080)
> Stack: ffffffff8825000a ffff81012d219a60 ffff81012e524740 ffff81012d219a60
> ffff81012d219af8 ffffffff88258ff8 ffff81012eae3c00 ffff81012d219ac8
> ffff81012f9d7a80 ffffffff88255233 ffffffff804e42e8 0000000000000000
> Call Trace:
> [<ffffffff88255233>] :nfnetlink:nfnetlink_rcv_msg+0x129/0x172
> [<ffffffff8825512b>] :nfnetlink:nfnetlink_rcv_msg+0x21/0x172
> [<ffffffff8825510a>] :nfnetlink:nfnetlink_rcv_msg+0x0/0x172
> [<ffffffff803d23b6>] netlink_rcv_skb+0x34/0x8b
> [<ffffffff8825501f>] :nfnetlink:nfnetlink_rcv+0x1f/0x2c
> [<ffffffff803d2156>] netlink_unicast+0x1e0/0x240
> [<ffffffff803d29eb>] netlink_sendmsg+0x2a2/0x2b5
> [<ffffffff803ba345>] memcpy_fromiovec+0x36/0x66
> [<ffffffff803b3790>] sock_sendmsg+0xe2/0xff
> [<ffffffff80243e10>] autoremove_wake_function+0x0/0x2e
> [<ffffffff803b3790>] sock_sendmsg+0xe2/0xff
> [<ffffffff80243e10>] autoremove_wake_function+0x0/0x2e
> [<ffffffff80312f8d>] xfs_vn_getattr+0x3d/0xfd
> [<ffffffff803b29c0>] move_addr_to_kernel+0x25/0x36
> [<ffffffff803b39c1>] sys_sendmsg+0x214/0x287
> [<ffffffff803b3b5c>] sys_sendto+0x128/0x151
> [<ffffffff8027bbf5>] do_readv_writev+0x18f/0x1a4
> [<ffffffff8020be2e>] system_call+0x7e/0x83
>
>
> Code: 0f 0b eb fe 44 01 e0 44 01 67 68 3b 87 b8 00 00 00 89 87 b4
> RIP [<ffffffff88258b2c>] :nfnetlink_queue:nfqnl_recv_verdict+0x179/0x227
> RSP <ffff81012d219a08>
> ---[ end trace 303d8add98149551 ]---
>
> I cannot reproduce problem on kernel 2.6.22.3 (both i386 and x86-64) and
> 2.6.24.2 if arch is i386.
>
> tcpmd5 application http://tcpmd5.googlecode.com/files/tcpmd5_0.0.3.tar.gz
>
>
^ permalink raw reply
* [PATCH 2/6] e1000: warn if this driver is used for e1000e devices
From: Auke Kok @ 2008-02-11 17:25 UTC (permalink / raw)
To: jeff; +Cc: netdev, e1000-devel
In-Reply-To: <20080211172539.29090.99369.stgit@localhost.localdomain>
We're already starting to see reports from users still
using e1000 where they should be using e1000e now that this is
actually possible. Just to prevent some of this thrash, add
a big warning on load on these devices that people should
switch to e1000e.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
---
drivers/net/e1000/e1000_main.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 7c5b05a..81db7fd 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1203,6 +1203,14 @@ e1000_probe(struct pci_dev *pdev,
printk("%s\n", print_mac(mac, netdev->dev_addr));
+ if (adapter->hw.bus_type == e1000_bus_type_pci_express) {
+ DPRINTK(PROBE, WARNING, "This device (id %04x:%04x) will no "
+ "longer be supported by this driver in the future.\n",
+ pdev->vendor, pdev->device);
+ DPRINTK(PROBE, WARNING, "please use the \"e1000e\" "
+ "driver instead.\n");
+ }
+
/* reset the hardware with the new settings */
e1000_reset(adapter);
^ permalink raw reply related
* [PATCH 1/6] [NET] replace code with FIELD_SIZEOF
From: Auke Kok @ 2008-02-11 17:25 UTC (permalink / raw)
To: jeff; +Cc: netdev, e1000-devel
From: Julia Lawall <julia@diku.dk>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_ethtool.c | 2 +-
drivers/net/igb/igb_ethtool.c | 2 +-
drivers/net/ixgb/ixgb_ethtool.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index d876787..85e66f4 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -50,7 +50,7 @@ struct e1000_stats {
int stat_offset;
};
-#define E1000_STAT(m) sizeof(((struct e1000_adapter *)0)->m), \
+#define E1000_STAT(m) FIELD_SIZEOF(struct e1000_adapter, m), \
offsetof(struct e1000_adapter, m)
static const struct e1000_stats e1000_gstrings_stats[] = {
{ "rx_packets", E1000_STAT(stats.gprc) },
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index f69721e..0447f9b 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -43,7 +43,7 @@ struct igb_stats {
int stat_offset;
};
-#define IGB_STAT(m) sizeof(((struct igb_adapter *)0)->m), \
+#define IGB_STAT(m) FIELD_SIZEOF(struct igb_adapter, m), \
offsetof(struct igb_adapter, m)
static const struct igb_stats igb_gstrings_stats[] = {
{ "rx_packets", IGB_STAT(stats.gprc) },
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index a267dd8..53a9fd0 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -49,7 +49,7 @@ struct ixgb_stats {
int stat_offset;
};
-#define IXGB_STAT(m) sizeof(((struct ixgb_adapter *)0)->m), \
+#define IXGB_STAT(m) FIELD_SIZEOF(struct ixgb_adapter, m), \
offsetof(struct ixgb_adapter, m)
static struct ixgb_stats ixgb_gstrings_stats[] = {
{"rx_packets", IXGB_STAT(net_stats.rx_packets)},
^ permalink raw reply related
* [PATCH 6/6] ixgbe: remove accidentally added #ifdef
From: Auke Kok @ 2008-02-11 17:26 UTC (permalink / raw)
To: jeff; +Cc: e1000-devel, netdev
In-Reply-To: <20080211172539.29090.99369.stgit@localhost.localdomain>
Let's not add these #ifdef NETIF_F_TSO's back.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/ixgbe/ixgbe_main.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index a4aeaec..540b647 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -220,7 +220,6 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_adapter *adapter,
tx_ring->stats.bytes += tx_buffer_info->length;
if (cleaned) {
struct sk_buff *skb = tx_buffer_info->skb;
-#ifdef NETIF_F_TSO
unsigned int segs, bytecount;
segs = skb_shinfo(skb)->gso_segs ?: 1;
/* multiply data chunks by size of headers */
@@ -228,10 +227,6 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_adapter *adapter,
skb->len;
total_tx_packets += segs;
total_tx_bytes += bytecount;
-#else
- total_tx_packets++;
- total_tx_bytes += skb->len;
-#endif
}
ixgbe_unmap_and_free_tx_resource(adapter,
tx_buffer_info);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related
* [PATCH 5/6] ixgbe: Disallow device reset during ethtool test
From: Auke Kok @ 2008-02-11 17:26 UTC (permalink / raw)
To: jeff; +Cc: e1000-devel, netdev
In-Reply-To: <20080211172539.29090.99369.stgit@localhost.localdomain>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/ixgbe/ixgbe_main.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 576fb51..a4aeaec 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -1942,6 +1942,10 @@ static int ixgbe_open(struct net_device *netdev)
int err;
u32 num_rx_queues = adapter->num_rx_queues;
+ /* disallow open during test */
+ if (test_bit(__IXGBE_TESTING, &adapter->state))
+ return -EBUSY;
+
try_intr_reinit:
/* allocate transmit descriptors */
err = ixgbe_setup_all_tx_resources(adapter);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox