* Re: [PATCH] act_nat: not all of the ICMP packets need an IP header payload
From: Changli Gao @ 2010-07-10 14:08 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S. Miller, Jamal Hadi Salim,
Rodrigo Partearroyo González, Herbert Xu,
Iratxo Pichel Ortiz, Noelia Morón, netdev
In-Reply-To: <1278742953.2538.24.camel@edumazet-laptop>
On Sat, Jul 10, 2010 at 2:22 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le samedi 10 juillet 2010 à 09:33 +0800, Changli Gao a écrit :
>
> Changli, this patch has no attribution.
>
> Rodrigo spent lot of time to find the problem and is willing to fix it.
>
> Could you please give a chance to Rodrigo to complete its first kernel
> patch ?
>
Oh. Sorry. The honor belongs to him. I think he can give his Sigh off,
if he thinks this patch is OK.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* Re: [PATCH] atmel: unregister_netdev() on error
From: Dan Carpenter @ 2010-07-10 14:12 UTC (permalink / raw)
To: Kulikov Vasiliy
Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Simon Kelley,
John W. Linville, David S. Miller, Stephen Hemminger,
Eric Dumazet, Ben Hutchings,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1278767508-10164-1-git-send-email-segooon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Sat, Jul 10, 2010 at 05:11:47PM +0400, Kulikov Vasiliy wrote:
> We must unregister registered device if probe_atmel_card() fails.
I think you hit send accidentally on this one?
> if (!probe_atmel_card(dev)) {
> unregister_netdev(dev);
^^^^^^^^^^^^^^^^^^^^^^^
> - goto err_out_res;
> + goto err_out_unreg;
> }
>
> netif_carrier_off(dev);
> @@ -1640,6 +1640,9 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
>
> return dev;
>
> +err_out_unreg:
> + unregister_netdev(dev);
^^^^^^^^^^^^^^^^^^^^^^
> +
What the pants? :P
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [patch] isdn: fix strlen() usage
From: Dan Carpenter @ 2010-07-10 14:31 UTC (permalink / raw)
To: Karsten Keil
Cc: Stephen Hemminger, David S. Miller, Dirk Hohndel, Jiri Kosina,
netdev, kernel-janitors
There was a missing "else" statement so the original code overflowed if
->master->name was too long. Also the ->slave and ->master buffers can
hold names with 9 characters and a NULL so I cleaned it up to allow
another character.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 8c85d1e..26d44c3 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -2924,16 +2924,17 @@ isdn_net_getcfg(isdn_net_ioctl_cfg * cfg)
cfg->dialtimeout = lp->dialtimeout >= 0 ? lp->dialtimeout / HZ : -1;
cfg->dialwait = lp->dialwait / HZ;
if (lp->slave) {
- if (strlen(lp->slave->name) > 8)
+ if (strlen(lp->slave->name) >= 10)
strcpy(cfg->slave, "too-long");
else
strcpy(cfg->slave, lp->slave->name);
} else
cfg->slave[0] = '\0';
if (lp->master) {
- if (strlen(lp->master->name) > 8)
+ if (strlen(lp->master->name) >= 10)
strcpy(cfg->master, "too-long");
- strcpy(cfg->master, lp->master->name);
+ else
+ strcpy(cfg->master, lp->master->name);
} else
cfg->master[0] = '\0';
return 0;
^ permalink raw reply related
* Re: [PATCH] atmel: unregister_netdev() on error
From: Kulikov Vasiliy @ 2010-07-10 16:38 UTC (permalink / raw)
To: Dan Carpenter
Cc: kernel-janitors, Simon Kelley, John W. Linville, David S. Miller,
Stephen Hemminger, Eric Dumazet, Ben Hutchings, linux-wireless,
netdev
In-Reply-To: <20100710141204.GY19184@bicker>
On Sat, Jul 10, 2010 at 16:12 +0200, Dan Carpenter wrote:
> > +err_out_unreg:
> > + unregister_netdev(dev);
> ^^^^^^^^^^^^^^^^^^^^^^
> > +
>
> What the pants? :P
Hmm, I've slightly misunderstood the code, sorry.
Thanks, Dan.
^ permalink raw reply
* [PATCH] Export SMBIOS provided firmware instance and label to sysfs
From: Narendra K @ 2010-07-10 17:14 UTC (permalink / raw)
To: netdev, linux-hotplug, linux-pci
Cc: matt_domsch, charles_rose, jordan_hargrave, vijay_nijhawan
Hello,
This post is in continuation of the discussions in the thread
http://marc.info/?l=linux-pci&m=127852633816819&w=3.
The patch has the following changes -
1.The patch would be compiled only if CONFIG_DMI is set
2.The .test method has been changed to use .is_visible which is part of
already existing infrastructure.
Please find the patch with the above changes here -
From: Narendra K <narendra_k@dell.com>
Subject: [PATCH] Export SMBIOS provided firmware instance and label to sysfs
This patch exports SMBIOS provided firmware instance and label
of onboard pci devices to sysfs
Signed-off-by: Jordan Hargrave <jordan_hargrave@dell.com>
Signed-off-by: Narendra K <narendra_k@dell.com>
---
drivers/firmware/dmi_scan.c | 26 ++++++++
drivers/pci/Makefile | 3 +
drivers/pci/pci-label.c | 142 +++++++++++++++++++++++++++++++++++++++++++
drivers/pci/pci-sysfs.c | 5 ++
drivers/pci/pci.h | 9 +++
include/linux/dmi.h | 9 +++
6 files changed, 194 insertions(+), 0 deletions(-)
create mode 100644 drivers/pci/pci-label.c
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index d464672..6894ce4 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -277,6 +277,29 @@ static void __init dmi_save_ipmi_device(const struct dmi_header *dm)
list_add_tail(&dev->list, &dmi_devices);
}
+static void __init dmi_save_dev_onboard(int instance, int segment, int bus,
+ int devfn, const char *name)
+{
+ struct dmi_dev_onboard *onboard_dev;
+
+ onboard_dev = dmi_alloc(sizeof(*onboard_dev) + strlen(name) + 1);
+ if (!onboard_dev) {
+ printk(KERN_ERR "dmi_save_dev_onboard: out of memory.\n");
+ return;
+ }
+ onboard_dev->instance = instance;
+ onboard_dev->segment = segment;
+ onboard_dev->bus = bus;
+ onboard_dev->devfn = devfn;
+
+ strcpy((char *)&onboard_dev[1], name);
+ onboard_dev->dev.type = DMI_DEV_TYPE_DEV_ONBOARD;
+ onboard_dev->dev.name = (char *)&onboard_dev[1];
+ onboard_dev->dev.device_data = onboard_dev;
+
+ list_add(&onboard_dev->dev.list, &dmi_devices);
+}
+
static void __init dmi_save_extended_devices(const struct dmi_header *dm)
{
const u8 *d = (u8*) dm + 5;
@@ -285,6 +308,8 @@ static void __init dmi_save_extended_devices(const struct dmi_header *dm)
if ((*d & 0x80) == 0)
return;
+ dmi_save_dev_onboard(*(d+1), *(u16 *)(d+2), *(d+4), *(d+5),
+ dmi_string_nosave(dm, *(d-1)));
dmi_save_one_device(*d & 0x7f, dmi_string_nosave(dm, *(d - 1)));
}
@@ -333,6 +358,7 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
break;
case 41: /* Onboard Devices Extended Information */
dmi_save_extended_devices(dm);
+ break;
}
}
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 0b51857..dc1aa09 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -55,6 +55,9 @@ obj-$(CONFIG_MICROBLAZE) += setup-bus.o
#
obj-$(CONFIG_ACPI) += pci-acpi.o
+# SMBIOS provided firmware instance and labels
+obj-$(CONFIG_DMI) += pci-label.o
+
# Cardbus & CompactPCI use setup-bus
obj-$(CONFIG_HOTPLUG) += setup-bus.o
diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
new file mode 100644
index 0000000..d0eb964
--- /dev/null
+++ b/drivers/pci/pci-label.c
@@ -0,0 +1,142 @@
+/*
+ * Purpose: Export the firmware instance/index and label associated with
+ * a pci device to sysfs
+ * Copyright (C) 2010 Dell Inc.
+ * by Narendra K <Narendra_K@dell.com>,
+ * Jordan Hargrave <Jordan_Hargrave@dell.com>
+ *
+ * SMBIOS defines type 41 for onboard pci devices. This code retrieves
+ * the instance number and string from the type 41 record and exports
+ * it to sysfs.
+ *
+ * Please see http://linux.dell.com/wiki/index.php/Oss/libnetdevname for more
+ * information.
+ */
+
+#include <linux/dmi.h>
+#include <linux/sysfs.h>
+#include <linux/pci.h>
+#include <linux/pci_ids.h>
+#include <linux/module.h>
+#include <linux/device.h>
+#include "pci.h"
+
+static char smbios_attr[4096];
+
+enum smbios_attr_enum {
+ SMBIOS_ATTR_LABEL_SHOW = 1,
+ SMBIOS_ATTR_INSTANCE_SHOW,
+};
+
+static mode_t
+smbios_instance_string_exist(struct kobject *kobj, struct attribute *attr,
+ int attribute)
+{
+ struct device *dev;
+ struct pci_dev *pdev;
+ const struct dmi_device *dmi;
+ struct dmi_dev_onboard *donboard;
+ int bus;
+ int devfn;
+
+ dev = container_of(kobj, struct device, kobj);
+ pdev = to_pci_dev(dev);
+
+ bus = pdev->bus->number;
+ devfn = pdev->devfn;
+
+ dmi = NULL;
+ while ((dmi = dmi_find_device(DMI_DEV_TYPE_DEV_ONBOARD,
+ NULL, dmi)) != NULL) {
+ donboard = dmi->device_data;
+ if (donboard && donboard->bus == bus &&
+ donboard->devfn == devfn) {
+ if (attribute == SMBIOS_ATTR_INSTANCE_SHOW)
+ return scnprintf(smbios_attr, PAGE_SIZE,
+ "%d\n", donboard->instance);
+ else if (attribute == SMBIOS_ATTR_LABEL_SHOW)
+ return scnprintf(smbios_attr, PAGE_SIZE,
+ "%s\n", dmi->name);
+ return strlen(dmi->name);
+ }
+ }
+ return 0;
+}
+
+static ssize_t
+smbiosname_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ ssize_t result;
+ result = smbios_instance_string_exist(&dev->kobj, &attr->attr,
+ SMBIOS_ATTR_LABEL_SHOW);
+ strncpy(buf, smbios_attr, result);
+ return result;
+}
+
+static ssize_t
+smbiosinstance_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ ssize_t result;
+ result = smbios_instance_string_exist(&dev->kobj, &attr->attr,
+ SMBIOS_ATTR_INSTANCE_SHOW);
+ strncpy(buf, smbios_attr, result);
+ return result;
+}
+
+static struct device_attribute smbios_attr_label = {
+ .attr = {.name = "label", .mode = 0444, .owner = THIS_MODULE},
+ .show = smbiosname_show,
+};
+
+static struct device_attribute smbios_attr_instance = {
+ .attr = {.name = "index", .mode = 0444, .owner = THIS_MODULE},
+ .show = smbiosinstance_show,
+};
+
+static struct attribute *smbios_attributes[] = {
+ &smbios_attr_label.attr,
+ &smbios_attr_instance.attr,
+ NULL,
+};
+
+static struct attribute_group smbios_attr_group = {
+ .attrs = smbios_attributes,
+ .is_visible = smbios_instance_string_exist,
+};
+
+static int
+pci_create_smbiosname_file(struct pci_dev *pdev)
+{
+ if (smbios_attr_group.is_visible &&
+ smbios_attr_group.is_visible(&pdev->dev.kobj, NULL, 0)) {
+ if (!sysfs_create_group(&pdev->dev.kobj, &smbios_attr_group))
+ return 0;
+ }
+ return -1;
+}
+
+static int
+pci_remove_smbiosname_file(struct pci_dev *pdev)
+{
+ if (smbios_attr_group.is_visible &&
+ smbios_attr_group.is_visible(&pdev->dev.kobj, NULL, 0)) {
+ sysfs_remove_group(&pdev->dev.kobj, &smbios_attr_group);
+ return 0;
+ }
+ return -1;
+}
+
+int pci_create_firmware_label_files(struct pci_dev *pdev)
+{
+ if (!pci_create_smbiosname_file(pdev))
+ return 0;
+ return -ENODEV;
+}
+
+int pci_remove_firmware_label_files(struct pci_dev *pdev)
+{
+ if (!pci_remove_smbiosname_file(pdev))
+ return 0;
+ return -ENODEV;
+}
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index afd2fbf..01fd799 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1132,6 +1132,8 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
pci_create_slot_links(pdev);
+ pci_create_firmware_label_files(pdev);
+
return 0;
err_vga_file:
@@ -1201,6 +1203,9 @@ void pci_remove_sysfs_dev_files(struct pci_dev *pdev)
sysfs_remove_bin_file(&pdev->dev.kobj, pdev->rom_attr);
kfree(pdev->rom_attr);
}
+
+ pci_remove_firmware_label_files(pdev);
+
}
static int __init pci_sysfs_init(void)
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index f8077b3..089f402 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -11,6 +11,15 @@
extern int pci_uevent(struct device *dev, struct kobj_uevent_env *env);
extern int pci_create_sysfs_dev_files(struct pci_dev *pdev);
extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
+#ifndef CONFIG_DMI
+static inline int pci_create_firmware_label_files(struct pci_dev *pdev)
+{ return 0; }
+static inline int pci_remove_firmware_label_files(struct pci_dev *pdev)
+{ return 0; }
+#else
+extern int pci_create_firmware_label_files(struct pci_dev *pdev);
+extern int pci_remove_firmware_label_files(struct pci_dev *pdev);
+#endif
extern void pci_cleanup_rom(struct pci_dev *dev);
#ifdef HAVE_PCI_MMAP
extern int pci_mmap_fits(struct pci_dev *pdev, int resno,
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index a8a3e1a..90e087f 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -20,6 +20,7 @@ enum dmi_device_type {
DMI_DEV_TYPE_SAS,
DMI_DEV_TYPE_IPMI = -1,
DMI_DEV_TYPE_OEM_STRING = -2,
+ DMI_DEV_TYPE_DEV_ONBOARD = -3,
};
struct dmi_header {
@@ -37,6 +38,14 @@ struct dmi_device {
#ifdef CONFIG_DMI
+struct dmi_dev_onboard {
+ struct dmi_device dev;
+ int instance;
+ int segment;
+ int bus;
+ int devfn;
+};
+
extern int dmi_check_system(const struct dmi_system_id *list);
const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list);
extern const char * dmi_get_system_info(int field);
--
1.6.5.2
With regards,
Narendra K
^ permalink raw reply related
* [PATCH net-next] drivers/net/mlx4: Use %pV, pr_<level>, printk_once
From: Joe Perches @ 2010-07-10 17:22 UTC (permalink / raw)
To: Roland Dreier, Yevgeny Petrilin, Jack Morgenstein; +Cc: netdev, linux-kernel
Remove near duplication of format string constants by using the newly
introduced vsprintf extention %pV to reduce text by 20k or so.
$ size drivers/net/mlx4/built-in.o*
text data bss dec hex filename
161367 1866 48784 212017 33c31 drivers/net/mlx4/built-in.o
142621 1866 46248 190735 2e90f drivers/net/mlx4/built-in.o.new
Use printk_once as appropriate.
Convert printks to pr_<level>, some bare printks now use pr_cont.
Remove now unused #define PFX.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/mlx4/catas.c | 4 +-
drivers/net/mlx4/en_main.c | 29 +++++++++++++++++---
drivers/net/mlx4/eq.c | 6 ++--
drivers/net/mlx4/main.c | 16 +++--------
drivers/net/mlx4/mlx4.h | 15 +++++-----
drivers/net/mlx4/mlx4_en.h | 62 +++++++++++++++++++++----------------------
6 files changed, 71 insertions(+), 61 deletions(-)
diff --git a/drivers/net/mlx4/catas.c b/drivers/net/mlx4/catas.c
index f599294..68aaa42 100644
--- a/drivers/net/mlx4/catas.c
+++ b/drivers/net/mlx4/catas.c
@@ -101,8 +101,8 @@ static void catas_reset(struct work_struct *work)
ret = mlx4_restart_one(priv->dev.pdev);
/* 'priv' now is not valid */
if (ret)
- printk(KERN_ERR "mlx4 %s: Reset failed (%d)\n",
- pci_name(pdev), ret);
+ pr_err("mlx4 %s: Reset failed (%d)\n",
+ pci_name(pdev), ret);
else {
dev = pci_get_drvdata(pdev);
mlx4_dbg(dev, "Reset succeeded\n");
diff --git a/drivers/net/mlx4/en_main.c b/drivers/net/mlx4/en_main.c
index cbabf14..97934f1 100644
--- a/drivers/net/mlx4/en_main.c
+++ b/drivers/net/mlx4/en_main.c
@@ -79,6 +79,29 @@ MLX4_EN_PARM_INT(pfctx, 0, "Priority based Flow Control policy on TX[7:0]."
MLX4_EN_PARM_INT(pfcrx, 0, "Priority based Flow Control policy on RX[7:0]."
" Per priority bit mask");
+int en_print(const char *level, const struct mlx4_en_priv *priv,
+ const char *format, ...)
+{
+ va_list args;
+ struct va_format vaf;
+ int i;
+
+ va_start(args, format);
+
+ vaf.fmt = format;
+ vaf.va = &args;
+ if (priv->registered)
+ i = printk("%s%s: %s: %pV",
+ level, DRV_NAME, priv->dev->name, &vaf);
+ else
+ i = printk("%s%s: %s: Port %d: %pV",
+ level, DRV_NAME, dev_name(&priv->mdev->pdev->dev),
+ priv->port, &vaf);
+ va_end(args);
+
+ return i;
+}
+
static int mlx4_en_get_profile(struct mlx4_en_dev *mdev)
{
struct mlx4_en_profile *params = &mdev->profile;
@@ -152,15 +175,11 @@ static void mlx4_en_remove(struct mlx4_dev *dev, void *endev_ptr)
static void *mlx4_en_add(struct mlx4_dev *dev)
{
- static int mlx4_en_version_printed;
struct mlx4_en_dev *mdev;
int i;
int err;
- if (!mlx4_en_version_printed) {
- printk(KERN_INFO "%s", mlx4_en_version);
- mlx4_en_version_printed++;
- }
+ printk_once(KERN_INFO "%s", mlx4_en_version);
mdev = kzalloc(sizeof *mdev, GFP_KERNEL);
if (!mdev) {
diff --git a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c
index 22d0b3b..6d7b2bf 100644
--- a/drivers/net/mlx4/eq.c
+++ b/drivers/net/mlx4/eq.c
@@ -475,10 +475,10 @@ static void mlx4_free_eq(struct mlx4_dev *dev,
mlx4_dbg(dev, "Dumping EQ context %02x:\n", eq->eqn);
for (i = 0; i < sizeof (struct mlx4_eq_context) / 4; ++i) {
if (i % 4 == 0)
- printk("[%02x] ", i * 4);
- printk(" %08x", be32_to_cpup(mailbox->buf + i * 4));
+ pr_cont("[%02x] ", i * 4);
+ pr_cont(" %08x", be32_to_cpup(mailbox->buf + i * 4));
if ((i + 1) % 4 == 0)
- printk("\n");
+ pr_cont("\n");
}
}
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index e3e0d54..5102ab1 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -1050,8 +1050,7 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
int err;
int port;
- printk(KERN_INFO PFX "Initializing %s\n",
- pci_name(pdev));
+ pr_info(DRV_NAME ": Initializing %s\n", pci_name(pdev));
err = pci_enable_device(pdev);
if (err) {
@@ -1216,12 +1215,7 @@ err_disable_pdev:
static int __devinit mlx4_init_one(struct pci_dev *pdev,
const struct pci_device_id *id)
{
- static int mlx4_version_printed;
-
- if (!mlx4_version_printed) {
- printk(KERN_INFO "%s", mlx4_version);
- ++mlx4_version_printed;
- }
+ printk_once(KERN_INFO "%s", mlx4_version);
return __mlx4_init_one(pdev, id);
}
@@ -1301,17 +1295,17 @@ static struct pci_driver mlx4_driver = {
static int __init mlx4_verify_params(void)
{
if ((log_num_mac < 0) || (log_num_mac > 7)) {
- printk(KERN_WARNING "mlx4_core: bad num_mac: %d\n", log_num_mac);
+ pr_warning("mlx4_core: bad num_mac: %d\n", log_num_mac);
return -1;
}
if ((log_num_vlan < 0) || (log_num_vlan > 7)) {
- printk(KERN_WARNING "mlx4_core: bad num_vlan: %d\n", log_num_vlan);
+ pr_warning("mlx4_core: bad num_vlan: %d\n", log_num_vlan);
return -1;
}
if ((log_mtts_per_seg < 1) || (log_mtts_per_seg > 5)) {
- printk(KERN_WARNING "mlx4_core: bad log_mtts_per_seg: %d\n", log_mtts_per_seg);
+ pr_warning("mlx4_core: bad log_mtts_per_seg: %d\n", log_mtts_per_seg);
return -1;
}
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 13343e8..0da5bb7 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -48,7 +48,6 @@
#include <linux/mlx4/doorbell.h>
#define DRV_NAME "mlx4_core"
-#define PFX DRV_NAME ": "
#define DRV_VERSION "0.01"
#define DRV_RELDATE "May 1, 2007"
@@ -88,17 +87,17 @@ extern int mlx4_debug_level;
#endif /* CONFIG_MLX4_DEBUG */
#define mlx4_dbg(mdev, format, arg...) \
- do { \
- if (mlx4_debug_level) \
- dev_printk(KERN_DEBUG, &mdev->pdev->dev, format, ## arg); \
- } while (0)
+do { \
+ if (mlx4_debug_level) \
+ dev_printk(KERN_DEBUG, &mdev->pdev->dev, format, ##arg); \
+} while (0)
#define mlx4_err(mdev, format, arg...) \
- dev_err(&mdev->pdev->dev, format, ## arg)
+ dev_err(&mdev->pdev->dev, format, ##arg)
#define mlx4_info(mdev, format, arg...) \
- dev_info(&mdev->pdev->dev, format, ## arg)
+ dev_info(&mdev->pdev->dev, format, ##arg)
#define mlx4_warn(mdev, format, arg...) \
- dev_warn(&mdev->pdev->dev, format, ## arg)
+ dev_warn(&mdev->pdev->dev, format, ##arg)
struct mlx4_bitmap {
u32 last;
diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h
index b55e46c..4492109 100644
--- a/drivers/net/mlx4/mlx4_en.h
+++ b/drivers/net/mlx4/mlx4_en.h
@@ -52,40 +52,8 @@
#define DRV_VERSION "1.4.1.1"
#define DRV_RELDATE "June 2009"
-
#define MLX4_EN_MSG_LEVEL (NETIF_MSG_LINK | NETIF_MSG_IFDOWN)
-#define en_print(level, priv, format, arg...) \
- { \
- if ((priv)->registered) \
- printk(level "%s: %s: " format, DRV_NAME, \
- (priv->dev)->name, ## arg); \
- else \
- printk(level "%s: %s: Port %d: " format, \
- DRV_NAME, dev_name(&priv->mdev->pdev->dev), \
- (priv)->port, ## arg); \
- }
-
-#define en_dbg(mlevel, priv, format, arg...) \
- { \
- if (NETIF_MSG_##mlevel & priv->msg_enable) \
- en_print(KERN_DEBUG, priv, format, ## arg) \
- }
-#define en_warn(priv, format, arg...) \
- en_print(KERN_WARNING, priv, format, ## arg)
-#define en_err(priv, format, arg...) \
- en_print(KERN_ERR, priv, format, ## arg)
-
-#define mlx4_err(mdev, format, arg...) \
- printk(KERN_ERR "%s %s: " format , DRV_NAME ,\
- dev_name(&mdev->pdev->dev) , ## arg)
-#define mlx4_info(mdev, format, arg...) \
- printk(KERN_INFO "%s %s: " format , DRV_NAME ,\
- dev_name(&mdev->pdev->dev) , ## arg)
-#define mlx4_warn(mdev, format, arg...) \
- printk(KERN_WARNING "%s %s: " format , DRV_NAME ,\
- dev_name(&mdev->pdev->dev) , ## arg)
-
/*
* Device constants
*/
@@ -568,4 +536,34 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset);
* Globals
*/
extern const struct ethtool_ops mlx4_en_ethtool_ops;
+
+
+
+/*
+ * printk / logging functions
+ */
+
+int en_print(const char *level, const struct mlx4_en_priv *priv,
+ const char *format, ...) __attribute__ ((format (printf, 3, 4)));
+
+#define en_dbg(mlevel, priv, format, arg...) \
+do { \
+ if (NETIF_MSG_##mlevel & priv->msg_enable) \
+ en_print(KERN_DEBUG, priv, format, ##arg); \
+} while (0)
+#define en_warn(priv, format, arg...) \
+ en_print(KERN_WARNING, priv, format, ##arg)
+#define en_err(priv, format, arg...) \
+ en_print(KERN_ERR, priv, format, ##arg)
+
+#define mlx4_err(mdev, format, arg...) \
+ pr_err("%s %s: " format, DRV_NAME, \
+ dev_name(&mdev->pdev->dev), ##arg)
+#define mlx4_info(mdev, format, arg...) \
+ pr_info("%s %s: " format, DRV_NAME, \
+ dev_name(&mdev->pdev->dev), ##arg)
+#define mlx4_warn(mdev, format, arg...) \
+ pr_warning("%s %s: " format, DRV_NAME, \
+ dev_name(&mdev->pdev->dev), ##arg)
+
#endif
--
1.7.1.337.g6068.dirty
^ permalink raw reply related
* Re: [PATCH] Export SMBIOS provided firmware instance and label to sysfs
From: Greg KH @ 2010-07-10 17:52 UTC (permalink / raw)
To: Narendra K
Cc: netdev, linux-hotplug, linux-pci, matt_domsch, charles_rose,
jordan_hargrave, vijay_nijhawan
In-Reply-To: <20100710171445.GA24568@auslistsprd01.us.dell.com>
On Sat, Jul 10, 2010 at 12:14:45PM -0500, Narendra K wrote:
> +static char smbios_attr[4096];
> +
> +enum smbios_attr_enum {
> + SMBIOS_ATTR_LABEL_SHOW = 1,
> + SMBIOS_ATTR_INSTANCE_SHOW,
> +};
> +
> +static mode_t
> +smbios_instance_string_exist(struct kobject *kobj, struct attribute *attr,
> + int attribute)
> +{
> + struct device *dev;
> + struct pci_dev *pdev;
> + const struct dmi_device *dmi;
> + struct dmi_dev_onboard *donboard;
> + int bus;
> + int devfn;
> +
> + dev = container_of(kobj, struct device, kobj);
> + pdev = to_pci_dev(dev);
> +
> + bus = pdev->bus->number;
> + devfn = pdev->devfn;
> +
> + dmi = NULL;
> + while ((dmi = dmi_find_device(DMI_DEV_TYPE_DEV_ONBOARD,
> + NULL, dmi)) != NULL) {
> + donboard = dmi->device_data;
> + if (donboard && donboard->bus == bus &&
> + donboard->devfn == devfn) {
> + if (attribute == SMBIOS_ATTR_INSTANCE_SHOW)
> + return scnprintf(smbios_attr, PAGE_SIZE,
> + "%d\n", donboard->instance);
> + else if (attribute == SMBIOS_ATTR_LABEL_SHOW)
> + return scnprintf(smbios_attr, PAGE_SIZE,
> + "%s\n", dmi->name);
Wait, depending on the attribute you are looking at, you are placing the
data in a single buffer? What happens if userspace opens and reads both
files at once?
Please don't use this function for your show attributes, just properly
copy the correct string into the userspace buffer. This logic just
complicates things a lot more, right?
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] Export SMBIOS provided firmware instance and label to sysfs
From: Greg KH @ 2010-07-10 17:49 UTC (permalink / raw)
To: Narendra K
Cc: netdev, linux-hotplug, linux-pci, matt_domsch, charles_rose,
jordan_hargrave, vijay_nijhawan
In-Reply-To: <20100710171445.GA24568@auslistsprd01.us.dell.com>
On Sat, Jul 10, 2010 at 12:14:45PM -0500, Narendra K wrote:
> +static char smbios_attr[4096];
Interesting size, too bad you don't reference it again:
> + if (attribute == SMBIOS_ATTR_INSTANCE_SHOW)
> + return scnprintf(smbios_attr, PAGE_SIZE,
> + "%d\n", donboard->instance);
> + else if (attribute == SMBIOS_ATTR_LABEL_SHOW)
> + return scnprintf(smbios_attr, PAGE_SIZE,
> + "%s\n", dmi->name);
PAGE_SIZE here?
Which is it (note, some arches PAGE_SIZE is not 4k...)
> + return strlen(dmi->name);
> + }
> + }
> + return 0;
> +}
> +
> +static ssize_t
> +smbiosname_show(struct device *dev, struct device_attribute *attr, char *buf)
> +{
> + ssize_t result;
> + result = smbios_instance_string_exist(&dev->kobj, &attr->attr,
> + SMBIOS_ATTR_LABEL_SHOW);
> + strncpy(buf, smbios_attr, result);
> + return result;
> +}
> +
> +static ssize_t
> +smbiosinstance_show(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + ssize_t result;
> + result = smbios_instance_string_exist(&dev->kobj, &attr->attr,
> + SMBIOS_ATTR_INSTANCE_SHOW);
> + strncpy(buf, smbios_attr, result);
> + return result;
> +}
> +
> +static struct device_attribute smbios_attr_label = {
> + .attr = {.name = "label", .mode = 0444, .owner = THIS_MODULE},
> + .show = smbiosname_show,
> +};
> +
> +static struct device_attribute smbios_attr_instance = {
> + .attr = {.name = "index", .mode = 0444, .owner = THIS_MODULE},
> + .show = smbiosinstance_show,
> +};
> +
> +static struct attribute *smbios_attributes[] = {
> + &smbios_attr_label.attr,
> + &smbios_attr_instance.attr,
> + NULL,
> +};
> +
> +static struct attribute_group smbios_attr_group = {
> + .attrs = smbios_attributes,
> + .is_visible = smbios_instance_string_exist,
> +};
> +
> +static int
> +pci_create_smbiosname_file(struct pci_dev *pdev)
> +{
> + if (smbios_attr_group.is_visible &&
You set .is_visable above, how could it not be set?
> + smbios_attr_group.is_visible(&pdev->dev.kobj, NULL, 0)) {
> + if (!sysfs_create_group(&pdev->dev.kobj, &smbios_attr_group))
> + return 0;
No, sysfs_create_group will call .is_visable, right? You shouldn't need
to call it yourself or check it, at all.
> +static int
> +pci_remove_smbiosname_file(struct pci_dev *pdev)
> +{
> + if (smbios_attr_group.is_visible &&
> + smbios_attr_group.is_visible(&pdev->dev.kobj, NULL, 0)) {
> + sysfs_remove_group(&pdev->dev.kobj, &smbios_attr_group);
> + return 0;
Same here, you shouldn't have to check .is_visable.
> + }
> + return -1;
Why -1? Please use a real error value.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] tproxy: nf_tproxy_assign_sock() can handle tw sockets
From: David Miller @ 2010-07-10 19:30 UTC (permalink / raw)
To: eric.dumazet; +Cc: felipewd, kaber, linux-kernel, netdev
In-Reply-To: <1278742649.2538.17.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 10 Jul 2010 08:17:29 +0200
> Strange thing with your crash report is CR2 value, with unexpected value
> of 000000000b388000 while RAX value is dce8dce85d415d41
>
> Faulting instruction is :
>
> 48 83 b8 b0 00 00 00 00 cmpq $0x0,0xb0(%rax)
>
> So I would have expected CR2 being RAX+0xb0, but its not.
It could be corruption from elsewhere. Those last four hex
digits (0x5d415d41) are "]A]A" in ascii, but that could just
be coincidence.
^ permalink raw reply
* [PATCH -net-next-2.6] ll_temac: Fix missing validate_addr hook
From: Denis Kirjanov @ 2010-07-10 21:10 UTC (permalink / raw)
To: davem; +Cc: netdev
Fix missing validate_addr hook
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
drivers/net/ll_temac_main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
index 7b12d0e..13d21a3 100644
--- a/drivers/net/ll_temac_main.c
+++ b/drivers/net/ll_temac_main.c
@@ -883,6 +883,7 @@ static const struct net_device_ops temac_netdev_ops = {
.ndo_stop = temac_stop,
.ndo_start_xmit = temac_start_xmit,
.ndo_set_mac_address = netdev_set_mac_address,
+ .ndo_validate_addr = eth_validate_addr,
//.ndo_set_multicast_list = temac_set_multicast_list,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = temac_poll_controller,
--
1.6.4.4
^ permalink raw reply related
* [patch] hostap: fixup strlen() math
From: Dan Carpenter @ 2010-07-10 22:10 UTC (permalink / raw)
To: Jouni Malinen
Cc: John W. Linville, Martin Decky, linux-wireless, netdev,
kernel-janitors
In hostap_add_interface() we do:
sprintf(dev->name, "%s%s", prefix, name);
dev->name has IFNAMSIZ (16) characters.
prefix is local->dev->name.
name is "wds%d"
strlen() returns the number of characters in the string not counting the
NULL so if we have a string with 11 characters we get "12345678901wds%d"
which is 16 characters and a NULL so we're past the end of the array.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index eb57d1e..f1bc258 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -186,7 +186,7 @@ int prism2_wds_add(local_info_t *local, u8 *remote_addr,
return -ENOBUFS;
/* verify that there is room for wds# postfix in the interface name */
- if (strlen(local->dev->name) > IFNAMSIZ - 5) {
+ if (strlen(local->dev->name) >= IFNAMSIZ - 5) {
printk(KERN_DEBUG "'%s' too long base device name\n",
local->dev->name);
return -EINVAL;
^ permalink raw reply related
* Re: [PATCH] sysfs: Don't allow the creation of symlinks we can't remove
From: Maciej W. Rozycki @ 2010-07-10 22:30 UTC (permalink / raw)
To: Eric W. Biederman
Cc: Greg KH, Andrew Morton, Rafael J. Wysocki, Kay Sievers,
Johannes Berg, Greg KH, netdev
In-Reply-To: <m1630q7x5v.fsf_-_@fess.ebiederm.org>
On Thu, 8 Jul 2010, Eric W. Biederman wrote:
> Recently my tagged sysfs support revealed a flaw in the device core
> that a few rare drivers are running into such that we don't always put
> network devices in a class subdirectory named net/.
I've been cc-ed for a reason I suppose -- any network driver I should be
looking into? What's the actual problem?
Maciej
^ permalink raw reply
* [PATCH kernel 2.6.35-rc3-git7] axnet_cs: use spin_lock_irqsave in ax_interrupt
From: Ken Kawasaki @ 2010-07-10 11:18 UTC (permalink / raw)
To: netdev
In-Reply-To: <20100706202243.95319ab4.ken_kawasaki@spring.nifty.jp>
axnet_cs:
use spin_lock_irqsave instead of spin_lock in ax_interrupt
Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
---
--- linux-2.6.35-git7/drivers/net/pcmcia/axnet_cs.c.orig 2010-07-04 08:28:15.000000000 +0900
+++ linux-2.6.35-git7/drivers/net/pcmcia/axnet_cs.c 2010-07-10 19:07:20.000000000 +0900
@@ -1168,6 +1168,7 @@ static irqreturn_t ax_interrupt(int irq,
int interrupts, nr_serviced = 0, i;
struct ei_device *ei_local;
int handled = 0;
+ unsigned long flags;
e8390_base = dev->base_addr;
ei_local = netdev_priv(dev);
@@ -1176,7 +1177,7 @@ static irqreturn_t ax_interrupt(int irq,
* Protect the irq test too.
*/
- spin_lock(&ei_local->page_lock);
+ spin_lock_irqsave(&ei_local->page_lock, flags);
if (ei_local->irqlock)
{
@@ -1188,7 +1189,7 @@ static irqreturn_t ax_interrupt(int irq,
dev->name, inb_p(e8390_base + EN0_ISR),
inb_p(e8390_base + EN0_IMR));
#endif
- spin_unlock(&ei_local->page_lock);
+ spin_unlock_irqrestore(&ei_local->page_lock, flags);
return IRQ_NONE;
}
@@ -1261,7 +1262,7 @@ static irqreturn_t ax_interrupt(int irq,
ei_local->irqlock = 0;
outb_p(ENISR_ALL, e8390_base + EN0_IMR);
- spin_unlock(&ei_local->page_lock);
+ spin_unlock_irqrestore(&ei_local->page_lock, flags);
return IRQ_RETVAL(handled);
}
^ permalink raw reply
* Re: linux-next: Tree for July 6 (NET_DSA + PHYLIB kconfig)
From: David Miller @ 2010-07-11 2:09 UTC (permalink / raw)
To: randy.dunlap; +Cc: sfr, netdev, linux-next, linux-kernel
In-Reply-To: <20100706103417.8923b697.randy.dunlap@oracle.com>
From: Randy Dunlap <randy.dunlap@oracle.com>
Date: Tue, 6 Jul 2010 10:34:17 -0700
> NET_DSA selects PHYLIB. PHYLIB depends on NET_ETHERNET, which is not enabled
> in this randconfig. net/dsa code does need PHYLIB code, so PHYLIB symbol should
> either drop "depends on NET_ETHERNET" or it should be changed to
> depends on NET_ETHERNET || NET_DSA
>
> Preference?
The situations seems to suggest NET_DSA depends upon NET_ETHERNET, so
adding NET_ETHERNET to NET_DSA's dependencies probably works better.
^ permalink raw reply
* Re: [PATCH] bnx2x: add support for receive hashing
From: David Miller @ 2010-07-11 2:12 UTC (permalink / raw)
To: therbert; +Cc: vladz, netdev
In-Reply-To: <AANLkTinRUJS6e8dwqvIMhtAUWBcj5oTk-D9MMrhbL9Bk@mail.gmail.com>
From: Tom Herbert <therbert@google.com>
Date: Wed, 7 Jul 2010 12:17:31 -0700
> It is to enable the device to provide the RSS hash in RX descriptor.
> The hash severs two purposes now, it's used internally in the device
> to perform RSS table lookup and also value in RX descriptor. The
> latter does not require multi-queue. Strictly speaking, on a single
> processor system without multqueue, it would be true that enabling the
> RX hash on bnx2x is currently superfluous (notwithstanding some other
> use of the hash might be implemented).
We intend to use the card provided RSS hash to optimize GSO
flow comparisons at some point.
There are other possible uses as well.
Therefore even in a single RX queue configuration, the driver
should provide the hash if it can.
^ permalink raw reply
* a couple questions about drivers/net/macv*.c
From: Robert P. J. Day @ 2010-07-10 23:44 UTC (permalink / raw)
To: netdev
first (trivial) point, i notice that both macvlan.c and macvtap.c
are still both listed as EXPERIMENTAL -- is that still accurate?
bigger issue in macvtap.c -- notice this declaration:
static unsigned int macvtap_major;
that seems like a violation of coding style since that variable is
used later on in:
devt = MKDEV(MAJOR(macvtap_major), dev->ifindex);
and
err = alloc_chrdev_region(&macvtap_major, 0,
MACVTAP_NUM_DEVS, "macvtap");
where its type should simply be the typedef "dev_t" for transparency,
should it not? hardcoding that variable as an unsigned int seems like
a bad idea.
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Top-notch, inexpensive online Linux/OSS/kernel courses
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply
* Re: a couple questions about drivers/net/macv*.c
From: David Miller @ 2010-07-11 2:26 UTC (permalink / raw)
To: rpjday; +Cc: netdev
In-Reply-To: <alpine.DEB.2.00.1007101652030.7658@lynx>
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
Date: Sat, 10 Jul 2010 19:44:59 -0400 (EDT)
>
> first (trivial) point, i notice that both macvlan.c and macvtap.c
> are still both listed as EXPERIMENTAL -- is that still accurate?
Probably the tag should be removed, a lot of people use this
facility and it works quite well as far as I can tell.
> bigger issue in macvtap.c -- notice this declaration:
>
> static unsigned int macvtap_major;
>
> that seems like a violation of coding style since that variable is
> used later on in:
>
> devt = MKDEV(MAJOR(macvtap_major), dev->ifindex);
> and
>
> err = alloc_chrdev_region(&macvtap_major, 0,
> MACVTAP_NUM_DEVS, "macvtap");
>
> where its type should simply be the typedef "dev_t" for transparency,
> should it not?
Yep, I'll check in the following to net-next-2.6, thanks.
--------------------
macvtap: Use dev_t for macvtap_major.
Reported-by: "Robert P. J. Day" <rpjday@crashcourse.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/macvtap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index a8a94e2..2b4d59b 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -58,7 +58,7 @@ static struct proto macvtap_proto = {
* only has one tap, the interface numbers assure that the
* device nodes are unique.
*/
-static unsigned int macvtap_major;
+static dev_t macvtap_major;
#define MACVTAP_NUM_DEVS 65536
static struct class *macvtap_class;
static struct cdev macvtap_cdev;
--
1.7.1.1
^ permalink raw reply related
* Re: a couple questions about drivers/net/macv*.c
From: Robert P. J. Day @ 2010-07-11 2:31 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20100710.192610.232749731.davem@davemloft.net>
On Sat, 10 Jul 2010, David Miller wrote:
> From: "Robert P. J. Day" <rpjday@crashcourse.ca>
> Date: Sat, 10 Jul 2010 19:44:59 -0400 (EDT)
>
> >
> > first (trivial) point, i notice that both macvlan.c and macvtap.c
> > are still both listed as EXPERIMENTAL -- is that still accurate?
>
> Probably the tag should be removed, a lot of people use this
> facility and it works quite well as far as I can tell.
>
> > bigger issue in macvtap.c -- notice this declaration:
> >
> > static unsigned int macvtap_major;
> >
> > that seems like a violation of coding style since that variable is
> > used later on in:
> >
> > devt = MKDEV(MAJOR(macvtap_major), dev->ifindex);
> > and
> >
> > err = alloc_chrdev_region(&macvtap_major, 0,
> > MACVTAP_NUM_DEVS, "macvtap");
> >
> > where its type should simply be the typedef "dev_t" for transparency,
> > should it not?
>
> Yep, I'll check in the following to net-next-2.6, thanks.
>
> --------------------
> macvtap: Use dev_t for macvtap_major.
>
> Reported-by: "Robert P. J. Day" <rpjday@crashcourse.ca>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
> drivers/net/macvtap.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
> index a8a94e2..2b4d59b 100644
> --- a/drivers/net/macvtap.c
> +++ b/drivers/net/macvtap.c
> @@ -58,7 +58,7 @@ static struct proto macvtap_proto = {
> * only has one tap, the interface numbers assure that the
> * device nodes are unique.
> */
> -static unsigned int macvtap_major;
> +static dev_t macvtap_major;
technically, i would drop the "_major" suffix since that variable
doesn't represent simply the major device number but the entire dev_t
typedef, but that's your call.
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Top-notch, inexpensive online Linux/OSS/kernel courses
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply
* Re: oops in tcp_xmit_retransmit_queue() w/ v2.6.32.15
From: David Miller @ 2010-07-11 2:36 UTC (permalink / raw)
To: tj; +Cc: linux-kernel, netdev, henning.fehrmann, carsten.aulbert
In-Reply-To: <4C358AAA.9080400@kernel.org>
From: Tejun Heo <tj@kernel.org>
Date: Thu, 08 Jul 2010 10:22:02 +0200
> We've been seeing oops in tcp_xmit_retransmit_queue() w/ 2.6.32.15.
...
> Does anything ring a bell?
A long time ago we had a packet scheduler bug that could corrupt
the TCP socket queues, but that was fixed in 2.6.27 so would
definitely be fixed in your kernel.
--------------------
commit 69747650c814a8a79fef412c7416adf823293a3e
Author: David S. Miller <davem@davemloft.net>
Date: Sun Aug 17 23:55:36 2008 -0700
pkt_sched: Fix return value corruption in HTB and TBF.
Based upon a bug report by Josip Rodin.
Packet schedulers should only return NET_XMIT_DROP iff
the packet really was dropped. If the packet does reach
the device after we return NET_XMIT_DROP then TCP can
crash because it depends upon the enqueue path return
values being accurate.
Signed-off-by: David S. Miller <davem@davemloft.net>
--------------------
Nothing else jumps to mind, sorry.
^ permalink raw reply
* Re: [PATCH net-next-2.6] be2net: Patch to determine if function is VF while running in guest OS.
From: David Miller @ 2010-07-11 2:42 UTC (permalink / raw)
To: sarveshwarb; +Cc: netdev
In-Reply-To: <20100709114344.GA2392@serverengines.com>
From: Sarveshwar Bandi <sarveshwarb@serverengines.com>
Date: Fri, 9 Jul 2010 17:13:55 +0530
> When driver is loaded in guest OS, the pci variables is_virtfn and is_physfn are
> both set to 0. This change uses registers in controller to determine the same.
>
> Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/2] 82596: do not panic on out of memory
From: David Miller @ 2010-07-11 2:42 UTC (permalink / raw)
To: segooon
Cc: kernel-janitors, jpirko, shemminger, eric.dumazet, andre.goddard,
netdev
In-Reply-To: <1278678323-6848-1-git-send-email-segooon@gmail.com>
From: Kulikov Vasiliy <segooon@gmail.com>
Date: Fri, 9 Jul 2010 16:25:22 +0400
> If dev_alloc_skb() failed then free already allocated skbs.
> remove_rx_bufs() can be called multiple times, so set rbd->skb to NULL
> to avoid double free. remove_rx_bufs() was moved upwards to be seen by
> init_rx_bufs().
>
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Applied to net-next-2.6
^ permalink raw reply
* Re: [PATCH 2/2] 82596: free resources on error
From: David Miller @ 2010-07-11 2:42 UTC (permalink / raw)
To: segooon
Cc: kernel-janitors, jpirko, shemminger, eric.dumazet, andre.goddard,
netdev
In-Reply-To: <1278678340-6889-1-git-send-email-segooon@gmail.com>
From: Kulikov Vasiliy <segooon@gmail.com>
Date: Fri, 9 Jul 2010 16:25:40 +0400
> IRQ 56 was not freed anywhere (neither in i596_open() on error nor in
> i596_close()), rx_bufs were not freed if init_i596_mem() fails,
> netif_stop_queue() was not called.
>
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Applied to net-next-2.6
^ permalink raw reply
* Re: [PATCH kernel 2.6.35-rc3-git7] axnet_cs: use spin_lock_irqsave in ax_interrupt
From: Ben Hutchings @ 2010-07-11 2:46 UTC (permalink / raw)
To: Ken Kawasaki; +Cc: netdev
In-Reply-To: <20100710201813.a3e5c79c.ken_kawasaki@spring.nifty.jp>
On Sat, 2010-07-10 at 20:18 +0900, Ken Kawasaki wrote:
> axnet_cs:
> use spin_lock_irqsave instead of spin_lock in ax_interrupt
[...]
I assume this is because it's now called from ei_watchdog() and not only
from interrupt context. Perhaps you should explain that in the commit
message.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
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 kernel 2.6.35-rc3-git7] axnet_cs: use spin_lock_irqsave in ax_interrupt
From: David Miller @ 2010-07-11 2:49 UTC (permalink / raw)
To: bhutchings; +Cc: ken_kawasaki, netdev
In-Reply-To: <1278816388.6139.10.camel@localhost>
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Sun, 11 Jul 2010 03:46:28 +0100
> On Sat, 2010-07-10 at 20:18 +0900, Ken Kawasaki wrote:
>> axnet_cs:
>> use spin_lock_irqsave instead of spin_lock in ax_interrupt
> [...]
>
> I assume this is because it's now called from ei_watchdog() and not only
> from interrupt context. Perhaps you should explain that in the commit
> message.
No, interrupt handlers in general may not assume that interrupts
are off or on when they are invoked.
Therefore they must use irqflags saving/restoring.
^ permalink raw reply
* Re: linux-next: build warning after merge of the net tree
From: David Miller @ 2010-07-11 2:52 UTC (permalink / raw)
To: joe; +Cc: sfr, netdev, linux-next, linux-kernel, gregkh
In-Reply-To: <1278562423.1712.43.camel@Joe-Laptop>
From: Joe Perches <joe@perches.com>
Date: Wed, 07 Jul 2010 21:13:42 -0700
> On Wed, 2010-07-07 at 18:18 -0700, David Miller wrote:
>> It looks like there are just a hand-ful of cases, so maybe we can tweak
>> them by hand. For example, in the sym53c8xx_2 driver bits we can replace
>> the NULL labels passed to sym_print_msg() with a real string and therefore
>> remove the "" case.
>>
>> Joe, any better ideas?
>
> You're right there are just a few cases where dev_info
> is uses as a preface for a hex_dump style display.
>
> Maybe it'd be OK to simply add a trailing space to the
> preface and remove any leading spaces from the subsequent
> initial printks.
>
> dev_info(dev, " ");
That might work.
The sym53c8xx_2 doesn't even need this, like I said, you could
just remove the NULL 'label' argument cases and then have that
bit cured.
Could you take a stab at this and the other scsi bits that
trigger this warning?
Thanks Joe!
^ 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