Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 2/3] workqueue: Add an API to create a singlethread workqueue attached to the current task's cgroup
From: Michael S. Tsirkin @ 2010-05-28 15:08 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Oleg Nesterov, Sridhar Samudrala, netdev, lkml,
	kvm@vger.kernel.org, Andrew Morton, Dmitri Vorobiev, Jiri Kosina,
	Thomas Gleixner, Ingo Molnar, Andi Kleen
In-Reply-To: <4BFEE216.2070807@kernel.org>

On Thu, May 27, 2010 at 11:20:22PM +0200, Tejun Heo wrote:
> Hello, Michael.
> 
> On 05/27/2010 07:32 PM, Michael S. Tsirkin wrote:
> > Well, this is why I proposed adding a new API for creating
> > workqueue within workqueue.c, rather than exposing the task
> > and attaching it to cgroups in our driver: so that workqueue
> > maintainers can fix the implementation if it ever changes.
> > 
> > And after all, it's an internal API, we can always change
> > it later if we need.
> ...
> > Well, yes but we are using APIs like flush_work etc. These are very
> > handy.  It seems much easier than rolling our own queue on top of kthread.
> 
> The thing is that this kind of one-off usage becomes problemetic when
> you're trying to change the implementation detail.  All current
> workqueue users don't care which thread they run on and they shouldn't
> as each work owns the context only for the duration the work is
> executing.  If this sort of fundamental guidelines are followed, the
> implementation can be improved in pretty much transparent way but when
> you start depending on specific implementation details, things become
> messy pretty quickly.
> 
> If this type of usage were more common, adding proper way to account
> work usage according to cgroups would make sense but that's not the
> case here and I removed the only exception case recently while trying
> to implement cmwq and if this is added.  So, this would be the only
> one which makes such extra assumptions in the whole kernel.  One way
> or the other, workqueue needs to be improved and I don't really think
> adding the single exception at this point is a good idea.
> 
> The thing I realized after stop_machine conversion was that there was
> no reason to use workqueue there at all.  There already are more than
> enough not-too-difficult synchronization constructs and if you're
> using a thread for dedicated purposes, code complexity isn't that
> different either way.  Plus, it would also be clearer that dedicated
> threads are required there for what reason.  So, I strongly suggest
> using a kthread.  If there are issues which are noticeably difficult
> to solve with kthread, we can definitely talk about that and think
> about things again.
> 
> Thank you.

Well, we have create_singlethread_workqueue, right?
This is not very different ... is it?

Just copying structures and code from workqueue.c,
adding vhost_ in front of it will definitely work:
there is nothing magic about the workqueue library.
But this just involves cut and paste which might be best avoided.
One final idea before we go the cut and paste way: how about
'create_workqueue_from_task' that would get a thread and have workqueue
run there?

> -- 
> tejun

^ permalink raw reply

* MDNS is broken in latest -git
From: Maxim Levitsky @ 2010-05-28 15:02 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; +Cc: linux-wireless

On latest git, it became impossible to use hostname.local alias to
access my network hosts.

In fact when I look at 'avahi-discover' I see nothing but local
services.

I did a bisect, but unfortunely ended with merge commit, although
bisection seem to be normal (and I didn't do any shortcuts).

I own a iwl3945 wireless card.


The bisection log:

git bisect start
# good: [537b60d17894b7c19a6060feae40299d7109d6e7] Merge branch 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
git bisect good 537b60d17894b7c19a6060feae40299d7109d6e7
# bad: [d515e86e639890b33a09390d062b0831664f04a2] Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6
git bisect bad d515e86e639890b33a09390d062b0831664f04a2
# good: [a26272e5200765691e67d6780e52b32498fdb659] Merge branch 'docs-next' of git://git.lwn.net/linux-2.6
git bisect good a26272e5200765691e67d6780e52b32498fdb659
# good: [10fc51b9953112ade61e33ff2f6f005f005a2361] skge: use the DMA state API instead of the pci equivalents
git bisect good 10fc51b9953112ade61e33ff2f6f005f005a2361
# bad: [c316ba3b518bc35ce5aef5421135220389f4eb98] Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6
git bisect bad c316ba3b518bc35ce5aef5421135220389f4eb98
# bad: [7a9b149212f3716c598afe973b6261fd58453b7a] Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
git bisect bad 7a9b149212f3716c598afe973b6261fd58453b7a
# good: [726ef428af41b1fbdf569772ab73de0844c4e0f2] USB: belkin_sa: minor clean-ups
git bisect good 726ef428af41b1fbdf569772ab73de0844c4e0f2
# good: [6fe70aae0d128339febfabc073ba4c4a03de4f45] Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
git bisect good 6fe70aae0d128339febfabc073ba4c4a03de4f45
# bad: [57b610805ce92dbd79fc97509f80fa5391b99623] net: Add netlink support for virtual port management (was iovnl)
git bisect bad 57b610805ce92dbd79fc97509f80fa5391b99623
# good: [78ad38923094a479453f5b02b37a012377a36f34] qlcnic: fix internal loopback test
git bisect good 78ad38923094a479453f5b02b37a012377a36f34
# good: [e1bc7eedbafe0415cdfd82e17e6f65bb3369239d] atm: select FW_LOADER in Kconfig for solos-pci
git bisect good e1bc7eedbafe0415cdfd82e17e6f65bb3369239d
# bad: [eedf042a63ffef050ebc015de19b52dc065e830b] ipv6: fix the bug of address check
git bisect bad eedf042a63ffef050ebc015de19b52dc065e830b
# good: [99bf236612801351834b441314379bc5304d62ce] drivers/net/usb: Use kmemdup
git bisect good 99bf236612801351834b441314379bc5304d62ce
# good: [380fefb2ddabd4cd5f14dbe090481f0544e65078] dm9000: fix "BUG: spinlock recursion"
git bisect good 380fefb2ddabd4cd5f14dbe090481f0544e65078
# bad: [820ae8a80eb59962aefbbd4908dfe144ec0f9edb] Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
git bisect bad 820ae8a80eb59962aefbbd4908dfe144ec0f9edb


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

^ permalink raw reply

* Re: [PATCH] netdev/fec: fix ifconfig eth0 down hang issue
From: Wolfram Sang @ 2010-05-28 14:45 UTC (permalink / raw)
  To: Bryan Wu
  Cc: davem, afleming, s.hauer, gerg, amit.kucheria, netdev,
	linux-kernel
In-Reply-To: <1275037685-14555-1-git-send-email-bryan.wu@canonical.com>

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

On Fri, May 28, 2010 at 05:08:05PM +0800, Bryan Wu wrote:
> BugLink: http://bugs.launchpad.net/bugs/559065
> 
> In fec open/close function, we need to use phy_connect and phy_disconnect
> operation before we start/stop phy. Otherwise it will cause system hang.
> 
> Only call fec_enet_mii_probe() in open function, because the first open
> action will cause NULL pointer error.
> 
> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>

We use this patch for 1 month now and didn't encounter any flaws so far.

Tested-by: Wolfram Sang <w.sang@pengutronix.de>

Oops, too late... well, one for the comfortable feeling ;)

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply

* Re: [PATCH v3] can: Add driver for esd CAN-USB/2 device
From: Matthias Fuchs @ 2010-05-28 14:19 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <201005261547.34596.oneukum-l3A5Bk7waGM@public.gmane.org>

