* [PATCH 0/7] e1000e: cleanup
From: Asbjoern Sloth Toennesen @ 2010-12-09 2:40 UTC (permalink / raw)
To: Jeff Kirsher, Jeff Kirsher; +Cc: e1000-devel, netdev, linux-kernel
Hi,
This patchset fixes most checkstyle problems in e1000e.
Checkpatch summary:
pre: total: 221 errors, 129 warnings, 24520 lines checked
post: total: 2 errors, 34 warnings, 24533 lines checked
The two remaining errors are of the type "Macros with complex values
should be enclosed in parenthesis", with macros containing 3 comma
seperated values.
The remaining warnings are all caused by <20ms msleep usage, that should
be replaced with usleep_range calls.
This patchset is based on top of jkirsher/net-next-2.6.git (67d5288)
Asbjoern Sloth Toennesen (7):
e1000e: cleanup: fix spacing issues
e1000e: cleanup: fix bracket issues
e1000e: cleanup: simplify E1000_ALL_* defines
e1000e: cleanup: fix long lines
e1000e: cleanup: fix space issues in ich8_* structs
e1000e: cleanup: swap arguments to avoid checkpatch errors
e1000e: cleanup: fix copyright notices to preferred style
drivers/net/e1000e/82571.c | 70 +++++++-------
drivers/net/e1000e/defines.h | 110 ++++++++++++-----------
drivers/net/e1000e/e1000.h | 93 +++++++++++---------
drivers/net/e1000e/es2lan.c | 135 ++++++++++++++--------------
drivers/net/e1000e/ethtool.c | 75 ++++++++--------
drivers/net/e1000e/hw.h | 56 ++++++------
drivers/net/e1000e/ich8lan.c | 185 +++++++++++++++++++-------------------
drivers/net/e1000e/lib.c | 78 ++++++++--------
drivers/net/e1000e/netdev.c | 171 +++++++++++++++++------------------
drivers/net/e1000e/param.c | 60 +++++++------
drivers/net/e1000e/phy.c | 204 +++++++++++++++++++++---------------------
11 files changed, 625 insertions(+), 612 deletions(-)
--
1.7.2.3
------------------------------------------------------------------------------
This SF Dev2Dev email is sponsored by:
WikiLeaks The End of the Free Internet
http://p.sf.net/sfu/therealnews-com
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* [PATCH 0/7] e1000e: cleanup
From: Asbjoern Sloth Toennesen @ 2010-12-09 2:40 UTC (permalink / raw)
To: Jeff Kirsher, Jeff Kirsher; +Cc: e1000-devel, netdev, linux-kernel
Hi,
This patchset fixes most checkstyle problems in e1000e.
Checkpatch summary:
pre: total: 221 errors, 129 warnings, 24520 lines checked
post: total: 2 errors, 34 warnings, 24533 lines checked
The two remaining errors are of the type "Macros with complex values
should be enclosed in parenthesis", with macros containing 3 comma
seperated values.
The remaining warnings are all caused by <20ms msleep usage, that should
be replaced with usleep_range calls.
This patchset is based on top of jkirsher/net-next-2.6.git (67d5288)
Asbjoern Sloth Toennesen (7):
e1000e: cleanup: fix spacing issues
e1000e: cleanup: fix bracket issues
e1000e: cleanup: simplify E1000_ALL_* defines
e1000e: cleanup: fix long lines
e1000e: cleanup: fix space issues in ich8_* structs
e1000e: cleanup: swap arguments to avoid checkpatch errors
e1000e: cleanup: fix copyright notices to preferred style
drivers/net/e1000e/82571.c | 70 +++++++-------
drivers/net/e1000e/defines.h | 110 ++++++++++++-----------
drivers/net/e1000e/e1000.h | 93 +++++++++++---------
drivers/net/e1000e/es2lan.c | 135 ++++++++++++++--------------
drivers/net/e1000e/ethtool.c | 75 ++++++++--------
drivers/net/e1000e/hw.h | 56 ++++++------
drivers/net/e1000e/ich8lan.c | 185 +++++++++++++++++++-------------------
drivers/net/e1000e/lib.c | 78 ++++++++--------
drivers/net/e1000e/netdev.c | 171 +++++++++++++++++------------------
drivers/net/e1000e/param.c | 60 +++++++------
drivers/net/e1000e/phy.c | 204 +++++++++++++++++++++---------------------
11 files changed, 625 insertions(+), 612 deletions(-)
--
1.7.2.3
^ permalink raw reply
* Re: linux-next: build failure after merge of the net tree
From: David Miller @ 2010-12-09 2:39 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-next, linux-kernel, socketcan
In-Reply-To: <20101209132836.6f6acfb8.sfr@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 9 Dec 2010 13:28:36 +1100
> After merging the net tree, today's linux-next build (x86_64 allmodconfig)
> failed like this:
>
> drivers/net/can/slcan.c: In function 'slcan_open':
> drivers/net/can/slcan.c:568: error: dereferencing pointer to incomplete type
That's amazing that with all the header files this driver includes,
powerpc somehow doesn't get the task_struct definition :-)
I'll add the obvious linux/sched.h include to fix this, thanks!
^ permalink raw reply
* [PATCH net-next V2] ehea: Use the standard logging functions
From: Joe Perches @ 2010-12-09 2:39 UTC (permalink / raw)
To: Breno Leitao; +Cc: David Miller, netdev, linux-kernel
In-Reply-To: <1291697844.17494.260.camel@Joe-Laptop>
Remove ehea_error, ehea_info and ehea_debug macros.
Use pr_fmt, pr_<level>, netdev_<level> and netif_<level> as appropriate.
Fix messages to use trailing "\n", some messages had an extra one
as the old ehea_<level> macros added a trailing "\n".
Coalesced long format strings.
Uncompiled/untested.
Signed-off-by: Joe Perches <joe@perches.com>
---
Updated after today's merge of net and net-next.
Sorry to make you test it again Breno.
drivers/net/ehea/ehea.h | 13 --
drivers/net/ehea/ehea_ethtool.c | 18 +-
drivers/net/ehea/ehea_main.c | 415 +++++++++++++++++++--------------------
drivers/net/ehea/ehea_phyp.c | 40 ++--
drivers/net/ehea/ehea_qmr.c | 89 +++++----
5 files changed, 278 insertions(+), 297 deletions(-)
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 8e745e7..45e709f 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -130,19 +130,6 @@
/* utility functions */
-#define ehea_info(fmt, args...) \
- printk(KERN_INFO DRV_NAME ": " fmt "\n", ## args)
-
-#define ehea_error(fmt, args...) \
- printk(KERN_ERR DRV_NAME ": Error in %s: " fmt "\n", __func__, ## args)
-
-#ifdef DEBUG
-#define ehea_debug(fmt, args...) \
- printk(KERN_DEBUG DRV_NAME ": " fmt, ## args)
-#else
-#define ehea_debug(fmt, args...) do {} while (0)
-#endif
-
void ehea_dump(void *adr, int len, char *msg);
#define EHEA_BMASK(pos, length) (((pos) << 16) + (length))
diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c
index 1f37ee6..afebf20 100644
--- a/drivers/net/ehea/ehea_ethtool.c
+++ b/drivers/net/ehea/ehea_ethtool.c
@@ -26,6 +26,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "ehea.h"
#include "ehea_phyp.h"
@@ -118,10 +120,10 @@ doit:
ret = ehea_set_portspeed(port, sp);
if (!ret)
- ehea_info("%s: Port speed successfully set: %dMbps "
- "%s Duplex",
- port->netdev->name, port->port_speed,
- port->full_duplex == 1 ? "Full" : "Half");
+ netdev_info(dev,
+ "Port speed successfully set: %dMbps %s Duplex\n",
+ port->port_speed,
+ port->full_duplex == 1 ? "Full" : "Half");
out:
return ret;
}
@@ -134,10 +136,10 @@ static int ehea_nway_reset(struct net_device *dev)
ret = ehea_set_portspeed(port, EHEA_SPEED_AUTONEG);
if (!ret)
- ehea_info("%s: Port speed successfully set: %dMbps "
- "%s Duplex",
- port->netdev->name, port->port_speed,
- port->full_duplex == 1 ? "Full" : "Half");
+ netdev_info(port->netdev,
+ "Port speed successfully set: %dMbps %s Duplex\n",
+ port->port_speed,
+ port->full_duplex == 1 ? "Full" : "Half");
return ret;
}
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 69f6152..90878d8 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -26,6 +26,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/tcp.h>
@@ -136,8 +138,8 @@ void ehea_dump(void *adr, int len, char *msg)
int x;
unsigned char *deb = adr;
for (x = 0; x < len; x += 16) {
- printk(DRV_NAME " %s adr=%p ofs=%04x %016llx %016llx\n", msg,
- deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8]));
+ pr_info("%s adr=%p ofs=%04x %016llx %016llx\n",
+ msg, deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8]));
deb += 16;
}
}
@@ -337,7 +339,7 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev)
cb2 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb2) {
- ehea_error("no mem for cb2");
+ netdev_err(dev, "no mem for cb2\n");
goto out;
}
@@ -345,7 +347,7 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev)
port->logical_port_id,
H_PORT_CB2, H_PORT_CB2_ALL, cb2);
if (hret != H_SUCCESS) {
- ehea_error("query_ehea_port failed");
+ netdev_err(dev, "query_ehea_port failed\n");
goto out_herr;
}
@@ -400,7 +402,7 @@ static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes)
skb_arr_rq1[index] = netdev_alloc_skb(dev,
EHEA_L_PKT_SIZE);
if (!skb_arr_rq1[index]) {
- ehea_info("Unable to allocate enough skb in the array\n");
+ netdev_info(dev, "Unable to allocate enough skb in the array\n");
pr->rq1_skba.os_skbs = fill_wqes - i;
break;
}
@@ -424,14 +426,14 @@ static void ehea_init_fill_rq1(struct ehea_port_res *pr, int nr_rq1a)
int i;
if (nr_rq1a > pr->rq1_skba.len) {
- ehea_error("NR_RQ1A bigger than skb array len\n");
+ netdev_error(dev, "NR_RQ1A bigger than skb array len\n");
return;
}
for (i = 0; i < nr_rq1a; i++) {
skb_arr_rq1[i] = netdev_alloc_skb(dev, EHEA_L_PKT_SIZE);
if (!skb_arr_rq1[i]) {
- ehea_info("No enough memory to allocate skb array\n");
+ netdev_info(dev, "Not enough memory to allocate skb array\n");
break;
}
}
@@ -469,8 +471,9 @@ static int ehea_refill_rq_def(struct ehea_port_res *pr,
if (!skb) {
q_skba->os_skbs = fill_wqes - i;
if (q_skba->os_skbs == q_skba->len - 2) {
- ehea_info("%s: rq%i ran dry - no mem for skb",
- pr->port->netdev->name, rq_nr);
+ netdev_info(pr->port->netdev,
+ "rq%i ran dry - no mem for skb\n",
+ rq_nr);
ret = -ENOMEM;
}
break;
@@ -635,8 +638,8 @@ static int ehea_treat_poll_error(struct ehea_port_res *pr, int rq,
if (cqe->status & EHEA_CQE_STAT_FAT_ERR_MASK) {
if (netif_msg_rx_err(pr->port)) {
- ehea_error("Critical receive error for QP %d. "
- "Resetting port.", pr->qp->init_attr.qp_nr);
+ pr_err("Critical receive error for QP %d. Resetting port.\n",
+ pr->qp->init_attr.qp_nr);
ehea_dump(cqe, sizeof(*cqe), "CQE");
}
ehea_schedule_port_reset(pr->port);
@@ -738,13 +741,13 @@ static int ehea_proc_rwqes(struct net_device *dev,
skb_arr_rq1_len,
wqe_index);
if (unlikely(!skb)) {
- if (netif_msg_rx_err(port))
- ehea_error("LL rq1: skb=NULL");
+ netif_err(port, rx_err, dev,
+ "LL rq1: skb=NULL\n");
skb = netdev_alloc_skb(dev,
EHEA_L_PKT_SIZE);
if (!skb) {
- ehea_info("Not enough memory to allocate skb\n");
+ netdev_info(dev, "Not enough memory to allocate skb\n");
break;
}
}
@@ -756,8 +759,8 @@ static int ehea_proc_rwqes(struct net_device *dev,
skb = get_skb_by_index(skb_arr_rq2,
skb_arr_rq2_len, cqe);
if (unlikely(!skb)) {
- if (netif_msg_rx_err(port))
- ehea_error("rq2: skb=NULL");
+ netif_err(port, rx_err, dev,
+ "rq2: skb=NULL\n");
break;
}
ehea_fill_skb(dev, skb, cqe);
@@ -767,8 +770,8 @@ static int ehea_proc_rwqes(struct net_device *dev,
skb = get_skb_by_index(skb_arr_rq3,
skb_arr_rq3_len, cqe);
if (unlikely(!skb)) {
- if (netif_msg_rx_err(port))
- ehea_error("rq3: skb=NULL");
+ netif_err(port, rx_err, dev,
+ "rq3: skb=NULL\n");
break;
}
ehea_fill_skb(dev, skb, cqe);
@@ -840,7 +843,7 @@ static void check_sqs(struct ehea_port *port)
msecs_to_jiffies(100));
if (!ret) {
- ehea_error("HW/SW queues out of sync");
+ pr_err("HW/SW queues out of sync\n");
ehea_schedule_port_reset(pr->port);
return;
}
@@ -873,14 +876,14 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota)
}
if (cqe->status & EHEA_CQE_STAT_ERR_MASK) {
- ehea_error("Bad send completion status=0x%04X",
- cqe->status);
+ pr_err("Bad send completion status=0x%04X\n",
+ cqe->status);
if (netif_msg_tx_err(pr->port))
ehea_dump(cqe, sizeof(*cqe), "Send CQE");
if (cqe->status & EHEA_CQE_STAT_RESET_MASK) {
- ehea_error("Resetting port");
+ pr_err("Resetting port\n");
ehea_schedule_port_reset(pr->port);
break;
}
@@ -998,8 +1001,8 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param)
while (eqe) {
qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry);
- ehea_error("QP aff_err: entry=0x%llx, token=0x%x",
- eqe->entry, qp_token);
+ pr_err("QP aff_err: entry=0x%llx, token=0x%x\n",
+ eqe->entry, qp_token);
qp = port->port_res[qp_token].qp;
@@ -1017,7 +1020,7 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param)
}
if (reset_port) {
- ehea_error("Resetting port");
+ pr_err("Resetting port\n");
ehea_schedule_port_reset(port);
}
@@ -1045,7 +1048,7 @@ int ehea_sense_port_attr(struct ehea_port *port)
/* may be called via ehea_neq_tasklet() */
cb0 = (void *)get_zeroed_page(GFP_ATOMIC);
if (!cb0) {
- ehea_error("no mem for cb0");
+ pr_err("no mem for cb0\n");
ret = -ENOMEM;
goto out;
}
@@ -1137,7 +1140,7 @@ int ehea_set_portspeed(struct ehea_port *port, u32 port_speed)
cb4 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb4) {
- ehea_error("no mem for cb4");
+ pr_err("no mem for cb4\n");
ret = -ENOMEM;
goto out;
}
@@ -1188,16 +1191,16 @@ int ehea_set_portspeed(struct ehea_port *port, u32 port_speed)
break;
}
} else {
- ehea_error("Failed sensing port speed");
+ pr_err("Failed sensing port speed\n");
ret = -EIO;
}
} else {
if (hret == H_AUTHORITY) {
- ehea_info("Hypervisor denied setting port speed");
+ pr_info("Hypervisor denied setting port speed\n");
ret = -EPERM;
} else {
ret = -EIO;
- ehea_error("Failed setting port speed");
+ pr_err("Failed setting port speed\n");
}
}
if (!prop_carrier_state || (port->phy_link == EHEA_PHY_LINK_UP))
@@ -1214,80 +1217,78 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe)
u8 ec;
u8 portnum;
struct ehea_port *port;
+ struct net_device *dev;
ec = EHEA_BMASK_GET(NEQE_EVENT_CODE, eqe);
portnum = EHEA_BMASK_GET(NEQE_PORTNUM, eqe);
port = ehea_get_port(adapter, portnum);
+ dev = port->netdev;
switch (ec) {
case EHEA_EC_PORTSTATE_CHG: /* port state change */
if (!port) {
- ehea_error("unknown portnum %x", portnum);
+ netdev_err(dev, "unknown portnum %x\n", portnum);
break;
}
if (EHEA_BMASK_GET(NEQE_PORT_UP, eqe)) {
- if (!netif_carrier_ok(port->netdev)) {
+ if (!netif_carrier_ok(dev)) {
ret = ehea_sense_port_attr(port);
if (ret) {
- ehea_error("failed resensing port "
- "attributes");
+ netdev_err(dev, "failed resensing port attributes\n");
break;
}
- if (netif_msg_link(port))
- ehea_info("%s: Logical port up: %dMbps "
- "%s Duplex",
- port->netdev->name,
- port->port_speed,
- port->full_duplex ==
- 1 ? "Full" : "Half");
+ netif_info(port, link, dev,
+ "Logical port up: %dMbps %s Duplex\n",
+ port->port_speed,
+ port->full_duplex == 1 ?
+ "Full" : "Half");
- netif_carrier_on(port->netdev);
- netif_wake_queue(port->netdev);
+ netif_carrier_on(dev);
+ netif_wake_queue(dev);
}
} else
- if (netif_carrier_ok(port->netdev)) {
- if (netif_msg_link(port))
- ehea_info("%s: Logical port down",
- port->netdev->name);
- netif_carrier_off(port->netdev);
- netif_stop_queue(port->netdev);
+ if (netif_carrier_ok(dev)) {
+ netif_info(port, link, dev,
+ "Logical port down\n");
+ netif_carrier_off(dev);
+ netif_stop_queue(dev);
}
if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PORT_UP, eqe)) {
port->phy_link = EHEA_PHY_LINK_UP;
- if (netif_msg_link(port))
- ehea_info("%s: Physical port up",
- port->netdev->name);
+ netif_info(port, link, dev,
+ "Physical port up\n");
if (prop_carrier_state)
- netif_carrier_on(port->netdev);
+ netif_carrier_on(dev);
} else {
port->phy_link = EHEA_PHY_LINK_DOWN;
- if (netif_msg_link(port))
- ehea_info("%s: Physical port down",
- port->netdev->name);
+ netif_info(port, link, dev,
+ "Physical port down\n");
if (prop_carrier_state)
- netif_carrier_off(port->netdev);
+ netif_carrier_off(dev);
}
if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PRIMARY, eqe))
- ehea_info("External switch port is primary port");
+ netdev_info(dev,
+ "External switch port is primary port\n");
else
- ehea_info("External switch port is backup port");
+ netdev_info(dev,
+ "External switch port is backup port\n");
break;
case EHEA_EC_ADAPTER_MALFUNC:
- ehea_error("Adapter malfunction");
+ netdev_err(dev, "Adapter malfunction\n");
break;
case EHEA_EC_PORT_MALFUNC:
- ehea_info("Port malfunction: Device: %s", port->netdev->name);
- netif_carrier_off(port->netdev);
- netif_stop_queue(port->netdev);
+ netdev_info(dev, "Port malfunction\n");
+ netif_carrier_off(dev);
+ netif_stop_queue(dev);
break;
default:
- ehea_error("unknown event code %x, eqe=0x%llX", ec, eqe);
+ netdev_err(dev, "unknown event code %x, eqe=0x%llX\n", ec, eqe);
break;
}
}
@@ -1299,13 +1300,13 @@ static void ehea_neq_tasklet(unsigned long data)
u64 event_mask;
eqe = ehea_poll_eq(adapter->neq);
- ehea_debug("eqe=%p", eqe);
+ pr_debug("eqe=%p\n", eqe);
while (eqe) {
- ehea_debug("*eqe=%lx", eqe->entry);
+ pr_debug("*eqe=%lx\n", eqe->entry);
ehea_parse_eqe(adapter, eqe->entry);
eqe = ehea_poll_eq(adapter->neq);
- ehea_debug("next eqe=%p", eqe);
+ pr_debug("next eqe=%p\n", eqe);
}
event_mask = EHEA_BMASK_SET(NELR_PORTSTATE_CHG, 1)
@@ -1354,14 +1355,14 @@ static int ehea_reg_interrupts(struct net_device *dev)
ehea_qp_aff_irq_handler,
IRQF_DISABLED, port->int_aff_name, port);
if (ret) {
- ehea_error("failed registering irq for qp_aff_irq_handler:"
- "ist=%X", port->qp_eq->attr.ist1);
+ netdev_err(dev, "failed registering irq for qp_aff_irq_handler:ist=%X\n",
+ port->qp_eq->attr.ist1);
goto out_free_qpeq;
}
- if (netif_msg_ifup(port))
- ehea_info("irq_handle 0x%X for function qp_aff_irq_handler "
- "registered", port->qp_eq->attr.ist1);
+ netif_info(port, ifup, dev,
+ "irq_handle 0x%X for function qp_aff_irq_handler registered\n",
+ port->qp_eq->attr.ist1);
for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
@@ -1373,14 +1374,13 @@ static int ehea_reg_interrupts(struct net_device *dev)
IRQF_DISABLED, pr->int_send_name,
pr);
if (ret) {
- ehea_error("failed registering irq for ehea_queue "
- "port_res_nr:%d, ist=%X", i,
- pr->eq->attr.ist1);
+ netdev_err(dev, "failed registering irq for ehea_queue port_res_nr:%d, ist=%X\n",
+ i, pr->eq->attr.ist1);
goto out_free_req;
}
- if (netif_msg_ifup(port))
- ehea_info("irq_handle 0x%X for function ehea_queue_int "
- "%d registered", pr->eq->attr.ist1, i);
+ netif_info(port, ifup, dev,
+ "irq_handle 0x%X for function ehea_queue_int %d registered\n",
+ pr->eq->attr.ist1, i);
}
out:
return ret;
@@ -1411,16 +1411,16 @@ static void ehea_free_interrupts(struct net_device *dev)
for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
pr = &port->port_res[i];
ibmebus_free_irq(pr->eq->attr.ist1, pr);
- if (netif_msg_intr(port))
- ehea_info("free send irq for res %d with handle 0x%X",
- i, pr->eq->attr.ist1);
+ netif_info(port, intr, dev,
+ "free send irq for res %d with handle 0x%X\n",
+ i, pr->eq->attr.ist1);
}
/* associated events */
ibmebus_free_irq(port->qp_eq->attr.ist1, port);
- if (netif_msg_intr(port))
- ehea_info("associated event interrupt for handle 0x%X freed",
- port->qp_eq->attr.ist1);
+ netif_info(port, intr, dev,
+ "associated event interrupt for handle 0x%X freed\n",
+ port->qp_eq->attr.ist1);
}
static int ehea_configure_port(struct ehea_port *port)
@@ -1489,7 +1489,7 @@ int ehea_gen_smrs(struct ehea_port_res *pr)
out_free:
ehea_rem_mr(&pr->send_mr);
out:
- ehea_error("Generating SMRS failed\n");
+ pr_err("Generating SMRS failed\n");
return -EIO;
}
@@ -1544,7 +1544,7 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr,
pr->eq = ehea_create_eq(adapter, eq_type, EHEA_MAX_ENTRIES_EQ, 0);
if (!pr->eq) {
- ehea_error("create_eq failed (eq)");
+ pr_err("create_eq failed (eq)\n");
goto out_free;
}
@@ -1552,7 +1552,7 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr,
pr->eq->fw_handle,
port->logical_port_id);
if (!pr->recv_cq) {
- ehea_error("create_cq failed (cq_recv)");
+ pr_err("create_cq failed (cq_recv)\n");
goto out_free;
}
@@ -1560,19 +1560,19 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr,
pr->eq->fw_handle,
port->logical_port_id);
if (!pr->send_cq) {
- ehea_error("create_cq failed (cq_send)");
+ pr_err("create_cq failed (cq_send)\n");
goto out_free;
}
if (netif_msg_ifup(port))
- ehea_info("Send CQ: act_nr_cqes=%d, Recv CQ: act_nr_cqes=%d",
- pr->send_cq->attr.act_nr_of_cqes,
- pr->recv_cq->attr.act_nr_of_cqes);
+ pr_info("Send CQ: act_nr_cqes=%d, Recv CQ: act_nr_cqes=%d\n",
+ pr->send_cq->attr.act_nr_of_cqes,
+ pr->recv_cq->attr.act_nr_of_cqes);
init_attr = kzalloc(sizeof(*init_attr), GFP_KERNEL);
if (!init_attr) {
ret = -ENOMEM;
- ehea_error("no mem for ehea_qp_init_attr");
+ pr_err("no mem for ehea_qp_init_attr\n");
goto out_free;
}
@@ -1597,18 +1597,18 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr,
pr->qp = ehea_create_qp(adapter, adapter->pd, init_attr);
if (!pr->qp) {
- ehea_error("create_qp failed");
+ pr_err("create_qp failed\n");
ret = -EIO;
goto out_free;
}
if (netif_msg_ifup(port))
- ehea_info("QP: qp_nr=%d\n act_nr_snd_wqe=%d\n nr_rwqe_rq1=%d\n "
- "nr_rwqe_rq2=%d\n nr_rwqe_rq3=%d", init_attr->qp_nr,
- init_attr->act_nr_send_wqes,
- init_attr->act_nr_rwqes_rq1,
- init_attr->act_nr_rwqes_rq2,
- init_attr->act_nr_rwqes_rq3);
+ pr_info("QP: qp_nr=%d\n act_nr_snd_wqe=%d\n nr_rwqe_rq1=%d\n nr_rwqe_rq2=%d\n nr_rwqe_rq3=%d\n",
+ init_attr->qp_nr,
+ init_attr->act_nr_send_wqes,
+ init_attr->act_nr_rwqes_rq1,
+ init_attr->act_nr_rwqes_rq2,
+ init_attr->act_nr_rwqes_rq3);
pr->sq_skba_size = init_attr->act_nr_send_wqes + 1;
@@ -1759,7 +1759,7 @@ static void write_swqe2_TSO(struct sk_buff *skb,
swqe->descriptors++;
}
} else
- ehea_error("cannot handle fragmented headers");
+ pr_err("cannot handle fragmented headers\n");
}
static void write_swqe2_nonTSO(struct sk_buff *skb,
@@ -1855,8 +1855,8 @@ static int ehea_broadcast_reg_helper(struct ehea_port *port, u32 hcallid)
port->logical_port_id,
reg_type, port->mac_addr, 0, hcallid);
if (hret != H_SUCCESS) {
- ehea_error("%sregistering bc address failed (tagged)",
- hcallid == H_REG_BCMC ? "" : "de");
+ pr_err("%sregistering bc address failed (tagged)\n",
+ hcallid == H_REG_BCMC ? "" : "de");
ret = -EIO;
goto out_herr;
}
@@ -1867,8 +1867,8 @@ static int ehea_broadcast_reg_helper(struct ehea_port *port, u32 hcallid)
port->logical_port_id,
reg_type, port->mac_addr, 0, hcallid);
if (hret != H_SUCCESS) {
- ehea_error("%sregistering bc address failed (vlan)",
- hcallid == H_REG_BCMC ? "" : "de");
+ pr_err("%sregistering bc address failed (vlan)\n",
+ hcallid == H_REG_BCMC ? "" : "de");
ret = -EIO;
}
out_herr:
@@ -1890,7 +1890,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
cb0 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb0) {
- ehea_error("no mem for cb0");
+ pr_err("no mem for cb0\n");
ret = -ENOMEM;
goto out;
}
@@ -1938,11 +1938,11 @@ out:
static void ehea_promiscuous_error(u64 hret, int enable)
{
if (hret == H_AUTHORITY)
- ehea_info("Hypervisor denied %sabling promiscuous mode",
- enable == 1 ? "en" : "dis");
+ pr_info("Hypervisor denied %sabling promiscuous mode\n",
+ enable == 1 ? "en" : "dis");
else
- ehea_error("failed %sabling promiscuous mode",
- enable == 1 ? "en" : "dis");
+ pr_err("failed %sabling promiscuous mode\n",
+ enable == 1 ? "en" : "dis");
}
static void ehea_promiscuous(struct net_device *dev, int enable)
@@ -1956,7 +1956,7 @@ static void ehea_promiscuous(struct net_device *dev, int enable)
cb7 = (void *)get_zeroed_page(GFP_ATOMIC);
if (!cb7) {
- ehea_error("no mem for cb7");
+ pr_err("no mem for cb7\n");
goto out;
}
@@ -2016,7 +2016,7 @@ static int ehea_drop_multicast_list(struct net_device *dev)
hret = ehea_multicast_reg_helper(port, mc_entry->macaddr,
H_DEREG_BCMC);
if (hret) {
- ehea_error("failed deregistering mcast MAC");
+ pr_err("failed deregistering mcast MAC\n");
ret = -EIO;
}
@@ -2039,7 +2039,8 @@ static void ehea_allmulti(struct net_device *dev, int enable)
if (!hret)
port->allmulti = 1;
else
- ehea_error("failed enabling IFF_ALLMULTI");
+ netdev_err(dev,
+ "failed enabling IFF_ALLMULTI\n");
}
} else
if (!enable) {
@@ -2048,7 +2049,8 @@ static void ehea_allmulti(struct net_device *dev, int enable)
if (!hret)
port->allmulti = 0;
else
- ehea_error("failed disabling IFF_ALLMULTI");
+ netdev_err(dev,
+ "failed disabling IFF_ALLMULTI\n");
}
}
@@ -2059,7 +2061,7 @@ static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr)
ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_ATOMIC);
if (!ehea_mcl_entry) {
- ehea_error("no mem for mcl_entry");
+ pr_err("no mem for mcl_entry\n");
return;
}
@@ -2072,7 +2074,7 @@ static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr)
if (!hret)
list_add(&ehea_mcl_entry->list, &port->mc_list->list);
else {
- ehea_error("failed registering mcast MAC");
+ pr_err("failed registering mcast MAC\n");
kfree(ehea_mcl_entry);
}
}
@@ -2105,9 +2107,8 @@ static void ehea_set_multicast_list(struct net_device *dev)
}
if (netdev_mc_count(dev) > port->adapter->max_mc_mac) {
- ehea_info("Mcast registration limit reached (0x%llx). "
- "Use ALLMULTI!",
- port->adapter->max_mc_mac);
+ pr_info("Mcast registration limit reached (0x%llx). Use ALLMULTI!\n",
+ port->adapter->max_mc_mac);
goto out;
}
@@ -2313,10 +2314,10 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
pr->swqe_id_counter += 1;
- if (netif_msg_tx_queued(port)) {
- ehea_info("post swqe on QP %d", pr->qp->init_attr.qp_nr);
+ netif_info(port, tx_queued, dev,
+ "post swqe on QP %d\n", pr->qp->init_attr.qp_nr);
+ if (netif_msg_tx_queued(port))
ehea_dump(swqe, 512, "swqe");
- }
if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) {
netif_stop_queue(dev);
@@ -2352,14 +2353,14 @@ static void ehea_vlan_rx_register(struct net_device *dev,
cb1 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb1) {
- ehea_error("no mem for cb1");
+ pr_err("no mem for cb1\n");
goto out;
}
hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
H_PORT_CB1, H_PORT_CB1_ALL, cb1);
if (hret != H_SUCCESS)
- ehea_error("modify_ehea_port failed");
+ pr_err("modify_ehea_port failed\n");
free_page((unsigned long)cb1);
out:
@@ -2376,14 +2377,14 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
cb1 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb1) {
- ehea_error("no mem for cb1");
+ pr_err("no mem for cb1\n");
goto out;
}
hret = ehea_h_query_ehea_port(adapter->handle, port->logical_port_id,
H_PORT_CB1, H_PORT_CB1_ALL, cb1);
if (hret != H_SUCCESS) {
- ehea_error("query_ehea_port failed");
+ pr_err("query_ehea_port failed\n");
goto out;
}
@@ -2393,7 +2394,7 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
H_PORT_CB1, H_PORT_CB1_ALL, cb1);
if (hret != H_SUCCESS)
- ehea_error("modify_ehea_port failed");
+ pr_err("modify_ehea_port failed\n");
out:
free_page((unsigned long)cb1);
return;
@@ -2411,14 +2412,14 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
cb1 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb1) {
- ehea_error("no mem for cb1");
+ pr_err("no mem for cb1\n");
goto out;
}
hret = ehea_h_query_ehea_port(adapter->handle, port->logical_port_id,
H_PORT_CB1, H_PORT_CB1_ALL, cb1);
if (hret != H_SUCCESS) {
- ehea_error("query_ehea_port failed");
+ pr_err("query_ehea_port failed\n");
goto out;
}
@@ -2428,7 +2429,7 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
H_PORT_CB1, H_PORT_CB1_ALL, cb1);
if (hret != H_SUCCESS)
- ehea_error("modify_ehea_port failed");
+ pr_err("modify_ehea_port failed\n");
out:
free_page((unsigned long)cb1);
}
@@ -2450,7 +2451,7 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp)
hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle,
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0);
if (hret != H_SUCCESS) {
- ehea_error("query_ehea_qp failed (1)");
+ pr_err("query_ehea_qp failed (1)\n");
goto out;
}
@@ -2459,14 +2460,14 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp)
EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0,
&dummy64, &dummy64, &dummy16, &dummy16);
if (hret != H_SUCCESS) {
- ehea_error("modify_ehea_qp failed (1)");
+ pr_err("modify_ehea_qp failed (1)\n");
goto out;
}
hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle,
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0);
if (hret != H_SUCCESS) {
- ehea_error("query_ehea_qp failed (2)");
+ pr_err("query_ehea_qp failed (2)\n");
goto out;
}
@@ -2475,14 +2476,14 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp)
EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0,
&dummy64, &dummy64, &dummy16, &dummy16);
if (hret != H_SUCCESS) {
- ehea_error("modify_ehea_qp failed (2)");
+ pr_err("modify_ehea_qp failed (2)\n");
goto out;
}
hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle,
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0);
if (hret != H_SUCCESS) {
- ehea_error("query_ehea_qp failed (3)");
+ pr_err("query_ehea_qp failed (3)\n");
goto out;
}
@@ -2491,14 +2492,14 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp)
EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0,
&dummy64, &dummy64, &dummy16, &dummy16);
if (hret != H_SUCCESS) {
- ehea_error("modify_ehea_qp failed (3)");
+ pr_err("modify_ehea_qp failed (3)\n");
goto out;
}
hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle,
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0);
if (hret != H_SUCCESS) {
- ehea_error("query_ehea_qp failed (4)");
+ pr_err("query_ehea_qp failed (4)\n");
goto out;
}
@@ -2519,7 +2520,7 @@ static int ehea_port_res_setup(struct ehea_port *port, int def_qps,
EHEA_MAX_ENTRIES_EQ, 1);
if (!port->qp_eq) {
ret = -EINVAL;
- ehea_error("ehea_create_eq failed (qp_eq)");
+ pr_err("ehea_create_eq failed (qp_eq)\n");
goto out_kill_eq;
}
@@ -2600,27 +2601,27 @@ static int ehea_up(struct net_device *dev)
ret = ehea_port_res_setup(port, port->num_def_qps,
port->num_add_tx_qps);
if (ret) {
- ehea_error("port_res_failed");
+ netdev_err(dev, "port_res_failed\n");
goto out;
}
/* Set default QP for this port */
ret = ehea_configure_port(port);
if (ret) {
- ehea_error("ehea_configure_port failed. ret:%d", ret);
+ netdev_err(dev, "ehea_configure_port failed. ret:%d\n", ret);
goto out_clean_pr;
}
ret = ehea_reg_interrupts(dev);
if (ret) {
- ehea_error("reg_interrupts failed. ret:%d", ret);
+ netdev_err(dev, "reg_interrupts failed. ret:%d\n", ret);
goto out_clean_pr;
}
for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
ret = ehea_activate_qp(port->adapter, port->port_res[i].qp);
if (ret) {
- ehea_error("activate_qp failed");
+ netdev_err(dev, "activate_qp failed\n");
goto out_free_irqs;
}
}
@@ -2628,7 +2629,7 @@ static int ehea_up(struct net_device *dev)
for (i = 0; i < port->num_def_qps; i++) {
ret = ehea_fill_port_res(&port->port_res[i]);
if (ret) {
- ehea_error("out_free_irqs");
+ netdev_err(dev, "out_free_irqs\n");
goto out_free_irqs;
}
}
@@ -2651,7 +2652,7 @@ out_clean_pr:
ehea_clean_all_portres(port);
out:
if (ret)
- ehea_info("Failed starting %s. ret=%i", dev->name, ret);
+ netdev_info(dev, "Failed starting. ret=%i\n", ret);
ehea_update_bcmc_registrations();
ehea_update_firmware_handles();
@@ -2682,8 +2683,7 @@ static int ehea_open(struct net_device *dev)
mutex_lock(&port->port_lock);
- if (netif_msg_ifup(port))
- ehea_info("enabling port %s", dev->name);
+ netif_info(port, ifup, dev, "enabling port\n");
ret = ehea_up(dev);
if (!ret) {
@@ -2718,8 +2718,7 @@ static int ehea_down(struct net_device *dev)
ret = ehea_clean_all_portres(port);
if (ret)
- ehea_info("Failed freeing resources for %s. ret=%i",
- dev->name, ret);
+ netdev_info(dev, "Failed freeing resources. ret=%i\n", ret);
ehea_update_firmware_handles();
@@ -2731,8 +2730,7 @@ static int ehea_stop(struct net_device *dev)
int ret;
struct ehea_port *port = netdev_priv(dev);
- if (netif_msg_ifdown(port))
- ehea_info("disabling port %s", dev->name);
+ netif_info(port, ifdown, dev, "disabling port\n");
set_bit(__EHEA_DISABLE_PORT_RESET, &port->flags);
cancel_work_sync(&port->reset_task);
@@ -2773,7 +2771,7 @@ static void ehea_flush_sq(struct ehea_port *port)
msecs_to_jiffies(100));
if (!ret) {
- ehea_error("WARNING: sq not flushed completely");
+ pr_err("WARNING: sq not flushed completely\n");
break;
}
}
@@ -2809,7 +2807,7 @@ int ehea_stop_qps(struct net_device *dev)
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF),
cb0);
if (hret != H_SUCCESS) {
- ehea_error("query_ehea_qp failed (1)");
+ pr_err("query_ehea_qp failed (1)\n");
goto out;
}
@@ -2821,7 +2819,7 @@ int ehea_stop_qps(struct net_device *dev)
1), cb0, &dummy64,
&dummy64, &dummy16, &dummy16);
if (hret != H_SUCCESS) {
- ehea_error("modify_ehea_qp failed (1)");
+ pr_err("modify_ehea_qp failed (1)\n");
goto out;
}
@@ -2829,14 +2827,14 @@ int ehea_stop_qps(struct net_device *dev)
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF),
cb0);
if (hret != H_SUCCESS) {
- ehea_error("query_ehea_qp failed (2)");
+ pr_err("query_ehea_qp failed (2)\n");
goto out;
}
/* deregister shared memory regions */
dret = ehea_rem_smrs(pr);
if (dret) {
- ehea_error("unreg shared memory region failed");
+ pr_err("unreg shared memory region failed\n");
goto out;
}
}
@@ -2905,7 +2903,7 @@ int ehea_restart_qps(struct net_device *dev)
ret = ehea_gen_smrs(pr);
if (ret) {
- ehea_error("creation of shared memory regions failed");
+ netdev_err(dev, "creation of shared memory regions failed\n");
goto out;
}
@@ -2916,7 +2914,7 @@ int ehea_restart_qps(struct net_device *dev)
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF),
cb0);
if (hret != H_SUCCESS) {
- ehea_error("query_ehea_qp failed (1)");
+ netdev_err(dev, "query_ehea_qp failed (1)\n");
goto out;
}
@@ -2928,7 +2926,7 @@ int ehea_restart_qps(struct net_device *dev)
1), cb0, &dummy64,
&dummy64, &dummy16, &dummy16);
if (hret != H_SUCCESS) {
- ehea_error("modify_ehea_qp failed (1)");
+ netdev_err(dev, "modify_ehea_qp failed (1)\n");
goto out;
}
@@ -2936,7 +2934,7 @@ int ehea_restart_qps(struct net_device *dev)
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF),
cb0);
if (hret != H_SUCCESS) {
- ehea_error("query_ehea_qp failed (2)");
+ netdev_err(dev, "query_ehea_qp failed (2)\n");
goto out;
}
@@ -2973,8 +2971,7 @@ static void ehea_reset_port(struct work_struct *work)
ehea_set_multicast_list(dev);
- if (netif_msg_timer(port))
- ehea_info("Device %s resetted successfully", dev->name);
+ netif_info(port, timer, dev, "reset successful\n");
port_napi_enable(port);
@@ -2989,7 +2986,7 @@ static void ehea_rereg_mrs(struct work_struct *work)
int ret, i;
struct ehea_adapter *adapter;
- ehea_info("LPAR memory changed - re-initializing driver");
+ pr_info("LPAR memory changed - re-initializing driver\n");
list_for_each_entry(adapter, &adapter_list, list)
if (adapter->active_ports) {
@@ -3021,8 +3018,7 @@ static void ehea_rereg_mrs(struct work_struct *work)
/* Unregister old memory region */
ret = ehea_rem_mr(&adapter->mr);
if (ret) {
- ehea_error("unregister MR failed - driver"
- " inoperable!");
+ pr_err("unregister MR failed - driver inoperable!\n");
goto out;
}
}
@@ -3034,8 +3030,7 @@ static void ehea_rereg_mrs(struct work_struct *work)
/* Register new memory region */
ret = ehea_reg_kernel_mr(adapter, &adapter->mr);
if (ret) {
- ehea_error("register MR failed - driver"
- " inoperable!");
+ pr_err("register MR failed - driver inoperable!\n");
goto out;
}
@@ -3058,7 +3053,7 @@ static void ehea_rereg_mrs(struct work_struct *work)
}
}
}
- ehea_info("re-initializing driver complete");
+ pr_info("re-initializing driver complete\n");
out:
return;
}
@@ -3111,7 +3106,7 @@ int ehea_get_jumboframe_status(struct ehea_port *port, int *jumbo)
/* (Try to) enable *jumbo frames */
cb4 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb4) {
- ehea_error("no mem for cb4");
+ pr_err("no mem for cb4\n");
ret = -ENOMEM;
goto out;
} else {
@@ -3173,13 +3168,13 @@ static struct device *ehea_register_port(struct ehea_port *port,
ret = of_device_register(&port->ofdev);
if (ret) {
- ehea_error("failed to register device. ret=%d", ret);
+ pr_err("failed to register device. ret=%d\n", ret);
goto out;
}
ret = device_create_file(&port->ofdev.dev, &dev_attr_log_port_id);
if (ret) {
- ehea_error("failed to register attributes, ret=%d", ret);
+ pr_err("failed to register attributes, ret=%d\n", ret);
goto out_unreg_of_dev;
}
@@ -3229,7 +3224,7 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
dev = alloc_etherdev(sizeof(struct ehea_port));
if (!dev) {
- ehea_error("no mem for net_device");
+ pr_err("no mem for net_device\n");
ret = -ENOMEM;
goto out_err;
}
@@ -3283,7 +3278,7 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
ret = register_netdev(dev);
if (ret) {
- ehea_error("register_netdev failed. ret=%d", ret);
+ pr_err("register_netdev failed. ret=%d\n", ret);
goto out_unreg_port;
}
@@ -3291,11 +3286,10 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
ret = ehea_get_jumboframe_status(port, &jumbo);
if (ret)
- ehea_error("failed determining jumbo frame status for %s",
- port->netdev->name);
+ netdev_err(dev, "failed determining jumbo frame status\n");
- ehea_info("%s: Jumbo frames are %sabled", dev->name,
- jumbo == 1 ? "en" : "dis");
+ netdev_info(dev, "Jumbo frames are %sabled\n",
+ jumbo == 1 ? "en" : "dis");
adapter->active_ports++;
@@ -3311,8 +3305,8 @@ out_free_ethdev:
free_netdev(dev);
out_err:
- ehea_error("setting up logical port with id=%d failed, ret=%d",
- logical_port_id, ret);
+ pr_err("setting up logical port with id=%d failed, ret=%d\n",
+ logical_port_id, ret);
return NULL;
}
@@ -3340,13 +3334,13 @@ static int ehea_setup_ports(struct ehea_adapter *adapter)
dn_log_port_id = of_get_property(eth_dn, "ibm,hea-port-no",
NULL);
if (!dn_log_port_id) {
- ehea_error("bad device node: eth_dn name=%s",
- eth_dn->full_name);
+ pr_err("bad device node: eth_dn name=%s\n",
+ eth_dn->full_name);
continue;
}
if (ehea_add_adapter_mr(adapter)) {
- ehea_error("creating MR failed");
+ pr_err("creating MR failed\n");
of_node_put(eth_dn);
return -EIO;
}
@@ -3355,9 +3349,8 @@ static int ehea_setup_ports(struct ehea_adapter *adapter)
*dn_log_port_id,
eth_dn);
if (adapter->port[i])
- ehea_info("%s -> logical port id #%d",
- adapter->port[i]->netdev->name,
- *dn_log_port_id);
+ netdev_info(adapter->port[i]->netdev,
+ "logical port id #%d\n", *dn_log_port_id);
else
ehea_remove_adapter_mr(adapter);
@@ -3402,21 +3395,20 @@ static ssize_t ehea_probe_port(struct device *dev,
port = ehea_get_port(adapter, logical_port_id);
if (port) {
- ehea_info("adding port with logical port id=%d failed. port "
- "already configured as %s.", logical_port_id,
- port->netdev->name);
+ netdev_info(port->netdev, "adding port with logical port id=%d failed: port already configured\n",
+ logical_port_id);
return -EINVAL;
}
eth_dn = ehea_get_eth_dn(adapter, logical_port_id);
if (!eth_dn) {
- ehea_info("no logical port with id %d found", logical_port_id);
+ pr_info("no logical port with id %d found\n", logical_port_id);
return -EINVAL;
}
if (ehea_add_adapter_mr(adapter)) {
- ehea_error("creating MR failed");
+ pr_err("creating MR failed\n");
return -EIO;
}
@@ -3431,8 +3423,8 @@ static ssize_t ehea_probe_port(struct device *dev,
break;
}
- ehea_info("added %s (logical port id=%d)", port->netdev->name,
- logical_port_id);
+ netdev_info(port->netdev, "added: (logical port id=%d)\n",
+ logical_port_id);
} else {
ehea_remove_adapter_mr(adapter);
return -EIO;
@@ -3455,8 +3447,8 @@ static ssize_t ehea_remove_port(struct device *dev,
port = ehea_get_port(adapter, logical_port_id);
if (port) {
- ehea_info("removed %s (logical port id=%d)", port->netdev->name,
- logical_port_id);
+ netdev_info(port->netdev, "removed: (logical port id=%d)\n",
+ logical_port_id);
ehea_shutdown_single_port(port);
@@ -3466,8 +3458,8 @@ static ssize_t ehea_remove_port(struct device *dev,
break;
}
} else {
- ehea_error("removing port with logical port id=%d failed. port "
- "not configured.", logical_port_id);
+ pr_err("removing port with logical port id=%d failed. port not configured.\n",
+ logical_port_id);
return -EINVAL;
}
@@ -3504,7 +3496,7 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
int ret;
if (!dev || !dev->dev.of_node) {
- ehea_error("Invalid ibmebus device probed");
+ pr_err("Invalid ibmebus device probed\n");
return -EINVAL;
}
@@ -3652,17 +3644,17 @@ static int ehea_mem_notifier(struct notifier_block *nb,
switch (action) {
case MEM_CANCEL_OFFLINE:
- ehea_info("memory offlining canceled");
+ pr_info("memory offlining canceled\n");
/* Readd canceled memory block */
case MEM_ONLINE:
- ehea_info("memory is going online");
+ pr_info("memory is going online\n");
set_bit(__EHEA_STOP_XFER, &ehea_driver_flags);
if (ehea_add_sect_bmap(arg->start_pfn, arg->nr_pages))
goto out_unlock;
ehea_rereg_mrs(NULL);
break;
case MEM_GOING_OFFLINE:
- ehea_info("memory is going offline");
+ pr_info("memory is going offline\n");
set_bit(__EHEA_STOP_XFER, &ehea_driver_flags);
if (ehea_rem_sect_bmap(arg->start_pfn, arg->nr_pages))
goto out_unlock;
@@ -3688,7 +3680,7 @@ static int ehea_reboot_notifier(struct notifier_block *nb,
unsigned long action, void *unused)
{
if (action == SYS_RESTART) {
- ehea_info("Reboot: freeing all eHEA resources");
+ pr_info("Reboot: freeing all eHEA resources\n");
ibmebus_unregister_driver(&ehea_driver);
}
return NOTIFY_DONE;
@@ -3704,22 +3696,22 @@ static int check_module_parm(void)
if ((rq1_entries < EHEA_MIN_ENTRIES_QP) ||
(rq1_entries > EHEA_MAX_ENTRIES_RQ1)) {
- ehea_info("Bad parameter: rq1_entries");
+ pr_info("Bad parameter: rq1_entries\n");
ret = -EINVAL;
}
if ((rq2_entries < EHEA_MIN_ENTRIES_QP) ||
(rq2_entries > EHEA_MAX_ENTRIES_RQ2)) {
- ehea_info("Bad parameter: rq2_entries");
+ pr_info("Bad parameter: rq2_entries\n");
ret = -EINVAL;
}
if ((rq3_entries < EHEA_MIN_ENTRIES_QP) ||
(rq3_entries > EHEA_MAX_ENTRIES_RQ3)) {
- ehea_info("Bad parameter: rq3_entries");
+ pr_info("Bad parameter: rq3_entries\n");
ret = -EINVAL;
}
if ((sq_entries < EHEA_MIN_ENTRIES_QP) ||
(sq_entries > EHEA_MAX_ENTRIES_SQ)) {
- ehea_info("Bad parameter: sq_entries");
+ pr_info("Bad parameter: sq_entries\n");
ret = -EINVAL;
}
@@ -3739,8 +3731,7 @@ int __init ehea_module_init(void)
{
int ret;
- printk(KERN_INFO "IBM eHEA ethernet device driver (Release %s)\n",
- DRV_VERSION);
+ pr_info("IBM eHEA ethernet device driver (Release %s)\n", DRV_VERSION);
INIT_WORK(&ehea_rereg_mr_task, ehea_rereg_mrs);
@@ -3760,27 +3751,27 @@ int __init ehea_module_init(void)
ret = register_reboot_notifier(&ehea_reboot_nb);
if (ret)
- ehea_info("failed registering reboot notifier");
+ pr_info("failed registering reboot notifier\n");
ret = register_memory_notifier(&ehea_mem_nb);
if (ret)
- ehea_info("failed registering memory remove notifier");
+ pr_info("failed registering memory remove notifier\n");
ret = crash_shutdown_register(ehea_crash_handler);
if (ret)
- ehea_info("failed registering crash handler");
+ pr_info("failed registering crash handler\n");
ret = ibmebus_register_driver(&ehea_driver);
if (ret) {
- ehea_error("failed registering eHEA device driver on ebus");
+ pr_err("failed registering eHEA device driver on ebus\n");
goto out2;
}
ret = driver_create_file(&ehea_driver.driver,
&driver_attr_capabilities);
if (ret) {
- ehea_error("failed to register capabilities attribute, ret=%d",
- ret);
+ pr_err("failed to register capabilities attribute, ret=%d\n",
+ ret);
goto out3;
}
@@ -3806,7 +3797,7 @@ static void __exit ehea_module_exit(void)
unregister_reboot_notifier(&ehea_reboot_nb);
ret = crash_shutdown_unregister(ehea_crash_handler);
if (ret)
- ehea_info("failed unregistering crash handler");
+ pr_info("failed unregistering crash handler\n");
unregister_memory_notifier(&ehea_mem_nb);
kfree(ehea_fw_handles.arr);
kfree(ehea_bcmc_regs.arr);
diff --git a/drivers/net/ehea/ehea_phyp.c b/drivers/net/ehea/ehea_phyp.c
index 8fe9dca..0506967 100644
--- a/drivers/net/ehea/ehea_phyp.c
+++ b/drivers/net/ehea/ehea_phyp.c
@@ -26,6 +26,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "ehea_phyp.h"
@@ -67,12 +69,11 @@ static long ehea_plpar_hcall_norets(unsigned long opcode,
}
if (ret < H_SUCCESS)
- ehea_error("opcode=%lx ret=%lx"
- " arg1=%lx arg2=%lx arg3=%lx arg4=%lx"
- " arg5=%lx arg6=%lx arg7=%lx ",
- opcode, ret,
- arg1, arg2, arg3, arg4, arg5,
- arg6, arg7);
+ pr_err("opcode=%lx ret=%lx"
+ " arg1=%lx arg2=%lx arg3=%lx arg4=%lx"
+ " arg5=%lx arg6=%lx arg7=%lx\n",
+ opcode, ret,
+ arg1, arg2, arg3, arg4, arg5, arg6, arg7);
return ret;
}
@@ -114,19 +115,18 @@ static long ehea_plpar_hcall9(unsigned long opcode,
&& (((cb_cat == H_PORT_CB4) && ((arg3 == H_PORT_CB4_JUMBO)
|| (arg3 == H_PORT_CB4_SPEED))) || ((cb_cat == H_PORT_CB7)
&& (arg3 == H_PORT_CB7_DUCQPN)))))
- ehea_error("opcode=%lx ret=%lx"
- " arg1=%lx arg2=%lx arg3=%lx arg4=%lx"
- " arg5=%lx arg6=%lx arg7=%lx arg8=%lx"
- " arg9=%lx"
- " out1=%lx out2=%lx out3=%lx out4=%lx"
- " out5=%lx out6=%lx out7=%lx out8=%lx"
- " out9=%lx",
- opcode, ret,
- arg1, arg2, arg3, arg4, arg5,
- arg6, arg7, arg8, arg9,
- outs[0], outs[1], outs[2], outs[3],
- outs[4], outs[5], outs[6], outs[7],
- outs[8]);
+ pr_err("opcode=%lx ret=%lx"
+ " arg1=%lx arg2=%lx arg3=%lx arg4=%lx"
+ " arg5=%lx arg6=%lx arg7=%lx arg8=%lx"
+ " arg9=%lx"
+ " out1=%lx out2=%lx out3=%lx out4=%lx"
+ " out5=%lx out6=%lx out7=%lx out8=%lx"
+ " out9=%lx\n",
+ opcode, ret,
+ arg1, arg2, arg3, arg4, arg5,
+ arg6, arg7, arg8, arg9,
+ outs[0], outs[1], outs[2], outs[3], outs[4],
+ outs[5], outs[6], outs[7], outs[8]);
return ret;
}
@@ -515,7 +515,7 @@ u64 ehea_h_register_rpage_mr(const u64 adapter_handle, const u64 mr_handle,
const u64 log_pageaddr, const u64 count)
{
if ((count > 1) && (log_pageaddr & ~PAGE_MASK)) {
- ehea_error("not on pageboundary");
+ pr_err("not on pageboundary\n");
return H_PARAMETER;
}
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c
index 89128b6..cd44bb8 100644
--- a/drivers/net/ehea/ehea_qmr.c
+++ b/drivers/net/ehea/ehea_qmr.c
@@ -26,6 +26,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/mm.h>
#include <linux/slab.h>
#include "ehea.h"
@@ -45,7 +47,7 @@ static void *hw_qpageit_get_inc(struct hw_queue *queue)
queue->current_q_offset -= queue->pagesize;
retvalue = NULL;
} else if (((u64) retvalue) & (EHEA_PAGESIZE-1)) {
- ehea_error("not on pageboundary");
+ pr_err("not on pageboundary\n");
retvalue = NULL;
}
return retvalue;
@@ -58,15 +60,15 @@ static int hw_queue_ctor(struct hw_queue *queue, const u32 nr_of_pages,
int i, k;
if ((pagesize > PAGE_SIZE) || (!pages_per_kpage)) {
- ehea_error("pagesize conflict! kernel pagesize=%d, "
- "ehea pagesize=%d", (int)PAGE_SIZE, (int)pagesize);
+ pr_err("pagesize conflict! kernel pagesize=%d, ehea pagesize=%d\n",
+ (int)PAGE_SIZE, (int)pagesize);
return -EINVAL;
}
queue->queue_length = nr_of_pages * pagesize;
queue->queue_pages = kmalloc(nr_of_pages * sizeof(void *), GFP_KERNEL);
if (!queue->queue_pages) {
- ehea_error("no mem for queue_pages");
+ pr_err("no mem for queue_pages\n");
return -ENOMEM;
}
@@ -130,7 +132,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
cq = kzalloc(sizeof(*cq), GFP_KERNEL);
if (!cq) {
- ehea_error("no mem for cq");
+ pr_err("no mem for cq\n");
goto out_nomem;
}
@@ -147,7 +149,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
hret = ehea_h_alloc_resource_cq(adapter->handle, &cq->attr,
&cq->fw_handle, &cq->epas);
if (hret != H_SUCCESS) {
- ehea_error("alloc_resource_cq failed");
+ pr_err("alloc_resource_cq failed\n");
goto out_freemem;
}
@@ -159,7 +161,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
for (counter = 0; counter < cq->attr.nr_pages; counter++) {
vpage = hw_qpageit_get_inc(&cq->hw_queue);
if (!vpage) {
- ehea_error("hw_qpageit_get_inc failed");
+ pr_err("hw_qpageit_get_inc failed\n");
goto out_kill_hwq;
}
@@ -168,9 +170,8 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
0, EHEA_CQ_REGISTER_ORIG,
cq->fw_handle, rpage, 1);
if (hret < H_SUCCESS) {
- ehea_error("register_rpage_cq failed ehea_cq=%p "
- "hret=%llx counter=%i act_pages=%i",
- cq, hret, counter, cq->attr.nr_pages);
+ pr_err("register_rpage_cq failed ehea_cq=%p hret=%llx counter=%i act_pages=%i\n",
+ cq, hret, counter, cq->attr.nr_pages);
goto out_kill_hwq;
}
@@ -178,14 +179,14 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
vpage = hw_qpageit_get_inc(&cq->hw_queue);
if ((hret != H_SUCCESS) || (vpage)) {
- ehea_error("registration of pages not "
- "complete hret=%llx\n", hret);
+ pr_err("registration of pages not complete hret=%llx\n",
+ hret);
goto out_kill_hwq;
}
} else {
if (hret != H_PAGE_REGISTERED) {
- ehea_error("CQ: registration of page failed "
- "hret=%llx\n", hret);
+ pr_err("CQ: registration of page failed hret=%llx\n",
+ hret);
goto out_kill_hwq;
}
}
@@ -241,7 +242,7 @@ int ehea_destroy_cq(struct ehea_cq *cq)
}
if (hret != H_SUCCESS) {
- ehea_error("destroy CQ failed");
+ pr_err("destroy CQ failed\n");
return -EIO;
}
@@ -259,7 +260,7 @@ struct ehea_eq *ehea_create_eq(struct ehea_adapter *adapter,
eq = kzalloc(sizeof(*eq), GFP_KERNEL);
if (!eq) {
- ehea_error("no mem for eq");
+ pr_err("no mem for eq\n");
return NULL;
}
@@ -272,21 +273,21 @@ struct ehea_eq *ehea_create_eq(struct ehea_adapter *adapter,
hret = ehea_h_alloc_resource_eq(adapter->handle,
&eq->attr, &eq->fw_handle);
if (hret != H_SUCCESS) {
- ehea_error("alloc_resource_eq failed");
+ pr_err("alloc_resource_eq failed\n");
goto out_freemem;
}
ret = hw_queue_ctor(&eq->hw_queue, eq->attr.nr_pages,
EHEA_PAGESIZE, sizeof(struct ehea_eqe));
if (ret) {
- ehea_error("can't allocate eq pages");
+ pr_err("can't allocate eq pages\n");
goto out_freeres;
}
for (i = 0; i < eq->attr.nr_pages; i++) {
vpage = hw_qpageit_get_inc(&eq->hw_queue);
if (!vpage) {
- ehea_error("hw_qpageit_get_inc failed");
+ pr_err("hw_qpageit_get_inc failed\n");
hret = H_RESOURCE;
goto out_kill_hwq;
}
@@ -370,7 +371,7 @@ int ehea_destroy_eq(struct ehea_eq *eq)
}
if (hret != H_SUCCESS) {
- ehea_error("destroy EQ failed");
+ pr_err("destroy EQ failed\n");
return -EIO;
}
@@ -395,7 +396,7 @@ int ehea_qp_alloc_register(struct ehea_qp *qp, struct hw_queue *hw_queue,
for (cnt = 0; cnt < nr_pages; cnt++) {
vpage = hw_qpageit_get_inc(hw_queue);
if (!vpage) {
- ehea_error("hw_qpageit_get_inc failed");
+ pr_err("hw_qpageit_get_inc failed\n");
goto out_kill_hwq;
}
rpage = virt_to_abs(vpage);
@@ -403,7 +404,7 @@ int ehea_qp_alloc_register(struct ehea_qp *qp, struct hw_queue *hw_queue,
0, h_call_q_selector,
qp->fw_handle, rpage, 1);
if (hret < H_SUCCESS) {
- ehea_error("register_rpage_qp failed");
+ pr_err("register_rpage_qp failed\n");
goto out_kill_hwq;
}
}
@@ -432,7 +433,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,
qp = kzalloc(sizeof(*qp), GFP_KERNEL);
if (!qp) {
- ehea_error("no mem for qp");
+ pr_err("no mem for qp\n");
return NULL;
}
@@ -441,7 +442,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,
hret = ehea_h_alloc_resource_qp(adapter->handle, init_attr, pd,
&qp->fw_handle, &qp->epas);
if (hret != H_SUCCESS) {
- ehea_error("ehea_h_alloc_resource_qp failed");
+ pr_err("ehea_h_alloc_resource_qp failed\n");
goto out_freemem;
}
@@ -455,7 +456,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,
init_attr->act_wqe_size_enc_sq, adapter,
0);
if (ret) {
- ehea_error("can't register for sq ret=%x", ret);
+ pr_err("can't register for sq ret=%x\n", ret);
goto out_freeres;
}
@@ -465,7 +466,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,
init_attr->act_wqe_size_enc_rq1,
adapter, 1);
if (ret) {
- ehea_error("can't register for rq1 ret=%x", ret);
+ pr_err("can't register for rq1 ret=%x\n", ret);
goto out_kill_hwsq;
}
@@ -476,7 +477,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,
init_attr->act_wqe_size_enc_rq2,
adapter, 2);
if (ret) {
- ehea_error("can't register for rq2 ret=%x", ret);
+ pr_err("can't register for rq2 ret=%x\n", ret);
goto out_kill_hwr1q;
}
}
@@ -488,7 +489,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,
init_attr->act_wqe_size_enc_rq3,
adapter, 3);
if (ret) {
- ehea_error("can't register for rq3 ret=%x", ret);
+ pr_err("can't register for rq3 ret=%x\n", ret);
goto out_kill_hwr2q;
}
}
@@ -553,7 +554,7 @@ int ehea_destroy_qp(struct ehea_qp *qp)
}
if (hret != H_SUCCESS) {
- ehea_error("destroy QP failed");
+ pr_err("destroy QP failed\n");
return -EIO;
}
@@ -842,7 +843,7 @@ static u64 ehea_reg_mr_section(int top, int dir, int idx, u64 *pt,
(hret != H_PAGE_REGISTERED)) {
ehea_h_free_resource(adapter->handle, mr->handle,
FORCE_FREE);
- ehea_error("register_rpage_mr failed");
+ pr_err("register_rpage_mr failed\n");
return hret;
}
}
@@ -896,7 +897,7 @@ int ehea_reg_kernel_mr(struct ehea_adapter *adapter, struct ehea_mr *mr)
pt = (void *)get_zeroed_page(GFP_KERNEL);
if (!pt) {
- ehea_error("no mem");
+ pr_err("no mem\n");
ret = -ENOMEM;
goto out;
}
@@ -906,14 +907,14 @@ int ehea_reg_kernel_mr(struct ehea_adapter *adapter, struct ehea_mr *mr)
&mr->handle, &mr->lkey);
if (hret != H_SUCCESS) {
- ehea_error("alloc_resource_mr failed");
+ pr_err("alloc_resource_mr failed\n");
ret = -EIO;
goto out;
}
if (!ehea_bmap) {
ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE);
- ehea_error("no busmap available");
+ pr_err("no busmap available\n");
ret = -EIO;
goto out;
}
@@ -929,7 +930,7 @@ int ehea_reg_kernel_mr(struct ehea_adapter *adapter, struct ehea_mr *mr)
if (hret != H_SUCCESS) {
ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE);
- ehea_error("registering mr failed");
+ pr_err("registering mr failed\n");
ret = -EIO;
goto out;
}
@@ -952,7 +953,7 @@ int ehea_rem_mr(struct ehea_mr *mr)
hret = ehea_h_free_resource(mr->adapter->handle, mr->handle,
FORCE_FREE);
if (hret != H_SUCCESS) {
- ehea_error("destroy MR failed");
+ pr_err("destroy MR failed\n");
return -EIO;
}
@@ -987,14 +988,14 @@ void print_error_data(u64 *data)
length = EHEA_PAGESIZE;
if (type == EHEA_AER_RESTYPE_QP)
- ehea_error("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, "
- "port=%llX", resource, data[6], data[12], data[22]);
+ pr_err("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, port=%llX\n",
+ resource, data[6], data[12], data[22]);
else if (type == EHEA_AER_RESTYPE_CQ)
- ehea_error("CQ (resource=%llX) state: AER=0x%llX", resource,
- data[6]);
+ pr_err("CQ (resource=%llX) state: AER=0x%llX\n",
+ resource, data[6]);
else if (type == EHEA_AER_RESTYPE_EQ)
- ehea_error("EQ (resource=%llX) state: AER=0x%llX", resource,
- data[6]);
+ pr_err("EQ (resource=%llX) state: AER=0x%llX\n",
+ resource, data[6]);
ehea_dump(data, length, "error data");
}
@@ -1008,7 +1009,7 @@ u64 ehea_error_data(struct ehea_adapter *adapter, u64 res_handle,
rblock = (void *)get_zeroed_page(GFP_KERNEL);
if (!rblock) {
- ehea_error("Cannot allocate rblock memory.");
+ pr_err("Cannot allocate rblock memory\n");
goto out;
}
@@ -1020,9 +1021,9 @@ u64 ehea_error_data(struct ehea_adapter *adapter, u64 res_handle,
*aerr = rblock[12];
print_error_data(rblock);
} else if (ret == H_R_STATE) {
- ehea_error("No error data available: %llX.", res_handle);
+ pr_err("No error data available: %llX\n", res_handle);
} else
- ehea_error("Error data could not be fetched: %llX", res_handle);
+ pr_err("Error data could not be fetched: %llX\n", res_handle);
free_page((unsigned long)rblock);
out:
--
1.7.3.3.398.g0b0cd.dirty
^ permalink raw reply related
* Re: TSO/GRO/LRO/somethingO breaks LVS on 2.6.36
From: Simon Kirby @ 2010-12-09 2:35 UTC (permalink / raw)
To: Simon Horman; +Cc: Eric Dumazet, netdev
In-Reply-To: <20101203123617.GA6993@verge.net.au>
On Fri, Dec 03, 2010 at 09:36:19PM +0900, Simon Horman wrote:
> On Fri, Dec 03, 2010 at 12:29:03PM +0100, Eric Dumazet wrote:
> > Le vendredi 03 d??cembre 2010 ?? 02:34 -0800, Simon Kirby a ??crit :
> > > Hello!
> > >
> > > We upgraded some LVS (DR) servers from 2.6.35 to 2.6.36 on tg3 cards
> > > (partno(BCM95721) rev 4201) with VLAN tags in use, to think that
> > > everything looked great, but in fact...
> > >
> > > LVS was receiving magically-merged TCP packets which it tried to forward
> > > on to the real server, only to get annoyed at itself for trying to
> > > forward a packet bigger than the device MTU:
> > >
> > > IP A.47376 > B.529: . 175488:176936(1448) ack 1 win 92 <nop,nop,timestamp 52737308 29656081>
> > > IP A.47376 > B.529: . 176936:179832(2896) ack 1 win 92 <nop,nop,timestamp 52737325 29656098>
> > > IP B > A: ICMP B unreachable - need to frag (mtu 1500), length 556
> > >
> >
> > Hi Simon
> >
> > This is a tcpdump on A ?
> > Could you take it also on B ?
> >
> > tcpdump displays large buffers, but they should be split (of course)
> > when sent on wire.
I assume you don't need this anymore since the problem was figured out?
Otherwise, let me know.
> > > This caused packet loss for any merged frames, which caused abysmal
> > > performance for uploads via the LVS server. Local performance to or
> > > from the box is still fine, because the stack doesn't care, only the
> > > forwarding part of LVS is running into the problem.
> > >
> > > Furthermore, disabling _everything_ reported by ethtool -k doesn't seem
> > > to change the result, even if I down/up the interface after, and even if
> > > I try on every single interface including the VLANned ones. This seems
> > > to be another bug. Reverting to 2.6.35 makes it all work again.
> > >
> > > Possibly related to commit 7fe876af921d1d2bc8353e0062c10ff35e902653
> > >
> > > So how should this be fixed? Should LVS be taught to fragment, or must
> > > we disable the merging in this case? It seems like it would work well if
> > > the sending side could do the same offload in reverse, but I'm not sure
> > > if that would be possible.
> > >
> > > Simon-
> >
> >
> > I believe Simon Horman has some patches for GRO and LVS.
> >
> > Please send the results of "ethtool -k eth0" on all your nics / vlans ?
> >
> > For TSO, I am not sure why and where it could matter...
>
> There is a patch to teach LVS how to cope with GRO in nf-next-2.6
> and I expect it to be included in 2.6.38. The patch is "ipvs: allow
> transmit of GRO aggregated skbs" and perhaps it should be considered
> for 2.6.37 and stable. In general the work around is to disable GRO.
>
> The patch does not resolve the incompatibility of LVS with LRO.
> The work around there is to disable LRO. I'm not entirely sure
> how to teach LVS to disable LRO automatically, or if its desirable.
Yeah, things will still break if the interfaces have mismatched GRO
support, etc.
It would be nice if it could be all smart about it, but I don't see how
this could be done sanely, as it doesn't know if the destination
interface could support GRO transmission until it has gone through the
LVS processing. Would software GRO be faster on transmission be faster
than no GRO at all?
> Simon, you mention that you disabled everything with ethtool, but the
> tcpdump above shows a 2896 byte packet, which seems that GRO (or LRO?) is
> active. So perhaps as you speculate that is a bug
Right. So, on 2.6.35, ethtool shows:
# ethtool -k eth1
Offload parameters for eth1:
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp segmentation offload: on
udp fragmentation offload: off
generic segmentation offload: on
large receive offload: off
# ethtool -k eth1.39
Offload parameters for eth1.39:
rx-checksumming: on
tx-checksumming: off
scatter-gather: off
tcp segmentation offload: off
udp fragmentation offload: off
generic segmentation offload: off
large receive offload: off
On 2.6.36, ethtool shows:
# ethtool -k eth1
Offload parameters for eth1:
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp segmentation offload: on
udp fragmentation offload: off
generic segmentation offload: on
large receive offload: off
# ethtool -k eth1.39
Offload parameters for eth1.39:
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp segmentation offload: on
udp fragmentation offload: off
generic segmentation offload: on
large receive offload: off
And if I set it with ethtool -K eth1.39 gso off; ethtool -K eth1 gso off,
it says "off", but I still see merged frames, as verified with an nc <
/dev/zero and tcpdump -i any -n 'length > 1500'.
> I will prepare a backport of the "ipvs: allow transmit of GRO aggregated
> skbs" patch to v2.6.36 and post it shortly. Testing to see if that
> resolves the problem that you are seeing would probably be a good start.
I can test this in our case, and it should specifically work on the
servers we were seeing the problem on, but it still needs some
complicated logic to be safe for all cases (like when LVS decides to
route out an interface without GRO). Anyway, thanks!
Simon-
^ permalink raw reply
* linux-next: build failure after merge of the net tree
From: Stephen Rothwell @ 2010-12-09 2:28 UTC (permalink / raw)
To: David Miller, netdev; +Cc: linux-next, linux-kernel, Oliver Hartkopp
[-- Attachment #1: Type: text/plain, Size: 529 bytes --]
Hi all,
After merging the net tree, today's linux-next build (x86_64 allmodconfig)
failed like this:
drivers/net/can/slcan.c: In function 'slcan_open':
drivers/net/can/slcan.c:568: error: dereferencing pointer to incomplete type
Caused by commit a1044e36e457fb6dbdf90ce756d578b251d99b5e ("can: add
slcan driver for serial/USB-serial CAN adapters").
I have used the net tree from next-20101208 for today.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* Re: NULL dereference in econet AUN-over-UDP receive
From: David Miller @ 2010-12-09 2:02 UTC (permalink / raw)
To: eric.dumazet; +Cc: nelhage, netdev
In-Reply-To: <1291858667.2795.16.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 09 Dec 2010 02:37:47 +0100
> Le mercredi 08 décembre 2010 à 19:30 -0500, Nelson Elhage a écrit :
>> While testing one of my econet reproducers on a patched kernel, I triggered a
>> NULL pointer dereference in the econet AUN-over-UDP receive path. Upon further
>> investigation, I now suspect that this code path hasn't worked at all in years.
>>
>> A copy of the oops is below for your reference, but here's my analysis:
>>
>> When aun_data_available receives a data packet (ah->code == 2), it calls
>> aun_incoming to process the skb. The start of aun_incoming looks like:
>>
>> static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len)
>> {
>> struct iphdr *ip = ip_hdr(skb);
>> unsigned char stn = ntohl(ip->saddr) & 0xff;
>> struct sock *sk = NULL;
>> struct sk_buff *newskb;
>> ---> struct ec_device *edev = skb->dev->ec_ptr;
>>
>
> This can be changed to use skb_dst(skb)->dev instead
>
> struct dst *dst = skb_dst(skb);
>
> if (dst) {
> dev = dst->dev;
> ...
> }
Nelson please test if this patch fixes your crash:
econet: Fix crash in aun_incoming().
Unconditional use of skb->dev won't work here,
try to fetch the econet device via skb_dst()->dev
instead.
Suggested by Eric Dumazet.
Reported-by: Nelson Elhage <nelhage@ksplice.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index f180371..15dcc1a 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -851,9 +851,13 @@ static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len)
{
struct iphdr *ip = ip_hdr(skb);
unsigned char stn = ntohl(ip->saddr) & 0xff;
+ struct dst_entry *dst = skb_dst(skb);
+ struct ec_device *edev = NULL;
struct sock *sk = NULL;
struct sk_buff *newskb;
- struct ec_device *edev = skb->dev->ec_ptr;
+
+ if (dst)
+ edev = dst->dev->ec_ptr;
if (! edev)
goto bad;
^ permalink raw reply related
* Re: [PATCH 0/5 V2] Firewire networking assorted fixes
From: Maxim Levitsky @ 2010-12-09 1:42 UTC (permalink / raw)
To: linux1394-devel; +Cc: Stefan Richter, netdev
In-Reply-To: <1291779177.32420.8.camel@maxim-laptop>
[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]
On Wed, 2010-12-08 at 05:32 +0200, Maxim Levitsky wrote:
> On Mon, 2010-11-29 at 04:09 +0200, Maxim Levitsky wrote:
> > Hi,
> >
> > This is updated version of the patches.
> > I updated the changelogs, addressed comments on patch #2
> >
> > Best regards,
> > Maxim Levitsky
> >
>
> Today I have achieved the ultimate goal,
> full support of firewire networking via NetworkManager.
>
> Currently it is patched with few hacks but much less that I expected.
>
> I also had to patch dhclient as it unfortunately sends raw packets
> together with hardware header (ethernet of course...)
>
> I will soon clean up these hacks to turn them into patches and send to
> developers.
>
> The kernel side needs only the attached patch.
> It adds the link state detection to firewire-net
>
> Just for fun, this is screenshot that proves that NM works:
> http://img210.imageshack.us/img210/6019/screenshotdjk.png
And cleaned up patches that add the support attached.
Will send these to NM and dhcp ML soon.
Best regards,
Maxim Levitsky
[-- Attachment #2: 0001-Add-support-for-RFC2855-DHCP-over-IEEE1394.patch --]
[-- Type: text/x-patch, Size: 9407 bytes --]
>From 09750594f8c861d58762969d4fe1f1b3b81b0b5f Mon Sep 17 00:00:00 2001
From: Maxim Levitsky <maximlevitsky@gmail.com>
Date: Thu, 9 Dec 2010 02:49:23 +0200
Subject: [PATCH] Add support for RFC2855, DHCP over IEEE1394
---
client/dhclient.c | 18 ++++++++++
common/Makefile.dist | 6 ++-
common/discover.c | 15 ++++++--
common/firewire.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++
common/lpf.c | 9 ++++-
common/packet.c | 13 +++++++
includes/dhcpd.h | 7 ++++
7 files changed, 151 insertions(+), 7 deletions(-)
create mode 100644 common/firewire.c
diff --git a/client/dhclient.c b/client/dhclient.c
index a9a0993..5f079b3 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -1890,6 +1890,24 @@ void make_client_options (client, lease, type, sid, rip, prl, op)
client -> requested_address.len = 0;
}
+#ifdef HAVE_ARPHRD_IEEE1394
+ /* Per RFC2855, send hardware address inside client identifier
+ by default*/
+ if (client -> interface -> hw_address.hbuf [0] == ARPHRD_IEEE1394) {
+ i = DHO_DHCP_CLIENT_IDENTIFIER;
+ if (!(option_code_hash_lookup(&option, dhcp_universe.code_hash,
+ &i, 0, MDL) &&
+ make_const_option_cache(&oc, NULL,
+ &client -> interface -> hw_address.hbuf [1], 8,
+ option, MDL)))
+ log_error ("can't make requested address cache.");
+ else {
+ save_option (&dhcp_universe, *op, oc);
+ option_cache_dereference (&oc, MDL);
+ }
+ option_dereference(&option, MDL);
+ }
+#endif
i = DHO_DHCP_MESSAGE_TYPE;
if (!(option_code_hash_lookup(&option, dhcp_universe.code_hash, &i, 0,
MDL) &&
diff --git a/common/Makefile.dist b/common/Makefile.dist
index 2b9faee..52f280b 100644
--- a/common/Makefile.dist
+++ b/common/Makefile.dist
@@ -23,11 +23,13 @@
CATMANPAGES = dhcp-options.cat5 dhcp-eval.cat5
SEDMANPAGES = dhcp-options.man5 dhcp-eval.man5
SRC = raw.c parse.c nit.c icmp.c dispatch.c conflex.c upf.c bpf.c socket.c \
- lpf.c dlpi.c packet.c tr.c ethernet.c memory.c print.c options.c \
+ lpf.c dlpi.c packet.c tr.c ethernet.c firewire.c \
+ memory.c print.c options.c \
inet.c tree.c tables.c alloc.c fddi.c ctrace.c dns.c resolv.c \
execute.c discover.c comapi.c
OBJ = raw.o parse.o nit.o icmp.o dispatch.o conflex.o upf.o bpf.o socket.o \
- lpf.o dlpi.o packet.o tr.o ethernet.o memory.o print.o options.o \
+ lpf.o dlpi.o packet.o tr.o ethernet.o firewire.o \
+ memory.o print.o options.o \
inet.o tree.o tables.o alloc.o fddi.o ctrace.o dns.o resolv.o \
execute.o discover.o comapi.o
MAN = dhcp-options.5 dhcp-eval.5
diff --git a/common/discover.c b/common/discover.c
index 69d23b1..979b1c4 100644
--- a/common/discover.c
+++ b/common/discover.c
@@ -471,15 +471,22 @@ void discover_interfaces (state)
case ARPHRD_SIT:
/* ignore IPv6-in-IPv4 interfaces. */
#endif
-#ifdef HAVE_ARPHRD_IEEE1394
- case ARPHRD_IEEE1394:
- /* ignore IEEE1394 interfaces. */
-#endif
#ifdef HAVE_ARPHRD_LOOPBACK
case ARPHRD_LOOPBACK:
/* ignore loopback interface */
break;
#endif
+#ifdef HAVE_ARPHRD_IEEE1394
+ case ARPHRD_IEEE1394:
+ /* According to RFC2855, we set hlen to 0,
+ but store hardware address in the client ID,
+ so store hardware address but set len to 0 */
+ tmp -> hw_address.hlen = 1;
+ tmp -> hw_address.hbuf [0] = ARPHRD_IEEE1394;
+ memcpy (&tmp -> hw_address.hbuf [1], sa.sa_data, 8);
+ break;
+#endif
+
case ARPHRD_ETHER:
tmp -> hw_address.hlen = 7;
diff --git a/common/firewire.c b/common/firewire.c
new file mode 100644
index 0000000..f11efd2
--- /dev/null
+++ b/common/firewire.c
@@ -0,0 +1,90 @@
+/* firewire.c
+
+Based on ethernet.c
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-2003 by Internet Software Consortium
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Internet Systems Consortium, Inc.
+ * 950 Charter Street
+ * Redwood City, CA 94063
+ * <info@isc.org>
+ * https://www.isc.org/
+ *
+ * This software has been written for Internet Systems Consortium
+ * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
+ * To learn more about Internet Systems Consortium, see
+ * ``https://www.isc.org/''. To learn more about Vixie Enterprises,
+ * see ``http://www.vix.com''. To learn more about Nominum, Inc., see
+ * ``http://www.nominum.com''.
+ */
+
+#ifndef lint
+static char copyright[] =
+"$Id: firewire.c,v 1.8.140.1 2009/07/23 21:43:33 sar Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
+#endif /* not lint */
+
+#include "dhcpd.h"
+
+#if defined (PACKET_ASSEMBLY) || defined (PACKET_DECODING)
+#include "includes/netinet/if_ether.h"
+#endif /* PACKET_ASSEMBLY || PACKET_DECODING */
+
+#define FWNET_ALEN 8
+struct fwnet_header {
+ unsigned char h_dest[FWNET_ALEN]; /* destination address */
+ uint16_t h_proto; /* packet type ID field */
+} __attribute__((packed));
+
+#if defined (PACKET_ASSEMBLY)
+/* Assemble an hardware header... */
+
+void assemble_fw_header (struct interface_info *interface,
+ unsigned char *buf,
+ unsigned *bufix,
+ struct hardware *to)
+{
+ struct fwnet_header hdr;
+ memset(hdr.h_dest, 0xFF, FWNET_ALEN);
+ hdr.h_proto = htons (ETHERTYPE_IP);
+ memcpy (&buf [*bufix], &hdr, sizeof(hdr));
+ *bufix += sizeof(hdr);
+}
+
+#endif /* PACKET_ASSEMBLY */
+
+#ifdef PACKET_DECODING
+/* Decode a hardware header... */
+
+ssize_t decode_fw_header(struct interface_info *interface,
+ unsigned char *buf,
+ unsigned bufix,
+ struct hardware *from)
+{
+ struct fwnet_header hdr;
+ memcpy(&hdr, buf + bufix, sizeof(hdr));
+
+#ifdef USERLAND_FILTER
+ if (ntohs (hdr.h_proto) != ETHERTYPE_IP)
+ return -1;
+#endif
+
+ memcpy(&from->hbuf[1], hdr.h_dest, FWNET_ALEN);
+ from->hlen = FWNET_ALEN + 1;
+ return sizeof(hdr);
+}
+
+#endif /* PACKET_DECODING */
diff --git a/common/lpf.c b/common/lpf.c
index 5922660..a3fafef 100644
--- a/common/lpf.c
+++ b/common/lpf.c
@@ -181,6 +181,13 @@ void if_register_receive (info)
lpf_tr_filter_setup (info);
else
#endif
+#if defined (HAVE_ARPHRD_IEEE1394)
+ /* FIXME: this currently piggybacks on TR no-op filter, as
+ generic filter don't work for FW */
+ if (info -> hw_address.hbuf[0] == ARPHRD_IEEE1394)
+ lpf_tr_filter_setup (info);
+ else
+#endif
lpf_gen_filter_setup (info);
if (!quiet_interface_discovery)
@@ -245,7 +252,7 @@ static void lpf_gen_filter_setup (info)
}
}
-#if defined (HAVE_TR_SUPPORT)
+#if defined (HAVE_TR_SUPPORT) || defined (HAVE_ARPHRD_IEEE1394)
static void lpf_tr_filter_setup (info)
struct interface_info *info;
{
diff --git a/common/packet.c b/common/packet.c
index 4c878a6..378114e 100644
--- a/common/packet.c
+++ b/common/packet.c
@@ -111,6 +111,8 @@ void assemble_hw_header (interface, buf, bufix, to)
unsigned *bufix;
struct hardware *to;
{
+
+
#if defined (HAVE_TR_SUPPORT)
if (interface -> hw_address.hbuf [0] == HTYPE_IEEE802)
assemble_tr_header (interface, buf, bufix, to);
@@ -121,6 +123,11 @@ void assemble_hw_header (interface, buf, bufix, to)
assemble_fddi_header (interface, buf, bufix, to);
else
#endif
+#if defined (HAVE_ARPHRD_IEEE1394)
+ if (interface -> hw_address.hbuf [0] == ARPHRD_IEEE1394)
+ assemble_fw_header(interface, buf, bufix, to);
+#endif
+ else
assemble_ethernet_header (interface, buf, bufix, to);
}
@@ -198,6 +205,7 @@ ssize_t decode_hw_header (interface, buf, bufix, from)
unsigned bufix;
struct hardware *from;
{
+
#if defined (HAVE_TR_SUPPORT)
if (interface -> hw_address.hbuf [0] == HTYPE_IEEE802)
return decode_tr_header (interface, buf, bufix, from);
@@ -208,6 +216,11 @@ ssize_t decode_hw_header (interface, buf, bufix, from)
return decode_fddi_header (interface, buf, bufix, from);
else
#endif
+#if defined (HAVE_ARPHRD_IEEE1394)
+ if (interface -> hw_address.hbuf [0] == ARPHRD_IEEE1394)
+ return decode_fw_header (interface, buf, bufix, from);
+#endif
+ else
return decode_ethernet_header (interface, buf, bufix, from);
}
diff --git a/includes/dhcpd.h b/includes/dhcpd.h
index 50b899c..95b119a 100644
--- a/includes/dhcpd.h
+++ b/includes/dhcpd.h
@@ -2135,6 +2135,13 @@ ssize_t decode_tr_header PROTO ((struct interface_info *,
unsigned char *,
unsigned, struct hardware *));
+/* firewire.c */
+void assemble_fw_header PROTO ((struct interface_info *, unsigned char *,
+ unsigned *, struct hardware *));
+ssize_t decode_fw_header PROTO ((struct interface_info *,
+ unsigned char *,
+ unsigned, struct hardware *));
+
/* dhxpxlt.c */
void convert_statement PROTO ((struct parse *));
void convert_host_statement PROTO ((struct parse *, jrefproto));
--
1.7.1
[-- Attachment #3: 0001-NM-allow-use-of-IPV4-over-firewire.patch --]
[-- Type: text/x-patch, Size: 1097 bytes --]
>From 93129738ca8450899e416420f630aee17c8301d5 Mon Sep 17 00:00:00 2001
From: Maxim Levitsky <maximlevitsky@gmail.com>
Date: Thu, 9 Dec 2010 00:30:55 +0200
Subject: [PATCH] NM: allow use of IPV4 over firewire
Don't ignore these devices since NM
works just fine with them iff the dhclient
works.
Patches are posted to make it work with
firewire networking link
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
src/nm-udev-manager.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/nm-udev-manager.c b/src/nm-udev-manager.c
index ff0ef68..3cd2970 100644
--- a/src/nm-udev-manager.c
+++ b/src/nm-udev-manager.c
@@ -408,7 +408,9 @@ net_add (NMUdevManager *self, GUdevDevice *device)
g_return_if_fail (device != NULL);
etype = g_udev_device_get_sysfs_attr_as_int (device, "type");
- if (etype != 1) {
+
+ /* firewire devices are similiar to ethernet, so allow them too */
+ if (etype != 1 && etype != 24) {
nm_log_dbg (LOGD_HW, "ignoring interface with type %d", etype);
return; /* Not using ethernet encapsulation, don't care */
}
--
1.7.1
^ permalink raw reply related
* Re: NULL dereference in econet AUN-over-UDP receive
From: Eric Dumazet @ 2010-12-09 1:37 UTC (permalink / raw)
To: Nelson Elhage; +Cc: netdev
In-Reply-To: <20101209003015.GA27906@ksplice.com>
Le mercredi 08 décembre 2010 à 19:30 -0500, Nelson Elhage a écrit :
> While testing one of my econet reproducers on a patched kernel, I triggered a
> NULL pointer dereference in the econet AUN-over-UDP receive path. Upon further
> investigation, I now suspect that this code path hasn't worked at all in years.
>
> A copy of the oops is below for your reference, but here's my analysis:
>
> When aun_data_available receives a data packet (ah->code == 2), it calls
> aun_incoming to process the skb. The start of aun_incoming looks like:
>
> static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len)
> {
> struct iphdr *ip = ip_hdr(skb);
> unsigned char stn = ntohl(ip->saddr) & 0xff;
> struct sock *sk = NULL;
> struct sk_buff *newskb;
> ---> struct ec_device *edev = skb->dev->ec_ptr;
>
This can be changed to use skb_dst(skb)->dev instead
struct dst *dst = skb_dst(skb);
if (dst) {
dev = dst->dev;
...
}
>
> However, as far as I can tell, skb->dev is always NULL, meaning that that last
> line will fault immediately before this function can do any real work.
>
> In particular, 'skb' comes from "skb = skb_recv_datagram(sk, 0, 1, &err)" in
> aun_data_available. skb_recv_datagram() pulls skb's off of sk->sk_receive_queue,
> and (unless I'm missing something), the only way things get on that queue is via
> sock_queue_rcv_skbsock_queue_rcv_skb, which explicitly sets skb->dev = NULL.
>
> So, if I understand this all correctly, receiving AUN-over-UDP just plain hasn't
> worked at all for a long time -- I can reproduce this crash on 2.6.12, which is
> the earliest I've tested, and from reading code I suspect it's been broken at
> least since 2.6.0.
>
> I am not an expert in the networking subsystem, though, so if I am missing some
> way that this code does actually work, please feel to correct me.
>
> If, on the other hand, this code really hasn't worked in years, and no one
> noticed, I wonder if we should reconsider moving this code into staging and
> eventually out entirely, at least unless any real users step forward.
>
> - Nelson
>
>
> ---- snip here ----
>
> BUG: unable to handle kernel NULL pointer dereference at 0000000000000240
> IP: [<ffffffff813a303e>] aun_data_available+0xb3/0x28d
> PGD e818067 PUD e819067 PMD 0
> Oops: 0000 [#1] SMP
> last sysfs file: /sys/devices/virtual/net/lo/operstate
> CPU 0
> Modules linked in:
>
> Pid: 0, comm: swapper Not tainted 2.6.37-rc3 #39 /Bochs
> RIP: 0010:[<ffffffff813a303e>] [<ffffffff813a303e>] aun_data_available+0xb3/0x28d
> RSP: 0018:ffff88000fc03b00 EFLAGS: 00010246
> RAX: 0000000000000000 RBX: ffff88000fc03b3c RCX: ffff88000e808800
> RDX: 0000000000000002 RSI: 0000000000000286 RDI: ffff88000e8060d4
> RBP: ffff88000fc03b70 R08: 0000000000000003 R09: 0000000000000002
> R10: ffff88000e69ac00 R11: 00000000ffffffff R12: ffff88000e80886a
> R13: ffff88000e439500 R14: ffff88000e8060d4 R15: ffff88000e80884e
> FS: 0000000000000000(0000) GS:ffff88000fc00000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> CR2: 0000000000000240 CR3: 000000000e813000 CR4: 00000000000006f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> Process swapper (pid: 0, threadinfo ffffffff81600000, task ffffffff8162b020)
> Stack:
> ffff88000fc03ba0 ffffffff8131d614 ffff880000000010 ffff88000e806000
> 0200000100000000 0202000a00000000 ffffc90000086d48 0000000000000246
> ffff88000fc03b70 ffff88000e806000 ffff88000e439500 0000000000000000
> Call Trace:
> <IRQ>
> [<ffffffff8131d614>] ? rt_intern_hash+0x5de/0x606
> [<ffffffff812f7839>] sock_queue_rcv_skb+0x168/0x187
> [<ffffffff81325641>] ip_queue_rcv_skb+0x45/0x4c
> [<ffffffff81031aa0>] ? try_to_wake_up+0x265/0x277
> [<ffffffff8133ee23>] __udp_queue_rcv_skb+0x50/0xb9
> [<ffffffff813403b0>] udp_queue_rcv_skb+0x1ad/0x26e
> [<ffffffff81340b67>] __udp4_lib_rcv+0x30a/0x50d
> [<ffffffff81340d7f>] udp_rcv+0x15/0x17
> [<ffffffff813206b1>] ip_local_deliver+0x12d/0x1d0
> [<ffffffff81320546>] ip_rcv+0x4f2/0x530
> [<ffffffff81300fb3>] __netif_receive_skb+0x34d/0x377
> [<ffffffff81301c1d>] netif_receive_skb+0x67/0x6e
> [<ffffffff812fb763>] ? __netdev_alloc_skb+0x1d/0x3a
> [<ffffffff8129a189>] cp_rx_poll+0x2e8/0x3ab
> [<ffffffff81007414>] ? nommu_map_page+0x0/0xa0
> [<ffffffff81302308>] net_rx_action+0xa7/0x215
> [<ffffffff8103c0f9>] __do_softirq+0xcd/0x18c
> [<ffffffff81002e4c>] call_softirq+0x1c/0x28
> [<ffffffff810042c3>] do_softirq+0x33/0x68
> [<ffffffff8103bc61>] irq_exit+0x36/0x38
> [<ffffffff810039a8>] do_IRQ+0xa3/0xba
> [<ffffffff813be8d3>] ret_from_intr+0x0/0xa
> <EOI>
> [<ffffffff810089a1>] ? default_idle+0x62/0x7a
> [<ffffffff813c1882>] ? atomic_notifier_call_chain+0x13/0x15
> [<ffffffff81001321>] cpu_idle+0x54/0xbe
> [<ffffffff813a3d49>] rest_init+0x6d/0x6f
> [<ffffffff8169cc85>] start_kernel+0x332/0x33d
> [<ffffffff8169c2a8>] x86_64_start_reservations+0xb8/0xbc
> [<ffffffff8169c39e>] x86_64_start_kernel+0xf2/0xf9
> Code: 00 80 fa 04 0f 84 bb 01 00 00 80 fa 02 0f 85 c3 01 00 00 45 8b bd a0 00 00 00 4e 8d 3c 39 41 8b 47 0c 0f c8 88 45 b7 49 8b 45 20 <4c> 8b b0 40 02 00 00 4d 85 f6 0f 84 4f 01 00 00 41 8a 46 01 48
> RIP [<ffffffff813a303e>] aun_data_available+0xb3/0x28d
> RSP <ffff88000fc03b00>
> CR2: 0000000000000240
> ---[ end trace 8e7c904f0da8a9a0 ]---
> Kernel panic - not syncing: Fatal exception in interrupt
> Pid: 0, comm: swapper Tainted: G D 2.6.37-rc3 #39
> Call Trace:
> <IRQ> [<ffffffff813bc1b4>] panic+0x8c/0x18d
> [<ffffffff810374ff>] ? kmsg_dump+0x115/0x12f
> [<ffffffff813bf5a2>] oops_end+0x81/0x8e
> [<ffffffff81020b01>] no_context+0x1f7/0x206
> [<ffffffff81067af6>] ? handle_IRQ_event+0x52/0x117
> [<ffffffff81020c92>] __bad_area_nosemaphore+0x182/0x1a5
> [<ffffffff81069aa5>] ? handle_fasteoi_irq+0xd5/0xe0
> [<ffffffff81020cc3>] bad_area_nosemaphore+0xe/0x10
> [<ffffffff813c160a>] do_page_fault+0x1e3/0x3db
> [<ffffffff810039a8>] ? do_IRQ+0xa3/0xba
> [<ffffffff813be8d3>] ? ret_from_intr+0x0/0xa
> [<ffffffff8102c35c>] ? enqueue_task_fair+0x156/0x162
> [<ffffffff812fcb99>] ? __skb_recv_datagram+0x116/0x258
> [<ffffffff813beadf>] page_fault+0x1f/0x30
> [<ffffffff813a303e>] ? aun_data_available+0xb3/0x28d
> [<ffffffff8131d614>] ? rt_intern_hash+0x5de/0x606
> [<ffffffff812f7839>] sock_queue_rcv_skb+0x168/0x187
> [<ffffffff81325641>] ip_queue_rcv_skb+0x45/0x4c
> [<ffffffff81031aa0>] ? try_to_wake_up+0x265/0x277
> [<ffffffff8133ee23>] __udp_queue_rcv_skb+0x50/0xb9
> [<ffffffff813403b0>] udp_queue_rcv_skb+0x1ad/0x26e
> [<ffffffff81340b67>] __udp4_lib_rcv+0x30a/0x50d
> [<ffffffff81340d7f>] udp_rcv+0x15/0x17
> [<ffffffff813206b1>] ip_local_deliver+0x12d/0x1d0
> [<ffffffff81320546>] ip_rcv+0x4f2/0x530
> [<ffffffff81300fb3>] __netif_receive_skb+0x34d/0x377
> [<ffffffff81301c1d>] netif_receive_skb+0x67/0x6e
> [<ffffffff812fb763>] ? __netdev_alloc_skb+0x1d/0x3a
> [<ffffffff8129a189>] cp_rx_poll+0x2e8/0x3ab
> [<ffffffff81007414>] ? nommu_map_page+0x0/0xa0
> [<ffffffff81302308>] net_rx_action+0xa7/0x215
> [<ffffffff8103c0f9>] __do_softirq+0xcd/0x18c
> [<ffffffff81002e4c>] call_softirq+0x1c/0x28
> [<ffffffff810042c3>] do_softirq+0x33/0x68
> [<ffffffff8103bc61>] irq_exit+0x36/0x38
> [<ffffffff810039a8>] do_IRQ+0xa3/0xba
> [<ffffffff813be8d3>] ret_from_intr+0x0/0xa
> <EOI> [<ffffffff810089a1>] ? default_idle+0x62/0x7a
> [<ffffffff813c1882>] ? atomic_notifier_call_chain+0x13/0x15
> [<ffffffff81001321>] cpu_idle+0x54/0xbe
> [<ffffffff813a3d49>] rest_init+0x6d/0x6f
> [<ffffffff8169cc85>] start_kernel+0x332/0x33d
> [<ffffffff8169c2a8>] x86_64_start_reservations+0xb8/0xbc
> [<ffffffff8169c39e>] x86_64_start_kernel+0xf2/0xf9
> --
> 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
^ permalink raw reply
* [PATCH, post-2.6.36 regression fix] r8169: Fix runtime power management
From: Rafael J. Wysocki @ 2010-12-09 1:32 UTC (permalink / raw)
To: David Miller
Cc: Francois Romieu, Matthew Garrett, netdev, LKML,
Linux-pm mailing list
From: Rafael J. Wysocki <rjw@sisk.pl>
Subject: r8169: Fix runtime power management
I noticed that one of the post-2.6.36 patches broke runtime PM of the
r8169 on my MSI Wind test machine in such a way that the link was not
brought up after reconnecting the network cable.
In the process of debugging the issue I realized that we only should
invoke the runtime PM functions in rtl8169_check_link_status() when
link change is reported and if we do so, the problem goes away.
Moreover, this allows rtl8169_runtime_idle() to be simplified quite
a bit.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/net/r8169.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
Index: linux-2.6/drivers/net/r8169.c
===================================================================
--- linux-2.6.orig/drivers/net/r8169.c
+++ linux-2.6/drivers/net/r8169.c
@@ -744,26 +744,36 @@ static void rtl8169_xmii_reset_enable(vo
mdio_write(ioaddr, MII_BMCR, val & 0xffff);
}
-static void rtl8169_check_link_status(struct net_device *dev,
+static void __rtl8169_check_link_status(struct net_device *dev,
struct rtl8169_private *tp,
- void __iomem *ioaddr)
+ void __iomem *ioaddr,
+ bool pm)
{
unsigned long flags;
spin_lock_irqsave(&tp->lock, flags);
if (tp->link_ok(ioaddr)) {
/* This is to cancel a scheduled suspend if there's one. */
- pm_request_resume(&tp->pci_dev->dev);
+ if (pm)
+ pm_request_resume(&tp->pci_dev->dev);
netif_carrier_on(dev);
netif_info(tp, ifup, dev, "link up\n");
} else {
netif_carrier_off(dev);
netif_info(tp, ifdown, dev, "link down\n");
- pm_schedule_suspend(&tp->pci_dev->dev, 100);
+ if (pm)
+ pm_schedule_suspend(&tp->pci_dev->dev, 100);
}
spin_unlock_irqrestore(&tp->lock, flags);
}
+static void rtl8169_check_link_status(struct net_device *dev,
+ struct rtl8169_private *tp,
+ void __iomem *ioaddr)
+{
+ __rtl8169_check_link_status(dev, tp, ioaddr, false);
+}
+
#define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)
static u32 __rtl8169_get_wol(struct rtl8169_private *tp)
@@ -4600,7 +4610,7 @@ static irqreturn_t rtl8169_interrupt(int
}
if (status & LinkChg)
- rtl8169_check_link_status(dev, tp, ioaddr);
+ __rtl8169_check_link_status(dev, tp, ioaddr, true);
/* We need to see the lastest version of tp->intr_mask to
* avoid ignoring an MSI interrupt and having to wait for
@@ -4890,11 +4900,7 @@ static int rtl8169_runtime_idle(struct d
struct net_device *dev = pci_get_drvdata(pdev);
struct rtl8169_private *tp = netdev_priv(dev);
- if (!tp->TxDescArray)
- return 0;
-
- rtl8169_check_link_status(dev, tp, tp->mmio_addr);
- return -EBUSY;
+ return tp->TxDescArray ? -EBUSY : 0;
}
static const struct dev_pm_ops rtl8169_pm_ops = {
^ permalink raw reply
* Re: subscribe
From: tingwei liu @ 2010-12-09 1:23 UTC (permalink / raw)
To: netdev
In-Reply-To: <AANLkTi=R0ZpeL3vQrVXeipRR0M=v1YKvkBu+S_CO1RBn@mail.gmail.com>
subscribe tingw.liu@gmail.com
^ permalink raw reply
* Re: [stable] [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Eric Dumazet @ 2010-12-09 1:25 UTC (permalink / raw)
To: Greg KH
Cc: David Miller, lkml20101129, netdev, jesse, linux-kernel, greearb,
stable
In-Reply-To: <20101208231624.GA8992@kroah.com>
Le mercredi 08 décembre 2010 à 15:16 -0800, Greg KH a écrit :
> On Wed, Dec 08, 2010 at 08:47:31AM -0800, David Miller wrote:
> > From: Eric Dumazet <eric.dumazet@gmail.com>
> > Date: Wed, 01 Dec 2010 11:55:14 +0100
> >
> >
> > Greg/-stable, please integrate this patch from Eric into 2.6.36 if you
> > haven't already done so.
>
> I've updated the version in the .36-stable queue with this one, thanks.
>
Thanks.
By the way, all credits given to Jesse, I only made a change to his
patch, so I left him as the author.
Ah I see I forgot the "From: Jesse Gross <jesse@nicira.com>" header when
I sent it, my bad, sorry !
^ permalink raw reply
* Re: tc: show format ABI changed
From: Eric Dumazet @ 2010-12-09 1:18 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, Jarek Poplawski, netdev
In-Reply-To: <20101208145136.1ca3ece4@nehalam>
Le mercredi 08 décembre 2010 à 14:51 -0800, Stephen Hemminger a écrit :
> Although well intentioned, the following patch should have not
> been applied since it changes the kernel ABI. It broke some scripts
> parsing the output format of tc commands.
>
> Before HTB would report bogus zero values, now it reports
> nothing and that changes the output format. Like the empty
> fields in /proc, I argue we can't play fast and loose with
> netlink responses.
>
> Not a big deal to fix the script in this case, in this case
> so don't revert it.
Thanks.
I really prefer not giving false information to user.
If you change tc, please add an option so that user can ask tc not
invent "zero values"
^ permalink raw reply
* NULL dereference in econet AUN-over-UDP receive
From: Nelson Elhage @ 2010-12-09 0:30 UTC (permalink / raw)
To: netdev
While testing one of my econet reproducers on a patched kernel, I triggered a
NULL pointer dereference in the econet AUN-over-UDP receive path. Upon further
investigation, I now suspect that this code path hasn't worked at all in years.
A copy of the oops is below for your reference, but here's my analysis:
When aun_data_available receives a data packet (ah->code == 2), it calls
aun_incoming to process the skb. The start of aun_incoming looks like:
static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len)
{
struct iphdr *ip = ip_hdr(skb);
unsigned char stn = ntohl(ip->saddr) & 0xff;
struct sock *sk = NULL;
struct sk_buff *newskb;
---> struct ec_device *edev = skb->dev->ec_ptr;
However, as far as I can tell, skb->dev is always NULL, meaning that that last
line will fault immediately before this function can do any real work.
In particular, 'skb' comes from "skb = skb_recv_datagram(sk, 0, 1, &err)" in
aun_data_available. skb_recv_datagram() pulls skb's off of sk->sk_receive_queue,
and (unless I'm missing something), the only way things get on that queue is via
sock_queue_rcv_skb, which explicitly sets skb->dev = NULL.
So, if I understand this all correctly, receiving AUN-over-UDP just plain hasn't
worked at all for a long time -- I can reproduce this crash on 2.6.12, which is
the earliest I've tested, and from reading code I suspect it's been broken at
least since 2.6.0.
I am not an expert in the networking subsystem, though, so if I am missing some
way that this code does actually work, please feel to correct me.
If, on the other hand, this code really hasn't worked in years, and no one
noticed, I wonder if we should reconsider moving this code into staging and
eventually out entirely, at least unless any real users step forward.
- Nelson
---- snip here ----
BUG: unable to handle kernel NULL pointer dereference at 0000000000000240
IP: [<ffffffff813a303e>] aun_data_available+0xb3/0x28d
PGD e818067 PUD e819067 PMD 0
Oops: 0000 [#1] SMP
last sysfs file: /sys/devices/virtual/net/lo/operstate
CPU 0
Modules linked in:
Pid: 0, comm: swapper Not tainted 2.6.37-rc3 #39 /Bochs
RIP: 0010:[<ffffffff813a303e>] [<ffffffff813a303e>] aun_data_available+0xb3/0x28d
RSP: 0018:ffff88000fc03b00 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88000fc03b3c RCX: ffff88000e808800
RDX: 0000000000000002 RSI: 0000000000000286 RDI: ffff88000e8060d4
RBP: ffff88000fc03b70 R08: 0000000000000003 R09: 0000000000000002
R10: ffff88000e69ac00 R11: 00000000ffffffff R12: ffff88000e80886a
R13: ffff88000e439500 R14: ffff88000e8060d4 R15: ffff88000e80884e
FS: 0000000000000000(0000) GS:ffff88000fc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000240 CR3: 000000000e813000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 0, threadinfo ffffffff81600000, task ffffffff8162b020)
Stack:
ffff88000fc03ba0 ffffffff8131d614 ffff880000000010 ffff88000e806000
0200000100000000 0202000a00000000 ffffc90000086d48 0000000000000246
ffff88000fc03b70 ffff88000e806000 ffff88000e439500 0000000000000000
Call Trace:
<IRQ>
[<ffffffff8131d614>] ? rt_intern_hash+0x5de/0x606
[<ffffffff812f7839>] sock_queue_rcv_skb+0x168/0x187
[<ffffffff81325641>] ip_queue_rcv_skb+0x45/0x4c
[<ffffffff81031aa0>] ? try_to_wake_up+0x265/0x277
[<ffffffff8133ee23>] __udp_queue_rcv_skb+0x50/0xb9
[<ffffffff813403b0>] udp_queue_rcv_skb+0x1ad/0x26e
[<ffffffff81340b67>] __udp4_lib_rcv+0x30a/0x50d
[<ffffffff81340d7f>] udp_rcv+0x15/0x17
[<ffffffff813206b1>] ip_local_deliver+0x12d/0x1d0
[<ffffffff81320546>] ip_rcv+0x4f2/0x530
[<ffffffff81300fb3>] __netif_receive_skb+0x34d/0x377
[<ffffffff81301c1d>] netif_receive_skb+0x67/0x6e
[<ffffffff812fb763>] ? __netdev_alloc_skb+0x1d/0x3a
[<ffffffff8129a189>] cp_rx_poll+0x2e8/0x3ab
[<ffffffff81007414>] ? nommu_map_page+0x0/0xa0
[<ffffffff81302308>] net_rx_action+0xa7/0x215
[<ffffffff8103c0f9>] __do_softirq+0xcd/0x18c
[<ffffffff81002e4c>] call_softirq+0x1c/0x28
[<ffffffff810042c3>] do_softirq+0x33/0x68
[<ffffffff8103bc61>] irq_exit+0x36/0x38
[<ffffffff810039a8>] do_IRQ+0xa3/0xba
[<ffffffff813be8d3>] ret_from_intr+0x0/0xa
<EOI>
[<ffffffff810089a1>] ? default_idle+0x62/0x7a
[<ffffffff813c1882>] ? atomic_notifier_call_chain+0x13/0x15
[<ffffffff81001321>] cpu_idle+0x54/0xbe
[<ffffffff813a3d49>] rest_init+0x6d/0x6f
[<ffffffff8169cc85>] start_kernel+0x332/0x33d
[<ffffffff8169c2a8>] x86_64_start_reservations+0xb8/0xbc
[<ffffffff8169c39e>] x86_64_start_kernel+0xf2/0xf9
Code: 00 80 fa 04 0f 84 bb 01 00 00 80 fa 02 0f 85 c3 01 00 00 45 8b bd a0 00 00 00 4e 8d 3c 39 41 8b 47 0c 0f c8 88 45 b7 49 8b 45 20 <4c> 8b b0 40 02 00 00 4d 85 f6 0f 84 4f 01 00 00 41 8a 46 01 48
RIP [<ffffffff813a303e>] aun_data_available+0xb3/0x28d
RSP <ffff88000fc03b00>
CR2: 0000000000000240
---[ end trace 8e7c904f0da8a9a0 ]---
Kernel panic - not syncing: Fatal exception in interrupt
Pid: 0, comm: swapper Tainted: G D 2.6.37-rc3 #39
Call Trace:
<IRQ> [<ffffffff813bc1b4>] panic+0x8c/0x18d
[<ffffffff810374ff>] ? kmsg_dump+0x115/0x12f
[<ffffffff813bf5a2>] oops_end+0x81/0x8e
[<ffffffff81020b01>] no_context+0x1f7/0x206
[<ffffffff81067af6>] ? handle_IRQ_event+0x52/0x117
[<ffffffff81020c92>] __bad_area_nosemaphore+0x182/0x1a5
[<ffffffff81069aa5>] ? handle_fasteoi_irq+0xd5/0xe0
[<ffffffff81020cc3>] bad_area_nosemaphore+0xe/0x10
[<ffffffff813c160a>] do_page_fault+0x1e3/0x3db
[<ffffffff810039a8>] ? do_IRQ+0xa3/0xba
[<ffffffff813be8d3>] ? ret_from_intr+0x0/0xa
[<ffffffff8102c35c>] ? enqueue_task_fair+0x156/0x162
[<ffffffff812fcb99>] ? __skb_recv_datagram+0x116/0x258
[<ffffffff813beadf>] page_fault+0x1f/0x30
[<ffffffff813a303e>] ? aun_data_available+0xb3/0x28d
[<ffffffff8131d614>] ? rt_intern_hash+0x5de/0x606
[<ffffffff812f7839>] sock_queue_rcv_skb+0x168/0x187
[<ffffffff81325641>] ip_queue_rcv_skb+0x45/0x4c
[<ffffffff81031aa0>] ? try_to_wake_up+0x265/0x277
[<ffffffff8133ee23>] __udp_queue_rcv_skb+0x50/0xb9
[<ffffffff813403b0>] udp_queue_rcv_skb+0x1ad/0x26e
[<ffffffff81340b67>] __udp4_lib_rcv+0x30a/0x50d
[<ffffffff81340d7f>] udp_rcv+0x15/0x17
[<ffffffff813206b1>] ip_local_deliver+0x12d/0x1d0
[<ffffffff81320546>] ip_rcv+0x4f2/0x530
[<ffffffff81300fb3>] __netif_receive_skb+0x34d/0x377
[<ffffffff81301c1d>] netif_receive_skb+0x67/0x6e
[<ffffffff812fb763>] ? __netdev_alloc_skb+0x1d/0x3a
[<ffffffff8129a189>] cp_rx_poll+0x2e8/0x3ab
[<ffffffff81007414>] ? nommu_map_page+0x0/0xa0
[<ffffffff81302308>] net_rx_action+0xa7/0x215
[<ffffffff8103c0f9>] __do_softirq+0xcd/0x18c
[<ffffffff81002e4c>] call_softirq+0x1c/0x28
[<ffffffff810042c3>] do_softirq+0x33/0x68
[<ffffffff8103bc61>] irq_exit+0x36/0x38
[<ffffffff810039a8>] do_IRQ+0xa3/0xba
[<ffffffff813be8d3>] ret_from_intr+0x0/0xa
<EOI> [<ffffffff810089a1>] ? default_idle+0x62/0x7a
[<ffffffff813c1882>] ? atomic_notifier_call_chain+0x13/0x15
[<ffffffff81001321>] cpu_idle+0x54/0xbe
[<ffffffff813a3d49>] rest_init+0x6d/0x6f
[<ffffffff8169cc85>] start_kernel+0x332/0x33d
[<ffffffff8169c2a8>] x86_64_start_reservations+0xb8/0xbc
[<ffffffff8169c39e>] x86_64_start_kernel+0xf2/0xf9
^ permalink raw reply
* Re: [PATCH] atm: correct sysfs 'device' link creation and parent relationships
From: Dan Williams @ 2010-12-09 0:33 UTC (permalink / raw)
To: David Miller
Cc: kay.sievers-tD+1rO4QERM, netdev-u79uwXL29TY76Z2rM5mHXA,
duncan.sands-GANU6spQydw, linux-usb-u79uwXL29TY76Z2rM5mHXA,
chas-vT06rRrALxcmhCb6mdbn6A
In-Reply-To: <20101208.121532.232745367.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Wed, 2010-12-08 at 12:15 -0800, David Miller wrote:
> From: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> Date: Wed, 08 Dec 2010 10:11:21 -0800 (PST)
>
> > From: Kay Sievers <kay.sievers-tD+1rO4QERM@public.gmane.org>
> > Date: Tue, 7 Dec 2010 08:35:53 +0100
> >
> >> On Sun, Dec 5, 2010 at 23:17, Dan Williams <dcbw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> >>> The ATM subsystem was incorrectly creating the 'device' link for ATM
> >>> nodes in sysfs. This led to incorrect device/parent relationships
> >>> exposed by sysfs and udev. Instead of rolling the 'device' link by hand
> >>> in the generic ATM code, pass each ATM driver's bus device down to the
> >>> sysfs code and let sysfs do this stuff correctly.
> >>
> >> Looks good to me.
> >
> > I've applied this to net-2.6, thanks Dan.
>
> Actually I'm reverting, it breaks the build.
>
> Did you even grep for "atm_dev_register()" after changning the number
> of arguments, or were you depending upon build failures to guide you?
What seems to have happened here was that I built against my installed
kernel config, which apparently does not enable a few of the drivers,
and thus I missed the error. I apologize, I will submit a new patch,
and I will not let this happen again.
Dan
> Please never do the latter, as it always leads to things like this.
>
> drivers/atm/fore200e.c:2577:7: error: too few arguments to function 'atm_dev_register'
> drivers/atm/iphase.c:3175:2: error: too few arguments to function 'atm_dev_register'
--
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
* [net-next-2.6 PATCH 2/2] enic: Use VF mac set by IFLA_VF_MAC in port profile provisioning data
From: Roopa Prabhu @ 2010-12-08 23:54 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20101208235340.24874.50597.stgit@savbu-pc100.cisco.com>
From: Roopa Prabhu <roprabhu@cisco.com>
This patch adds support in enic 802.1Qbh port profile provisioning code
to use the mac address set by IFLA_VF_MAC. For now we handle this mac as a
special case for a VM mac address sent to us by libvirt. The VM mac address
is sent to the switch along with the rest of the port profile provisioning
data. This patch also adds calls to register and deregister the mac address
during port profile association/deassociation.
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
---
drivers/net/enic/enic.h | 1 +
drivers/net/enic/enic_main.c | 79 ++++++++++++++++++++++++++++++------------
2 files changed, 57 insertions(+), 23 deletions(-)
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index bd473a9..577067e 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -62,6 +62,7 @@ struct enic_port_profile {
u8 instance_uuid[PORT_UUID_MAX];
u8 host_uuid[PORT_UUID_MAX];
u8 vf_mac[ETH_ALEN];
+ u8 mac_addr[ETH_ALEN];
};
/* Per-instance private data structure */
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index ddeffb5..21be989 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1278,9 +1278,14 @@ static int enic_set_port_profile(struct enic *enic, u8 *mac)
VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR,
strlen(enic->pp.name) + 1, enic->pp.name);
- vic_provinfo_add_tlv(vp,
- VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
- ETH_ALEN, mac);
+ if (!is_zero_ether_addr(enic->pp.mac_addr))
+ vic_provinfo_add_tlv(vp,
+ VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
+ ETH_ALEN, enic->pp.mac_addr);
+ else
+ vic_provinfo_add_tlv(vp,
+ VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
+ ETH_ALEN, mac);
if (enic->pp.set & ENIC_SET_INSTANCE) {
sprintf(uuid_str, "%pUB", enic->pp.instance_uuid);
@@ -1300,16 +1305,18 @@ static int enic_set_port_profile(struct enic *enic, u8 *mac)
vic_provinfo_free(vp);
if (err)
return err;
+
+ enic->pp.set |= ENIC_SET_APPLIED;
break;
case PORT_REQUEST_DISASSOCIATE:
+ enic->pp.set &= ~ENIC_SET_APPLIED;
break;
default:
return -EINVAL;
}
- enic->pp.set |= ENIC_SET_APPLIED;
return 0;
}
@@ -1317,29 +1324,31 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
struct nlattr *port[])
{
struct enic *enic = netdev_priv(netdev);
+ struct enic_port_profile new_pp;
+ int err = 0;
- memset(&enic->pp, 0, sizeof(enic->pp));
+ memset(&new_pp, 0, sizeof(new_pp));
if (port[IFLA_PORT_REQUEST]) {
- enic->pp.set |= ENIC_SET_REQUEST;
- enic->pp.request = nla_get_u8(port[IFLA_PORT_REQUEST]);
+ new_pp.set |= ENIC_SET_REQUEST;
+ new_pp.request = nla_get_u8(port[IFLA_PORT_REQUEST]);
}
if (port[IFLA_PORT_PROFILE]) {
- enic->pp.set |= ENIC_SET_NAME;
- memcpy(enic->pp.name, nla_data(port[IFLA_PORT_PROFILE]),
+ new_pp.set |= ENIC_SET_NAME;
+ memcpy(new_pp.name, nla_data(port[IFLA_PORT_PROFILE]),
PORT_PROFILE_MAX);
}
if (port[IFLA_PORT_INSTANCE_UUID]) {
- enic->pp.set |= ENIC_SET_INSTANCE;
- memcpy(enic->pp.instance_uuid,
+ new_pp.set |= ENIC_SET_INSTANCE;
+ memcpy(new_pp.instance_uuid,
nla_data(port[IFLA_PORT_INSTANCE_UUID]), PORT_UUID_MAX);
}
if (port[IFLA_PORT_HOST_UUID]) {
- enic->pp.set |= ENIC_SET_HOST;
- memcpy(enic->pp.host_uuid,
+ new_pp.set |= ENIC_SET_HOST;
+ memcpy(new_pp.host_uuid,
nla_data(port[IFLA_PORT_HOST_UUID]), PORT_UUID_MAX);
}
@@ -1347,21 +1356,39 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
if (vf != PORT_SELF_VF)
return -EOPNOTSUPP;
- if (!(enic->pp.set & ENIC_SET_REQUEST))
+ if (!(new_pp.set & ENIC_SET_REQUEST))
return -EOPNOTSUPP;
- if (enic->pp.request == PORT_REQUEST_ASSOCIATE) {
-
- /* If the interface mac addr hasn't been assigned,
- * assign a random mac addr before setting port-
- * profile.
- */
+ if (new_pp.request == PORT_REQUEST_ASSOCIATE) {
+ /* Special case handling */
+ if (!is_zero_ether_addr(enic->pp.vf_mac))
+ memcpy(new_pp.mac_addr, enic->pp.vf_mac, ETH_ALEN);
if (is_zero_ether_addr(netdev->dev_addr))
random_ether_addr(netdev->dev_addr);
+ } else if (new_pp.request == PORT_REQUEST_DISASSOCIATE) {
+ if (!is_zero_ether_addr(enic->pp.mac_addr))
+ enic_dev_del_addr(enic, enic->pp.mac_addr);
}
- return enic_set_port_profile(enic, netdev->dev_addr);
+ memcpy(&enic->pp, &new_pp, sizeof(struct enic_port_profile));
+
+ err = enic_set_port_profile(enic, netdev->dev_addr);
+ if (err)
+ goto set_port_profile_cleanup;
+
+ if (!is_zero_ether_addr(enic->pp.mac_addr))
+ enic_dev_add_addr(enic, enic->pp.mac_addr);
+
+set_port_profile_cleanup:
+ memset(enic->pp.vf_mac, 0, ETH_ALEN);
+
+ if (err || enic->pp.request == PORT_REQUEST_DISASSOCIATE) {
+ memset(netdev->dev_addr, 0, ETH_ALEN);
+ memset(enic->pp.mac_addr, 0, ETH_ALEN);
+ }
+
+ return err;
}
static int enic_get_vf_port(struct net_device *netdev, int vf,
@@ -1941,7 +1968,10 @@ static int enic_open(struct net_device *netdev)
for (i = 0; i < enic->rq_count; i++)
vnic_rq_enable(&enic->rq[i]);
- enic_dev_add_station_addr(enic);
+ if (enic_is_dynamic(enic) && !is_zero_ether_addr(enic->pp.mac_addr))
+ enic_dev_add_addr(enic, enic->pp.mac_addr);
+ else
+ enic_dev_add_station_addr(enic);
enic_set_rx_mode(netdev);
netif_wake_queue(netdev);
@@ -1989,7 +2019,10 @@ static int enic_stop(struct net_device *netdev)
netif_carrier_off(netdev);
netif_tx_disable(netdev);
- enic_dev_del_station_addr(enic);
+ if (enic_is_dynamic(enic) && !is_zero_ether_addr(enic->pp.mac_addr))
+ enic_dev_del_addr(enic, enic->pp.mac_addr);
+ else
+ enic_dev_del_station_addr(enic);
for (i = 0; i < enic->wq_count; i++) {
err = vnic_wq_disable(&enic->wq[i]);
^ permalink raw reply related
* [net-next-2.6 PATCH 1/2] enic: Add ndo_set_vf_mac support for enic dynamic devices
From: Roopa Prabhu @ 2010-12-08 23:53 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20101208235340.24874.50597.stgit@savbu-pc100.cisco.com>
From: Roopa Prabhu <roprabhu@cisco.com>
This patch implements the ndo_set_vf_mac netdev operation for enic
dynamic devices. It treats the mac address set by IFLA_VF_MAC as a
special case to use it in the port profile provisioning data.
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
---
drivers/net/enic/enic.h | 3 ++-
drivers/net/enic/enic_main.c | 20 ++++++++++++++++++++
2 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index 8f374c1..bd473a9 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -32,7 +32,7 @@
#define DRV_NAME "enic"
#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION "1.4.1.8"
+#define DRV_VERSION "1.4.1.9"
#define DRV_COPYRIGHT "Copyright 2008-2010 Cisco Systems, Inc"
#define ENIC_BARS_MAX 6
@@ -61,6 +61,7 @@ struct enic_port_profile {
char name[PORT_PROFILE_MAX];
u8 instance_uuid[PORT_UUID_MAX];
u8 host_uuid[PORT_UUID_MAX];
+ u8 vf_mac[ETH_ALEN];
};
/* Per-instance private data structure */
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 1931f15..ddeffb5 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1231,6 +1231,23 @@ static int enic_dev_init_done(struct enic *enic, int *done, int *error)
return err;
}
+static int enic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
+{
+ struct enic *enic = netdev_priv(netdev);
+
+ if (vf != PORT_SELF_VF)
+ return -EOPNOTSUPP;
+
+ /* Ignore the vf argument for now. We can assume the request
+ * is coming on a vf.
+ */
+ if (is_valid_ether_addr(mac)) {
+ memcpy(enic->pp.vf_mac, mac, ETH_ALEN);
+ return 0;
+ } else
+ return -EINVAL;
+}
+
static int enic_set_port_profile(struct enic *enic, u8 *mac)
{
struct vic_provinfo *vp;
@@ -2411,6 +2428,9 @@ static const struct net_device_ops enic_netdev_dynamic_ops = {
.ndo_tx_timeout = enic_tx_timeout,
.ndo_set_vf_port = enic_set_vf_port,
.ndo_get_vf_port = enic_get_vf_port,
+#ifdef IFLA_VF_MAX
+ .ndo_set_vf_mac = enic_set_vf_mac,
+#endif
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = enic_poll_controller,
#endif
^ permalink raw reply related
* [net-next-2.6 PATCH 0/2] enic: updates to version 1.4.1.9
From: Roopa Prabhu @ 2010-12-08 23:53 UTC (permalink / raw)
To: davem; +Cc: netdev
This patch series implements the following enic driver updates:
01/2 - Add ndo_set_vf_mac support for enic dynamic devices
02/2 - Use VF mac set by IFLA_VF_MAC in port profile provisioning data
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
^ permalink raw reply
* Re: echo > 0 .../disable_ipv6 broken in 2.6.37-rc4
From: Stephen Hemminger @ 2010-12-08 23:49 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: Brian Haley, netdev, Mahesh Kelkar, Lorenzo Colitti
In-Reply-To: <m1tyineu3p.fsf@fess.ebiederm.org>
On Wed, 08 Dec 2010 15:13:30 -0800
ebiederm@xmission.com (Eric W. Biederman) wrote:
> Brian Haley <brian.haley@hp.com> writes:
>
> > This got broken in 2.6.34-rc1, and the most obvious culprit is this,
> > although I haven't bisected it:
> >
> > commit dc2b99f71ef477a31020511876ab4403fb7c4420
> > Author: stephen hemminger <shemminger@vyatta.com>
> > Date: Mon Feb 8 19:48:05 2010 +0000
> >
> > IPv6: keep permanent addresses on admin down
> >
> > Permanent IPV6 addresses should not be removed when the link is
> > set to admin down, only when device is removed.
> >
> > When link is lost permanent addresses should be marked as tentative
> > so that when link comes back they are subject to duplicate address
> > detection (if DAD was enabled for that address).
> >
> > Other routing systems keep manually configured IPv6 addresses
> > when link is set down.
> >
> > Even though there was a bugfix update, it didn't help.
> >
> > I unfortunately won't be able to look at this more until at least Friday,
> > I couldn't come up with a quick patch just looking quickly at
> > addrconf_ifdown().
>
> This is almost certainly it.
> ip link set lo down
> ip link set lo up
>
> Is enough to break ping6 ::1.
>
> I get the feeling the loopback address was not actually tested and
> there is something different about it.
Loopback is already handled as special case in addrconf. Look at IFF_LOOPBACK
perhaps there is a logic error there.
--
^ permalink raw reply
* [net-next-2.6 PATCH] enic: Add ndo_set_rx_mode support for enic vnics
From: Roopa Prabhu @ 2010-12-08 23:19 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Roopa Prabhu <roprabhu@cisco.com>
Add ndo_set_rx_mode support to register unicast and multicast
address filters for enic devices
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
---
drivers/net/enic/enic.h | 4 +
drivers/net/enic/enic_main.c | 121 ++++++++++++++++++++++++++++++++++--------
drivers/net/enic/enic_res.h | 1
3 files changed, 102 insertions(+), 24 deletions(-)
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index 7067254..8f374c1 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -32,7 +32,7 @@
#define DRV_NAME "enic"
#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION "1.4.1.7"
+#define DRV_VERSION "1.4.1.8"
#define DRV_COPYRIGHT "Copyright 2008-2010 Cisco Systems, Inc"
#define ENIC_BARS_MAX 6
@@ -78,8 +78,10 @@ struct enic {
spinlock_t devcmd_lock;
u8 mac_addr[ETH_ALEN];
u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
+ u8 uc_addr[ENIC_UNICAST_PERFECT_FILTERS][ETH_ALEN];
unsigned int flags;
unsigned int mc_count;
+ unsigned int uc_count;
int csum_rx_enabled;
u32 port_mtu;
u32 rx_coalesce_usecs;
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 9f293fa..1931f15 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1002,7 +1002,7 @@ static int enic_dev_packet_filter(struct enic *enic, int directed,
return err;
}
-static int enic_dev_add_multicast_addr(struct enic *enic, u8 *addr)
+static int enic_dev_add_addr(struct enic *enic, u8 *addr)
{
int err;
@@ -1013,7 +1013,7 @@ static int enic_dev_add_multicast_addr(struct enic *enic, u8 *addr)
return err;
}
-static int enic_dev_del_multicast_addr(struct enic *enic, u8 *addr)
+static int enic_dev_del_addr(struct enic *enic, u8 *addr)
{
int err;
@@ -1024,29 +1024,19 @@ static int enic_dev_del_multicast_addr(struct enic *enic, u8 *addr)
return err;
}
-/* netif_tx_lock held, BHs disabled */
-static void enic_set_multicast_list(struct net_device *netdev)
+static void enic_add_multicast_addr_list(struct enic *enic)
{
- struct enic *enic = netdev_priv(netdev);
+ struct net_device *netdev = enic->netdev;
struct netdev_hw_addr *ha;
- int directed = 1;
- int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
- int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
- int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0;
unsigned int mc_count = netdev_mc_count(netdev);
- int allmulti = (netdev->flags & IFF_ALLMULTI) ||
- mc_count > ENIC_MULTICAST_PERFECT_FILTERS;
- unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0);
u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
unsigned int i, j;
- if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS)
+ if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS) {
+ netdev_warn(netdev, "Registering only %d out of %d "
+ "multicast addresses\n",
+ ENIC_MULTICAST_PERFECT_FILTERS, mc_count);
mc_count = ENIC_MULTICAST_PERFECT_FILTERS;
-
- if (enic->flags != flags) {
- enic->flags = flags;
- enic_dev_packet_filter(enic, directed,
- multicast, broadcast, promisc, allmulti);
}
/* Is there an easier way? Trying to minimize to
@@ -1068,7 +1058,7 @@ static void enic_set_multicast_list(struct net_device *netdev)
mc_addr[j]) == 0)
break;
if (j == mc_count)
- enic_dev_del_multicast_addr(enic, enic->mc_addr[i]);
+ enic_dev_del_addr(enic, enic->mc_addr[i]);
}
for (i = 0; i < mc_count; i++) {
@@ -1077,7 +1067,7 @@ static void enic_set_multicast_list(struct net_device *netdev)
enic->mc_addr[j]) == 0)
break;
if (j == enic->mc_count)
- enic_dev_add_multicast_addr(enic, mc_addr[i]);
+ enic_dev_add_addr(enic, mc_addr[i]);
}
/* Save the list to compare against next time
@@ -1089,6 +1079,89 @@ static void enic_set_multicast_list(struct net_device *netdev)
enic->mc_count = mc_count;
}
+static void enic_add_unicast_addr_list(struct enic *enic)
+{
+ struct net_device *netdev = enic->netdev;
+ struct netdev_hw_addr *ha;
+ unsigned int uc_count = netdev_uc_count(netdev);
+ u8 uc_addr[ENIC_UNICAST_PERFECT_FILTERS][ETH_ALEN];
+ unsigned int i, j;
+
+ if (uc_count > ENIC_UNICAST_PERFECT_FILTERS) {
+ netdev_warn(netdev, "Registering only %d out of %d "
+ "unicast addresses\n",
+ ENIC_UNICAST_PERFECT_FILTERS, uc_count);
+ uc_count = ENIC_UNICAST_PERFECT_FILTERS;
+ }
+
+ /* Is there an easier way? Trying to minimize to
+ * calls to add/del unicast addrs. We keep the
+ * addrs from the last call in enic->uc_addr and
+ * look for changes to add/del.
+ */
+
+ i = 0;
+ netdev_for_each_uc_addr(ha, netdev) {
+ if (i == uc_count)
+ break;
+ memcpy(uc_addr[i++], ha->addr, ETH_ALEN);
+ }
+
+ for (i = 0; i < enic->uc_count; i++) {
+ for (j = 0; j < uc_count; j++)
+ if (compare_ether_addr(enic->uc_addr[i],
+ uc_addr[j]) == 0)
+ break;
+ if (j == uc_count)
+ enic_dev_del_addr(enic, enic->uc_addr[i]);
+ }
+
+ for (i = 0; i < uc_count; i++) {
+ for (j = 0; j < enic->uc_count; j++)
+ if (compare_ether_addr(uc_addr[i],
+ enic->uc_addr[j]) == 0)
+ break;
+ if (j == enic->uc_count)
+ enic_dev_add_addr(enic, uc_addr[i]);
+ }
+
+ /* Save the list to compare against next time
+ */
+
+ for (i = 0; i < uc_count; i++)
+ memcpy(enic->uc_addr[i], uc_addr[i], ETH_ALEN);
+
+ enic->uc_count = uc_count;
+}
+
+/* netif_tx_lock held, BHs disabled */
+static void enic_set_rx_mode(struct net_device *netdev)
+{
+ struct enic *enic = netdev_priv(netdev);
+ int directed = 1;
+ int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
+ int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
+ int promisc = (netdev->flags & IFF_PROMISC) ||
+ netdev_uc_count(netdev) > ENIC_UNICAST_PERFECT_FILTERS;
+ int allmulti = (netdev->flags & IFF_ALLMULTI) ||
+ netdev_mc_count(netdev) > ENIC_MULTICAST_PERFECT_FILTERS;
+ unsigned int flags = netdev->flags |
+ (allmulti ? IFF_ALLMULTI : 0) |
+ (promisc ? IFF_PROMISC : 0);
+
+ if (enic->flags != flags) {
+ enic->flags = flags;
+ enic_dev_packet_filter(enic, directed,
+ multicast, broadcast, promisc, allmulti);
+ }
+
+ if (!promisc) {
+ enic_add_unicast_addr_list(enic);
+ if (!allmulti)
+ enic_add_multicast_addr_list(enic);
+ }
+}
+
/* rtnl lock is held */
static void enic_vlan_rx_register(struct net_device *netdev,
struct vlan_group *vlan_group)
@@ -1852,7 +1925,7 @@ static int enic_open(struct net_device *netdev)
vnic_rq_enable(&enic->rq[i]);
enic_dev_add_station_addr(enic);
- enic_set_multicast_list(netdev);
+ enic_set_rx_mode(netdev);
netif_wake_queue(netdev);
@@ -2328,7 +2401,8 @@ static const struct net_device_ops enic_netdev_dynamic_ops = {
.ndo_start_xmit = enic_hard_start_xmit,
.ndo_get_stats = enic_get_stats,
.ndo_validate_addr = eth_validate_addr,
- .ndo_set_multicast_list = enic_set_multicast_list,
+ .ndo_set_rx_mode = enic_set_rx_mode,
+ .ndo_set_multicast_list = enic_set_rx_mode,
.ndo_set_mac_address = enic_set_mac_address_dynamic,
.ndo_change_mtu = enic_change_mtu,
.ndo_vlan_rx_register = enic_vlan_rx_register,
@@ -2349,7 +2423,8 @@ static const struct net_device_ops enic_netdev_ops = {
.ndo_get_stats = enic_get_stats,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = enic_set_mac_address,
- .ndo_set_multicast_list = enic_set_multicast_list,
+ .ndo_set_rx_mode = enic_set_rx_mode,
+ .ndo_set_multicast_list = enic_set_rx_mode,
.ndo_change_mtu = enic_change_mtu,
.ndo_vlan_rx_register = enic_vlan_rx_register,
.ndo_vlan_rx_add_vid = enic_vlan_rx_add_vid,
diff --git a/drivers/net/enic/enic_res.h b/drivers/net/enic/enic_res.h
index 9a103d9..25be273 100644
--- a/drivers/net/enic/enic_res.h
+++ b/drivers/net/enic/enic_res.h
@@ -34,6 +34,7 @@
#define ENIC_MAX_MTU 9000
#define ENIC_MULTICAST_PERFECT_FILTERS 32
+#define ENIC_UNICAST_PERFECT_FILTERS 32
#define ENIC_NON_TSO_MAX_DESC 16
^ permalink raw reply related
* Re: [net-next-2.6 PATCH] enic: Add ndo_set_rx_mode support for enic vnics
From: roprabhu @ 2010-12-08 23:16 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20101208230148.24021.32576.stgit@savbu-pc100.cisco.com>
Please ignore. Will update Signed-off list and re-spin. Thanks.
On 12/8/10 3:01 PM, "Roopa Prabhu" <roprabhu@cisco.com> wrote:
> From: Roopa Prabhu <roprabhu@cisco.com>
>
> Add ndo_set_rx_mode support to register unicast and multicast
> address filters for enic devices
>
> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
> Signed-off-by: David Wang <dwang2@cisco.com>
> Signed-off-by: Christian Benvenuti <benve@cisco.com>
> ---
> drivers/net/enic/enic.h | 4 +
> drivers/net/enic/enic_main.c | 121
> ++++++++++++++++++++++++++++++++++--------
> drivers/net/enic/enic_res.h | 1
> 3 files changed, 102 insertions(+), 24 deletions(-)
>
>
> diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
> index 7067254..8f374c1 100644
> --- a/drivers/net/enic/enic.h
> +++ b/drivers/net/enic/enic.h
> @@ -32,7 +32,7 @@
>
> #define DRV_NAME "enic"
> #define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"
> -#define DRV_VERSION "1.4.1.7"
> +#define DRV_VERSION "1.4.1.8"
> #define DRV_COPYRIGHT "Copyright 2008-2010 Cisco Systems, Inc"
>
> #define ENIC_BARS_MAX 6
> @@ -78,8 +78,10 @@ struct enic {
> spinlock_t devcmd_lock;
> u8 mac_addr[ETH_ALEN];
> u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
> + u8 uc_addr[ENIC_UNICAST_PERFECT_FILTERS][ETH_ALEN];
> unsigned int flags;
> unsigned int mc_count;
> + unsigned int uc_count;
> int csum_rx_enabled;
> u32 port_mtu;
> u32 rx_coalesce_usecs;
> diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
> index 9f293fa..1931f15 100644
> --- a/drivers/net/enic/enic_main.c
> +++ b/drivers/net/enic/enic_main.c
> @@ -1002,7 +1002,7 @@ static int enic_dev_packet_filter(struct enic *enic, int
> directed,
> return err;
> }
>
> -static int enic_dev_add_multicast_addr(struct enic *enic, u8 *addr)
> +static int enic_dev_add_addr(struct enic *enic, u8 *addr)
> {
> int err;
>
> @@ -1013,7 +1013,7 @@ static int enic_dev_add_multicast_addr(struct enic
> *enic, u8 *addr)
> return err;
> }
>
> -static int enic_dev_del_multicast_addr(struct enic *enic, u8 *addr)
> +static int enic_dev_del_addr(struct enic *enic, u8 *addr)
> {
> int err;
>
> @@ -1024,29 +1024,19 @@ static int enic_dev_del_multicast_addr(struct enic
> *enic, u8 *addr)
> return err;
> }
>
> -/* netif_tx_lock held, BHs disabled */
> -static void enic_set_multicast_list(struct net_device *netdev)
> +static void enic_add_multicast_addr_list(struct enic *enic)
> {
> - struct enic *enic = netdev_priv(netdev);
> + struct net_device *netdev = enic->netdev;
> struct netdev_hw_addr *ha;
> - int directed = 1;
> - int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
> - int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
> - int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0;
> unsigned int mc_count = netdev_mc_count(netdev);
> - int allmulti = (netdev->flags & IFF_ALLMULTI) ||
> - mc_count > ENIC_MULTICAST_PERFECT_FILTERS;
> - unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0);
> u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
> unsigned int i, j;
>
> - if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS)
> + if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS) {
> + netdev_warn(netdev, "Registering only %d out of %d "
> + "multicast addresses\n",
> + ENIC_MULTICAST_PERFECT_FILTERS, mc_count);
> mc_count = ENIC_MULTICAST_PERFECT_FILTERS;
> -
> - if (enic->flags != flags) {
> - enic->flags = flags;
> - enic_dev_packet_filter(enic, directed,
> - multicast, broadcast, promisc, allmulti);
> }
>
> /* Is there an easier way? Trying to minimize to
> @@ -1068,7 +1058,7 @@ static void enic_set_multicast_list(struct net_device
> *netdev)
> mc_addr[j]) == 0)
> break;
> if (j == mc_count)
> - enic_dev_del_multicast_addr(enic, enic->mc_addr[i]);
> + enic_dev_del_addr(enic, enic->mc_addr[i]);
> }
>
> for (i = 0; i < mc_count; i++) {
> @@ -1077,7 +1067,7 @@ static void enic_set_multicast_list(struct net_device
> *netdev)
> enic->mc_addr[j]) == 0)
> break;
> if (j == enic->mc_count)
> - enic_dev_add_multicast_addr(enic, mc_addr[i]);
> + enic_dev_add_addr(enic, mc_addr[i]);
> }
>
> /* Save the list to compare against next time
> @@ -1089,6 +1079,89 @@ static void enic_set_multicast_list(struct net_device
> *netdev)
> enic->mc_count = mc_count;
> }
>
> +static void enic_add_unicast_addr_list(struct enic *enic)
> +{
> + struct net_device *netdev = enic->netdev;
> + struct netdev_hw_addr *ha;
> + unsigned int uc_count = netdev_uc_count(netdev);
> + u8 uc_addr[ENIC_UNICAST_PERFECT_FILTERS][ETH_ALEN];
> + unsigned int i, j;
> +
> + if (uc_count > ENIC_UNICAST_PERFECT_FILTERS) {
> + netdev_warn(netdev, "Registering only %d out of %d "
> + "unicast addresses\n",
> + ENIC_UNICAST_PERFECT_FILTERS, uc_count);
> + uc_count = ENIC_UNICAST_PERFECT_FILTERS;
> + }
> +
> + /* Is there an easier way? Trying to minimize to
> + * calls to add/del unicast addrs. We keep the
> + * addrs from the last call in enic->uc_addr and
> + * look for changes to add/del.
> + */
> +
> + i = 0;
> + netdev_for_each_uc_addr(ha, netdev) {
> + if (i == uc_count)
> + break;
> + memcpy(uc_addr[i++], ha->addr, ETH_ALEN);
> + }
> +
> + for (i = 0; i < enic->uc_count; i++) {
> + for (j = 0; j < uc_count; j++)
> + if (compare_ether_addr(enic->uc_addr[i],
> + uc_addr[j]) == 0)
> + break;
> + if (j == uc_count)
> + enic_dev_del_addr(enic, enic->uc_addr[i]);
> + }
> +
> + for (i = 0; i < uc_count; i++) {
> + for (j = 0; j < enic->uc_count; j++)
> + if (compare_ether_addr(uc_addr[i],
> + enic->uc_addr[j]) == 0)
> + break;
> + if (j == enic->uc_count)
> + enic_dev_add_addr(enic, uc_addr[i]);
> + }
> +
> + /* Save the list to compare against next time
> + */
> +
> + for (i = 0; i < uc_count; i++)
> + memcpy(enic->uc_addr[i], uc_addr[i], ETH_ALEN);
> +
> + enic->uc_count = uc_count;
> +}
> +
> +/* netif_tx_lock held, BHs disabled */
> +static void enic_set_rx_mode(struct net_device *netdev)
> +{
> + struct enic *enic = netdev_priv(netdev);
> + int directed = 1;
> + int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
> + int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
> + int promisc = (netdev->flags & IFF_PROMISC) ||
> + netdev_uc_count(netdev) > ENIC_UNICAST_PERFECT_FILTERS;
> + int allmulti = (netdev->flags & IFF_ALLMULTI) ||
> + netdev_mc_count(netdev) > ENIC_MULTICAST_PERFECT_FILTERS;
> + unsigned int flags = netdev->flags |
> + (allmulti ? IFF_ALLMULTI : 0) |
> + (promisc ? IFF_PROMISC : 0);
> +
> + if (enic->flags != flags) {
> + enic->flags = flags;
> + enic_dev_packet_filter(enic, directed,
> + multicast, broadcast, promisc, allmulti);
> + }
> +
> + if (!promisc) {
> + enic_add_unicast_addr_list(enic);
> + if (!allmulti)
> + enic_add_multicast_addr_list(enic);
> + }
> +}
> +
> /* rtnl lock is held */
> static void enic_vlan_rx_register(struct net_device *netdev,
> struct vlan_group *vlan_group)
> @@ -1852,7 +1925,7 @@ static int enic_open(struct net_device *netdev)
> vnic_rq_enable(&enic->rq[i]);
>
> enic_dev_add_station_addr(enic);
> - enic_set_multicast_list(netdev);
> + enic_set_rx_mode(netdev);
>
> netif_wake_queue(netdev);
>
> @@ -2328,7 +2401,8 @@ static const struct net_device_ops
> enic_netdev_dynamic_ops = {
> .ndo_start_xmit = enic_hard_start_xmit,
> .ndo_get_stats = enic_get_stats,
> .ndo_validate_addr = eth_validate_addr,
> - .ndo_set_multicast_list = enic_set_multicast_list,
> + .ndo_set_rx_mode = enic_set_rx_mode,
> + .ndo_set_multicast_list = enic_set_rx_mode,
> .ndo_set_mac_address = enic_set_mac_address_dynamic,
> .ndo_change_mtu = enic_change_mtu,
> .ndo_vlan_rx_register = enic_vlan_rx_register,
> @@ -2349,7 +2423,8 @@ static const struct net_device_ops enic_netdev_ops = {
> .ndo_get_stats = enic_get_stats,
> .ndo_validate_addr = eth_validate_addr,
> .ndo_set_mac_address = enic_set_mac_address,
> - .ndo_set_multicast_list = enic_set_multicast_list,
> + .ndo_set_rx_mode = enic_set_rx_mode,
> + .ndo_set_multicast_list = enic_set_rx_mode,
> .ndo_change_mtu = enic_change_mtu,
> .ndo_vlan_rx_register = enic_vlan_rx_register,
> .ndo_vlan_rx_add_vid = enic_vlan_rx_add_vid,
> diff --git a/drivers/net/enic/enic_res.h b/drivers/net/enic/enic_res.h
> index 9a103d9..25be273 100644
> --- a/drivers/net/enic/enic_res.h
> +++ b/drivers/net/enic/enic_res.h
> @@ -34,6 +34,7 @@
> #define ENIC_MAX_MTU 9000
>
> #define ENIC_MULTICAST_PERFECT_FILTERS 32
> +#define ENIC_UNICAST_PERFECT_FILTERS 32
>
> #define ENIC_NON_TSO_MAX_DESC 16
>
>
> --
> 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
^ permalink raw reply
* Re: [stable] [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Greg KH @ 2010-12-08 23:16 UTC (permalink / raw)
To: David Miller
Cc: eric.dumazet, lkml20101129, netdev, jesse, linux-kernel, greearb,
stable
In-Reply-To: <20101208.084731.189716071.davem@davemloft.net>
On Wed, Dec 08, 2010 at 08:47:31AM -0800, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 01 Dec 2010 11:55:14 +0100
>
>
> Greg/-stable, please integrate this patch from Eric into 2.6.36 if you
> haven't already done so.
I've updated the version in the .36-stable queue with this one, thanks.
greg k-h
^ permalink raw reply
* Re: echo > 0 .../disable_ipv6 broken in 2.6.37-rc4
From: Eric W. Biederman @ 2010-12-08 23:13 UTC (permalink / raw)
To: Brian Haley; +Cc: netdev, Mahesh Kelkar, Lorenzo Colitti, Stephen Hemminger
In-Reply-To: <4D000B6D.1060708@hp.com>
Brian Haley <brian.haley@hp.com> writes:
> This got broken in 2.6.34-rc1, and the most obvious culprit is this,
> although I haven't bisected it:
>
> commit dc2b99f71ef477a31020511876ab4403fb7c4420
> Author: stephen hemminger <shemminger@vyatta.com>
> Date: Mon Feb 8 19:48:05 2010 +0000
>
> IPv6: keep permanent addresses on admin down
>
> Permanent IPV6 addresses should not be removed when the link is
> set to admin down, only when device is removed.
>
> When link is lost permanent addresses should be marked as tentative
> so that when link comes back they are subject to duplicate address
> detection (if DAD was enabled for that address).
>
> Other routing systems keep manually configured IPv6 addresses
> when link is set down.
>
> Even though there was a bugfix update, it didn't help.
>
> I unfortunately won't be able to look at this more until at least Friday,
> I couldn't come up with a quick patch just looking quickly at
> addrconf_ifdown().
This is almost certainly it.
ip link set lo down
ip link set lo up
Is enough to break ping6 ::1.
I get the feeling the loopback address was not actually tested and
there is something different about it.
Eric
^ permalink raw reply
* Re: [34/44] Limit sysctl_tcp_mem and sysctl_udp_mem initializers to prevent integer overflows.
From: Greg KH @ 2010-12-08 23:13 UTC (permalink / raw)
To: David Miller
Cc: pekkas, eric.dumazet, kaber, yoshfuji, netdev, linux-kernel,
stable, vladislav.yasevich, linux-sctp, w, holt, kuznet, akpm,
jmorris, torvalds, stable-review, alan, sri
In-Reply-To: <20101208.082522.226789733.davem@davemloft.net>
On Wed, Dec 08, 2010 at 08:25:22AM -0800, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 08 Dec 2010 06:50:45 +0100
>
> > Le mardi 07 décembre 2010 à 20:16 -0800, Greg KH a écrit :
> >> On Tue, Dec 07, 2010 at 05:22:34PM -0800, Linus Torvalds wrote:
> >> > On Tue, Dec 7, 2010 at 4:04 PM, Greg KH <gregkh@suse.de> wrote:
> >> > >
> >> > > From: Robin Holt <holt@sgi.com>
> >> > >
> >> > > [ Problem was fixed differently upstream. -DaveM ]
> >> >
> >> > Gaah. I'd really like to see more of a description for things like
> >> > this. A commit ID for the alternate fix, or at least a few words about
> >> > the different fix or reason why upstream doesn't need the stable
> >> > commit.
> >>
> >> I'll let David confirm this, he's the one who sent it to me :)
> >
> > upstream uses commit 8d987e5c7510 (net: avoid limits overflow)
> >
> > This commit is a bit more untrusive for stable kernels :
> >
> > It depends on :
> > a9febbb4bd13 (sysctl: min/max bounds are optional)
> > 27b3d80a7b6a (sysctl: fix min/max handling in __do_proc_doulongvec_minmax())
>
> Yep, this is the case. Greg, you can add a reference to:
>
> a9febbb4bd13
> 27b3d80a7b6a
> 8d987e5c7510
>
> in my "[ ... ]" in the commit message to clear this up.
Now added, thanks.
greg k-h
^ permalink raw reply
* Re: [stable] [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Greg KH @ 2010-12-08 23:06 UTC (permalink / raw)
To: David Miller
Cc: eric.dumazet, lkml20101129, netdev, jesse, linux-kernel, greearb,
stable
In-Reply-To: <20101208.084731.189716071.davem@davemloft.net>
On Wed, Dec 08, 2010 at 08:47:31AM -0800, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 01 Dec 2010 11:55:14 +0100
>
>
> Greg/-stable, please integrate this patch from Eric into 2.6.36 if you
> haven't already done so.
It looks like I took a different, older version, I'll update it to this
one now.
thanks,
greg k-h
^ 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