* [RFC] [ver3 PATCH 6/6] virtio_net: Convert virtio_net driver to use find_vqs_irq
From: Krishna Kumar @ 2011-11-11 13:07 UTC (permalink / raw)
To: rusty, mst; +Cc: netdev, kvm, davem, Krishna Kumar, virtualization
In-Reply-To: <20111111130223.9878.59517.sendpatchset@krkumar2.in.ibm.com>
Convert virtio_net driver to use find_vqs_irq(). The TX vq's
share a single irq, while the RX vq's have individual irq's.
The skb_xmit_done handler also checks if any work is required.
Signed-off-by: krkumar2@in.ibm.com
---
drivers/net/virtio_net.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff -ruNp org/drivers/net/virtio_net.c new/drivers/net/virtio_net.c
--- org/drivers/net/virtio_net.c 2011-11-11 16:45:17.000000000 +0530
+++ new/drivers/net/virtio_net.c 2011-11-11 16:48:45.000000000 +0530
@@ -163,11 +163,13 @@ static void skb_xmit_done(struct virtque
struct virtnet_info *vi = vq->vdev->priv;
int qnum = vq->queue_index / 2; /* RX/TX vqs are allocated in pairs */
- /* Suppress further interrupts. */
- virtqueue_disable_cb(vq);
+ if (__netif_subqueue_stopped(vi->dev, qnum)) {
+ /* Suppress further interrupts. */
+ virtqueue_disable_cb(vq);
- /* We were probably waiting for more output buffers. */
- netif_wake_subqueue(vi->dev, qnum);
+ /* We were probably waiting for more output buffers. */
+ netif_wake_subqueue(vi->dev, qnum);
+ }
}
static void set_skb_frag(struct sk_buff *skb, struct page *page,
@@ -1120,6 +1122,7 @@ static void setup_cvq(struct virtnet_inf
static int invoke_find_vqs(struct virtnet_info *vi)
{
+ unsigned long *flags = NULL;
vq_callback_t **callbacks;
struct virtqueue **vqs;
int ret = -ENOMEM;
@@ -1141,6 +1144,14 @@ static int invoke_find_vqs(struct virtne
if (!vqs || !callbacks || !names)
goto err;
+ if (vi->num_queue_pairs > 1) {
+ int num = (total_vqs + BITS_PER_LONG - 1) / BITS_PER_LONG;
+
+ flags = kzalloc(num * sizeof(*flags), GFP_KERNEL);
+ if (!flags)
+ goto err;
+ }
+
/* Allocate/initialize parameters for recv virtqueues */
for (i = 0; i < vi->num_queue_pairs * 2; i += 2) {
callbacks[i] = skb_recv_done;
@@ -1155,6 +1166,8 @@ static int invoke_find_vqs(struct virtne
names[i] = kasprintf(GFP_KERNEL, "output.%d", i / 2);
if (!names[i])
goto err;
+ if (flags)
+ set_bit(i, flags);
}
/* Parameters for control virtqueue, if any */
@@ -1163,9 +1176,9 @@ static int invoke_find_vqs(struct virtne
names[i - 1] = "control";
}
- ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks,
- (const char **)names);
-
+ ret = vi->vdev->config->find_vqs_irq(vi->vdev, total_vqs, vqs,
+ callbacks, (const char **)names,
+ flags);
if (ret)
goto err;
@@ -1174,6 +1187,8 @@ static int invoke_find_vqs(struct virtne
setup_cvq(vi, vqs, vi->num_queue_pairs * 2);
err:
+ kfree(flags);
+
if (ret && names)
for (i = 0; i < vi->num_queue_pairs * 2; i++)
kfree(names[i]);
^ permalink raw reply
* [RFC] [ver3 PATCH 5/6] virtio: Implement find_vqs_irq()
From: Krishna Kumar @ 2011-11-11 13:06 UTC (permalink / raw)
To: rusty, mst; +Cc: netdev, virtualization, davem, Krishna Kumar, kvm
In-Reply-To: <20111111130223.9878.59517.sendpatchset@krkumar2.in.ibm.com>
Implement find_vqs_irq() to reduce number of vectors. It can
be used to specify which vq's need their own irqs, and which
can share irqs with other vq's.
Signed-off-by: krkumar2@in.ibm.com
---
drivers/virtio/virtio_pci.c | 108 ++++++++++++++++++++++++--------
include/linux/virtio_config.h | 14 ++++
2 files changed, 95 insertions(+), 27 deletions(-)
diff -ruNp org/drivers/virtio/virtio_pci.c new/drivers/virtio/virtio_pci.c
--- org/drivers/virtio/virtio_pci.c 2011-11-11 16:45:09.000000000 +0530
+++ new/drivers/virtio/virtio_pci.c 2011-11-11 16:54:35.000000000 +0530
@@ -40,7 +40,7 @@ struct virtio_pci_device
/* the IO mapping for the PCI config space */
void __iomem *ioaddr;
- /* a list of queues so we can dispatch IRQs */
+ /* a list of queues which have registered to receive IRQs */
spinlock_t lock;
struct list_head virtqueues;
@@ -196,7 +196,7 @@ static irqreturn_t vp_config_changed(int
return IRQ_HANDLED;
}
-/* Notify all virtqueues on an interrupt. */
+/* Notify all vq's on 'virtqueues' list on an interrupt. */
static irqreturn_t vp_vring_interrupt(int irq, void *opaque)
{
struct virtio_pci_device *vp_dev = opaque;
@@ -358,7 +358,7 @@ static struct virtqueue *setup_vq(struct
struct virtio_pci_device *vp_dev = to_vp_device(vdev);
struct virtio_pci_vq_info *info;
struct virtqueue *vq;
- unsigned long flags, size;
+ unsigned long size;
u16 num;
int err;
@@ -378,6 +378,7 @@ static struct virtqueue *setup_vq(struct
info->num = num;
info->msix_vector = msix_vec;
+ INIT_LIST_HEAD(&info->node);
size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
@@ -411,14 +412,6 @@ static struct virtqueue *setup_vq(struct
}
}
- if (callback) {
- spin_lock_irqsave(&vp_dev->lock, flags);
- list_add(&info->node, &vp_dev->virtqueues);
- spin_unlock_irqrestore(&vp_dev->lock, flags);
- } else {
- INIT_LIST_HEAD(&info->node);
- }
-
return vq;
out_assign:
@@ -472,7 +465,8 @@ static void vp_del_vqs(struct virtio_dev
if (vp_dev->per_vq_vectors &&
info->msix_vector != VIRTIO_MSI_NO_VECTOR)
free_irq(vp_dev->msix_entries[info->msix_vector].vector,
- vq);
+ list_empty(&info->node) ?
+ (void *)vq : (void *)vp_dev);
vp_del_vq(vq);
}
vp_dev->per_vq_vectors = false;
@@ -480,16 +474,37 @@ static void vp_del_vqs(struct virtio_dev
vp_free_vectors(vdev);
}
+static void add_vq_to_list(struct virtqueue *vq,
+ struct virtio_pci_device *vp_dev,
+ vq_callback_t *cb)
+{
+ struct virtio_pci_vq_info *info = vq->priv;
+ unsigned long flags;
+
+ if (cb) {
+ spin_lock_irqsave(&vp_dev->lock, flags);
+ list_add(&info->node, &vp_dev->virtqueues);
+ spin_unlock_irqrestore(&vp_dev->lock, flags);
+ }
+}
+
+/* Return true if flags is NULL, or 'bit'# in flags is clear */
+static bool bit_clear(unsigned long *flags, int bit)
+{
+ return flags ? !test_bit(bit, flags) : true;
+}
+
static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs,
struct virtqueue *vqs[],
vq_callback_t *callbacks[],
const char *names[],
bool use_msix,
- bool per_vq_vectors)
+ bool per_vq_vectors, unsigned long *flags)
{
struct virtio_pci_device *vp_dev = to_vp_device(vdev);
u16 msix_vec;
int i, err, nvectors, allocated_vectors;
+ int count = 0; /* Count of vq's using shared irq's */
if (!use_msix) {
/* Old style: one normal interrupt for change and all vqs. */
@@ -500,9 +515,19 @@ static int vp_try_to_find_vqs(struct vir
if (per_vq_vectors) {
/* Best option: one for change interrupt, one per vq. */
nvectors = 1;
- for (i = 0; i < nvqs; ++i)
- if (callbacks[i])
+ for (i = 0; i < nvqs; ++i) {
+ bool alloc_irq = bit_clear(flags, i);
+
+ /*
+ * We allocate a vector if cb is present,
+ * AND (driver requested a vector OR this
+ * is the first shared vector).
+ */
+ if (callbacks[i] &&
+ (alloc_irq || ++count == 1))
++nvectors;
+ }
+ count = 0;
} else {
/* Second best: one for change, shared for all vqs. */
nvectors = 2;
@@ -516,20 +541,38 @@ static int vp_try_to_find_vqs(struct vir
vp_dev->per_vq_vectors = per_vq_vectors;
allocated_vectors = vp_dev->msix_used_vectors;
for (i = 0; i < nvqs; ++i) {
- if (!callbacks[i] || !vp_dev->msix_enabled)
+ bool alloc_irq = bit_clear(flags, i);
+ irq_handler_t irq_handler;
+ void *data;
+
+ if (!callbacks[i] || !vp_dev->msix_enabled ||
+ !(alloc_irq || ++count == 1))
msix_vec = VIRTIO_MSI_NO_VECTOR;
else if (vp_dev->per_vq_vectors)
msix_vec = allocated_vectors++;
else
msix_vec = VP_MSIX_VQ_VECTOR;
+
vqs[i] = setup_vq(vdev, i, callbacks[i], names[i], msix_vec);
if (IS_ERR(vqs[i])) {
err = PTR_ERR(vqs[i]);
goto error_find;
}
- if (!vp_dev->per_vq_vectors || msix_vec == VIRTIO_MSI_NO_VECTOR)
+ if (!vp_dev->per_vq_vectors ||
+ msix_vec == VIRTIO_MSI_NO_VECTOR) {
+ add_vq_to_list(vqs[i], vp_dev, callbacks[i]);
continue;
+ }
+
+ if (alloc_irq) {
+ irq_handler = vring_interrupt;
+ data = vqs[i];
+ } else {
+ add_vq_to_list(vqs[i], vp_dev, callbacks[i]);
+ irq_handler = vp_vring_interrupt;
+ data = vp_dev;
+ }
/* allocate per-vq irq if available and necessary */
snprintf(vp_dev->msix_names[msix_vec],
@@ -537,9 +580,9 @@ static int vp_try_to_find_vqs(struct vir
"%s-%s",
dev_name(&vp_dev->vdev.dev), names[i]);
err = request_irq(vp_dev->msix_entries[msix_vec].vector,
- vring_interrupt, 0,
+ irq_handler, 0,
vp_dev->msix_names[msix_vec],
- vqs[i]);
+ data);
if (err) {
vp_del_vq(vqs[i]);
goto error_find;
@@ -554,26 +597,36 @@ error_request:
return err;
}
-/* the config->find_vqs() implementation */
-static int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs,
- struct virtqueue *vqs[],
- vq_callback_t *callbacks[],
- const char *names[])
+/* the config->find_vqs_irq() implementation */
+static int vp_find_vqs_irq(struct virtio_device *vdev, unsigned nvqs,
+ struct virtqueue *vqs[],
+ vq_callback_t *callbacks[],
+ const char *names[], unsigned long *flags)
{
int err;
/* Try MSI-X with one vector per queue. */
- err = vp_try_to_find_vqs(vdev, nvqs, vqs, callbacks, names, true, true);
+ err = vp_try_to_find_vqs(vdev, nvqs, vqs, callbacks, names, true, true,
+ flags);
if (!err)
return 0;
/* Fallback: MSI-X with one vector for config, one shared for queues. */
err = vp_try_to_find_vqs(vdev, nvqs, vqs, callbacks, names,
- true, false);
+ true, false, NULL);
if (!err)
return 0;
/* Finally fall back to regular interrupts. */
return vp_try_to_find_vqs(vdev, nvqs, vqs, callbacks, names,
- false, false);
+ false, false, NULL);
+}
+
+/* the config->find_vqs() implementation */
+static int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs,
+ struct virtqueue *vqs[],
+ vq_callback_t *callbacks[],
+ const char *names[])
+{
+ return vp_find_vqs_irq(vdev, nvqs, vqs, callbacks, names, NULL);
}
static struct virtio_config_ops virtio_pci_config_ops = {
@@ -583,6 +636,7 @@ static struct virtio_config_ops virtio_p
.set_status = vp_set_status,
.reset = vp_reset,
.find_vqs = vp_find_vqs,
+ .find_vqs_irq = vp_find_vqs_irq,
.del_vqs = vp_del_vqs,
.get_features = vp_get_features,
.finalize_features = vp_finalize_features,
diff -ruNp org/include/linux/virtio_config.h new/include/linux/virtio_config.h
--- org/include/linux/virtio_config.h 2011-11-11 16:45:09.000000000 +0530
+++ new/include/linux/virtio_config.h 2011-11-11 16:45:21.000000000 +0530
@@ -92,6 +92,16 @@
* callbacks: array of callbacks, for each virtqueue
* names: array of virtqueue names (mainly for debugging)
* Returns 0 on success or error status
+ * @find_vqs_irq: find virtqueues and instantiate them. The flags parameter
+ * indicates the vq's that can share irq's.
+ * vdev: the virtio_device
+ * nvqs: the number of virtqueues to find
+ * vqs: on success, includes new virtqueues
+ * callbacks: array of callbacks, for each virtqueue
+ * names: array of virtqueue names (mainly for debugging)
+ * flags: indicates which vq's need their own irq and which can share.
+ * See example usage in virtio_net.c
+ * Returns 0 on success or error status
* @del_vqs: free virtqueues found by find_vqs().
* @get_features: get the array of feature bits for this device.
* vdev: the virtio_device
@@ -114,6 +124,10 @@ struct virtio_config_ops {
struct virtqueue *vqs[],
vq_callback_t *callbacks[],
const char *names[]);
+ int (*find_vqs_irq)(struct virtio_device *vdev, unsigned nvqs,
+ struct virtqueue *vqs[],
+ vq_callback_t *callbacks[],
+ const char *names[], unsigned long *flags);
void (*del_vqs)(struct virtio_device *);
u32 (*get_features)(struct virtio_device *vdev);
void (*finalize_features)(struct virtio_device *vdev);
^ permalink raw reply
* Re: [PATCH V2 01/14] clk: add helper functions clk_prepare_enable and clk_disable_unprepare
From: Richard Zhao @ 2011-11-11 14:20 UTC (permalink / raw)
To: Sascha Hauer
Cc: Russell King - ARM Linux, amit.kucheria-Z7WLFzj8eWMS+FvcfC7Uqw,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-mmc-u79uwXL29TY76Z2rM5mHXA,
eric.miao-QSEj5FYQhm4dnm+yROfE0A,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
ben-linux-elnMNo+KYs3YtjvyW6yDsg,
linux-serial-u79uwXL29TY76Z2rM5mHXA, cjb-2X9k7bc8m7Mdnm+yROfE0A,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
alan-VuQAYsv1563Yd54FQh9/CA
In-Reply-To: <20111111115644.GT16886-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
On Fri, Nov 11, 2011 at 12:56:44PM +0100, Sascha Hauer wrote:
> On Fri, Nov 11, 2011 at 10:27:27AM +0000, Russell King - ARM Linux wrote:
> > On Fri, Nov 11, 2011 at 10:15:56AM +0100, Sascha Hauer wrote:
> > > On Fri, Nov 11, 2011 at 05:05:47PM +0800, Richard Zhao wrote:
> > > > {
> > > > int ret;
> > > >
> > > > ret = clk_prepare(clk);
> > > > if (ret)
> > > > return ret;
> > > > ret = clk_enable(clk);
> > > > if (ret)
> > > > clk_unprepare(clk);
> > > > return ret;
> > >
> > > Yes, looks good.
> >
> > While this looks like a nice easy solution for converting existing
> > drivers, I'd suggest thinking about this a little more...
> >
> > I would suggest some thought is given to the placement of clk_enable()
> > and clk_disable() when adding clk_prepare(), especially if your existing
> > clk_enable() function can only be called from non-atomic contexts.
> >
> > Obviously, the transition path needs to be along these lines:
> >
> > 1. add clk_prepare() to drivers
> > 2. implement clk_prepare() and make clk_enable() callable from non-atomic
> > contexts
> > 3. move clk_enable() in drivers to places it can be called from non-atomic
> > contexts to achieve greater power savings (maybe via the runtime pm)
Hi Russell,
There are use cases calling clk_enable in atomic context, but there are even more
cases caling in non-atomic context. The patch meant to help the latter cases.
Tuning of driver power savings can be left to other contributers. Is it ok
if I add below comments:
/* clk_prepare_enable helps cases using clk_enable in non-atomic context. */
static inline int clk_prepare_enable(struct clk *clk)
...
/* clk_disable_unprepare helps cases using clk_disable in non-atomic context. */
static inline void clk_disable_unprepare(struct clk *clk)
...
Thanks
Richard
> >
> > and where a driver is shared between different sub-architectures which
> > have non-atomic clk_enable()s, (3) can only happen when all those sub-
> > architectures have been updated to step (2).
>
> The drivers changed here all do clk_prepare/enable in their probe
> function. I agree that this clk_prepare_enable patch gives kind of
> wrong motivation to just use this function and to forget about
> potential power savings with proper integration of clk_prepare/enable.
> I think though that it will take a long time until all drivers really
> do this no matter if we have such a helper or not. I think that in the
> meantime it's better to have a little helper than to clobber the probe
> code with additional error handling.
>
> Sascha
>
> --
> Pengutronix e.K. | |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply
* [PATCH] fsl_pq_mdio: Clean up tbi address configuration
From: Andy Fleming @ 2011-11-11 15:10 UTC (permalink / raw)
To: David Miller; +Cc: netdev
The code for setting the address of the internal TBI PHY was
convoluted enough without a maze of ifdefs. Clean it up a bit
so we allow the logic to fail down to -ENODEV at the end of
the if/else ladder, rather than using ifdefs to repeat the same
failure code over and over.
Also, remove the support for the auto-configuration. I'm not aware of
anyone using it, and it ends up using the bus mutex before it's been
initialized.
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
drivers/net/ethernet/freescale/fsl_pq_mdio.c | 53 ++++----------------------
1 files changed, 8 insertions(+), 45 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
index 52f4e8a..4d9f84b 100644
--- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
+++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
@@ -183,28 +183,10 @@ void fsl_pq_mdio_bus_name(char *name, struct device_node *np)
}
EXPORT_SYMBOL_GPL(fsl_pq_mdio_bus_name);
-/* Scan the bus in reverse, looking for an empty spot */
-static int fsl_pq_mdio_find_free(struct mii_bus *new_bus)
-{
- int i;
-
- for (i = PHY_MAX_ADDR; i > 0; i--) {
- u32 phy_id;
-
- if (get_phy_id(new_bus, i, &phy_id))
- return -1;
-
- if (phy_id == 0xffffffff)
- break;
- }
-
- return i;
-}
-
-#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs, struct device_node *np)
{
+#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
struct gfar __iomem *enet_regs;
/*
@@ -220,15 +202,15 @@ static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs, struct devi
} else if (of_device_is_compatible(np, "fsl,etsec2-mdio") ||
of_device_is_compatible(np, "fsl,etsec2-tbi")) {
return of_iomap(np, 1);
- } else
- return NULL;
-}
+ }
#endif
+ return NULL;
+}
-#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id)
{
+#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
struct device_node *np = NULL;
int err = 0;
@@ -261,9 +243,10 @@ static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id)
return err;
else
return -EINVAL;
-}
+#else
+ return -ENODEV;
#endif
-
+}
static int fsl_pq_mdio_probe(struct platform_device *ofdev)
{
@@ -339,19 +322,13 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev)
of_device_is_compatible(np, "fsl,etsec2-mdio") ||
of_device_is_compatible(np, "fsl,etsec2-tbi") ||
of_device_is_compatible(np, "gianfar")) {
-#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
tbipa = get_gfar_tbipa(regs, np);
if (!tbipa) {
err = -EINVAL;
goto err_free_irqs;
}
-#else
- err = -ENODEV;
- goto err_free_irqs;
-#endif
} else if (of_device_is_compatible(np, "fsl,ucc-mdio") ||
of_device_is_compatible(np, "ucc_geth_phy")) {
-#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
u32 id;
static u32 mii_mng_master;
@@ -364,10 +341,6 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev)
mii_mng_master = id;
ucc_set_qe_mux_mii_mng(id - 1);
}
-#else
- err = -ENODEV;
- goto err_free_irqs;
-#endif
} else {
err = -ENODEV;
goto err_free_irqs;
@@ -386,16 +359,6 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev)
}
if (tbiaddr == -1) {
- out_be32(tbipa, 0);
-
- tbiaddr = fsl_pq_mdio_find_free(new_bus);
- }
-
- /*
- * We define TBIPA at 0 to be illegal, opting to fail for boards that
- * have PHYs at 1-31, rather than change tbipa and rescan.
- */
- if (tbiaddr == 0) {
err = -EBUSY;
goto err_free_irqs;
--
1.7.3.4
^ permalink raw reply related
* [PATCH 1/6] net/ethernet/atl1c: Disable ASPM on various chipsets
From: Matthew Garrett @ 2011-11-11 16:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Matthew Garrett, netdev, jcliburn, chris.snook
In-Reply-To: <1321027511-31229-1-git-send-email-mjg@redhat.com>
The Windows driver disables ASPM support for various chipsets supported
by atl1c. This adds the same set of logic to the Linux driver. ASPM is
disabled on l1c, l2c, l2cb and l2cb2 devices except for those in Toshiba
or Lenovo devices. Data taken from
http://www.atheros.cz/atheros-inf-file.php?inf=199&chipset=51&system=6
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Cc: jcliburn@gmail.com
Cc: chris.snook@gmail.com
---
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 02c7ed8..d91dabd 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -19,6 +19,7 @@
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <linux/pci-aspm.h>
#include "atl1c.h"
#define ATL1C_DRV_VERSION "1.0.1.0-NAPI"
@@ -2652,6 +2653,20 @@ static int __devinit atl1c_probe(struct pci_dev *pdev,
int err = 0;
+ switch (pdev->device) {
+ case PCI_DEVICE_ID_ATTANSIC_L1C:
+ case PCI_DEVICE_ID_ATTANSIC_L2C:
+ case PCI_DEVICE_ID_ATHEROS_L2C_B:
+ case PCI_DEVICE_ID_ATHEROS_L2C_B2:
+ if (pdev->subsystem_vendor == PCI_VENDOR_ID_TOSHIBA ||
+ pdev->subsystem_vendor == PCI_VENDOR_ID_LENOVO)
+ break;
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S |
+ PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+ break;
+ }
+
/* enable device (incl. PCI PM wakeup and hotplug setup) */
err = pci_enable_device_mem(pdev);
if (err) {
--
1.7.7.1
^ permalink raw reply related
* [PATCH 2/6] net/ethernet/atl1e: Disable ASPM
From: Matthew Garrett @ 2011-11-11 16:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Matthew Garrett, netdev, jcliburn, chris.snook
In-Reply-To: <1321027511-31229-1-git-send-email-mjg@redhat.com>
http://www.atheros.cz/atheros-inf-file.php?inf=209&chipset=45&system=6
indicates that ASPM is disabled on all L1E hardware. Duplicate for sanity.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Cc: jcliburn@gmail.com
Cc: chris.snook@gmail.com
---
drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index 95483bc..fc74dd1 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -2264,6 +2264,9 @@ static int __devinit atl1e_probe(struct pci_dev *pdev,
int err = 0;
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+
err = pci_enable_device(pdev);
if (err) {
dev_err(&pdev->dev, "cannot enable PCI device\n");
--
1.7.7.1
^ permalink raw reply related
* [PATCH 3/6] net/ethernet/jme: Disable ASPM
From: Matthew Garrett @ 2011-11-11 16:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Matthew Garrett, netdev, cooldavid
In-Reply-To: <1321027511-31229-1-git-send-email-mjg@redhat.com>
http://driveragent.com/archive/30421/7-0-14 indicates that ASPM is
disabled on the 250 and 260. Duplicate for sanity.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Cc: cooldavid@cooldavid.org
---
drivers/net/ethernet/jme.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index 7becff1..b28a873 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -2860,6 +2860,9 @@ jme_init_one(struct pci_dev *pdev,
/*
* set up PCI device basics
*/
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+
rc = pci_enable_device(pdev);
if (rc) {
pr_err("Cannot enable PCI device\n");
--
1.7.7.1
^ permalink raw reply related
* [PATCH V2 1/6] net/ethernet/atl1c: Disable ASPM on various chipsets
From: Matthew Garrett @ 2011-11-11 16:14 UTC (permalink / raw)
To: linux-kernel; +Cc: Matthew Garrett, netdev, jcliburn, chris.snook
In-Reply-To: <1321028064-644-1-git-send-email-mjg@redhat.com>
The Windows driver disables ASPM support for various chipsets supported
by atl1c. This adds the same set of logic to the Linux driver. ASPM is
disabled on l1c, l2c, l2cb and l2cb2 devices except for those in Toshiba
or Lenovo devices. Data taken from
http://www.atheros.cz/atheros-inf-file.php?inf=199&chipset=51&system=6
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Cc: jcliburn@gmail.com
Cc: chris.snook@gmail.com
---
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 02c7ed8..d91dabd 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -19,6 +19,7 @@
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <linux/pci-aspm.h>
#include "atl1c.h"
#define ATL1C_DRV_VERSION "1.0.1.0-NAPI"
@@ -2652,6 +2653,20 @@ static int __devinit atl1c_probe(struct pci_dev *pdev,
int err = 0;
+ switch (pdev->device) {
+ case PCI_DEVICE_ID_ATTANSIC_L1C:
+ case PCI_DEVICE_ID_ATTANSIC_L2C:
+ case PCI_DEVICE_ID_ATHEROS_L2C_B:
+ case PCI_DEVICE_ID_ATHEROS_L2C_B2:
+ if (pdev->subsystem_vendor == PCI_VENDOR_ID_TOSHIBA ||
+ pdev->subsystem_vendor == PCI_VENDOR_ID_LENOVO)
+ break;
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S |
+ PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+ break;
+ }
+
/* enable device (incl. PCI PM wakeup and hotplug setup) */
err = pci_enable_device_mem(pdev);
if (err) {
--
1.7.7.1
^ permalink raw reply related
* [PATCH V2 2/6] net/ethernet/atl1e: Disable ASPM
From: Matthew Garrett @ 2011-11-11 16:14 UTC (permalink / raw)
To: linux-kernel; +Cc: Matthew Garrett, netdev, jcliburn, chris.snook
In-Reply-To: <1321028064-644-1-git-send-email-mjg@redhat.com>
http://www.atheros.cz/atheros-inf-file.php?inf=209&chipset=45&system=6
indicates that ASPM is disabled on all L1E hardware. Duplicate for sanity.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Cc: jcliburn@gmail.com
Cc: chris.snook@gmail.com
---
drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index 95483bc..fc74dd1 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -2264,6 +2264,9 @@ static int __devinit atl1e_probe(struct pci_dev *pdev,
int err = 0;
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+
err = pci_enable_device(pdev);
if (err) {
dev_err(&pdev->dev, "cannot enable PCI device\n");
--
1.7.7.1
^ permalink raw reply related
* [PATCH V2 3/6] net/ethernet/jme: Disable ASPM
From: Matthew Garrett @ 2011-11-11 16:14 UTC (permalink / raw)
To: linux-kernel; +Cc: Matthew Garrett, netdev, cooldavid
In-Reply-To: <1321028064-644-1-git-send-email-mjg@redhat.com>
http://driveragent.com/archive/30421/7-0-14 indicates that ASPM is
disabled on the 250 and 260. Duplicate for sanity.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Cc: cooldavid@cooldavid.org
---
drivers/net/ethernet/jme.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index 7becff1..88e7ce1 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/pci.h>
+#include <linux/pci-aspm.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
@@ -2860,6 +2861,9 @@ jme_init_one(struct pci_dev *pdev,
/*
* set up PCI device basics
*/
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+
rc = pci_enable_device(pdev);
if (rc) {
pr_err("Cannot enable PCI device\n");
--
1.7.7.1
^ permalink raw reply related
* Re: [patch net-next V7] net: introduce ethernet teaming device
From: Flavio Leitner @ 2011-11-11 18:04 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, eric.dumazet, bhutchings, shemminger, fubar, andy,
tgraf, ebiederm, mirqus, kaber, greearb, jesse, benjamin.poirier,
jzupka, ivecera
In-Reply-To: <1320939698-1062-1-git-send-email-jpirko@redhat.com>
On Thu, 10 Nov 2011 16:41:38 +0100
Jiri Pirko <jpirko@redhat.com> wrote:
> This patch introduces new network device called team. It supposes to be
> very fast, simple, userspace-driven alternative to existing bonding
> driver.
>
> Userspace library called libteam with couple of demo apps is available
> here:
> https://github.com/jpirko/libteam
> Note it's still in its dipers atm.
>
> team<->libteam use generic netlink for communication. That and rtnl
> suppose to be the only way to configure team device, no sysfs etc.
>
> Python binding of libteam was recently introduced.
> Daemon providing arpmon/miimon active-backup functionality will be
> introduced shortly. All what's necessary is already implemented in
> kernel team driver.
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>
> v6->v7:
> - transmit and receive functions are not checked in hot paths.
> That also resolves memory leak on transmit when no port is
> present
>
You're right. No need to patch those function names if we use libnl
from git.
[...]
> +static void team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid)
> +{
> + struct team *team = netdev_priv(dev);
> + struct team_port *port;
> +
> + rcu_read_lock();
> + list_for_each_entry_rcu(port, &team->port_list, list) {
> + const struct net_device_ops *ops = port->dev->netdev_ops;
> +
> + ops->ndo_vlan_rx_add_vid(port->dev, vid);
This causes a oops when enslaving a tg3 device because there is
no ndo_vlan_rx_add_vid().
> + }
> + rcu_read_unlock();
> +}
> +
> +static void team_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid)
> +{
> + struct team *team = netdev_priv(dev);
> + struct team_port *port;
> +
> + rcu_read_lock();
> + list_for_each_entry_rcu(port, &team->port_list, list) {
> + const struct net_device_ops *ops = port->dev->netdev_ops;
> +
> + ops->ndo_vlan_rx_kill_vid(port->dev, vid);
Well, probably here too, though you can't reach this point without
crashing at team_vlan_rx_add_vid() first.
fbl
^ permalink raw reply
* Re: [patch net-next V7] net: introduce ethernet teaming device
From: Flavio Leitner @ 2011-11-11 19:05 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, eric.dumazet, bhutchings, shemminger, fubar, andy,
tgraf, ebiederm, mirqus, kaber, greearb, jesse, benjamin.poirier,
jzupka, ivecera
In-Reply-To: <20111111160441.5ab366cc@asterix.rh>
On Fri, 11 Nov 2011 16:04:41 -0200
Flavio Leitner <fbl@redhat.com> wrote:
> On Thu, 10 Nov 2011 16:41:38 +0100
> Jiri Pirko <jpirko@redhat.com> wrote:
>
> > This patch introduces new network device called team. It supposes to be
> > very fast, simple, userspace-driven alternative to existing bonding
> > driver.
> >
> > Userspace library called libteam with couple of demo apps is available
> > here:
> > https://github.com/jpirko/libteam
> > Note it's still in its dipers atm.
> >
> > team<->libteam use generic netlink for communication. That and rtnl
> > suppose to be the only way to configure team device, no sysfs etc.
> >
> > Python binding of libteam was recently introduced.
> > Daemon providing arpmon/miimon active-backup functionality will be
> > introduced shortly. All what's necessary is already implemented in
> > kernel team driver.
> >
> > Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> >
> > v6->v7:
> > - transmit and receive functions are not checked in hot paths.
> > That also resolves memory leak on transmit when no port is
> > present
> >
>
> You're right. No need to patch those function names if we use libnl
> from git.
>
> [...]
> > +static void team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid)
> > +{
> > + struct team *team = netdev_priv(dev);
> > + struct team_port *port;
> > +
> > + rcu_read_lock();
> > + list_for_each_entry_rcu(port, &team->port_list, list) {
> > + const struct net_device_ops *ops = port->dev->netdev_ops;
> > +
> > + ops->ndo_vlan_rx_add_vid(port->dev, vid);
>
> This causes a oops when enslaving a tg3 device because there is
> no ndo_vlan_rx_add_vid().
>
Sorry, I should have said when bring team0 up:
[root@f16i7 ~]# ip link set team0 up
Killed
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [< (null)>] (null)
PGD 18ee5b067 PUD 18d9cd067 PMD 0
Oops: 0010 [#1] SMP
d_timer snd soundcore snd_page_alloc pl2303 usbserial iTCO_wdt iTCO_vendor_support raid0 i2c_i801 pcspkr microcode serio_raw uinput floppy joydev ipv6 autofs4 ata_generic firewire_ohci pata_acpi firewire_core crc_itu_t pata_marvell nouveau ttm drm_kms_helper drm hwmon i2c_algo_bit i2c_core mxm_wmi wmi video [last unloaded: scsi_wait_scan]
Pid: 21877, comm: ip Not tainted 3.2.0-rc1-10901-g40709d7 #31 /DX58SO
RIP: 0010:[<0000000000000000>] [< (null)>] (null)
RSP: 0018:ffff88018eecd6a0 EFLAGS: 00010283
RAX: ffffffffa02a4370 RBX: ffff8801a4d04500 RCX: 0000000000000e7f
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880198356000
RBP: ffff88018eecd6d8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: ffff880181d57600 R12: 0000000000000000
R13: ffff8801a526f7d8 R14: ffffffffa032f0c0 R15: 0000000000000000
FS: 00007f52ae475700(0000) GS:ffff8801afcc0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000000 CR3: 00000001983ab000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process ip (pid: 21877, threadinfo ffff88018eecc000, task ffff88018db8aea0)
Stack:
ffffffffa01e21ca ffffffff81a36700 ffff8801a4d04518 ffff8801a526f000
0000000000000001 ffff8801a526f000 00000000fffffff0 ffff88018eecd738
ffffffffa03062f5 ffff88018eecd708 00000000000080fe ffff88018eecd6f8
Call Trace:
[<ffffffffa01e21ca>] ? team_vlan_rx_add_vid+0x45/0x69 [team]
[<ffffffffa03062f5>] vlan_device_event+0xd5/0x3e2 [8021q]
[<ffffffff8148e97b>] notifier_call_chain+0x37/0x63
[<ffffffff8106d2a4>] raw_notifier_call_chain+0x14/0x16
[<ffffffff813d1fb1>] call_netdevice_notifiers+0x4a/0x4f
[<ffffffff813d636d>] __dev_notify_flags+0x37/0x5b
[<ffffffff813d63d9>] dev_change_flags+0x48/0x54
[<ffffffff813e0ace>] do_setlink+0x2b0/0x7a5
[<ffffffff8123c078>] ? __nla_reserve+0x26/0x4e
[<ffffffff813e19ed>] rtnl_newlink+0x253/0x46e
[<ffffffff813e184b>] ? rtnl_newlink+0xb1/0x46e
[<ffffffff813e158f>] rtnetlink_rcv_msg+0x23b/0x251
[<ffffffff813e1354>] ? __rtnl_unlock+0x17/0x17
[<ffffffff813f55d5>] netlink_rcv_skb+0x42/0x8d
[<ffffffff813e06aa>] rtnetlink_rcv+0x26/0x2d
[<ffffffff813f5164>] netlink_unicast+0xec/0x156
[<ffffffff813f53c9>] netlink_sendmsg+0x1fb/0x233
[<ffffffff813c27f7>] sock_sendmsg+0xe6/0x109
[<ffffffff81229308>] ? radix_tree_lookup_slot+0xe/0x10
[<ffffffff810cb0c8>] ? unlock_page+0x27/0x2b
[<ffffffff810e67b8>] ? __do_fault+0x351/0x38b
[<ffffffff8103ae47>] ? should_resched+0xe/0x2d
[<ffffffff8148a03d>] ? _cond_resched+0xe/0x22
[<ffffffff8103ae47>] ? should_resched+0xe/0x2d
[<ffffffff813cc733>] ? copy_from_user+0x2f/0x31
[<ffffffff813ccb1e>] ? verify_iovec+0x52/0xa4
[<ffffffff813c2adc>] __sys_sendmsg+0x213/0x2ba
[<ffffffff810e5eaa>] ? pmd_offset+0x19/0x3f
[<ffffffff810e9008>] ? handle_mm_fault+0x103/0x118
[<ffffffff8148e8ed>] ? do_page_fault+0x343/0x39a
[<ffffffff810ed7a3>] ? do_brk+0x23f/0x293
[<ffffffff813c46ee>] sys_sendmsg+0x42/0x60
[<ffffffff81491d82>] system_call_fastpath+0x16/0x1b
Code: Bad RIP value.
RIP [< (null)>] (null)
RSP <ffff88018eecd6a0>
CR2: 0000000000000000
---[ end trace 8255e7c0eb274d5c ]---
fbl
^ permalink raw reply
* (unknown),
From: Assured Loan Lenders @ 2011-11-11 12:14 UTC (permalink / raw)
Assured Loan Lenders
We give out loan to Organizations and individual's for just 2% loan
interest rate.We give out local and international loan via account
transfer to any body all over the world.
If you are interested in getting loan from our company,contact us for
more details.
EMAIL: assuredloan2@yahoo.com.hk
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
^ permalink raw reply
* Re: [patch net-next V7] net: introduce ethernet teaming device
From: Flavio Leitner @ 2011-11-11 19:58 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, eric.dumazet, bhutchings, shemminger, fubar, andy,
tgraf, ebiederm, mirqus, kaber, greearb, jesse, benjamin.poirier,
jzupka, ivecera
In-Reply-To: <20111111170509.581c4ca2@asterix.rh>
On Fri, 11 Nov 2011 17:05:09 -0200
Flavio Leitner <fbl@redhat.com> wrote:
> On Fri, 11 Nov 2011 16:04:41 -0200
> Flavio Leitner <fbl@redhat.com> wrote:
>
> > On Thu, 10 Nov 2011 16:41:38 +0100
> > Jiri Pirko <jpirko@redhat.com> wrote:
> >
> > > This patch introduces new network device called team. It supposes to be
> > > very fast, simple, userspace-driven alternative to existing bonding
> > > driver.
> > >
> > > Userspace library called libteam with couple of demo apps is available
> > > here:
> > > https://github.com/jpirko/libteam
> > > Note it's still in its dipers atm.
> > >
> > > team<->libteam use generic netlink for communication. That and rtnl
> > > suppose to be the only way to configure team device, no sysfs etc.
> > >
> > > Python binding of libteam was recently introduced.
> > > Daemon providing arpmon/miimon active-backup functionality will be
> > > introduced shortly. All what's necessary is already implemented in
> > > kernel team driver.
> > >
> > > Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> > >
> > > v6->v7:
> > > - transmit and receive functions are not checked in hot paths.
> > > That also resolves memory leak on transmit when no port is
> > > present
> > >
> >
> > You're right. No need to patch those function names if we use libnl
> > from git.
> >
> > [...]
> > > +static void team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid)
> > > +{
> > > + struct team *team = netdev_priv(dev);
> > > + struct team_port *port;
> > > +
> > > + rcu_read_lock();
> > > + list_for_each_entry_rcu(port, &team->port_list, list) {
> > > + const struct net_device_ops *ops = port->dev->netdev_ops;
> > > +
> > > + ops->ndo_vlan_rx_add_vid(port->dev, vid);
> >
> > This causes a oops when enslaving a tg3 device because there is
> > no ndo_vlan_rx_add_vid().
> >
> Sorry, I should have said when bring team0 up:
>
> [root@f16i7 ~]# ip link set team0 up
> Killed
>
> BUG: unable to handle kernel NULL pointer dereference at (null)
> IP: [< (null)>] (null)
> PGD 18ee5b067 PUD 18d9cd067 PMD 0
> Oops: 0010 [#1] SMP
> d_timer snd soundcore snd_page_alloc pl2303 usbserial iTCO_wdt iTCO_vendor_support raid0 i2c_i801 pcspkr microcode serio_raw uinput floppy joydev ipv6 autofs4 ata_generic firewire_ohci pata_acpi firewire_core crc_itu_t pata_marvell nouveau ttm drm_kms_helper drm hwmon i2c_algo_bit i2c_core mxm_wmi wmi video [last unloaded: scsi_wait_scan]
>
> Pid: 21877, comm: ip Not tainted 3.2.0-rc1-10901-g40709d7 #31 /DX58SO
> RIP: 0010:[<0000000000000000>] [< (null)>] (null)
> RSP: 0018:ffff88018eecd6a0 EFLAGS: 00010283
> RAX: ffffffffa02a4370 RBX: ffff8801a4d04500 RCX: 0000000000000e7f
> RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880198356000
> RBP: ffff88018eecd6d8 R08: 0000000000000001 R09: 0000000000000000
> R10: 0000000000000000 R11: ffff880181d57600 R12: 0000000000000000
> R13: ffff8801a526f7d8 R14: ffffffffa032f0c0 R15: 0000000000000000
> FS: 00007f52ae475700(0000) GS:ffff8801afcc0000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> CR2: 0000000000000000 CR3: 00000001983ab000 CR4: 00000000000006e0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> Process ip (pid: 21877, threadinfo ffff88018eecc000, task ffff88018db8aea0)
>
I patched the kernel to test if there is ops->ndo_vlan_rx_add_vid before
call it and works out, no more oopses.
Well, as there is no active-backup daemon yet (right?), only the link
notification is sent to team_monitor when I remove the cable from the
NIC, so I have to switch manually active and backup slaves.
ping -f, ssh, and a script to change active slave every second are
running in parallel.
I haven't noticed any other issue so far.
fbl
^ permalink raw reply
* Re: [PATCH 4/4] sunrpc: use SKB fragment destructors to delay completion until page is released by network stack.
From: J. Bruce Fields @ 2011-11-11 20:00 UTC (permalink / raw)
To: Ian Campbell
Cc: Michael S. Tsirkin,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David S. Miller,
Neil Brown, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1321017627.955.254.camel-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org>
On Fri, Nov 11, 2011 at 01:20:27PM +0000, Ian Campbell wrote:
> On Fri, 2011-11-11 at 12:38 +0000, Michael S. Tsirkin wrote:
> > On Wed, Nov 09, 2011 at 03:02:07PM +0000, Ian Campbell wrote:
> > > This prevents an issue where an ACK is delayed, a retransmit is queued (either
> > > at the RPC or TCP level) and the ACK arrives before the retransmission hits the
> > > wire. If this happens to an NFS WRITE RPC then the write() system call
> > > completes and the userspace process can continue, potentially modifying data
> > > referenced by the retransmission before the retransmission occurs.
> > >
> > > Signed-off-by: Ian Campbell <ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
> > > Acked-by: Trond Myklebust <Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
> > > Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> > > Cc: Neil Brown <neilb-l3A5Bk7waGM@public.gmane.org>
> > > Cc: "J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
> > > Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > > Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> >
> > So this blocks the system call until all page references
> > are gone, right?
>
> Right. The alternative is to return to userspace while the network stack
> still has a reference to the buffer which was passed in -- that's the
> exact class of problem this patch is supposed to fix.
>
> > But, there's no upper limit on how long the
> > page is referenced, correct?
>
> Correct.
>
> > consider a bridged setup
> > with an skb queued at a tap device - this cause one process
> > to block another one by virtue of not consuming a cloned skb?
>
> Hmm, yes.
>
> One approach might be to introduce the concept of an skb timeout to the
> stack as a whole and cancel (or deep copy) after that timeout occurs.
> That's going to be tricky though I suspect...
>
> A simpler option would be to have an end points such as a tap device
> which can swallow skbs for arbitrary times implement a policy in this
> regard, either to deep copy or drop after a timeout?
Stupid question: Is it a requirement that you be safe against DOS by a
rogue process with a tap device? (And if so, does current code satisfy
that requirement?)
--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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: [RFC] [ver3 PATCH 0/6] Implement multiqueue virtio-net
From: Sasha Levin @ 2011-11-11 22:02 UTC (permalink / raw)
To: Krishna Kumar; +Cc: kvm, mst, netdev, virtualization, davem
In-Reply-To: <20111111130223.9878.59517.sendpatchset@krkumar2.in.ibm.com>
Hi,
I'm seeing this BUG() sometimes when running it using a small patch I
did for KVM tool:
[ 1.280766] BUG: unable to handle kernel NULL pointer dereference at
0000000000000010
[ 1.281531] IP: [<ffffffff810b3ac7>] free_percpu+0x9a/0x104
[ 1.281531] PGD 0
[ 1.281531] Oops: 0000 [#1] PREEMPT SMP
[ 1.281531] CPU 0
[ 1.281531] Pid: 1, comm: swapper Not tainted
3.1.0-sasha-19665-gef3d2b7 #39
[ 1.281531] RIP: 0010:[<ffffffff810b3ac7>] [<ffffffff810b3ac7>]
free_percpu+0x9a/0x104
[ 1.281531] RSP: 0018:ffff88001383fd50 EFLAGS: 00010046
[ 1.281531] RAX: 0000000000000000 RBX: 0000000000000282 RCX:
00000000000f4400
[ 1.281531] RDX: 00003ffffffff000 RSI: ffff880000000240 RDI:
0000000001c06063
[ 1.281531] RBP: ffff880013fcb7c0 R08: ffffea00004e30c0 R09:
ffffffff8138ba64
[ 1.281531] R10: 0000000000001880 R11: 0000000000001880 R12:
ffff881213c00000
[ 1.281531] R13: ffff8800138c0e00 R14: 0000000000000010 R15:
ffff8800138c0d00
[ 1.281531] FS: 0000000000000000(0000) GS:ffff880013c00000(0000)
knlGS:0000000000000000
[ 1.281531] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 1.281531] CR2: 0000000000000010 CR3: 0000000001c05000 CR4:
00000000000406f0
[ 1.281531] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[ 1.281531] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[ 1.281531] Process swapper (pid: 1, threadinfo ffff88001383e000,
task ffff880013848000)
[ 1.281531] Stack:
[ 1.281531] ffff880013846ec0 0000000000000000 0000000000000000
ffffffff8138a0e5
[ 1.281531] ffff880013846ec0 ffff880013846800 ffff880013b6c000
ffffffff8138bb63
[ 1.281531] 0000000000000011 000000000000000f ffff8800fffffff0
0000000181239bcd
[ 1.281531] Call Trace:
[ 1.281531] [<ffffffff8138a0e5>] ? free_rq_sq+0x2c/0xce
[ 1.281531] [<ffffffff8138bb63>] ? virtnet_probe+0x81c/0x855
[ 1.281531] [<ffffffff8129c9e7>] ? virtio_dev_probe+0xa7/0xc6
[ 1.281531] [<ffffffff8134d2c3>] ? driver_probe_device+0xb2/0x142
[ 1.281531] [<ffffffff8134d3a2>] ? __driver_attach+0x4f/0x6f
[ 1.281531] [<ffffffff8134d353>] ? driver_probe_device+0x142/0x142
[ 1.281531] [<ffffffff8134c3ab>] ? bus_for_each_dev+0x47/0x72
[ 1.281531] [<ffffffff8134c90d>] ? bus_add_driver+0xa2/0x1e6
[ 1.281531] [<ffffffff81cc1b36>] ? tun_init+0x89/0x89
[ 1.281531] [<ffffffff8134db59>] ? driver_register+0x8d/0xf8
[ 1.281531] [<ffffffff81cc1b36>] ? tun_init+0x89/0x89
[ 1.281531] [<ffffffff81c98ac1>] ? do_one_initcall+0x78/0x130
[ 1.281531] [<ffffffff81c98c0e>] ? kernel_init+0x95/0x113
[ 1.281531] [<ffffffff81658274>] ? kernel_thread_helper+0x4/0x10
[ 1.281531] [<ffffffff81c98b79>] ? do_one_initcall+0x130/0x130
[ 1.281531] [<ffffffff81658270>] ? gs_change+0x13/0x13
[ 1.281531] Code: c2 85 d2 48 0f 45 2d d1 39 ce 00 eb 22 65 8b 14 25
90 cc 00 00 48 8b 05 f0 a6 bc 00 48 63 d2 4c 89 e7 48 03 3c d0 e8 83 dd
00 00
[ 1.281531] 8b 68 10 44 89 e6 48 89 ef 2b 75 18 e8 e4 f1 ff ff 8b 05
fd
[ 1.281531] RIP [<ffffffff810b3ac7>] free_percpu+0x9a/0x104
[ 1.281531] RSP <ffff88001383fd50>
[ 1.281531] CR2: 0000000000000010
[ 1.281531] ---[ end trace 68cbc23dfe2fe62a ]---
I don't have time today to dig into it, sorry.
On Fri, 2011-11-11 at 18:32 +0530, Krishna Kumar wrote:
> This patch series resurrects the earlier multiple TX/RX queues
> functionality for virtio_net, and addresses the issues pointed
> out. It also includes an API to share irq's, f.e. amongst the
> TX vqs.
>
> I plan to run TCP/UDP STREAM and RR tests for local->host and
> local->remote, and send the results in the next couple of days.
>
>
> patch #1: Introduce VIRTIO_NET_F_MULTIQUEUE
> patch #2: Move 'num_queues' to virtqueue
> patch #3: virtio_net driver changes
> patch #4: vhost_net changes
> patch #5: Implement find_vqs_irq()
> patch #6: Convert virtio_net driver to use find_vqs_irq()
>
>
> Changes from rev2:
> Michael:
> -------
> 1. Added functions to handle setting RX/TX/CTRL vq's.
> 2. num_queue_pairs instead of numtxqs.
> 3. Experimental support for fewer irq's in find_vqs.
>
> Rusty:
> ------
> 4. Cleaned up some existing "while (1)".
> 5. rvq/svq and rx_sg/tx_sg changed to vq and sg respectively.
> 6. Cleaned up some "#if 1" code.
>
>
> Issue when using patch5:
> -------------------------
>
> The new API is designed to minimize code duplication. E.g.
> vp_find_vqs() is implemented as:
>
> static int vp_find_vqs(...)
> {
> return vp_find_vqs_irq(vdev, nvqs, vqs, callbacks, names, NULL);
> }
>
> In my testing, when multiple tx/rx is used with multiple netperf
> sessions, all the device tx queues stops a few thousand times and
> subsequently woken up by skb_xmit_done. But after some 40K-50K
> iterations of stop/wake, some of the txq's stop and no wake
> interrupt comes. (modprobe -r followed by modprobe solves this, so
> it is not a system hang). At the time of the hang (#txqs=#rxqs=4):
>
> # egrep "CPU|virtio0" /proc/interrupts | grep -v config
> CPU0 CPU1 CPU2 CPU3
> 41: 49057 49262 48828 49421 PCI-MSI-edge virtio0-input.0
> 42: 5066 5213 5221 5109 PCI-MSI-edge virtio0-output.0
> 43: 43380 43770 43007 43148 PCI-MSI-edge virtio0-input.1
> 44: 41433 41727 42101 41175 PCI-MSI-edge virtio0-input.2
> 45: 38465 37629 38468 38768 PCI-MSI-edge virtio0-input.3
>
> # tc -s qdisc show dev eth0
> qdisc mq 0: root
> Sent 393196939897 bytes 271191624 pkt (dropped 59897,
> overlimits 0 requeues 67156) backlog 25375720b 1601p
> requeues 67156
>
> I am not sure if patch #5 is responsible for the hang. Also, without
> patch #5/patch #6, I changed vp_find_vqs() to:
> static int vp_find_vqs(...)
> {
> return vp_try_to_find_vqs(vdev, nvqs, vqs, callbacks, names,
> false, false);
> }
> No packets were getting TX'd with this change when #txqs>1. This is
> with the MQ-only patch that doesn't touch drivers/virtio/ directory.
>
> Also, the MQ patch works reasonably well with 2 vectors - with
> use_msix=1 and per_vq_vectors=0 in vp_find_vqs().
>
> Patch against net-next - please review.
>
> Signed-off-by: krkumar2@in.ibm.com
> ---
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Sasha.
^ permalink raw reply
* [RFC] kvm tools: Implement multiple VQ for virtio-net
From: Sasha Levin @ 2011-11-11 22:12 UTC (permalink / raw)
To: penberg
Cc: Krishna Kumar, kvm, Michael S. Tsirkin, asias.hejun,
virtualization, gorcunov, Sasha Levin, netdev, mingo
This is a patch based on Krishna Kumar's patch series which implements
multiple VQ support for virtio-net.
The patch was tested with ver3 of the patch.
Cc: Krishna Kumar <krkumar2@in.ibm.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: virtualization@lists.linux-foundation.org
Cc: netdev@vger.kernel.org
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
tools/kvm/include/kvm/virtio-pci.h | 2 +-
tools/kvm/virtio/net.c | 94 +++++++++++++++++++----------------
2 files changed, 52 insertions(+), 44 deletions(-)
diff --git a/tools/kvm/include/kvm/virtio-pci.h b/tools/kvm/include/kvm/virtio-pci.h
index 2bbb271..94d20ee 100644
--- a/tools/kvm/include/kvm/virtio-pci.h
+++ b/tools/kvm/include/kvm/virtio-pci.h
@@ -6,7 +6,7 @@
#include <linux/types.h>
-#define VIRTIO_PCI_MAX_VQ 3
+#define VIRTIO_PCI_MAX_VQ 16
#define VIRTIO_PCI_MAX_CONFIG 1
struct kvm;
diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c
index cee2b5b..0754795 100644
--- a/tools/kvm/virtio/net.c
+++ b/tools/kvm/virtio/net.c
@@ -27,9 +27,8 @@
#include <sys/wait.h>
#define VIRTIO_NET_QUEUE_SIZE 128
-#define VIRTIO_NET_NUM_QUEUES 2
-#define VIRTIO_NET_RX_QUEUE 0
-#define VIRTIO_NET_TX_QUEUE 1
+#define VIRTIO_NET_NUM_QUEUES 16
+#define VIRTIO_NET_IS_RX_QUEUE(x) (((x) % 2) == 0)
struct net_dev;
@@ -49,14 +48,13 @@ struct net_dev {
struct virtio_net_config config;
u32 features;
- pthread_t io_rx_thread;
- pthread_mutex_t io_rx_lock;
- pthread_cond_t io_rx_cond;
-
- pthread_t io_tx_thread;
- pthread_mutex_t io_tx_lock;
- pthread_cond_t io_tx_cond;
+ pthread_t io_thread[VIRTIO_NET_NUM_QUEUES];
+ pthread_mutex_t io_lock[VIRTIO_NET_NUM_QUEUES];
+ pthread_cond_t io_cond[VIRTIO_NET_NUM_QUEUES];
+ int rx_vq_num;
+ int tx_vq_num;
+ int vq_num;
int tap_fd;
char tap_name[IFNAMSIZ];
@@ -78,17 +76,22 @@ static void *virtio_net_rx_thread(void *p)
struct net_dev *ndev = p;
u16 out, in;
u16 head;
- int len;
+ int len, queue_num;
+
+ mutex_lock(&ndev->mutex);
+ queue_num = ndev->rx_vq_num * 2;
+ ndev->tx_vq_num++;
+ mutex_unlock(&ndev->mutex);
kvm = ndev->kvm;
- vq = &ndev->vqs[VIRTIO_NET_RX_QUEUE];
+ vq = &ndev->vqs[queue_num];
while (1) {
- mutex_lock(&ndev->io_rx_lock);
+ mutex_lock(&ndev->io_lock[queue_num]);
if (!virt_queue__available(vq))
- pthread_cond_wait(&ndev->io_rx_cond, &ndev->io_rx_lock);
- mutex_unlock(&ndev->io_rx_lock);
+ pthread_cond_wait(&ndev->io_cond[queue_num], &ndev->io_lock[queue_num]);
+ mutex_unlock(&ndev->io_lock[queue_num]);
while (virt_queue__available(vq)) {
@@ -99,7 +102,7 @@ static void *virtio_net_rx_thread(void *p)
virt_queue__set_used_elem(vq, head, len);
/* We should interrupt guest right now, otherwise latency is huge. */
- ndev->vtrans.trans_ops->signal_vq(kvm, &ndev->vtrans, VIRTIO_NET_RX_QUEUE);
+ ndev->vtrans.trans_ops->signal_vq(kvm, &ndev->vtrans, queue_num);
}
}
@@ -117,16 +120,21 @@ static void *virtio_net_tx_thread(void *p)
struct net_dev *ndev = p;
u16 out, in;
u16 head;
- int len;
+ int len, queue_num;
+
+ mutex_lock(&ndev->mutex);
+ queue_num = ndev->tx_vq_num * 2 + 1;
+ ndev->tx_vq_num++;
+ mutex_unlock(&ndev->mutex);
kvm = ndev->kvm;
- vq = &ndev->vqs[VIRTIO_NET_TX_QUEUE];
+ vq = &ndev->vqs[queue_num];
while (1) {
- mutex_lock(&ndev->io_tx_lock);
+ mutex_lock(&ndev->io_lock[queue_num]);
if (!virt_queue__available(vq))
- pthread_cond_wait(&ndev->io_tx_cond, &ndev->io_tx_lock);
- mutex_unlock(&ndev->io_tx_lock);
+ pthread_cond_wait(&ndev->io_cond[queue_num], &ndev->io_lock[queue_num]);
+ mutex_unlock(&ndev->io_lock[queue_num]);
while (virt_queue__available(vq)) {
@@ -137,7 +145,7 @@ static void *virtio_net_tx_thread(void *p)
virt_queue__set_used_elem(vq, head, len);
}
- ndev->vtrans.trans_ops->signal_vq(kvm, &ndev->vtrans, VIRTIO_NET_TX_QUEUE);
+ ndev->vtrans.trans_ops->signal_vq(kvm, &ndev->vtrans, queue_num);
}
pthread_exit(NULL);
@@ -148,20 +156,9 @@ static void *virtio_net_tx_thread(void *p)
static void virtio_net_handle_callback(struct kvm *kvm, struct net_dev *ndev, int queue)
{
- switch (queue) {
- case VIRTIO_NET_TX_QUEUE:
- mutex_lock(&ndev->io_tx_lock);
- pthread_cond_signal(&ndev->io_tx_cond);
- mutex_unlock(&ndev->io_tx_lock);
- break;
- case VIRTIO_NET_RX_QUEUE:
- mutex_lock(&ndev->io_rx_lock);
- pthread_cond_signal(&ndev->io_rx_cond);
- mutex_unlock(&ndev->io_rx_lock);
- break;
- default:
- pr_warning("Unknown queue index %u", queue);
- }
+ mutex_lock(&ndev->io_lock[queue]);
+ pthread_cond_signal(&ndev->io_cond[queue]);
+ mutex_unlock(&ndev->io_lock[queue]);
}
static bool virtio_net__tap_init(const struct virtio_net_params *params,
@@ -248,14 +245,17 @@ fail:
static void virtio_net__io_thread_init(struct kvm *kvm, struct net_dev *ndev)
{
- pthread_mutex_init(&ndev->io_tx_lock, NULL);
- pthread_mutex_init(&ndev->io_rx_lock, NULL);
+ int i;
- pthread_cond_init(&ndev->io_tx_cond, NULL);
- pthread_cond_init(&ndev->io_rx_cond, NULL);
+ for (i = 0; i < ndev->vq_num; i++) {
+ pthread_mutex_init(&ndev->io_lock[i], NULL);
+ pthread_cond_init(&ndev->io_cond[i], NULL);
+ }
- pthread_create(&ndev->io_tx_thread, NULL, virtio_net_tx_thread, ndev);
- pthread_create(&ndev->io_rx_thread, NULL, virtio_net_rx_thread, ndev);
+ for (i = 0; i < ndev->vq_num; i += 2) {
+ pthread_create(&ndev->io_thread[i], NULL, virtio_net_tx_thread, ndev);
+ pthread_create(&ndev->io_thread[i + 1], NULL, virtio_net_rx_thread, ndev);
+ }
}
static inline int tap_ops_tx(struct iovec *iov, u16 out, struct net_dev *ndev)
@@ -311,13 +311,19 @@ static u32 get_host_features(struct kvm *kvm, void *dev)
| 1UL << VIRTIO_NET_F_HOST_TSO6
| 1UL << VIRTIO_NET_F_GUEST_UFO
| 1UL << VIRTIO_NET_F_GUEST_TSO4
- | 1UL << VIRTIO_NET_F_GUEST_TSO6;
+ | 1UL << VIRTIO_NET_F_GUEST_TSO6
+ | 1UL << VIRTIO_NET_F_MULTIQUEUE;
}
static void set_guest_features(struct kvm *kvm, void *dev, u32 features)
{
struct net_dev *ndev = dev;
+ if (features & (1UL << VIRTIO_NET_F_MULTIQUEUE))
+ ndev->vq_num = ndev->config.num_queues;
+ else
+ ndev->vq_num = 2;
+
ndev->features = features;
}
@@ -395,6 +401,8 @@ void virtio_net__init(const struct virtio_net_params *params)
ndev->info.host_mac.addr[i] = params->host_mac[i];
}
+ ndev->config.num_queues = VIRTIO_NET_NUM_QUEUES;
+
ndev->mode = params->mode;
if (ndev->mode == NET_MODE_TAP) {
if (!virtio_net__tap_init(params, ndev))
--
1.7.7.2
^ permalink raw reply related
* [PATCH] r8169: add module param for control of ASPM disable
From: Todd Broch @ 2011-11-11 23:05 UTC (permalink / raw)
To: Realtek linux nic maintainers, Francois Romieu; +Cc: netdev, Todd Broch
ASPM has been disabled in this driver by default as its been
implicated in stability issues on at least one platform. This CL adds
a module parameter to allow control of ASPM disable. The default
value is to enable ASPM again as its provides signficant (200mW) power
savings on the platform I tested.
Signed-off-by: Todd Broch <tbroch@chromium.org>
---
drivers/net/r8169.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 5f838ef..05769fa0 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -671,6 +671,10 @@ struct rtl8169_private {
#define RTL_FIRMWARE_UNKNOWN ERR_PTR(-EAGAIN);
};
+static int aspm_disable = 0;
+module_param(aspm_disable, bool, 0444);
+MODULE_PARM_DESC(aspm_disable, "Disable ASPM completely.");
+
MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
module_param(use_dac, int, 0);
@@ -3291,8 +3295,12 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* disable ASPM completely as that cause random device stop working
* problems as well as full system hangs for some PCIe devices users */
- pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
- PCIE_LINK_STATE_CLKPM);
+ if (aspm_disable) {
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S |
+ PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+ dprintk("ASPM disabled");
+ }
/* enable device (incl. PCI PM wakeup and hotplug setup) */
rc = pci_enable_device(pdev);
--
1.7.3.1
^ permalink raw reply related
* Re: [patch net-next V7] net: introduce ethernet teaming device
From: Jiri Pirko @ 2011-11-12 0:15 UTC (permalink / raw)
To: Flavio Leitner
Cc: netdev, davem, eric.dumazet, bhutchings, shemminger, fubar, andy,
tgraf, ebiederm, mirqus, kaber, greearb, jesse, benjamin.poirier,
jzupka, ivecera
In-Reply-To: <20111111175845.10c82c3c@asterix.rh>
Fri, Nov 11, 2011 at 08:58:45PM CET, fbl@redhat.com wrote:
>On Fri, 11 Nov 2011 17:05:09 -0200
>Flavio Leitner <fbl@redhat.com> wrote:
>
>> On Fri, 11 Nov 2011 16:04:41 -0200
>> Flavio Leitner <fbl@redhat.com> wrote:
>>
>> > On Thu, 10 Nov 2011 16:41:38 +0100
>> > Jiri Pirko <jpirko@redhat.com> wrote:
>> >
>> > > This patch introduces new network device called team. It supposes to be
>> > > very fast, simple, userspace-driven alternative to existing bonding
>> > > driver.
>> > >
>> > > Userspace library called libteam with couple of demo apps is available
>> > > here:
>> > > https://github.com/jpirko/libteam
>> > > Note it's still in its dipers atm.
>> > >
>> > > team<->libteam use generic netlink for communication. That and rtnl
>> > > suppose to be the only way to configure team device, no sysfs etc.
>> > >
>> > > Python binding of libteam was recently introduced.
>> > > Daemon providing arpmon/miimon active-backup functionality will be
>> > > introduced shortly. All what's necessary is already implemented in
>> > > kernel team driver.
>> > >
>> > > Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>> > >
>> > > v6->v7:
>> > > - transmit and receive functions are not checked in hot paths.
>> > > That also resolves memory leak on transmit when no port is
>> > > present
>> > >
>> >
>> > You're right. No need to patch those function names if we use libnl
>> > from git.
>> >
>> > [...]
>> > > +static void team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid)
>> > > +{
>> > > + struct team *team = netdev_priv(dev);
>> > > + struct team_port *port;
>> > > +
>> > > + rcu_read_lock();
>> > > + list_for_each_entry_rcu(port, &team->port_list, list) {
>> > > + const struct net_device_ops *ops = port->dev->netdev_ops;
>> > > +
>> > > + ops->ndo_vlan_rx_add_vid(port->dev, vid);
>> >
>> > This causes a oops when enslaving a tg3 device because there is
>> > no ndo_vlan_rx_add_vid().
>> >
>> Sorry, I should have said when bring team0 up:
>>
>> [root@f16i7 ~]# ip link set team0 up
>> Killed
>>
>> BUG: unable to handle kernel NULL pointer dereference at (null)
>> IP: [< (null)>] (null)
>> PGD 18ee5b067 PUD 18d9cd067 PMD 0
>> Oops: 0010 [#1] SMP
>> d_timer snd soundcore snd_page_alloc pl2303 usbserial iTCO_wdt iTCO_vendor_support raid0 i2c_i801 pcspkr microcode serio_raw uinput floppy joydev ipv6 autofs4 ata_generic firewire_ohci pata_acpi firewire_core crc_itu_t pata_marvell nouveau ttm drm_kms_helper drm hwmon i2c_algo_bit i2c_core mxm_wmi wmi video [last unloaded: scsi_wait_scan]
>>
>> Pid: 21877, comm: ip Not tainted 3.2.0-rc1-10901-g40709d7 #31 /DX58SO
>> RIP: 0010:[<0000000000000000>] [< (null)>] (null)
>> RSP: 0018:ffff88018eecd6a0 EFLAGS: 00010283
>> RAX: ffffffffa02a4370 RBX: ffff8801a4d04500 RCX: 0000000000000e7f
>> RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880198356000
>> RBP: ffff88018eecd6d8 R08: 0000000000000001 R09: 0000000000000000
>> R10: 0000000000000000 R11: ffff880181d57600 R12: 0000000000000000
>> R13: ffff8801a526f7d8 R14: ffffffffa032f0c0 R15: 0000000000000000
>> FS: 00007f52ae475700(0000) GS:ffff8801afcc0000(0000) knlGS:0000000000000000
>> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
>> CR2: 0000000000000000 CR3: 00000001983ab000 CR4: 00000000000006e0
>> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
>> Process ip (pid: 21877, threadinfo ffff88018eecc000, task ffff88018db8aea0)
>>
>
>I patched the kernel to test if there is ops->ndo_vlan_rx_add_vid before
>call it and works out, no more oopses.
Yes, this should be checked. I missed that. I would like to address this
as follow up patch because I'm sure it's not the last bug in team (I
would be sending Vx of the patch for long time :( )
>
>Well, as there is no active-backup daemon yet (right?), only the link
>notification is sent to team_monitor when I remove the cable from the
>NIC, so I have to switch manually active and backup slaves.
Correct. I plan to do very simple active-backup daemon written in python
in matter of days. Keep pulling libteam git.
>
>ping -f, ssh, and a script to change active slave every second are
>running in parallel.
>
>I haven't noticed any other issue so far.
Thanks for testing this Flavio!
Jirka
>fbl
^ permalink raw reply
* send/receive data via eth0/1 external loop ?
From: Roland Kletzing @ 2011-11-12 0:47 UTC (permalink / raw)
To: netdev
Hello,
i`m searching for a while now, but i did not find a solution, so forgive when
i`m (as a user) asking for expert help here.
I want to do some network stress/burn-in and quality/reliability testing,
i.e. i want to send/receive large amounts of data trough the systems network
interfaces without the need of hogging the net or other systems.
so, that test should run "loopback", i.e. connecting eth0+1 via crossover cable
or via locally attached switch. I don`t want to use a second system for that.
testing at ip/tcp level would be favourable , but raw eth level would be also fine.
But how ?
What appears simple on a first view, seems to be difficult.... :(
All i came across is this report:
http://www.zyztematik.com/?p=10
and this description of a patch:
http://www.ssi.bg/~ja/send-to-self.txt
Does somebody know a proper way of achieving this without patching the
kernel ?
regards
Roland
___________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
^ permalink raw reply
* Re: [PATCH 1/2] net: vlan: 802.1ad S-VLAN support
From: David Miller @ 2011-11-12 1:22 UTC (permalink / raw)
To: equinox; +Cc: netdev, kaber
In-Reply-To: <1320512055-1231037-2-git-send-email-equinox@diac24.net>
From: David Lamparter <equinox@diac24.net>
Date: Sat, 5 Nov 2011 17:54:14 +0100
> @@ -87,7 +97,8 @@ struct vlan_group {
> */
> unsigned int nr_vlans;
> struct hlist_node hlist; /* linked list */
> - struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS];
> + struct net_device **vlan_devices_arrays[VLAN_N_PROTOCOL]
> + [VLAN_GROUP_ARRAY_SPLIT_PARTS];
> struct rcu_head rcu;
> };
This is a terrible waste of memory. You're now using 5 times as much space,
the vast majority of which will be entirely unused.
I don't even think it's semantically correct, all these alias QinQ protocol
values don't provide completely new VLAN_ID name spaces at all. So this
layout doesn't even make any sense, you're allowing for something that isn't
even allowed.
Rework these datastructures to eliminate the wastage please.
^ permalink raw reply
* Re: [PATCH net-next v1] net-forcedeth: Add internal loopback support for forcedeth NICs.
From: David Miller @ 2011-11-12 1:28 UTC (permalink / raw)
To: horti
Cc: netdev, linux-kernel, david.decotigny, ian.campbell, rick.jones2,
eric.dumazet, maheshb
In-Reply-To: <177427773f155c883809613ddf1ce28546aaac3e.1320871300.git.horti@google.com>
From: Sanjay Hortikar <horti@google.com>
Date: Wed, 9 Nov 2011 12:45:25 -0800
> @@ -5124,6 +5266,12 @@ static int nv_open(struct net_device *dev)
>
> spin_unlock_irq(&np->lock);
>
> + /* If the loopback feature was set while the device was down, make sure
> + * that it's set correctly now.
> + */
Improperly formatted comment, it should be:
/*
*
*/
> @@ -5328,6 +5476,10 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
>
> dev->features |= dev->hw_features;
>
> + /* Add loopback capability to the device. */
> + dev->hw_features |= NETIF_F_LOOPBACK;
> +
> +
> np->pause_flags = NV_PAUSEFRAME_RX_CAPABLE | NV_PAUSEFRAME_RX_REQ | NV_PAUSEFRAME_AUTONEG;
Please do not add all of these extra empty lines.
^ permalink raw reply
* Re: [PATCH] route: add more relaxed option for secure_redirects
From: David Miller @ 2011-11-12 1:33 UTC (permalink / raw)
To: fbl; +Cc: netdev
In-Reply-To: <1320710630-28335-1-git-send-email-fbl@redhat.com>
From: Flavio Leitner <fbl@redhat.com>
Date: Mon, 7 Nov 2011 22:03:50 -0200
> When the host uses a gateway IP address that is actually an alias
> address, the ICMP redirect message source address can be the gateway's
> main IP address, so the message is ignored by the host regardless of
> the secure_redirects setup.
>
> The new value (2) allows that ICMP message to be processed.
> The possible values are:
>
> 0 - Accept ICMP redirect messages only if its source address is the
> previous gateway address.
> 1 - The same as above. However, if shared_media is FALSE, it has to
> be for gateways listed in default gateway list as well.
> 2 - Accept ICMP redirects messages ignoring the conditions above.
> default value is 1.
>
> Signed-off-by: Flavio Leitner <fbl@redhat.com>
The more I look at this the less I like it.
Look, if IPVS or whatever is translating addresses and this is what
causes the problem then this entity can very well translate the damn
addresses right back in the redirect so it looks legitimate to the
sender.
You can't translate people's addresses, and them let them see that
intenal remapping in ICMP errors. The redirect is dropped by the
sender because it not only looks like crap, it is crap.
This is fundamentally not the correct way to handle this.
I'm not applying this patch.
^ permalink raw reply
* Re: [PATCH 1/1] net: fec: convert to clk_prepare/clk_unprepare
From: David Miller @ 2011-11-12 1:43 UTC (permalink / raw)
To: richard.zhao; +Cc: netdev, shawn.guo, eric.miao, kernel, linux-arm-kernel
In-Reply-To: <1320901304-13157-1-git-send-email-richard.zhao@linaro.org>
From: Richard Zhao <richard.zhao@linaro.org>
Date: Thu, 10 Nov 2011 13:01:44 +0800
> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
You're going to have to provide a more reasonable commit message.
Unless it's a typo fix or similar you need to explain your change
and why it's necessary.
^ permalink raw reply
* Re : webmail Upgrade
From: Kayda Norman @ 2011-11-12 1:29 UTC (permalink / raw)
Your mailbox has exceeded the storage limit which is 20GB as set by your administrator, you are currently running on 20.9GB,you may not be able to send or receive new mail until you re-validate your mailbox. To re-validate your mailbox please: click the link below : https://docs.google.com/spreadsheet/viewform?formkey=dGNROWlKUkxPaWdVNlp1VTN5UWJySXc6MQ
Thanks
System Administrator
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox