* Re: [PATCH]: Add Network Sysrq Support
From: Stephen Hemminger @ 2011-06-21 17:08 UTC (permalink / raw)
To: Prarit Bhargava; +Cc: netdev, davem, agospoda, nhorman, lwoodman
In-Reply-To: <20110621130040.12035.62533.sendpatchset@prarit.bos.redhat.com>
On Tue, 21 Jun 2011 09:00:40 -0400
Prarit Bhargava <prarit@redhat.com> wrote:
> Add Network Sysrq Support
>
> In some circumstances, a system can hang/lockup in such a way that the system
> is completely unresponsive to keyboard or console input but is still
> responsive to ping. The config option, CONFIG_SYSRQ_PING, builds
> net/ipv4/sysrq-ping.ko which allows a root user to configure the system for
> a remote sysrq.
>
> To use this do:
>
> mount -t debugfs none /sys/kernel/debug/
> echo 1 > /proc/sys/kernel/sysrq
> echo <hex digit val> > /sys/kernel/debug/network_sysrq_magic
> echo 1 > /sys/kernel/debug/network_sysrq_enable
>
> Then on another system on the network you can do:
>
> ping -c 1 -p <up to 30 hex digit val><hex val of sysrq> <target_system_name>
>
> ex) sysrq-m, m is ascii 0x6d
>
> ping -c 1 p 1623a06f554d46d676d <target_system_name>
>
> Note that the network sysrq automatically disables after the receipt of
> the ping, ie) it is single-shot mode. If you want to use this again, you
> must complete the above four steps again.
>
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Isn't same functionality already available with netconsole?
^ permalink raw reply
* [RFC 7/7] netxen: use netdev_irqname
From: Stephen Hemminger @ 2011-06-21 17:05 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20110621170541.309890798@vyatta.com>
[-- Attachment #1: netxen-use-irqname.patch --]
[-- Type: text/plain, Size: 763 bytes --]
Use the new netdev_irqname to cause network device interrupts to
be named according to the standard convention of "ethX-N".
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/netxen/netxen_nic_main.c 2011-06-21 10:00:10.223951255 -0700
+++ b/drivers/net/netxen/netxen_nic_main.c 2011-06-21 10:02:46.695951169 -0700
@@ -955,7 +955,8 @@ netxen_nic_request_irq(struct netxen_ada
for (ring = 0; ring < adapter->max_sds_rings; ring++) {
sds_ring = &recv_ctx->sds_rings[ring];
- sprintf(sds_ring->name, "%s[%d]", netdev->name, ring);
+ netdev_irqname(sds_ring->name, sizeof(sds_ring->name),
+ netdev, NETIF_IRQ_TXRX, ring);
err = request_irq(sds_ring->irq, handler,
flags, sds_ring->name, sds_ring);
if (err)
^ permalink raw reply
* [RFC 4/7] benet: use irq naming standard
From: Stephen Hemminger @ 2011-06-21 17:05 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20110621170541.309890798@vyatta.com>
[-- Attachment #1: benet-use-irqname.patch --]
[-- Type: text/plain, Size: 1687 bytes --]
Use the standard for network device IRQ nameing for multiqueue devices.
It appears, this device has one transmit interrup, but multiple receive
interrupts. They will now be named:
ethX-tx-0 ethX-rx-0 ethX-rx-1 ...
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/benet/be_main.c 2011-06-21 09:34:01.407952135 -0700
+++ b/drivers/net/benet/be_main.c 2011-06-21 09:41:03.643951899 -0700
@@ -2196,13 +2196,16 @@ static inline int be_msix_vec_get(struct
}
static int be_request_irq(struct be_adapter *adapter,
- struct be_eq_obj *eq_obj,
- void *handler, char *desc, void *context)
+ struct be_eq_obj *eq_obj,
+ unsigned int usage, unsigned int queue,
+ irq_handler_t handler, void *context)
{
struct net_device *netdev = adapter->netdev;
int vec;
- sprintf(eq_obj->desc, "%s-%s", netdev->name, desc);
+ netdev_irqname(eq_obj->desc, sizeof(eq_obj->desc),
+ netdev, usage, queue);
+
vec = be_msix_vec_get(adapter, eq_obj);
return request_irq(vec, handler, 0, eq_obj->desc, context);
}
@@ -2218,17 +2221,17 @@ static int be_msix_register(struct be_ad
{
struct be_rx_obj *rxo;
int status, i;
- char qname[10];
- status = be_request_irq(adapter, &adapter->tx_eq, be_msix_tx_mcc, "tx",
- adapter);
+ status = be_request_irq(adapter, &adapter->tx_eq,
+ NETIF_IRQ_TX, 0,
+ be_msix_tx_mcc, adapter);
if (status)
goto err;
for_all_rx_queues(adapter, rxo, i) {
- sprintf(qname, "rxq%d", i);
- status = be_request_irq(adapter, &rxo->rx_eq, be_msix_rx,
- qname, rxo);
+ status = be_request_irq(adapter, &rxo->rx_eq,
+ NETIF_IRQ_RX, i,
+ be_msix_rx, rxo);
if (status)
goto err_msix;
}
^ permalink raw reply
* [RFC 5/7] bnx2: use netdev_irqname
From: Stephen Hemminger @ 2011-06-21 17:05 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20110621170541.309890798@vyatta.com>
[-- Attachment #1: bnx2-use-irqname.patch --]
[-- Type: text/plain, Size: 1006 bytes --]
Also increase size of irq name to account for longer device names.
Original code was broken for full size names.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/bnx2.c 2011-06-21 09:52:00.527951530 -0700
+++ b/drivers/net/bnx2.c 2011-06-21 09:52:58.807951497 -0700
@@ -6173,7 +6173,8 @@ bnx2_enable_msix(struct bnx2 *bp, int ms
bp->flags |= BNX2_FLAG_USING_MSIX | BNX2_FLAG_ONE_SHOT_MSI;
for (i = 0; i < total_vecs; i++) {
bp->irq_tbl[i].vector = msix_ent[i].vector;
- snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i);
+ netdev_irqname(bp->irq_tbl[i].name, len,
+ dev, NETIF_IRQ_TXRX, i);
bp->irq_tbl[i].handler = bnx2_msi_1shot;
}
}
--- a/drivers/net/bnx2.h 2011-06-21 09:53:18.331951487 -0700
+++ b/drivers/net/bnx2.h 2011-06-21 09:53:51.723951469 -0700
@@ -6657,7 +6657,7 @@ struct bnx2_irq {
irq_handler_t handler;
unsigned int vector;
u8 requested;
- char name[IFNAMSIZ + 2];
+ char name[32];
};
struct bnx2_tx_ring_info {
^ permalink raw reply
* [RFC 2/7] igb: use netdev_irqname
From: Stephen Hemminger @ 2011-06-21 17:05 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20110621170541.309890798@vyatta.com>
[-- Attachment #1: igb-use-irq-name.patch --]
[-- Type: text/plain, Size: 1563 bytes --]
This is an example of usage of netdev_irqname to create standard
IRQ names. There is a change of behavior, the driver will now skip
unused IRQ vectors (similar to ixgbe).
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/igb/igb_main.c 2011-06-21 09:12:49.567952849 -0700
+++ b/drivers/net/igb/igb_main.c 2011-06-21 09:29:48.211952277 -0700
@@ -920,16 +920,20 @@ static int igb_request_msix(struct igb_a
q_vector->itr_register = hw->hw_addr + E1000_EITR(vector);
if (q_vector->rx_ring && q_vector->tx_ring)
- sprintf(q_vector->name, "%s-TxRx-%u", netdev->name,
- q_vector->rx_ring->queue_index);
+ netdev_irqname(q_vector->name, sizeof(q_vector->name),
+ netdev, NETIF_IRQ_TXRX,
+ q_vector->rx_ring->queue_index);
else if (q_vector->tx_ring)
- sprintf(q_vector->name, "%s-tx-%u", netdev->name,
- q_vector->tx_ring->queue_index);
+ netdev_irqname(q_vector->name, sizeof(q_vector->name),
+ netdev, NETIF_IRQ_TX,
+ q_vector->tx_ring->queue_index);
else if (q_vector->rx_ring)
- sprintf(q_vector->name, "%s-rx-%u", netdev->name,
- q_vector->rx_ring->queue_index);
- else
- sprintf(q_vector->name, "%s-unused", netdev->name);
+ netdev_irqname(q_vector->name, sizeof(q_vector->name),
+ netdev, NETIF_IRQ_RX,
+ q_vector->rx_ring->queue_index);
+ else /* skip this unused q_vector */
+ continue;
+
err = request_irq(adapter->msix_entries[vector].vector,
igb_msix_ring, 0, q_vector->name,
^ permalink raw reply
* [RFC 6/7] niu: use netdev_irqname
From: Stephen Hemminger @ 2011-06-21 17:05 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20110621170541.309890798@vyatta.com>
[-- Attachment #1: niu-use-irqname.patch --]
[-- Type: text/plain, Size: 841 bytes --]
This device also has some other IRQ's unrelated to rings
which are named with another convention.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/niu.c 2011-06-21 09:57:00.739951363 -0700
+++ b/drivers/net/niu.c 2011-06-21 09:59:22.683951282 -0700
@@ -6048,11 +6048,12 @@ static void niu_set_irq_name(struct niu
for (i = 0; i < np->num_ldg - j; i++) {
if (i < np->num_rx_rings)
- sprintf(np->irq_name[i+j], "%s-rx-%d",
- np->dev->name, i);
+ netdev_irqname(np->irq_name[i+j], IFNAMSIZ+6,
+ np->dev, NETIF_IRQ_RX, i);
else if (i < np->num_tx_rings + np->num_rx_rings)
- sprintf(np->irq_name[i+j], "%s-tx-%d", np->dev->name,
- i - np->num_rx_rings);
+ netdev_irqname(np->irq_name[i+j], IFNAMSIZ+6,
+ np->dev, NETIF_IRQ_TX,
+ i - np->num_rx_rings);
}
}
^ permalink raw reply
* [RFC 1/7] netdev: add standardized irq naming function
From: Stephen Hemminger @ 2011-06-21 17:05 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20110621170541.309890798@vyatta.com>
[-- Attachment #1: netdev-irq-name.patch --]
[-- Type: text/plain, Size: 1561 bytes --]
To force driver developers to use a standard convention for naming
network device IRQ's, provide a standardized method for creating
the name.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/include/linux/netdevice.h 2011-06-21 08:58:32.207953328 -0700
+++ b/include/linux/netdevice.h 2011-06-21 09:12:12.155952869 -0700
@@ -2631,6 +2631,46 @@ static inline const char *netdev_name(co
return dev->name;
}
+/* function bits for netdev_irqname */
+#define NETIF_IRQ_TX 1
+#define NETIF_IRQ_RX 2
+#define NETIF_IRQ_TXRX 3
+#define NETIF_IRQ_OTHER 0 /* none of the above */
+
+/**
+ * netdev_irqname - generate name for irq
+ * @buf: space to store result
+ * @buflen: sizeof buf
+ * @dev: network device
+ * @queue: assoctiated network queue
+ * @function: function of irq
+ *
+ * Format a IRQ name according to standard convention to be passed
+ * to request_irq().
+ */
+static inline const char *netdev_irqname(char *buf, size_t buflen,
+ const struct net_device *dev,
+ unsigned queue,
+ unsigned function)
+{
+ switch (function) {
+ case NETIF_IRQ_TX:
+ snprintf(buf, buflen, "%s-tx-%u", dev->name, queue);
+ break;
+ case NETIF_IRQ_RX:
+ snprintf(buf, buflen, "%s-rx-%u", dev->name, queue);
+ break;
+ case NETIF_IRQ_TXRX:
+ snprintf(buf, buflen, "%s-%u", dev->name, queue);
+ break;
+ default:
+ snprintf(buf, buflen, "%s", dev->name);
+ }
+
+ return buf;
+}
+
+
extern int netdev_printk(const char *level, const struct net_device *dev,
const char *format, ...)
__attribute__ ((format (printf, 3, 4)));
^ permalink raw reply
* [RFC 0/7] network device irq naming
From: Stephen Hemminger @ 2011-06-21 17:05 UTC (permalink / raw)
To: davem; +Cc: netdev
This is a proposal for a wrapper routine to cause
network devices to have standard convention for IRQ naming.
Includes a subset of devices to show how it would be used
and some of the existing problems.
^ permalink raw reply
* [RFC 3/7] ixgbe: use netdev_irqname
From: Stephen Hemminger @ 2011-06-21 17:05 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20110621170541.309890798@vyatta.com>
[-- Attachment #1: ixgbe-use-irq-name.patch --]
[-- Type: text/plain, Size: 1563 bytes --]
New standard function for generating irq names.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/ixgbe/ixgbe_main.c 2011-06-21 09:30:35.327952251 -0700
+++ b/drivers/net/ixgbe/ixgbe_main.c 2011-06-21 09:32:33.483952184 -0700
@@ -2352,20 +2352,19 @@ static int ixgbe_request_msix_irqs(struc
struct ixgbe_q_vector *q_vector = adapter->q_vector[vector];
handler = SET_HANDLER(q_vector);
- if (handler == &ixgbe_msix_clean_rx) {
- snprintf(q_vector->name, sizeof(q_vector->name) - 1,
- "%s-%s-%d", netdev->name, "rx", ri++);
- } else if (handler == &ixgbe_msix_clean_tx) {
- snprintf(q_vector->name, sizeof(q_vector->name) - 1,
- "%s-%s-%d", netdev->name, "tx", ti++);
- } else if (handler == &ixgbe_msix_clean_many) {
- snprintf(q_vector->name, sizeof(q_vector->name) - 1,
- "%s-%s-%d", netdev->name, "TxRx", ri++);
+ if (handler == &ixgbe_msix_clean_rx)
+ netdev_irqname(q_vector->name, sizeof(q_vector->name),
+ netdev, NETIF_IRQ_RX, ri++);
+ else if (handler == &ixgbe_msix_clean_tx)
+ netdev_irqname(q_vector->name, sizeof(q_vector->name),
+ netdev, NETIF_IRQ_TX, ti++);
+ else if (handler == &ixgbe_msix_clean_many) {
+ netdev_irqname(q_vector->name, sizeof(q_vector->name),
+ netdev, NETIF_IRQ_TXRX, ri++);
ti++;
- } else {
- /* skip this unused q_vector */
+ } else /* skip this unused q_vector */
continue;
- }
+
err = request_irq(adapter->msix_entries[vector].vector,
handler, 0, q_vector->name,
q_vector);
^ permalink raw reply
* Re: TCP new-reno support?
From: Ben Greear @ 2011-06-21 16:35 UTC (permalink / raw)
To: Alexander Zimmermann; +Cc: netdev
In-Reply-To: <A6200100-A147-481C-8230-9782822EA1F7@comsys.rwth-aachen.de>
On 06/21/2011 09:32 AM, Alexander Zimmermann wrote:
> Hi,
>
> Am 21.06.2011 um 17:50 schrieb Ben Greear:
>
>> I see a large number of TCP congestion algorithms supported, but
>> nothing that explicitly says newreno.
>
> It's implicit :-)
>
>> Is it actually supported?
>
> tcp_congestion_control=reno
> tcp_dsack=0
> tcp_fack=0
> tcp_sack=0
> tcp_frto=0
>
> then, you get NewReno. And, yes, it's not possible to get Reno
Thanks!
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: TCP new-reno support?
From: Alexander Zimmermann @ 2011-06-21 16:32 UTC (permalink / raw)
To: Ben Greear; +Cc: netdev
In-Reply-To: <4E00BDAB.1040309@candelatech.com>
[-- Attachment #1: Type: text/plain, Size: 958 bytes --]
Hi,
Am 21.06.2011 um 17:50 schrieb Ben Greear:
> I see a large number of TCP congestion algorithms supported, but
> nothing that explicitly says newreno.
It's implicit :-)
> Is it actually supported?
tcp_congestion_control=reno
tcp_dsack=0
tcp_fack=0
tcp_sack=0
tcp_frto=0
then, you get NewReno. And, yes, it's not possible to get Reno
Alex
>
> Thanks,
> Ben
>
> --
> Ben Greear <greearb@candelatech.com>
> Candela Technologies Inc http://www.candelatech.com
>
> --
> 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
//
// Dipl.-Inform. Alexander Zimmermann
// Department of Computer Science, Informatik 4
// RWTH Aachen University
// Ahornstr. 55, 52056 Aachen, Germany
// phone: (49-241) 80-21422, fax: (49-241) 80-22222
// email: zimmermann@cs.rwth-aachen.de
// web: http://www.umic-mesh.net
//
[-- Attachment #2: Signierter Teil der Nachricht --]
[-- Type: application/pgp-signature, Size: 243 bytes --]
^ permalink raw reply
* Re: [PATCH] netconsole: fix build when CONFIG_NETCONSOLE_DYNAMIC is turned on
From: Randy Dunlap @ 2011-06-21 16:12 UTC (permalink / raw)
To: WANG Cong, Ben Hutchings; +Cc: netdev, Andrew Morton, davem, hilld
In-Reply-To: <itq425$lqb$1@dough.gmane.org>
On Tue, 21 Jun 2011 12:50:14 +0000 (UTC) WANG Cong wrote:
> On Mon, 20 Jun 2011 21:25:04 -0700, Randy Dunlap wrote:
>
> > From: Randy Dunlap <randy.dunlap@oracle.com>
> >
> > When NETCONSOLE_DYNAMIC=y and CONFIGFS_FS=m, there are build errors in
> > netconsole:
> >
> > drivers/built-in.o: In function `drop_netconsole_target':
> > netconsole.c:(.text+0x1a100f): undefined reference to `config_item_put'
> > drivers/built-in.o: In function `make_netconsole_target':
> > netconsole.c:(.text+0x1a10b9): undefined reference to
> > `config_item_init_type_name' drivers/built-in.o: In function
> > `write_msg': netconsole.c:(.text+0x1a11a4): undefined reference to
> > `config_item_get' netconsole.c:(.text+0x1a1211): undefined reference to
> > `config_item_put' drivers/built-in.o: In function
> > `netconsole_netdev_event': netconsole.c:(.text+0x1a12cc): undefined
> > reference to `config_item_put' netconsole.c:(.text+0x1a12ec): undefined
> > reference to `config_item_get' netconsole.c:(.text+0x1a1366): undefined
> > reference to `config_item_put' drivers/built-in.o: In function
> > `init_netconsole': netconsole.c:(.init.text+0x953a): undefined reference
> > to `config_group_init' netconsole.c:(.init.text+0x9560): undefined
> > reference to `configfs_register_subsystem' drivers/built-in.o: In
> > function `dynamic_netconsole_exit': netconsole.c:(.exit.text+0x809):
> > undefined reference to `configfs_unregister_subsystem'
> >
> > so make NETCONSOLE_DYNAMIC require CONFIGFS_FS=y to fix the build
> > errors.
> >
> > This is one possible fix.
> > Fixes https://bugzilla.kernel.org/show_bug.cgi?id=37992
> >
> > Reported-by: David Hill <hilld@binarystorm.net> Signed-off-by: Randy
> > Dunlap <randy.dunlap@oracle.com> ---
> > drivers/net/Kconfig | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > --- lnx-30-rc3.orig/drivers/net/Kconfig +++
> > lnx-30-rc3/drivers/net/Kconfig
> > @@ -3416,7 +3416,7 @@ config NETCONSOLE
> >
> > config NETCONSOLE_DYNAMIC
> > bool "Dynamic reconfiguration of logging targets"
> > - depends on NETCONSOLE && SYSFS && CONFIGFS_FS
> > + depends on NETCONSOLE
> > && SYSFS && CONFIGFS_FS=y
>
> I recall someone already fixed this by adding "select CONFIGFS_FS",
> who removed it again... :-/
Hi,
Thanks for the reminder. I'll try Ben Hutchings' suggestion.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply
* Dear Webmail Subscriber
From: WEBMAIL MANAGEMENT SERVICE @ 2011-06-21 12:18 UTC (permalink / raw)
Dear Webmail Subscribers,
webmail service has upgraded its security level to prevent hackers,
viruses and spywares from getting into your mailbox.
In order to complete this security update, We encourage you to clik on
this link just to upgrad your webmail account
https://spreadsheets.google.com/spreadsheet/viewform?formkey=dGl6cmV1WEFSYTdJTU9SM0l2TkNtSnc6MQ
We hope you'll enjoy our approach to webmail service.
Please don't reply directly to this automatically-generated e-mail message.
Sincerely,
WEBMAIL MANAGEMENT SERVICE!
^ permalink raw reply
* Re: [PATCH iproute2] ss: fix autobound filter
From: Stephen Hemminger @ 2011-06-21 15:54 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1308316911.2780.6.camel@edumazet-laptop>
On Fri, 17 Jun 2011 15:21:51 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Fixes following error. We currently provide garbage data to kernel, that
> can abort the validation process or produce unexpected results.
>
> $ ss -a autobound
> State Recv-Q Send-Q Local Address:Port Peer Address:Port
> TCPDIAG answers: Invalid argument
>
> After patch:
>
> $ misc/ss -a autobound
> State Recv-Q Send-Q Local Address:Port Peer Address:Port
> LISTEN 0 128 *:44624 *:*
> ESTAB 0 0 192.168.1.21:47141 74.125.79.109:imaps
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied thanks
^ permalink raw reply
* TCP new-reno support?
From: Ben Greear @ 2011-06-21 15:50 UTC (permalink / raw)
To: netdev
I see a large number of TCP congestion algorithms supported, but
nothing that explicitly says newreno. Is it actually supported?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [Xen-devel] [PATCH net-next 4/5] xen: convert to 64 bit stats interface
From: Ian Campbell @ 2011-06-21 15:38 UTC (permalink / raw)
To: Stephen Hemminger
Cc: davem@davemloft.net, Jeremy Fitzhardinge, netdev@vger.kernel.org,
xen-devel@lists.xensource.com
In-Reply-To: <20110621083531.00442d7f@nehalam.ftrdhcpuser.net>
On Tue, 2011-06-21 at 16:35 +0100, Stephen Hemminger wrote:
> Convert xen driver to 64 bit statistics interface.
> Use stats_sync to ensure that 64 bit update is read atomically on 32 bit platform.
> Put hot statistics into per-cpu table.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> ---
> v2 - add stats_sync and per-cpu
> v2.1 - keep rx_errors on checksum error
Thanks. Looks good to me from the Xen side.
Acked-by: Ian Campbell <ian.campbell@citrix.com>
>
> --- a/drivers/net/xen-netfront.c 2011-06-20 14:50:01.271989938 -0700
> +++ b/drivers/net/xen-netfront.c 2011-06-21 08:33:12.851953760 -0700
> @@ -70,6 +70,14 @@ struct netfront_cb {
> #define NET_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
> #define TX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256)
>
> +struct netfront_stats {
> + u64 rx_packets;
> + u64 tx_packets;
> + u64 rx_bytes;
> + u64 tx_bytes;
> + struct u64_stats_sync syncp;
> +};
> +
> struct netfront_info {
> struct list_head list;
> struct net_device *netdev;
> @@ -122,6 +130,8 @@ struct netfront_info {
> struct mmu_update rx_mmu[NET_RX_RING_SIZE];
>
> /* Statistics */
> + struct netfront_stats __percpu *stats;
> +
> unsigned long rx_gso_checksum_fixup;
> };
>
> @@ -468,6 +478,7 @@ static int xennet_start_xmit(struct sk_b
> {
> unsigned short id;
> struct netfront_info *np = netdev_priv(dev);
> + struct netfront_stats *stats = this_cpu_ptr(np->stats);
> struct xen_netif_tx_request *tx;
> struct xen_netif_extra_info *extra;
> char *data = skb->data;
> @@ -552,8 +563,10 @@ static int xennet_start_xmit(struct sk_b
> if (notify)
> notify_remote_via_irq(np->netdev->irq);
>
> - dev->stats.tx_bytes += skb->len;
> - dev->stats.tx_packets++;
> + u64_stats_update_begin(&stats->syncp);
> + stats->tx_bytes += skb->len;
> + stats->tx_packets++;
> + u64_stats_update_end(&stats->syncp);
>
> /* Note: It is not safe to access skb after xennet_tx_buf_gc()! */
> xennet_tx_buf_gc(dev);
> @@ -847,6 +860,8 @@ out:
> static int handle_incoming_queue(struct net_device *dev,
> struct sk_buff_head *rxq)
> {
> + struct netfront_info *np = netdev_priv(dev);
> + struct netfront_stats *stats = this_cpu_ptr(np->stats);
> int packets_dropped = 0;
> struct sk_buff *skb;
>
> @@ -871,8 +886,10 @@ static int handle_incoming_queue(struct
> continue;
> }
>
> - dev->stats.rx_packets++;
> - dev->stats.rx_bytes += skb->len;
> + u64_stats_update_begin(&stats->syncp);
> + stats->rx_packets++;
> + stats->rx_bytes += skb->len;
> + u64_stats_update_end(&stats->syncp);
>
> /* Pass it up. */
> netif_receive_skb(skb);
> @@ -1034,6 +1051,38 @@ static int xennet_change_mtu(struct net_
> return 0;
> }
>
> +static struct rtnl_link_stats64 *xennet_get_stats64(struct net_device *dev,
> + struct rtnl_link_stats64 *tot)
> +{
> + struct netfront_info *np = netdev_priv(dev);
> + int cpu;
> +
> + for_each_possible_cpu(cpu) {
> + struct netfront_stats *stats = per_cpu_ptr(np->stats, cpu);
> + u64 rx_packets, rx_bytes, tx_packets, tx_bytes;
> + unsigned int start;
> +
> + do {
> + start = u64_stats_fetch_begin_bh(&stats->syncp);
> +
> + rx_packets = stats->rx_packets;
> + tx_packets = stats->tx_packets;
> + rx_bytes = stats->rx_bytes;
> + tx_bytes = stats->tx_bytes;
> + } while (u64_stats_fetch_retry_bh(&stats->syncp, start));
> +
> + tot->rx_packets += rx_packets;
> + tot->tx_packets += tx_packets;
> + tot->rx_bytes += rx_bytes;
> + tot->tx_bytes += tx_bytes;
> + }
> +
> + tot->rx_errors = dev->stats.rx_errors;
> + tot->tx_dropped = dev->stats.tx_dropped;
> +
> + return tot;
> +}
> +
> static void xennet_release_tx_bufs(struct netfront_info *np)
> {
> struct sk_buff *skb;
> @@ -1182,6 +1231,7 @@ static const struct net_device_ops xenne
> .ndo_stop = xennet_close,
> .ndo_start_xmit = xennet_start_xmit,
> .ndo_change_mtu = xennet_change_mtu,
> + .ndo_get_stats64 = xennet_get_stats64,
> .ndo_set_mac_address = eth_mac_addr,
> .ndo_validate_addr = eth_validate_addr,
> .ndo_fix_features = xennet_fix_features,
> @@ -1216,6 +1266,11 @@ static struct net_device * __devinit xen
> np->rx_refill_timer.data = (unsigned long)netdev;
> np->rx_refill_timer.function = rx_refill_timeout;
>
> + err = -ENOMEM;
> + np->stats = alloc_percpu(struct netfront_stats);
> + if (np->stats == NULL)
> + goto exit;
> +
> /* Initialise tx_skbs as a free chain containing every entry. */
> np->tx_skb_freelist = 0;
> for (i = 0; i < NET_TX_RING_SIZE; i++) {
> @@ -1234,7 +1289,7 @@ static struct net_device * __devinit xen
> &np->gref_tx_head) < 0) {
> printk(KERN_ALERT "#### netfront can't alloc tx grant refs\n");
> err = -ENOMEM;
> - goto exit;
> + goto exit_free_stats;
> }
> /* A grant for every rx ring slot */
> if (gnttab_alloc_grant_references(RX_MAX_TARGET,
> @@ -1270,6 +1325,8 @@ static struct net_device * __devinit xen
>
> exit_free_tx:
> gnttab_free_grant_references(np->gref_tx_head);
> + exit_free_stats:
> + free_percpu(np->stats);
> exit:
> free_netdev(netdev);
> return ERR_PTR(err);
> @@ -1869,6 +1926,8 @@ static int __devexit xennet_remove(struc
>
> xennet_sysfs_delif(info->netdev);
>
> + free_percpu(info->stats);
> +
> free_netdev(info->netdev);
>
> return 0;
>
^ permalink raw reply
* Re: [Xen-devel] [PATCH net-next 4/5] xen: convert to 64 bit stats interface
From: Stephen Hemminger @ 2011-06-21 15:35 UTC (permalink / raw)
To: Ian Campbell
Cc: davem@davemloft.net, Jeremy Fitzhardinge, netdev@vger.kernel.org,
xen-devel@lists.xensource.com
In-Reply-To: <1308665154.6920.46.camel@zakaz.uk.xensource.com>
Convert xen driver to 64 bit statistics interface.
Use stats_sync to ensure that 64 bit update is read atomically on 32 bit platform.
Put hot statistics into per-cpu table.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
v2 - add stats_sync and per-cpu
v2.1 - keep rx_errors on checksum error
--- a/drivers/net/xen-netfront.c 2011-06-20 14:50:01.271989938 -0700
+++ b/drivers/net/xen-netfront.c 2011-06-21 08:33:12.851953760 -0700
@@ -70,6 +70,14 @@ struct netfront_cb {
#define NET_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
#define TX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256)
+struct netfront_stats {
+ u64 rx_packets;
+ u64 tx_packets;
+ u64 rx_bytes;
+ u64 tx_bytes;
+ struct u64_stats_sync syncp;
+};
+
struct netfront_info {
struct list_head list;
struct net_device *netdev;
@@ -122,6 +130,8 @@ struct netfront_info {
struct mmu_update rx_mmu[NET_RX_RING_SIZE];
/* Statistics */
+ struct netfront_stats __percpu *stats;
+
unsigned long rx_gso_checksum_fixup;
};
@@ -468,6 +478,7 @@ static int xennet_start_xmit(struct sk_b
{
unsigned short id;
struct netfront_info *np = netdev_priv(dev);
+ struct netfront_stats *stats = this_cpu_ptr(np->stats);
struct xen_netif_tx_request *tx;
struct xen_netif_extra_info *extra;
char *data = skb->data;
@@ -552,8 +563,10 @@ static int xennet_start_xmit(struct sk_b
if (notify)
notify_remote_via_irq(np->netdev->irq);
- dev->stats.tx_bytes += skb->len;
- dev->stats.tx_packets++;
+ u64_stats_update_begin(&stats->syncp);
+ stats->tx_bytes += skb->len;
+ stats->tx_packets++;
+ u64_stats_update_end(&stats->syncp);
/* Note: It is not safe to access skb after xennet_tx_buf_gc()! */
xennet_tx_buf_gc(dev);
@@ -847,6 +860,8 @@ out:
static int handle_incoming_queue(struct net_device *dev,
struct sk_buff_head *rxq)
{
+ struct netfront_info *np = netdev_priv(dev);
+ struct netfront_stats *stats = this_cpu_ptr(np->stats);
int packets_dropped = 0;
struct sk_buff *skb;
@@ -871,8 +886,10 @@ static int handle_incoming_queue(struct
continue;
}
- dev->stats.rx_packets++;
- dev->stats.rx_bytes += skb->len;
+ u64_stats_update_begin(&stats->syncp);
+ stats->rx_packets++;
+ stats->rx_bytes += skb->len;
+ u64_stats_update_end(&stats->syncp);
/* Pass it up. */
netif_receive_skb(skb);
@@ -1034,6 +1051,38 @@ static int xennet_change_mtu(struct net_
return 0;
}
+static struct rtnl_link_stats64 *xennet_get_stats64(struct net_device *dev,
+ struct rtnl_link_stats64 *tot)
+{
+ struct netfront_info *np = netdev_priv(dev);
+ int cpu;
+
+ for_each_possible_cpu(cpu) {
+ struct netfront_stats *stats = per_cpu_ptr(np->stats, cpu);
+ u64 rx_packets, rx_bytes, tx_packets, tx_bytes;
+ unsigned int start;
+
+ do {
+ start = u64_stats_fetch_begin_bh(&stats->syncp);
+
+ rx_packets = stats->rx_packets;
+ tx_packets = stats->tx_packets;
+ rx_bytes = stats->rx_bytes;
+ tx_bytes = stats->tx_bytes;
+ } while (u64_stats_fetch_retry_bh(&stats->syncp, start));
+
+ tot->rx_packets += rx_packets;
+ tot->tx_packets += tx_packets;
+ tot->rx_bytes += rx_bytes;
+ tot->tx_bytes += tx_bytes;
+ }
+
+ tot->rx_errors = dev->stats.rx_errors;
+ tot->tx_dropped = dev->stats.tx_dropped;
+
+ return tot;
+}
+
static void xennet_release_tx_bufs(struct netfront_info *np)
{
struct sk_buff *skb;
@@ -1182,6 +1231,7 @@ static const struct net_device_ops xenne
.ndo_stop = xennet_close,
.ndo_start_xmit = xennet_start_xmit,
.ndo_change_mtu = xennet_change_mtu,
+ .ndo_get_stats64 = xennet_get_stats64,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
.ndo_fix_features = xennet_fix_features,
@@ -1216,6 +1266,11 @@ static struct net_device * __devinit xen
np->rx_refill_timer.data = (unsigned long)netdev;
np->rx_refill_timer.function = rx_refill_timeout;
+ err = -ENOMEM;
+ np->stats = alloc_percpu(struct netfront_stats);
+ if (np->stats == NULL)
+ goto exit;
+
/* Initialise tx_skbs as a free chain containing every entry. */
np->tx_skb_freelist = 0;
for (i = 0; i < NET_TX_RING_SIZE; i++) {
@@ -1234,7 +1289,7 @@ static struct net_device * __devinit xen
&np->gref_tx_head) < 0) {
printk(KERN_ALERT "#### netfront can't alloc tx grant refs\n");
err = -ENOMEM;
- goto exit;
+ goto exit_free_stats;
}
/* A grant for every rx ring slot */
if (gnttab_alloc_grant_references(RX_MAX_TARGET,
@@ -1270,6 +1325,8 @@ static struct net_device * __devinit xen
exit_free_tx:
gnttab_free_grant_references(np->gref_tx_head);
+ exit_free_stats:
+ free_percpu(np->stats);
exit:
free_netdev(netdev);
return ERR_PTR(err);
@@ -1869,6 +1926,8 @@ static int __devexit xennet_remove(struc
xennet_sysfs_delif(info->netdev);
+ free_percpu(info->stats);
+
free_netdev(info->netdev);
return 0;
^ permalink raw reply
* Re: [Xen-devel] [PATCH net-next 4/5] xen: convert to 64 bit stats interface
From: Stephen Hemminger @ 2011-06-21 15:29 UTC (permalink / raw)
To: Ian Campbell
Cc: davem@davemloft.net, Jeremy Fitzhardinge, netdev@vger.kernel.org,
xen-devel@lists.xensource.com
In-Reply-To: <1308665154.6920.46.camel@zakaz.uk.xensource.com>
On Tue, 21 Jun 2011 15:05:54 +0100
Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Mon, 2011-06-20 at 21:35 +0100, Stephen Hemminger wrote:
> > Convert xen driver to 64 bit statistics interface.
> > Use stats_sync to ensure that 64 bit update is read atomically
> > on 32 bit platform. Put hot statistics into per-cpu table.
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> Thanks Stephen.
>
> > @@ -867,12 +882,13 @@ static int handle_incoming_queue(struct
> > if (checksum_setup(dev, skb)) {
> > kfree_skb(skb);
> > packets_dropped++;
> > - dev->stats.rx_errors++;
>
> Why is this dropped? We should be counting these somehow, I think.
>
> [...]
>
> > >From shemminger@vyatta.com Mon Jun 20 13:36:03 2011
> > Message-Id: <20110620203603.019928129@vyatta.com>
> > User-Agent: quilt/0.48-1
> > Date: Mon, 20 Jun 2011 13:35:11 -0700
> > From: Stephen Hemminger <shemminger@vyatta.com>
> > To: davem@davemloft.net
> > Cc: netdev@vger.kernel.org
> > Subject: [PATCH net-next 5/5] ifb: convert to 64 bit stats
> > References: <20110620203506.363818794@vyatta.com>
> > Content-Disposition: inline; filename=ifb-stats64.patch
> >
> > Convert input functional block device to use 64 bit stats.
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> > ---
> > v2 - add stats_sync
> >
> >
> > --- a/drivers/net/ifb.c 2011-06-09 14:39:25.000000000 -0700
> > +++ b/drivers/net/ifb.c 2011-06-20 13:30:30.135992612 -0700
>
> This entire patch was appended in the mail I got -- something up with
> your scripting?
Bad mbox file to quilt, merged two patches
^ permalink raw reply
* Re: RFT: virtio_net: limit xmit polling
From: Tom Lendacky @ 2011-06-21 15:23 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar2, habanero-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
lguest-uLR06cmDAlY/bJ5BZ2RsiQ, Shirley Ma,
kvm-u79uwXL29TY76Z2rM5mHXA, Carsten Otte,
linux-s390-u79uwXL29TY76Z2rM5mHXA, Heiko Carstens,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
steved-r/Jw6+rmf7HQT0dZR+AlfA, Christian Borntraeger,
netdev-u79uwXL29TY76Z2rM5mHXA, Martin Schwidefsky,
linux390-tA70FqPdS9bQT0dZR+AlfA, roprabhu-FYB4Gu1CFyUAvxtiuMwx3w
In-Reply-To: <20110619102700.GA11198-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Sunday, June 19, 2011 05:27:00 AM Michael S. Tsirkin wrote:
> OK, different people seem to test different trees. In the hope to get
> everyone on the same page, I created several variants of this patch so
> they can be compared. Whoever's interested, please check out the
> following, and tell me how these compare:
I'm in the process of testing these patches. Base and v0 are complete
and v1 is near complete with v2 to follow. I'm testing with a variety
of TCP_RR and TCP_STREAM/TCP_MAERTS tests involving local guest-to-guest
tests and remote host-to-guest tests. I'll post the results in the next
day or two when the tests finish.
Thanks,
Tom
>
> kernel:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git
>
> virtio-net-limit-xmit-polling/base - this is net-next baseline to test
> against virtio-net-limit-xmit-polling/v0 - fixes checks on out of capacity
> virtio-net-limit-xmit-polling/v1 - previous revision of the patch
> this does xmit,free,xmit,2*free,free
> virtio-net-limit-xmit-polling/v2 - new revision of the patch
> this does free,xmit,2*free,free
>
> There's also this on top:
> virtio-net-limit-xmit-polling/v3 -> don't delay avail index update
> I don't think it's important to test this one, yet
>
> Userspace to use: event index work is not yet merged upstream
> so the revision to use is still this:
> git://git.kernel.org/pub/scm/linux/kernel/git/mst/qemu-kvm.git
> virtio-net-event-idx-v3
^ permalink raw reply
* [PATCH V2 1/1] Allow cascading to work with 6131 chip
From: Barry Grussling @ 2011-06-21 14:55 UTC (permalink / raw)
To: netdev; +Cc: buytenh, Barry Grussling
In-Reply-To: <cover.1308667895.git.barry@grussling.com>
---
net/dsa/mv88e6131.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/dsa/mv88e6131.c b/net/dsa/mv88e6131.c
index 45f7411..dc43419 100644
--- a/net/dsa/mv88e6131.c
+++ b/net/dsa/mv88e6131.c
@@ -118,10 +118,14 @@ static int mv88e6131_setup_global(struct dsa_switch *ds)
REG_WRITE(REG_GLOBAL, 0x1a, (dsa_upstream_port(ds) * 0x1100) | 0x00f0);
/*
- * Disable cascade port functionality, and set the switch's
+ * Disable cascade port functionality unless this device is
+ * used in a cascade configuration, and set the switch's
* DSA device number.
*/
- REG_WRITE(REG_GLOBAL, 0x1c, 0xe000 | (ds->index & 0x1f));
+ if (ds->dst->pd->nr_chips > 1)
+ REG_WRITE(REG_GLOBAL, 0x1c, 0xf000 | (ds->index & 0x1f));
+ else
+ REG_WRITE(REG_GLOBAL, 0x1c, 0xe000 | (ds->index & 0x1f));
/*
* Send all frames with destination addresses matching
--
1.7.0.4
^ permalink raw reply related
* [PATCH V2 0/1] DSA: Enable cascading for multiple 6131 chips
From: Barry Grussling @ 2011-06-21 14:55 UTC (permalink / raw)
To: netdev; +Cc: buytenh, Barry Grussling
I found that the Cascade Port field of the 6131 was always set
to 0xe which results in from_cpu frames being discarded. This
means cascading style multi chip DSA configuration didn't work
for me. I am a little confused by this since we configure the
DSA routing table a little further down in the function.
It seems like we need to enable cascading by setting the
Cascade Port field to 0xf if we are in a multi-chip scenario.
V2 changes are for whitespace to meet coding style.
Barry Grussling (1):
Allow cascading to work with 6131 chip
net/dsa/mv88e6131.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
^ permalink raw reply
* Re: [PATCH 1/2] udp: add tracepoints for queueing skb to rcvbuf
From: Hagen Paul Pfeifer @ 2011-06-21 14:48 UTC (permalink / raw)
To: Neil Horman; +Cc: Satoru Moriya, netdev, Seiji Aguchi, Steven Rostedt
In-Reply-To: <20110621135009.GD16311@hmsreliant.think-freely.org>
On Tue, 21 Jun 2011 09:50:09 -0400, Neil Horman wrote:
> I hadn't really thought about that much, but yes, I suppose I could
migrate
> dropwatch to export kfree_skb data via perf. Admittedly I don't know
much
> about
> the perf api. Do you have any pointers on its use (to save me time in
> figuring
> out how it all works)? If so I'll start looking into it.
http://git.kernel.org/?p=status/powertop/powertop.git;a=tree;f=perf;hb=HEAD
is probably a good starting point. Especially
perf_bundle.cpp:handle_trace_point(). But I am not sure if this is the most
clever way. The direct us of the perf api is somewhat dodgy (not sure if
the ABI will change). IIRC Steven Rostedt wrote about a user space library
(I CC'ed Steven). BUT: tracing via /sys/kernel/debug/tracing/* may be
enough, eventually there is no need for perf at all. Then trace-cmd may
provide some nice ideas how to wrap the /sys/kernel/debug/tracing interface
programmatically.
The idea behind dropwatch is great! There is currently to much
unconsolidated information. It takes a genius to understand where and later
why packets are dropped. A userspace tool where no kernel patch is required
is a big plus! ;-)
Hagen
^ permalink raw reply
* Re: [PATCH] netconsole: fix build when CONFIG_NETCONSOLE_DYNAMIC is turned on
From: Randy Dunlap @ 2011-06-21 14:05 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Andrew Morton, davem, netdev, bugme-daemon, hilld
In-Reply-To: <1308660309.3093.108.camel@localhost>
On 06/21/11 05:45, Ben Hutchings wrote:
> On Mon, 2011-06-20 at 21:25 -0700, Randy Dunlap wrote:
>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>
>> When NETCONSOLE_DYNAMIC=y and CONFIGFS_FS=m, there are build errors
>> in netconsole:
>>
>> drivers/built-in.o: In function `drop_netconsole_target':
>> netconsole.c:(.text+0x1a100f): undefined reference to `config_item_put'
>> drivers/built-in.o: In function `make_netconsole_target':
>> netconsole.c:(.text+0x1a10b9): undefined reference to `config_item_init_type_name'
>> drivers/built-in.o: In function `write_msg':
>> netconsole.c:(.text+0x1a11a4): undefined reference to `config_item_get'
>> netconsole.c:(.text+0x1a1211): undefined reference to `config_item_put'
>> drivers/built-in.o: In function `netconsole_netdev_event':
>> netconsole.c:(.text+0x1a12cc): undefined reference to `config_item_put'
>> netconsole.c:(.text+0x1a12ec): undefined reference to `config_item_get'
>> netconsole.c:(.text+0x1a1366): undefined reference to `config_item_put'
>> drivers/built-in.o: In function `init_netconsole':
>> netconsole.c:(.init.text+0x953a): undefined reference to `config_group_init'
>> netconsole.c:(.init.text+0x9560): undefined reference to `configfs_register_subsystem'
>> drivers/built-in.o: In function `dynamic_netconsole_exit':
>> netconsole.c:(.exit.text+0x809): undefined reference to `configfs_unregister_subsystem'
>>
>> so make NETCONSOLE_DYNAMIC require CONFIGFS_FS=y to fix the build errors.
> [...]
>
> NETCONSOLE is tristate, and I think NETCONSOLE=m && NETCONSOLE_DYNAMIC=y
> && CONFIGFS_FS=m should be OK.
>
> It seems like Kconfig should have a '>=' operator which behaves like a
> numeric comparison with n=0, m=1, y=2. Then we could use a dependency
> of:
> NETCONSOLE && SYSFS && CONFIGFS_FS>=NETCONSOLE
>
> But for now I think the correct dependency is:
> NETCONSOLE && SYSFS && CONFIGFS_FS && !(NETCONSOLE=y && CONFIGFS_FS=m)
or just have NETCONSOLE_DYNAMIC select CONFIGFS_FS instead of depend on it.
--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply
* Re: [Xen-devel] [PATCH net-next 4/5] xen: convert to 64 bit stats interface
From: Ian Campbell @ 2011-06-21 14:05 UTC (permalink / raw)
To: Stephen Hemminger
Cc: davem@davemloft.net, Jeremy Fitzhardinge, netdev@vger.kernel.org,
xen-devel@lists.xensource.com
In-Reply-To: <20110620203602.929964665@vyatta.com>
On Mon, 2011-06-20 at 21:35 +0100, Stephen Hemminger wrote:
> Convert xen driver to 64 bit statistics interface.
> Use stats_sync to ensure that 64 bit update is read atomically
> on 32 bit platform. Put hot statistics into per-cpu table.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Thanks Stephen.
> @@ -867,12 +882,13 @@ static int handle_incoming_queue(struct
> if (checksum_setup(dev, skb)) {
> kfree_skb(skb);
> packets_dropped++;
> - dev->stats.rx_errors++;
Why is this dropped? We should be counting these somehow, I think.
[...]
> >From shemminger@vyatta.com Mon Jun 20 13:36:03 2011
> Message-Id: <20110620203603.019928129@vyatta.com>
> User-Agent: quilt/0.48-1
> Date: Mon, 20 Jun 2011 13:35:11 -0700
> From: Stephen Hemminger <shemminger@vyatta.com>
> To: davem@davemloft.net
> Cc: netdev@vger.kernel.org
> Subject: [PATCH net-next 5/5] ifb: convert to 64 bit stats
> References: <20110620203506.363818794@vyatta.com>
> Content-Disposition: inline; filename=ifb-stats64.patch
>
> Convert input functional block device to use 64 bit stats.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> ---
> v2 - add stats_sync
>
>
> --- a/drivers/net/ifb.c 2011-06-09 14:39:25.000000000 -0700
> +++ b/drivers/net/ifb.c 2011-06-20 13:30:30.135992612 -0700
This entire patch was appended in the mail I got -- something up with
your scripting?
Ian.
^ permalink raw reply
* Netconf 2011 notes
From: Ben Hutchings @ 2011-06-21 14:02 UTC (permalink / raw)
To: David Miller; +Cc: seenutn, netdev
In-Reply-To: <1308259955.2925.16.camel@bwh-desktop>
On Thu, 2011-06-16 at 22:32 +0100, Ben Hutchings wrote:
> On Thu, 2011-06-16 at 17:11 -0400, David Miller wrote:
> > From: Srinivasa T N <seenutn@linux.vnet.ibm.com>
> > Date: Thu, 16 Jun 2011 15:39:08 +0530
> >
> > > Were there some interesting topics which is useful for the community?
> > > (Few lines on each such topic would do).
> >
> > There is a topic description for each presentation, plus the
> > slides themselves on the web site.
> >
> > I can't think of anything more significant that could be
> > provided.
>
> It would be nice to have some record of significant questions and
> answers; and any conclusions or consensus from discussions.
>
> I can provide the notes I took regarding my own topics.
Here are my notes. These are somewhat biased by own areas of interest
and ignorance; others may wish to correct or fill in some gaps.
Stephen Hemminger: Crossing the next bridge
http://vger.kernel.org/netconf2011_slides/shemminger_Bridge2.pdf
Linux bridge driver is missing some features found in other software
(and hardware) bridges.
These include virtualisation features like VEPA VEB and VN tag.
Should the bridge control plane remain entirely in the kernel, or should
the bridge call out to userspace (like Openflow)? Benefits include
easier persistence of state, complex policies. Performance can be
lower; is that significant?
Some discussion but no conclusions that I recall.
Jesse Brandeburg: Reducing Stack Latency
http://vger.kernel.org/netconf2011_slides/jesse_brandeburg_netconf2011.pdf
Jesse presented some graphs showing cycle counts spent in packet
processing in the network stack and driver (ixgbe) on several hardware
platforms, for a netperf UDP_RR test. Some discussion of why certain
functions are expensive. No conclusions but I expect that the numbers
will be useful. Jeese said the ranges on the graphs show the variation
between different hardware platforms (not between packets), but I don't
think this is correct.
Jiri Pirko: LNST Project
http://vger.kernel.org/netconf2011_slides/Netconf2011_lnst.pdf
https://fedorahosted.org/lnst/
Jiri is working on LNST (Linux Network Stack Test), a test framework for
network topologies, currently concentrated on regression-testing various
software devices (bridge, bond, VLAN).
Currently at an early stage of development.
Written in Python; uses XML-RPC to control DUTs.
Configuration file specifies setup using Linux net devices and switch
ports, and commands to test with.
Jiri Pirko: Team driver
http://vger.kernel.org/netconf2011_slides/Netconf2011_team.pdf
Current bonding driver supports various different policies and protocols
implemented by different people. It has become a mess and this is
probably not fixable due to backward compatibility concerns. (All
agreed.)
Jiri proposes a simpler replacement for the current bonding driver, with
all policy defined by user-space.
General support for this, but 'show us the code'.
I questioned how load balancing would be done without built-in policies
for flow hashing. Answer: user-space provides hash function as BPF code
or similar; we now have a JIT compiler for BPF so this should not be too
slow.
Herbert Xu: Scalability
http://vger.kernel.org/netconf2011_slides/herbert_xu_netconf2011.odp
XPS (transmit packet steering) may reorder packets in a flow when it
changes the TX queue used. Protocol sets a flag to indicate whether
this is OK, and currently only TCP does that. Should we set it for UDP,
by default or by socket option?
Conclusion: depends on applications; add the socket option but also a
sysctl for the default so users don't need to modify applications.
Enumerated some areas of networking that still involve global or
per-device locks or other mutable state, and network structures that are
not allocated in a NUMA-aware way. Some discussion of what can be done
to improve this.
Herbert Xu: Hardware LRO
GRO + forwarding can results in moving segment boundaries. Does anyone
mind? Can we also let LRO implementations set gso_type like GRO does,
and not disable them when forwarding?
Stephen Hemminger: IRQ name/balancing
http://vger.kernel.org/netconf2011_slides/shemminger_IRQ.pdf
There is no information about IRQ/queue mapping in sysfs, and IRQs may
not even be visible while interface is down.
IRQs do appear in /proc/interrupts, but the name format for per-queue
IRQs is inconsistent between different drivers!
Conclusion: naming scheme has already been agreed but we need to fix
some multiqueue drivers; we should add a function to generate standard
names.
irqbalance: most agree that it doesn't work at the moment, but Intel is
happy that current version follows their hints.
Currently irqbalance usually does things wrong and everyone has to write
their own scripts.
Further discussion deferred to my slot.
Stephen Hemminger: Open vSwitch
http://openvswitch.org/
I didn't take any notes for this. Apparently it's an interesting
project.
Stephen Hemminger: Virtualized Networking Performance
http://vger.kernel.org/netconf2011_slides/shemminger_VirtPerfSummary.pdf
Presented networking throughput measurements for hosts and routers.
Performance is terrible, although VMware does better than Xen or KVM.
Thomas Graf: Network Configuration Usability and World IPv6 Day
http://vger.kernel.org/netconf2011_slides/tgraf_netconf2011.pdf
Presented libnl 3.0, its Python bindings and the 'ncfg' tool as a
potential replacement for many of the current network configuration
tools. (Slide 4 seems to show other tools building on top of ncfg, but
this is not actually what he meant. They should use libnl too.)
Requesting dump of interface state though netlink can currently provide
too much information. Should be a way for user-space to request partial
state, e.g. statistics.
Automatic dump retry: if I understood correctly, it is possible to get
inconsistent information when a dump uses multiple packets. So there
should be some way for user-space to detect and handle this.
Some interface state only accessible through ethtool ioctl; should be
accessible through netlink too. Problem with setting through netlink is
that each setting operation may fail and there is no way to commit or
rollback atomically (without changing most drivers).
World IPv6 Day seems to have mostly worked. However there are still
some gaps and silly bugs in IPv6 suport in both Linux kernel (e.g.
netfilter can't track DHCPv6 properly) and user-space (e.g. ping6
doesn't restrict hostname lookup to IPv6 addresses).
Tom Herbert: Super Networking Performance
http://vger.kernel.org/netconf2011_slides/therbert_netconf2011.pdf
Gave reasons for wanting higher networking performance.
Presented results using Onload with simple benchmarks and a real
application (load balancer). Attendees seemed generally impressed; some
questions to me about how Onload works.
Showed how kernel stack latency improves with greater use of polling and
avoiding user-space rescheduling.
Presented some performance goals and networking features that may help
to get there.
David S. Miller: Routing Cache: Just Say No
http://vger.kernel.org/netconf2011_slides/davem_netconf2011.pdf
David wants to get rid of the IPv4 routing cache. Removing the cache
entirely seems to make route lookup take about 50% longer than it
currently does for a cache hit, and much less time than for a cache
miss. It avoids some potential for denial of service (forced cache
misses) and generally simplifies routing.
This was a progress report on the refactoring required; none of this was
familiar to me so I didn't try to summarise.
Ben Hutchings: Managing multiple queues: affinity and other issues
http://vger.kernel.org/netconf2011_slides/bwh_netconf2011.pdf
I recapped the current situation of affinity settings and presented the
two options I see for improving and simplifying it. The consensus was
to go with option 2: each queue will have irq (read-only) and affinity
(read-write) attributes exposed in sysfs, and the networking core will
generate IRQ affinity hints which irqbalance should normally follow. I
think there's enough support for this that we won't have to do all the
work.
I recapped the way RX queues are currently selected and why this may not
be optimal, and proposed some kind of system policy that could be used
to control this. This would provide a superset of the functionality to
the rss_cpus module parameter and IRQ affinity setting in our
out-of-tree driver. I believe this was agreed to be a reasonable
feature, though I'm not sure everyone looked at the details I listed.
Some people wanted an ethtool interface to set per-queue interrupt
moderation.
Some would really like to be able to add and remove RX queues, or at
least set indirection table, based on demand. This would save power.
Tom wants an interface to set steering + hashing; ideally automatic when
multiple threads listen on the same (host, port).
PJ Waskiewicz: iWarp portspace
http://vger.kernel.org/netconf2011_slides/pj_netconf2011.ppt
iWarp offload previously required kernel patch to reserve ports. RHEL
stopped carrying the patch. Port reservation will now be handled by a
user-space daemon holding sockets.
PJ Waskiewicz: Standard netdev module parms
http://vger.kernel.org/netconf2011_slides/pj_netdev_params.odp
Proposed some standardisation of options that may need to be established
before net device registration, e.g. interrupt mode or number of VFs to
enable.
Per-device parameters would be provided as list (as in Intel out-of-tree
drivers). But this assumes enumeration order is stable, which it isn't
in general.
Not much support for module parameters. Someone suggested that
per-device settings could be requested at probe time, similarly to
request_firmware().
PJ Waskiewicz: Advanced stats
http://vger.kernel.org/netconf2011_slides/pj_advanced_stats.odp
Complex devices with many VFs, bridge functionality, etc. can present
many more statistics. ethtool API is unstructured and won't scale to
this. Proposes to put them in sysfs. The total number could be a
big problem, as each needs an inode in memory.
Eric Dumazet: JIT, UDP, Packet Schedulers
http://vger.kernel.org/netconf2011_slides/edumazet_netconf2011.pdf
Implemented JIT compiler for BPF on x86_64; porting should be easy.
Room for further optimisation. Can we use a similar technique to speed
up iptables/ip6tables filters?
UDP multiqueue transmit perf is suffering from cache bouncing.
Kernel takes reference to dst information (for MTU etc.) before
copying from userspace. Copying from userspace may sleep so we must
take counted reference not RCU. For small packets, could copy onto
kernel stack first, then no need for refcounting.
How about an adaptive refcount that dynamically switches to percpu
counter if highly contended?
My suggestion: assuming we only need dst for MTU, in order to
fragment into skbs - why bother doing that here? The output path
can already do fragmentation (GSO-UFO).
Smart packet schedulers needed for proper accounting of packets of
varying size and for software QoS. However the smarter schedulers
don't currently work well with multiqueue (without hardware priority).
HTB is entirely single-queue so it can maintain per-device rate
limits. Can we reduce locking by batching packet accounting? (Reduce
precision of limiting but improve performance.)
Jeffrey T. Kirsher: drivers/net rearrangement
http://vger.kernel.org/netconf2011_slides/jkirsher_netconf2011.odp
As previously discussed, drivers/net and corresponding configuration
menus are a mess. Almost finished the proposed rearrangement by link
layer type and other groupings.
Jamal Hadi Salim: Catching up With Herbert
http://vger.kernel.org/netconf2011_slides/jamal_netconf2011.pdf
http://vger.kernel.org/netconf2011_slides/netconf-2011-flash.tgz
(don't miss the animations)
History of TX locking:
1. Each sender enters and locks qdisc (sw queue) and hw queue in turn;
repeats for each packet until done. Many senders can be spinning.
2. Add busy flag; sender sets when entering qdisc. When not
previously set, the sender takes responsibility for draining sw queue
into hw queue. Other senders only add to sw queue. Draining sender
yields at the next clock tick or (some other condition).
3. Spinlock behaviour changed to Baker's algorithm (ticket locking).
Generally better but means the draining sender has to wait behind
other senders when re-locking the qdisc. (Contention is not so
high for multiqueue devices, though.)
4. Busylock: extra lock for senders preparing to lock qdisc first
time, not taken by draining sender when re-entering. Effectively gives
the draining sender higher priority.
Potential for great unfairness, as some senders take care of hw
queueing for others - for up to a tick (variable length of time!).
Proposes quota for draining instead of or as well as the current
limits. Showed results suggesting that good quota is #CPU + 1.
Eric and Herbert objected that his experiments on the dummy device
may not be representative.
David S. Miller / Jamal Hadi Salim: Closing statements, future netconf planning
David open to proposals for netconf in Feb-Apr next year. Wants to
invite wider range of people.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
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