Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next-2.6 00/12] Convert more drivers to ethtool set_phys_id
From: Ben Hutchings @ 2011-04-04 23:07 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev
In-Reply-To: <20110404184340.604594357@linuxplumber.net>

On Mon, 2011-04-04 at 11:43 -0700, Stephen Hemminger wrote:
> Did a bunch of the easy drivers to convert.

Thanks Stephen.  I would have done some of these but I'm pretty snowed
under at the moment.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply

* Re: [PATCH net-next 1/7] tg3: Add 5720 ASIC rev
From: Matt Carlson @ 2011-04-04 23:05 UTC (permalink / raw)
  To: Joe Perches; +Cc: Matthew Carlson, davem@davemloft.net, netdev@vger.kernel.org
In-Reply-To: <1301942262.1941.60.camel@Joe-Laptop>

On Mon, Apr 04, 2011 at 11:37:42AM -0700, Joe Perches wrote:
> On Mon, 2011-04-04 at 11:24 -0700, Matt Carlson wrote:
> > This patch adds support for the 5720 ASIC rev.
> > 
> > Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
> > Reviewed-by: Michael Chan <mchan@broadcom.com>
> > ---
> >  drivers/net/tg3.c |   67 +++++++++++++++++++++++++++++++++++++---------------
> >  drivers/net/tg3.h |    5 ++++
> >  2 files changed, 52 insertions(+), 20 deletions(-)
> > 
> > diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
> > index b7e03a6..b105cdd 100644
> > --- a/drivers/net/tg3.c
> > +++ b/drivers/net/tg3.c
> > @@ -98,12 +98,14 @@
> >   */
> >  #define TG3_RX_STD_RING_SIZE(tp) \
> >  	((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || \
> > -	  GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) ? \
> > +	  GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || \
> > +	  GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) ? \
> 
> Maybe it'd be better to convert all of these:
> 
> 	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
> 	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
> 	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720)
> 
> tests to a common functions something like:
> 
> static bool can_asic_<foo>(struct tg3 *tp)
> {
> 	int rev = GET_ASIC_REV(tp->pci_chip_rev_id);
> 	return (rev == ASIC_REV_5717) ||
> 	       (rev == ASIC_REV_5719) ||
> 	       (rev == ASIC_REV_5720);
> }

In general, we do try to do this.  We already have a TG3_FLG3_5717_PLUS
flag, but it includes the 57765 ASIC rev.  I thought :

	if ((tp->tg3_flags3 & TG3_FLG3_5717_PLUS) &&
	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765)

didn't look much cleaner.  Demoting the 57765 from that flag also
uglifies the code too much.

Let me think about this a little more.


^ permalink raw reply

* Re: [PATCH net-next-2.6 02/12] skge: implement set_phys_id
From: Ben Hutchings @ 2011-04-04 22:57 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev
In-Reply-To: <20110404184501.450494215@linuxplumber.net>

