* Re: [PATCH] tg3: fix tigon3_dma_hwbug_workaround()
From: Ari Savolainen @ 2011-10-22 7:54 UTC (permalink / raw)
To: Eric Dumazet
Cc: RongQing Li, David Miller, richardcochran, netdev, linux-kernel
In-Reply-To: <1319268338.6180.20.camel@edumazet-laptop>
I tried a similar patch earlier and got another panic with that. I was
quite tired at that time and may have made a mistake. I'll test Eric's
patch either later today or tomorrow.
Ari
2011/10/22 Eric Dumazet <eric.dumazet@gmail.com>:
> Ari got kernel panics using tg3 NIC, and bisected to 2669069aacc9 "tg3:
> enable transmit time stamping."
>
> This is because tigon3_dma_hwbug_workaround() might alloc a new skb and
> free the original. We panic when skb_tx_timestamp() is called on freed
> skb.
>
> Reported-by: Ari Savolainen <ari.m.savolainen@gmail.com>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> drivers/net/tg3.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
> index 4a1374d..6149dc5 100644
> --- a/drivers/net/tg3.c
> +++ b/drivers/net/tg3.c
> @@ -6029,12 +6029,12 @@ static void tg3_tx_skb_unmap(struct tg3_napi *tnapi, u32 entry, int last)
>
> /* Workaround 4GB and 40-bit hardware DMA bugs. */
> static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
> - struct sk_buff *skb,
> + struct sk_buff **pskb,
> u32 *entry, u32 *budget,
> u32 base_flags, u32 mss, u32 vlan)
> {
> struct tg3 *tp = tnapi->tp;
> - struct sk_buff *new_skb;
> + struct sk_buff *new_skb, *skb = *pskb;
> dma_addr_t new_addr = 0;
> int ret = 0;
>
> @@ -6076,7 +6076,7 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
> }
>
> dev_kfree_skb(skb);
> -
> + *pskb = new_skb;
> return ret;
> }
>
> @@ -6305,7 +6305,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
> */
> entry = tnapi->tx_prod;
> budget = tg3_tx_avail(tnapi);
> - if (tigon3_dma_hwbug_workaround(tnapi, skb, &entry, &budget,
> + if (tigon3_dma_hwbug_workaround(tnapi, &skb, &entry, &budget,
> base_flags, mss, vlan))
> goto out_unlock;
> }
>
>
>
^ permalink raw reply
* Re: [BUG] bonding : LOCKDEP warning
From: David Miller @ 2011-10-22 7:58 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, ebiederm
In-Reply-To: <1319268987.6180.21.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 22 Oct 2011 09:36:27 +0200
> On latest net-next I got following splat
I suspect Biederman's namespace patch set.
Eric B. please take a look.
^ permalink raw reply
* Re: [PATCH] net: add sysctl allow_so_priority for SO_PRIORITY setsockopt
From: Maciej Żenczykowski @ 2011-10-22 8:27 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20111022.025836.1306779710775525629.davem@davemloft.net>
> I also don't see why we'd want to allow disabling this either.
> I really hate these patches that offer ways to disable things
> that normally work, and thus break apps when the non-default
> is selected.
Well... the purpose of settings like this is precisely to break functionality
when the default is not set ;-)
> I kind of have a feeling the kind of situation you're trying to
> account for, you have some cloud where people run random stuff
> that you don't control.
Yes, I have control of the kernel, I have control of root, I have control of
some daemons that are running on the machine, but I don't really have
control of the entirety of userspace, some of it I have source code for
and could audit to guarantee correctness (but I can't really enforce
that on the users, ultimately they can run any binary),
and for some of it I don't even have that. Either way, it's much
easier to delegate setting policy to
userspace management daemon(s), and leave enforcing it to the kernel.
This is just one more such knob.
> But you didn't specify this, and we just have to guess. Why don't you
> describe the specific situation where you want to modify this setting?
> Please do this instead of just talking about what the side effects are
> inside of the kernel. That's much less interesting when it comes to
> patches like this.
Very well, that's a good point.
Here's an attempt to provide some insight.
I am attempting to allow not-fully-code-audited nor fully trusted apps to run
in a cgroup containerized environment, with many apps in many
containers (not 1:1, has hierarchies) on a single kernel.
The apps are in the believed to not be actively malicious class, but
very likely to be buggy, or written by ill-advised programmers based
on wrong/outdated or otherwise incorrect documentation. I cannot rely
on unprivileged userspace getting things right.
I have to have some mechanism to grant these apps permissions to
utilize specific levels of network fabric priority. For this I have
the aforementioned per-cgroup allowed TOS settings. VLANs are not appropriate
because a client with high priority net privs is allowed to send a
request to a server with no special priority permissions.
(there are further patches to support tcp tos reflection so the server
can automatically respond with the client's priority)
Multiqueue networking combined with hardware priority queues and xps
desires to use skb->priority + active cpu for tx queue selection.
In this particular case TX queue selection should happen based on the
TOS priority.
Setting TOS automatically sets sk_priority (and hence skb->priority).
So all's good, so long as userspace doesn't go and change the
sk_priority field via SO_PRIORITY and break the mapping.
As a further note:
Some of these apps may be a little more special, a little more
audited, and a little more trusted.
Enough so that they might be granted CAP_NET_RAW, but not enough so
that they can get CAP_NET_ADMIN.
Hence the general desire for CAP_NET_ADMIN to control general
machine-global networking state, but not have it control
per-socket or per-packet settings. ie. bringing up or down an
interface affects everyone (hence must be CAP_NET_ADMIN, and much more
tightly controlled), while spoofing a packet doesn't really negatively
affect anyone (you can't assume the network is trusted, so there can
be
external sources of spoofing or eavesdropping anyway).
---
I could attempt to publish the vast majority of our internal
networking code base (there isn't really anything secret in there),
but it's based on 2.6.34 and even after two years of attempting to
clean it up and refactor it (along with a rebase from 2.6.26, and all
while actively continuing development) I'm still not at the point were
I would consider this to be a particular useful course of action
(there's a lot of bugfixes of bugfixes of crappy patches in there,
plus hacks, plus tons of backports from upstream, and tons of code
which is upstream but slightly differently then we have it internally,
because we had it first, and pushed v2 upstream, etc...). Instead I'm
trying to get the easy hanging fruit out of the way, rebase our
patches onto probably 3.2 or 3.3, likely sending some more your way
during the process, and see where that leaves us. Basically trying to
reduce the delta. We will always have internal only patches, but the
fewer, the less burden for us, hence I'm trying to get the ones I
believe to be potentially useful externally upstreamed. Obviously
whatever patches you don't accept, we'll still keep around locally.
Maciej
^ permalink raw reply
* Re: [PATCH] net: add sysctl allow_so_priority for SO_PRIORITY setsockopt
From: David Miller @ 2011-10-22 8:40 UTC (permalink / raw)
To: zenczykowski; +Cc: netdev
In-Reply-To: <CAHo-OoyVSbsxb8U3Y5WCNRsxjr00g1O3HJcT1fmu5cmP5i-JsA@mail.gmail.com>
From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Sat, 22 Oct 2011 01:27:03 -0700
> I am attempting to allow not-fully-code-audited nor fully trusted apps to run
> in a cgroup containerized environment, with many apps in many
> containers (not 1:1, has hierarchies) on a single kernel.
Extend, if necessary, the cgroup classifier so you can use it to clip
off the socket inherited priority in the SKB for this cgroup.
Really, this control has no business in the socket API layer.
^ permalink raw reply
* [PATCH net-next] w5300: add WIZnet W5300 Ethernet driver
From: Taehun Kim @ 2011-10-22 8:41 UTC (permalink / raw)
To: David S. Miller; +Cc: linux-kernel, netdev, romieu, suhwan, bongbong
hello, guys.
I have rewritten W5300 driver by applying the Francois Romieu's feedback
(http://marc.info/?l=linux-netdev&m=131714561419786&w=2).
This driver has been tested in the ARM board.
Please review this driver and apply it if do not have any problems.
Thank you.
T.K.
Signed-off-by: Taehun Kim <kth3321@gmail.com>
---
drivers/net/ethernet/Kconfig | 1 +
drivers/net/ethernet/Makefile | 1 +
drivers/net/ethernet/wiznet/Kconfig | 32 ++
drivers/net/ethernet/wiznet/Makefile | 5 +
drivers/net/ethernet/wiznet/w5300.c | 706 ++++++++++++++++++++++++++++++++++
drivers/net/ethernet/wiznet/w5300.h | 121 ++++++
6 files changed, 866 insertions(+), 0 deletions(-)
create mode 100644 drivers/net/ethernet/wiznet/Kconfig
create mode 100644 drivers/net/ethernet/wiznet/Makefile
create mode 100644 drivers/net/ethernet/wiznet/w5300.c
create mode 100644 drivers/net/ethernet/wiznet/w5300.h
diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig
index 6dff5a0..6325d85 100644
--- a/drivers/net/ethernet/Kconfig
+++ b/drivers/net/ethernet/Kconfig
@@ -173,5 +173,6 @@ source "drivers/net/ethernet/tundra/Kconfig"
source "drivers/net/ethernet/via/Kconfig"
source "drivers/net/ethernet/xilinx/Kconfig"
source "drivers/net/ethernet/xircom/Kconfig"
+source "drivers/net/ethernet/wiznet/Kconfig"
endif # ETHERNET
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
index c53ad3a..7bd5211 100644
--- a/drivers/net/ethernet/Makefile
+++ b/drivers/net/ethernet/Makefile
@@ -72,3 +72,4 @@ obj-$(CONFIG_NET_VENDOR_TUNDRA) += tundra/
obj-$(CONFIG_NET_VENDOR_VIA) += via/
obj-$(CONFIG_NET_VENDOR_XILINX) += xilinx/
obj-$(CONFIG_NET_VENDOR_XIRCOM) += xircom/
+obj-$(CONFIG_NET_VENDOR_WIZNET) += wiznet/
diff --git a/drivers/net/ethernet/wiznet/Kconfig b/drivers/net/ethernet/wiznet/Kconfig
new file mode 100644
index 0000000..b5925bd
--- /dev/null
+++ b/drivers/net/ethernet/wiznet/Kconfig
@@ -0,0 +1,32 @@
+#
+# WIZnet device configuration
+#
+
+config NET_VENDOR_WIZNET
+ bool "WIZnet devices"
+ default y
+ ---help---
+ If you have a network (Ethernet) card belonging to this class, say Y
+ and read the Ethernet-HOWTO, available from
+ <http://www.tldp.org/docs.html#howto>.
+
+ Note that the answer to this question doesn't directly affect the
+ kernel: saying N will just cause the configurator to skip all
+ the questions about WIZnet devices. If you say Y, you will be asked for
+ your specific card in the following questions.
+
+if NET_VENDOR_WIZNET
+
+config W5300
+ tristate "WIZnet W5300 Ethernet support"
+ depends on ARM
+ ---help---
+ This driver supports the Ethernet in the WIZnet W5300 chips.
+ W5300 supports hardwired TCP/IP stack. But this driver is limited to
+ the Ethernet function. To use hardwired TCP/IP stack, need to modify
+ the TCP/IP stack in linux kerenl.
+
+ To compile this driver as a module, choose M here: the module
+ will be called w5300.
+
+endif # NET_VENDOR_WIZNET
diff --git a/drivers/net/ethernet/wiznet/Makefile b/drivers/net/ethernet/wiznet/Makefile
new file mode 100644
index 0000000..53120bc
--- /dev/null
+++ b/drivers/net/ethernet/wiznet/Makefile
@@ -0,0 +1,5 @@
+#
+# Makefile for the WIZnet device drivers.
+#
+
+obj-$(CONFIG_W5300) += w5300.o
diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c
new file mode 100644
index 0000000..14bbfee
--- /dev/null
+++ b/drivers/net/ethernet/wiznet/w5300.c
@@ -0,0 +1,706 @@
+/* w5300.c: A Linux Ethernet driver for the WIZnet W5300 chip. */
+/*
+ Copyright (C) 2011 Taehun Kim <kth3321@gmail.com>
+
+ This software may be used and distributed according to the terms of
+ the GNU General Public License (GPL), incorporated herein by reference.
+ Drivers based on or derived from this code fall under the GPL and must
+ retain the authorship, copyright and license notice. This file is not
+ a complete program and may only be used when the entire operating
+ system is licensed under the GPL.
+*/
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/errno.h>
+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/ioport.h>
+#include <linux/io.h>
+
+#include "w5300.h"
+
+#define DEV_NAME "w5300"
+#define DRV_VERSION "1.0"
+#define DRV_RELDATE "Oct 22, 2011"
+
+#define W5300_DEF_MSG_ENABLE \
+ (NETIF_MSG_DRV | \
+ NETIF_MSG_TIMER | \
+ NETIF_MSG_IFUP | \
+ NETIF_MSG_RX_ERR | \
+ NETIF_MSG_INTR | \
+ NETIF_MSG_TX_DONE)
+
+static const char driver_info[] =
+ KERN_INFO DEV_NAME ": Ethernet driver v" DRV_VERSION "("
+ DRV_RELDATE ")\n";
+
+MODULE_AUTHOR("Taehun Kim <kth3321@gmail.com>");
+MODULE_DESCRIPTION("WIZnet W5300 Ethernet driver");
+MODULE_VERSION(DRV_VERSION);
+MODULE_LICENSE("GPL");
+
+/* Transmit timeout, default 5 seconds. */
+static int watchdog = 5000;
+module_param(watchdog, int, 0400);
+MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds");
+
+static int debug = -1;
+module_param(debug, int, 0);
+MODULE_PARM_DESC(debug, "W5300: bitmapped message enable number");
+
+/*
+ * This is W5300 information structure.
+ * Additional information is included in struct net_device.
+ */
+struct wiz_private {
+ void __iomem *base;
+ struct net_device *dev;
+ u8 rxbuf_conf[MAX_SOCK_NUM];
+ u8 txbuf_conf[MAX_SOCK_NUM];
+ struct net_device_stats stats;
+ struct napi_struct napi;
+ spinlock_t lock;
+ u32 msg_enable;
+};
+
+/* Default MAC address. */
+static __initdata u8 w5300_defmac[6] = {0x00, 0x08, 0xDC, 0xA0, 0x00, 0x01};
+
+/* Default RX/TX buffer size(KByte). */
+static u8 w5300_rxbuf_conf[MAX_SOCK_NUM] __initdata = {
+ 64, 0, 0, 0, 0, 0, 0, 0
+};
+
+static u8 w5300_txbuf_conf[MAX_SOCK_NUM] __initdata = {
+ 64, 0, 0, 0, 0, 0, 0, 0
+};
+
+/* Notifying packet size in the RX FIFO */
+static int w5300_get_rxsize(struct wiz_private *wp, int s)
+{
+ u32 val;
+
+ val = w5300_read(wp, Sn_RX_RSR(s));
+ val = (val << 16) + w5300_read(wp, Sn_RX_RSR(s) + 2);
+ return val;
+}
+
+/* Packet Receive Function. It reads received packet from the Rx FIFO. */
+static void w5300_recv_data(struct wiz_private *wp, int s, u8 *buf,
+ ssize_t len)
+{
+ int i;
+ u16 recv_data;
+
+ /* read from RX FIFO */
+ for (i = 0; i < len; i += 2) {
+ recv_data = w5300_read(wp, Sn_RX_FIFO(s));
+ buf[i] = (u8) ((recv_data & 0xFF00) >> 8);
+ buf[i + 1] = (u8) (recv_data & 0x00FF);
+ }
+}
+
+/* Setting MAC address of W5300 */
+static void w5300_set_macaddr(struct wiz_private *wp, u8 * addr)
+{
+ int i;
+
+ for (i = 0; i < 3; ++i) {
+ u16 mac_addr = (addr[2*i] << 8) | addr[2*i+1];
+
+ w5300_write(wp, SHAR + 2*i, mac_addr);
+ }
+}
+
+/* Opening channels of W5300 */
+static int w5300_channel_open(struct wiz_private *wp, u32 type)
+{
+ int timeout = 1000;
+
+ /* Which type will be used for open? */
+ switch (type) {
+ case Sn_MR_MACRAW:
+ case Sn_MR_MACRAW_MF:
+ w5300_write(wp, Sn_MR(0), type);
+ break;
+ default:
+ netif_err(wp, ifup, wp->dev,
+ "Unknown socket type (%d)\n", type);
+
+ return -EFAULT;
+ }
+
+ w5300_write(wp, Sn_CR(0), Sn_CR_OPEN);
+
+ while (timeout--) {
+ if (!w5300_read(wp, Sn_CR(0)))
+ return 0;
+ udelay(1);
+ }
+
+ return -EBUSY;
+}
+
+/* Activating the interrupt of related channel */
+static void w5300_interrupt_enable(struct wiz_private *wp)
+{
+ u16 mask;
+
+ mask = w5300_read(wp, IMR) | 0x1;
+ w5300_write(wp, IMR, mask);
+}
+
+/* De-activating the interrupt of related channel */
+static void w5300_interrupt_disable(struct wiz_private *wp)
+{
+ u16 mask;
+
+ mask = w5300_read(wp, IMR) & ~0x1;
+ w5300_write(wp, IMR, mask);
+}
+
+/* W5300 initialization function */
+static int w5300_reset(struct net_device *dev)
+{
+ struct wiz_private *wp = netdev_priv(dev);
+ u32 txbuf_total = 0, i;
+ u16 mem_cfg = 0;
+ u16 rx_size, tx_size;
+
+ netif_dbg(wp, drv, wp->dev, "w5300 chip reset\n");
+
+ /* W5300 is initialized by sending RESET command. */
+ w5300_write(wp, MR, MR_RST);
+ mdelay(5);
+
+ /* Mode Register Setting
+ * Ping uses S/W stack of the Linux kernel. Set the Ping Block.*/
+ w5300_write(wp, MR, MR_WDF(1) | MR_PB);
+
+ /* Setting MAC address */
+ w5300_set_macaddr(wp, dev->dev_addr);
+
+ /* Setting the size of Rx/Tx FIFO */
+ for (i = 0; i < MAX_SOCK_NUM; ++i) {
+ if (wp->rxbuf_conf[i] > 64) {
+ netif_err(wp, drv, wp->dev,
+ "Illegal Channel(%d) RX memory size.\n", i);
+
+ return -EINVAL;
+ }
+ if (wp->txbuf_conf[i] > 64) {
+ netif_err(wp, drv, wp->dev,
+ "Illegal Channel(%d) TX memory size.\n", i);
+
+ return -EINVAL;
+ }
+ txbuf_total += wp->txbuf_conf[i];
+ }
+
+ if (txbuf_total % 8) {
+ netif_err(wp, drv, wp->dev,
+ "Illegal memory size register setting.\n");
+
+ return -EINVAL;
+ }
+
+ for (i = 0; i < 4; ++i) {
+ rx_size = (wp->rxbuf_conf[2*i] << 8) | wp->rxbuf_conf[2*i+1];
+ tx_size = (wp->txbuf_conf[2*i] << 8) | wp->txbuf_conf[2*i+1];
+
+ w5300_write(wp, RMSR + 2*i, rx_size);
+ w5300_write(wp, TMSR + 2*i, tx_size);
+ }
+
+ /* Setting FIFO Memory Type (TX&RX) */
+ for (i = 0; i < txbuf_total / 8; ++i) {
+ mem_cfg <<= 1;
+ mem_cfg |= 1;
+ }
+ w5300_write(wp, MTYPER, mem_cfg);
+
+ /* Masking all interrupts */
+ w5300_write(wp, IMR, 0x0000);
+
+ return 0;
+}
+
+/* Interrupt Handler(ISR) */
+static irqreturn_t wiz_interrupt(int irq, void *dev_instance)
+{
+ struct net_device *dev = dev_instance;
+ struct wiz_private *wp = netdev_priv(dev);
+ int timeout = 100;
+ u16 isr, ssr;
+ int s;
+
+ isr = w5300_read(wp, IR);
+
+ /* Completing all interrupts at a time. */
+ while (isr && timeout--) {
+ w5300_write(wp, IR, isr);
+
+ /* Finding the channel to create the interrupt */
+ s = find_first_bit((ulong *)&isr, sizeof(u16));
+ ssr = w5300_read(wp, Sn_IR(s));
+ /* socket interrupt is cleared. */
+ w5300_write(wp, Sn_IR(s), ssr);
+
+ netif_dbg(wp, intr, wp->dev,
+ "ISR = %X, SSR = %X, s = %X\n",
+ isr, ssr, s);
+
+ if (likely(!s)) {
+ if (ssr & Sn_IR_RECV) {
+ /* Interrupt disable. */
+ w5300_interrupt_disable(wp);
+ /* Receiving by polling method */
+ napi_schedule(&wp->napi);
+ }
+ }
+
+ /* Is there any interrupt to be processed? */
+ isr = w5300_read(wp, IR);
+ }
+
+ return IRQ_HANDLED;
+}
+
+static int wiz_open(struct net_device *dev)
+{
+ struct wiz_private *wp = netdev_priv(dev);
+ int ret;
+
+ napi_enable(&wp->napi);
+
+ ret = request_irq(dev->irq, wiz_interrupt, IRQF_SHARED,
+ dev->name, dev);
+ if (ret < 0) {
+ netif_err(wp, ifup, wp->dev, "request_irq() error!\n");
+ return ret;
+ }
+
+ w5300_interrupt_enable(wp);
+
+ /* Sending OPEN command to use channel 0 as MACRAW mode. */
+ ret = w5300_channel_open(wp, Sn_MR_MACRAW_MF);
+ if (ret < 0) {
+ netif_err(wp, ifup, wp->dev, "w5300 channel open fail!\n");
+ return ret;
+ }
+
+ netif_carrier_on(dev);
+ netif_start_queue(dev);
+
+ return 0;
+}
+
+static int wiz_close(struct net_device *dev)
+{
+ struct wiz_private *wp = netdev_priv(dev);
+ int timeout = 1000;
+
+ napi_disable(&wp->napi);
+ netif_carrier_off(dev);
+
+ /* Interrupt masking of all channels */
+ w5300_write(wp, IMR, 0x0000);
+ w5300_write(wp, Sn_CR(0), Sn_CR_CLOSE);
+
+ while (timeout--) {
+ if (!w5300_read(wp, Sn_CR(0)))
+ break;
+ udelay(1);
+ }
+
+ free_irq(dev->irq, dev);
+
+ return 0;
+}
+
+static int w5300_send_data(struct wiz_private *wp, u8 *buf, ssize_t len)
+{
+ int i;
+ u16 send_data;
+ int timeout = 1000;
+
+ /* Writing packets in to Tx FIFO */
+ for (i = 0; i < len; i += 2) {
+ send_data = (buf[i] << 8) | buf[i+1];
+ w5300_write(wp, Sn_TX_FIFO(0), send_data);
+ }
+
+ w5300_write(wp, Sn_TX_WRSR(0), (u16)(len >> 16));
+ w5300_write(wp, Sn_TX_WRSR(0) + 2, (u16)len);
+ w5300_write(wp, Sn_CR(0), Sn_CR_SEND);
+
+ while (timeout--) {
+ if (!w5300_read(wp, Sn_CR(0)))
+ return len;
+ udelay(1);
+ }
+
+ return -EBUSY;
+}
+
+/* Function to transmit data at the MACRAW mode */
+static int wiz_start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct wiz_private *wp = netdev_priv(dev);
+ int ret;
+
+ ret = w5300_send_data(wp, skb->data, skb->len);
+
+ /* Statistical Process */
+ if (ret < 0) {
+ wp->stats.tx_dropped++;
+ } else {
+ wp->stats.tx_bytes += skb->len;
+ wp->stats.tx_packets++;
+ dev->trans_start = jiffies;
+ netif_dbg(wp, tx_done, wp->dev,
+ "tx done, packet size = %d\n", skb->len);
+ }
+ dev_kfree_skb(skb);
+
+ return NETDEV_TX_OK;
+}
+
+static struct net_device_stats *wiz_get_stats(struct net_device *dev)
+{
+ struct wiz_private *wp = netdev_priv(dev);
+
+ return &wp->stats;
+}
+
+/* It is called when multi-cast list or flag is changed. */
+static void wiz_set_multicast(struct net_device *dev)
+{
+ struct wiz_private *wp = netdev_priv(dev);
+ int ret;
+ u32 type = dev->flags & IFF_PROMISC ? Sn_MR_MACRAW : Sn_MR_MACRAW_MF;
+
+ ret = w5300_channel_open(wp, type);
+ if (ret < 0) {
+ netif_err(wp, ifup, wp->dev,
+ "w5300 channel open fail!\n");
+ }
+}
+
+static int wiz_set_mac_address(struct net_device *dev, void *addr)
+{
+ struct wiz_private *wp = netdev_priv(dev);
+ struct sockaddr *sock_addr = addr;
+
+ netif_dbg(wp, drv, wp->dev, "set mac address");
+
+ spin_lock(&wp->lock);
+ w5300_set_macaddr(wp, sock_addr->sa_data);
+ memcpy(dev->dev_addr, sock_addr->sa_data, dev->addr_len);
+ spin_unlock(&wp->lock);
+
+ return 0;
+}
+
+static void wiz_tx_timeout(struct net_device *dev)
+{
+ struct wiz_private *wp = netdev_priv(dev);
+ unsigned long flags;
+
+ netif_dbg(wp, timer, wp->dev, "Transmit timeout");
+
+ spin_lock_irqsave(&wp->lock, flags);
+
+ /* Initializing W5300 chip. */
+ if (w5300_reset(dev) < 0) {
+ netif_err(wp, timer, wp->dev, "w5300 reset fail!\n");
+ return;
+ }
+
+ /* Waking up network interface */
+ netif_wake_queue(dev);
+ spin_unlock_irqrestore(&wp->lock, flags);
+}
+
+/*
+ * Polling Function to process only receiving at the MACRAW mode.
+ * De-activating the interrupt when recv interrupt occurs,
+ * and processing the RECEIVE with this Function
+ * Activating the interrupt after completing RECEIVE process
+ * As recv interrupt often occurs at short intervals,
+ * there will system load in case that interrupt handler process the RECEIVE.
+ */
+static int wiz_rx_poll(struct napi_struct *napi, int budget)
+{
+ struct wiz_private *wp = container_of(napi, struct wiz_private, napi);
+ struct net_device *dev = wp->dev;
+ int npackets = 0;
+
+ /* Processing the RECEIVE during Rx FIFO is containing any packet */
+ while (w5300_get_rxsize(wp, 0) > 0) {
+ struct sk_buff *skb;
+ u16 rxbuf_len, pktlen;
+ u32 crc;
+
+ /* The first 2byte is the information about packet lenth. */
+ w5300_recv_data(wp, 0, (u8 *)&pktlen, 2);
+ pktlen = be16_to_cpu(pktlen);
+
+ netif_dbg(wp, rx_err, wp->dev, "pktlen = %d\n", pktlen);
+
+ /*
+ * Allotting the socket buffer in which packet will be contained
+ * Ethernet packet is of 14byte.
+ * In order to make it multiplied by 2, the buffer allocation
+ * should be 2bytes bigger than the packet.
+ */
+ skb = netdev_alloc_skb_ip_align(dev, pktlen);
+ if (!skb) {
+ u8 temp[pktlen + 4];
+ wp->stats.rx_dropped++;
+ w5300_recv_data(wp, 0, temp, pktlen + 4);
+ continue;
+ }
+
+ /* Initializing the socket buffer */
+ skb->dev = dev;
+ skb_reserve(skb, 2);
+ skb_put(skb, pktlen);
+
+ /* Reading packets from W5300 Rx FIFO into socket buffer. */
+ w5300_recv_data(wp, 0, (u8 *)skb->data, pktlen);
+
+ /* Reading and discarding 4byte CRC. */
+ w5300_recv_data(wp, 0, (u8 *)&crc, 4);
+ crc = be32_to_cpu(crc);
+
+ /* The packet type is Ethernet. */
+ skb->protocol = eth_type_trans(skb, dev);
+
+ /* Passing packets to uppder stack (kernel). */
+ netif_receive_skb(skb);
+
+ /* Processing statistical information */
+ wp->stats.rx_packets++;
+ wp->stats.rx_bytes += pktlen;
+ wp->dev->last_rx = jiffies;
+ rxbuf_len -= pktlen;
+ npackets++;
+
+ if (npackets >= budget)
+ break;
+ }
+
+ /* If packet number is smaller than budget when getting out of loopback,
+ * the RECEIVE process is completed. */
+ if (npackets < budget) {
+ unsigned long flags;
+
+ spin_lock_irqsave(&wp->lock, flags);
+ w5300_interrupt_enable(wp);
+ __napi_complete(napi);
+ spin_unlock_irqrestore(&wp->lock, flags);
+ }
+ return npackets;
+}
+
+static const struct net_device_ops wiz_netdev_ops = {
+ .ndo_open = wiz_open,
+ .ndo_stop = wiz_close,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_set_mac_address = wiz_set_mac_address,
+ .ndo_set_rx_mode = wiz_set_multicast,
+ .ndo_get_stats = wiz_get_stats,
+ .ndo_start_xmit = wiz_start_xmit,
+ .ndo_tx_timeout = wiz_tx_timeout,
+};
+
+/* Initialize W5300 driver. */
+static int __devinit w5300_drv_probe(struct platform_device *pdev)
+{
+ struct net_device *dev;
+ struct wiz_private *wp;
+ struct resource *res;
+ void __iomem *addr;
+ int ret;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ ret = -ENODEV;
+ goto out;
+ }
+
+ /* Request the chip register regions. */
+ if (!request_mem_region(res->start, resource_size(res), DEV_NAME)) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ /* Allocatting struct net_device structure which is managing W5300 */
+ dev = alloc_etherdev(sizeof(struct wiz_private));
+ if (!dev) {
+ ret = -ENOMEM;
+ goto release_region;
+ }
+
+ dev->dma = (unsigned char)-1;
+ dev->irq = platform_get_irq(pdev, 0);
+ wp = netdev_priv(dev);
+ wp->dev = dev;
+ wp->msg_enable = (debug < 0 ? W5300_DEF_MSG_ENABLE : debug);
+ addr = ioremap(res->start, SZ_1M);
+ if (!addr) {
+ ret = -ENOMEM;
+ goto release_both;
+ }
+
+ platform_set_drvdata(pdev, dev);
+ wp->base = addr;
+
+ spin_lock_init(&wp->lock);
+
+ /* Initialization of Rx/Tx FIFO size */
+ memcpy(wp->rxbuf_conf, w5300_rxbuf_conf, MAX_SOCK_NUM);
+ memcpy(wp->txbuf_conf, w5300_txbuf_conf, MAX_SOCK_NUM);
+
+ dev->base_addr = res->start;
+
+ memcpy(dev->dev_addr, w5300_defmac, dev->addr_len);
+ dev->netdev_ops = &wiz_netdev_ops;
+
+ /* Setting napi. Enabling to process max 16 packets at a time. */
+ netif_napi_add(dev, &wp->napi, wiz_rx_poll, 16);
+
+ dev->watchdog_timeo = msecs_to_jiffies(watchdog);
+
+ ret = w5300_reset(dev);
+ if (ret < 0)
+ goto release_both;
+
+ ret = register_netdev(dev);
+ if (ret != 0) {
+ platform_set_drvdata(pdev, NULL);
+ iounmap(addr);
+release_both:
+ free_netdev(dev);
+release_region:
+ release_mem_region(res->start, resource_size(res));
+ }
+out:
+ return ret;
+}
+
+static int __devexit w5300_drv_remove(struct platform_device *pdev)
+{
+ struct net_device *dev = platform_get_drvdata(pdev);
+ struct wiz_private *wp = netdev_priv(dev);
+ struct resource *res;
+
+ platform_set_drvdata(pdev, NULL);
+ unregister_netdev(dev);
+
+ iounmap(wp->base);
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (res != NULL)
+ release_mem_region(res->start, resource_size(res));
+
+ free_netdev(dev);
+
+ return 0;
+}
+
+#ifdef CONFIG_PM
+
+static int w5300_drv_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct net_device *dev = platform_get_drvdata(pdev);
+
+ if (dev) {
+ struct wiz_private *wp = netdev_priv(dev);
+
+ if (netif_running(dev)) {
+ int timeout = 1000;
+
+ netif_carrier_off(dev);
+ netif_device_detach(dev);
+ w5300_write(wp, IMR, 0x0000);
+ w5300_write(wp, Sn_CR(0), Sn_CR_CLOSE);
+
+ while (timeout--) {
+ if (!w5300_read(wp, Sn_CR(0)))
+ return 0;
+ udelay(1);
+ }
+ return -EBUSY;
+ }
+ }
+ return 0;
+}
+
+static int w5300_drv_resume(struct platform_device *pdev)
+{
+ struct net_device *dev = platform_get_drvdata(pdev);
+ int ret = 0;
+
+ if (dev) {
+ struct wiz_private *wp = netdev_priv(dev);
+
+ if (netif_running(dev)) {
+ ret = w5300_reset(dev);
+ if (ret < 0)
+ goto out;
+
+ w5300_interrupt_enable(wp);
+
+ ret = w5300_channel_open(wp, Sn_MR_MACRAW_MF);
+ if (ret < 0)
+ goto out;
+
+ netif_carrier_on(dev);
+ netif_device_attach(dev);
+ }
+ }
+
+out:
+ return ret;
+}
+#endif /* CONFIG_PM */
+
+static struct platform_driver w5300_driver = {
+ .driver = {
+ .name = DEV_NAME,
+ .owner = THIS_MODULE,
+ },
+ .probe = w5300_drv_probe,
+ .remove = __devexit_p(w5300_drv_remove),
+#ifdef CONFIG_PM
+ .suspend = w5300_drv_suspend,
+ .resume = w5300_drv_resume,
+#endif
+};
+
+static int __init wiz_module_init(void)
+{
+ return platform_driver_register(&w5300_driver);
+}
+
+static void __exit wiz_module_exit(void)
+{
+ platform_driver_unregister(&w5300_driver);
+}
+
+module_init(wiz_module_init);
+module_exit(wiz_module_exit);
diff --git a/drivers/net/ethernet/wiznet/w5300.h b/drivers/net/ethernet/wiznet/w5300.h
new file mode 100644
index 0000000..bb6e181
--- /dev/null
+++ b/drivers/net/ethernet/wiznet/w5300.h
@@ -0,1 +1,121 @@
+#ifndef _W5300_H_
+#define _W5300_H_
+
+/* Maximum socket number. W5300 supports max 8 channels. */
+#define MAX_SOCK_NUM 8
+
+/* socket register */
+#define CH_BASE (0x200)
+
+/* size of each channel register map */
+#define CH_SIZE 0x40
+
+#define MR (0) /**< Mode register */
+#define IR (0x02) /**< Interrupt register */
+#define IMR (0x04) /**< Interrupt mask register */
+#define SHAR (0x08) /**< Source MAC register address */
+#define TMSR (0x20) /**< Transmit memory size register */
+#define RMSR (0x28) /**< Receive memory size register */
+
+/*
+ * Memory Type Register
+ * '1' - TX memory
+ * '0' - RX memory
+ */
+#define MTYPER (0x30)
+
+/* Chip ID register(=0x5300) */
+#define IDR (0xFE)
+#define IDR1 (IDR + 1)
+
+/* socket Mode register */
+#define Sn_MR(ch) (CH_BASE + ch * CH_SIZE + 0x00)
+#define Sn_MR1(ch) (Sn_MR(ch)+1)
+
+/* socket command register */
+#define Sn_CR(ch) (CH_BASE + ch * CH_SIZE + 0x02)
+#define Sn_CR1(ch) (Sn_CR(ch)+1);
+
+/* socket interrupt register */
+#define Sn_IR(ch) (CH_BASE + ch * CH_SIZE + 0x06)
+
+/* Transmit Size Register (Byte count) */
+#define Sn_TX_WRSR(ch) (CH_BASE + ch * CH_SIZE + 0x20)
+
+/* Transmit free memory size register (Byte count) */
+#define Sn_TX_FSR(ch) (CH_BASE + ch * CH_SIZE + 0x24)
+
+/* Received data size register (Byte count) */
+#define Sn_RX_RSR(ch) (CH_BASE + ch * CH_SIZE + 0x28)
+
+/* FIFO register for Transmit */
+#define Sn_TX_FIFO(ch) (CH_BASE + ch * CH_SIZE + 0x2E)
+
+/* FIFO register for Receive */
+#define Sn_RX_FIFO(ch) (CH_BASE + ch * CH_SIZE + 0x30)
+
+/* MODE register values */
+#define MR_DBW (1 << 15) /**< Data bus width bit of MR. */
+#define MR_MPF (1 << 14) /**< Mac layer pause frame bit of MR. */
+#define MR_WDF(x) ((x & 0x07) << 11) /**< Write data fetch time bit of MR. */
+#define MR_RDH (1 << 10) /**< Read data hold time bit of MR. */
+#define MR_FS (1 << 8) /**< FIFO swap bit of MR. */
+#define MR_RST (1 << 7) /**< S/W reset bit of MR. */
+#define MR_MT (1 << 5) /**< Memory test bit of MR. */
+#define MR_PB (1 << 4) /**< Ping block bit of MR. */
+#define MR_PPPoE (1 << 3) /**< PPPoE bit of MR. */
+#define MR_DBS (1 << 2) /**< Data bus swap of MR. */
+#define MR_IND (1 << 0) /**< Indirect mode bit of MR. */
+
+/* IR register values */
+#define IR_IPCF (1 << 7) /**< IP conflict bit of IR. */
+#define IR_DPUR (1 << 6) /**< Destination port unreachable bit of IR. */
+#define IR_PPPT (1 << 5) /**< PPPoE terminate bit of IR. */
+#define IR_FMTU (1 << 4) /**< Fragment MTU bit of IR. */
+#define IR_SnINT(n) (0x01 << n) /**< SOCKETn interrupt occurrence bit of IR. */
+
+/* Sn_MR values */
+#define Sn_MR_ALIGN (1 << 8) /**< Alignment bit of Sn_MR. */
+#define Sn_MR_MULTI (1 << 7) /**< Multicasting bit of Sn_MR. */
+#define Sn_MR_MF (1 << 6) /**< MAC filter bit of Sn_MR. */
+#define Sn_MR_IGMPv (1 << 5) /**< IGMP version bit of Sn_MR. */
+#define Sn_MR_ND (1 << 5) /**< No delayed ack bit of Sn_MR. */
+#define Sn_MR_CLOSE 0x00 /**< Protocol bits of Sn_MR. */
+#define Sn_MR_TCP 0x01 /**< Protocol bits of Sn_MR. */
+#define Sn_MR_UDP 0x02 /**< Protocol bits of Sn_MR. */
+#define Sn_MR_IPRAW 0x03 /**< Protocol bits of Sn_MR. */
+#define Sn_MR_MACRAW 0x04 /**< Protocol bits of Sn_MR. */
+#define Sn_MR_MACRAW_MF 0x44 /**< Protocol bits of Sn_MR */
+#define Sn_MR_PPPoE 0x05 /**< Protocol bits of Sn_MR. */
+
+/* Sn_CR values */
+#define Sn_CR_OPEN 0x01 /**< OPEN command value of Sn_CR. */
+#define Sn_CR_LISTEN 0x02 /**< LISTEN command value of Sn_CR. */
+#define Sn_CR_CONNECT 0x04 /**< CONNECT command value of Sn_CR. */
+#define Sn_CR_DISCON 0x08 /**< DISCONNECT command value of Sn_CR. */
+#define Sn_CR_CLOSE 0x10 /**< CLOSE command value of Sn_CR. */
+#define Sn_CR_SEND 0x20 /**< SEND command value of Sn_CR. */
+#define Sn_CR_SEND_MAC 0x21 /**< SEND_MAC command value of Sn_CR. */
+#define Sn_CR_SEND_KEEP 0x22 /**< SEND_KEEP command value of Sn_CR */
+#define Sn_CR_RECV 0x40 /**< RECV command value of Sn_CR */
+#define Sn_CR_PCON 0x23 /**< PCON command value of Sn_CR */
+#define Sn_CR_PDISCON 0x24 /**< PDISCON command value of Sn_CR */
+#define Sn_CR_PCR 0x25 /**< PCR command value of Sn_CR */
+#define Sn_CR_PCN 0x26 /**< PCN command value of Sn_CR */
+#define Sn_CR_PCJ 0x27 /**< PCJ command value of Sn_CR */
+
+/* Sn_IR values */
+#define Sn_IR_PRECV 0x80 /**< PPP receive bit of Sn_IR */
+#define Sn_IR_PFAIL 0x40 /**< PPP fail bit of Sn_IR */
+#define Sn_IR_PNEXT 0x20 /**< PPP next phase bit of Sn_IR */
+#define Sn_IR_SENDOK 0x10 /**< Send OK bit of Sn_IR */
+#define Sn_IR_TIMEOUT 0x08 /**< Timout bit of Sn_IR */
+#define Sn_IR_RECV 0x04 /**< Receive bit of Sn_IR */
+#define Sn_IR_DISCON 0x02 /**< Disconnect bit of Sn_IR */
+#define Sn_IR_CON 0x01 /**< Connect bit of Sn_IR */
+
+/* W5300 Register READ/WRITE funtions(Just 16 bit interface). */
+#define w5300_write(wp, addr, val) writew(val, (wp->base + addr))
+#define w5300_read(wp, addr) readw((wp->base + addr))
+
+#endif /* _W5300_H_ */
--
1.7.1
^ permalink raw reply related
* Re: [BUG] bonding : LOCKDEP warning
From: Eric W. Biederman @ 2011-10-22 8:43 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, David Miller
In-Reply-To: <1319268987.6180.21.camel@edumazet-laptop>
Eric Dumazet <eric.dumazet@gmail.com> writes:
> On latest net-next I got following splat
Eric it is going to be a little bit before I can test this but I believe
we just need the one fix in the patch below. Can you verify this fixes
your lockdep issue.
Thanks,
Eric
>From 60aeafd8976a1117e118574ada44a79b69c75e70 Mon Sep 17 00:00:00 2001
From: Eric W. Biederman <ebiederm@xmission.com>
Date: Sat, 22 Oct 2011 01:36:18 -0700
Subject: [PATCH] bonding: Add a forgetten sysfs_attr_init on class_attr_bonding_masters
When I made class_attr_bonding_matters per network namespace and dynamically
allocated I overlooked the need for calling sysfs_attr_init. Oops.
This fixes the following lockdep splat:
[ 5.749651] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[ 5.749655] bonding: MII link monitoring set to 100 ms
[ 5.749676] BUG: key f49a831c not in .data!
[ 5.749677] ------------[ cut here ]------------
[ 5.749752] WARNING: at kernel/lockdep.c:2897 lockdep_init_map+0x1c3/0x460()
[ 5.749809] Hardware name: ProLiant BL460c G1
[ 5.749862] Modules linked in: bonding(+)
[ 5.749978] Pid: 3177, comm: modprobe Not tainted 3.1.0-rc9-02177-gf2d1a4e-dirty #1157
[ 5.750066] Call Trace:
[ 5.750120] [<c1352c2f>] ? printk+0x18/0x21
[ 5.750176] [<c103112d>] warn_slowpath_common+0x6d/0xa0
[ 5.750231] [<c1060133>] ? lockdep_init_map+0x1c3/0x460
[ 5.750287] [<c1060133>] ? lockdep_init_map+0x1c3/0x460
[ 5.750342] [<c103117d>] warn_slowpath_null+0x1d/0x20
[ 5.750398] [<c1060133>] lockdep_init_map+0x1c3/0x460
[ 5.750453] [<c1355ddd>] ? _raw_spin_unlock+0x1d/0x20
[ 5.750510] [<c11255c8>] ? sysfs_new_dirent+0x68/0x110
[ 5.750565] [<c1124d4b>] sysfs_add_file_mode+0x8b/0xe0
[ 5.750621] [<c1124db3>] sysfs_add_file+0x13/0x20
[ 5.750675] [<c1124e7c>] sysfs_create_file+0x1c/0x20
[ 5.750737] [<c1208f09>] class_create_file+0x19/0x20
[ 5.750794] [<c12c186f>] netdev_class_create_file+0xf/0x20
[ 5.750853] [<f85deaf4>] bond_create_sysfs+0x44/0x90 [bonding]
[ 5.750911] [<f8410947>] ? bond_create_proc_dir+0x1e/0x3e [bonding]
[ 5.750970] [<f841007e>] bond_net_init+0x7e/0x87 [bonding]
[ 5.751026] [<f8410000>] ? 0xf840ffff
[ 5.751080] [<c12abc7a>] ops_init.clone.4+0xba/0x100
[ 5.751135] [<c12abdb2>] ? register_pernet_subsys+0x12/0x30
[ 5.751191] [<c12abd03>] register_pernet_operations.clone.3+0x43/0x80
[ 5.751249] [<c12abdb9>] register_pernet_subsys+0x19/0x30
[ 5.751306] [<f84108b9>] bonding_init+0x832/0x8a2 [bonding]
[ 5.751363] [<c10011f0>] do_one_initcall+0x30/0x160
[ 5.751420] [<f8410087>] ? bond_net_init+0x87/0x87 [bonding]
[ 5.751477] [<c106d5cf>] sys_init_module+0xef/0x1890
[ 5.751533] [<c1356490>] sysenter_do_call+0x12/0x36
[ 5.751588] ---[ end trace 89f492d83a7f5006 ]---
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
drivers/net/bonding/bond_sysfs.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 6044ff8..5a20804 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -1675,6 +1675,7 @@ int bond_create_sysfs(struct bond_net *bn)
int ret;
bn->class_attr_bonding_masters = class_attr_bonding_masters;
+ sysfs_attr_init(&bn->class_attr_bonding_masters.attr);
ret = netdev_class_create_file(&bn->class_attr_bonding_masters);
/*
--
1.7.2.5
^ permalink raw reply related
* Re: [PATCH] net: add sysctl allow_so_priority for SO_PRIORITY setsockopt
From: David Täht @ 2011-10-22 9:01 UTC (permalink / raw)
To: Maciej Żenczykowski; +Cc: David Miller, netdev
In-Reply-To: <CAHo-OoyVSbsxb8U3Y5WCNRsxjr00g1O3HJcT1fmu5cmP5i-JsA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 6481 bytes --]
On 10/22/2011 10:27 AM, Maciej Żenczykowski wrote:
>> I also don't see why we'd want to allow disabling this either.
I have been watching this and the other capability patches go by with
interest. My use case is that I would like to be running "named" as a
non-root user, but would like it to vary the dscp (tos) field on a per
connection basis.
tcp zone transfers = bulk
tcp/udp queries = something like interactive | CS5 (this moves dns
queries into the VI queue on wireless - which can also be done with
SO_PRIORITY)
Having TOS modification as a grant-able capability and otherwise
restricting it makes some sense in a world of otherwise unrestricted
user programs in the clouds, however I note that setting CS1, reducing
something from best effort to background, should also be allowed
universally.
I note that another way to hammer down someone elses (guest machine,
external router, etc) TOS settings would be to do it in iptables, but to
do it on a fine grained basis at present would take up to 63 iptables
rules...
lastly...
The skb->priority field needs some re-thought. In the case of wireless,
it selects a different tx queue based on magic (see net/wireless/utils.c)
/* skb->priority values from 256->263 are magic values to
* directly indicate a specific 802.1d priority. This is used
* to allow 802.1d priority to be passed directly in from VLAN
* tags, etc.
*/
if (skb->priority >= 256 && skb->priority <= 263)
return skb->priority - 256;
classification is an aristotelian rathole!
>> I really hate these patches that offer ways to disable things
>> that normally work, and thus break apps when the non-default
>> is selected.
> Well... the purpose of settings like this is precisely to break functionality
> when the default is not set ;-)
>
>> I kind of have a feeling the kind of situation you're trying to
>> account for, you have some cloud where people run random stuff
>> that you don't control.
> Yes, I have control of the kernel, I have control of root, I have control of
> some daemons that are running on the machine, but I don't really have
> control of the entirety of userspace, some of it I have source code for
> and could audit to guarantee correctness (but I can't really enforce
> that on the users, ultimately they can run any binary),
> and for some of it I don't even have that. Either way, it's much
> easier to delegate setting policy to
> userspace management daemon(s), and leave enforcing it to the kernel.
> This is just one more such knob.
>
>> But you didn't specify this, and we just have to guess. Why don't you
>> describe the specific situation where you want to modify this setting?
>> Please do this instead of just talking about what the side effects are
>> inside of the kernel. That's much less interesting when it comes to
>> patches like this.
> Very well, that's a good point.
>
> Here's an attempt to provide some insight.
>
> I am attempting to allow not-fully-code-audited nor fully trusted apps to run
> in a cgroup containerized environment, with many apps in many
> containers (not 1:1, has hierarchies) on a single kernel.
> The apps are in the believed to not be actively malicious class, but
> very likely to be buggy, or written by ill-advised programmers based
> on wrong/outdated or otherwise incorrect documentation. I cannot rely
> on unprivileged userspace getting things right.
> I have to have some mechanism to grant these apps permissions to
> utilize specific levels of network fabric priority. For this I have
> the aforementioned per-cgroup allowed TOS settings. VLANs are not appropriate
> because a client with high priority net privs is allowed to send a
> request to a server with no special priority permissions.
> (there are further patches to support tcp tos reflection so the server
> can automatically respond with the client's priority)
>
> Multiqueue networking combined with hardware priority queues and xps
> desires to use skb->priority + active cpu for tx queue selection.
> In this particular case TX queue selection should happen based on the
> TOS priority.
> Setting TOS automatically sets sk_priority (and hence skb->priority).
> So all's good, so long as userspace doesn't go and change the
> sk_priority field via SO_PRIORITY and break the mapping.
>
> As a further note:
>
> Some of these apps may be a little more special, a little more
> audited, and a little more trusted.
> Enough so that they might be granted CAP_NET_RAW, but not enough so
> that they can get CAP_NET_ADMIN.
> Hence the general desire for CAP_NET_ADMIN to control general
> machine-global networking state, but not have it control
> per-socket or per-packet settings. ie. bringing up or down an
> interface affects everyone (hence must be CAP_NET_ADMIN, and much more
> tightly controlled), while spoofing a packet doesn't really negatively
> affect anyone (you can't assume the network is trusted, so there can
> be
> external sources of spoofing or eavesdropping anyway).
>
> ---
>
> I could attempt to publish the vast majority of our internal
> networking code base (there isn't really anything secret in there),
> but it's based on 2.6.34 and even after two years of attempting to
> clean it up and refactor it (along with a rebase from 2.6.26, and all
> while actively continuing development) I'm still not at the point were
> I would consider this to be a particular useful course of action
> (there's a lot of bugfixes of bugfixes of crappy patches in there,
> plus hacks, plus tons of backports from upstream, and tons of code
> which is upstream but slightly differently then we have it internally,
> because we had it first, and pushed v2 upstream, etc...). Instead I'm
> trying to get the easy hanging fruit out of the way, rebase our
> patches onto probably 3.2 or 3.3, likely sending some more your way
> during the process, and see where that leaves us. Basically trying to
> reduce the delta. We will always have internal only patches, but the
> fewer, the less burden for us, hence I'm trying to get the ones I
> believe to be potentially useful externally upstreamed. Obviously
> whatever patches you don't accept, we'll still keep around locally.
>
> Maciej
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Dave Täht
[-- Attachment #2: dave_taht.vcf --]
[-- Type: text/x-vcard, Size: 214 bytes --]
begin:vcard
fn;quoted-printable:Dave T=C3=A4ht
n;quoted-printable:T=C3=A4ht;Dave
email;internet:dave.taht@gmail.com
tel;home:1-239-829-5608
tel;cell:0638645374
x-mozilla-html:FALSE
version:2.1
end:vcard
^ permalink raw reply
* Re: [BUG] bonding : LOCKDEP warning
From: Eric Dumazet @ 2011-10-22 9:05 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: netdev, David Miller
In-Reply-To: <m14nz1l8mc.fsf@fess.ebiederm.org>
Le samedi 22 octobre 2011 à 01:43 -0700, Eric W. Biederman a écrit :
> Eric Dumazet <eric.dumazet@gmail.com> writes:
>
> > On latest net-next I got following splat
>
> Eric it is going to be a little bit before I can test this but I believe
> we just need the one fix in the patch below. Can you verify this fixes
> your lockdep issue.
>
> Thanks,
>
> Eric
>
>
> From 60aeafd8976a1117e118574ada44a79b69c75e70 Mon Sep 17 00:00:00 2001
> From: Eric W. Biederman <ebiederm@xmission.com>
> Date: Sat, 22 Oct 2011 01:36:18 -0700
> Subject: [PATCH] bonding: Add a forgetten sysfs_attr_init on class_attr_bonding_masters
>
> When I made class_attr_bonding_matters per network namespace and dynamically
> allocated I overlooked the need for calling sysfs_attr_init. Oops.
>
> This fixes the following lockdep splat:
>
> [ 5.749651] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
> [ 5.749655] bonding: MII link monitoring set to 100 ms
> [ 5.749676] BUG: key f49a831c not in .data!
> [ 5.749677] ------------[ cut here ]------------
> [ 5.749752] WARNING: at kernel/lockdep.c:2897 lockdep_init_map+0x1c3/0x460()
> [ 5.749809] Hardware name: ProLiant BL460c G1
> [ 5.749862] Modules linked in: bonding(+)
> [ 5.749978] Pid: 3177, comm: modprobe Not tainted 3.1.0-rc9-02177-gf2d1a4e-dirty #1157
> [ 5.750066] Call Trace:
> [ 5.750120] [<c1352c2f>] ? printk+0x18/0x21
> [ 5.750176] [<c103112d>] warn_slowpath_common+0x6d/0xa0
> [ 5.750231] [<c1060133>] ? lockdep_init_map+0x1c3/0x460
> [ 5.750287] [<c1060133>] ? lockdep_init_map+0x1c3/0x460
> [ 5.750342] [<c103117d>] warn_slowpath_null+0x1d/0x20
> [ 5.750398] [<c1060133>] lockdep_init_map+0x1c3/0x460
> [ 5.750453] [<c1355ddd>] ? _raw_spin_unlock+0x1d/0x20
> [ 5.750510] [<c11255c8>] ? sysfs_new_dirent+0x68/0x110
> [ 5.750565] [<c1124d4b>] sysfs_add_file_mode+0x8b/0xe0
> [ 5.750621] [<c1124db3>] sysfs_add_file+0x13/0x20
> [ 5.750675] [<c1124e7c>] sysfs_create_file+0x1c/0x20
> [ 5.750737] [<c1208f09>] class_create_file+0x19/0x20
> [ 5.750794] [<c12c186f>] netdev_class_create_file+0xf/0x20
> [ 5.750853] [<f85deaf4>] bond_create_sysfs+0x44/0x90 [bonding]
> [ 5.750911] [<f8410947>] ? bond_create_proc_dir+0x1e/0x3e [bonding]
> [ 5.750970] [<f841007e>] bond_net_init+0x7e/0x87 [bonding]
> [ 5.751026] [<f8410000>] ? 0xf840ffff
> [ 5.751080] [<c12abc7a>] ops_init.clone.4+0xba/0x100
> [ 5.751135] [<c12abdb2>] ? register_pernet_subsys+0x12/0x30
> [ 5.751191] [<c12abd03>] register_pernet_operations.clone.3+0x43/0x80
> [ 5.751249] [<c12abdb9>] register_pernet_subsys+0x19/0x30
> [ 5.751306] [<f84108b9>] bonding_init+0x832/0x8a2 [bonding]
> [ 5.751363] [<c10011f0>] do_one_initcall+0x30/0x160
> [ 5.751420] [<f8410087>] ? bond_net_init+0x87/0x87 [bonding]
> [ 5.751477] [<c106d5cf>] sys_init_module+0xef/0x1890
> [ 5.751533] [<c1356490>] sysenter_do_call+0x12/0x36
> [ 5.751588] ---[ end trace 89f492d83a7f5006 ]---
>
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
> ---
> drivers/net/bonding/bond_sysfs.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
> index 6044ff8..5a20804 100644
> --- a/drivers/net/bonding/bond_sysfs.c
> +++ b/drivers/net/bonding/bond_sysfs.c
> @@ -1675,6 +1675,7 @@ int bond_create_sysfs(struct bond_net *bn)
> int ret;
>
> bn->class_attr_bonding_masters = class_attr_bonding_masters;
> + sysfs_attr_init(&bn->class_attr_bonding_masters.attr);
>
> ret = netdev_class_create_file(&bn->class_attr_bonding_masters);
> /*
Reported-and-tested-by: Eric Dumazet <eric.dumazet@gmail.com>
Thanks a lot Eric !
^ permalink raw reply
* Re: [BUG] bonding : LOCKDEP warning
From: David Miller @ 2011-10-22 9:09 UTC (permalink / raw)
To: eric.dumazet; +Cc: ebiederm, netdev
In-Reply-To: <1319274349.6180.23.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 22 Oct 2011 11:05:49 +0200
> Reported-and-tested-by: Eric Dumazet <eric.dumazet@gmail.com>
Patchwork says "parse error"
I'll fix it up this time, but please do not use free form
tags like this in the future. Thanks.
^ permalink raw reply
* Re: [BUG] bonding : LOCKDEP warning
From: Eric Dumazet @ 2011-10-22 9:19 UTC (permalink / raw)
To: David Miller; +Cc: ebiederm, netdev
In-Reply-To: <20111022.050914.551507702374659667.davem@davemloft.net>
Le samedi 22 octobre 2011 à 05:09 -0400, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Sat, 22 Oct 2011 11:05:49 +0200
>
> > Reported-and-tested-by: Eric Dumazet <eric.dumazet@gmail.com>
>
> Patchwork says "parse error"
>
> I'll fix it up this time, but please do not use free form
> tags like this in the future. Thanks.
Strange, it seems quite usual these days, you're the first one to
complain. Maybe compain to Patchwork ?
Reported-and-tested-by: Shlomo Pongratz <shlomop@mellanox.com>
Reported-and-tested-by: Simon Kirby <sim@hostway.ca>
Reported-and-tested-by: Amir Vadai <amirv@dev.mellanox.co.il>
Reported-and-tested-by: Alexandre Oliva <aoliva@redhat.com>
Reported-and-tested-by: Rocko Requin <rockorequin@hotmail.com>
Reported-and-tested-by: Richard Cochran <richardcochran@gmail.com>
Reported-and-tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Reported-and-tested-by: Hor Jiun Shyong <jiunshyong@gmail.com>
Reported-and-tested-by: Eric Dumazet <eric.dumazet@gmail.com>
Reported-and-tested-by: Eric Dumazet <eric.dumazet@gmail.com>
Reported-and-tested-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reported-and-tested-by: Jan Teichmann <jan.teichmann@gmail.com>
Reported-and-tested-by: Arnaud Lacombe <lacombar@gmail.com>
Reported-and-tested-by: Jim Bray <jimsantelmo@gmail.com>
Reported-and-tested-by: Muhammad Khurram Khan
Reported-and-tested-by: Matej Laitl <matej@laitl.cz>
Reported-and-tested-by: Thomas Seilund <tps@netmaster.dk>
Reported-and-tested-by: René Fritz <rene@colorcube.de>
Reported-and-tested-by: Randy Dunlap <rdunlap@xenotime.net>
Reported-and-tested-by: William Light <wrl@illest.net>
Reported-and-tested-by: Xiaotian Feng <xtfeng@gmail.com>
Reported-and-tested-by: Dave Jones <davej@redhat.com>
Reported-and-tested-by: Xiaotian Feng <xtfeng@gmail.com>
Reported-and-tested-by: Joachim Eastwood <manabian@gmail.com>
Reported-and-tested-by: Pavel Roskin <proski@gnu.org>
Reported-and-tested-by: Christian Casteyde <casteyde.christian@free.fr>
Reported-and-tested-by: Sebastian Siewior <sebastian@breakpoint.cc>
...
^ permalink raw reply
* [PATCH 31/49] ISDN: irq: Remove IRQF_DISABLED
From: Yong Zhang @ 2011-10-22 9:56 UTC (permalink / raw)
To: linux-kernel; +Cc: tglx, Armin Schindler, Karsten Keil, netdev
In-Reply-To: <1319277421-9203-1-git-send-email-yong.zhang0@gmail.com>
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
We run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler
returns with interrupts enabled (see commit [b738a50a:
genirq: Warn when handler enables interrupts]).
So now this flag is a NOOP and can be removed.
Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
---
drivers/isdn/hardware/eicon/divasmain.c | 2 +-
drivers/isdn/sc/init.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
index f332b60..8a0a831 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -481,7 +481,7 @@ void __inline__ outpp(void __iomem *addr, word p)
int diva_os_register_irq(void *context, byte irq, const char *name)
{
int result = request_irq(irq, diva_os_irq_wrapper,
- IRQF_DISABLED | IRQF_SHARED, name, context);
+ IRQF_SHARED, name, context);
return (result);
}
diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c
index ca710ab..a3127fb 100644
--- a/drivers/isdn/sc/init.c
+++ b/drivers/isdn/sc/init.c
@@ -336,7 +336,7 @@ static int __init sc_init(void)
*/
sc_adapter[cinst]->interrupt = irq[b];
if (request_irq(sc_adapter[cinst]->interrupt, interrupt_handler,
- IRQF_DISABLED, interface->id,
+ 0, interface->id,
(void *)(unsigned long) cinst))
{
kfree(sc_adapter[cinst]->channel);
--
1.7.1
^ permalink raw reply related
* [PATCH 35/49] net: irq: Remove IRQF_DISABLED
From: Yong Zhang @ 2011-10-22 9:56 UTC (permalink / raw)
To: linux-kernel
Cc: tglx, Jaroslav Kysela, Breno Leitao, Olof Johansson,
Nicolas Pitre, Steve Glendinning, Geoff Levand, Thomas Sailer,
Joerg Reuter, Klaus Kudielka, Jean-Paul Roubelat, Samuel Ortiz,
Christian Lamparter, John W. Linville, David S. Miller,
uclinux-dist-devel, netdev, cbe-oss-dev, linux-hams,
linux-wireless
In-Reply-To: <1319277421-9203-1-git-send-email-yong.zhang0@gmail.com>
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
We run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler
returns with interrupts enabled (see commit [b738a50a:
genirq: Warn when handler enables interrupts]).
So now this flag is a NOOP and can be removed.
Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
---
drivers/net/ethernet/adi/bfin_mac.c | 4 ++--
drivers/net/ethernet/amd/sun3lance.c | 2 +-
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 4 ++--
drivers/net/ethernet/dec/tulip/de4x5.c | 2 +-
drivers/net/ethernet/freescale/fec.c | 2 +-
drivers/net/ethernet/hp/hp100.c | 2 +-
drivers/net/ethernet/ibm/ehea/ehea_main.c | 6 +++---
drivers/net/ethernet/korina.c | 8 ++++----
drivers/net/ethernet/lantiq_etop.c | 4 ++--
drivers/net/ethernet/marvell/pxa168_eth.c | 2 +-
drivers/net/ethernet/micrel/ks8851_mll.c | 2 +-
drivers/net/ethernet/natsemi/jazzsonic.c | 2 +-
drivers/net/ethernet/natsemi/xtsonic.c | 2 +-
drivers/net/ethernet/pasemi/pasemi_mac.c | 4 ++--
drivers/net/ethernet/smsc/smc91x.h | 2 +-
drivers/net/ethernet/smsc/smsc9420.c | 2 +-
drivers/net/ethernet/ti/davinci_emac.c | 2 +-
drivers/net/ethernet/toshiba/ps3_gelic_net.c | 2 +-
drivers/net/hamradio/baycom_ser_fdx.c | 2 +-
drivers/net/hamradio/baycom_ser_hdx.c | 2 +-
drivers/net/hamradio/scc.c | 2 +-
drivers/net/hamradio/yam.c | 2 +-
drivers/net/irda/bfin_sir.c | 4 ++--
drivers/net/irda/donauboe.c | 4 ++--
drivers/net/irda/sh_irda.c | 2 +-
drivers/net/irda/sh_sir.c | 2 +-
drivers/net/wan/hostess_sv11.c | 2 +-
drivers/net/wan/sealevel.c | 2 +-
drivers/net/wireless/p54/p54spi.c | 2 +-
include/net/irda/irda_device.h | 2 +-
30 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethernet/adi/bfin_mac.c
index b6d69c9..0d3804f 100644
--- a/drivers/net/ethernet/adi/bfin_mac.c
+++ b/drivers/net/ethernet/adi/bfin_mac.c
@@ -531,7 +531,7 @@ static int bfin_mac_ethtool_setwol(struct net_device *dev,
if (lp->wol && !lp->irq_wake_requested) {
/* register wake irq handler */
rc = request_irq(IRQ_MAC_WAKEDET, bfin_mac_wake_interrupt,
- IRQF_DISABLED, "EMAC_WAKE", dev);
+ 0, "EMAC_WAKE", dev);
if (rc)
return rc;
lp->irq_wake_requested = true;
@@ -1544,7 +1544,7 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev)
/* now, enable interrupts */
/* register irq handler */
rc = request_irq(IRQ_MAC_RX, bfin_mac_interrupt,
- IRQF_DISABLED, "EMAC_RX", ndev);
+ 0, "EMAC_RX", ndev);
if (rc) {
dev_err(&pdev->dev, "Cannot request Blackfin MAC RX IRQ!\n");
rc = -EBUSY;
diff --git a/drivers/net/ethernet/amd/sun3lance.c b/drivers/net/ethernet/amd/sun3lance.c
index 080b71f..9aee9f7 100644
--- a/drivers/net/ethernet/amd/sun3lance.c
+++ b/drivers/net/ethernet/amd/sun3lance.c
@@ -358,7 +358,7 @@ static int __init lance_probe( struct net_device *dev)
REGA(CSR0) = CSR0_STOP;
- if (request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev) < 0) {
+ if (request_irq(LANCE_IRQ, lance_interrupt, 0, "SUN3 Lance", dev) < 0) {
#ifdef CONFIG_SUN3
iounmap((void __iomem *)ioaddr);
#endif
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index a11a8ad..25d6875 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -840,13 +840,13 @@ static int bcm_enet_open(struct net_device *dev)
if (ret)
goto out_phy_disconnect;
- ret = request_irq(priv->irq_rx, bcm_enet_isr_dma, IRQF_DISABLED,
+ ret = request_irq(priv->irq_rx, bcm_enet_isr_dma, 0,
dev->name, dev);
if (ret)
goto out_freeirq;
ret = request_irq(priv->irq_tx, bcm_enet_isr_dma,
- IRQF_DISABLED, dev->name, dev);
+ 0, dev->name, dev);
if (ret)
goto out_freeirq_rx;
diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c
index 871bcaa..7dd7989 100644
--- a/drivers/net/ethernet/dec/tulip/de4x5.c
+++ b/drivers/net/ethernet/dec/tulip/de4x5.c
@@ -1321,7 +1321,7 @@ de4x5_open(struct net_device *dev)
if (request_irq(dev->irq, de4x5_interrupt, IRQF_SHARED,
lp->adapter_name, dev)) {
printk("de4x5_open(): Requested IRQ%d is busy - attemping FAST/SHARE...", dev->irq);
- if (request_irq(dev->irq, de4x5_interrupt, IRQF_DISABLED | IRQF_SHARED,
+ if (request_irq(dev->irq, de4x5_interrupt, IRQF_SHARED,
lp->adapter_name, dev)) {
printk("\n Cannot get IRQ- reconfigure your hardware.\n");
disable_ast(dev);
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 1124ce0..642c567 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1573,7 +1573,7 @@ fec_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, i);
if (i && irq < 0)
break;
- ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev);
+ ret = request_irq(irq, fec_enet_interrupt, 0, pdev->name, ndev);
if (ret) {
while (--i >= 0) {
irq = platform_get_irq(pdev, i);
diff --git a/drivers/net/ethernet/hp/hp100.c b/drivers/net/ethernet/hp/hp100.c
index 6a5ee07..4c4f3f4 100644
--- a/drivers/net/ethernet/hp/hp100.c
+++ b/drivers/net/ethernet/hp/hp100.c
@@ -1097,7 +1097,7 @@ static int hp100_open(struct net_device *dev)
/* New: if bus is PCI or EISA, interrupts might be shared interrupts */
if (request_irq(dev->irq, hp100_interrupt,
lp->bus == HP100_BUS_PCI || lp->bus ==
- HP100_BUS_EISA ? IRQF_SHARED : IRQF_DISABLED,
+ HP100_BUS_EISA ? IRQF_SHARED : 0,
"hp100", dev)) {
printk("hp100: %s: unable to get IRQ %d\n", dev->name, dev->irq);
return -EAGAIN;
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index dfefe80..192a1bb 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -1348,7 +1348,7 @@ static int ehea_reg_interrupts(struct net_device *dev)
ret = ibmebus_request_irq(port->qp_eq->attr.ist1,
ehea_qp_aff_irq_handler,
- IRQF_DISABLED, port->int_aff_name, port);
+ 0, port->int_aff_name, port);
if (ret) {
netdev_err(dev, "failed registering irq for qp_aff_irq_handler:ist=%X\n",
port->qp_eq->attr.ist1);
@@ -1366,7 +1366,7 @@ static int ehea_reg_interrupts(struct net_device *dev)
"%s-queue%d", dev->name, i);
ret = ibmebus_request_irq(pr->eq->attr.ist1,
ehea_recv_irq_handler,
- IRQF_DISABLED, pr->int_send_name,
+ 0, pr->int_send_name,
pr);
if (ret) {
netdev_err(dev, "failed registering irq for ehea_queue port_res_nr:%d, ist=%X\n",
@@ -3521,7 +3521,7 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
(unsigned long)adapter);
ret = ibmebus_request_irq(adapter->neq->attr.ist1,
- ehea_interrupt_neq, IRQF_DISABLED,
+ ehea_interrupt_neq, 0,
"ehea_neq", adapter);
if (ret) {
dev_err(&dev->dev, "requesting NEQ IRQ failed\n");
diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
index d8430f4..2a96cd5 100644
--- a/drivers/net/ethernet/korina.c
+++ b/drivers/net/ethernet/korina.c
@@ -1001,14 +1001,14 @@ static int korina_open(struct net_device *dev)
* that handles the Done Finished
* Ovr and Und Events */
ret = request_irq(lp->rx_irq, korina_rx_dma_interrupt,
- IRQF_DISABLED, "Korina ethernet Rx", dev);
+ 0, "Korina ethernet Rx", dev);
if (ret < 0) {
printk(KERN_ERR "%s: unable to get Rx DMA IRQ %d\n",
dev->name, lp->rx_irq);
goto err_release;
}
ret = request_irq(lp->tx_irq, korina_tx_dma_interrupt,
- IRQF_DISABLED, "Korina ethernet Tx", dev);
+ 0, "Korina ethernet Tx", dev);
if (ret < 0) {
printk(KERN_ERR "%s: unable to get Tx DMA IRQ %d\n",
dev->name, lp->tx_irq);
@@ -1017,7 +1017,7 @@ static int korina_open(struct net_device *dev)
/* Install handler for overrun error. */
ret = request_irq(lp->ovr_irq, korina_ovr_interrupt,
- IRQF_DISABLED, "Ethernet Overflow", dev);
+ 0, "Ethernet Overflow", dev);
if (ret < 0) {
printk(KERN_ERR "%s: unable to get OVR IRQ %d\n",
dev->name, lp->ovr_irq);
@@ -1026,7 +1026,7 @@ static int korina_open(struct net_device *dev)
/* Install handler for underflow error. */
ret = request_irq(lp->und_irq, korina_und_interrupt,
- IRQF_DISABLED, "Ethernet Underflow", dev);
+ 0, "Ethernet Underflow", dev);
if (ret < 0) {
printk(KERN_ERR "%s: unable to get UND IRQ %d\n",
dev->name, lp->und_irq);
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index 6bb2b95..d9a268c 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -280,7 +280,7 @@ ltq_etop_hw_init(struct net_device *dev)
if (IS_TX(i)) {
ltq_dma_alloc_tx(&ch->dma);
- request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED,
+ request_irq(irq, ltq_etop_dma_irq, 0,
"etop_tx", priv);
} else if (IS_RX(i)) {
ltq_dma_alloc_rx(&ch->dma);
@@ -289,7 +289,7 @@ ltq_etop_hw_init(struct net_device *dev)
if (ltq_etop_alloc_skb(ch))
return -ENOMEM;
ch->dma.desc = 0;
- request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED,
+ request_irq(irq, ltq_etop_dma_irq, 0,
"etop_rx", priv);
}
ch->dma.irq = irq;
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index d17d062..4e2b30d 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1132,7 +1132,7 @@ static int pxa168_eth_open(struct net_device *dev)
int err;
err = request_irq(dev->irq, pxa168_eth_int_handler,
- IRQF_DISABLED, dev->name, dev);
+ 0, dev->name, dev);
if (err) {
dev_printk(KERN_ERR, &dev->dev, "can't assign irq\n");
return -EAGAIN;
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
index d19c849..a6b427b 100644
--- a/drivers/net/ethernet/micrel/ks8851_mll.c
+++ b/drivers/net/ethernet/micrel/ks8851_mll.c
@@ -899,7 +899,7 @@ static int ks_net_open(struct net_device *netdev)
struct ks_net *ks = netdev_priv(netdev);
int err;
-#define KS_INT_FLAGS (IRQF_DISABLED|IRQF_TRIGGER_LOW)
+#define KS_INT_FLAGS (IRQF_TRIGGER_LOW)
/* lock the card, even if we may not actually do anything
* else at the moment.
*/
diff --git a/drivers/net/ethernet/natsemi/jazzsonic.c b/drivers/net/ethernet/natsemi/jazzsonic.c
index fc7c6a9..ecc3467 100644
--- a/drivers/net/ethernet/natsemi/jazzsonic.c
+++ b/drivers/net/ethernet/natsemi/jazzsonic.c
@@ -84,7 +84,7 @@ static int jazzsonic_open(struct net_device* dev)
{
int retval;
- retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED,
+ retval = request_irq(dev->irq, sonic_interrupt, 0,
"sonic", dev);
if (retval) {
printk(KERN_ERR "%s: unable to get IRQ %d.\n",
diff --git a/drivers/net/ethernet/natsemi/xtsonic.c b/drivers/net/ethernet/natsemi/xtsonic.c
index ccf61b9..04de013 100644
--- a/drivers/net/ethernet/natsemi/xtsonic.c
+++ b/drivers/net/ethernet/natsemi/xtsonic.c
@@ -95,7 +95,7 @@ static int xtsonic_open(struct net_device *dev)
{
int retval;
- retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED,
+ retval = request_irq(dev->irq, sonic_interrupt, 0,
"sonic", dev);
if (retval) {
printk(KERN_ERR "%s: unable to get IRQ %d.\n",
diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c
index c6f0056..bb7c5fc 100644
--- a/drivers/net/ethernet/pasemi/pasemi_mac.c
+++ b/drivers/net/ethernet/pasemi/pasemi_mac.c
@@ -1218,7 +1218,7 @@ static int pasemi_mac_open(struct net_device *dev)
snprintf(mac->tx_irq_name, sizeof(mac->tx_irq_name), "%s tx",
dev->name);
- ret = request_irq(mac->tx->chan.irq, pasemi_mac_tx_intr, IRQF_DISABLED,
+ ret = request_irq(mac->tx->chan.irq, pasemi_mac_tx_intr, 0,
mac->tx_irq_name, mac->tx);
if (ret) {
dev_err(&mac->pdev->dev, "request_irq of irq %d failed: %d\n",
@@ -1229,7 +1229,7 @@ static int pasemi_mac_open(struct net_device *dev)
snprintf(mac->rx_irq_name, sizeof(mac->rx_irq_name), "%s rx",
dev->name);
- ret = request_irq(mac->rx->chan.irq, pasemi_mac_rx_intr, IRQF_DISABLED,
+ ret = request_irq(mac->rx->chan.irq, pasemi_mac_rx_intr, 0,
mac->rx_irq_name, mac->rx);
if (ret) {
dev_err(&mac->pdev->dev, "request_irq of irq %d failed: %d\n",
diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h
index 5f53fbb..e6319f5 100644
--- a/drivers/net/ethernet/smsc/smc91x.h
+++ b/drivers/net/ethernet/smsc/smc91x.h
@@ -271,7 +271,7 @@ static inline void mcf_outsw(void *a, unsigned char *p, int l)
#define SMC_insw(a, r, p, l) mcf_insw(a + r, p, l)
#define SMC_outsw(a, r, p, l) mcf_outsw(a + r, p, l)
-#define SMC_IRQ_FLAGS (IRQF_DISABLED)
+#define SMC_IRQ_FLAGS (0)
#else
diff --git a/drivers/net/ethernet/smsc/smsc9420.c b/drivers/net/ethernet/smsc/smsc9420.c
index edb24b0..a13c8ce 100644
--- a/drivers/net/ethernet/smsc/smsc9420.c
+++ b/drivers/net/ethernet/smsc/smsc9420.c
@@ -1360,7 +1360,7 @@ static int smsc9420_open(struct net_device *dev)
smsc9420_reg_write(pd, INT_STAT, 0xFFFFFFFF);
smsc9420_pci_flush_write(pd);
- if (request_irq(dev->irq, smsc9420_isr, IRQF_SHARED | IRQF_DISABLED,
+ if (request_irq(dev->irq, smsc9420_isr, IRQF_SHARED,
DRV_NAME, pd)) {
smsc_warn(IFUP, "Unable to use IRQ = %d", dev->irq);
result = -ENODEV;
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 815c797..ba8cb9d 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1553,7 +1553,7 @@ static int emac_dev_open(struct net_device *ndev)
while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, k))) {
for (i = res->start; i <= res->end; i++) {
- if (request_irq(i, emac_irq, IRQF_DISABLED,
+ if (request_irq(i, emac_irq, 0,
ndev->name, ndev))
goto rollback;
}
diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
index 7bf1e20..7036cb7 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
@@ -1735,7 +1735,7 @@ static int __devinit ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
goto fail_alloc_irq;
}
result = request_irq(card->irq, gelic_card_interrupt,
- IRQF_DISABLED, netdev->name, card);
+ 0, netdev->name, card);
if (result) {
dev_info(ctodev(card), "%s:request_irq failed (%d)\n",
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c
index a974727..636b65c 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -445,7 +445,7 @@ static int ser12_open(struct net_device *dev)
outb(0, FCR(dev->base_addr)); /* disable FIFOs */
outb(0x0d, MCR(dev->base_addr));
outb(0, IER(dev->base_addr));
- if (request_irq(dev->irq, ser12_interrupt, IRQF_DISABLED | IRQF_SHARED,
+ if (request_irq(dev->irq, ser12_interrupt, IRQF_SHARED,
"baycom_ser_fdx", dev)) {
release_region(dev->base_addr, SER12_EXTENT);
return -EBUSY;
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index e349d86..f9a8976 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -490,7 +490,7 @@ static int ser12_open(struct net_device *dev)
outb(0, FCR(dev->base_addr)); /* disable FIFOs */
outb(0x0d, MCR(dev->base_addr));
outb(0, IER(dev->base_addr));
- if (request_irq(dev->irq, ser12_interrupt, IRQF_DISABLED | IRQF_SHARED,
+ if (request_irq(dev->irq, ser12_interrupt, IRQF_SHARED,
"baycom_ser12", dev)) {
release_region(dev->base_addr, SER12_EXTENT);
return -EBUSY;
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index 3365581..f432f32 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -1735,7 +1735,7 @@ static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
if (!Ivec[hwcfg.irq].used && hwcfg.irq)
{
if (request_irq(hwcfg.irq, scc_isr,
- IRQF_DISABLED, "AX.25 SCC",
+ 0, "AX.25 SCC",
(void *)(long) hwcfg.irq))
printk(KERN_WARNING "z8530drv: warning, cannot get IRQ %d\n", hwcfg.irq);
else
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 96a98d2..9d60f06 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -890,7 +890,7 @@ static int yam_open(struct net_device *dev)
goto out_release_base;
}
outb(0, IER(dev->base_addr));
- if (request_irq(dev->irq, yam_interrupt, IRQF_DISABLED | IRQF_SHARED, dev->name, dev)) {
+ if (request_irq(dev->irq, yam_interrupt, IRQF_SHARED, dev->name, dev)) {
printk(KERN_ERR "%s: irq %d busy\n", dev->name, dev->irq);
ret = -EBUSY;
goto out_release_base;
diff --git a/drivers/net/irda/bfin_sir.c b/drivers/net/irda/bfin_sir.c
index 9d4ce1a..529317b 100644
--- a/drivers/net/irda/bfin_sir.c
+++ b/drivers/net/irda/bfin_sir.c
@@ -410,12 +410,12 @@ static int bfin_sir_startup(struct bfin_sir_port *port, struct net_device *dev)
#else
- if (request_irq(port->irq, bfin_sir_rx_int, IRQF_DISABLED, "BFIN_SIR_RX", dev)) {
+ if (request_irq(port->irq, bfin_sir_rx_int, 0, "BFIN_SIR_RX", dev)) {
dev_warn(&dev->dev, "Unable to attach SIR RX interrupt\n");
return -EBUSY;
}
- if (request_irq(port->irq+1, bfin_sir_tx_int, IRQF_DISABLED, "BFIN_SIR_TX", dev)) {
+ if (request_irq(port->irq+1, bfin_sir_tx_int, 0, "BFIN_SIR_TX", dev)) {
dev_warn(&dev->dev, "Unable to attach SIR TX interrupt\n");
free_irq(port->irq, dev);
return -EBUSY;
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index b45b2cc..04e4528 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -1353,7 +1353,7 @@ toshoboe_net_open (struct net_device *dev)
return 0;
rc = request_irq (self->io.irq, toshoboe_interrupt,
- IRQF_SHARED | IRQF_DISABLED, dev->name, self);
+ IRQF_SHARED, dev->name, self);
if (rc)
return rc;
@@ -1560,7 +1560,7 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
self->io.fir_base = self->base;
self->io.fir_ext = OBOE_IO_EXTENT;
self->io.irq = pci_dev->irq;
- self->io.irqflags = IRQF_SHARED | IRQF_DISABLED;
+ self->io.irqflags = IRQF_SHARED;
self->speed = self->io.speed = 9600;
self->async = 0;
diff --git a/drivers/net/irda/sh_irda.c b/drivers/net/irda/sh_irda.c
index d275e27..bc77767 100644
--- a/drivers/net/irda/sh_irda.c
+++ b/drivers/net/irda/sh_irda.c
@@ -809,7 +809,7 @@ static int __devinit sh_irda_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ndev);
- if (request_irq(irq, sh_irda_irq, IRQF_DISABLED, "sh_irda", self)) {
+ if (request_irq(irq, sh_irda_irq, 0, "sh_irda", self)) {
dev_warn(&pdev->dev, "Unable to attach sh_irda interrupt\n");
goto err_mem_4;
}
diff --git a/drivers/net/irda/sh_sir.c b/drivers/net/irda/sh_sir.c
index ed7d7d6..d5575f7 100644
--- a/drivers/net/irda/sh_sir.c
+++ b/drivers/net/irda/sh_sir.c
@@ -761,7 +761,7 @@ static int __devinit sh_sir_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ndev);
- if (request_irq(irq, sh_sir_irq, IRQF_DISABLED, "sh_sir", self)) {
+ if (request_irq(irq, sh_sir_irq, 0, "sh_sir", self)) {
dev_warn(&pdev->dev, "Unable to attach sh_sir interrupt\n");
goto err_mem_4;
}
diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c
index 3d80e42..3d74166 100644
--- a/drivers/net/wan/hostess_sv11.c
+++ b/drivers/net/wan/hostess_sv11.c
@@ -220,7 +220,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
/* We want a fast IRQ for this device. Actually we'd like an even faster
IRQ ;) - This is one driver RtLinux is made for */
- if (request_irq(irq, z8530_interrupt, IRQF_DISABLED,
+ if (request_irq(irq, z8530_interrupt, 0,
"Hostess SV11", sv) < 0) {
pr_warn("IRQ %d already in use\n", irq);
goto err_irq;
diff --git a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c
index 0b4fd05..6027e47 100644
--- a/drivers/net/wan/sealevel.c
+++ b/drivers/net/wan/sealevel.c
@@ -266,7 +266,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,
/* We want a fast IRQ for this device. Actually we'd like an even faster
IRQ ;) - This is one driver RtLinux is made for */
- if (request_irq(irq, z8530_interrupt, IRQF_DISABLED,
+ if (request_irq(irq, z8530_interrupt, 0,
"SeaLevel", dev) < 0) {
pr_warn("IRQ %d already in use\n", irq);
goto err_request_irq;
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index f18df82..c901e07 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -641,7 +641,7 @@ static int __devinit p54spi_probe(struct spi_device *spi)
gpio_direction_input(p54spi_gpio_irq);
ret = request_irq(gpio_to_irq(p54spi_gpio_irq),
- p54spi_interrupt, IRQF_DISABLED, "p54spi",
+ p54spi_interrupt, 0, "p54spi",
priv->spi);
if (ret < 0) {
dev_err(&priv->spi->dev, "request_irq() failed");
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index 94c852d..1141747 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -162,7 +162,7 @@ typedef struct {
int irq, irq2; /* Interrupts used */
int dma, dma2; /* DMA channel(s) used */
int fifo_size; /* FIFO size */
- int irqflags; /* interrupt flags (ie, IRQF_SHARED|IRQF_DISABLED) */
+ int irqflags; /* interrupt flags (ie, IRQF_SHARED) */
int direction; /* Link direction, used by some FIR drivers */
int enabled; /* Powered on? */
int suspended; /* Suspended by APM */
--
1.7.1
^ permalink raw reply related
* [PATCH net-next] tcp: avoid frag allocation for small frames
From: Eric Dumazet @ 2011-10-22 12:23 UTC (permalink / raw)
To: David Miller; +Cc: netdev
tcp_sendmsg() uses select_size() helper to choose skb head size when a
new skb must be allocated.
If GSO is enabled for the socket, current strategy is to force all
payload data to be outside of headroom, in PAGE fragments.
This strategy is not welcome for small packets, wasting memory.
Experiments show that best results are obtained when using 2048 bytes
for skb head (This includes the skb overhead and various headers)
This patch provides better len/truesize ratios for packets sent to
loopback device, and reduce memory needs for in-flight loopback packets,
particularly on arches with big pages.
If a sender sends many 1-byte packets to an unresponsive application,
receiver rmem_alloc will grow faster and will stop queuing these packets
sooner, or will collapse its receive queue to free excess memory.
netperf -t TCP_RR results are improved by ~4 %, and many workloads are
improved as well (tbench, mysql...)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/ipv4/tcp.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 704adad..cd45b44 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -897,9 +897,12 @@ static inline int select_size(const struct sock *sk, int sg)
int tmp = tp->mss_cache;
if (sg) {
- if (sk_can_gso(sk))
- tmp = 0;
- else {
+ if (sk_can_gso(sk)) {
+ /* Small frames wont use a full page:
+ * Payload will immediately follow tcp header.
+ */
+ tmp = SKB_WITH_OVERHEAD(2048 - MAX_TCP_HEADER);
+ } else {
int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER);
if (tmp >= pgbreak &&
^ permalink raw reply related
* [PATCH] jme: fix irq storm after suspend/resume
From: Clemens Buchacher @ 2011-10-22 12:56 UTC (permalink / raw)
To: Guo-Fu Tseng; +Cc: netdev, linux-kernel, Adrian Chadd, Mohammed Shafi
If the device is down during suspend/resume, interrupts are enabled
without a registered interrupt handler, causing a storm of
unhandled interrupts until the IRQ is disabled because "nobody
cared".
Instead, check that the device is up before touching it in the
suspend/resume code.
Fixes https://bugzilla.kernel.org/show_bug.cgi?id=39112
Helped-by: Adrian Chadd <adrian@freebsd.org>
Helped-by: Mohammed Shafi <shafi.wireless@gmail.com>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
Unfortunately, bugzilla.kernel.org is still down. There is at least
one other person who reported the issue, and I don't have their
email address. So for now, I am the only one who tested this fix.
The patch applies to current tip (2efd7c0) of Linus' tree. I also
tested it based on v3.0 and it worked the same.
Many thanks to Adrian and Mohammed for helping me debug this issue.
See this thread for the history:
http://mid.gmane.org/20110827113253.GA1444@ecki
drivers/net/jme.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index 3ac262f..7a8a3b6 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -3131,6 +3131,9 @@ jme_suspend(struct device *dev)
struct net_device *netdev = pci_get_drvdata(pdev);
struct jme_adapter *jme = netdev_priv(netdev);
+ if (!netif_running(netdev))
+ return 0;
+
atomic_dec(&jme->link_changing);
netif_device_detach(netdev);
@@ -3171,6 +3174,9 @@ jme_resume(struct device *dev)
struct net_device *netdev = pci_get_drvdata(pdev);
struct jme_adapter *jme = netdev_priv(netdev);
+ if (!netif_running(netdev))
+ return 0;
+
jme_clear_pm(jme);
jme_phy_on(jme);
if (test_bit(JME_FLAG_SSET, &jme->flags))
--
1.7.7
^ permalink raw reply related
* Re: [PATCH] jme: fix irq storm after suspend/resume
From: Mohammed Shafi @ 2011-10-22 13:09 UTC (permalink / raw)
To: Clemens Buchacher; +Cc: Guo-Fu Tseng, netdev, linux-kernel, Adrian Chadd
In-Reply-To: <20111022125620.GA2256@ecki.lan>
On Sat, Oct 22, 2011 at 6:26 PM, Clemens Buchacher <drizzd@aon.at> wrote:
> If the device is down during suspend/resume, interrupts are enabled
> without a registered interrupt handler, causing a storm of
> unhandled interrupts until the IRQ is disabled because "nobody
> cared".
thank you so much for fixing this. incredible persistence from your side!
>
> Instead, check that the device is up before touching it in the
> suspend/resume code.
>
> Fixes https://bugzilla.kernel.org/show_bug.cgi?id=39112
>
> Helped-by: Adrian Chadd <adrian@freebsd.org>
> Helped-by: Mohammed Shafi <shafi.wireless@gmail.com>
> Signed-off-by: Clemens Buchacher <drizzd@aon.at>
> ---
>
> Unfortunately, bugzilla.kernel.org is still down. There is at least
> one other person who reported the issue, and I don't have their
> email address. So for now, I am the only one who tested this fix.
>
> The patch applies to current tip (2efd7c0) of Linus' tree. I also
> tested it based on v3.0 and it worked the same.
>
> Many thanks to Adrian and Mohammed for helping me debug this issue.
> See this thread for the history:
> http://mid.gmane.org/20110827113253.GA1444@ecki
>
> drivers/net/jme.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/jme.c b/drivers/net/jme.c
> index 3ac262f..7a8a3b6 100644
> --- a/drivers/net/jme.c
> +++ b/drivers/net/jme.c
> @@ -3131,6 +3131,9 @@ jme_suspend(struct device *dev)
> struct net_device *netdev = pci_get_drvdata(pdev);
> struct jme_adapter *jme = netdev_priv(netdev);
>
> + if (!netif_running(netdev))
> + return 0;
> +
> atomic_dec(&jme->link_changing);
>
> netif_device_detach(netdev);
> @@ -3171,6 +3174,9 @@ jme_resume(struct device *dev)
> struct net_device *netdev = pci_get_drvdata(pdev);
> struct jme_adapter *jme = netdev_priv(netdev);
>
> + if (!netif_running(netdev))
> + return 0;
> +
> jme_clear_pm(jme);
> jme_phy_on(jme);
> if (test_bit(JME_FLAG_SSET, &jme->flags))
> --
> 1.7.7
>
>
--
shafi
^ permalink raw reply
* Re: [PATCH] tg3: fix tigon3_dma_hwbug_workaround()
From: Ari Savolainen @ 2011-10-22 13:30 UTC (permalink / raw)
To: Eric Dumazet
Cc: RongQing Li, David Miller, richardcochran, netdev, linux-kernel
In-Reply-To: <CAEbykaVif3Mi50aDzY5p09iHC3DgtbYFQBGPAWiLa8hhyk5w8A@mail.gmail.com>
I tested the patch. It works. The panics are gone.
Thanks,
Ari
2011/10/22 Ari Savolainen <ari.m.savolainen@gmail.com>:
> I tried a similar patch earlier and got another panic with that. I was
> quite tired at that time and may have made a mistake. I'll test Eric's
> patch either later today or tomorrow.
>
> Ari
>
> 2011/10/22 Eric Dumazet <eric.dumazet@gmail.com>:
>> Ari got kernel panics using tg3 NIC, and bisected to 2669069aacc9 "tg3:
>> enable transmit time stamping."
>>
>> This is because tigon3_dma_hwbug_workaround() might alloc a new skb and
>> free the original. We panic when skb_tx_timestamp() is called on freed
>> skb.
>>
>> Reported-by: Ari Savolainen <ari.m.savolainen@gmail.com>
>> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
>> ---
>> drivers/net/tg3.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
>> index 4a1374d..6149dc5 100644
>> --- a/drivers/net/tg3.c
>> +++ b/drivers/net/tg3.c
>> @@ -6029,12 +6029,12 @@ static void tg3_tx_skb_unmap(struct tg3_napi *tnapi, u32 entry, int last)
>>
>> /* Workaround 4GB and 40-bit hardware DMA bugs. */
>> static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
>> - struct sk_buff *skb,
>> + struct sk_buff **pskb,
>> u32 *entry, u32 *budget,
>> u32 base_flags, u32 mss, u32 vlan)
>> {
>> struct tg3 *tp = tnapi->tp;
>> - struct sk_buff *new_skb;
>> + struct sk_buff *new_skb, *skb = *pskb;
>> dma_addr_t new_addr = 0;
>> int ret = 0;
>>
>> @@ -6076,7 +6076,7 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
>> }
>>
>> dev_kfree_skb(skb);
>> -
>> + *pskb = new_skb;
>> return ret;
>> }
>>
>> @@ -6305,7 +6305,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
>> */
>> entry = tnapi->tx_prod;
>> budget = tg3_tx_avail(tnapi);
>> - if (tigon3_dma_hwbug_workaround(tnapi, skb, &entry, &budget,
>> + if (tigon3_dma_hwbug_workaround(tnapi, &skb, &entry, &budget,
>> base_flags, mss, vlan))
>> goto out_unlock;
>> }
>>
>>
>>
>
^ permalink raw reply
* Re: [LARTC] LARTC mailing list
From: Andrew Beverley @ 2011-10-22 14:10 UTC (permalink / raw)
To: Linux Advanced Routing & Traffic Control project
Cc: linux-new-lists, netfilter, netdev
In-Reply-To: <4EA2BF3D.1010107@linuxsystems.it>
On Sat, 2011-10-22 at 15:03 +0200, Niccolò Belli wrote:
> Is someone still interested to bring LARTC to a new life?
> I'm sorry for the subscription but the list didn't work anymore and it
> was unfeasible to CC 30+ addresses. Let me know if you want to
> unsubscribe and you don't know how to.
Thanks for doing this Niccolo. However, I'd rather see it hosted at
vger.kernel.org for all the reasons previously outlined.
I was actually going to suggest a new list called net-users instead.
There is netdev, netfilter-devel and netfilter, but not a general
networking users list.
User questions do get asked on netdev, and some non-netfilter questions
get asked on the netfilter list, but it would seem sensible to have a
general networking users list that would include LARTC questions.
Comments anyone?
Andy
^ permalink raw reply
* Re: [patch net-next V2] net: introduce ethernet teaming device
From: Jiri Pirko @ 2011-10-22 15:13 UTC (permalink / raw)
To: Eric Dumazet
Cc: netdev, davem, bhutchings, shemminger, fubar, andy, tgraf,
ebiederm, mirqus, kaber, greearb, jesse, fbl, benjamin.poirier,
jzupka
In-Reply-To: <1319208237.32161.14.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
>> +
>> +/************************
>> + * Rx path frame handler
>> + ************************/
>> +
>> +/* note: already called with rcu_read_lock */
>> +static rx_handler_result_t team_handle_frame(struct sk_buff **pskb)
>> +{
>> + struct sk_buff *skb = *pskb;
>> + struct team_port *port;
>> + struct team *team;
>> + rx_handler_result_t res = RX_HANDLER_ANOTHER;
>> +
>> + skb = skb_share_check(skb, GFP_ATOMIC);
>> + if (!skb)
>> + return RX_HANDLER_CONSUMED;
>> +
>> + *pskb = skb;
>> +
>> + port = team_port_get_rcu(skb->dev);
>> + team = port->team;
>> +
>> + if (team->mode_ops.receive)
>
>Hmm, you need ACCESS_ONCE() here or rcu_dereference()
>
>See commit 4d97480b1806e883eb (bonding: use local function pointer of
>bond->recv_probe in bond_handle_frame) for reference
I do not think so. Because mode_ops.receive changes only from
__team_change_mode() and this can be called only in case no ports are in
team. And team_port_del() calls synchronize_rcu().
Jirka
>
>> + res = team->mode_ops.receive(team, port, skb);
>> +
>> + if (res == RX_HANDLER_ANOTHER) {
>> + struct team_pcpu_stats *pcpu_stats;
>> +
>> + pcpu_stats = this_cpu_ptr(team->pcpu_stats);
>> + u64_stats_update_begin(&pcpu_stats->syncp);
>> + pcpu_stats->rx_packets++;
>> + pcpu_stats->rx_bytes += skb->len;
>> + if (skb->pkt_type == PACKET_MULTICAST)
>> + pcpu_stats->rx_multicast++;
>> + u64_stats_update_end(&pcpu_stats->syncp);
>> +
>> + skb->dev = team->dev;
>> + } else {
>> + this_cpu_inc(team->pcpu_stats->rx_dropped);
>> + }
>> +
>> + return res;
>> +}
>> +
^ permalink raw reply
* Kernel driver r8169 not working for Realtek 8111E onboard network card
From: Adrian George Sav @ 2011-10-22 15:22 UTC (permalink / raw)
To: netdev@vger.kernel.org
Hello.
I am having trouble with the r8169 kernel driver for Realtek 8111E network card.
The NIC works intermittently and horribly with this driver. Unusable.
Below is my config. I am happy to provide any and every other necessary information to help in solving this.
Thank you.
Motherboard: ASUS P8P67(REV 3.1)
Kernel: up to 2.6.39
lspci -vv:
------------------------------------------------------------------------------------------------------------
07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
Subsystem: ASUSTeK Computer Inc. P8P67 Deluxe Motherboard [Realtek RTL8111E]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 66
Region 0: I/O ports at d000 [size=256]
Region 2: Memory at d0004000 (64-bit, prefetchable) [size=4K]
Region 4: Memory at d0000000 (64-bit, prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000feeff00c Data: 417a
Capabilities: [70] Express (v2) Endpoint, MSI 01
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <512ns, L1 <64us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 4096 bytes
DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 <64us
ClockPM+ Surprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Range ABCD, TimeoutDis+
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-
LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-, Selectable De-emphasis: -6dB
Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -6dB
Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
Vector table: BAR=4 offset=00000000
PBA: BAR=4 offset=00000800
Capabilities: [d0] Vital Product Data
Unknown small resource type 00, will not decode more.
Capabilities: [100 v1] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
AERCap: First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
Capabilities: [140 v1] Virtual Channel
Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
Arb: Fixed- WRR32- WRR64- WRR128-
Ctrl: ArbSelect=Fixed
Status: InProgress-
VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=01
Status: NegoPending- InProgress-
Capabilities: [160 v1] Device Serial Number 01-00-00-00-68-4c-e0-00
Kernel driver in use: r8169
Kernel modules: r8169
------------------------------------------------------------------------------------------------------------
^ permalink raw reply
* Re: [patch net-next V2] net: introduce ethernet teaming device
From: Jiri Pirko @ 2011-10-22 15:55 UTC (permalink / raw)
To: Jay Vosburgh
Cc: netdev, davem, eric.dumazet, bhutchings, shemminger, andy, tgraf,
ebiederm, mirqus, kaber, greearb, jesse, fbl, benjamin.poirier,
jzupka
In-Reply-To: <3128.1319221621@death>
Fri, Oct 21, 2011 at 08:27:01PM CEST, fubar@us.ibm.com wrote:
>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 basis for libteam was recently introduced (some need
>>still need to be done on it though). 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>
>>
>>v1->v2:
>> - modes are made as modules. Makes team more modular and
>> extendable.
>> - several commenters' nitpicks found on v1 were fixed
>> - several other bugs were fixed.
>> - note I ignored Eric's comment about roundrobin port selector
>> as Eric's way may be easily implemented as another mode (mode
>> "random") in future.
>>---
>
>[...]
>
>>+static int team_port_add(struct team *team, struct net_device *port_dev)
>>+{
>>+ struct net_device *dev = team->dev;
>>+ struct team_port *port;
>>+ char *portname = port_dev->name;
>>+ char tmp_addr[ETH_ALEN];
>>+ int err;
>>+
>>+ if (port_dev->flags & IFF_LOOPBACK ||
>>+ port_dev->type != ARPHRD_ETHER) {
>>+ netdev_err(dev, "Device %s is of an unsupported type\n",
>>+ portname);
>>+ return -EINVAL;
>>+ }
>>+
>>+ if (team_port_exists(port_dev)) {
>>+ netdev_err(dev, "Device %s is already a port "
>>+ "of a team device\n", portname);
>>+ return -EBUSY;
>>+ }
>>+
>>+ if (port_dev->flags & IFF_UP) {
>>+ netdev_err(dev, "Device %s is up. Set it down before adding it as a team port\n",
>>+ portname);
>>+ return -EBUSY;
>>+ }
>>+
>>+ port = kzalloc(sizeof(struct team_port), GFP_KERNEL);
>>+ if (!port)
>>+ return -ENOMEM;
>>+
>>+ port->dev = port_dev;
>>+ port->team = team;
>>+
>>+ port->orig.mtu = port_dev->mtu;
>>+ err = dev_set_mtu(port_dev, dev->mtu);
>>+ if (err) {
>>+ netdev_dbg(dev, "Error %d calling dev_set_mtu\n", err);
>>+ goto err_set_mtu;
>>+ }
>>+
>>+ memcpy(port->orig.dev_addr, port_dev->dev_addr, ETH_ALEN);
>>+ random_ether_addr(tmp_addr);
>>+ err = __set_port_mac(port_dev, tmp_addr);
>>+ if (err) {
>>+ netdev_dbg(dev, "Device %s mac addr set failed\n",
>>+ portname);
>>+ goto err_set_mac_rand;
>>+ }
>>+
>>+ err = dev_open(port_dev);
>>+ if (err) {
>>+ netdev_dbg(dev, "Device %s opening failed\n",
>>+ portname);
>>+ goto err_dev_open;
>>+ }
>>+
>>+ err = team_port_set_orig_mac(port);
>>+ if (err) {
>>+ netdev_dbg(dev, "Device %s mac addr set failed - Device does not support addr change when it's opened\n",
>>+ portname);
>>+ goto err_set_mac_opened;
>>+ }
>
> This will exclude a number of devices that bonding currently
>provides at least partial support for.
>
> Most of those are older 10 or 10/100 Ethernet drivers (anything
>that uses eth_mac_addr for its ndo_set_mac_address, I think; there look
>to be about 140 or so of those), but it also includes Infiniband (which
>is excluded explicitly elsewhere).
Team supports only ETH atm. I think it can be easily extended to support
Infiniband in future. But that's not priority now.
The "life mac change" check can be easily moved into port_enter mode
callback to let the mode decide. Then FOM active can be easily implemented
as another mode.
>
> Another small set of Ethernet devices (those that currently need
>bonding's fail_over_mac option) do permit setting the MAC while open,
>but will misbehave if multiple ports are set to the same MAC. The usual
>suspects here are ehea and qeth, which are partition-aware devices for
>IBM's pseries and zseries hardware, but there may be others I'm not
>familiar with.
Actually this (FOM2) is very close to the behaviour "activebackup" team
mode has now.
>
> If these will be permanent limitations of the team driver, then
>this should (eventually) be in the documentation.
>
> Also, from looking at the code, it's not obvious if nesting of
>teams is supported or not. I'm not seeing anything in the code that
>would prohibit adding a team device as a port to another team. If
>nesting of teams is undesirable, it should probably be explicitly tested
>for and disallowed.
Nesting is allowed.
>
>[...]
>
>>+static int __init team_module_init(void)
>>+{
>>+ int err;
>>+
>>+ register_netdevice_notifier(&team_notifier_block);
>>+
>>+ err = rtnl_link_register(&team_link_ops);
>>+ if (err)
>>+ goto err_rtln_reg;
>>+
>>+ err = team_nl_init();
>>+ if (err)
>>+ goto err_nl_init;
>>+
>>+ return 0;
>>+
>>+err_nl_init:
>>+ rtnl_link_unregister(&team_link_ops);
>>+
>>+err_rtln_reg:
>>+ unregister_netdevice_notifier(&team_notifier_block);
>
> Minor nit: I suspect you meant "err_rtnl_reg" here, and in the
>goto above.
Corrected.
Thanks Jay.
Jirka
>
> -J
>
>---
> -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
>
^ permalink raw reply
* Re: [PATCH] jme: fix irq storm after suspend/resume
From: Mantas M. @ 2011-10-22 16:27 UTC (permalink / raw)
To: linux-kernel; +Cc: netdev
In-Reply-To: <20111022125620.GA2256@ecki.lan>
On 22/10/11 15:56, Clemens Buchacher wrote:
> If the device is down during suspend/resume, interrupts are enabled
> without a registered interrupt handler, causing a storm of
> unhandled interrupts until the IRQ is disabled because "nobody
> cared".
>
> Instead, check that the device is up before touching it in the
> suspend/resume code.
>
> Fixes https://bugzilla.kernel.org/show_bug.cgi?id=39112
Just tested the patch, suspend/resume works well.
--
Mantas M.
^ permalink raw reply
* Re: [patch net-next V2] net: introduce ethernet teaming device
From: Eric Dumazet @ 2011-10-22 16:51 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, bhutchings, shemminger, fubar, andy, tgraf,
ebiederm, mirqus, kaber, greearb, jesse, fbl, benjamin.poirier,
jzupka
In-Reply-To: <20111022151346.GA2028@minipsycho.orion>
Le samedi 22 octobre 2011 à 17:13 +0200, Jiri Pirko a écrit :
> >> +
> >> +/************************
> >> + * Rx path frame handler
> >> + ************************/
> >> +
> >> +/* note: already called with rcu_read_lock */
> >> +static rx_handler_result_t team_handle_frame(struct sk_buff **pskb)
> >> +{
> >> + struct sk_buff *skb = *pskb;
> >> + struct team_port *port;
> >> + struct team *team;
> >> + rx_handler_result_t res = RX_HANDLER_ANOTHER;
> >> +
> >> + skb = skb_share_check(skb, GFP_ATOMIC);
> >> + if (!skb)
> >> + return RX_HANDLER_CONSUMED;
> >> +
> >> + *pskb = skb;
> >> +
> >> + port = team_port_get_rcu(skb->dev);
> >> + team = port->team;
> >> +
> >> + if (team->mode_ops.receive)
> >
> >Hmm, you need ACCESS_ONCE() here or rcu_dereference()
> >
> >See commit 4d97480b1806e883eb (bonding: use local function pointer of
> >bond->recv_probe in bond_handle_frame) for reference
>
> I do not think so. Because mode_ops.receive changes only from
> __team_change_mode() and this can be called only in case no ports are in
> team. And team_port_del() calls synchronize_rcu().
>
We are used to code following this template :
if (ops->handler)
ops->handler(arguments);
But this is valid only because ops points to constant memory.
In your case, we really see its not true, dont try to pretend its safe.
^ permalink raw reply
* Re: Kernel driver r8169 not working for Realtek 8111E onboard network card
From: Francois Romieu @ 2011-10-22 21:44 UTC (permalink / raw)
To: Adrian George Sav; +Cc: netdev@vger.kernel.org
In-Reply-To: <1319296941.68390.YahooMailNeo@web161905.mail.bf1.yahoo.com>
Adrian George Sav <adi_sav@yahoo.com> :
[...]
> I am having trouble with the r8169 kernel driver for Realtek 8111E network
> card. The NIC works intermittently and horribly with this driver. Unusable.
>
> Below is my config. I am happy to provide any and every other necessary
> information to help in solving this.
Up to 2.6.39 ?
Your r8169 driver is too old. Please try current -rc and send your dmesg
including the XID line from the r8169 driver.
--
Ueimor
^ permalink raw reply
* Kernel Panic every 2 weeks on ISP server (NULL pointer dereference)
From: Luciano Ruete @ 2011-10-23 1:18 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: Text/Plain, Size: 1072 bytes --]
Hi,
I'm the sysadmin at a 3500 customers ISP, wich runs an iptables+tc solution
for load balancing and QoS.
Every 2 or 3 weeks the server panics with a "NULL pointer dereference" and
with IP at "dev_queue_xmit"
It is curious that if i disable MSI on the network card driver this panics
seems to disapear, does this ring a bell?
The server is an IBM, previously with Broadcom NetXtreme II BCM5709 nics and
now with Intel 82576. I change the nics thinking that maybe the bug was in
Broadcom Driver but it seems to affect MSI in general.
The tc+iptables rules are auto-generated with sequreisp[1] an ISP solution
that i wrote and is open sourced under AGPLv3.
Tell me if you need any further information, and plz CC because I'm not
suscribed.
root@server:~# uname -a
Linux server 2.6.35-30-server #60~lucid1-Ubuntu SMP Tue Sep 20 22:28:40 UTC
2011 x86_64 GNU/Linux
[1]https://github.com/sequre/sequreisp
--
Luciano Ruete
Sequre - Sys Admin
Mitre 617, piso 7, of. 1
+54 261 4254894
Mendoza - Argentina
http://www.sequre.com.ar/
http://www.sequreisp.com/
[-- Attachment #2: kern.log.txt --]
[-- Type: text/plain, Size: 12769 bytes --]
BUG: unable to handle kernel NULL pointer dereference at (null)
[694244.692704] IP: [<ffffffff814b48ea>] dev_queue_xmit+0xaa/0x5b0
[694244.763424] PGD 16f369067 PUD 16f368067 PMD 0
[694244.817577] Oops: 0000 [#1] SMP
[694244.857160] last sysfs file: /sys/devices/system/cpu/cpu7/cache/index2/shared_cpu_map
[694244.951740] CPU 3
[694244.974623] Modules linked in: xt_mac ppp_deflate zlib_deflate bsd_comp ppp_async crc_ccitt nf_conntrack_netlink nfnetlink xt_owner ipt_REJECT ipt_REDIRECT ipt_MASQUERADE xt_helper xt_length xt_TCPMSS xt_mark xt_connmark xt_state xt_tcpudp xt_multiport iptable_mangle iptable_nat iptable_filter ip_tables x_tables sch_sfq act_mirred cls_u32 sch_prio cls_fw sch_htb ifb dummy 8021q garp stp nf_nat_irc nf_conntrack_irc nf_nat_sip nf_conntrack_sip nf_nat_pptp nf_conntrack_pptp nf_conntrack_proto_gre nf_nat_proto_gre nf_nat_amanda ts_kmp nf_conntrack_amanda nf_nat_ftp nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack_ftp nf_conntrack cdc_ether i7core_edac usbnet serio_raw edac_core tpm_tis tpm ioatdma tpm_bios lp shpchp parport mii raid10 raid456 async_pq async_xor xor async_memcpy async_r
aid6_recov megaraid_sas raid6_pq async_tx raid1 raid0 multipath igb dca usbhid hid linear
[694245.905128]
[694245.923881] Pid: 30, comm: events/3 Not tainted 2.6.35-30-server #60~lucid1-Ubuntu 69Y5698 /System x3650 M3 -[7945AC1]-
[694246.057920] RIP: 0010:[<ffffffff814b48ea>] [<ffffffff814b48ea>] dev_queue_xmit+0xaa/0x5b0
[694246.157723] RSP: 0018:ffff880001e63960 EFLAGS: 00010202
[694246.222176] RAX: 0000000000002000 RBX: ffff880145b6f400 RCX: 000000009fe9dec3
[694246.308451] RDX: 0000000000000004 RSI: 0000000000000000 RDI: ffff88017bd47130
[694246.394725] RBP: ffff880001e639a0 R08: ffff880145b6f400 R09: ffff88017bd47130
[694246.480998] R10: 0000000000000000 R11: 0000000000000003 R12: 0000000000000000
[694246.567265] R13: ffff880118128000 R14: ffff88015c39d300 R15: ffff880001e63b00
[694246.653534] FS: 0000000000000000(0000) GS:ffff880001e60000(0000) knlGS:0000000000000000
[694246.751226] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[694246.820861] CR2: 0000000000000000 CR3: 0000000250400000 CR4: 00000000000006e0
[694246.907128] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[694246.993394] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[694247.079668] Process events/3 (pid: 30, threadinfo ffff880276efe000, task ffff880276ed44d0)
[694247.179433] Stack:
[694247.204410] 0000000000000000 ffff880118128000 ffff880001e639e0 ffff880145b6f400
[694247.291793] <0> 0000000000000000 ffff88015ce2f780 ffff880145b6f400 ffff880001e63b00
[694247.384466] <0> ffff880001e639e0 ffffffff814e9347 ffff880001e63a20 ffff880145b6f400
[694247.479257] Call Trace:
[694247.509424] <IRQ>
[694247.535481] [<ffffffff814e9347>] ip_finish_output+0x237/0x310
[694247.606165] [<ffffffff814e9738>] ip_output+0xb8/0xc0
[694247.667503] [<ffffffff814e75d3>] ? __ip_local_out+0xa3/0xb0
[694247.736114] [<ffffffff814e84c9>] ip_local_out+0x29/0x30
[694247.800566] [<ffffffff814e8ce1>] ip_queue_xmit+0x191/0x3f0
[694247.868129] [<ffffffff814fe484>] tcp_transmit_skb+0x3f4/0x700
[694247.938811] [<ffffffff815002fd>] tcp_send_ack+0xdd/0x130
[694248.004302] [<ffffffff814fc823>] tcp_rcv_synsent_state_process+0x5a3/0x5b0
[694248.088493] [<ffffffff815046bf>] ? tcp_v4_inbound_md5_hash+0x7f/0x210
[694248.167486] [<ffffffff814fcf8d>] tcp_rcv_state_process+0x7d/0x4e0
[694248.242332] [<ffffffff815048f3>] tcp_v4_do_rcv+0xa3/0x1c0
[694248.308864] [<ffffffff81505ab9>] tcp_v4_rcv+0x5a9/0x830
[694248.373314] [<ffffffff814e36a0>] ? ip_local_deliver_finish+0x0/0x290
[694248.451265] [<ffffffff814db384>] ? nf_hook_slow+0x74/0x100
[694248.518830] [<ffffffff814e36a0>] ? ip_local_deliver_finish+0x0/0x290
[694248.596781] [<ffffffff814e377d>] ip_local_deliver_finish+0xdd/0x290
[694248.673696] [<ffffffff814e39b0>] ip_local_deliver+0x80/0x90
[694248.742300] [<ffffffff814e2f29>] ip_rcv_finish+0x119/0x410
[694248.809870] [<ffffffff814e35cd>] ip_rcv+0x23d/0x310
[694248.870167] [<ffffffff814af233>] __netif_receive_skb+0x383/0x5c0
[694248.943960] [<ffffffff814af57b>] process_backlog+0x10b/0x210
[694249.013603] [<ffffffff814b04af>] net_rx_action+0x10f/0x2a0
[694249.081175] [<ffffffff8106862d>] __do_softirq+0xbd/0x200
[694249.146672] [<ffffffff810ca950>] ? handle_IRQ_event+0x50/0x160
[694249.218394] [<ffffffff81068695>] ? __do_softirq+0x125/0x200
[694249.287006] [<ffffffff8100afdc>] call_softirq+0x1c/0x30
[694249.351458] [<ffffffff8100cab5>] do_softirq+0x65/0xa0
[694249.413833] [<ffffffff810684e5>] irq_exit+0x85/0x90
[694249.474131] [<ffffffff815aac85>] do_IRQ+0x75/0xf0
[694249.532352] [<ffffffff815a3853>] ret_from_intr+0x0/0x11
[694249.596797] <EOI>
[694249.622854] [<ffffffff815a3319>] ? _raw_spin_unlock_irqrestore+0x19/0x30
[694249.704961] [<ffffffffa0107826>] ppp_asynctty_receive+0x86/0x100 [ppp_async]
[694249.791233] [<ffffffff81360816>] flush_to_ldisc+0x1a6/0x1e0
[694249.859834] [<ffffffff81360670>] ? flush_to_ldisc+0x0/0x1e0
[694249.928442] [<ffffffff8107b2a5>] run_workqueue+0xc5/0x1a0
[694249.994969] [<ffffffff8107b423>] worker_thread+0xa3/0x110
[694250.061499] [<ffffffff810800d0>] ? autoremove_wake_function+0x0/0x40
[694250.139451] [<ffffffff8107b380>] ? worker_thread+0x0/0x110
[694250.207014] [<ffffffff8107fb56>] kthread+0x96/0xa0
[694250.266274] [<ffffffff8100aee4>] kernel_thread_helper+0x4/0x10
[694250.338002] [<ffffffff8107fac0>] ? kthread+0x0/0xa0
[694250.398296] [<ffffffff8100aee0>] ? kernel_thread_helper+0x0/0x10
[694250.472081] Code: f6 49 c1 e6 07 66 89 93 ac 00 00 00 4d 03 b5 40 03 00 00 0f b7 83 a6 00 00 00 4d 8b 66 08 80 e4 cf 80 cc 20 66 89 83 a6 00 00 00 <49> 83 3c 24 00 0f 84 3b 02 00 00 49 8d 84 24 9c 00 00 00 48 89
[694250.700622] RIP [<ffffffff814b48ea>] dev_queue_xmit+0xaa/0x5b0
[694250.772367] RSP <ffff880001e63960>
[694250.814999] CR2: 0000000000000000
[694250.855923] ---[ end trace 0c85e47af955446e ]---
[694250.912113] Kernel panic - not syncing: Fatal exception in interrupt
[694250.989074] Pid: 30, comm: events/3 Tainted: G D 2.6.35-30-server #60~lucid1-Ubuntu
[694251.090974] Call Trace:
[694251.121208] <IRQ> [<ffffffff815a0597>] panic+0x90/0x113
[694251.154109] ------------[ cut here ]------------
[694251.154118] WARNING: at /build/buildd/linux-lts-backport-maverick-2.6.35/net/sched/sch_generic.c:258 dev_watchdog+0x25f/0x270()
[694251.154121] Hardware name: System x3650 M3 -[7945AC1]-
[694251.154123] NETDEV WATCHDOG: eth0 (igb): transmit queue 0 timed out
[694251.154124] Modules linked in: xt_mac ppp_deflate zlib_deflate bsd_comp ppp_async crc_ccitt nf_conntrack_netlink nfnetlink xt_owner ipt_REJECT ipt_REDIRECT ipt_MASQUERADE xt_helper xt_length xt_TCPMSS xt_mark xt_connmark xt_state xt_tcpudp xt_multiport iptable_mangle iptable_nat iptable_filter ip_tables x_tables sch_sfq act_mirred cls_u32 sch_prio cls_fw sch_htb ifb dummy 8021q garp stp nf_nat_irc nf_conntrack_irc nf_nat_sip nf_conntrack_sip nf_nat_pptp nf_conntrack_pptp nf_conntrack_proto_gre nf_nat_proto_gre nf_nat_amanda ts_kmp nf_conntrack_amanda nf_nat_ftp nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack_ftp nf_conntrack cdc_ether i7core_edac usbnet serio_raw edac_core tpm_tis tpm ioatdma tpm_bios lp shpchp parport mii raid10 raid456 async_pq async_xor xor async_memcpy async_r
aid6_recov megaraid_sas raid6_pq async_tx raid1 raid0 multipath igb dca usbhid hid linear
[694251.154174] Pid: 0, comm: swapper Tainted: G D 2.6.35-30-server #60~lucid1-Ubuntu
[694251.154176] Call Trace:
[694251.154178] <IRQ> [<ffffffff8106159f>] warn_slowpath_common+0x7f/0xc0
[694251.154187] [<ffffffff81061696>] warn_slowpath_fmt+0x46/0x50
[694251.154190] [<ffffffff814cd81f>] dev_watchdog+0x25f/0x270
[694251.154200] [<ffffffffa01adc49>] ? destroy_conntrack+0xa9/0xe0 [nf_conntrack]
[694251.154204] [<ffffffff814db1a7>] ? nf_conntrack_destroy+0x17/0x30
[694251.154211] [<ffffffffa01ad264>] ? death_by_timeout+0xd4/0x140 [nf_conntrack]
[694251.154214] [<ffffffff814cd5c0>] ? dev_watchdog+0x0/0x270
[694251.154217] [<ffffffff814cd5c0>] ? dev_watchdog+0x0/0x270
[694251.154221] [<ffffffff81070172>] call_timer_fn+0x42/0x120
[694251.154226] [<ffffffff8105553b>] ? scheduler_tick+0x1db/0x300
[694251.154229] [<ffffffff814cd5c0>] ? dev_watchdog+0x0/0x270
[694251.154232] [<ffffffff81071734>] run_timer_softirq+0x154/0x270
[694251.154236] [<ffffffff8108a683>] ? ktime_get+0x63/0xe0
[694251.154239] [<ffffffff8106862d>] __do_softirq+0xbd/0x200
[694251.154243] [<ffffffff8108fa1a>] ? tick_program_event+0x2a/0x30
[694251.154247] [<ffffffff8100afdc>] call_softirq+0x1c/0x30
[694251.154250] [<ffffffff8100cab5>] do_softirq+0x65/0xa0
[694251.154253] [<ffffffff810684e5>] irq_exit+0x85/0x90
[694251.154258] [<ffffffff815aad70>] smp_apic_timer_interrupt+0x70/0x9b
[694251.154261] [<ffffffff8100aa93>] apic_timer_interrupt+0x13/0x20
[694251.154263] <EOI> [<ffffffff8130ad54>] ? intel_idle+0xe4/0x180
[694251.154271] [<ffffffff8130ad37>] ? intel_idle+0xc7/0x180
[694251.154277] [<ffffffff81488062>] cpuidle_idle_call+0x92/0x140
[694251.154281] [<ffffffff81008d93>] cpu_idle+0xb3/0x110
[694251.154285] [<ffffffff8159b226>] start_secondary+0x100/0x102
[694251.154288] ---[ end trace 0c85e47af955446f ]---
[694251.154389] igb 0000:17:00.0: eth0: Reset adapter
[694251.273081] igb 0000:18:00.0: eth2: Reset adapter
[694254.499174] [<ffffffff815a485a>] oops_end+0xea/0xf0
[694254.559522] [<ffffffff8103e45c>] no_context+0xfc/0x190
[694254.622984] [<ffffffffa0070155>] ? nfnetlink_has_listeners+0x15/0x20 [nfnetlink]
[694254.713470] [<ffffffff8103e615>] __bad_area_nosemaphore+0x125/0x1e0
[694254.790433] [<ffffffff8103e6e3>] bad_area_nosemaphore+0x13/0x20
[694254.863244] [<ffffffff815a711f>] do_page_fault+0x28f/0x350
[694254.930864] [<ffffffff815a3b35>] page_fault+0x25/0x30
[694254.993287] [<ffffffff814b48ea>] ? dev_queue_xmit+0xaa/0x5b0
[694255.062987] [<ffffffff814e9347>] ip_finish_output+0x237/0x310
[694255.133728] [<ffffffff814e9738>] ip_output+0xb8/0xc0
[694255.195123] [<ffffffff814e75d3>] ? __ip_local_out+0xa3/0xb0
[694255.263784] [<ffffffff814e84c9>] ip_local_out+0x29/0x30
[694255.328283] [<ffffffff814e8ce1>] ip_queue_xmit+0x191/0x3f0
[694255.395910] [<ffffffff814fe484>] tcp_transmit_skb+0x3f4/0x700
[694255.466647] [<ffffffff815002fd>] tcp_send_ack+0xdd/0x130
[694255.532185] [<ffffffff814fc823>] tcp_rcv_synsent_state_process+0x5a3/0x5b0
[694255.616423] [<ffffffff815046bf>] ? tcp_v4_inbound_md5_hash+0x7f/0x210
[694255.695489] [<ffffffff814fcf8d>] tcp_rcv_state_process+0x7d/0x4e0
[694255.770377] [<ffffffff815048f3>] tcp_v4_do_rcv+0xa3/0x1c0
[694255.838650] [<ffffffff81505ab9>] tcp_v4_rcv+0x5a9/0x830
[694255.903158] [<ffffffff814e36a0>] ? ip_local_deliver_finish+0x0/0x290
[694255.981164] [<ffffffff814db384>] ? nf_hook_slow+0x74/0x100
[694256.048778] [<ffffffff814e36a0>] ? ip_local_deliver_finish+0x0/0x290
[694256.126783] [<ffffffff814e377d>] ip_local_deliver_finish+0xdd/0x290
[694256.203750] [<ffffffff814e39b0>] ip_local_deliver+0x80/0x90
[694256.272413] [<ffffffff814e2f29>] ip_rcv_finish+0x119/0x410
[694256.340028] [<ffffffff814e35cd>] ip_rcv+0x23d/0x310
[694256.400385] [<ffffffff814af233>] __netif_receive_skb+0x383/0x5c0
[694256.474233] [<ffffffff814af57b>] process_backlog+0x10b/0x210
[694256.543933] [<ffffffff814b04af>] net_rx_action+0x10f/0x2a0
[694256.611549] [<ffffffff8106862d>] __do_softirq+0xbd/0x200
[694256.677096] [<ffffffff810ca950>] ? handle_IRQ_event+0x50/0x160
[694256.748871] [<ffffffff81068695>] ? __do_softirq+0x125/0x200
[694256.817527] [<ffffffff8100afdc>] call_softirq+0x1c/0x30
[694256.882030] [<ffffffff8100cab5>] do_softirq+0x65/0xa0
[694256.944458] [<ffffffff810684e5>] irq_exit+0x85/0x90
[694257.004807] [<ffffffff815aac85>] do_IRQ+0x75/0xf0
[694257.063079] [<ffffffff815a3853>] ret_from_intr+0x0/0x11
[694257.127578] <EOI> [<ffffffff815a3319>] ? _raw_spin_unlock_irqrestore+0x19/0x30
[694257.217120] [<ffffffffa0107826>] ppp_asynctty_receive+0x86/0x100 [ppp_async]
[694257.303447] [<ffffffff81360816>] flush_to_ldisc+0x1a6/0x1e0
[694257.372104] [<ffffffff81360670>] ? flush_to_ldisc+0x0/0x1e0
[694257.440768] [<ffffffff8107b2a5>] run_workqueue+0xc5/0x1a0
[694257.507355] [<ffffffff8107b423>] worker_thread+0xa3/0x110
[694257.573940] [<ffffffff810800d0>] ? autoremove_wake_function+0x0/0x40
[694257.651961] [<ffffffff8107b380>] ? worker_thread+0x0/0x110
[694257.719582] [<ffffffff8107fb56>] kthread+0x96/0xa0
[694257.778897] [<ffffffff8100aee4>] kernel_thread_helper+0x4/0x10
[694257.850666] [<ffffffff8107fac0>] ? kthread+0x0/0xa0
[694257.911018] [<ffffffff8100aee0>] ? kernel_thread_helper+0x0/0x10
[694257.984951] Rebooting in 1 seconds..[ 0.000000] Initializing cgroup subsys cpuset
^ permalink raw reply
* YOUR TRANSACTION IS STOPED
From: Account Inspection service @ 2011-10-23 3:26 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 198 bytes --]
We are sorry to inform you that you package being
delivered to you has been seized please download the attachment for
information on how to receive the parcel
Best Regards,
Timothy Gale Puckett
[-- Attachment #2: upsconfirma.doc --]
[-- Type: application/msword, Size: 39936 bytes --]
^ 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