On Wednesday 26 May 2010 15:47, Oliver Neukum wrote:
> Am Mittwoch, 26. Mai 2010 11:14:03 schrieb Matthias Fuchs:
> > +       netdev->trans_start = jiffies;
> > +
> > +       /* Slow down tx path */
> > +       if (atomic_read(&priv->active_tx_jobs) >= MAX_TX_URBS)
> > +               netif_stop_queue(netdev);
> 
> Where is the queue started again?
> 
> 	Regards
> 		Oliver

This is done in the ack-patch for sent messages:

static void esd_usb2_tx_done_msg(struct esd_usb2_net_priv *priv,
				 struct esd_usb2_msg *msg)
{
...
	atomic_dec(&priv->active_tx_jobs);

	netif_wake_queue(netdev);
}

Matthias

^ permalink raw reply

* Re: RX/close vcc race with solos/atmtcp/usbatm/he
From: David Woodhouse @ 2010-05-28 13:33 UTC (permalink / raw)
  To: David Miller; +Cc: linux-atm-general, netdev, nathan
In-Reply-To: <20100528.034628.200383563.davem@davemloft.net>

On Fri, 2010-05-28 at 03:46 -0700, David Miller wrote:
> From: David Woodhouse <dwmw2@infradead.org>
> Date: Wed, 26 May 2010 12:16:24 +0100
> 
> > Can anyone see a better approach -- short of rewriting the whole ATM
> > layer to make the locking saner?
> 
> There is no doubt in my mind that these VCC objects need to be
> refcounted when used like this.

Perhaps. Although in the general case they're tied to the 'struct sock'
and don't need to outlive it. These drivers which look up the VCC to
feed incoming packets to it are the only exception to that rule that I'm
aware of.

> The only other alternative is to make use of something like RCU.

I agree. In fact the use of tasklet_unlock_wait() in my patch is what I
settled on when I went looking for 'something like RCU' to solve this
particular case. I was _going_ to add RCU stuff, but realised that this
was sufficient.

In the close() path we clear the READY bit in the VCC, wait for the
tasklet to finish using it, and only then do we destroy the VCC.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


^ permalink raw reply

* Re: [PATCH 1/2] Export firmware assigned labels of network devices to sysfs
From: Domsch, Matt @ 2010-05-28 13:16 UTC (permalink / raw)
  To: K, Narendra
  Cc: netdev@vger.kernel.org, linux-hotplug@vger.kernel.org,
	linux-pci@vger.kernel.org, Hargrave, Jordan, Rose, Charles,
	Nijhawan, Vijay
In-Reply-To: <20100528115520.GA24114@littleblue.us.dell.com>

On Fri, May 28, 2010 at 06:55:21AM -0500, K, Narendra wrote:
> Hello,
> 
> This patch is in continuation of an earlier discussion -
> 
> http://marc.info/?l=linux-netdev&m=126712978908314&w=3
> 
> The patch has the following review suggestions from the community incorporated -
> 
> 1. The name of the attribute has been changed from "smbiosname" to "label" to hide
> the implementation details.
> 2. The implementation has been moved to a new file drivers/pci/pci-label.c
> 
> The patch has following enhancements over the earlier patch -
> 
> 1.Implement support for ACPI _DSM(Device Specific Method) provided by
> the system firmware. The _DSM returns an index which is the instance number and
> a label assigned to the network device by the system firmware. The onboard devices
> will have lower indexes than the add-in devices. The patch exports both index and
> the label to sysfs.
> 
> For Example -
> 
> cat /sys/class/net/eth0/device/label
> Embedded Broadcom 5709C NIC 1
> 
> cat /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/index
> 1
> 
> Please refer to the PCI-SIG Draft ECN
> "PCIe Device Labeling under Operating Systems Draft ECN" at this link -
> http://www.pcisig.com/specifications/pciexpress/review_zone/.
> 
> It would be great to know your views on this ECN. Please let us know if you have
> have any suggestions or changes.

Please note: the 30-day review period for this Draft ECN ends on June
21, 2010.  If there are objections to this approach, or modifications
you believe are necessary, please raise them before this point so we
may adjust the draft before it is ratified.

Thanks,
Matt

-- 
Matt Domsch
Technology Strategist
Dell | Office of the CTO

^ permalink raw reply

* [PATCH 2/2] dmi: save OEM defined slot information
From: K, Narendra @ 2010-05-28 12:06 UTC (permalink / raw)
  To: netdev@vger.kernel.org, linux-hotplug@vger.kernel.org,
	linux-pci@vger.kernel.org
  Cc: achiang@hp.com, Domsch, Matt, Hargrave, Jordan, Rose, Charles,
	Nijhawan, Vijay

Hello,

This patch from Alex Chiang exports onboard device information as defined by 
SMBIOS type 209 for HP Proliants systems.


From: Alex Chiang <achiang@hp.com>

Some legacy platforms provide onboard device information in an SMBIOS OEM-
defined field, notably HP Proliants.

This information can be used to provide information to userspace that allows
correlation between a Linux PCI device and a chassis label.

Save this information so that it can be exposed to userspace. We choose the
string "Embedded NIC %d" since there are known platforms from other vendors
(Dell) that provide a string in this format for their onboard NICs (although
theirs is provided by a Type 41 record). This consistency will help simplify
life for userspace tools.

Only support HP platforms for now. If we need support for another vendor in
the future, we can write a fancier implementation then.

This code was inspired by the implementation in the userspace dmidecode tool,
which was originally written by John Cagle.

Signed-off-by: Alex Chiang <achiang@hp.com>
---
 drivers/firmware/dmi_scan.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 7d8439b..291b876 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -311,6 +311,32 @@ static void __init dmi_save_extended_devices(const struct dmi_header *dm)
 	dmi_save_one_device(*d & 0x7f, dmi_string_nosave(dm, *(d - 1)));
 }
 
+static void __init dmi_save_oem_devices(const struct dmi_header *dm) {
+	int bus, devfn, count;
+	const u8 *d = (u8 *)dm + 4;
+	char name[20];
+
+	/* Only handle HP extensions for now */
+	if (strcmp(dmi_ident[DMI_BIOS_VENDOR], "HP"))
+		return;
+
+	count = 1;
+	while ((d + 8) <= ((u8 *)dm + dm->length)) {
+		if ((*d == 0x00 && *(d + 1) == 0x00) ||
+		    (*d == 0xff && *(d + 1) == 0xff))
+			goto next;
+
+		bus = *(d + 1);
+		devfn = *d;
+		sprintf(name, "Embedded NIC %d", count);
+		dmi_save_devslot(-1, 0, bus, devfn, name);
+
+next:
+		count++;
+		d += 8;
+	}
+}
+
 /*
  *	Process a DMI table entry. Right now all we care about are the BIOS
  *	and machine entries. For 2.5 we should pull the smbus controller info
@@ -357,6 +383,9 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
 	case 41:	/* Onboard Devices Extended Information */
 		dmi_save_extended_devices(dm);
 		break;
+	case 209:
+		dmi_save_oem_devices(dm);
+		break;
 	}
 }
 
-- 
1.6.5.2


With regards,
Narendra K

^ permalink raw reply related

* [PATCH 1/2] Export firmware assigned labels of network devices to sysfs
From: K, Narendra @ 2010-05-28 11:55 UTC (permalink / raw)
  To: netdev@vger.kernel.org, linux-hotplug@vger.kernel.org,
	linux-pci@vger.kernel.org
  Cc: Domsch, Matt, Hargrave, Jordan, Rose, Charles, Nijhawan, Vijay

Hello,

This patch is in continuation of an earlier discussion -

http://marc.info/?l=linux-netdev&m=126712978908314&w=3

The patch has the following review suggestions from the community incorporated -

1. The name of the attribute has been changed from "smbiosname" to "label" to hide
the implementation details.
2. The implementation has been moved to a new file drivers/pci/pci-label.c

The patch has following enhancements over the earlier patch -

1.Implement support for ACPI _DSM(Device Specific Method) provided by
the system firmware. The _DSM returns an index which is the instance number and
a label assigned to the network device by the system firmware. The onboard devices
will have lower indexes than the add-in devices. The patch exports both index and
the label to sysfs.

For Example -

cat /sys/class/net/eth0/device/label
Embedded Broadcom 5709C NIC 1

cat /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/index
1

Please refer to the PCI-SIG Draft ECN
"PCIe Device Labeling under Operating Systems Draft ECN" at this link -
http://www.pcisig.com/specifications/pciexpress/review_zone/.

It would be great to know your views on this ECN. Please let us know if you have
have any suggestions or changes.

2.If the system firmware does not provide ACPI _DSM, then implementation falls back
onto SMBIOS and exports SMBIOS labels to sysfs.

3. If SMBIOS is not available, no label will be created.

For an example user space implementation please look at this link -
http://linux.dell.com/wiki/index.php/Oss/libnetdevname

Please review -


From: Narendra K <Narendra_K@dell.com>

This patch exports the firmware assigned labels of network devices to
sysfs which could be used by user space.This helps in providing more
meaningful names to network devices such as

Embedded Broadcom 5709C NIC 1 - First on board netwrok interface

Signed-off-by: Jordan Hargrave <Jordan_Hargrave@dell.com>
Signed-off-by: Narendra K <Narendra_K@dell.com>
---
 drivers/firmware/dmi_scan.c |   24 +++++
 drivers/pci/Makefile        |    2 +-
 drivers/pci/pci-label.c     |  242 +++++++++++++++++++++++++++++++++++++++++++
 drivers/pci/pci-sysfs.c     |    6 +
 include/linux/dmi.h         |    9 ++
 include/linux/pci-label.h   |   38 +++++++
 6 files changed, 320 insertions(+), 1 deletions(-)
 create mode 100644 drivers/pci/pci-label.c
 create mode 100644 include/linux/pci-label.h

diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index d464672..7d8439b 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -277,6 +277,28 @@ static void __init dmi_save_ipmi_device(const struct dmi_header *dm)
        list_add_tail(&dev->list, &dmi_devices);
 }

+static void __init dmi_save_devslot(int id, int seg, int bus, int devfn, const char *name)
+{
+       struct dmi_devslot *slot;
+
+       slot = dmi_alloc(sizeof(*slot) + strlen(name) + 1);
+       if (!slot) {
+               printk(KERN_ERR "dmi_save_devslot: out of memory.\n");
+               return;
+       }
+       slot->id = id;
+       slot->seg = seg;
+       slot->bus = bus;
+       slot->devfn = devfn;
+
+       strcpy((char *)&slot[1], name);
+       slot->dev.type = DMI_DEV_TYPE_DEVSLOT;
+       slot->dev.name = (char *)&slot[1];
+       slot->dev.device_data = slot;
+
+       list_add(&slot->dev.list, &dmi_devices);
+}
+
 static void __init dmi_save_extended_devices(const struct dmi_header *dm)
 {
        const u8 *d = (u8*) dm + 5;
@@ -285,6 +307,7 @@ static void __init dmi_save_extended_devices(const struct dmi_header *dm)
        if ((*d & 0x80) == 0)
                return;

+       dmi_save_devslot(-1, *(u16 *)(d+2), *(d+4), *(d+5), dmi_string_nosave(dm, *(d-1)));
        dmi_save_one_device(*d & 0x7f, dmi_string_nosave(dm, *(d - 1)));
 }

@@ -333,6 +356,7 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
                break;
        case 41:        /* Onboard Devices Extended Information */
                dmi_save_extended_devices(dm);
+               break;
        }
 }

diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 0b51857..69c503a 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -4,7 +4,7 @@

 obj-y          += access.o bus.o probe.o remove.o pci.o \
                        pci-driver.o search.o pci-sysfs.o rom.o setup-res.o \
-                       irq.o vpd.o
+                       irq.o vpd.o pci-label.o
 obj-$(CONFIG_PROC_FS) += proc.o
 obj-$(CONFIG_SYSFS) += slot.o

diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
new file mode 100644
index 0000000..f3f4c37
--- /dev/null
+++ b/drivers/pci/pci-label.c
@@ -0,0 +1,242 @@
+/*
+ * File:       drivers/pci/pci-label.c
+ * Purpose:    Export the firmware label associated with a pci network interface
+ * device to sysfs
+ * Copyright (C) 2010 Dell Inc.
+ * by Narendra K <Narendra_K@dell.com>, Jordan Hargrave <Jordan_Hargrave@dell.com>
+ *
+ * This code checks if the pci network device has a related ACPI _DSM. If
+ * available, the code calls the _DSM to retrieve the index and string and
+ * exports them to sysfs. If the ACPI _DSM is not available, it falls back on
+ * SMBIOS. SMBIOS defines type 41 for onboard pci devices. This code retrieves
+ * strings associated with the type 41 and exports it to sysfs.
+ *
+ * Please see http://linux.dell.com/wiki/index.php/Oss/libnetdevname for more
+ * information.
+ */
+
+#include <linux/pci-label.h>
+
+static ssize_t
+smbiosname_string_exists(struct device *dev, char *buf)
+{
+       struct pci_dev *pdev = to_pci_dev(dev);
+       const struct dmi_device *dmi;
+       struct dmi_devslot *dslot;
+       int bus;
+       int devfn;
+
+       bus = pdev->bus->number;
+       devfn = pdev->devfn;
+
+       dmi = NULL;
+       while ((dmi = dmi_find_device(DMI_DEV_TYPE_DEVSLOT, NULL, dmi)) != NULL) {
+               dslot = dmi->device_data;
+               if (dslot && dslot->bus == bus && dslot->devfn == devfn) {
+                       if (buf)
+                               return scnprintf(buf, PAGE_SIZE, "%s\n", dmi->name);
+                       return strlen(dmi->name);
+               }
+       }
+
+       return 0;
+}
+
+static ssize_t
+smbiosname_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       return smbiosname_string_exists(dev, buf);
+}
+
+struct smbios_attribute smbios_attr_label = {
+       .attr = {.name = __stringify(label), .mode = 0444, .owner = THIS_MODULE},
+       .show = smbiosname_show,
+       .test = smbiosname_string_exists,
+};
+
+static int
+pci_create_smbiosname_file(struct pci_dev *pdev)
+{
+       if (smbios_attr_label.test && smbios_attr_label.test(&pdev->dev, NULL)) {
+               sysfs_create_file(&pdev->dev.kobj, &smbios_attr_label.attr);
+               return 0;
+       }
+       return -1;
+}
+
+static int
+pci_remove_smbiosname_file(struct pci_dev *pdev)
+{
+       if (smbios_attr_label.test && smbios_attr_label.test(&pdev->dev, NULL)) {
+               sysfs_remove_file(&pdev->dev.kobj, &smbios_attr_label.attr);
+               return 0;
+       }
+       return -1;
+}
+
+static const char dell_dsm_uuid[] = {
+       0xD0, 0x37, 0xC9, 0xE5, 0x53, 0x35, 0x7A, 0x4D,
+       0x91, 0x17, 0xEA, 0x4D, 0x19, 0xC3, 0x43, 0x4D
+};
+
+
+static int
+dsm_get_label(acpi_handle handle, int func,
+              struct acpi_buffer *output,
+              char *buf, char *attribute)
+{
+       struct acpi_object_list input;
+       union acpi_object params[4];
+       union acpi_object *obj;
+       int len = 0;
+
+       int err;
+
+       input.count = 4;
+       input.pointer = params;
+       params[0].type = ACPI_TYPE_BUFFER;
+       params[0].buffer.length = sizeof(dell_dsm_uuid);
+       params[0].buffer.pointer = (char *)dell_dsm_uuid;
+       params[1].type = ACPI_TYPE_INTEGER;
+       params[1].integer.value = 0x02;
+       params[2].type = ACPI_TYPE_INTEGER;
+       params[2].integer.value = func;
+       params[3].type = ACPI_TYPE_PACKAGE;
+       params[3].package.count = 0;
+       params[3].package.elements = NULL;
+
+       err = acpi_evaluate_object(handle, "_DSM", &input, output);
+       if (err) {
+               printk(KERN_INFO "failed to evaulate _DSM\n");
+               return -1;
+       }
+
+       obj = (union acpi_object *)output->pointer;
+
+       switch (obj->type) {
+       case ACPI_TYPE_PACKAGE:
+               if (obj->package.count == 2) {
+                       len = obj->package.elements[0].integer.value;
+                       if (buf) {
+                               if (!strncmp(attribute, "index", strlen(attribute)))
+                                       scnprintf(buf, PAGE_SIZE, "%lu\n",
+                                       obj->package.elements[0].integer.value);
+                               else
+                                       scnprintf(buf, PAGE_SIZE, "%s\n",
+                                       obj->package.elements[1].string.pointer);
+                               kfree(output->pointer);
+                               return strlen(buf);
+                       }
+               }
+               kfree(output->pointer);
+               return len;
+       break;
+       default:
+               return -1;
+       }
+}
+
+static ssize_t
+acpi_index_string_exist(struct device *dev, char *buf, char *attribute)
+{
+       struct pci_dev *pdev = to_pci_dev(dev);
+
+       struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL};
+       acpi_handle handle;
+       int length;
+       int is_addin_card = 0;
+
+       if ((pdev->class >> 16) != PCI_BASE_CLASS_NETWORK)
+               return -1;
+
+       handle = DEVICE_ACPI_HANDLE(dev);
+
+       if (!handle) {
+               /*
+                * The device is an add-in network controller and does have
+                * a valid handle. Try until we get the handle for the parent
+                * bridge
+                */
+               struct pci_bus *pbus;
+               for (pbus = pdev->bus; pbus; pbus = pbus->parent) {
+                       handle = DEVICE_ACPI_HANDLE(&(pbus->self->dev));
+                       if (handle)
+                               break;
+
+               }
+       }
+
+       if ((length = dsm_get_label(handle, DELL_DSM_NETWORK,
+                                   &output, buf, attribute)) < 0)
+               return -1;
+
+       return length;
+}
+
+static ssize_t
+acpilabel_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       return acpi_index_string_exist(dev, buf, "label");
+}
+
+static ssize_t
+acpiindex_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       return acpi_index_string_exist(dev, buf, "index");
+}
+
+struct acpi_attribute acpi_attr_label = {
+       .attr = {.name = __stringify(label), .mode = 0444, .owner = THIS_MODULE},
+       .show = acpilabel_show,
+       .test = acpi_index_string_exist,
+};
+
+struct acpi_attribute acpi_attr_index = {
+       .attr = {.name = __stringify(index), .mode = 0444, .owner = THIS_MODULE},
+       .show = acpiindex_show,
+       .test = acpi_index_string_exist,
+};
+
+static int
+pci_create_acpi_index_label_files(struct pci_dev *pdev)
+{
+       if (acpi_attr_label.test && acpi_attr_label.test(&pdev->dev, NULL) > 0) {
+               sysfs_create_file(&pdev->dev.kobj, &acpi_attr_label.attr);
+               sysfs_create_file(&pdev->dev.kobj, &acpi_attr_index.attr);
+               return 0;
+       }
+       return -1;
+}
+
+static int
+pci_remove_acpi_index_label_files(struct pci_dev *pdev)
+{
+       if (acpi_attr_label.test && acpi_attr_label.test(&pdev->dev, NULL) > 0) {
+               sysfs_remove_file(&pdev->dev.kobj, &acpi_attr_label.attr);
+               sysfs_remove_file(&pdev->dev.kobj, &acpi_attr_index.attr);
+               return 0;
+       }
+       return -1;
+}
+
+int pci_create_acpi_attr_files(struct pci_dev *pdev)
+{
+       if (!pci_create_acpi_index_label_files(pdev))
+               return 0;
+       if (!pci_create_smbiosname_file(pdev))
+               return 0;
+       return -ENODEV;
+}
+EXPORT_SYMBOL(pci_create_acpi_attr_files);
+
+int pci_remove_acpi_attr_files(struct pci_dev *pdev)
+{
+       if (!pci_remove_acpi_index_label_files(pdev))
+               return 0;
+       if (!pci_remove_smbiosname_file(pdev))
+               return 0;
+       return -ENODEV;
+
+}
+EXPORT_SYMBOL(pci_remove_acpi_attr_files);
+
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index fad9398..30fa62b 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -23,6 +23,7 @@
 #include <linux/mm.h>
 #include <linux/capability.h>
 #include <linux/pci-aspm.h>
+#include <linux/pci-label.h>
 #include <linux/slab.h>
 #include "pci.h"

@@ -1073,6 +1074,8 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
        if (retval)
                goto err_vga_file;

+       pci_create_acpi_attr_files(pdev);
+
        return 0;

 err_vga_file:
@@ -1140,6 +1143,9 @@ void pci_remove_sysfs_dev_files(struct pci_dev *pdev)
                sysfs_remove_bin_file(&pdev->dev.kobj, pdev->rom_attr);
                kfree(pdev->rom_attr);
        }
+
+       pci_remove_acpi_attr_files(pdev);
+
 }

 static int __init pci_sysfs_init(void)
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index a8a3e1a..cc57c3a 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -20,6 +20,7 @@ enum dmi_device_type {
        DMI_DEV_TYPE_SAS,
        DMI_DEV_TYPE_IPMI = -1,
        DMI_DEV_TYPE_OEM_STRING = -2,
+       DMI_DEV_TYPE_DEVSLOT = -3,
 };

 struct dmi_header {
@@ -37,6 +38,14 @@ struct dmi_device {

 #ifdef CONFIG_DMI

+struct dmi_devslot {
+       struct dmi_device dev;
+       int id;
+       int seg;
+       int bus;
+       int devfn;
+};
+
 extern int dmi_check_system(const struct dmi_system_id *list);
 const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list);
 extern const char * dmi_get_system_info(int field);
diff --git a/include/linux/pci-label.h b/include/linux/pci-label.h
new file mode 100644
index 0000000..e9a4dfb
--- /dev/null
+++ b/include/linux/pci-label.h
@@ -0,0 +1,38 @@
+/*
+ * File                include/linux/pci-label.h
+ * Copyright (C) 2010 Dell Inc.
+ * by Narendra K <Narendra_K@dell.com>, Jordan Hargrave <Jordan_Hargrave@dell.com>
+ */
+
+#ifndef _PCI_LABEL_H_
+#define _PCI_LABEL_H_
+
+#include <linux/dmi.h>
+#include <linux/sysfs.h>
+#include <linux/pci.h>
+#include <linux/pci_ids.h>
+#include <linux/module.h>
+#include <linux/acpi.h>
+#include <linux/pci-acpi.h>
+#include <acpi/acpi_drivers.h>
+#include <acpi/acpi_bus.h>
+
+struct smbios_attribute {
+       struct attribute attr;
+       ssize_t (*show) (struct device *dev, char *buf);
+       ssize_t (*test) (struct device *dev, char *buf);
+};
+
+struct acpi_attribute {
+       struct attribute attr;
+       ssize_t (*show) (struct device *dev, char *buf);
+       ssize_t (*test) (struct device *dev, char *buf);
+};
+
+#define DELL_DSM_NETWORK       0x07
+
+extern int pci_create_acpi_attr_files(struct pci_dev *pdev);
+extern int pci_remove_acpi_attr_files(struct pci_dev *pdev);
+
+#endif  /* _PCI_LABEL_H_ */
+
--
1.6.5.2


With regards,
Narendra K

^ permalink raw reply related

* [GIT] Networking
From: David Miller @ 2010-05-28 11:07 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


Several fixes including the one for the bootup failure Ingo reported
yesterday:

1) Network cgroup needs to initialize classid properly when module
   is absent, fix from Herbert Xu.