On Mon, 2011-04-04 at 11:43 -0700, Stephen Hemminger wrote:
> Implement set_phys_id led control on SysKonnect board.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> 
> --- a/drivers/net/skge.c	2011-04-04 10:48:15.713539204 -0700
> +++ b/drivers/net/skge.c	2011-04-04 10:50:07.387094723 -0700
> @@ -786,29 +786,28 @@ static void skge_led(struct skge_port *s
>  }
>  
>  /* blink LED's for finding board */
> -static int skge_phys_id(struct net_device *dev, u32 data)
> +static int skge_set_phys_id(struct net_device *dev,
> +			    enum ethtool_phys_id_state state)
>  {
>  	struct skge_port *skge = netdev_priv(dev);
> -	unsigned long ms;
> -	enum led_mode mode = LED_MODE_TST;
>  
> -	if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
> -		ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT / HZ) * 1000;
> -	else
> -		ms = data * 1000;
> -
> -	while (ms > 0) {
> -		skge_led(skge, mode);
> -		mode ^= LED_MODE_TST;
> -
> -		if (msleep_interruptible(BLINK_MS))
> -			break;
> -		ms -= BLINK_MS;
> +	switch (state) {
> +	case ETHTOOL_ID_ACTIVE:
> +		return -1;
[...]

Must be -EINVAL.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply

* Re: shutdown oops in xt_compat_calc_jump
From: Eric Dumazet @ 2011-04-04 22:48 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: dann frazier, netdev, netfilter-devel@vger.kernel.org
In-Reply-To: <1301949477.3021.55.camel@edumazet-laptop>

Le lundi 04 avril 2011 à 22:37 +0200, Eric Dumazet a écrit :
> Le lundi 04 avril 2011 à 22:02 +0200, Patrick McHardy a écrit :
> > CCed netfilter-devel.
> > 
> > Am 04.04.2011 21:48, schrieb dann frazier:
> > > fyi, noticed this oops when shutting down a system running top of git
> > > (@ 78fca1be)
> > > 
> > > [ 1169.794644] cfg80211: Calling CRDA to update world regulatory domain
> > > [ 1170.490646] bluetoothd[2029]: segfault at f8ad9944 ip 00000000f77045e0 sp 00000000ffcb14e0 error 4 in bluetoothd[f76bf000+8b000]
> > > [ 1170.543817] BUG: unable to handle kernel paging request at 00000001dc1be9f8
> > > [ 1170.543875] IP: [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
> > > [ 1170.543927] PGD 1215b3067 PUD 0 
> > > [ 1170.543955] Oops: 0000 [#1] SMP 
> > > [ 1170.543982] last sysfs file: /sys/module/bridge/initstate
> > > [ 1170.544017] CPU 3 
> > > [ 1170.544031] Modules linked in: ebtable_broute ebtable_filter vfat msdos fat ext3 jbd ip6table_filter ip6_tables ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc acpi_cpufreq mperf cpufreq_powersave cpufreq_userspace cpufreq_conservative cpufreq_stats binfmt_misc kvm(-) fuse ext2 loop snd_hda_codec_hdmi snd_hda_codec_conexant arc4 ecb snd_usb_audio snd_usbmidi_lib snd_seq_midi snd_seq_midi_event snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_rawmidi i915 drm_kms_helper thinkpad_acpi snd_seq iwlagn snd_timer snd_seq_device drm snd mac80211 psmouse btusb serio_raw bluetooth evdev tpm_tis snd_page_alloc tpm i2c_i801 i2c_algo_bit cfg80211 battery soundcore nvram tpm_bios i2c_core rfkill wmi ac power_supply video button processor ext4 mbcache jbd2 crc16 sha256_generic aesni_intel cryptd aes_x86_64 aes_generic cbc dm_crypt dm_mod sd_mod crc_t10di
> > f 
> > >  usbhid
> > > hid usb_storage ahci libahci libata ehci_hcd scsi_mod usbcore e1000e thermal thermal_sys [last unloaded: kvm_intel]
> > > [ 1170.544836] 
> > > [ 1170.544849] Pid: 4901, comm: ebtables Not tainted 2.6.39-rc1+ #9 LENOVO 2516CTO/2516CTO
> > > [ 1170.544902] RIP: 0010:[<ffffffffa051e7b0>]  [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
> > > [ 1170.544958] RSP: 0018:ffff880121473cf8  EFLAGS: 00010217
> > > [ 1170.544989] RAX: 000000003b837d3f RBX: 0000000000000090 RCX: 000000007706fa7f
> > > [ 1170.545029] RDX: 0000000000000000 RSI: 0000000000000090 RDI: 000000003b837d3f
> > > [ 1170.545067] RBP: ffffc900111a3000 R08: 0000000000000000 R09: dead000000200200
> > > [ 1170.545104] R10: dead000000100100 R11: 0000000000001311 R12: ffff880121473d88
> > > [ 1170.545147] R13: ffffc900111a6000 R14: ffffffff817de300 R15: 0000000000000000
> > > [ 1170.545185] FS:  0000000000000000(0000) GS:ffff880137d80000(0063) knlGS:00000000f761b6c0
> > > [ 1170.545227] CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
> > > [ 1170.545258] CR2: 00000001dc1be9f8 CR3: 0000000125868000 CR4: 00000000000006e0
> > > [ 1170.545297] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > > [ 1170.545334] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> > > [ 1170.545375] Process ebtables (pid: 4901, threadinfo ffff880121472000, task ffff8801322d1ac0)
> > > [ 1170.545418] Stack:
> > > [ 1170.545433]  0000000000000090 ffffffffa0576d46 f7007265746c6966 0000000000000054
> > > [ 1170.545479]  0000000000000000 0000000000000000 000000000000000e 0000000000000090
> > > [ 1170.545529]  0000000000000000 0000000008af2180 0000000008af21b0 0000000008af21e0
> > > [ 1170.545579] Call Trace:
> > > [ 1170.545600]  [<ffffffffa0576d46>] ? compat_do_replace+0x117/0x221 [ebtables]
> > > [ 1170.545639]  [<ffffffffa0577392>] ? compat_do_ebt_set_ctl+0x55/0xbb [ebtables]
> > > [ 1170.545688]  [<ffffffff810337e3>] ? need_resched+0x1a/0x23
> > > [ 1170.545723]  [<ffffffff810337f1>] ? should_resched+0x5/0x24
> > > [ 1170.545730]  [<ffffffff81314cc5>] ? _cond_resched+0x9/0x20
> > > [ 1170.545733]  [<ffffffff813152fe>] ? mutex_lock_interruptible+0x18/0x32
> > > [ 1170.545738]  [<ffffffff8128490b>] ? nf_sockopt_find.clone.1+0xda/0xec
> > > [ 1170.545742]  [<ffffffff81284996>] ? compat_nf_sockopt+0x79/0xa5
> > > [ 1170.545744]  [<ffffffff810337f1>] ? should_resched+0x5/0x24
> > > [ 1170.545747]  [<ffffffff812849f3>] ? compat_nf_setsockopt+0x1a/0x1f
> > > [ 1170.545751]  [<ffffffff8128fb35>] ? compat_ip_setsockopt+0x80/0xa0
> > > [ 1170.545756]  [<ffffffff812784a2>] ? compat_sys_setsockopt+0x1d5/0x204
> > > [ 1170.545759]  [<ffffffff810337f1>] ? should_resched+0x5/0x24
> > > [ 1170.545761]  [<ffffffff81314cc5>] ? _cond_resched+0x9/0x20
> > > [ 1170.545764]  [<ffffffff812788a5>] ? compat_sys_socketcall+0x148/0x1a7
> > > [ 1170.545768]  [<ffffffff8131d2c0>] ? sysenter_dispatch+0x7/0x2e
> > > [ 1170.545769] Code: 5d 41 5e 41 5f c3 40 0f b6 ff 53 31 d2 48 6b ff 70 48 03 3d 03 1b 00 00 8b 4f 6c 4c 8b 47 60 ff c9 eb 27 8d 04 11 d1 f8 48 63 f8 
> > > [ 1170.545787] RIP  [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
> > > [ 1170.545792]  RSP <ffff880121473cf8>
> > > [ 1170.545794] CR2: 00000001dc1be9f8
> > > [ 1170.654269] ---[ end trace d44667d90dcbd115 ]---
> > > [ 1170.662411] fuse exit
> > > Kernel logging (proc) stopped.
> > > --
> 
> 
> Hmm, commit 255d0dc34068a976550ce555e must have a problem for ebtables ?
> 
> Dann, could you give us what you do with ebtables ?
> 
> Thanks
> 

For sure, there was a typo in above commit, but this is not enough to
make ebtables work in COMPAT mode.

Hmm...

[PATCH] netfilter: fix a typo in ebtables

commit 255d0dc34068a976 (netfilter: x_table: speedup compat operations)
added a typo in compat_table_info()

Reported-by: dann frazier <dannf@dannf.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 893669c..b5d0d1f 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -1766,7 +1766,7 @@ static int compat_table_info(const struct ebt_table_info *info,
 
 	newinfo->entries_size = size;
 
-	xt_compat_init_offsets(AF_INET, info->nentries);
+	xt_compat_init_offsets(NFPROTO_BRIDGE, info->nentries);
 	return EBT_ENTRY_ITERATE(entries, size, compat_calc_entry, info,
 							entries, newinfo);
 }


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* RE: [PATCH 6/8] benet: convert to set_phys_id
From: Ajit.Khaparde @ 2011-04-04 22:32 UTC (permalink / raw)
  To: shemminger, davem, bhutchings, Sathya.Perla, subbu.seetharaman; +Cc: netdev
In-Reply-To: <20110404210805.802043416@linuxplumber.net>

_______________________________________
From: Stephen Hemminger [shemminger@vyatta.com]
Sent: Monday, April 04, 2011 4:06 PM
To: David S. Miller; Ben Hutchings; Perla, Sathya; Seetharaman, Subramanian; Khaparde, Ajit
Cc: netdev@vger.kernel.org
Subject: [PATCH 6/8] benet: convert to set_phys_id

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


Thanks Stephen. You finished the work, while I was in the middle of the same.

I have picked this patch for testing. I guess the ethtool patches will be re-spun.
So I will probably wait for that before I send an update.

-Ajit

^ permalink raw reply

* [PATCH 5/8] niu: convert to new ethtool set_phys_id
From: Stephen Hemminger @ 2011-04-04 22:31 UTC (permalink / raw)
  To: David S. Miller; +Cc: Ben Hutchings, netdev
In-Reply-To: <20110404210805.696664557@linuxplumber.net>


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

---
Sorry for mangled version..

 drivers/net/niu.c |   33 ++++++++++++++++++---------------
 drivers/net/niu.h |    1 +
 2 files changed, 19 insertions(+), 15 deletions(-)

--- a/drivers/net/niu.c	2011-04-04 13:15:46.805340164 -0700
+++ b/drivers/net/niu.c	2011-04-04 13:19:17.551610508 -0700
@@ -7888,28 +7888,31 @@ static void niu_force_led(struct niu *np
 	nw64_mac(reg, val);
 }
 
-static int niu_phys_id(struct net_device *dev, u32 data)
+static int niu_set_phys_id(struct net_device *dev,
+			   enum ethtool_phys_id_state state)
+
 {
 	struct niu *np = netdev_priv(dev);
-	u64 orig_led_state;
-	int i;
 
 	if (!netif_running(dev))
 		return -EAGAIN;
 
-	if (data == 0)
-		data = 2;
-
-	orig_led_state = niu_led_state_save(np);
-	for (i = 0; i < (data * 2); i++) {
-		int on = ((i % 2) == 0);
-
-		niu_force_led(np, on);
+	switch (state) {
+	case ETHTOOL_ID_ACTIVE:
+		np->orig_led_state = niu_led_state_save(np);
+		return -EINVAL;
+
+	case ETHTOOL_ID_ON:
+		niu_force_led(np, 1);
+		break;
+
+	case ETHTOOL_ID_OFF:
+		niu_force_led(np, 0);
+		break;
 
-		if (msleep_interruptible(500))
-			break;
+	case ETHTOOL_ID_INACTIVE:
+		niu_led_state_restore(np, np->orig_led_state);
 	}
-	niu_led_state_restore(np, orig_led_state);
 
 	return 0;
 }
@@ -7932,7 +7935,7 @@ static const struct ethtool_ops niu_etht
 	.get_strings		= niu_get_strings,
 	.get_sset_count		= niu_get_sset_count,
 	.get_ethtool_stats	= niu_get_ethtool_stats,
-	.phys_id		= niu_phys_id,
+	.set_phys_id		= niu_set_phys_id,
 	.get_rxnfc		= niu_get_nfc,
 	.set_rxnfc		= niu_set_nfc,
 	.set_flags		= niu_set_flags,
--- a/drivers/net/niu.h	2011-04-04 13:16:37.445885085 -0700
+++ b/drivers/net/niu.h	2011-04-04 13:17:27.034418897 -0700
@@ -3279,6 +3279,7 @@ struct niu {
 	unsigned long			xpcs_off;
 
 	struct timer_list		timer;
+	u64				orig_led_state;
 	const struct niu_phy_ops	*phy_ops;
 	int				phy_addr;
 

^ permalink raw reply

* [PATCH 7/8] pcnet32: convert to set_phys_id
From: Stephen Hemminger @ 2011-04-04 21:06 UTC (permalink / raw)
  To: David S. Miller, Ben Hutchings, Don Fry; +Cc: netdev
In-Reply-To: <20110404210634.840793593@linuxplumber.net>

[-- Attachment #1: pcnet32-set_phys.patch --]
[-- Type: text/plain, Size: 4165 bytes --]

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

--- a/drivers/net/pcnet32.c	2011-04-04 13:33:41.144686505 -0700
+++ b/drivers/net/pcnet32.c	2011-04-04 13:41:13.545491008 -0700
@@ -295,12 +295,14 @@ struct pcnet32_private {
 	struct net_device	*next;
 	struct mii_if_info	mii_if;
 	struct timer_list	watchdog_timer;
-	struct timer_list	blink_timer;
 	u32			msg_enable;	/* debug message level */
 
 	/* each bit indicates an available PHY */
 	u32			phymask;
 	unsigned short		chip_version;	/* which variant this is */
+
+	/* saved registers during ethtool blink */
+	u16 			save_regs[4];
 };
 
 static int pcnet32_probe_pci(struct pci_dev *, const struct pci_device_id *);
@@ -324,8 +326,6 @@ static void pcnet32_restart(struct net_d
 static void pcnet32_ethtool_test(struct net_device *dev,
 				 struct ethtool_test *eth_test, u64 * data);
 static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1);
-static int pcnet32_phys_id(struct net_device *dev, u32 data);
-static void pcnet32_led_blink_callback(struct net_device *dev);
 static int pcnet32_get_regs_len(struct net_device *dev);
 static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
 			     void *ptr);
@@ -1022,7 +1022,8 @@ clean_up:
 	return rc;
 }				/* end pcnet32_loopback_test  */
 
-static void pcnet32_led_blink_callback(struct net_device *dev)
+static int pcnet32_set_phys_id(struct net_device *dev,
+			       enum ethtool_phys_id_state state)
 {
 	struct pcnet32_private *lp = netdev_priv(dev);
 	struct pcnet32_access *a = &lp->a;
@@ -1030,50 +1031,31 @@ static void pcnet32_led_blink_callback(s
 	unsigned long flags;
 	int i;
 
-	spin_lock_irqsave(&lp->lock, flags);
-	for (i = 4; i < 8; i++)
-		a->write_bcr(ioaddr, i, a->read_bcr(ioaddr, i) ^ 0x4000);
-	spin_unlock_irqrestore(&lp->lock, flags);
-
-	mod_timer(&lp->blink_timer, PCNET32_BLINK_TIMEOUT);
-}
+	switch (state) {
+	case ETHTOOL_ID_ACTIVE:
+		/* Save the current value of the bcrs */
+		spin_lock_irqsave(&lp->lock, flags);
+		for (i = 4; i < 8; i++)
+			lp->save_regs[i - 4] = a->read_bcr(ioaddr, i);
+		spin_unlock_irqrestore(&lp->lock, flags);
+		return -EINVAL;
 
-static int pcnet32_phys_id(struct net_device *dev, u32 data)
-{
-	struct pcnet32_private *lp = netdev_priv(dev);
-	struct pcnet32_access *a = &lp->a;
-	ulong ioaddr = dev->base_addr;
-	unsigned long flags;
-	int i, regs[4];
+	case ETHTOOL_ID_ON:
+	case ETHTOOL_ID_OFF:
+		/* Blink the led */
+		spin_lock_irqsave(&lp->lock, flags);
+		for (i = 4; i < 8; i++)
+			a->write_bcr(ioaddr, i, a->read_bcr(ioaddr, i) ^ 0x4000);
+		spin_unlock_irqrestore(&lp->lock, flags);
+		break;
 
-	if (!lp->blink_timer.function) {
-		init_timer(&lp->blink_timer);
-		lp->blink_timer.function = (void *)pcnet32_led_blink_callback;
-		lp->blink_timer.data = (unsigned long)dev;
+	case ETHTOOL_ID_INACTIVE:
+		/* Restore the original value of the bcrs */
+		spin_lock_irqsave(&lp->lock, flags);
+		for (i = 4; i < 8; i++)
+			a->write_bcr(ioaddr, i, lp->save_regs[i - 4]);
+		spin_unlock_irqrestore(&lp->lock, flags);
 	}
-
-	/* Save the current value of the bcrs */
-	spin_lock_irqsave(&lp->lock, flags);
-	for (i = 4; i < 8; i++)
-		regs[i - 4] = a->read_bcr(ioaddr, i);
-	spin_unlock_irqrestore(&lp->lock, flags);
-
-	mod_timer(&lp->blink_timer, jiffies);
-	set_current_state(TASK_INTERRUPTIBLE);
-
-	/* AV: the limit here makes no sense whatsoever */
-	if ((!data) || (data > (u32) (MAX_SCHEDULE_TIMEOUT / HZ)))
-		data = (u32) (MAX_SCHEDULE_TIMEOUT / HZ);
-
-	msleep_interruptible(data * 1000);
-	del_timer_sync(&lp->blink_timer);
-
-	/* Restore the original value of the bcrs */
-	spin_lock_irqsave(&lp->lock, flags);
-	for (i = 4; i < 8; i++)
-		a->write_bcr(ioaddr, i, regs[i - 4]);
-	spin_unlock_irqrestore(&lp->lock, flags);
-
 	return 0;
 }
 
@@ -1450,7 +1432,7 @@ static const struct ethtool_ops pcnet32_
 	.set_ringparam		= pcnet32_set_ringparam,
 	.get_strings		= pcnet32_get_strings,
 	.self_test		= pcnet32_ethtool_test,
-	.phys_id		= pcnet32_phys_id,
+	.set_phys_id		= pcnet32_set_phys_id,
 	.get_regs_len		= pcnet32_get_regs_len,
 	.get_regs		= pcnet32_get_regs,
 	.get_sset_count		= pcnet32_get_sset_count,



^ permalink raw reply

* [PATCH 6/8] benet: convert to set_phys_id
From: Stephen Hemminger @ 2011-04-04 21:06 UTC (permalink / raw)
  To: David S. Miller, Ben Hutchings, Sathya Perla, Subbu Seetharaman,
	Ajit 
  Cc: netdev
In-Reply-To: <20110404210634.840793593@linuxplumber.net>

[-- Attachment #1: benet-set-phys.patch --]
[-- Type: text/plain, Size: 2410 bytes --]

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


---
 drivers/net/benet/be.h         |    1 
 drivers/net/benet/be_ethtool.c |   42 ++++++++++++++++++++++-------------------
 2 files changed, 24 insertions(+), 19 deletions(-)

--- a/drivers/net/benet/be.h	2011-04-04 13:27:59.285137429 -0700
+++ b/drivers/net/benet/be.h	2011-04-04 13:31:08.107089776 -0700
@@ -313,6 +313,7 @@ struct be_adapter {
 	char fw_ver[FW_VER_LEN];
 	u32 if_handle;		/* Used to configure filtering */
 	u32 pmac_id;		/* MAC addr handle used by BE card */
+	u32 beacon_state;	/* for set_phys_id */
 
 	bool eeh_err;
 	bool link_up;
--- a/drivers/net/benet/be_ethtool.c	2011-04-04 13:24:55.943254754 -0700
+++ b/drivers/net/benet/be_ethtool.c	2011-04-04 13:32:35.043991789 -0700
@@ -526,29 +526,33 @@ be_set_pauseparam(struct net_device *net
 }
 
 static int
-be_phys_id(struct net_device *netdev, u32 data)
+be_set_phys_id(struct net_device *netdev,
+	       enum ethtool_phys_id_state state)
 {
 	struct be_adapter *adapter = netdev_priv(netdev);
-	int status;
-	u32 cur;
-
-	be_cmd_get_beacon_state(adapter, adapter->hba_port_num, &cur);
-
-	if (cur == BEACON_STATE_ENABLED)
-		return 0;
-
-	if (data < 2)
-		data = 2;
 
-	status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0,
-			BEACON_STATE_ENABLED);
-	set_current_state(TASK_INTERRUPTIBLE);
-	schedule_timeout(data*HZ);
+	switch (state) {
+	case ETHTOOL_ID_ACTIVE:
+		be_cmd_get_beacon_state(adapter, adapter->hba_port_num,
+					&adapter->beacon_state);
+		return -EINVAL;
 
-	status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0,
-			BEACON_STATE_DISABLED);
+	case ETHTOOL_ID_ON:
+		be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0,
+					BEACON_STATE_ENABLED);
+		break;
+
+	case ETHTOOL_ID_OFF:
+		be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0,
+					BEACON_STATE_DISABLED);
+		break;
+
+	case ETHTOOL_ID_INACTIVE:
+		be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0,
+					adapter->beacon_state);
+	}
 
-	return status;
+	return 0;
 }
 
 static bool
@@ -753,7 +757,7 @@ const struct ethtool_ops be_ethtool_ops
 	.get_tso = ethtool_op_get_tso,
 	.set_tso = ethtool_op_set_tso,
 	.get_strings = be_get_stat_strings,
-	.phys_id = be_phys_id,
+	.set_phys_id = be_set_phys_id,
 	.get_sset_count = be_get_sset_count,
 	.get_ethtool_stats = be_get_ethtool_stats,
 	.get_regs_len = be_get_reg_len,



^ permalink raw reply

* [PATCH 8/8] ewrk3: convert to set_phys_id
From: Stephen Hemminger @ 2011-04-04 21:06 UTC (permalink / raw)
  To: David S. Miller, Ben Hutchings; +Cc: netdev
In-Reply-To: <20110404210634.840793593@linuxplumber.net>

[-- Attachment #1: ewrk3-set-phys.patch --]
[-- Type: text/plain, Size: 2472 bytes --]

Keep orginal locking and error handling.

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


--- a/drivers/net/ewrk3.c	2011-04-04 13:41:41.717791151 -0700
+++ b/drivers/net/ewrk3.c	2011-04-04 13:46:55.425138028 -0700
@@ -1604,55 +1604,51 @@ static u32 ewrk3_get_link(struct net_dev
 	return !(cmr & CMR_LINK);
 }
 
-static int ewrk3_phys_id(struct net_device *dev, u32 data)
+static int ewrk3_set_phys_id(struct net_device *dev,
+			     enum ethtool_phys_id_state state)
 {
 	struct ewrk3_private *lp = netdev_priv(dev);
 	unsigned long iobase = dev->base_addr;
 	unsigned long flags;
 	u8 cr;
-	int count;
-
-	/* Toggle LED 4x per second */
-	count = data << 2;
 
 	spin_lock_irqsave(&lp->hw_lock, flags);
 
-	/* Bail if a PHYS_ID is already in progress */
-	if (lp->led_mask == 0) {
-		spin_unlock_irqrestore(&lp->hw_lock, flags);
-		return -EBUSY;
-	}
+	switch (state) {
+	case ETHTOOL_ID_ACTIVE:
+		/* Bail if a PHYS_ID is already in progress */
+		if (lp->led_mask == 0) {
+			spin_unlock_irqrestore(&lp->hw_lock, flags);
+			return -EBUSY;
+		}
 
-	/* Prevent ISR from twiddling the LED */
-	lp->led_mask = 0;
+		/* Prevent ISR from twiddling the LED */
+		lp->led_mask = 0;
+		spin_unlock_irqrestore(&lp->hw_lock, flags);
+		return -EINVAL;
 
-	while (count--) {
+	case ETHTOOL_ID_ON:
+	case ETHTOOL_ID_OFF:
 		/* Toggle the LED */
 		cr = inb(EWRK3_CR);
 		outb(cr ^ CR_LED, EWRK3_CR);
+		break;
 
-		/* Wait a little while */
-		spin_unlock_irqrestore(&lp->hw_lock, flags);
-		msleep(250);
-		spin_lock_irqsave(&lp->hw_lock, flags);
-
-		/* Exit if we got a signal */
-		if (signal_pending(current))
-			break;
+	case ETHTOOL_ID_INACTIVE:
+		lp->led_mask = CR_LED;
+		cr = inb(EWRK3_CR);
+		outb(cr & ~CR_LED, EWRK3_CR);
 	}
-
-	lp->led_mask = CR_LED;
-	cr = inb(EWRK3_CR);
-	outb(cr & ~CR_LED, EWRK3_CR);
 	spin_unlock_irqrestore(&lp->hw_lock, flags);
-	return signal_pending(current) ? -ERESTARTSYS : 0;
+
+	return 0;
 }
 
 static const struct ethtool_ops ethtool_ops_203 = {
 	.get_drvinfo = ewrk3_get_drvinfo,
 	.get_settings = ewrk3_get_settings,
 	.set_settings = ewrk3_set_settings,
-	.phys_id = ewrk3_phys_id,
+	.set_phys_id = ewrk3_set_phys_id,
 };
 
 static const struct ethtool_ops ethtool_ops = {
@@ -1660,7 +1656,7 @@ static const struct ethtool_ops ethtool_
 	.get_settings = ewrk3_get_settings,
 	.set_settings = ewrk3_set_settings,
 	.get_link = ewrk3_get_link,
-	.phys_id = ewrk3_phys_id,
+	.set_phys_id = ewrk3_set_phys_id,
 };
 
 /*



^ permalink raw reply

* [PATCH 4/8] s2io: convert to set_phys_id
From: Stephen Hemminger @ 2011-04-04 21:06 UTC (permalink / raw)
  To: David S. Miller, Ben Hutchings, Jon Mason; +Cc: netdev
In-Reply-To: <20110404210634.840793593@linuxplumber.net>

[-- Attachment #1: s2io-set-phys.patch --]
[-- Type: text/plain, Size: 4664 bytes --]

Convert to new ethtool set physical id model. Remove no longer used
timer, and fix docbook comment.

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


--- a/drivers/net/s2io.c	2011-04-04 12:56:26.680911740 -0700
+++ b/drivers/net/s2io.c	2011-04-04 13:12:34.591276022 -0700
@@ -5484,53 +5484,50 @@ static void s2io_ethtool_gregs(struct ne
 	}
 }
 
-/**
- *  s2io_phy_id  - timer function that alternates adapter LED.
- *  @data : address of the private member of the device structure, which
- *  is a pointer to the s2io_nic structure, provided as an u32.
- * Description: This is actually the timer function that alternates the
- * adapter LED bit of the adapter control bit to set/reset every time on
- * invocation. The timer is set for 1/2 a second, hence tha NIC blinks
- *  once every second.
+/*
+ *  s2io_set_led - control NIC led
  */
-static void s2io_phy_id(unsigned long data)
+static void s2io_set_led(struct s2io_nic *sp, bool on)
 {
-	struct s2io_nic *sp = (struct s2io_nic *)data;
 	struct XENA_dev_config __iomem *bar0 = sp->bar0;
-	u64 val64 = 0;
-	u16 subid;
+	u16 subid = sp->pdev->subsystem_device;
+	u64 val64;
 
-	subid = sp->pdev->subsystem_device;
 	if ((sp->device_type == XFRAME_II_DEVICE) ||
 	    ((subid & 0xFF) >= 0x07)) {
 		val64 = readq(&bar0->gpio_control);
-		val64 ^= GPIO_CTRL_GPIO_0;
+		if (on)
+			val64 |= GPIO_CTRL_GPIO_0;
+		else
+			val64 &= ~GPIO_CTRL_GPIO_0;
+
 		writeq(val64, &bar0->gpio_control);
 	} else {
 		val64 = readq(&bar0->adapter_control);
-		val64 ^= ADAPTER_LED_ON;
+		if (on)
+			val64 |= ADAPTER_LED_ON;
+		else
+			val64 &= ~ADAPTER_LED_ON;
+
 		writeq(val64, &bar0->adapter_control);
 	}
 
-	mod_timer(&sp->id_timer, jiffies + HZ / 2);
 }
 
 /**
- * s2io_ethtool_idnic - To physically identify the nic on the system.
- * @sp : private member of the device structure, which is a pointer to the
- * s2io_nic structure.
- * @id : pointer to the structure with identification parameters given by
- * ethtool.
+ * s2io_ethtool_set_led - To physically identify the nic on the system.
+ * @dev : network device
+ * @state: led setting
+ *
  * Description: Used to physically identify the NIC on the system.
  * The Link LED will blink for a time specified by the user for
  * identification.
  * NOTE: The Link has to be Up to be able to blink the LED. Hence
  * identification is possible only if it's link is up.
- * Return value:
- * int , returns 0 on success
  */
 
-static int s2io_ethtool_idnic(struct net_device *dev, u32 data)
+static int s2io_ethtool_set_led(struct net_device *dev,
+				enum ethtool_phys_id_state state)
 {
 	u64 val64 = 0, last_gpio_ctrl_val;
 	struct s2io_nic *sp = netdev_priv(dev);
@@ -5543,24 +5540,27 @@ static int s2io_ethtool_idnic(struct net
 		val64 = readq(&bar0->adapter_control);
 		if (!(val64 & ADAPTER_CNTL_EN)) {
 			pr_err("Adapter Link down, cannot blink LED\n");
-			return -EFAULT;
+			return -EAGAIN;
 		}
 	}
-	if (sp->id_timer.function == NULL) {
-		init_timer(&sp->id_timer);
-		sp->id_timer.function = s2io_phy_id;
-		sp->id_timer.data = (unsigned long)sp;
-	}
-	mod_timer(&sp->id_timer, jiffies);
-	if (data)
-		msleep_interruptible(data * HZ);
-	else
-		msleep_interruptible(MAX_FLICKER_TIME);
-	del_timer_sync(&sp->id_timer);
 
-	if (CARDS_WITH_FAULTY_LINK_INDICATORS(sp->device_type, subid)) {
-		writeq(last_gpio_ctrl_val, &bar0->gpio_control);
-		last_gpio_ctrl_val = readq(&bar0->gpio_control);
+	switch (state) {
+	case ETHTOOL_ID_ACTIVE:
+		return -EINVAL;
+
+	case ETHTOOL_ID_ON:
+		s2io_set_led(sp, true);
+		break;
+
+	case ETHTOOL_ID_OFF:
+		s2io_set_led(sp, false);
+		break;
+
+	case ETHTOOL_ID_INACTIVE:
+		if (CARDS_WITH_FAULTY_LINK_INDICATORS(sp->device_type, subid)) {
+			writeq(last_gpio_ctrl_val, &bar0->gpio_control);
+			last_gpio_ctrl_val = readq(&bar0->gpio_control);
+		}
 	}
 
 	return 0;
@@ -6776,7 +6776,7 @@ static const struct ethtool_ops netdev_e
 	.set_ufo = ethtool_op_set_ufo,
 	.self_test = s2io_ethtool_test,
 	.get_strings = s2io_ethtool_get_strings,
-	.phys_id = s2io_ethtool_idnic,
+	.set_phys_id = s2io_ethtool_set_led,
 	.get_ethtool_stats = s2io_get_ethtool_stats,
 	.get_sset_count = s2io_get_sset_count,
 };
--- a/drivers/net/s2io.h	2011-04-04 13:05:25.570692566 -0700
+++ b/drivers/net/s2io.h	2011-04-04 13:05:29.762736762 -0700
@@ -893,9 +893,6 @@ struct s2io_nic {
 	u16 all_multi_pos;
 	u16 promisc_flg;
 
-	/*  Id timer, used to blink NIC to physically identify NIC. */
-	struct timer_list id_timer;
-
 	/*  Restart timer, used to restart NIC if the device is stuck and
 	 *  a schedule task that will set the correct Link state once the
 	 *  NIC's PHY has stabilized after a state change.



^ permalink raw reply

* [PATCH 1/8] vxge: convert to set_phys_id
From: Stephen Hemminger @ 2011-04-04 21:06 UTC (permalink / raw)
  To: David S. Miller, Ben Hutchings, Jon Mason; +Cc: netdev
In-Reply-To: <20110404210634.840793593@linuxplumber.net>

[-- Attachment #1: vxge-set-phys-id.patch --]
[-- Type: text/plain, Size: 1784 bytes --]

Also fix up incorrect docbook comment

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


--- a/drivers/net/vxge/vxge-ethtool.c	2011-04-04 11:56:50.004060423 -0700
+++ b/drivers/net/vxge/vxge-ethtool.c	2011-04-04 11:58:47.045259090 -0700
@@ -134,22 +134,29 @@ static void vxge_ethtool_gregs(struct ne
 /**
  * vxge_ethtool_idnic - To physically identify the nic on the system.
  * @dev : device pointer.
- * @id : pointer to the structure with identification parameters given by
- * ethtool.
+ * @state : requested LED state
  *
  * Used to physically identify the NIC on the system.
- * The Link LED will blink for a time specified by the user.
- * Return value:
  * 0 on success
  */
-static int vxge_ethtool_idnic(struct net_device *dev, u32 data)
+static int vxge_ethtool_idnic(struct net_device *dev,
+			      enum ethtool_phys_id_state state)
 {
 	struct vxgedev *vdev = netdev_priv(dev);
 	struct __vxge_hw_device *hldev = vdev->devh;
 
-	vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_ON);
-	msleep_interruptible(data ? (data * HZ) : VXGE_MAX_FLICKER_TIME);
-	vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_OFF);
+	switch (state) {
+	case ETHTOOL_ID_ACTIVE:
+		vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_ON);
+		break;
+
+	case ETHTOOL_ID_INACTIVE:
+		vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_OFF);
+		break;
+
+	default:
+		return -EINVAL;
+	}
 
 	return 0;
 }
@@ -1183,7 +1190,7 @@ static const struct ethtool_ops vxge_eth
 	.get_tso		= ethtool_op_get_tso,
 	.set_tso		= vxge_ethtool_op_set_tso,
 	.get_strings		= vxge_ethtool_get_strings,
-	.phys_id		= vxge_ethtool_idnic,
+	.set_phys_id		= vxge_ethtool_idnic,
 	.get_sset_count		= vxge_ethtool_get_sset_count,
 	.get_ethtool_stats	= vxge_get_ethtool_stats,
 	.set_flags		= vxge_set_flags,



^ permalink raw reply

* [PATCH 5/8] --- drivers/net/niu.c | 33 ++++++++++++++++++--------------- drivers/net/niu.h | 1 + 2 files changed, 19 insertions(+), 15 deletions(-)
From: Stephen Hemminger @ 2011-04-04 21:06 UTC (permalink / raw)
  To: David S. Miller, Ben Hutchings; +Cc: netdev
In-Reply-To: <20110404210634.840793593@linuxplumber.net>

[-- Attachment #1: niu-set-phys.patch --]
[-- Type: text/plain, Size: 1710 bytes --]

--- a/drivers/net/niu.c	2011-04-04 13:15:46.805340164 -0700
+++ b/drivers/net/niu.c	2011-04-04 13:19:17.551610508 -0700
@@ -7888,28 +7888,31 @@ static void niu_force_led(struct niu *np
 	nw64_mac(reg, val);
 }
 
-static int niu_phys_id(struct net_device *dev, u32 data)
+static int niu_set_phys_id(struct net_device *dev,
+			   enum ethtool_phys_id_state state)
+
 {
 	struct niu *np = netdev_priv(dev);
-	u64 orig_led_state;
-	int i;
 
 	if (!netif_running(dev))
 		return -EAGAIN;
 
-	if (data == 0)
-		data = 2;
-
-	orig_led_state = niu_led_state_save(np);
-	for (i = 0; i < (data * 2); i++) {
-		int on = ((i % 2) == 0);
-
-		niu_force_led(np, on);
+	switch (state) {
+	case ETHTOOL_ID_ACTIVE:
+		np->orig_led_state = niu_led_state_save(np);
+		return -EINVAL;
+
+	case ETHTOOL_ID_ON:
+		niu_force_led(np, 1);
+		break;
+
+	case ETHTOOL_ID_OFF:
+		niu_force_led(np, 0);
+		break;
 
-		if (msleep_interruptible(500))
-			break;
+	case ETHTOOL_ID_INACTIVE:
+		niu_led_state_restore(np, np->orig_led_state);
 	}
-	niu_led_state_restore(np, orig_led_state);
 
 	return 0;
 }
@@ -7932,7 +7935,7 @@ static const struct ethtool_ops niu_etht
 	.get_strings		= niu_get_strings,
 	.get_sset_count		= niu_get_sset_count,
 	.get_ethtool_stats	= niu_get_ethtool_stats,
-	.phys_id		= niu_phys_id,
+	.set_phys_id		= niu_set_phys_id,
 	.get_rxnfc		= niu_get_nfc,
 	.set_rxnfc		= niu_set_nfc,
 	.set_flags		= niu_set_flags,
--- a/drivers/net/niu.h	2011-04-04 13:16:37.445885085 -0700
+++ b/drivers/net/niu.h	2011-04-04 13:17:27.034418897 -0700
@@ -3279,6 +3279,7 @@ struct niu {
 	unsigned long			xpcs_off;
 
 	struct timer_list		timer;
+	u64				orig_led_state;
 	const struct niu_phy_ops	*phy_ops;
 	int				phy_addr;
 



^ permalink raw reply

* [PATCH 3/8] bnx2x: convert to set_phys_id
From: Stephen Hemminger @ 2011-04-04 21:06 UTC (permalink / raw)
  To: David S. Miller, Ben Hutchings, Eilon Greenstein; +Cc: netdev
In-Reply-To: <20110404210634.840793593@linuxplumber.net>

[-- Attachment #1: bnx2x-set-phys.patch --]
[-- Type: text/plain, Size: 2138 bytes --]

Also cleanup error codes to no lie about things that driver doesn't
support. If device is down report -EAGAIN (same as Broadcom), and 
if port doesn't blink then error as well.

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


--- a/drivers/net/bnx2x/bnx2x_ethtool.c	2011-04-04 12:54:28.927607342 -0700
+++ b/drivers/net/bnx2x/bnx2x_ethtool.c	2011-04-04 12:55:43.108429058 -0700
@@ -2097,36 +2097,38 @@ static void bnx2x_get_ethtool_stats(stru
 	}
 }
 
-static int bnx2x_phys_id(struct net_device *dev, u32 data)
+static int bnx2x_set_phys_id(struct net_device *dev,
+			     enum ethtool_phys_id_state state)
 {
 	struct bnx2x *bp = netdev_priv(dev);
-	int i;
 
 	if (!netif_running(dev))
-		return 0;
+		return -EAGAIN;
 
 	if (!bp->port.pmf)
-		return 0;
+		return -EOPNOTSUPP;
 
-	if (data == 0)
-		data = 2;
+	switch (state) {
+	case ETHTOOL_ID_ACTIVE:
+		return -EINVAL;
 
-	for (i = 0; i < (data * 2); i++) {
-		if ((i % 2) == 0)
-			bnx2x_set_led(&bp->link_params, &bp->link_vars,
-				      LED_MODE_OPER, SPEED_1000);
-		else
-			bnx2x_set_led(&bp->link_params, &bp->link_vars,
-				      LED_MODE_OFF, 0);
+	case ETHTOOL_ID_ON:
+		bnx2x_set_led(&bp->link_params, &bp->link_vars,
+			      LED_MODE_OPER, SPEED_1000);
+		break;
+
+	case ETHTOOL_ID_OFF:
+		bnx2x_set_led(&bp->link_params, &bp->link_vars,
+			      LED_MODE_OFF, 0);
 
-		msleep_interruptible(500);
-		if (signal_pending(current))
-			break;
-	}
+		break;
 
-	if (bp->link_vars.link_up)
-		bnx2x_set_led(&bp->link_params, &bp->link_vars, LED_MODE_OPER,
-			      bp->link_vars.line_speed);
+	case ETHTOOL_ID_INACTIVE:
+		if (bp->link_vars.link_up)
+			bnx2x_set_led(&bp->link_params, &bp->link_vars,
+				      LED_MODE_OPER,
+				      bp->link_vars.line_speed);
+	}
 
 	return 0;
 }
@@ -2218,7 +2220,7 @@ static const struct ethtool_ops bnx2x_et
 	.self_test		= bnx2x_self_test,
 	.get_sset_count		= bnx2x_get_sset_count,
 	.get_strings		= bnx2x_get_strings,
-	.phys_id		= bnx2x_phys_id,
+	.set_phys_id		= bnx2x_set_phys_id,
 	.get_ethtool_stats	= bnx2x_get_ethtool_stats,
 	.get_rxnfc		= bnx2x_get_rxnfc,
 	.get_rxfh_indir		= bnx2x_get_rxfh_indir,



^ permalink raw reply

* [PATCH 2/8] bnx2: convert to set_phys_id
From: Stephen Hemminger @ 2011-04-04 21:06 UTC (permalink / raw)
  To: David S. Miller, Ben Hutchings, Michael Chan; +Cc: netdev
In-Reply-To: <20110404210634.840793593@linuxplumber.net>

[-- Attachment #1: bnx2-set-phys.patch --]
[-- Type: text/plain, Size: 2840 bytes --]

In this case, need to add element to device private to hold
original led state.

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

---
 drivers/net/bnx2.c |   58 +++++++++++++++++++++++++----------------------------
 drivers/net/bnx2.h |    1 
 2 files changed, 29 insertions(+), 30 deletions(-)

--- a/drivers/net/bnx2.c	2011-04-04 12:00:28.358308398 -0700
+++ b/drivers/net/bnx2.c	2011-04-04 12:05:33.909298263 -0700
@@ -7495,41 +7495,39 @@ bnx2_get_ethtool_stats(struct net_device
 }
 
 static int
-bnx2_phys_id(struct net_device *dev, u32 data)
+bnx2_set_phys_id(struct net_device *dev, enum ethtool_phys_id_state state)
 {
 	struct bnx2 *bp = netdev_priv(dev);
-	int i;
-	u32 save;
 
-	bnx2_set_power_state(bp, PCI_D0);
+	switch (state) {
+	case ETHTOOL_ID_ACTIVE:
+		bnx2_set_power_state(bp, PCI_D0);
 
-	if (data == 0)
-		data = 2;
+		bp->leds_save = REG_RD(bp, BNX2_MISC_CFG);
+		REG_WR(bp, BNX2_MISC_CFG, BNX2_MISC_CFG_LEDMODE_MAC);
+		return -EINVAL;
 
-	save = REG_RD(bp, BNX2_MISC_CFG);
-	REG_WR(bp, BNX2_MISC_CFG, BNX2_MISC_CFG_LEDMODE_MAC);
-
-	for (i = 0; i < (data * 2); i++) {
-		if ((i % 2) == 0) {
-			REG_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE);
-		}
-		else {
-			REG_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE |
-				BNX2_EMAC_LED_1000MB_OVERRIDE |
-				BNX2_EMAC_LED_100MB_OVERRIDE |
-				BNX2_EMAC_LED_10MB_OVERRIDE |
-				BNX2_EMAC_LED_TRAFFIC_OVERRIDE |
-				BNX2_EMAC_LED_TRAFFIC);
-		}
-		msleep_interruptible(500);
-		if (signal_pending(current))
-			break;
+	case ETHTOOL_ID_ON:
+		REG_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE |
+		       BNX2_EMAC_LED_1000MB_OVERRIDE |
+		       BNX2_EMAC_LED_100MB_OVERRIDE |
+		       BNX2_EMAC_LED_10MB_OVERRIDE |
+		       BNX2_EMAC_LED_TRAFFIC_OVERRIDE |
+		       BNX2_EMAC_LED_TRAFFIC);
+		break;
+
+	case ETHTOOL_ID_OFF:
+		REG_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE);
+		break;
+
+	case ETHTOOL_ID_INACTIVE:
+		REG_WR(bp, BNX2_EMAC_LED, 0);
+		REG_WR(bp, BNX2_MISC_CFG, bp->leds_save);
+
+		if (!netif_running(dev))
+			bnx2_set_power_state(bp, PCI_D3hot);
+		break;
 	}
-	REG_WR(bp, BNX2_EMAC_LED, 0);
-	REG_WR(bp, BNX2_MISC_CFG, save);
-
-	if (!netif_running(dev))
-		bnx2_set_power_state(bp, PCI_D3hot);
 
 	return 0;
 }
@@ -7602,7 +7600,7 @@ static const struct ethtool_ops bnx2_eth
 	.set_tso		= bnx2_set_tso,
 	.self_test		= bnx2_self_test,
 	.get_strings		= bnx2_get_strings,
-	.phys_id		= bnx2_phys_id,
+	.set_phys_id		= bnx2_set_phys_id,
 	.get_ethtool_stats	= bnx2_get_ethtool_stats,
 	.get_sset_count		= bnx2_get_sset_count,
 	.set_flags		= bnx2_set_flags,
--- a/drivers/net/bnx2.h	2011-04-04 12:03:55.332429815 -0700
+++ b/drivers/net/bnx2.h	2011-04-04 12:04:59.388992279 -0700
@@ -6922,6 +6922,7 @@ struct bnx2 {
 	u8			num_tx_rings;
 	u8			num_rx_rings;
 
+	u32 			leds_save;
 	u32			idle_chk_status_idx;
 
 #ifdef BCM_CNIC



^ permalink raw reply

* [PATCH 0/8] Convert even more drivers to set_phys_id
From: Stephen Hemminger @ 2011-04-04 21:06 UTC (permalink / raw)
  To: David S. Miller, Ben Hutchings; +Cc: netdev

This converts most drivers to the new set_phys_id ethtool ops.
The three remaining drivers do things that are harder to convert since
they all use a mailbox model. These should all compile, but not
tested.



^ permalink raw reply

* RE: [PATCH net-next-2.6 07/12] igbvf: remove bogus phys_id
From: Rose, Gregory V @ 2011-04-04 21:27 UTC (permalink / raw)
  To: Stephen Hemminger, David S. Miller, Ben Hutchings,
	Kirsher, Jeffrey T, "Br
  Cc: netdev@vger.kernel.org
In-Reply-To: <20110404184501.915865252@linuxplumber.net>

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> On Behalf Of Stephen Hemminger
> Sent: Monday, April 04, 2011 11:44 AM
> To: David S. Miller; Ben Hutchings; Kirsher, Jeffrey T; Brandeburg, Jesse;
> Allan, Bruce W; Wyborny, Carolyn; Skidmore, Donald C; Ronciak, John
> Cc: netdev@vger.kernel.org
> Subject: [PATCH net-next-2.6 07/12] igbvf: remove bogus phys_id
> 
> This device lies about supporting phys_id. Remove it and just
> let the upper layer report not supported.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> --- a/drivers/net/igbvf/ethtool.c	2011-04-04 11:15:50.477019338 -0700
> +++ b/drivers/net/igbvf/ethtool.c	2011-04-04 11:16:12.661202774 -0700
> @@ -391,11 +391,6 @@ static int igbvf_set_wol(struct net_devi
>  	return -EOPNOTSUPP;
>  }
> 
> -static int igbvf_phys_id(struct net_device *netdev, u32 data)
> -{
> -	return 0;
> -}
> -
>  static int igbvf_get_coalesce(struct net_device *netdev,
>                                struct ethtool_coalesce *ec)
>  {
> @@ -527,7 +522,6 @@ static const struct ethtool_ops igbvf_et
>  	.self_test		= igbvf_diag_test,
>  	.get_sset_count		= igbvf_get_sset_count,
>  	.get_strings		= igbvf_get_strings,
> -	.phys_id		= igbvf_phys_id,
>  	.get_ethtool_stats	= igbvf_get_ethtool_stats,
>  	.get_coalesce		= igbvf_get_coalesce,
>  	.set_coalesce		= igbvf_set_coalesce,

I would just like to note that many virtual devices lie about their underlying capabilities.  Many systems report having an Realtek adapter when in fact they don't.  I'm agnostic about this change but at one time I had an internal bug report because my VF driver *didn't* report phys_id.  I'll keep this email around if my tester writes up a big for me.

Regards,

- Greg


^ permalink raw reply

* Re: shutdown oops in xt_compat_calc_jump
From: dann frazier @ 2011-04-04 21:17 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Patrick McHardy, netdev, netfilter-devel@vger.kernel.org
In-Reply-To: <1301949477.3021.55.camel@edumazet-laptop>

On Mon, Apr 04, 2011 at 10:37:57PM +0200, Eric Dumazet wrote:
> Le lundi 04 avril 2011 à 22:02 +0200, Patrick McHardy a écrit :
> > CCed netfilter-devel.
> > 
> > Am 04.04.2011 21:48, schrieb dann frazier:
> > > fyi, noticed this oops when shutting down a system running top of git
> > > (@ 78fca1be)
> > > 
> > > [ 1169.794644] cfg80211: Calling CRDA to update world regulatory domain
> > > [ 1170.490646] bluetoothd[2029]: segfault at f8ad9944 ip 00000000f77045e0 sp 00000000ffcb14e0 error 4 in bluetoothd[f76bf000+8b000]
> > > [ 1170.543817] BUG: unable to handle kernel paging request at 00000001dc1be9f8
> > > [ 1170.543875] IP: [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
> > > [ 1170.543927] PGD 1215b3067 PUD 0 
> > > [ 1170.543955] Oops: 0000 [#1] SMP 
> > > [ 1170.543982] last sysfs file: /sys/module/bridge/initstate
> > > [ 1170.544017] CPU 3 
> > > [ 1170.544031] Modules linked in: ebtable_broute ebtable_filter vfat msdos fat ext3 jbd ip6table_filter ip6_tables ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc acpi_cpufreq mperf cpufreq_powersave cpufreq_userspace cpufreq_conservative cpufreq_stats binfmt_misc kvm(-) fuse ext2 loop snd_hda_codec_hdmi snd_hda_codec_conexant arc4 ecb snd_usb_audio snd_usbmidi_lib snd_seq_midi snd_seq_midi_event snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_rawmidi i915 drm_kms_helper thinkpad_acpi snd_seq iwlagn snd_timer snd_seq_device drm snd mac80211 psmouse btusb serio_raw bluetooth evdev tpm_tis snd_page_alloc tpm i2c_i801 i2c_algo_bit cfg80211 battery soundcore nvram tpm_bios i2c_core rfkill wmi ac power_supply video button processor ext4 mbcache jbd2 crc16 sha256_generic aesni_intel cryptd aes_x86_64 aes_generic cbc dm_crypt dm_mod sd_mod crc_t10
>  di
> > f 
> > >  usbhid
> > > hid usb_storage ahci libahci libata ehci_hcd scsi_mod usbcore e1000e thermal thermal_sys [last unloaded: kvm_intel]
> > > [ 1170.544836] 
> > > [ 1170.544849] Pid: 4901, comm: ebtables Not tainted 2.6.39-rc1+ #9 LENOVO 2516CTO/2516CTO
> > > [ 1170.544902] RIP: 0010:[<ffffffffa051e7b0>]  [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
> > > [ 1170.544958] RSP: 0018:ffff880121473cf8  EFLAGS: 00010217
> > > [ 1170.544989] RAX: 000000003b837d3f RBX: 0000000000000090 RCX: 000000007706fa7f
> > > [ 1170.545029] RDX: 0000000000000000 RSI: 0000000000000090 RDI: 000000003b837d3f
> > > [ 1170.545067] RBP: ffffc900111a3000 R08: 0000000000000000 R09: dead000000200200
> > > [ 1170.545104] R10: dead000000100100 R11: 0000000000001311 R12: ffff880121473d88
> > > [ 1170.545147] R13: ffffc900111a6000 R14: ffffffff817de300 R15: 0000000000000000
> > > [ 1170.545185] FS:  0000000000000000(0000) GS:ffff880137d80000(0063) knlGS:00000000f761b6c0
> > > [ 1170.545227] CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
> > > [ 1170.545258] CR2: 00000001dc1be9f8 CR3: 0000000125868000 CR4: 00000000000006e0
> > > [ 1170.545297] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > > [ 1170.545334] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> > > [ 1170.545375] Process ebtables (pid: 4901, threadinfo ffff880121472000, task ffff8801322d1ac0)
> > > [ 1170.545418] Stack:
> > > [ 1170.545433]  0000000000000090 ffffffffa0576d46 f7007265746c6966 0000000000000054
> > > [ 1170.545479]  0000000000000000 0000000000000000 000000000000000e 0000000000000090
> > > [ 1170.545529]  0000000000000000 0000000008af2180 0000000008af21b0 0000000008af21e0
> > > [ 1170.545579] Call Trace:
> > > [ 1170.545600]  [<ffffffffa0576d46>] ? compat_do_replace+0x117/0x221 [ebtables]
> > > [ 1170.545639]  [<ffffffffa0577392>] ? compat_do_ebt_set_ctl+0x55/0xbb [ebtables]
> > > [ 1170.545688]  [<ffffffff810337e3>] ? need_resched+0x1a/0x23
> > > [ 1170.545723]  [<ffffffff810337f1>] ? should_resched+0x5/0x24
> > > [ 1170.545730]  [<ffffffff81314cc5>] ? _cond_resched+0x9/0x20
> > > [ 1170.545733]  [<ffffffff813152fe>] ? mutex_lock_interruptible+0x18/0x32
> > > [ 1170.545738]  [<ffffffff8128490b>] ? nf_sockopt_find.clone.1+0xda/0xec
> > > [ 1170.545742]  [<ffffffff81284996>] ? compat_nf_sockopt+0x79/0xa5
> > > [ 1170.545744]  [<ffffffff810337f1>] ? should_resched+0x5/0x24
> > > [ 1170.545747]  [<ffffffff812849f3>] ? compat_nf_setsockopt+0x1a/0x1f
> > > [ 1170.545751]  [<ffffffff8128fb35>] ? compat_ip_setsockopt+0x80/0xa0
> > > [ 1170.545756]  [<ffffffff812784a2>] ? compat_sys_setsockopt+0x1d5/0x204
> > > [ 1170.545759]  [<ffffffff810337f1>] ? should_resched+0x5/0x24
> > > [ 1170.545761]  [<ffffffff81314cc5>] ? _cond_resched+0x9/0x20
> > > [ 1170.545764]  [<ffffffff812788a5>] ? compat_sys_socketcall+0x148/0x1a7
> > > [ 1170.545768]  [<ffffffff8131d2c0>] ? sysenter_dispatch+0x7/0x2e
> > > [ 1170.545769] Code: 5d 41 5e 41 5f c3 40 0f b6 ff 53 31 d2 48 6b ff 70 48 03 3d 03 1b 00 00 8b 4f 6c 4c 8b 47 60 ff c9 eb 27 8d 04 11 d1 f8 48 63 f8 
> > > [ 1170.545787] RIP  [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
> > > [ 1170.545792]  RSP <ffff880121473cf8>
> > > [ 1170.545794] CR2: 00000001dc1be9f8
> > > [ 1170.654269] ---[ end trace d44667d90dcbd115 ]---
> > > [ 1170.662411] fuse exit
> > > Kernel logging (proc) stopped.
> > > --
> 
> 
> Hmm, commit 255d0dc34068a976550ce555e must have a problem for ebtables ?
> 
> Dann, could you give us what you do with ebtables ?

I don't do anything explicitly with ebtables, I just happen to have it
installed. The only place I know of that calls ebtables on shutdown is
the ebtables initscript itself:

dannf@fluid:~$ sudo rm /tmp/ebtables.log 
dannf@fluid:~$ cat /sbin/ebtables
#!/bin/sh

echo "$*" >> /tmp/ebtables.log

/sbin/ebtables.real $*
dannf@fluid:~$ sudo /etc/init.d/ebtables stop
Clearing ebtables rulesets: filter nat broute done.
dannf@fluid:~$ sudo cat /tmp/ebtables.log 
-t filter -L
-t filter -L
-t nat -L
-t broute -L
-t filter --init-table
-t nat --init-table
-t broute --init-table

^ permalink raw reply

* Re: [patch net-next-2.6] net: vlan: make non-hw-accel rx path similar to hw-accel
From: Nicolas de Pesloüan @ 2011-04-04 21:04 UTC (permalink / raw)
  To: Jesse Gross
  Cc: Eric W. Biederman, Jiri Pirko, netdev, davem, shemminger, kaber,
	fubar, eric.dumazet, andy, xiaosuo
In-Reply-To: <BANLkTikpUTSxeHo-DA+=Ta7A7C95_+Kfdg@mail.gmail.com>

Le 04/04/2011 22:50, Jesse Gross a écrit :
> On Mon, Apr 4, 2011 at 1:47 PM, Nicolas de Pesloüan
> <nicolas.2p.debian@gmail.com>  wrote:
>> Can someone clarify whether hwaccel capable NIC will always untag tagged
>> frames or will only do so if requested at device setup?
>
> It can be changed on the fly by ethtool, similar to other forms of offloading.

Thanks Jesse.

So if hwaccell vlan untagging is disabled, what is the current behavior? Is the frame delivered 
untouched (tagged) to ptype_all handlers if no particular vlan device is setup on the parent device?

With Jiri's patch, it would be always untagged, whatever requested by ethtool.

Am I right?

	Nicolas.


^ permalink raw reply

* Re: [PATCH net-next-2.6 00/12] Convert more drivers to ethtool set_phys_id
From: Stephen Hemminger @ 2011-04-04 20:52 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: David S. Miller, Ben Hutchings, netdev@vger.kernel.org
In-Reply-To: <1301949164.3842.1.camel@jtkirshe-MOBL1>

On Mon, 04 Apr 2011 13:32:44 -0700
Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:

> On Mon, 2011-04-04 at 13:14 -0700, Stephen Hemminger wrote:
> > On Mon, 4 Apr 2011 12:53:14 -0700
> > Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
> > 
> > > On Mon, Apr 4, 2011 at 11:43, Stephen Hemminger <shemminger@vyatta.com> wrote:
> > > > Did a bunch of the easy drivers to convert.
> > > >
> > > >
> > > 
> > > I have added patches 3-9 (Intel driver conversions) to my queue of
> > > patches.  Thanks Stephen.
> > 
> > I changed the behaviour of igbvf for 'ethtool -p' to return not supported.
> > This seems correct, but it may break somebody who has some weird script running
> > in a virt environment.
> 
> I also noticed you did not convert ixgbevf, so we will take a look at
> your changes for igbvf and come up with a patch for ixgbevf.

ixgbevf has no hook for phys_id and therefore no change is needed.

^ permalink raw reply

* Re: [patch net-next-2.6] net: vlan: make non-hw-accel rx path similar to hw-accel
From: Nicolas de Pesloüan @ 2011-04-04 20:51 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: Jesse Gross, netdev, davem, shemminger, kaber, fubar,
	eric.dumazet, andy, xiaosuo, Eric W. Biederman
In-Reply-To: <20110404203002.GB3657@psychotron.redhat.com>

Le 04/04/2011 22:30, Jiri Pirko a écrit :
> Mon, Apr 04, 2011 at 09:00:00PM CEST, nicolas.2p.debian@gmail.com wrote:
>> Le 04/04/2011 09:14, Jiri Pirko a écrit :
<snip>
>> So you want to move vlan_do_receive into an rx_handler, but want
>> untagging to stay hard-coded at the beginning of __netif_receive_skb.
>> I don't think I understand the rational behind that.
>
> vlan_hwaccel_do_receive/vlan_do_receive could be converted to
> rx_handler, not untagging.

Why do you consider untagging cannot be converted to rx_handler?

^ permalink raw reply

* Re: [patch net-next-2.6] net: vlan: make non-hw-accel rx path similar to hw-accel
From: Jesse Gross @ 2011-04-04 20:50 UTC (permalink / raw)
  To: Nicolas de Pesloüan
  Cc: Eric W. Biederman, Jiri Pirko, netdev, davem, shemminger, kaber,
	fubar, eric.dumazet, andy, xiaosuo
In-Reply-To: <4D9A2E74.70105@gmail.com>

On Mon, Apr 4, 2011 at 1:47 PM, Nicolas de Pesloüan
<nicolas.2p.debian@gmail.com> wrote:
> Can someone clarify whether hwaccel capable NIC will always untag tagged
> frames or will only do so if requested at device setup?

It can be changed on the fly by ethtool, similar to other forms of offloading.

^ permalink raw reply

* Re: [patch net-next-2.6] net: vlan: make non-hw-accel rx path similar to hw-accel
From: Nicolas de Pesloüan @ 2011-04-04 20:47 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Jiri Pirko, Jesse Gross, netdev, davem, shemminger, kaber, fubar,
	eric.dumazet, andy, xiaosuo
In-Reply-To: <m1d3l1eqw8.fsf@fess.ebiederm.org>

Le 04/04/2011 21:51, Eric W. Biederman a écrit :

>
> __netif_receive_skb is actually late for untagging.  eth_type_trans
> would be better but not path of control into __netif_receive_skb
> actually calls eth_type_trans.

Because vlan may nest, we need to keep some sort of frame untagging inside __netif_receive_skb.

In order to avoid duplicate code, I suggest to manage the first level untagging (for non hwaccel) 
the same way we manage other levels of untagging (which are by design non hwaccell).

Hence my proposal to use a rx_handler on the parent device of the vlan device, if we know the parent 
device lack hwaccel vlan handling.

So, instead of trying to mimic the hwaccel path in software, I suggest to simply disable software 
untagging when we know hwaccel untagging is present, by removing (or not installing) the vlan 
rx_handler from the hwaccel net_device.

Can someone clarify whether hwaccel capable NIC will always untag tagged frames or will only do so 
if requested at device setup?

	Nicolas.

^ permalink raw reply

* Re: shutdown oops in xt_compat_calc_jump
From: Eric Dumazet @ 2011-04-04 20:37 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: dann frazier, netdev, netfilter-devel@vger.kernel.org
In-Reply-To: <4D9A23BC.4010505@trash.net>

Le lundi 04 avril 2011 à 22:02 +0200, Patrick McHardy a écrit :
> CCed netfilter-devel.
> 
> Am 04.04.2011 21:48, schrieb dann frazier:
> > fyi, noticed this oops when shutting down a system running top of git
> > (@ 78fca1be)
> > 
> > [ 1169.794644] cfg80211: Calling CRDA to update world regulatory domain
> > [ 1170.490646] bluetoothd[2029]: segfault at f8ad9944 ip 00000000f77045e0 sp 00000000ffcb14e0 error 4 in bluetoothd[f76bf000+8b000]
> > [ 1170.543817] BUG: unable to handle kernel paging request at 00000001dc1be9f8
> > [ 1170.543875] IP: [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
> > [ 1170.543927] PGD 1215b3067 PUD 0 
> > [ 1170.543955] Oops: 0000 [#1] SMP 
> > [ 1170.543982] last sysfs file: /sys/module/bridge/initstate
> > [ 1170.544017] CPU 3 
> > [ 1170.544031] Modules linked in: ebtable_broute ebtable_filter vfat msdos fat ext3 jbd ip6table_filter ip6_tables ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc acpi_cpufreq mperf cpufreq_powersave cpufreq_userspace cpufreq_conservative cpufreq_stats binfmt_misc kvm(-) fuse ext2 loop snd_hda_codec_hdmi snd_hda_codec_conexant arc4 ecb snd_usb_audio snd_usbmidi_lib snd_seq_midi snd_seq_midi_event snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_rawmidi i915 drm_kms_helper thinkpad_acpi snd_seq iwlagn snd_timer snd_seq_device drm snd mac80211 psmouse btusb serio_raw bluetooth evdev tpm_tis snd_page_alloc tpm i2c_i801 i2c_algo_bit cfg80211 battery soundcore nvram tpm_bios i2c_core rfkill wmi ac power_supply video button processor ext4 mbcache jbd2 crc16 sha256_generic aesni_intel cryptd aes_x86_64 aes_generic cbc dm_crypt dm_mod sd_mod crc_t10di
> f 
> >  usbhid
> > hid usb_storage ahci libahci libata ehci_hcd scsi_mod usbcore e1000e thermal thermal_sys [last unloaded: kvm_intel]
> > [ 1170.544836] 
> > [ 1170.544849] Pid: 4901, comm: ebtables Not tainted 2.6.39-rc1+ #9 LENOVO 2516CTO/2516CTO
> > [ 1170.544902] RIP: 0010:[<ffffffffa051e7b0>]  [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
> > [ 1170.544958] RSP: 0018:ffff880121473cf8  EFLAGS: 00010217
> > [ 1170.544989] RAX: 000000003b837d3f RBX: 0000000000000090 RCX: 000000007706fa7f
> > [ 1170.545029] RDX: 0000000000000000 RSI: 0000000000000090 RDI: 000000003b837d3f
> > [ 1170.545067] RBP: ffffc900111a3000 R08: 0000000000000000 R09: dead000000200200
> > [ 1170.545104] R10: dead000000100100 R11: 0000000000001311 R12: ffff880121473d88
> > [ 1170.545147] R13: ffffc900111a6000 R14: ffffffff817de300 R15: 0000000000000000
> > [ 1170.545185] FS:  0000000000000000(0000) GS:ffff880137d80000(0063) knlGS:00000000f761b6c0
> > [ 1170.545227] CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
> > [ 1170.545258] CR2: 00000001dc1be9f8 CR3: 0000000125868000 CR4: 00000000000006e0
> > [ 1170.545297] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > [ 1170.545334] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> > [ 1170.545375] Process ebtables (pid: 4901, threadinfo ffff880121472000, task ffff8801322d1ac0)
> > [ 1170.545418] Stack:
> > [ 1170.545433]  0000000000000090 ffffffffa0576d46 f7007265746c6966 0000000000000054
> > [ 1170.545479]  0000000000000000 0000000000000000 000000000000000e 0000000000000090
> > [ 1170.545529]  0000000000000000 0000000008af2180 0000000008af21b0 0000000008af21e0
> > [ 1170.545579] Call Trace:
> > [ 1170.545600]  [<ffffffffa0576d46>] ? compat_do_replace+0x117/0x221 [ebtables]
> > [ 1170.545639]  [<ffffffffa0577392>] ? compat_do_ebt_set_ctl+0x55/0xbb [ebtables]
> > [ 1170.545688]  [<ffffffff810337e3>] ? need_resched+0x1a/0x23
> > [ 1170.545723]  [<ffffffff810337f1>] ? should_resched+0x5/0x24
> > [ 1170.545730]  [<ffffffff81314cc5>] ? _cond_resched+0x9/0x20
> > [ 1170.545733]  [<ffffffff813152fe>] ? mutex_lock_interruptible+0x18/0x32
> > [ 1170.545738]  [<ffffffff8128490b>] ? nf_sockopt_find.clone.1+0xda/0xec
> > [ 1170.545742]  [<ffffffff81284996>] ? compat_nf_sockopt+0x79/0xa5
> > [ 1170.545744]  [<ffffffff810337f1>] ? should_resched+0x5/0x24
> > [ 1170.545747]  [<ffffffff812849f3>] ? compat_nf_setsockopt+0x1a/0x1f
> > [ 1170.545751]  [<ffffffff8128fb35>] ? compat_ip_setsockopt+0x80/0xa0
> > [ 1170.545756]  [<ffffffff812784a2>] ? compat_sys_setsockopt+0x1d5/0x204
> > [ 1170.545759]  [<ffffffff810337f1>] ? should_resched+0x5/0x24
> > [ 1170.545761]  [<ffffffff81314cc5>] ? _cond_resched+0x9/0x20
> > [ 1170.545764]  [<ffffffff812788a5>] ? compat_sys_socketcall+0x148/0x1a7
> > [ 1170.545768]  [<ffffffff8131d2c0>] ? sysenter_dispatch+0x7/0x2e
> > [ 1170.545769] Code: 5d 41 5e 41 5f c3 40 0f b6 ff 53 31 d2 48 6b ff 70 48 03 3d 03 1b 00 00 8b 4f 6c 4c 8b 47 60 ff c9 eb 27 8d 04 11 d1 f8 48 63 f8 
> > [ 1170.545787] RIP  [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
> > [ 1170.545792]  RSP <ffff880121473cf8>
> > [ 1170.545794] CR2: 00000001dc1be9f8
> > [ 1170.654269] ---[ end trace d44667d90dcbd115 ]---
> > [ 1170.662411] fuse exit
> > Kernel logging (proc) stopped.
> > --


Hmm, commit 255d0dc34068a976550ce555e must have a problem for ebtables ?

Dann, could you give us what you do with ebtables ?

Thanks



^ permalink raw reply

* Re: [PATCH net-next-2.6 00/12] Convert more drivers to ethtool set_phys_id
From: Jeff Kirsher @ 2011-04-04 20:35 UTC (permalink / raw)
  To: David Miller
  Cc: shemminger@vyatta.com, bhutchings@solarflare.com,
	netdev@vger.kernel.org
In-Reply-To: <20110404.130624.63023544.davem@davemloft.net>

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

On Mon, 2011-04-04 at 13:06 -0700, David Miller wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Mon, 4 Apr 2011 12:53:14 -0700
> 
> > On Mon, Apr 4, 2011 at 11:43, Stephen Hemminger <shemminger@vyatta.com> wrote:
> >> Did a bunch of the easy drivers to convert.
> >>
> >>
> > 
> > I have added patches 3-9 (Intel driver conversions) to my queue of
> > patches.  Thanks Stephen.
> 
> Careful, Ben's commit to add the interface still isn't in the tree.
> 
> He needs to respin his patch set based upon feedback that came in
> the other day.

Yeah, I caught that.  I will be adding the dependent patches to my
internal tree for validation purposes only.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [PATCH net-next-2.6 00/12] Convert more drivers to ethtool set_phys_id
From: Jeff Kirsher @ 2011-04-04 20:32 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, Ben Hutchings, netdev@vger.kernel.org
In-Reply-To: <20110404131459.793f67fc@nehalam>

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

On Mon, 2011-04-04 at 13:14 -0700, Stephen Hemminger wrote:
> On Mon, 4 Apr 2011 12:53:14 -0700
> Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
> 
> > On Mon, Apr 4, 2011 at 11:43, Stephen Hemminger <shemminger@vyatta.com> wrote:
> > > Did a bunch of the easy drivers to convert.
> > >
> > >
> > 
> > I have added patches 3-9 (Intel driver conversions) to my queue of
> > patches.  Thanks Stephen.
> 
> I changed the behaviour of igbvf for 'ethtool -p' to return not supported.
> This seems correct, but it may break somebody who has some weird script running
> in a virt environment.

I also noticed you did not convert ixgbevf, so we will take a look at
your changes for igbvf and come up with a patch for ixgbevf.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox