* [NET_NEXT RFC PATCH 0/3] Series short description
From: Catherine Sullivan @ 2012-05-09 23:09 UTC (permalink / raw)
To: netdev
The following patches add debugfs support to the ixgbe driver to give users the
ability to call functions registered in netdev_ops (simulating kernel actions)
as well as the ability to read and write to individual HW registers on the fly.
These options can be useful when debugging and unit testing ixgbe.
The following series implements...
---
Catherine Sullivan (3):
ixgbe: added reg_ops file to debugfs
ixgbe: added netdev_ops file to debugfs
ixgbe: add debugfs support
drivers/net/ethernet/intel/ixgbe/Makefile | 2
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 10 +
drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 293 ++++++++++++++++++++++
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 17 +
4 files changed, 320 insertions(+), 2 deletions(-)
create mode 100644 drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
--
Catherine Sullivan
^ permalink raw reply
* [NET_NEXT RFC PATCH 1/3] ixgbe: add debugfs support
From: Catherine Sullivan @ 2012-05-09 23:09 UTC (permalink / raw)
To: netdev
In-Reply-To: <20120509230814.31910.80709.stgit@localhost6.localdomain6>
This patch adds debugfs support to the ixgbe driver to give
users the ability to access kernel information and to
simulate kernel events.
The filesystem is set up in the following driver/PCI-instance
hierarchy:
<debugfs>
|-- ixgbe
|-- PCI instance
| |-- attribute files
|-- PCI instance
|-- attribute files
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
---
drivers/net/ethernet/intel/ixgbe/Makefile | 2 -
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 10 ++-
drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 82 ++++++++++++++++++++++
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 17 +++++
4 files changed, 109 insertions(+), 2 deletions(-)
create mode 100644 drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
diff --git a/drivers/net/ethernet/intel/ixgbe/Makefile b/drivers/net/ethernet/intel/ixgbe/Makefile
index 9cfbf35..a11c8ef 100644
--- a/drivers/net/ethernet/intel/ixgbe/Makefile
+++ b/drivers/net/ethernet/intel/ixgbe/Makefile
@@ -32,7 +32,7 @@
obj-$(CONFIG_IXGBE) += ixgbe.o
-ixgbe-objs := ixgbe_main.o ixgbe_common.o ixgbe_ethtool.o \
+ixgbe-objs := ixgbe_main.o ixgbe_common.o ixgbe_ethtool.o ixgbe_debugfs.o\
ixgbe_82599.o ixgbe_82598.o ixgbe_phy.o ixgbe_sriov.o \
ixgbe_mbx.o ixgbe_x540.o ixgbe_sysfs.o ixgbe_lib.o
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index bd5885a..f3f4dd4 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -583,6 +583,9 @@ struct ixgbe_adapter {
#ifdef CONFIG_IXGBE_HWMON
struct hwmon_buff ixgbe_hwmon_buff;
#endif /* CONFIG_IXGBE_HWMON */
+#ifdef CONFIG_DEBUG_FS
+ struct dentry *ixgbe_dbg_adapter;
+#endif /*CONFIG_DEBUG_FS*/
};
struct ixgbe_fdir_filter {
@@ -711,7 +714,12 @@ extern int ixgbe_fcoe_get_hbainfo(struct net_device *netdev,
struct netdev_fcoe_hbainfo *info);
extern u8 ixgbe_fcoe_get_tc(struct ixgbe_adapter *adapter);
#endif /* IXGBE_FCOE */
-
+#ifdef CONFIG_DEBUG_FS
+extern void ixgbe_dbg_adapter_init(struct ixgbe_adapter *adapter);
+extern void ixgbe_dbg_adapter_exit(struct ixgbe_adapter *adapter);
+extern void ixgbe_dbg_init(void);
+extern void ixgbe_dbg_exit(void);
+#endif /* CONFIG_DEBUG_FS */
static inline struct netdev_queue *txring_txq(const struct ixgbe_ring *ring)
{
return netdev_get_tx_queue(ring->netdev, ring->queue_index);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
new file mode 100644
index 0000000..423700f
--- /dev/null
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
@@ -0,0 +1,82 @@
+/*******************************************************************************
+
+ Intel 10 Gigabit PCI Express Linux driver
+ Copyright(c) 1999 - 2012 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+ version 2, as published by the Free Software Foundation.
+
+ This program is distributed in the hope it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+
+ The full GNU General Public License is included in this distribution in
+ the file called "COPYING".
+
+ Contact Information:
+ e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
+ Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
+*******************************************************************************/
+
+#ifdef CONFIG_DEBUG_FS
+
+#include <linux/debugfs.h>
+#include <linux/module.h>
+
+#include "ixgbe.h"
+
+static struct dentry *ixgbe_dbg_root;
+
+/**
+ * ixgbe_dbg_adapter_init - setup the debugfs directory for the adapter
+ * @adapter: the adapter that is starting up
+ **/
+void ixgbe_dbg_adapter_init(struct ixgbe_adapter *adapter)
+{
+ const char *name = pci_name(adapter->pdev);
+
+ adapter->ixgbe_dbg_adapter = debugfs_create_dir(name, ixgbe_dbg_root);
+ if (adapter->ixgbe_dbg_adapter) {
+ /* create files here */
+ } else {
+ e_dev_err("debugfs entry for %s failed\n", name);
+ }
+}
+
+/**
+ * ixgbe_dbg_adapter_exit - clear out the adapter's debugfs entries
+ * @pf: the pf that is stopping
+ **/
+void ixgbe_dbg_adapter_exit(struct ixgbe_adapter *adapter)
+{
+ if (adapter->ixgbe_dbg_adapter)
+ debugfs_remove_recursive(adapter->ixgbe_dbg_adapter);
+ adapter->ixgbe_dbg_adapter = NULL;
+}
+
+/**
+ * ixgbe_dbg_init - start up debugfs for the driver
+ **/
+void ixgbe_dbg_init(void)
+{
+ ixgbe_dbg_root = debugfs_create_dir(ixgbe_driver_name, NULL);
+ if (ixgbe_dbg_root == NULL)
+ pr_err("init of debugfs failed\n");
+}
+
+/**
+ * ixgbe_dbg_exit - clean out the driver's debugfs entries
+ **/
+void ixgbe_dbg_exit(void)
+{
+ debugfs_remove_recursive(ixgbe_dbg_root);
+}
+
+#endif /* CONFIG_DEBUG_FS */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 7910000..503dcb6 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7383,6 +7383,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
e_err(probe, "failed to allocate sysfs resources\n");
#endif /* CONFIG_IXGBE_HWMON */
+#ifdef CONFIG_DEBUG_FS
+ ixgbe_dbg_adapter_init(adapter);
+#endif /* CONFIG_DEBUG_FS */
+
return 0;
err_register:
@@ -7417,6 +7421,10 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
struct ixgbe_adapter *adapter = pci_get_drvdata(pdev);
struct net_device *netdev = adapter->netdev;
+#ifdef CONFIG_DEBUG_FS
+ ixgbe_dbg_adapter_exit(adapter);
+#endif /*CONFIG_DEBUG_FS */
+
set_bit(__IXGBE_DOWN, &adapter->state);
cancel_work_sync(&adapter->service_task);
@@ -7672,6 +7680,10 @@ static int __init ixgbe_init_module(void)
pr_info("%s - version %s\n", ixgbe_driver_string, ixgbe_driver_version);
pr_info("%s\n", ixgbe_copyright);
+#ifdef CONFIG_DEBUG_FS
+ ixgbe_dbg_init();
+#endif /* CONFIG_DEBUG_FS */
+
#ifdef CONFIG_IXGBE_DCA
dca_register_notify(&dca_notifier);
#endif
@@ -7694,6 +7706,11 @@ static void __exit ixgbe_exit_module(void)
dca_unregister_notify(&dca_notifier);
#endif
pci_unregister_driver(&ixgbe_driver);
+
+#ifdef CONFIG_DEBUG_FS
+ ixgbe_dbg_exit();
+#endif /* CONFIG_DEBUG_FS */
+
rcu_barrier(); /* Wait for completion of call_rcu()'s */
}
^ permalink raw reply related
* [NET_NEXT RFC PATCH 2/3] ixgbe: added netdev_ops file to debugfs
From: Catherine Sullivan @ 2012-05-09 23:09 UTC (permalink / raw)
To: netdev
In-Reply-To: <20120509230814.31910.80709.stgit@localhost6.localdomain6>
Added the netdev_ops file to debugfs with a command to call the
ndo_tx_timeout function to give users the ability to simulate a
tx_timeout call made by the kernel.
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 103 ++++++++++++++++++++++
1 files changed, 101 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
index 423700f..dfe68a9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
@@ -34,6 +34,103 @@
static struct dentry *ixgbe_dbg_root;
+static char ixgbe_dbg_netdev_ops_buf[256] = "";
+
+/**
+ * ixgbe_dbg_netdev_ops_open - prep the debugfs netdev_ops data item
+ * when opened
+ * @inode: inode that was opened
+ * @filp: file info
+ *
+ * Stash the adapter pointer hiding in the inode into the file pointer
+ * where we can find it later in the read and write calls
+ **/
+static int ixgbe_dbg_netdev_ops_open(struct inode *inode, struct file *filp)
+{
+ filp->private_data = inode->i_private;
+ return 0;
+}
+
+/**
+ * ixgbe_dbg_netdev_ops_read - read for netdev_ops datum
+ * @filp: the opened file
+ * @buffer: where to write the data for the user to read
+ * @count: the size of the user's buffer
+ * @ppos: file position offset
+ **/
+static ssize_t ixgbe_dbg_netdev_ops_read(struct file *filp,
+ char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ struct ixgbe_adapter *adapter = filp->private_data;
+ char buf[256];
+ int bytes_not_copied;
+ int len;
+
+ /* don't allow partial reads */
+ if (*ppos != 0)
+ return 0;
+
+ len = snprintf(buf, sizeof(buf), "%s: %s\n",
+ adapter->netdev->name, ixgbe_dbg_netdev_ops_buf);
+ if (count < len)
+ return -ENOSPC;
+ bytes_not_copied = copy_to_user(buffer, buf, len);
+ if (bytes_not_copied < 0)
+ return bytes_not_copied;
+
+ *ppos = len;
+ return len;
+}
+
+/**
+ * ixgbe_dbg_netdev_ops_write - write into netdev_ops datum
+ * @filp: the opened file
+ * @buffer: where to find the user's data
+ * @count: the length of the user's data
+ * @ppos: file position offset
+ **/
+static ssize_t ixgbe_dbg_netdev_ops_write(struct file *filp,
+ const char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ struct ixgbe_adapter *adapter = filp->private_data;
+ int bytes_not_copied;
+
+ /* don't allow partial writes */
+ if (*ppos != 0)
+ return 0;
+ if (count >= sizeof(ixgbe_dbg_netdev_ops_buf))
+ return -ENOSPC;
+
+ bytes_not_copied = copy_from_user(ixgbe_dbg_netdev_ops_buf,
+ buffer, count);
+ if (bytes_not_copied < 0)
+ return bytes_not_copied;
+ else if (bytes_not_copied > 0)
+ count -= bytes_not_copied;
+ if (count < 0)
+ return -ENOSPC;
+ ixgbe_dbg_netdev_ops_buf[count] = '\0';
+
+ if (strncmp(ixgbe_dbg_netdev_ops_buf, "tx_timeout", 10) == 0) {
+ adapter->netdev->netdev_ops->ndo_tx_timeout(adapter->netdev);
+ e_dev_info("tx_timeout called\n");
+ } else {
+ e_dev_info("Unkown command: %s\n", ixgbe_dbg_netdev_ops_buf);
+ e_dev_info("Available commands:\n");
+ e_dev_info(" tx_timeout\n");
+ }
+ return count;
+}
+
+static const struct file_operations ixgbe_dbg_netdev_ops_fops = {
+ .owner = THIS_MODULE,
+ .open = ixgbe_dbg_netdev_ops_open,
+ .read = ixgbe_dbg_netdev_ops_read,
+ .write = ixgbe_dbg_netdev_ops_write,
+};
+
/**
* ixgbe_dbg_adapter_init - setup the debugfs directory for the adapter
* @adapter: the adapter that is starting up
@@ -41,10 +138,12 @@ static struct dentry *ixgbe_dbg_root;
void ixgbe_dbg_adapter_init(struct ixgbe_adapter *adapter)
{
const char *name = pci_name(adapter->pdev);
-
+ struct dentry *pfile;
adapter->ixgbe_dbg_adapter = debugfs_create_dir(name, ixgbe_dbg_root);
if (adapter->ixgbe_dbg_adapter) {
- /* create files here */
+ pfile = debugfs_create_file("netdev_ops", 0600,
+ adapter->ixgbe_dbg_adapter, adapter,
+ &ixgbe_dbg_netdev_ops_fops);
} else {
e_dev_err("debugfs entry for %s failed\n", name);
}
^ permalink raw reply related
* [NET_NEXT RFC PATCH 3/3] ixgbe: added reg_ops file to debugfs
From: Catherine Sullivan @ 2012-05-09 23:09 UTC (permalink / raw)
To: netdev
In-Reply-To: <20120509230814.31910.80709.stgit@localhost6.localdomain6>
Added the reg_ops file to debugfs with commands to read and write
a register to give users the ability to read and write individual
registers on the fly.
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 112 ++++++++++++++++++++++
1 files changed, 112 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
index dfe68a9..2558014 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
@@ -34,6 +34,115 @@
static struct dentry *ixgbe_dbg_root;
+static char ixgbe_dbg_reg_ops_buf[256] = "";
+
+/**
+ * ixgbe_dbg_reg_ops_open - prep the debugfs pokee data item when opened
+ * @inode: inode that was opened
+ * @filp: file info
+ *
+ * Stash the adapter pointer hiding in the inode into the file pointer where
+ * we can find it later in the read and write calls
+ **/
+static int ixgbe_dbg_reg_ops_open(struct inode *inode, struct file *filp)
+{
+ filp->private_data = inode->i_private;
+ return 0;
+}
+
+/**
+ * ixgbe_dbg_reg_ops_read - read for reg_ops datum
+ * @filp: the opened file
+ * @buffer: where to write the data for the user to read
+ * @count: the size of the user's buffer
+ * @ppos: file position offset
+ **/
+static ssize_t ixgbe_dbg_reg_ops_read(struct file *filp, char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ struct ixgbe_adapter *adapter = filp->private_data;
+ char buf[256];
+ int bytes_not_copied;
+ int len;
+
+ /* don't allow partial reads */
+ if (*ppos != 0)
+ return 0;
+
+ len = snprintf(buf, sizeof(buf), "%s: %s\n",
+ adapter->netdev->name, ixgbe_dbg_reg_ops_buf);
+ if (count < len)
+ return -ENOSPC;
+ bytes_not_copied = copy_to_user(buffer, buf, len);
+ if (bytes_not_copied < 0)
+ return bytes_not_copied;
+
+ *ppos = len;
+ return len;
+}
+
+/**
+ * ixgbe_dbg_reg_ops_write - write into reg_ops datum
+ * @filp: the opened file
+ * @buffer: where to find the user's data
+ * @count: the length of the user's data
+ * @ppos: file position offset
+ **/
+static ssize_t ixgbe_dbg_reg_ops_write(struct file *filp,
+ const char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ struct ixgbe_adapter *adapter = filp->private_data;
+ int bytes_not_copied;
+
+ /* don't allow partial writes */
+ if (*ppos != 0)
+ return 0;
+ if (count >= sizeof(ixgbe_dbg_reg_ops_buf))
+ return -ENOSPC;
+
+ bytes_not_copied = copy_from_user(ixgbe_dbg_reg_ops_buf, buffer, count);
+ if (bytes_not_copied < 0)
+ return bytes_not_copied;
+ ixgbe_dbg_reg_ops_buf[count] = '\0';
+
+ if (strncmp(ixgbe_dbg_reg_ops_buf, "write", 5) == 0) {
+ u32 reg, value;
+ int cnt;
+ cnt = sscanf(&ixgbe_dbg_reg_ops_buf[5], "%x %x", ®, &value);
+ if (cnt == 2) {
+ IXGBE_WRITE_REG(&adapter->hw, reg, value);
+ value = IXGBE_READ_REG(&adapter->hw, reg);
+ e_dev_info("write: 0x%08x = 0x%08x\n", reg, value);
+ } else {
+ e_dev_info("write reg value\n");
+ }
+ } else if (strncmp(ixgbe_dbg_reg_ops_buf, "read", 4) == 0) {
+ u32 reg, value;
+ int cnt;
+ cnt = sscanf(&ixgbe_dbg_reg_ops_buf[4], "%x", ®);
+ if (cnt == 1) {
+ value = IXGBE_READ_REG(&adapter->hw, reg);
+ e_dev_info("read 0x%08x = 0x%08x\n", reg, value);
+ } else {
+ e_dev_info("read reg\n");
+ }
+ } else {
+ e_dev_info("Unknown command %s\n", ixgbe_dbg_reg_ops_buf);
+ e_dev_info("Available commands:\n");
+ e_dev_info(" read reg\n");
+ e_dev_info(" write reg value\n");
+ }
+ return count;
+}
+
+static const struct file_operations ixgbe_dbg_reg_ops_fops = {
+ .owner = THIS_MODULE,
+ .open = ixgbe_dbg_reg_ops_open,
+ .read = ixgbe_dbg_reg_ops_read,
+ .write = ixgbe_dbg_reg_ops_write,
+};
+
static char ixgbe_dbg_netdev_ops_buf[256] = "";
/**
@@ -141,6 +250,9 @@ void ixgbe_dbg_adapter_init(struct ixgbe_adapter *adapter)
struct dentry *pfile;
adapter->ixgbe_dbg_adapter = debugfs_create_dir(name, ixgbe_dbg_root);
if (adapter->ixgbe_dbg_adapter) {
+ pfile = debugfs_create_file("reg_ops", 0600,
+ adapter->ixgbe_dbg_adapter, adapter,
+ &ixgbe_dbg_reg_ops_fops);
pfile = debugfs_create_file("netdev_ops", 0600,
adapter->ixgbe_dbg_adapter, adapter,
&ixgbe_dbg_netdev_ops_fops);
^ permalink raw reply related
* Re: [NET_NEXT RFC PATCH 1/3] ixgbe: add debugfs support
From: Stephen Hemminger @ 2012-05-09 23:10 UTC (permalink / raw)
To: Catherine Sullivan; +Cc: netdev
In-Reply-To: <20120509230940.31910.64408.stgit@localhost6.localdomain6>
On Wed, 09 May 2012 16:09:40 -0700
Catherine Sullivan <catherine.sullivan@intel.com> wrote:
> This patch adds debugfs support to the ixgbe driver to give
> users the ability to access kernel information and to
> simulate kernel events.
>
> The filesystem is set up in the following driver/PCI-instance
> hierarchy:
> <debugfs>
> |-- ixgbe
> |-- PCI instance
> | |-- attribute files
> |-- PCI instance
> |-- attribute files
>
> Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
This should be an optional configuration since it is meant for special
case usage. See SKY2_DEBUG
^ permalink raw reply
* Re: [NET_NEXT RFC PATCH 2/3] ixgbe: added netdev_ops file to debugfs
From: Stephen Hemminger @ 2012-05-09 23:10 UTC (permalink / raw)
To: Catherine Sullivan; +Cc: netdev
In-Reply-To: <20120509230945.31910.48302.stgit@localhost6.localdomain6>
On Wed, 09 May 2012 16:09:45 -0700
Catherine Sullivan <catherine.sullivan@intel.com> wrote:
> + e_dev_info("Unkown command: %s\n", ixgbe_dbg_netdev_ops_buf);
Spelling?
^ permalink raw reply
* Re: [NET_NEXT RFC PATCH 2/3] ixgbe: added netdev_ops file to debugfs
From: Stephen Hemminger @ 2012-05-09 23:13 UTC (permalink / raw)
To: Catherine Sullivan; +Cc: netdev
In-Reply-To: <20120509230945.31910.48302.stgit@localhost6.localdomain6>
On Wed, 09 May 2012 16:09:45 -0700
Catherine Sullivan <catherine.sullivan@intel.com> wrote:
> Added the netdev_ops file to debugfs with a command to call the
> ndo_tx_timeout function to give users the ability to simulate a
> tx_timeout call made by the kernel.
>
> Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
What is the justification for creating a new API here?
Your exposing only one thing 'tx_timeout' and that is a generic property
of the device (not ixgbe specific). That value is already available via
sysfs.
^ permalink raw reply
* Re: [NET_NEXT RFC PATCH 3/3] ixgbe: added reg_ops file to debugfs
From: Stephen Hemminger @ 2012-05-09 23:14 UTC (permalink / raw)
To: Catherine Sullivan; +Cc: netdev
In-Reply-To: <20120509230950.31910.6032.stgit@localhost6.localdomain6>
On Wed, 09 May 2012 16:09:50 -0700
Catherine Sullivan <catherine.sullivan@intel.com> wrote:
> Added the reg_ops file to debugfs with commands to read and write
> a register to give users the ability to read and write individual
> registers on the fly.
>
> Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
> ---
>
> drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 112 ++++++++++++++++++++++
> 1 files changed, 112 insertions(+), 0 deletions(-)
>
Aren't these registers already in ethtool? You are also
allowing write without any security checking.
^ permalink raw reply
* Re: [PATCH] pktgen: fix crash at module unload
From: Eric Dumazet @ 2012-05-09 23:29 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: David Miller, netdev
In-Reply-To: <874nrpyrp1.fsf@xmission.com>
On Wed, 2012-05-09 at 14:23 -0700, Eric W. Biederman wrote:
> That seems reasonable.
>
> Would it be easier to call unregister_netdevice_notifer before shutting
> down the threads, so you don't have the weird cases to deal with during
> shutdown?
>
> It looks like pg_cleanup doesn't take the pktgen_thread_lock, so
> I suspect that there are still races.
>
It was 'safe' because pktgen doesnt yet support cpu hotplug.
Given pktgen nature, I am not sure we should care, granted it doesnt
crash when a poor guy like me want to use it once in a while...
list was modified only at module load.
[PATCH v2] pktgen: fix crash at module unload
commit 7d3d43dab4e9 (net: In unregister_netdevice_notifier unregister
the netdevices.) makes pktgen crashing at module unload.
[ 296.820578] BUG: spinlock bad magic on CPU#6, rmmod/3267
[ 296.820719] lock: ffff880310c38000, .magic: ffff8803, .owner: <none>/-1, .owner_cpu: -1
[ 296.820943] Pid: 3267, comm: rmmod Not tainted 3.4.0-rc5+ #254
[ 296.821079] Call Trace:
[ 296.821211] [<ffffffff8168a715>] spin_dump+0x8a/0x8f
[ 296.821345] [<ffffffff8168a73b>] spin_bug+0x21/0x26
[ 296.821507] [<ffffffff812b4741>] do_raw_spin_lock+0x131/0x140
[ 296.821648] [<ffffffff8169188e>] _raw_spin_lock+0x1e/0x20
[ 296.821786] [<ffffffffa00cc0fd>] __pktgen_NN_threads+0x4d/0x140 [pktgen]
[ 296.821928] [<ffffffffa00ccf8d>] pktgen_device_event+0x10d/0x1e0 [pktgen]
[ 296.822073] [<ffffffff8154ed4f>] unregister_netdevice_notifier+0x7f/0x100
[ 296.822216] [<ffffffffa00d2a0b>] pg_cleanup+0x48/0x73 [pktgen]
[ 296.822357] [<ffffffff8109528e>] sys_delete_module+0x17e/0x2a0
[ 296.822502] [<ffffffff81699652>] system_call_fastpath+0x16/0x1b
Hold the pktgen_thread_lock while splicing pktgen_threads, and test
pktgen_exiting in pktgen_device_event() to make unload faster.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
---
net/core/pktgen.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index ffb5d38..b644505 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1931,7 +1931,7 @@ static int pktgen_device_event(struct notifier_block *unused,
{
struct net_device *dev = ptr;
- if (!net_eq(dev_net(dev), &init_net))
+ if (!net_eq(dev_net(dev), &init_net) || pktgen_exiting)
return NOTIFY_DONE;
/* It is OK that we do not hold the group lock right now,
@@ -3755,12 +3755,18 @@ static void __exit pg_cleanup(void)
{
struct pktgen_thread *t;
struct list_head *q, *n;
+ struct list_head list;
/* Stop all interfaces & threads */
pktgen_exiting = true;
- list_for_each_safe(q, n, &pktgen_threads) {
+ mutex_lock(&pktgen_thread_lock);
+ list_splice(&list, &pktgen_threads);
+ mutex_unlock(&pktgen_thread_lock);
+
+ list_for_each_safe(q, n, &list) {
t = list_entry(q, struct pktgen_thread, th_list);
+ list_del(&t->th_list);
kthread_stop(t->tsk);
kfree(t);
}
^ permalink raw reply related
* Re: Netlink for kernel<->user space communication?
From: Arvid Brodin @ 2012-05-09 23:32 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev@vger.kernel.org
In-Reply-To: <20120507153307.551b29ed@nehalam.linuxnetplumber.net>
On 2012-05-08 00:33, Stephen Hemminger wrote:
> On Mon, 7 May 2012 18:43:23 +0000
> Arvid Brodin <Arvid.Brodin@xdin.com> wrote:
>
>> On Tue, 24 Apr 2012 16:57:55 -0700
>> Stephen Hemminger <shemminger@xxxxxxxxxx> wrote:
>>> On Tue, 24 Apr 2012 23:52:34 +0000
>>> Arvid Brodin <Arvid.Brodin@xxxxxxxx> wrote:
>>>
>>>> Hi.
>>>>
>>>> I'm writing a kernel driver for the HSR protocol, a standard for high availability
>>>> networks. I want to send messages from the kernel to user space about broken network
>>>> links. I also want user space to be able to ask the kernel about its view of the status of
>>>> nodes on the network.
>>>>
>>>> Netlink seems like a good tool for this. (Is it?)
>>>
>>> Yes.
>>>
>>>> But do I use raw netlink? (Described here: http://www.linuxjournal.com/article/7356 - but
>>>> this seems a bit out of date, the kernel API description differs from today's kernel
>>>> implementation.)
>>>
>>> No. Your driver probably looks like a device so you should be
>>> using rtnetlink messages.
>>
>> I'm already using rtnetlink messages to add and remove my device, which works fine (see
>> e.g. http://www.spinics.net/lists/netdev/msg192817.html - although I didn't think it
>> meaningful to include the iproute2 patch here, until the kernel part is ready).
>>
>> The protocol specifies transmission of "supervision frames" every 2 seconds, e.g. to check
>> link integrity. Every such frame should be received from two directions in the ring - if
>> only one is received, then there is a link problem.
>
> Why not just manipulate the carrier or operational state (see Documentation/networking/operstate)
> and use the existing notification on link changes. If you don't get heartbeat then change
> the state of the device to indicate lower device is down with set_operstate(), the necessary
> link everts propgate back as netlink events.
With HSR, all nodes in the network ring can detect a link problem anywhere in the ring. So
I need a way to communicate link problems that does not concern the host's devices at all,
but rather the state of the network as a whole. A typical message might say "Frames from
node 01:23:45:67:89:AB is only received over Slave Interface 1!" This indicates a problem
since all frames should be received over both slave interfaces. The broken link can be
anywhere between this node and the indicated node. If user space is aware of the network
topology, it can figure out exactly where the damage is by looking at which nodes' frames
are received over which slave interface.
(Thanks for the operstates info though, I hadn't discovered IF_OPER_LOWERLAYERDOWN! I will
use it to indicate a local slave is down.)
>> I'd like to notify user space about every such occurence. Is there a rtnetlink message
>> type that fits this? The stuff in rtnetlink.h seems to be mostly concerned with specific
>> user space commands (there is something called RTNLGRP_NOTIFY but I couldn't find any
>> instances of it being used in the kernel, nor any documentation).
>>
>
> I am trying to steer you to use existing API's because then existing programs and
> infrastructure can deal with the new device type.
I really appreciate that! I want to use existing API's as far as possible. That's why I
keep sending you all these questions. :)
--
Arvid Brodin
XDIN AB | Jan Stenbecks Torg 17 | SE-164 40 Kista | Sweden | xdin.com
^ permalink raw reply
* Re: [PATCH 3/3] usbnet: fix skb traversing races during unlink(v1)
From: Ming Lei @ 2012-05-09 23:47 UTC (permalink / raw)
To: David Miller
Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
huajun.li.lee-Re5JQEeQqe8AvxtiuMwx3w, oneukum-l3A5Bk7waGM,
stable-DgEjT+Ai2ygdnm+yROfE0A
In-Reply-To: <20120503090450.41704527@tom-ThinkPad-T410>
Hi David,
On Thu, May 3, 2012 at 9:04 AM, Ming Lei <tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> From a87ff961f0a5d50223bd084dfac4fe5ce84f3913 Mon Sep 17 00:00:00 2001
> From: Ming Lei <tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Date: Thu, 26 Apr 2012 11:33:46 +0800
> Subject: [PATCH] usbnet: fix skb traversing races during unlink(v2)
>
> Commit 4231d47e6fe69f061f96c98c30eaf9fb4c14b96d(net/usbnet: avoid
> recursive locking in usbnet_stop()) fixes the recursive locking
> problem by releasing the skb queue lock before unlink, but may
> cause skb traversing races:
> - after URB is unlinked and the queue lock is released,
> the refered skb and skb->next may be moved to done queue,
> even be released
> - in skb_queue_walk_safe, the next skb is still obtained
> by next pointer of the last skb
> - so maybe trigger oops or other problems
>
> This patch extends the usage of entry->state to describe 'start_unlink'
> state, so always holding the queue(rx/tx) lock to change the state if
> the referd skb is in rx or tx queue because we need to know if the
> refered urb has been started unlinking in unlink_urbs.
>
> The other part of this patch is based on Huajun's patch:
> always traverse from head of the tx/rx queue to get skb which is
> to be unlinked but not been started unlinking.
>
> Signed-off-by: Huajun Li <huajun.li.lee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Ming Lei <tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org>
> Cc: stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
> ---
> v2:
> - if the Rx URB has been marked as being unlink, just not resubmit it
> in complete handler, so usb_block_urb/usb_unblock_urb can be avoided,
Considered that this one(v2) doesn't depend on usb tree any more and looks
no one objects it, could you apply this one on your tree?
Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] net: update the usage of CHECKSUM_UNNECESSARY
From: Ben Hutchings @ 2012-05-10 0:05 UTC (permalink / raw)
To: Michael S. Tsirkin, David Miller; +Cc: Yi Zou, netdev, devel, jeffrey.t.kirsher
In-Reply-To: <20120509060308.GA13522@redhat.com>
On Wed, 2012-05-09 at 09:03 +0300, Michael S. Tsirkin wrote:
> On Tue, May 08, 2012 at 07:20:58PM +0100, Ben Hutchings wrote:
> > On Tue, 2012-05-08 at 20:48 +0300, Michael S. Tsirkin wrote:
> > > On Mon, Mar 19, 2012 at 02:12:41PM -0700, Yi Zou wrote:
> > > > As suggested by Ben, this adds the clarification on the usage of
> > > > CHECKSUM_UNNECESSARY on the outgoing patch. Also add the usage
> > > > description of NETIF_F_FCOE_CRC and CHECKSUM_UNNECESSARY
> > > > for the kernel FCoE protocol driver.
> > > >
> > > > This is a follow-up to the following:
> > > > http://patchwork.ozlabs.org/patch/147315/
> > > >
> > > > Signed-off-by: Yi Zou <yi.zou@intel.com>
> > > > Cc: Ben Hutchings <bhutchings@solarflare.com>
> > > > Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > > > Cc: www.Open-FCoE.org <devel@open-fcoe.org>
> > > > ---
> > > >
> > > > include/linux/skbuff.h | 7 +++++++
> > > > 1 files changed, 7 insertions(+), 0 deletions(-)
> > > >
> > > > diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> > > > index 8dc8257..a2b9953 100644
> > > > --- a/include/linux/skbuff.h
> > > > +++ b/include/linux/skbuff.h
> > > > @@ -94,6 +94,13 @@
> > > > * about CHECKSUM_UNNECESSARY. 8)
> > > > * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead.
> > > > *
> > > > + * UNNECESSARY: device will do per protocol specific csum. Protocol drivers
> > > > + * that do not want net to perform the checksum calculation should use
> > > > + * this flag in their outgoing skbs.
> > > > + * NETIF_F_FCOE_CRC this indicates the device can do FCoE FC CRC
> > > > + * offload. Correspondingly, the FCoE protocol driver
> > > > + * stack should use CHECKSUM_UNNECESSARY.
> > > > + *
> > > > * Any questions? No questions, good. --ANK
> > > > */
> > > >
> > >
> > > So just to make sure I understand, you never get
> > > UNNECESSARY packets on tx unless you declared NETIF_F_FCOE_CRC?
> > >
> > > Maybe the comment says this somehow but could not figure it out.
> >
> > That's what should happen now. In future CHECKSUM_UNNECESSARY could be
> > used on output by other protocols which don't use TCP/IP-style
> > checksums, but always dependent on the output device supporting the
> > relevant offload feature.
> >
> > Ben.
>
> Isn't there another case: a device passes UNNECESSARY in on rx,
> and the skb is forwarded to another device?
> For example it is handled this way by tun, giving a nice
> performance boost for VMs, see 10a8d94a95742bb15b4e617ee9884bb4381362be
Hmm... I thought UNNECESSARY was supposed to be replaced by NONE on
output, but I don't see where that would happen. Which would mean we
had an undocumented case here, and now we have ambiguity. :-(
Ben.
--
Ben Hutchings, Staff 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
* [PATCH] ehea: fix losing of NEQ events when one event occurred early
From: Thadeu Lima de Souza Cascardo @ 2012-05-10 0:10 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Thadeu Lima de Souza Cascardo
The NEQ interrupt is only triggered when there was no previous pending
interrupt. If we request irq handling after an interrupt has occurred,
we will never get an interrupt until we call H_RESET_EVENTS.
Events seem to be cleared when we first register the NEQ. So, when we
requested irq handling right after registering it, a possible race with
an interrupt was much less likely. Now, there is a chance we may lose
this race and never get any events.
The fix here is to poll and acknowledge any events that might have
happened right after registering the irq handler.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea_main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index c9069a2..f088e59 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -3335,6 +3335,9 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
goto out_shutdown_ports;
}
+ /* Handle any events that might be pending. */
+ tasklet_hi_schedule(&adapter->neq_tasklet);
+
ret = 0;
goto out;
--
1.7.4.4
^ permalink raw reply related
* Re: [NET_NEXT RFC PATCH 3/3] ixgbe: added reg_ops file to debugfs
From: Ben Hutchings @ 2012-05-10 0:18 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Catherine Sullivan, netdev
In-Reply-To: <20120509161449.43704ea7@nehalam.linuxnetplumber.net>
On Wed, 2012-05-09 at 16:14 -0700, Stephen Hemminger wrote:
> On Wed, 09 May 2012 16:09:50 -0700
> Catherine Sullivan <catherine.sullivan@intel.com> wrote:
>
> > Added the reg_ops file to debugfs with commands to read and write
> > a register to give users the ability to read and write individual
> > registers on the fly.
> >
> > Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
> > ---
> >
> > drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 112 ++++++++++++++++++++++
> > 1 files changed, 112 insertions(+), 0 deletions(-)
> >
>
> Aren't these registers already in ethtool?
ethtool register access is read-only and would be very heavy-weight for
interactive debugging. Not sure this is the best interface to
read/write registers, but it's certainly not redundant.
> You are also allowing write without any security checking.
The file permissions are set to 0600 so it's root-only.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH] netlink: connector: implement cn_netlink_reply
From: Ben Hutchings @ 2012-05-10 0:20 UTC (permalink / raw)
To: Alban Crequy
Cc: Evgeniy Polyakov, netdev, Vincent Sanders,
Javier Martinez Canillas, Rodrigo Moya
In-Reply-To: <1336574243-12063-1-git-send-email-alban.crequy@collabora.co.uk>
On Wed, 2012-05-09 at 15:37 +0100, Alban Crequy wrote:
> In a connector callback, it was not possible to reply to a message only to a
> sender. This patch implements cn_netlink_reply(). It uses the connector socket
> to send an unicast netlink message back to the sender.
[...]
We try to avoid adding functions with no users. You'll need to submit
the code that's intended to use this as well.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH] ehea: fix losing of NEQ events when one event occurred early
From: David Miller @ 2012-05-10 0:29 UTC (permalink / raw)
To: cascardo; +Cc: netdev
In-Reply-To: <1336608618-31497-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Date: Wed, 9 May 2012 21:10:18 -0300
> + /* Handle any events that might be pending. */
> + tasklet_hi_schedule(&adapter->neq_tasklet);
> +
>
> ret = 0;
These extra empty lines are completely unnecessary, please remove
them.
^ permalink raw reply
* Re: [PATCH 08/14] batman-adv: ignore protocol packets if the interface did not enable this protocol
From: David Miller @ 2012-05-10 0:41 UTC (permalink / raw)
To: ordex-GaUfNO9RBHfsrOwW+9ziJQ
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
lindner_marek-LWAfsSFWpa4
In-Reply-To: <1336561976-16088-9-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Date: Wed, 9 May 2012 13:12:50 +0200
> + /* did we receive a B.A.T.M.A.N. IV OGM packet on an interface
> + * that does not have B.A.T.M.A.N. IV enabled ? */
Needs to be:
/* did we receive a B.A.T.M.A.N. IV OGM packet on an interface
* that does not have B.A.T.M.A.N. IV enabled ?
*/
^ permalink raw reply
* Re: [PATCH 11/14] batman-adv: Adding hard_iface specific sysfs wrapper macros for UINT
From: David Miller @ 2012-05-10 0:43 UTC (permalink / raw)
To: ordex-GaUfNO9RBHfsrOwW+9ziJQ
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
lindner_marek-LWAfsSFWpa4
In-Reply-To: <1336561976-16088-12-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Date: Wed, 9 May 2012 13:12:53 +0200
> + /**
> + * Mark the forwarded packet when it is not coming from our best
> + * next hop. We still need to forward the packet for our neighbor
> + * link quality detection to work in case the packet originated
> + * from a single hop neighbor. Otherwise we can simply drop the
> + * ogm.
> + */
Start comments with "/*" not "/**", and properly indent these lines.
^ permalink raw reply
* Re: [PATCH 09/14] batman-adv: refactoring API: find generalized name for bat_ogm_update_mac callback
From: David Miller @ 2012-05-10 0:42 UTC (permalink / raw)
To: ordex; +Cc: netdev, b.a.t.m.a.n, lindner_marek
In-Reply-To: <1336561976-16088-10-git-send-email-ordex@autistici.org>
From: Antonio Quartulli <ordex@autistici.org>
Date: Wed, 9 May 2012 13:12:51 +0200
> + /* (re-)init mac addresses of the protocol information
> + * belonging to this hard-interface */
Needs to be:
/* (re-)init mac addresses of the protocol information
* belonging to this hard-interface
*/
^ permalink raw reply
* Re: [PATCH 07/14] batman-adv: split neigh_new function into generic and batman iv specific parts
From: David Miller @ 2012-05-10 0:41 UTC (permalink / raw)
To: ordex; +Cc: netdev, b.a.t.m.a.n, lindner_marek
In-Reply-To: <1336561976-16088-8-git-send-email-ordex@autistici.org>
From: Antonio Quartulli <ordex@autistici.org>
Date: Wed, 9 May 2012 13:12:49 +0200
> From: Marek Lindner <lindner_marek@yahoo.de>
>
> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
The namespace pollution of the batman-adv code needs to improve,
and I'm putting my foot down starting with this change.
If you have a static function which is therefore private to a
source file, name it whatever you want.
But once it gets exported out of that file, you have to give it
an appropriate name. Probably with a "batman_adv_" prefix or
similar.
Otherwise, for one thing, if this code is statically built into
the tree it can conflict with symbol names elsewhere and break
the build.
^ permalink raw reply
* Re: [PATCH] netlink: connector: implement cn_netlink_reply
From: Evgeniy Polyakov @ 2012-05-10 0:45 UTC (permalink / raw)
To: Ben Hutchings
Cc: Alban Crequy, netdev, Vincent Sanders, Javier Martinez Canillas,
Rodrigo Moya
In-Reply-To: <1336609248.2499.20.camel@bwh-desktop.uk.solarflarecom.com>
On Thu, May 10, 2012 at 01:20:48AM +0100, Ben Hutchings (bhutchings@solarflare.com) wrote:
> On Wed, 2012-05-09 at 15:37 +0100, Alban Crequy wrote:
> > In a connector callback, it was not possible to reply to a message only to a
> > sender. This patch implements cn_netlink_reply(). It uses the connector socket
> > to send an unicast netlink message back to the sender.
> [...]
>
> We try to avoid adding functions with no users. You'll need to submit
> the code that's intended to use this as well.
I have no objection against this patch, but as correctly stated it is
useless without users. Alban, what is the code you want this
functionality to be used in? Do you plan to submit it? Can you submit
this change in the patch with your code?
--
Evgeniy Polyakov
^ permalink raw reply
* FW: PROBLEM: VLAN LRO issue
From: Steven Liu (劉人豪) @ 2012-05-10 1:01 UTC (permalink / raw)
To: netdev@vger.kernel.org
Hi Sir,
I found the issue about VLAN LRO feature and below is bug description and patch for your reference, thanks.
[1.] One line summary of the problem:
VLAN LRO issue
[2.] Full description of the problem/report:
LRO implementation cannot handle VLAN tagged packets correctly.
It uses correct packet length when creating new LRO session, but uses wrong packet length when putting following packets into exist LRO session.
[3.] Keywords (i.e., modules, networking, kernel):
Networking
[4.] Kernel version (from /proc/version):
Linux-3.4-rc3 and below
[5.] Output of Oops.. message (if applicable) with symbolic information
resolved (see Documentation/oops-tracing.txt) System is still working, but cannot speed up VLAN tagged traffic.
[X.] Other notes, patches, fixes, workarounds:
We have to apply below patch to fix this issue.
--- linux-3.4-rc3/net/ipv4/inet_lro.orig 2012-05-08 20:09:44.810366089 +0800
+++ linux-3.4-rc3/net/ipv4/inet_lro.c 2012-05-08 20:09:33.331679419 +0800
@@ -353,7 +353,7 @@ static int __lro_proc_skb(struct net_lro
if (lro_desc->tcp_next_seq != ntohl(tcph->seq))
goto out2;
- if (lro_tcp_ip_check(iph, tcph, skb->len, lro_desc))
+ if (lro_tcp_ip_check(iph, tcph, skb->len - vlan_hdr_len, lro_desc))
goto out2;
lro_add_packet(lro_desc, skb, iph, tcph);
Regards,
Steven
************* Email Confidentiality Notice ********************
The information contained in this e-mail message (including any
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be
conveyed only to the designated recipient(s). Any use, dissemination,
distribution, printing, retaining or copying of this e-mail (including its
attachments) by unintended recipient(s) is strictly prohibited and may
be unlawful. If you are not an intended recipient of this e-mail, or believe
that you have received this e-mail in error, please notify the sender
immediately (by replying to this e-mail), delete any and all copies of
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!
^ permalink raw reply
* Re: [PATCH 00/13] net: Add and use ether_addr_equal
From: David Miller @ 2012-05-10 1:21 UTC (permalink / raw)
To: joe
Cc: coreteam, netdev, bridge, linux-wireless, linux-kernel,
linux-bluetooth, netfilter, netfilter-devel
In-Reply-To: <cover.1336538937.git.joe@perches.com>
From: Joe Perches <joe@perches.com>
Date: Tue, 8 May 2012 21:56:44 -0700
> Add a boolean function to test 2 ethernet addresses for equality
> Convert compare_ether_addr uses to ether_addr_equal
This series looks great, I'll apply all of it.
Thanks Joe.
That case you didn't convert in mac80211 is probably the
bug Johannes was talking about which started this whole
discussion.
^ permalink raw reply
* Re: [PATCH V3 Resend 09/12] net/stmmac: Remove conditional compilation of clk code
From: David Miller @ 2012-05-10 1:22 UTC (permalink / raw)
To: viresh.kumar
Cc: andrew, mturquette, sshtylyov, netdev, spear-devel, linux-kernel,
w.sang, viresh.linux, peppe.cavallaro, linux, akpm, jgarzik,
linux-arm-kernel, LW
In-Reply-To: <8e66b900fe5ee10c8db93d2f12c912e3dfb0708f.1336448639.git.viresh.kumar@st.com>
From: Viresh Kumar <viresh.kumar@st.com>
Date: Tue, 8 May 2012 09:22:36 +0530
> With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h,
> there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif
> macros.
>
> This also fixes error paths of probe(), as a goto is required in this patch.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [PATCH v4 2/2] macvtap: restore vlan header on user read
From: David Miller @ 2012-05-10 1:24 UTC (permalink / raw)
To: mst; +Cc: basil.gor, ebiederm, netdev
In-Reply-To: <20120508192806.GB28536@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Tue, 8 May 2012 22:28:06 +0300
> On Fri, May 04, 2012 at 12:55:24PM +0400, Basil Gor wrote:
>> Ethernet vlan header is not on the packet and kept in the skb->vlan_tci
>> when it comes from lower dev. This patch inserts vlan header in user
>> buffer during skb copy on user read.
>>
>> Signed-off-by: Basil Gor <basil.gor@gmail.com>
>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
>
> Eric, ack?
Eric please review these two patches.
^ 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