2) GRO packets unconditionally dropped in ipv6 forwarding path, oops,
   also from Herbert Xu.

3) {un,}lock_sock_bh() is busted, it needs to properly arbitrate
   between user context lockers and async ones.  From Eric Dumazet.

   Fixes sk->sk_forward_alloc WARN_ON() reported by Anton Blanchard.

4) When __neigh_event_send() does __skb_queue_tail() it needs to force
   a reference to the skb->dst using skb_dst_force().  Fix from Eric
   Dumazet.

   Fixes a bootup failure reported by Ingo Molnar.

5) Several "if (x == NULL) x->foo" style NULL deref fixes from Julia
   Lawall.

6) Broadcom CNIC driver memory context init fix from Michael Chan.

7) FEC driver hangs on interface down because of improper PHY
   programming, fix from Bryan Wu.

8) Two vf_port/vfinfo netlink bug fixes from Scott Feldman:
   a) vf_port dump overruns netlink SKBs
   b) vfinfo blobs are sized incorrectly

9) Increase be2net POST timeout for EEH recovery, from Sathya Perla.

10) be2net ended up with the erroneous:

	while (...) {
	} while (...);

    after some recent changes, fix.  From Sarveshwar Bandi.

11) Array index limit check in __ip{,6}mr_fill_mroute() is off by one,
    fix from Dan Carpenter.

12) ll_temac fixes (interrupt validity fix, checksum offloading bugs)
    from Brian Hill.

13) IUCV protocol fails to release spinlock on memory allocation
    failure, from Julia Lawall.

14) VHOST fixes via Michael S. Tsirkin:
    a) vhost_set_ring index check is off by one, from Krishna Kumar.
    b) VHOST makes user copy return value checks wrongly, from Takuya Yoshikawa.
    c) leak on memory_access_ok() failure, also from Takuya Yoshikawa.

15) New netfilter xt_tee module needs to use skb_dst_drop() instead of
    the now verbotten dst_release(skb_dst(skb)).  From Eric Dumazet.

Please pull, thanks a lot!

The following changes since commit 63a6440326e4cd01d6a663069208a0e68e9b833f:
  Linus Torvalds (1):
        Merge git://git.kernel.org/.../pkl/squashfs-linus

are available in the git repository at:

  master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master

Brian Hill (2):
      net: ll_temac: fix interrupt bug when interrupt 0 is used
      net: ll_temac: fix checksum offload logic

Bryan Wu (1):
      netdev/fec: fix ifconfig eth0 down hang issue

Dan Carpenter (2):
      ipmr: off by one in __ipmr_fill_mroute()
      sctp: dubious bitfields in sctp_transport

Eric Dumazet (3):
      net: fix lock_sock_bh/unlock_sock_bh
      net: fix __neigh_event_send()
      xt_tee: use skb_dst_drop()

Herbert Xu (2):
      cls_cgroup: Initialise classid when module is absent
      ipv6: Add GSO support on forwarding path

Julia Lawall (3):
      net/iucv: Add missing spin_unlock
      drivers/net/hamradio: Eliminate a NULL pointer dereference
      drivers/net: Eliminate a NULL pointer dereference

Krishna Kumar (1):
      vhost: Fix host panic if ioctl called with wrong index

Michael Chan (1):
      cnic: Fix context memory init. on 5709.

Sarveshwar Bandi (1):
      be2net: Patch removes redundant while statement in loop.

Sathya Perla (1):
      be2net: increase POST timeout for EEH recovery

Scott Feldman (2):
      netlink: bug fix: don't overrun skbs on vf_port dump
      netlink: bug fix: wrong size was calculated for vfinfo list blob

Takuya Yoshikawa (3):
      vhost: fix to check the return value of copy_to/from_user() correctly
      vhost-net: fix to check the return value of copy_to/from_user() correctly
      vhost: fix the memory leak which will happen when memory_access_ok fails

 drivers/net/3c507.c         |    3 +-
 drivers/net/benet/be_cmds.c |    2 +-
 drivers/net/benet/be_main.c |    2 +-
 drivers/net/cnic.c          |   10 ++----
 drivers/net/cnic_if.h       |    4 +-
 drivers/net/fec.c           |   28 ++++++++------
 drivers/net/hamradio/yam.c  |    3 +-
 drivers/net/ll_temac.h      |    5 +++
 drivers/net/ll_temac_main.c |   84 ++++++++++++++++++++++++++++++-------------
 drivers/vhost/net.c         |   14 ++++----
 drivers/vhost/vhost.c       |   57 ++++++++++++++++-------------
 include/net/cls_cgroup.h    |    2 +-
 include/net/sctp/structs.h  |    2 +-
 include/net/sock.h          |   20 +++++++---
 net/core/datagram.c         |    6 ++-
 net/core/neighbour.c        |    1 +
 net/core/rtnetlink.c        |   26 ++++++++------
 net/core/sock.c             |   33 +++++++++++++++++
 net/ipv4/ipmr.c             |    2 +-
 net/ipv4/udp.c              |   14 ++++---
 net/ipv6/ip6_output.c       |    2 +-
 net/ipv6/ip6mr.c            |    2 +-
 net/ipv6/udp.c              |    5 ++-
 net/iucv/af_iucv.c          |    2 +-
 net/netfilter/xt_TEE.c      |    4 +-
 25 files changed, 214 insertions(+), 119 deletions(-)

^ permalink raw reply

* Re: RX/close vcc race with solos/atmtcp/usbatm/he
From: David Miller @ 2010-05-28 10:46 UTC (permalink / raw)
  To: dwmw2; +Cc: linux-atm-general, netdev, nathan
In-Reply-To: <1274872584.20576.13579.camel@macbook.infradead.org>

From: David Woodhouse <dwmw2@infradead.org>
Date: Wed, 26 May 2010 12:16:24 +0100

> Can anyone see a better approach -- short of rewriting the whole ATM
> layer to make the locking saner?

There is no doubt in my mind that these VCC objects need to be
refcounted when used like this.

The only other alternative is to make use of something like RCU.

^ permalink raw reply

* Re: [net-2.6 PATCH 2/2] netlink: bug fix: wrong size was calculated for vfinfo list blob
From: David Miller @ 2010-05-28 10:42 UTC (permalink / raw)
  To: scofeldm; +Cc: chrisw, netdev, kaber, arnd
In-Reply-To: <20100528071551.4058.24521.stgit@localhost.localdomain>

From: Scott Feldman <scofeldm@cisco.com>
Date: Fri, 28 May 2010 00:15:51 -0700

> From: Scott Feldman <scofeldm@cisco.com>
> 
> The wrong size was being calculated for vfinfo.  In one case, it was over-
> calculating using nlmsg_total_size on attrs, in another case, it was
> under-calculating by assuming ifla_vf_* structs are packed together, but
> each struct is it's own attr w/ hdr (and padding).
> 
> Signed-off-by: Scott Feldman <scofeldm@cisco.com>

Applied.

^ permalink raw reply

* Re: [net-2.6 PATCH 1/2] netlink: bug fix: don't overrun skbs on vf_port dump
From: David Miller @ 2010-05-28 10:42 UTC (permalink / raw)
  To: scofeldm; +Cc: chrisw, netdev, kaber, arnd
In-Reply-To: <20100528071546.4058.1332.stgit@localhost.localdomain>

From: Scott Feldman <scofeldm@cisco.com>
Date: Fri, 28 May 2010 00:15:46 -0700

> From: Scott Feldman <scofeldm@cisco.com>
> 
> Noticed by Patrick McHardy: was continuing to fill skb after a
> nla_put_failure, ignoring the size calculated by upper layer.  Now,
> return -EMSGSIZE on any overruns, but also allow netdev to
> fail ndo_get_vf_port with error other than -EMSGSIZE, thus unwinding
> nest.
> 
> Signed-off-by: Scott Feldman <scofeldm@cisco.com>

Applied.

^ permalink raw reply

* Re: [PATCH] xt_tee: use skb_dst_drop()
From: David Miller @ 2010-05-28 10:41 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, jengelh
In-Reply-To: <1275038698.2650.15.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 28 May 2010 11:24:58 +0200

> After commit 7fee226a (net: add a noref bit on skb dst), its wrong to
> use : dst_release(skb_dst(skb)), since we could decrement a refcount
> while skb dst was not refcounted.
> 
> We should use skb_dst_drop(skb) instead.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks Eric.

^ permalink raw reply

* Re: [PATCH] netdev/fec: fix ifconfig eth0 down hang issue
From: David Miller @ 2010-05-28 10:40 UTC (permalink / raw)
  To: bryan.wu; +Cc: afleming, s.hauer, gerg, amit.kucheria, netdev, linux-kernel
In-Reply-To: <1275037685-14555-1-git-send-email-bryan.wu@canonical.com>

From: Bryan Wu <bryan.wu@canonical.com>
Date: Fri, 28 May 2010 17:08:05 +0800

> BugLink: http://bugs.launchpad.net/bugs/559065
> 
> In fec open/close function, we need to use phy_connect and phy_disconnect
> operation before we start/stop phy. Otherwise it will cause system hang.
> 
> Only call fec_enet_mii_probe() in open function, because the first open
> action will cause NULL pointer error.
> 
> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>

Applied, thanks.

^ permalink raw reply

* Re: [RFC] netfilter: WIP: Xtables idletimer target implementation
From: Luciano Coelho @ 2010-05-28  9:58 UTC (permalink / raw)
  To: ext Jan Engelhardt
  Cc: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
	kaber@trash.net, Timo Teras
In-Reply-To: <alpine.LSU.2.01.1005281001550.11570@obet.zrqbmnf.qr>

On Fri, 2010-05-28 at 10:05 +0200, ext Jan Engelhardt wrote:
> On Friday 2010-05-28 07:25, Luciano Coelho wrote:
> >
> >Do you have any other suggestion on how I can associate the rules to
> >specific interfaces?
> 
> -A INPUT -i foo -j do
> -A do -j idletimer
> 
> A little funny, but actually this would allow me to keep a timer
> for a group of interfaces rather than just per-if.

Yes, this is what our userspace apps are doing.  I've formulated my
question in an unclear way.  If you check the rest of the code, I create
sysfs files under the interface's directory and use it as an attribute
to notify the userspace when the timer has expired.

In short, I need to figure out a way to associate each rule with an
interface in sysfs, so I can notify the userspace when the timer has
expired.  I couldn't figure out another way to do it.  Any suggestions?


> >> >+static int xt_idletimer_checkentry(const struct xt_tgchk_param *par)
> >> >+{
> >> >+	const struct xt_idletimer_info *info = par->targinfo;
> >> >+	const struct ipt_entry *entryinfo = par->entryinfo;
> >> >+	const struct ipt_ip *ip = &entryinfo->ip;
> >> 
> >> I'm not sure spying on ipt_ip is a long-term viable solution.
> >
> >Do you have any other suggestions on how I could get an interface
> >associated with the rule? I thought about having the userspace pass the
> >interface as an option to the rule (like I already do for the timeout
> >value), but that looked ugly to me, since the interface can already be
> >defined as part of the ruleset.
> 
> I have patches ready since a while that decouple ipt_ip
> from a rule, so there is no guarantee that such will exist.

Okay, if that's the case, then I don't know how to associate the rule
with a specific net object in the kobject tree.  Maybe I have to figure
out a different way to notify the userspace, unless I add the target
option I mentioned above. :/


-- 
Cheers,
Luca.


^ permalink raw reply

* [PATCH] xt_tee: use skb_dst_drop()
From: Eric Dumazet @ 2010-05-28  9:24 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Jan Engelhardt

After commit 7fee226a (net: add a noref bit on skb dst), its wrong to
use : dst_release(skb_dst(skb)), since we could decrement a refcount
while skb dst was not refcounted.

We should use skb_dst_drop(skb) instead.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 net/netfilter/xt_TEE.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/xt_TEE.c b/net/netfilter/xt_TEE.c
index d7920d9..859d9fd 100644
--- a/net/netfilter/xt_TEE.c
+++ b/net/netfilter/xt_TEE.c
@@ -76,7 +76,7 @@ tee_tg_route4(struct sk_buff *skb, const struct xt_tee_tginfo *info)
 	if (ip_route_output_key(net, &rt, &fl) != 0)
 		return false;
 
-	dst_release(skb_dst(skb));
+	skb_dst_drop(skb);
 	skb_dst_set(skb, &rt->u.dst);
 	skb->dev      = rt->u.dst.dev;
 	skb->protocol = htons(ETH_P_IP);
@@ -157,7 +157,7 @@ tee_tg_route6(struct sk_buff *skb, const struct xt_tee_tginfo *info)
 	if (dst == NULL)
 		return false;
 
-	dst_release(skb_dst(skb));
+	skb_dst_drop(skb);
 	skb_dst_set(skb, dst);
 	skb->dev      = dst->dev;
 	skb->protocol = htons(ETH_P_IPV6);



^ permalink raw reply related

* [PATCH] netdev/fec: fix ifconfig eth0 down hang issue
From: Bryan Wu @ 2010-05-28  9:08 UTC (permalink / raw)
  To: davem, afleming; +Cc: s.hauer, gerg, amit.kucheria, netdev, linux-kernel

BugLink: http://bugs.launchpad.net/bugs/559065

In fec open/close function, we need to use phy_connect and phy_disconnect
operation before we start/stop phy. Otherwise it will cause system hang.

Only call fec_enet_mii_probe() in open function, because the first open
action will cause NULL pointer error.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/net/fec.c |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 42d9ac9..cdc9376 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -679,6 +679,8 @@ static int fec_enet_mii_probe(struct net_device *dev)
 	struct phy_device *phy_dev = NULL;
 	int phy_addr;
 
+	fep->phy_dev = NULL;
+
 	/* find the first phy */
 	for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
 		if (fep->mii_bus->phy_map[phy_addr]) {
@@ -709,6 +711,11 @@ static int fec_enet_mii_probe(struct net_device *dev)
 	fep->link = 0;
 	fep->full_duplex = 0;
 
+	printk(KERN_INFO "%s: Freescale FEC PHY driver [%s] "
+		"(mii_bus:phy_addr=%s, irq=%d)\n", dev->name,
+		fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
+		fep->phy_dev->irq);
+
 	return 0;
 }
 
@@ -754,13 +761,8 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 	if (mdiobus_register(fep->mii_bus))
 		goto err_out_free_mdio_irq;
 
-	if (fec_enet_mii_probe(dev) != 0)
-		goto err_out_unregister_bus;
-
 	return 0;
 
-err_out_unregister_bus:
-	mdiobus_unregister(fep->mii_bus);
 err_out_free_mdio_irq:
 	kfree(fep->mii_bus->irq);
 err_out_free_mdiobus:
@@ -913,7 +915,12 @@ fec_enet_open(struct net_device *dev)
 	if (ret)
 		return ret;
 
-	/* schedule a link state check */
+	/* Probe and connect to PHY when open the interface */
+	ret = fec_enet_mii_probe(dev);
+	if (ret) {
+		fec_enet_free_buffers(dev);
+		return ret;
+	}
 	phy_start(fep->phy_dev);
 	netif_start_queue(dev);
 	fep->opened = 1;
@@ -927,10 +934,12 @@ fec_enet_close(struct net_device *dev)
 
 	/* Don't know what to do yet. */
 	fep->opened = 0;
-	phy_stop(fep->phy_dev);
 	netif_stop_queue(dev);
 	fec_stop(dev);
 
+	if (fep->phy_dev)
+		phy_disconnect(fep->phy_dev);
+
         fec_enet_free_buffers(dev);
 
 	return 0;
@@ -1294,11 +1303,6 @@ fec_probe(struct platform_device *pdev)
 	if (ret)
 		goto failed_register;
 
-	printk(KERN_INFO "%s: Freescale FEC PHY driver [%s] "
-		"(mii_bus:phy_addr=%s, irq=%d)\n", ndev->name,
-		fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
-		fep->phy_dev->irq);
-
 	return 0;
 
 failed_register:
-- 
1.7.0.4


^ permalink raw reply related

* Re: boot crash in arp_error_report()
From: David Miller @ 2010-05-28  8:53 UTC (permalink / raw)
  To: mingo; +Cc: eric.dumazet, torvalds, tglx, akpm, netdev, linux-kernel
In-Reply-To: <20100528082440.GA4168@elte.hu>

From: Ingo Molnar <mingo@elte.hu>
Date: Fri, 28 May 2010 10:24:40 +0200

> Preliminary testing shows that Eric's patch solves the problem.
> 
> Tested-by: Ingo Molnar <mingo@elte.hu>

Thanks a lot for testing Ingo.

^ permalink raw reply

* Re: [REGRESSION,BISECTED] MIPv6 support broken by f4f914b58019f0
From: Arnaud Ebalard @ 2010-05-28  8:51 UTC (permalink / raw)
  To: Scott C Otto
  Cc: Brian Haley, David Miller,
	YOSHIFUJI Hideaki / 吉藤英明, Jiri Olsa,
	netdev
In-Reply-To: <4BFEE49C.8060301@lucent.com>

Hi,

Scott C Otto <otts@alcatel-lucent.com> writes:

> All,
> Thanks for looking into this.
>
> The behavior of SO_BINDTODEVICE, certainly with IPV4, is to identify a specific
> interface to use for sending/receiving AF_INET packets upon.   And that's how it
> has behaved with IPV4.   Tools like ping, traceroute (and ping6, traceroute6)
> make use of it with the -i (interface) options.
>
> We ran into this issue when updating an IPV4 application to IPV6.   The report
> provided one example of the issue.
>
> The original change was based on the semantics of flowi.oif used in IPV4.  There
> flowi.oif (as it is with IPV6 as well) is also set to sk->sk_bound_dev_if when
> using ip_route_connect() and routing simply took a non-zero oif to enforce an
> interface.  Looking at IPV4 tunneling, flowi.oif is set the same way from
> tunnel's parms.link as with IPV6 so would follow those semantics as well.
>
> Obviously, with IPV6, the semantics of flowi.oif are different and perhaps even
> vary with the users of IPV6.
>
> If that variability is desired, the proposed change from Brian (using
> sk->sk_bound_dev_if) would be an equivalent means of supporting SO_BINDTODEVICE
> while limiting the impact.

ok. Thanks for the feedback. Can you comment on what is below?

>> The below might actually be what was actually intended, triggering
>> on what the user forced, rather than assuming all callers require
>> strict behavior.
>> 
>> -Brian
>> 
>> 
>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
>> index 294cbe8..252d761 100644
>> --- a/net/ipv6/route.c
>> +++ b/net/ipv6/route.c
>> @@ -814,7 +814,7 @@ struct dst_entry * ip6_route_output(struct net *net, struct sock *sk,
>>  {
>>  	int flags = 0;
>>  
>> -	if (fl->oif || rt6_need_strict(&fl->fl6_dst))
>> +	if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl->fl6_dst))
>>  		flags |= RT6_LOOKUP_F_IFACE;
>>  
>>  	if (!ipv6_addr_any(&fl->fl6_src))

Brian, I tested the patch on my Mobile Node: it fixes the regression. I
also updated the kernel on my Home Agent to a 2.6.34 with that fix and
everything works as expected. *For that aspect* and fwiw, you get my

Tested-by: Arnaud Ebalard <arno@natisbad.org>

For the SO_BINDTODEVICE aspect, I don't have code at hand to test if the
fix works as expected. We should also double check that this will not
break other paths which use the sk->sk_bound_dev_if with a different
semantic:

$ grep -R sk_bound_dev_if net/ | wc -l
125
$ grep -R 'sk_bound_dev_if = ' net/
net/ieee802154/raw.c:   sk->sk_bound_dev_if = dev->ifindex;
net/core/sock.c:        sk->sk_bound_dev_if = index;
net/ipv6/datagram.c:    sk->sk_bound_dev_if = usin->sin6_scope_id;
net/ipv6/datagram.c:    sk->sk_bound_dev_if = np->mcast_oif;
net/ipv6/af_inet6.c:    sk->sk_bound_dev_if = addr->sin6_scope_id;
net/ipv6/tcp_ipv6.c:    sk->sk_bound_dev_if = usin->sin6_scope_id;
net/ipv6/tcp_ipv6.c:    newsk->sk_bound_dev_if = treq->iif;
net/ipv6/raw.c:         sk->sk_bound_dev_if = addr->sin6_scope_id;
net/sctp/socket.c:      newsk->sk_bound_dev_if = sk->sk_bound_dev_if;
net/ipv4/ip_output.c:   sk->sk_bound_dev_if = arg->bound_dev_if;
net/ipv4/udp.c:         sk->sk_bound_dev_if = 0;
net/dccp/ipv6.c:        newsk->sk_bound_dev_if = ireq6->iif;
net/dccp/ipv6.c:        sk->sk_bound_dev_if = usin->sin6_scope_id;

Cheers,

a+

^ permalink raw reply

* Re: boot crash in arp_error_report()
From: Ingo Molnar @ 2010-05-28  8:24 UTC (permalink / raw)
  To: David Miller; +Cc: eric.dumazet, torvalds, tglx, akpm, netdev, linux-kernel
In-Reply-To: <20100528080531.GA9893@elte.hu>


* Ingo Molnar <mingo@elte.hu> wrote:

> 
> * David Miller <davem@davemloft.net> wrote:
> 
> > From: Eric Dumazet <eric.dumazet@gmail.com>
> > Date: Thu, 27 May 2010 22:18:24 +0200
> > 
> > > [PATCH] net: fix __neigh_event_send()
> > > 
> > > commit 7fee226ad23 (net: add a noref bit on skb dst) missed one spot
> > > where an skb is enqueued, with a possibly not refcounted dst entry.
> > > 
> > > __neigh_event_send() inserts skb into arp_queue, so we must make sure
> > > dst entry is refcounted, or dst entry can be freed by garbage collector
> > > after caller exits from rcu protected section.
> > > 
> > > Reported-by: Ingo Molnar <mingo@elte.hu>
> > > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> > 
> > Applied, thanks Eric.
> > 
> > Ingo can we get a confirmation that this fixes the bootup crash?
> 
> Sure, will let you know how it goes.

Preliminary testing shows that Eric's patch solves the problem.

Tested-by: Ingo Molnar <mingo@elte.hu>

Thanks!

	Ingo

^ permalink raw reply

* Re: [v5 Patch 1/3] netpoll: add generic support for bridge and bonding devices
From: Cong Wang @ 2010-05-28  8:16 UTC (permalink / raw)
  To: Flavio Leitner
  Cc: linux-kernel, Matt Mackall, netdev, bridge, Andy Gospodarek,
	Neil Horman, Jeff Moyer, Stephen Hemminger, bonding-devel,
	Jay Vosburgh, David Miller
In-Reply-To: <20100527180545.GA2345@sysclose.org>

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

On 05/28/10 02:05, Flavio Leitner wrote:
>
> Hi guys!
>
> I finally could test this to see if an old problem reported on bugzilla[1] was
> fixed now, but unfortunately it is still there.
>
> The ticket is private I guess, but basically the problem happens when bonding
> driver tries to print something after it had taken the write_lock (monitor
> functions, enslave/de-enslave), so the printk() will pass through netpoll, then
> on bonding again which no matter what mode you use, it will try to read_lock()
> the lock again. The result is a deadlock and the entire system hangs.
>

Does the attached patch fix this hang?

Thanks!

----------------------->

We should notify netconsole that bond is changing its slaves
when we use active-backup mode.

Signed-off-by: WANG Cong <amwang@redhat.com>

----


[-- Attachment #2: drivers-net-bonding-fix-activebackup-deadlock.diff --]
[-- Type: text/x-patch, Size: 898 bytes --]

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5e12462..9494c02 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1199,6 +1199,7 @@ void bond_select_active_slave(struct bonding *bond)
 
 	best_slave = bond_find_best_slave(bond);
 	if (best_slave != bond->curr_active_slave) {
+		netdev_bonding_change(bond->dev, NETDEV_BONDING_DESLAVE);
 		bond_change_active_slave(bond, best_slave);
 		rv = bond_set_carrier(bond);
 		if (!rv)
@@ -2154,6 +2155,7 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi
 	    (old_active) &&
 	    (new_active->link == BOND_LINK_UP) &&
 	    IS_UP(new_active->dev)) {
+		netdev_bonding_change(bond->dev, NETDEV_BONDING_DESLAVE);
 		write_lock_bh(&bond->curr_slave_lock);
 		bond_change_active_slave(bond, new_active);
 		write_unlock_bh(&bond->curr_slave_lock);

^ permalink raw reply related

* Re: [RFC] netfilter: WIP: Xtables idletimer target implementation
From: Jan Engelhardt @ 2010-05-28  8:05 UTC (permalink / raw)
  To: Luciano Coelho
  Cc: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
	kaber@trash.net, Timo Teras
In-Reply-To: <1275024304.3754.45.camel@powerslave>


On Friday 2010-05-28 07:25, Luciano Coelho wrote:
>
>Do you have any other suggestion on how I can associate the rules to
>specific interfaces?

-A INPUT -i foo -j do
-A do -j idletimer

A little funny, but actually this would allow me to keep a timer
for a group of interfaces rather than just per-if.

>> >+static int xt_idletimer_checkentry(const struct xt_tgchk_param *par)
>> >+{
>> >+	const struct xt_idletimer_info *info = par->targinfo;
>> >+	const struct ipt_entry *entryinfo = par->entryinfo;
>> >+	const struct ipt_ip *ip = &entryinfo->ip;
>> 
>> I'm not sure spying on ipt_ip is a long-term viable solution.
>
>Do you have any other suggestions on how I could get an interface
>associated with the rule? I thought about having the userspace pass the
>interface as an option to the rule (like I already do for the timeout
>value), but that looked ugly to me, since the interface can already be
>defined as part of the ruleset.

I have patches ready since a while that decouple ipt_ip
from a rule, so there is no guarantee that such will exist.

^ permalink raw reply

* Re: boot crash in arp_error_report()
From: Ingo Molnar @ 2010-05-28  8:05 UTC (permalink / raw)
  To: David Miller; +Cc: eric.dumazet, torvalds, tglx, akpm, netdev, linux-kernel
In-Reply-To: <20100527.161011.104042698.davem@davemloft.net>


* David Miller <davem@davemloft.net> wrote:

> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Thu, 27 May 2010 22:18:24 +0200
> 
> > [PATCH] net: fix __neigh_event_send()
> > 
> > commit 7fee226ad23 (net: add a noref bit on skb dst) missed one spot
> > where an skb is enqueued, with a possibly not refcounted dst entry.
> > 
> > __neigh_event_send() inserts skb into arp_queue, so we must make sure
> > dst entry is refcounted, or dst entry can be freed by garbage collector
> > after caller exits from rcu protected section.
> > 
> > Reported-by: Ingo Molnar <mingo@elte.hu>
> > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> 
> Applied, thanks Eric.
> 
> Ingo can we get a confirmation that this fixes the bootup crash?

Sure, will let you know how it goes.

Thanks,

	Ingo

^ permalink raw reply

* Re: [PATCH 2/2] netdev/fec: fix ifconfig eth0 down hang issue
From: Bryan Wu @ 2010-05-28  8:03 UTC (permalink / raw)
  To: David Miller; +Cc: afleming, s.hauer, gerg, amit.kucheria, netdev, linux-kernel
In-Reply-To: <20100528.004828.232759432.davem@davemloft.net>

On 05/28/2010 03:48 PM, David Miller wrote:
> From: Bryan Wu <bryan.wu@canonical.com>
> Date: Fri, 28 May 2010 13:26:42 +0800
> 
>> Since this patch is for another bug and doesn't depend on my first one patch.
>> Could you please review this?
> 
> Resubmit it as a formal, new, seperate patch submission and it will
> get looked at.

Okay, will do soon.

Thanks
-Bryan

^ permalink raw reply

* Re: [PATCH 2/2] netdev/fec: fix ifconfig eth0 down hang issue
From: David Miller @ 2010-05-28  7:48 UTC (permalink / raw)
  To: bryan.wu; +Cc: afleming, s.hauer, gerg, amit.kucheria, netdev, linux-kernel
In-Reply-To: <4BFF5412.1030303@canonical.com>

From: Bryan Wu <bryan.wu@canonical.com>
Date: Fri, 28 May 2010 13:26:42 +0800

> Since this patch is for another bug and doesn't depend on my first one patch.
> Could you please review this?

Resubmit it as a formal, new, seperate patch submission and it will
get looked at.

^ 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