* Re: [PATCH v4] net-netlink: Add a new attribute to expose TOS values via netlink
From: Stephen Hemminger @ 2011-10-12 19:08 UTC (permalink / raw)
To: Muraliraja Muniraju
Cc: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, linux-kernel, netdev
In-Reply-To: <1318446035-10267-1-git-send-email-muralira@google.com>
On Wed, 12 Oct 2011 12:00:35 -0700
Muraliraja Muniraju <muralira@google.com> wrote:
> From: Murali Raja <muralira@google.com>
>
> This patch exposes the tos value for the TCP sockets when the TOS flag
> is requested in the ext_flags for the inet_diag request. This would mainly be
> used to expose TOS values for both for TCP and UDP sockets. Currently it is
> supported for TCP. When netlink support for UDP would be added the support
> to expose the TOS values would alse be done. For IPV4 tos value is exposed
> and for IPV6 tclass value is exposed.
>
> Signed-off-by: Murali Raja <muralira@google.com>
> ---
> Changelog since v3:
> - Removed the tos structure from the inet_diag.h
>
> Changelog since v2:
> - Added support for IPv6 and used better API.
>
> Changelog since v3:
> - Removed reserved fields.
After this is accepted; it is trivial to add support to ss command.
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
^ permalink raw reply
* [PATCH v4] net-netlink: Add a new attribute to expose TOS values via netlink
From: Muraliraja Muniraju @ 2011-10-12 19:00 UTC (permalink / raw)
To: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy <kabe
Cc: linux-kernel, netdev, Murali Raja
In-Reply-To: <20111012085235.3b78729b@nehalam.linuxnetplumber.net>
From: Murali Raja <muralira@google.com>
This patch exposes the tos value for the TCP sockets when the TOS flag
is requested in the ext_flags for the inet_diag request. This would mainly be
used to expose TOS values for both for TCP and UDP sockets. Currently it is
supported for TCP. When netlink support for UDP would be added the support
to expose the TOS values would alse be done. For IPV4 tos value is exposed
and for IPV6 tclass value is exposed.
Signed-off-by: Murali Raja <muralira@google.com>
---
Changelog since v3:
- Removed the tos structure from the inet_diag.h
Changelog since v2:
- Added support for IPv6 and used better API.
Changelog since v3:
- Removed reserved fields.
include/linux/inet_diag.h | 3 ++-
net/ipv4/inet_diag.c | 5 +++++
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
index bc8c490..80b480c 100644
--- a/include/linux/inet_diag.h
+++ b/include/linux/inet_diag.h
@@ -97,9 +97,10 @@ enum {
INET_DIAG_INFO,
INET_DIAG_VEGASINFO,
INET_DIAG_CONG,
+ INET_DIAG_TOS,
};
-#define INET_DIAG_MAX INET_DIAG_CONG
+#define INET_DIAG_MAX INET_DIAG_TOS
/* INET_DIAG_MEM */
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 389a2e6..f5e2bda 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -108,6 +108,9 @@ static int inet_csk_diag_fill(struct sock *sk,
icsk->icsk_ca_ops->name);
}
+ if ((ext & (1 << (INET_DIAG_TOS - 1))) && (sk->sk_family != AF_INET6))
+ RTA_PUT_U8(skb, INET_DIAG_TOS, inet->tos);
+
r->idiag_family = sk->sk_family;
r->idiag_state = sk->sk_state;
r->idiag_timer = 0;
@@ -130,6 +133,8 @@ static int inet_csk_diag_fill(struct sock *sk,
&np->rcv_saddr);
ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst,
&np->daddr);
+ if (ext & (1 << (INET_DIAG_TOS - 1)))
+ RTA_PUT_U8(skb, INET_DIAG_TOS, np->tclass);
}
#endif
--
1.7.3.1
^ permalink raw reply related
* Re: [PATCH v3] net-netlink: Add a new attribute to expose TOS values via netlink
From: MuraliRaja Muniraju @ 2011-10-12 19:00 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, linux-kernel, netdev
In-Reply-To: <1318393869.3686.26.camel@edumazet-laptop>
Hi Eric,
I am planning to not add code for the TIME_WAIT case as the tos
values are zero as they are not saved. Please let me if this is OK.
Thanks,
Murali
On Tue, Oct 11, 2011 at 9:31 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le mardi 11 octobre 2011 à 21:16 -0700, MuraliRaja Muniraju a écrit :
>> Eric,
>> I think it would be useful to expose the values this way.
>> I shall make the changes to add TCLASS for ipv6 in the description.
>>
>> Regarding the TIME_WAIT state, I think it would be better of not
>> exposing the values because there would hardly be anything to transmit
>> during this time.
>>
>
> My remark had nothing to do with your patch actually :
>
> We dont store TOS/TCLASS on TIME_WAIT sockets, so you cannot report
> value in inet_diag.
>
> But we do send packets on behalf of TIME_WAIT sockets ;)
>
> Think about ACK messages. They probably are sent with a 0 TOS/TCLASS
> field... I am not sure its a problem or not.
>
>
>
>
--
Thanks,
Murali
^ permalink raw reply
* [PATCH 1/1] net: hold sock reference while processing tx timestamps
From: Richard Cochran @ 2011-10-12 18:36 UTC (permalink / raw)
To: netdev; +Cc: David Miller, Eric Dumazet, Johannes Berg, stable
In-Reply-To: <1318007501.3988.20.camel@jlt3.sipsolutions.net>
The pair of functions,
* skb_clone_tx_timestamp()
* skb_complete_tx_timestamp()
were designed to allow timestamping in PHY devices. The first
function, called during the MAC driver's hard_xmit method, identifies
PTP protocol packets, clones them, and gives them to the PHY device
driver. The PHY driver may hold onto the packet and deliver it at a
later time using the second function, which adds the packet to the
socket's error queue.
As pointed out by Johannes, nothing prevents the socket from
disappearing while the cloned packet is sitting in the PHY driver
awaiting a timestamp. This patch fixes the issue by taking a reference
on the socket for each such packet. In addition, the comments
regarding the usage of these function are expanded to highlight the
rule that PHY drivers must use skb_complete_tx_timestamp() to release
the packet, in order to release the socket reference, too.
These functions first appeared in v2.6.36.
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Cc: <stable@kernel.org>
---
include/linux/phy.h | 2 +-
include/linux/skbuff.h | 7 ++++++-
net/core/timestamping.c | 7 ++++++-
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 54fc413..79f337c 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -420,7 +420,7 @@ struct phy_driver {
/*
* Requests a Tx timestamp for 'skb'. The phy driver promises
- * to deliver it to the socket's error queue as soon as a
+ * to deliver it using skb_complete_tx_timestamp() as soon as a
* timestamp becomes available. One of the PTP_CLASS_ values
* is passed in 'type'.
*/
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 8bd383c..0f96646 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2020,8 +2020,13 @@ static inline bool skb_defer_rx_timestamp(struct sk_buff *skb)
/**
* skb_complete_tx_timestamp() - deliver cloned skb with tx timestamps
*
+ * PHY drivers may accept clones of transmitted packets for
+ * timestamping via their phy_driver.txtstamp method. These drivers
+ * must call this function to return the skb back to the stack, with
+ * or without a timestamp.
+ *
* @skb: clone of the the original outgoing packet
- * @hwtstamps: hardware time stamps
+ * @hwtstamps: hardware time stamps, may be NULL if not available
*
*/
void skb_complete_tx_timestamp(struct sk_buff *skb,
diff --git a/net/core/timestamping.c b/net/core/timestamping.c
index 98a5264..29e59d6 100644
--- a/net/core/timestamping.c
+++ b/net/core/timestamping.c
@@ -60,6 +60,7 @@ void skb_clone_tx_timestamp(struct sk_buff *skb)
clone = skb_clone(skb, GFP_ATOMIC);
if (!clone)
return;
+ sock_hold(sk);
clone->sk = sk;
phydev->drv->txtstamp(phydev, clone, type);
}
@@ -77,8 +78,11 @@ void skb_complete_tx_timestamp(struct sk_buff *skb,
struct sock_exterr_skb *serr;
int err;
- if (!hwtstamps)
+ if (!hwtstamps) {
+ sock_put(sk);
+ kfree_skb(skb);
return;
+ }
*skb_hwtstamps(skb) = *hwtstamps;
serr = SKB_EXT_ERR(skb);
@@ -87,6 +91,7 @@ void skb_complete_tx_timestamp(struct sk_buff *skb,
serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING;
skb->sk = NULL;
err = sock_queue_err_skb(sk, skb);
+ sock_put(sk);
if (err)
kfree_skb(skb);
}
--
1.7.2.5
^ permalink raw reply related
* [PATCH 3/3] netdev/phy: Add driver for Broadcom BCM8706 10G Ethernet PHY
From: David Daney @ 2011-10-12 18:06 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA, davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: afleming-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <1318442783-29058-1-git-send-email-david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Add a driver and PHY_ID number for said device. This is a 10Gig PHY
which uses MII_ADDR_C45 addressing, it is always 10G full duplex, so
there is no autonegotiation. All we do is report link state and send
interrupts when it changes.
If the PHY has a device tree of_node associated with it, the
"broadcom,c45-reg-init" property is used to supply register
initialization values when config_init() is called.
Signed-off-by: David Daney <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
---
.../devicetree/bindings/net/broadcom-bcm8706.txt | 28 +++
drivers/net/phy/Kconfig | 5 +
drivers/net/phy/Makefile | 1 +
drivers/net/phy/bcm8706.c | 212 ++++++++++++++++++++
include/linux/brcmphy.h | 1 +
5 files changed, 247 insertions(+), 0 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/broadcom-bcm8706.txt
create mode 100644 drivers/net/phy/bcm8706.c
diff --git a/Documentation/devicetree/bindings/net/broadcom-bcm8706.txt b/Documentation/devicetree/bindings/net/broadcom-bcm8706.txt
new file mode 100644
index 0000000..d58bea9
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/broadcom-bcm8706.txt
@@ -0,0 +1,28 @@
+The Broadcom BCM8706 is a 10G Ethernet PHY. It has these bindings in
+addition to the standard PHY bindings.
+
+Compatible: Should contain "broadcom,bcm8706" and
+ "ethernet-phy-ieee802.3-c45"
+
+Optional Properties:
+
+- broadcom,c45-reg-init : one of more sets of 4 cells. The first cell
+ is the device type, the second a register address, the third cell
+ contains a mask to be ANDed with the existing register value, and
+ the fourth cell is ORed with he result to yield the new register
+ value.
+
+Example:
+
+ ethernet-phy@5 {
+ reg = <5>;
+ compatible = "broadcom,bcm8706", "ethernet-phy-ieee802.3-c45";
+ interrupt-parent = <&gpio>;
+ interrupts = <12 8>; /* Pin 12, active low */
+ /*
+ * Set PMD Digital Control Register for
+ * GPIO[1] Tx/Rx
+ * GPIO[0] R64 Sync Acquired
+ */
+ broadcom,c45-reg-init = <1 0xc808 0xff8f 0x70>;
+ };
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 59b3b17..a99885f 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -62,6 +62,11 @@ config BCM63XX_PHY
---help---
Currently supports the 6348 and 6358 PHYs.
+config BCM8706_PHY
+ tristate "Driver for Broadcom BCM8706 10G Ethernet PHY"
+ help
+ Currently supports only the BCM8706 PHY.
+
config ICPLUS_PHY
tristate "Drivers for ICPlus PHYs"
---help---
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index d1a1927..ec46398 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_SMSC_PHY) += smsc.o
obj-$(CONFIG_VITESSE_PHY) += vitesse.o
obj-$(CONFIG_BROADCOM_PHY) += broadcom.o
obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o
+obj-$(CONFIG_BCM8706_PHY) += bcm8706.o
obj-$(CONFIG_ICPLUS_PHY) += icplus.o
obj-$(CONFIG_REALTEK_PHY) += realtek.o
obj-$(CONFIG_LSI_ET1011C_PHY) += et1011c.o
diff --git a/drivers/net/phy/bcm8706.c b/drivers/net/phy/bcm8706.c
new file mode 100644
index 0000000..3a23e04
--- /dev/null
+++ b/drivers/net/phy/bcm8706.c
@@ -0,0 +1,212 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2011 Cavium, Inc.
+ */
+
+#include <linux/module.h>
+#include <linux/phy.h>
+#include <linux/brcmphy.h>
+#include <linux/of.h>
+
+#define BCM8706_PMD_RX_SIGNAL_DETECT (MII_ADDR_C45 | 0x1000a)
+#define BCM8706_10GBASER_PCS_STATUS (MII_ADDR_C45 | 0x30020)
+#define BCM8706_XGXS_LANE_STATUS (MII_ADDR_C45 | 0x40018)
+
+#define BCM8706_LASI_CONTROL (MII_ADDR_C45 | 0x39002)
+#define BCM8706_LASI_STATUS (MII_ADDR_C45 | 0x39005)
+
+#ifdef CONFIG_OF_MDIO
+/*
+ * Set and/or override some configuration registers based on the
+ * broadcom,c45-reg-init property stored in the of_node for the phydev.
+ *
+ * broadcom,c45-reg-init = <devid reg mask value>,...;
+ *
+ * There may be one or more sets of <devid reg mask value>:
+ *
+ * devid: which sub-device to use.
+ * reg: the register.
+ * mask: if non-zero, ANDed with existing register value.
+ * value: ORed with the masked value and written to the regiser.
+ *
+ */
+static int bcm8706_of_reg_init(struct phy_device *phydev)
+{
+ const __be32 *paddr;
+ int len, i, ret;
+
+ if (!phydev->dev.of_node)
+ return 0;
+
+ paddr = of_get_property(phydev->dev.of_node,
+ "broadcom,c45-reg-init", &len);
+ if (!paddr || len < (4 * sizeof(*paddr)))
+ return 0;
+
+ ret = 0;
+ len /= sizeof(*paddr);
+ for (i = 0; i < len - 3; i += 4) {
+ u16 devid = be32_to_cpup(paddr + i);
+ u16 reg = be32_to_cpup(paddr + i + 1);
+ u16 mask = be32_to_cpup(paddr + i + 2);
+ u16 val_bits = be32_to_cpup(paddr + i + 3);
+ int val;
+ u32 regnum = MII_ADDR_C45 | (devid << 16) | reg;
+ val = 0;
+ if (mask) {
+ val = phy_read(phydev, regnum);
+ if (val < 0) {
+ ret = val;
+ goto err;
+ }
+ val &= mask;
+ }
+ val |= val_bits;
+
+ ret = phy_write(phydev, regnum, val);
+ if (ret < 0)
+ goto err;
+
+ }
+err:
+ return ret;
+}
+#else
+static int bcm8706_of_reg_init(struct phy_device *phydev)
+{
+ return 0;
+}
+#endif /* CONFIG_OF_MDIO */
+
+static int bcm8706_config_init(struct phy_device *phydev)
+{
+ phydev->supported = SUPPORTED_10000baseR_FEC;
+ phydev->advertising = ADVERTISED_10000baseR_FEC;
+ phydev->state = PHY_NOLINK;
+
+ bcm8706_of_reg_init(phydev);
+
+ return 0;
+}
+
+static int bcm8706_config_aneg(struct phy_device *phydev)
+{
+ return -EINVAL;
+}
+
+static int bcm8706_read_status(struct phy_device *phydev)
+{
+ int rx_signal_detect;
+ int pcs_status;
+ int xgxs_lane_status;
+
+ rx_signal_detect = phy_read(phydev, BCM8706_PMD_RX_SIGNAL_DETECT);
+ if (rx_signal_detect < 0)
+ return rx_signal_detect;
+
+ if ((rx_signal_detect & 1) == 0)
+ goto no_link;
+
+ pcs_status = phy_read(phydev, BCM8706_10GBASER_PCS_STATUS);
+ if (pcs_status < 0)
+ return pcs_status;
+
+ if ((pcs_status & 1) == 0)
+ goto no_link;
+
+ xgxs_lane_status = phy_read(phydev, BCM8706_XGXS_LANE_STATUS);
+ if (xgxs_lane_status < 0)
+ return xgxs_lane_status;
+
+ if ((xgxs_lane_status & 0x1000) == 0)
+ goto no_link;
+
+ phydev->speed = 10000;
+ phydev->link = 1;
+ phydev->duplex = 1;
+ return 0;
+
+no_link:
+ phydev->link = 0;
+ return 0;
+}
+
+static int bcm8706_config_intr(struct phy_device *phydev)
+{
+ int reg, err;
+
+ reg = phy_read(phydev, BCM8706_LASI_CONTROL);
+
+ if (reg < 0)
+ return reg;
+
+ if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
+ reg |= 1;
+ else
+ reg &= ~1;
+
+ err = phy_write(phydev, BCM8706_LASI_CONTROL, reg);
+ return err;
+}
+
+static int bcm8706_did_interrupt(struct phy_device *phydev)
+{
+ int reg;
+
+ reg = phy_read(phydev, BCM8706_LASI_STATUS);
+
+ if (reg < 0) {
+ dev_err(&phydev->dev,
+ "Error: Read of BCM8706_LASI_STATUS failed: %d\n", reg);
+ return 0;
+ }
+ return (reg & 1) != 0;
+}
+
+static int bcm8706_ack_interrupt(struct phy_device *phydev)
+{
+ /* Reading the LASI status clears it. */
+ bcm8706_did_interrupt(phydev);
+ return 0;
+}
+
+
+static struct phy_driver bcm8706_driver = {
+ .phy_id = PHY_ID_BCM8706,
+ .phy_id_mask = 0xffffffff,
+ .name = "Broadcom BCM8706",
+ .flags = PHY_HAS_INTERRUPT,
+ .config_init = bcm8706_config_init,
+ .config_aneg = bcm8706_config_aneg,
+ .read_status = bcm8706_read_status,
+ .ack_interrupt = bcm8706_ack_interrupt,
+ .config_intr = bcm8706_config_intr,
+ .did_interrupt = bcm8706_did_interrupt,
+ .driver = { .owner = THIS_MODULE },
+};
+
+static int __init bcm8706_init(void)
+{
+ int ret;
+
+ ret = phy_driver_register(&bcm8706_driver);
+
+ return ret;
+}
+module_init(bcm8706_init);
+
+static void __exit bcm8706_exit(void)
+{
+ phy_driver_unregister(&bcm8706_driver);
+}
+module_exit(bcm8706_exit);
+
+static struct mdio_device_id __maybe_unused bcm8706_tbl[] = {
+ { PHY_ID_BCM8706, 0xffffffff },
+ { }
+};
+
+MODULE_DEVICE_TABLE(mdio, bcm8706_tbl);
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index b840a49..e06a56a 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -9,6 +9,7 @@
#define PHY_ID_BCM5464 0x002060b0
#define PHY_ID_BCM5461 0x002060c0
#define PHY_ID_BCM57780 0x03625d90
+#define PHY_ID_BCM8706 0x0143bdc1
#define PHY_BCM_OUI_MASK 0xfffffc00
#define PHY_BCM_OUI_1 0x00206000
--
1.7.2.3
^ permalink raw reply related
* [PATCH 2/3] netdev/phy/of: Handle IEEE802.3 clause 45 Ethernet PHYs in of_mdiobus_register()
From: David Daney @ 2011-10-12 18:06 UTC (permalink / raw)
To: devicetree-discuss, grant.likely, linux-kernel, netdev, davem
Cc: afleming, David Daney
In-Reply-To: <1318442783-29058-1-git-send-email-david.daney@cavium.com>
Define two new "compatible" values for Ethernet
PHYs. "ethernet-phy-ieee802.3-c22" and "ethernet-phy-ieee802.3-c45"
are used to indicate a PHY uses the corresponding protocol.
If a PHY is "compatible" with "ethernet-phy-ieee802.3-c45", we
indicate this so that get_phy_device() can properly probe the device.
Signed-off-by: David Daney <david.daney@cavium.com>
---
Documentation/devicetree/bindings/net/phy.txt | 12 +++++++++++-
drivers/of/of_mdio.c | 4 ++++
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/phy.txt b/Documentation/devicetree/bindings/net/phy.txt
index bb8c742..de9cb32 100644
--- a/Documentation/devicetree/bindings/net/phy.txt
+++ b/Documentation/devicetree/bindings/net/phy.txt
@@ -16,8 +16,18 @@ Required properties:
Example:
+Optional Properties:
+
+- compatible: Compatible list, may contain "ethernet-phy-ieee802.3-c22" or
+ "ethernet-phy-ieee802.3-c45" for PHYs that implement
+ IEEE802.3 clause 22 or IEEE802.3 clause 45
+ specifications. If neither of these are specified, the
+ default is to assume clause 22. The compatible list may
+ also contain other elements.
+
ethernet-phy@0 {
- linux,phandle = <2452000>
+ compatible = "ethernet-phy-ieee802.3-c22";
+ linux,phandle = <2452000>;
interrupt-parent = <40000>;
interrupts = <35 1>;
reg = <0>;
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index 7c28e8c..f837a7f 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -79,6 +79,10 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
mdio->irq[addr] = PHY_POLL;
}
+ if (of_device_is_compatible(child,
+ "ethernet-phy-ieee802.3-c45"))
+ addr |= MII_ADDR_C45;
+
phy = get_phy_device(mdio, addr);
if (!phy || IS_ERR(phy)) {
dev_err(&mdio->dev, "error probing PHY at address %i\n",
--
1.7.2.3
^ permalink raw reply related
* [PATCH 1/3] netdev/phy: Handle IEEE802.3 clause 45 Ethernet PHYs
From: David Daney @ 2011-10-12 18:06 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA, davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: afleming-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <1318442783-29058-1-git-send-email-david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
The IEEE802.3 clause 45 MDIO bus protocol allows for directly
addressing PHY registers using a 21 bit address, and is used by many
10G Ethernet PHYS. Already existing is the ability of MDIO bus
drivers to use clause 45, with the MII_ADDR_C45 flag. Here we add
some support in the PHY and device tree infrastructure to use these
PHYs.
Normally the MII_ADDR_C45 flag is ORed with the register address to
indicate a clause 45 transaction. Here we also use this flag in the
*device* address passed to get_phy_id() and get_phy_device() to
indicate that probing should be done with clause 45 transactions. If
a PHY is successfully probed with MII_ADDR_C45, the new struct
phy_device is_c45 flag is set for the PHY.
Signed-off-by: David Daney <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
---
drivers/net/phy/phy_device.c | 25 ++++++++++++++++++++++---
include/linux/phy.h | 3 +++
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 83a5a5a..7e4d61b 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -171,6 +171,8 @@ static struct phy_device* phy_device_create(struct mii_bus *bus,
dev->autoneg = AUTONEG_ENABLE;
+ dev->is_c45 = (addr & MII_ADDR_C45) != 0;
+ addr &= ~MII_ADDR_C45;
dev->addr = addr;
dev->phy_id = phy_id;
dev->bus = bus;
@@ -205,15 +207,24 @@ static struct phy_device* phy_device_create(struct mii_bus *bus,
* @phy_id: where to store the ID retrieved.
*
* Description: Reads the ID registers of the PHY at @addr on the
- * @bus, stores it in @phy_id and returns zero on success.
+ * @bus, stores it in @phy_id and returns zero on success. If the
+ * @addr has been ORed with MII_ADDR_C45, mdio clause 45 data
+ * transfer is used to read ID from the PHY device, otherwise the
+ * standard protocol (clause 22) is used.
*/
int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id)
{
int phy_reg;
+ u32 c45_reg_base = 0;
+ if (addr & MII_ADDR_C45) {
+ addr &= ~MII_ADDR_C45;
+ /* Access the PHY's PHY XS registers with C45 mode. */
+ c45_reg_base = MII_ADDR_C45 | 0x40000;
+ }
/* Grab the bits from PHYIR1, and put them
* in the upper half */
- phy_reg = mdiobus_read(bus, addr, MII_PHYSID1);
+ phy_reg = mdiobus_read(bus, addr, c45_reg_base | MII_PHYSID1);
if (phy_reg < 0)
return -EIO;
@@ -221,7 +232,7 @@ int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id)
*phy_id = (phy_reg & 0xffff) << 16;
/* Grab the bits from PHYIR2, and put them in the lower half */
- phy_reg = mdiobus_read(bus, addr, MII_PHYSID2);
+ phy_reg = mdiobus_read(bus, addr, c45_reg_base | MII_PHYSID2);
if (phy_reg < 0)
return -EIO;
@@ -239,6 +250,9 @@ EXPORT_SYMBOL(get_phy_id);
*
* Description: Reads the ID registers of the PHY at @addr on the
* @bus, then allocates and returns the phy_device to represent it.
+ * If the @addr has been ORed with MII_ADDR_C45, mdio clause 45 data
+ * transfer is used to read the PHY device, otherwise the standard
+ * protocol (clause 22) is used.
*/
struct phy_device * get_phy_device(struct mii_bus *bus, int addr)
{
@@ -447,6 +461,11 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
/* Assume that if there is no driver, that it doesn't
* exist, and we should use the genphy driver. */
if (NULL == d->driver) {
+ if (phydev->is_c45) {
+ pr_err("No driver for phy %x\n", phydev->phy_id);
+ return -ENODEV;
+ }
+
d->driver = &genphy_driver.driver;
err = d->driver->probe(d);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index e4c3844..0a25e2c 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -246,6 +246,7 @@ struct sk_buff;
* phy_id: UID for this device found during discovery
* state: state of the PHY for management purposes
* dev_flags: Device-specific flags used by the PHY driver.
+ * is_c45: Set to 1 if this phy uses clause 45 addressing.
* addr: Bus address of PHY
* link_timeout: The number of timer firings to wait before the
* giving up on the current attempt at acquiring a link
@@ -283,6 +284,8 @@ struct phy_device {
u32 dev_flags;
+ unsigned int is_c45:1;
+
phy_interface_t interface;
/* Bus address of the PHY (0-31) */
--
1.7.2.3
^ permalink raw reply related
* [PATCH 0/3] netdev/phy/of: Improve 10G Ethernet PHY support.
From: David Daney @ 2011-10-12 18:06 UTC (permalink / raw)
To: devicetree-discuss, grant.likely, linux-kernel, netdev, davem
Cc: afleming, David Daney
The PHY driver core needs a couple of adjustments to be able to
support 10G PHYs. The main issue being that they use a different MDIO
bus protocol (IEEE802.3 clause 45).
The changes are not large:
1) The addr argument to get_phy_id() and get_phy_device() can be
flagged to indicate clause 45 addressing.
2) The device tree helper of_mdiobus_register() uses a new
"compatible" value to hook up the 10G phys.
3) A driver for the BCM8706 which makes use of it all.
David Daney (3):
netdev/phy: Handle IEEE802.3 clause 45 Ethernet PHYs
netdev/phy/of: Handle IEEE802.3 clause 45 Ethernet PHYs in
of_mdiobus_register()
netdev/phy: Add driver for Broadcom BCM8706 10G Ethernet PHY
.../devicetree/bindings/net/broadcom-bcm8706.txt | 28 +++
Documentation/devicetree/bindings/net/phy.txt | 12 +-
drivers/net/phy/Kconfig | 5 +
drivers/net/phy/Makefile | 1 +
drivers/net/phy/bcm8706.c | 212 ++++++++++++++++++++
drivers/net/phy/phy_device.c | 25 ++-
drivers/of/of_mdio.c | 4 +
include/linux/brcmphy.h | 1 +
include/linux/phy.h | 3 +
9 files changed, 287 insertions(+), 4 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/broadcom-bcm8706.txt
create mode 100644 drivers/net/phy/bcm8706.c
--
1.7.2.3
^ permalink raw reply
* Re: Seamless Service Restart / Port Takeover
From: Rick Jones @ 2011-10-12 17:14 UTC (permalink / raw)
To: Olaf van der Spek; +Cc: netdev
In-Reply-To: <CAGVGHmuVnsw4mdsxO=93yaYRgGaj20gR0+nNB_iaS=nTM_BThw@mail.gmail.com>
On 10/12/2011 09:53 AM, Olaf van der Spek wrote:
> Hi,
>
> When restarting a service, a webserver for example, you'd like this to
> be seamless for clients. Often, first a signal is send to the old
> process to close listening sockets, then the new process is started.
> This has both a race condition (sometimes 'avoided' with a sleep in
> between) and service interruption.
> Wouldn't it be possible to introduce mv / move like behaviour, where
> the socket can be rebound without races and without interruption?
I believe you can do that today if you write the application such that
the old instance, before it closes the listen endpoint and terminates,
instead passes access to it to the new instance via a Unix domain socket
between the two.
rick jones
^ permalink raw reply
* Seamless Service Restart / Port Takeover
From: Olaf van der Spek @ 2011-10-12 16:53 UTC (permalink / raw)
To: netdev
Hi,
When restarting a service, a webserver for example, you'd like this to
be seamless for clients. Often, first a signal is send to the old
process to close listening sockets, then the new process is started.
This has both a race condition (sometimes 'avoided' with a sleep in
between) and service interruption.
Wouldn't it be possible to introduce mv / move like behaviour, where
the socket can be rebound without races and without interruption?
Olaf
^ permalink raw reply
* Re: [PATCH] IPVS netns shutdown/startup dead-lock
From: Pablo Neira Ayuso @ 2011-10-12 16:33 UTC (permalink / raw)
To: Simon Horman
Cc: Patrick McHardy, lvs-devel, netdev, netfilter-devel,
Wensong Zhang, Julian Anastasov, David Miller, Hans Schillstrom
In-Reply-To: <1318298075-23501-2-git-send-email-horms@verge.net.au>
On Tue, Oct 11, 2011 at 10:54:35AM +0900, Simon Horman wrote:
> From: Hans Schillstrom <hans@schillstrom.com>
>
> ip_vs_mutext is used by both netns shutdown code and startup
> and both implicit uses sk_lock-AF_INET mutex.
>
> cleanup CPU-1 startup CPU-2
> ip_vs_dst_event() ip_vs_genl_set_cmd()
> sk_lock-AF_INET __ip_vs_mutex
> sk_lock-AF_INET
> __ip_vs_mutex
> * DEAD LOCK *
>
> A new mutex placed in ip_vs netns struct called sync_mutex is added.
>
> Comments from Julian and Simon added.
> This patch has been running for more than 3 month now and it seems to work.
>
> Ver. 3
> IP_VS_SO_GET_DAEMON in do_ip_vs_get_ctl protected by sync_mutex
> instead of __ip_vs_mutex as sugested by Julian.
Applied, thanks Simon.
http://1984.lsi.us.es/git/?p=net/.git;a=shortlog;h=refs/heads/nf
^ permalink raw reply
* [PATCH net-next 3/5] igbvf: Convert printks to pr_<level>
From: Joe Perches @ 2011-10-12 16:18 UTC (permalink / raw)
To: Jeff Kirsher, linux-kernel
Cc: netdev, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, Peter P Waskiewicz Jr, Alex Duyck,
John Ronciak, e1000-devel
In-Reply-To: <cover.1318436085.git.joe@perches.com>
Use current logging styles.
Prefix all output via #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Neaten link status dev_info.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ethernet/intel/igbvf/netdev.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index b3d760b..952ffcd 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -25,6 +25,8 @@
*******************************************************************************/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/types.h>
#include <linux/init.h>
@@ -51,7 +53,7 @@ const char igbvf_driver_version[] = DRV_VERSION;
static const char igbvf_driver_string[] =
"Intel(R) Virtual Function Network Driver";
static const char igbvf_copyright[] =
- "Copyright (c) 2009 - 2010 Intel Corporation.";
+ "Copyright (c) 2009 - 2010 Intel Corporation";
static int igbvf_poll(struct napi_struct *napi, int budget);
static void igbvf_reset(struct igbvf_adapter *);
@@ -1746,10 +1748,9 @@ void igbvf_update_stats(struct igbvf_adapter *adapter)
static void igbvf_print_link_info(struct igbvf_adapter *adapter)
{
- dev_info(&adapter->pdev->dev, "Link is Up %d Mbps %s\n",
+ dev_info(&adapter->pdev->dev, "Link is Up %d Mbps %s Duplex\n",
adapter->link_speed,
- ((adapter->link_duplex == FULL_DUPLEX) ?
- "Full Duplex" : "Half Duplex"));
+ adapter->link_duplex == FULL_DUPLEX ? "Full" : "Half");
}
static bool igbvf_has_link(struct igbvf_adapter *adapter)
@@ -2825,9 +2826,8 @@ static struct pci_driver igbvf_driver = {
static int __init igbvf_init_module(void)
{
int ret;
- printk(KERN_INFO "%s - version %s\n",
- igbvf_driver_string, igbvf_driver_version);
- printk(KERN_INFO "%s\n", igbvf_copyright);
+ pr_info("%s - version %s\n", igbvf_driver_string, igbvf_driver_version);
+ pr_info("%s\n", igbvf_copyright);
ret = pci_register_driver(&igbvf_driver);
--
1.7.6.405.gc1be0
^ permalink raw reply related
* [PATCH net-next 5/5] igb: Convert bare printk to pr_notice
From: Joe Perches @ 2011-10-12 16:18 UTC (permalink / raw)
To: Jeff Kirsher, linux-kernel
Cc: netdev, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, Peter P Waskiewicz Jr, Alex Duyck,
John Ronciak, e1000-devel
In-Reply-To: <cover.1318436085.git.joe@perches.com>
printks should use KERN_ levels.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ethernet/intel/igb/e1000_82575.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index c0857bd..e0acfff 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -29,6 +29,8 @@
* e1000_82576
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/types.h>
#include <linux/if_ether.h>
@@ -248,8 +250,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
* Check for invalid size
*/
if ((hw->mac.type == e1000_82576) && (size > 15)) {
- printk("igb: The NVM size is not valid, "
- "defaulting to 32K.\n");
+ pr_notice("The NVM size is not valid, defaulting to 32K\n");
size = 15;
}
nvm->word_size = 1 << size;
--
1.7.6.405.gc1be0
^ permalink raw reply related
* [PATCH net-next 4/5] igb: Convert printks to pr_<level>
From: Joe Perches @ 2011-10-12 16:18 UTC (permalink / raw)
To: Jeff Kirsher, linux-kernel
Cc: netdev, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, Peter P Waskiewicz Jr, Alex Duyck,
John Ronciak, e1000-devel
In-Reply-To: <cover.1318436085.git.joe@perches.com>
Use the current logging styles.
pr_<level> conversions are now prefixed with "igb: "
Correct a defect where the trailing NTU may have been printed
on a separate line because of an interleaving hex_dump.
Remove unnecessary uses of KERN_CONT and use single pr_info()s
to avoid any possible output interleaving from other modules.
Coalesce formats as appropriate.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 155 +++++++++++++---------------
1 files changed, 72 insertions(+), 83 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 10670f9..37c0000 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -25,6 +25,8 @@
*******************************************************************************/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/types.h>
#include <linux/init.h>
@@ -65,7 +67,7 @@ char igb_driver_name[] = "igb";
char igb_driver_version[] = DRV_VERSION;
static const char igb_driver_string[] =
"Intel(R) Gigabit Ethernet Network Driver";
-static const char igb_copyright[] = "Copyright (c) 2007-2011 Intel Corporation.";
+static const char igb_copyright[] = "Copyright (c) 2007-2011 Intel Corporation";
static const struct e1000_info *igb_info_tbl[] = {
[board_82575] = &e1000_82575_info,
@@ -318,16 +320,14 @@ static void igb_regdump(struct e1000_hw *hw, struct igb_reg_info *reginfo)
regs[n] = rd32(E1000_TXDCTL(n));
break;
default:
- printk(KERN_INFO "%-15s %08x\n",
+ pr_info("%-15s %08x\n",
reginfo->name, rd32(reginfo->ofs));
return;
}
snprintf(rname, 16, "%s%s", reginfo->name, "[0-3]");
- printk(KERN_INFO "%-15s ", rname);
- for (n = 0; n < 4; n++)
- printk(KERN_CONT "%08x ", regs[n]);
- printk(KERN_CONT "\n");
+ pr_info("%-15s %08x %08x %08x %08x\n",
+ rname, regs[0], regs[1], regs[2], regs[3]);
}
/*
@@ -352,18 +352,17 @@ static void igb_dump(struct igb_adapter *adapter)
/* Print netdevice Info */
if (netdev) {
dev_info(&adapter->pdev->dev, "Net device Info\n");
- printk(KERN_INFO "Device Name state "
- "trans_start last_rx\n");
- printk(KERN_INFO "%-15s %016lX %016lX %016lX\n",
- netdev->name,
- netdev->state,
- netdev->trans_start,
- netdev->last_rx);
+ pr_info("Device Name state trans_start last_rx\n");
+ pr_info("%-15s %016lX %016lX %016lX\n",
+ netdev->name,
+ netdev->state,
+ netdev->trans_start,
+ netdev->last_rx);
}
/* Print Registers */
dev_info(&adapter->pdev->dev, "Register Dump\n");
- printk(KERN_INFO " Register Name Value\n");
+ pr_info(" Register Name Value\n");
for (reginfo = (struct igb_reg_info *)igb_reg_info_tbl;
reginfo->name; reginfo++) {
igb_regdump(hw, reginfo);
@@ -374,18 +373,17 @@ static void igb_dump(struct igb_adapter *adapter)
goto exit;
dev_info(&adapter->pdev->dev, "TX Rings Summary\n");
- printk(KERN_INFO "Queue [NTU] [NTC] [bi(ntc)->dma ]"
- " leng ntw timestamp\n");
+ pr_info("Queue [NTU] [NTC] [bi(ntc)->dma ] leng ntw timestamp\n");
for (n = 0; n < adapter->num_tx_queues; n++) {
struct igb_tx_buffer *buffer_info;
tx_ring = adapter->tx_ring[n];
buffer_info = &tx_ring->tx_buffer_info[tx_ring->next_to_clean];
- printk(KERN_INFO " %5d %5X %5X %016llX %04X %p %016llX\n",
- n, tx_ring->next_to_use, tx_ring->next_to_clean,
- (u64)buffer_info->dma,
- buffer_info->length,
- buffer_info->next_to_watch,
- (u64)buffer_info->time_stamp);
+ pr_info(" %5d %5X %5X %016llX %04X %p %016llX\n",
+ n, tx_ring->next_to_use, tx_ring->next_to_clean,
+ (u64)buffer_info->dma,
+ buffer_info->length,
+ buffer_info->next_to_watch,
+ (u64)buffer_info->time_stamp);
}
/* Print TX Rings */
@@ -407,36 +405,37 @@ static void igb_dump(struct igb_adapter *adapter)
for (n = 0; n < adapter->num_tx_queues; n++) {
tx_ring = adapter->tx_ring[n];
- printk(KERN_INFO "------------------------------------\n");
- printk(KERN_INFO "TX QUEUE INDEX = %d\n", tx_ring->queue_index);
- printk(KERN_INFO "------------------------------------\n");
- printk(KERN_INFO "T [desc] [address 63:0 ] "
- "[PlPOCIStDDM Ln] [bi->dma ] "
- "leng ntw timestamp bi->skb\n");
+ pr_info("------------------------------------\n");
+ pr_info("TX QUEUE INDEX = %d\n", tx_ring->queue_index);
+ pr_info("------------------------------------\n");
+ pr_info("T [desc] [address 63:0 ] [PlPOCIStDDM Ln] [bi->dma ] leng ntw timestamp bi->skb\n");
for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) {
+ const char *next_desc;
struct igb_tx_buffer *buffer_info;
tx_desc = IGB_TX_DESC(tx_ring, i);
buffer_info = &tx_ring->tx_buffer_info[i];
u0 = (struct my_u0 *)tx_desc;
- printk(KERN_INFO "T [0x%03X] %016llX %016llX %016llX"
- " %04X %p %016llX %p", i,
+ if (i == tx_ring->next_to_use &&
+ i == tx_ring->next_to_clean)
+ next_desc = " NTC/U";
+ else if (i == tx_ring->next_to_use)
+ next_desc = " NTU";
+ else if (i == tx_ring->next_to_clean)
+ next_desc = " NTC";
+ else
+ next_desc = "";
+
+ pr_info("T [0x%03X] %016llX %016llX %016llX"
+ " %04X %p %016llX %p%s\n",
+ i,
le64_to_cpu(u0->a),
le64_to_cpu(u0->b),
(u64)buffer_info->dma,
buffer_info->length,
buffer_info->next_to_watch,
(u64)buffer_info->time_stamp,
- buffer_info->skb);
- if (i == tx_ring->next_to_use &&
- i == tx_ring->next_to_clean)
- printk(KERN_CONT " NTC/U\n");
- else if (i == tx_ring->next_to_use)
- printk(KERN_CONT " NTU\n");
- else if (i == tx_ring->next_to_clean)
- printk(KERN_CONT " NTC\n");
- else
- printk(KERN_CONT "\n");
+ buffer_info->skb, next_desc);
if (netif_msg_pktdata(adapter) && buffer_info->dma != 0)
print_hex_dump(KERN_INFO, "",
@@ -449,11 +448,11 @@ static void igb_dump(struct igb_adapter *adapter)
/* Print RX Rings Summary */
rx_ring_summary:
dev_info(&adapter->pdev->dev, "RX Rings Summary\n");
- printk(KERN_INFO "Queue [NTU] [NTC]\n");
+ pr_info("Queue [NTU] [NTC]\n");
for (n = 0; n < adapter->num_rx_queues; n++) {
rx_ring = adapter->rx_ring[n];
- printk(KERN_INFO " %5d %5X %5X\n", n,
- rx_ring->next_to_use, rx_ring->next_to_clean);
+ pr_info(" %5d %5X %5X\n",
+ n, rx_ring->next_to_use, rx_ring->next_to_clean);
}
/* Print RX Rings */
@@ -485,36 +484,41 @@ rx_ring_summary:
for (n = 0; n < adapter->num_rx_queues; n++) {
rx_ring = adapter->rx_ring[n];
- printk(KERN_INFO "------------------------------------\n");
- printk(KERN_INFO "RX QUEUE INDEX = %d\n", rx_ring->queue_index);
- printk(KERN_INFO "------------------------------------\n");
- printk(KERN_INFO "R [desc] [ PktBuf A0] "
- "[ HeadBuf DD] [bi->dma ] [bi->skb] "
- "<-- Adv Rx Read format\n");
- printk(KERN_INFO "RWB[desc] [PcsmIpSHl PtRs] "
- "[vl er S cks ln] ---------------- [bi->skb] "
- "<-- Adv Rx Write-Back format\n");
+ pr_info("------------------------------------\n");
+ pr_info("RX QUEUE INDEX = %d\n", rx_ring->queue_index);
+ pr_info("------------------------------------\n");
+ pr_info("R [desc] [ PktBuf A0] [ HeadBuf DD] [bi->dma ] [bi->skb] <-- Adv Rx Read format\n");
+ pr_info("RWB[desc] [PcsmIpSHl PtRs] [vl er S cks ln] ---------------- [bi->skb] <-- Adv Rx Write-Back format\n");
for (i = 0; i < rx_ring->count; i++) {
+ const char *next_desc;
struct igb_rx_buffer *buffer_info;
buffer_info = &rx_ring->rx_buffer_info[i];
rx_desc = IGB_RX_DESC(rx_ring, i);
u0 = (struct my_u0 *)rx_desc;
staterr = le32_to_cpu(rx_desc->wb.upper.status_error);
+
+ if (i == rx_ring->next_to_use)
+ next_desc = " NTU";
+ else if (i == rx_ring->next_to_clean)
+ next_desc = " NTC";
+ else
+ next_desc = "";
+
if (staterr & E1000_RXD_STAT_DD) {
/* Descriptor Done */
- printk(KERN_INFO "RWB[0x%03X] %016llX "
- "%016llX ---------------- %p", i,
+ pr_info("%s[0x%03X] %016llX %016llX ---------------- %p%s\n",
+ "RWB", i,
le64_to_cpu(u0->a),
le64_to_cpu(u0->b),
- buffer_info->skb);
+ buffer_info->skb, next_desc);
} else {
- printk(KERN_INFO "R [0x%03X] %016llX "
- "%016llX %016llX %p", i,
+ pr_info("%s[0x%03X] %016llX %016llX %016llX %p%s\n",
+ "R ", i,
le64_to_cpu(u0->a),
le64_to_cpu(u0->b),
(u64)buffer_info->dma,
- buffer_info->skb);
+ buffer_info->skb, next_desc);
if (netif_msg_pktdata(adapter)) {
print_hex_dump(KERN_INFO, "",
@@ -531,14 +535,6 @@ rx_ring_summary:
PAGE_SIZE/2, true);
}
}
-
- if (i == rx_ring->next_to_use)
- printk(KERN_CONT " NTU\n");
- else if (i == rx_ring->next_to_clean)
- printk(KERN_CONT " NTC\n");
- else
- printk(KERN_CONT "\n");
-
}
}
@@ -592,10 +588,10 @@ struct net_device *igb_get_hw_dev(struct e1000_hw *hw)
static int __init igb_init_module(void)
{
int ret;
- printk(KERN_INFO "%s - version %s\n",
+ pr_info("%s - version %s\n",
igb_driver_string, igb_driver_version);
- printk(KERN_INFO "%s\n", igb_copyright);
+ pr_info("%s\n", igb_copyright);
#ifdef CONFIG_IGB_DCA
dca_register_notify(&dca_notifier);
@@ -3676,23 +3672,19 @@ static void igb_watchdog_task(struct work_struct *work)
ctrl = rd32(E1000_CTRL);
/* Links status message must follow this format */
- printk(KERN_INFO "igb: %s NIC Link is Up %d Mbps %s, "
- "Flow Control: %s\n",
+ printk(KERN_INFO "igb: %s NIC Link is Up %d Mbps %s Duplex, Flow Control: %s\n",
netdev->name,
adapter->link_speed,
adapter->link_duplex == FULL_DUPLEX ?
- "Full Duplex" : "Half Duplex",
- ((ctrl & E1000_CTRL_TFCE) &&
- (ctrl & E1000_CTRL_RFCE)) ? "RX/TX" :
- ((ctrl & E1000_CTRL_RFCE) ? "RX" :
- ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None")));
+ "Full" : "Half",
+ (ctrl & E1000_CTRL_TFCE) &&
+ (ctrl & E1000_CTRL_RFCE) ? "RX/TX" :
+ (ctrl & E1000_CTRL_RFCE) ? "RX" :
+ (ctrl & E1000_CTRL_TFCE) ? "TX" : "None");
/* check for thermal sensor event */
if (igb_thermal_sensor_event(hw, E1000_THSTAT_LINK_THROTTLE)) {
- printk(KERN_INFO "igb: %s The network adapter "
- "link speed was downshifted "
- "because it overheated.\n",
- netdev->name);
+ netdev_info(netdev, "The network adapter link speed was downshifted because it overheated\n");
}
/* adjust timeout factor according to speed/duplex */
@@ -3723,10 +3715,7 @@ static void igb_watchdog_task(struct work_struct *work)
/* check for thermal sensor event */
if (igb_thermal_sensor_event(hw, E1000_THSTAT_PWR_DOWN)) {
- printk(KERN_ERR "igb: %s The network adapter "
- "was stopped because it "
- "overheated.\n",
- netdev->name);
+ netdev_err(netdev, "The network adapter was stopped because it overheated\n");
}
/* Links status message must follow this format */
--
1.7.6.405.gc1be0
^ permalink raw reply related
* [PATCH net-next 2/5] ixgbevf: Convert printks to pr_<level>
From: Joe Perches @ 2011-10-12 16:18 UTC (permalink / raw)
To: Jeff Kirsher, linux-kernel
Cc: netdev, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, Peter P Waskiewicz Jr, Alex Duyck,
John Ronciak, e1000-devel
In-Reply-To: <cover.1318436085.git.joe@perches.com>
Use the current logging styles, prefix output with "ixgbevf: "
Add #define pr_fmt
Coalesce formats.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ethernet/intel/ixgbevf/ethtool.c | 6 +++-
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 26 ++++++++++----------
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
index e29ba45..c9c084b 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
@@ -27,6 +27,8 @@
/* ethtool support for ixgbevf */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/types.h>
#include <linux/module.h>
#include <linux/slab.h>
@@ -549,8 +551,8 @@ static const u32 register_test_patterns[] = {
writel((W & M), (adapter->hw.hw_addr + R)); \
val = readl(adapter->hw.hw_addr + R); \
if ((W & M) != (val & M)) { \
- printk(KERN_ERR "set/check reg %04X test failed: got 0x%08X " \
- "expected 0x%08X\n", R, (val & M), (W & M)); \
+ pr_err("set/check reg %04X test failed: got 0x%08X expected 0x%08X\n", \
+ R, (val & M), (W & M)); \
*data = R; \
writel(before, (adapter->hw.hw_addr + R)); \
return 1; \
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 4930c46..51e944d 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -29,6 +29,9 @@
/******************************************************************************
Copyright (c)2006 - 2007 Myricom, Inc. for some LRO specific code
******************************************************************************/
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/types.h>
#include <linux/bitops.h>
#include <linux/module.h>
@@ -1437,7 +1440,7 @@ static int ixgbevf_write_uc_addr_list(struct net_device *netdev)
int count = 0;
if ((netdev_uc_count(netdev)) > 10) {
- printk(KERN_ERR "Too many unicast filters - No Space\n");
+ pr_err("Too many unicast filters - No Space\n");
return -ENOSPC;
}
@@ -2135,7 +2138,7 @@ static int ixgbevf_init_interrupt_scheme(struct ixgbevf_adapter *adapter)
err = ixgbevf_alloc_queues(adapter);
if (err) {
- printk(KERN_ERR "Unable to allocate memory for queues\n");
+ pr_err("Unable to allocate memory for queues\n");
goto err_alloc_queues;
}
@@ -2189,7 +2192,7 @@ static int __devinit ixgbevf_sw_init(struct ixgbevf_adapter *adapter)
} else {
err = hw->mac.ops.init_hw(hw);
if (err) {
- printk(KERN_ERR "init_shared_code failed: %d\n", err);
+ pr_err("init_shared_code failed: %d\n", err);
goto out;
}
}
@@ -2630,8 +2633,7 @@ static int ixgbevf_open(struct net_device *netdev)
* the vf can't start. */
if (hw->adapter_stopped) {
err = IXGBE_ERR_MBX;
- printk(KERN_ERR "Unable to start - perhaps the PF"
- " Driver isn't up yet\n");
+ pr_err("Unable to start - perhaps the PF Driver isn't up yet\n");
goto err_setup_reset;
}
}
@@ -2842,10 +2844,8 @@ static bool ixgbevf_tx_csum(struct ixgbevf_adapter *adapter,
break;
default:
if (unlikely(net_ratelimit())) {
- printk(KERN_WARNING
- "partial checksum but "
- "proto=%x!\n",
- skb->protocol);
+ pr_warn("partial checksum but proto=%x!\n",
+ skb->protocol);
}
break;
}
@@ -3414,7 +3414,7 @@ static int __devinit ixgbevf_probe(struct pci_dev *pdev,
memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
if (!is_valid_ether_addr(netdev->dev_addr)) {
- printk(KERN_ERR "invalid MAC address\n");
+ pr_err("invalid MAC address\n");
err = -EIO;
goto err_sw_init;
}
@@ -3535,10 +3535,10 @@ static struct pci_driver ixgbevf_driver = {
static int __init ixgbevf_init_module(void)
{
int ret;
- printk(KERN_INFO "ixgbevf: %s - version %s\n", ixgbevf_driver_string,
- ixgbevf_driver_version);
+ pr_info("%s - version %s\n",
+ ixgbevf_driver_string, ixgbevf_driver_version);
- printk(KERN_INFO "%s\n", ixgbevf_copyright);
+ pr_info("%s\n", ixgbevf_copyright);
ret = pci_register_driver(&ixgbevf_driver);
return ret;
--
1.7.6.405.gc1be0
^ permalink raw reply related
* [PATCH net-next 1/5] e1000e: Convert printks to pr_<level>
From: Joe Perches @ 2011-10-12 16:18 UTC (permalink / raw)
To: Jeff Kirsher, linux-kernel
Cc: netdev, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, Peter P Waskiewicz Jr, Alex Duyck,
John Ronciak, e1000-devel
In-Reply-To: <cover.1318436085.git.joe@perches.com>
Use the current logging styles.
pr_<level> conversions are now prefixed with "e1000e:"
Correct a couple of defects where the trailing NTU may have
been printed on a separate line because of an interleaving
hex_dump.
Remove unnecessary uses of KERN_CONT and use single pr_info()s
to avoid any possible output interleaving from other modules.
Coalesce formats as appropriate.
Remove an extra space from a broken across lines
coalescing of "Link Status " and " Change".
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 232 ++++++++++++----------------
1 files changed, 102 insertions(+), 130 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 78c5d21..40fcbee 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -163,16 +163,13 @@ static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo)
regs[n] = __er32(hw, E1000_TARC(n));
break;
default:
- printk(KERN_INFO "%-15s %08x\n",
- reginfo->name, __er32(hw, reginfo->ofs));
+ pr_info("%-15s %08x\n",
+ reginfo->name, __er32(hw, reginfo->ofs));
return;
}
snprintf(rname, 16, "%s%s", reginfo->name, "[0-1]");
- printk(KERN_INFO "%-15s ", rname);
- for (n = 0; n < 2; n++)
- printk(KERN_CONT "%08x ", regs[n]);
- printk(KERN_CONT "\n");
+ pr_info("%-15s %08x %08x\n", rname, regs[0], regs[1]);
}
/*
@@ -208,16 +205,15 @@ static void e1000e_dump(struct e1000_adapter *adapter)
/* Print netdevice Info */
if (netdev) {
dev_info(&adapter->pdev->dev, "Net device Info\n");
- printk(KERN_INFO "Device Name state "
- "trans_start last_rx\n");
- printk(KERN_INFO "%-15s %016lX %016lX %016lX\n",
- netdev->name, netdev->state, netdev->trans_start,
- netdev->last_rx);
+ pr_info("Device Name state trans_start last_rx\n");
+ pr_info("%-15s %016lX %016lX %016lX\n",
+ netdev->name, netdev->state, netdev->trans_start,
+ netdev->last_rx);
}
/* Print Registers */
dev_info(&adapter->pdev->dev, "Register Dump\n");
- printk(KERN_INFO " Register Name Value\n");
+ pr_info(" Register Name Value\n");
for (reginfo = (struct e1000_reg_info *)e1000_reg_info_tbl;
reginfo->name; reginfo++) {
e1000_regdump(hw, reginfo);
@@ -228,15 +224,14 @@ static void e1000e_dump(struct e1000_adapter *adapter)
goto exit;
dev_info(&adapter->pdev->dev, "Tx Ring Summary\n");
- printk(KERN_INFO "Queue [NTU] [NTC] [bi(ntc)->dma ]"
- " leng ntw timestamp\n");
+ pr_info("Queue [NTU] [NTC] [bi(ntc)->dma ] leng ntw timestamp\n");
buffer_info = &tx_ring->buffer_info[tx_ring->next_to_clean];
- printk(KERN_INFO " %5d %5X %5X %016llX %04X %3X %016llX\n",
- 0, tx_ring->next_to_use, tx_ring->next_to_clean,
- (unsigned long long)buffer_info->dma,
- buffer_info->length,
- buffer_info->next_to_watch,
- (unsigned long long)buffer_info->time_stamp);
+ pr_info(" %5d %5X %5X %016llX %04X %3X %016llX\n",
+ 0, tx_ring->next_to_use, tx_ring->next_to_clean,
+ (unsigned long long)buffer_info->dma,
+ buffer_info->length,
+ buffer_info->next_to_watch,
+ (unsigned long long)buffer_info->time_stamp);
/* Print Tx Ring */
if (!netif_msg_tx_done(adapter))
@@ -271,37 +266,32 @@ static void e1000e_dump(struct e1000_adapter *adapter)
* +----------------------------------------------------------------+
* 63 48 47 40 39 36 35 32 31 24 23 20 19 0
*/
- printk(KERN_INFO "Tl[desc] [address 63:0 ] [SpeCssSCmCsLen]"
- " [bi->dma ] leng ntw timestamp bi->skb "
- "<-- Legacy format\n");
- printk(KERN_INFO "Tc[desc] [Ce CoCsIpceCoS] [MssHlRSCm0Plen]"
- " [bi->dma ] leng ntw timestamp bi->skb "
- "<-- Ext Context format\n");
- printk(KERN_INFO "Td[desc] [address 63:0 ] [VlaPoRSCm1Dlen]"
- " [bi->dma ] leng ntw timestamp bi->skb "
- "<-- Ext Data format\n");
+ pr_info("Tl[desc] [address 63:0 ] [SpeCssSCmCsLen] [bi->dma ] leng ntw timestamp bi->skb <-- Legacy format\n");
+ pr_info("Tc[desc] [Ce CoCsIpceCoS] [MssHlRSCm0Plen] [bi->dma ] leng ntw timestamp bi->skb <-- Ext Context format\n");
+ pr_info("Td[desc] [address 63:0 ] [VlaPoRSCm1Dlen] [bi->dma ] leng ntw timestamp bi->skb <-- Ext Data format\n");
for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) {
+ const char *next_desc;
tx_desc = E1000_TX_DESC(*tx_ring, i);
buffer_info = &tx_ring->buffer_info[i];
u0 = (struct my_u0 *)tx_desc;
- printk(KERN_INFO "T%c[0x%03X] %016llX %016llX %016llX "
- "%04X %3X %016llX %p",
- (!(le64_to_cpu(u0->b) & (1 << 29)) ? 'l' :
- ((le64_to_cpu(u0->b) & (1 << 20)) ? 'd' : 'c')), i,
- (unsigned long long)le64_to_cpu(u0->a),
- (unsigned long long)le64_to_cpu(u0->b),
- (unsigned long long)buffer_info->dma,
- buffer_info->length, buffer_info->next_to_watch,
- (unsigned long long)buffer_info->time_stamp,
- buffer_info->skb);
if (i == tx_ring->next_to_use && i == tx_ring->next_to_clean)
- printk(KERN_CONT " NTC/U\n");
+ next_desc = " NTC/U";
else if (i == tx_ring->next_to_use)
- printk(KERN_CONT " NTU\n");
+ next_desc = " NTU";
else if (i == tx_ring->next_to_clean)
- printk(KERN_CONT " NTC\n");
+ next_desc = " NTC";
else
- printk(KERN_CONT "\n");
+ next_desc = "";
+ pr_info("T%c[0x%03X] %016llX %016llX %016llX %04X %3X %016llX %p%s\n",
+ (!(le64_to_cpu(u0->b) & (1 << 29)) ? 'l' :
+ ((le64_to_cpu(u0->b) & (1 << 20)) ? 'd' : 'c')),
+ i,
+ (unsigned long long)le64_to_cpu(u0->a),
+ (unsigned long long)le64_to_cpu(u0->b),
+ (unsigned long long)buffer_info->dma,
+ buffer_info->length, buffer_info->next_to_watch,
+ (unsigned long long)buffer_info->time_stamp,
+ buffer_info->skb, next_desc);
if (netif_msg_pktdata(adapter) && buffer_info->dma != 0)
print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS,
@@ -312,9 +302,9 @@ static void e1000e_dump(struct e1000_adapter *adapter)
/* Print Rx Ring Summary */
rx_ring_summary:
dev_info(&adapter->pdev->dev, "Rx Ring Summary\n");
- printk(KERN_INFO "Queue [NTU] [NTC]\n");
- printk(KERN_INFO " %5d %5X %5X\n", 0,
- rx_ring->next_to_use, rx_ring->next_to_clean);
+ pr_info("Queue [NTU] [NTC]\n");
+ pr_info(" %5d %5X %5X\n",
+ 0, rx_ring->next_to_use, rx_ring->next_to_clean);
/* Print Rx Ring */
if (!netif_msg_rx_status(adapter))
@@ -337,10 +327,7 @@ rx_ring_summary:
* 24 | Buffer Address 3 [63:0] |
* +-----------------------------------------------------+
*/
- printk(KERN_INFO "R [desc] [buffer 0 63:0 ] "
- "[buffer 1 63:0 ] "
- "[buffer 2 63:0 ] [buffer 3 63:0 ] [bi->dma ] "
- "[bi->skb] <-- Ext Pkt Split format\n");
+ pr_info("R [desc] [buffer 0 63:0 ] [buffer 1 63:0 ] [buffer 2 63:0 ] [buffer 3 63:0 ] [bi->dma ] [bi->skb] <-- Ext Pkt Split format\n");
/* [Extended] Receive Descriptor (Write-Back) Format
*
* 63 48 47 32 31 13 12 8 7 4 3 0
@@ -352,35 +339,40 @@ rx_ring_summary:
* +------------------------------------------------------+
* 63 48 47 32 31 20 19 0
*/
- printk(KERN_INFO "RWB[desc] [ck ipid mrqhsh] "
- "[vl l0 ee es] "
- "[ l3 l2 l1 hs] [reserved ] ---------------- "
- "[bi->skb] <-- Ext Rx Write-Back format\n");
+ pr_info("RWB[desc] [ck ipid mrqhsh] [vl l0 ee es] [ l3 l2 l1 hs] [reserved ] ---------------- [bi->skb] <-- Ext Rx Write-Back format\n");
for (i = 0; i < rx_ring->count; i++) {
+ const char *next_desc;
buffer_info = &rx_ring->buffer_info[i];
rx_desc_ps = E1000_RX_DESC_PS(*rx_ring, i);
u1 = (struct my_u1 *)rx_desc_ps;
staterr =
le32_to_cpu(rx_desc_ps->wb.middle.status_error);
+
+ if (i == rx_ring->next_to_use)
+ next_desc = " NTU";
+ else if (i == rx_ring->next_to_clean)
+ next_desc = " NTC";
+ else
+ next_desc = "";
+
if (staterr & E1000_RXD_STAT_DD) {
/* Descriptor Done */
- printk(KERN_INFO "RWB[0x%03X] %016llX "
- "%016llX %016llX %016llX "
- "---------------- %p", i,
- (unsigned long long)le64_to_cpu(u1->a),
- (unsigned long long)le64_to_cpu(u1->b),
- (unsigned long long)le64_to_cpu(u1->c),
- (unsigned long long)le64_to_cpu(u1->d),
- buffer_info->skb);
+ pr_info("%s[0x%03X] %016llX %016llX %016llX %016llX ---------------- %p%s\n",
+ "RWB", i,
+ (unsigned long long)le64_to_cpu(u1->a),
+ (unsigned long long)le64_to_cpu(u1->b),
+ (unsigned long long)le64_to_cpu(u1->c),
+ (unsigned long long)le64_to_cpu(u1->d),
+ buffer_info->skb, next_desc);
} else {
- printk(KERN_INFO "R [0x%03X] %016llX "
- "%016llX %016llX %016llX %016llX %p", i,
- (unsigned long long)le64_to_cpu(u1->a),
- (unsigned long long)le64_to_cpu(u1->b),
- (unsigned long long)le64_to_cpu(u1->c),
- (unsigned long long)le64_to_cpu(u1->d),
- (unsigned long long)buffer_info->dma,
- buffer_info->skb);
+ pr_info("%s[0x%03X] %016llX %016llX %016llX %016llX %016llX %p%s\n",
+ "R ", i,
+ (unsigned long long)le64_to_cpu(u1->a),
+ (unsigned long long)le64_to_cpu(u1->b),
+ (unsigned long long)le64_to_cpu(u1->c),
+ (unsigned long long)le64_to_cpu(u1->d),
+ (unsigned long long)buffer_info->dma,
+ buffer_info->skb, next_desc);
if (netif_msg_pktdata(adapter))
print_hex_dump(KERN_INFO, "",
@@ -388,13 +380,6 @@ rx_ring_summary:
phys_to_virt(buffer_info->dma),
adapter->rx_ps_bsize0, true);
}
-
- if (i == rx_ring->next_to_use)
- printk(KERN_CONT " NTU\n");
- else if (i == rx_ring->next_to_clean)
- printk(KERN_CONT " NTC\n");
- else
- printk(KERN_CONT "\n");
}
break;
default:
@@ -407,9 +392,7 @@ rx_ring_summary:
* 8 | Reserved |
* +-----------------------------------------------------+
*/
- printk(KERN_INFO "R [desc] [buf addr 63:0 ] "
- "[reserved 63:0 ] [bi->dma ] "
- "[bi->skb] <-- Ext (Read) format\n");
+ pr_info("R [desc] [buf addr 63:0 ] [reserved 63:0 ] [bi->dma ] [bi->skb] <-- Ext (Read) format\n");
/* Extended Receive Descriptor (Write-Back) Format
*
* 63 48 47 32 31 24 23 4 3 0
@@ -423,29 +406,37 @@ rx_ring_summary:
* +------------------------------------------------------+
* 63 48 47 32 31 20 19 0
*/
- printk(KERN_INFO "RWB[desc] [cs ipid mrq] "
- "[vt ln xe xs] "
- "[bi->skb] <-- Ext (Write-Back) format\n");
+ pr_info("RWB[desc] [cs ipid mrq] [vt ln xe xs] [bi->skb] <-- Ext (Write-Back) format\n");
for (i = 0; i < rx_ring->count; i++) {
+ const char *next_desc;
+
buffer_info = &rx_ring->buffer_info[i];
rx_desc = E1000_RX_DESC_EXT(*rx_ring, i);
u1 = (struct my_u1 *)rx_desc;
staterr = le32_to_cpu(rx_desc->wb.upper.status_error);
+
+ if (i == rx_ring->next_to_use)
+ next_desc = " NTU";
+ else if (i == rx_ring->next_to_clean)
+ next_desc = " NTC";
+ else
+ next_desc = "";
+
if (staterr & E1000_RXD_STAT_DD) {
/* Descriptor Done */
- printk(KERN_INFO "RWB[0x%03X] %016llX "
- "%016llX ---------------- %p", i,
- (unsigned long long)le64_to_cpu(u1->a),
- (unsigned long long)le64_to_cpu(u1->b),
- buffer_info->skb);
+ pr_info("%s[0x%03X] %016llX %016llX ---------------- %p%s\n",
+ "RWB", i,
+ (unsigned long long)le64_to_cpu(u1->a),
+ (unsigned long long)le64_to_cpu(u1->b),
+ buffer_info->skb, next_desc);
} else {
- printk(KERN_INFO "R [0x%03X] %016llX "
- "%016llX %016llX %p", i,
- (unsigned long long)le64_to_cpu(u1->a),
- (unsigned long long)le64_to_cpu(u1->b),
- (unsigned long long)buffer_info->dma,
- buffer_info->skb);
+ pr_info("%s[0x%03X] %016llX %016llX %016llX %p%s\n",
+ "R ", i,
+ (unsigned long long)le64_to_cpu(u1->a),
+ (unsigned long long)le64_to_cpu(u1->b),
+ (unsigned long long)buffer_info->dma,
+ buffer_info->skb, next_desc);
if (netif_msg_pktdata(adapter))
print_hex_dump(KERN_INFO, "",
@@ -456,13 +447,6 @@ rx_ring_summary:
adapter->rx_buffer_len,
true);
}
-
- if (i == rx_ring->next_to_use)
- printk(KERN_CONT " NTU\n");
- else if (i == rx_ring->next_to_clean)
- printk(KERN_CONT " NTC\n");
- else
- printk(KERN_CONT "\n");
}
}
@@ -1222,8 +1206,7 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
adapter->flags2 |= FLAG2_IS_DISCARDING;
if (adapter->flags2 & FLAG2_IS_DISCARDING) {
- e_dbg("Packet Split buffers didn't pick up the full "
- "packet\n");
+ e_dbg("Packet Split buffers didn't pick up the full packet\n");
dev_kfree_skb_irq(skb);
if (staterr & E1000_RXD_STAT_EOP)
adapter->flags2 &= ~FLAG2_IS_DISCARDING;
@@ -1238,8 +1221,7 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
length = le16_to_cpu(rx_desc->wb.middle.length0);
if (!length) {
- e_dbg("Last part of the packet spanning multiple "
- "descriptors\n");
+ e_dbg("Last part of the packet spanning multiple descriptors\n");
dev_kfree_skb_irq(skb);
goto next_desc;
}
@@ -1917,8 +1899,7 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
return;
}
/* MSI-X failed, so fall through and try MSI */
- e_err("Failed to initialize MSI-X interrupts. "
- "Falling back to MSI interrupts.\n");
+ e_err("Failed to initialize MSI-X interrupts. Falling back to MSI interrupts.\n");
e1000e_reset_interrupt_capability(adapter);
}
adapter->int_mode = E1000E_INT_MODE_MSI;
@@ -1928,8 +1909,7 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
adapter->flags |= FLAG_MSI_ENABLED;
} else {
adapter->int_mode = E1000E_INT_MODE_LEGACY;
- e_err("Failed to initialize MSI interrupts. Falling "
- "back to legacy interrupts.\n");
+ e_err("Failed to initialize MSI interrupts. Falling back to legacy interrupts.\n");
}
/* Fall through */
case E1000E_INT_MODE_LEGACY:
@@ -4168,16 +4148,13 @@ static void e1000_print_link_info(struct e1000_adapter *adapter)
u32 ctrl = er32(CTRL);
/* Link status message must follow this format for user tools */
- printk(KERN_INFO "e1000e: %s NIC Link is Up %d Mbps %s, "
- "Flow Control: %s\n",
- adapter->netdev->name,
- adapter->link_speed,
- (adapter->link_duplex == FULL_DUPLEX) ?
- "Full Duplex" : "Half Duplex",
- ((ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE)) ?
- "Rx/Tx" :
- ((ctrl & E1000_CTRL_RFCE) ? "Rx" :
- ((ctrl & E1000_CTRL_TFCE) ? "Tx" : "None")));
+ printk(KERN_INFO "e1000e: %s NIC Link is Up %d Mbps %s Duplex, Flow Control: %s\n",
+ adapter->netdev->name,
+ adapter->link_speed,
+ adapter->link_duplex == FULL_DUPLEX ? "Full" : "Half",
+ (ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE) ? "Rx/Tx" :
+ (ctrl & E1000_CTRL_RFCE) ? "Rx" :
+ (ctrl & E1000_CTRL_TFCE) ? "Tx" : "None");
}
static bool e1000e_has_link(struct e1000_adapter *adapter)
@@ -4323,10 +4300,7 @@ static void e1000_watchdog_task(struct work_struct *work)
e1e_rphy(hw, PHY_AUTONEG_EXP, &autoneg_exp);
if (!(autoneg_exp & NWAY_ER_LP_NWAY_CAPS))
- e_info("Autonegotiated half duplex but"
- " link partner cannot autoneg. "
- " Try forcing full duplex if "
- "link gets many collisions.\n");
+ e_info("Autonegotiated half duplex but link partner cannot autoneg. Try forcing full duplex if link gets many collisions.\n");
}
/* adjust timeout factor according to speed/duplex */
@@ -5110,8 +5084,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
if ((adapter->hw.mac.type == e1000_pch2lan) &&
!(adapter->flags2 & FLAG2_CRC_STRIPPING) &&
(new_mtu > ETH_DATA_LEN)) {
- e_err("Jumbo Frames not supported on 82579 when CRC "
- "stripping is disabled.\n");
+ e_err("Jumbo Frames not supported on 82579 when CRC stripping is disabled.\n");
return -EINVAL;
}
@@ -5527,8 +5500,8 @@ static int __e1000_resume(struct pci_dev *pdev)
phy_data & E1000_WUS_MC ? "Multicast Packet" :
phy_data & E1000_WUS_BC ? "Broadcast Packet" :
phy_data & E1000_WUS_MAG ? "Magic Packet" :
- phy_data & E1000_WUS_LNKC ? "Link Status "
- " Change" : "other");
+ phy_data & E1000_WUS_LNKC ? "Link Status Change" :
+ "other");
}
e1e_wphy(&adapter->hw, BM_WUS, ~0);
} else {
@@ -5949,8 +5922,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
err = dma_set_coherent_mask(&pdev->dev,
DMA_BIT_MASK(32));
if (err) {
- dev_err(&pdev->dev, "No usable DMA "
- "configuration, aborting\n");
+ dev_err(&pdev->dev, "No usable DMA configuration, aborting\n");
goto err_dma;
}
}
@@ -6412,7 +6384,7 @@ static int __init e1000_init_module(void)
int ret;
pr_info("Intel(R) PRO/1000 Network Driver - %s\n",
e1000e_driver_version);
- pr_info("Copyright(c) 1999 - 2011 Intel Corporation.\n");
+ pr_info("Copyright(c) 1999 - 2011 Intel Corporation\n");
ret = pci_register_driver(&e1000_driver);
return ret;
--
1.7.6.405.gc1be0
^ permalink raw reply related
* [PATCH net-next 0/5] intel: Logging cleanups
From: Joe Perches @ 2011-10-12 16:18 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: netdev, e1000-devel, linux-kernel
Just some conversions of printks to pr_<level>
and some trivial defect corrections.
Joe Perches (5):
e1000e: Convert printks to pr_<level>
ixgbevf: Convert printks to pr_<level>
igbvf: Convert printks to pr_<level>
igb: Convert printks to pr_<level>
igb: Convert bare printk to pr_notice
drivers/net/ethernet/intel/e1000e/netdev.c | 232 +++++++++------------
drivers/net/ethernet/intel/igb/e1000_82575.c | 5 +-
drivers/net/ethernet/intel/igb/igb_main.c | 155 +++++++--------
drivers/net/ethernet/intel/igbvf/netdev.c | 14 +-
drivers/net/ethernet/intel/ixgbevf/ethtool.c | 6 +-
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 26 ++--
6 files changed, 201 insertions(+), 237 deletions(-)
--
1.7.6.405.gc1be0
^ permalink raw reply
* Re: [PATCH v3] net-netlink: Add a new attribute to expose TOS values via netlink
From: Stephen Hemminger @ 2011-10-12 15:52 UTC (permalink / raw)
To: Muraliraja Muniraju
Cc: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, linux-kernel, netdev
In-Reply-To: <1318382887-31824-1-git-send-email-muralira@google.com>
On Tue, 11 Oct 2011 18:28:07 -0700
Muraliraja Muniraju <muralira@google.com> wrote:
> +/* INET_DIAG_TOS */
> +
> +struct inet_diag_tos {
> + __u8 idiag_tos;
> +};
> +
This structure is not used.
^ permalink raw reply
* Re: [PATCH] dev: use ifindex hash for dev_seq_ops
From: Stephen Hemminger @ 2011-10-12 15:50 UTC (permalink / raw)
To: Mihai Maruseac
Cc: davem, eric.dumazet, mirq-linux, therbert, jpirko, netdev,
linux-kernel, dbaluta, Mihai Maruseac
In-Reply-To: <1318413446-22258-1-git-send-email-mmaruseac@ixiacom.com>
On Wed, 12 Oct 2011 12:57:26 +0300
Mihai Maruseac <mihai.maruseac@gmail.com> wrote:
It looks like you lost the ability to seek back and read the header
(start token). How is the header handled, is possible to rewind
the file and read it over again?
> +static inline struct net_device *next_dev(struct seq_file *seq, loff_t *pos)
> +{
> + struct dev_iter_state *state = seq->private;
> + struct net *net = seq_file_net(seq);
> + struct net_device *dev = NULL;
> + loff_t off;
> +
> + ++*pos;
> + dev = dev_get_by_index_rcu(net, state->ifindex);
Looks good a couple of minor nits.
1. The function should not be inline, since it is in no way performance
critical. The compiler will probably inline it anyway.
2. dev does not have to be initialized since it is assigned a few
lines later. Most programmers are trained now to always initialize
variables, but often it is unnecessary.
3. The name next_dev() is a little generic; maybe a better name.
^ permalink raw reply
* ip6/ip6 tunnel add/change failure
From: Andras Takacs @ 2011-10-12 15:10 UTC (permalink / raw)
To: netdev; +Cc: József Kovacs, Emmanuel Thierry, Virág László
[-- Attachment #1: Type: text/plain, Size: 15562 bytes --]
Dear All,
We're using Mobile IPv6 Daemon (mip6d) on Linux 2.6.35.14. Previously we have used 2.6.22 without any kernel-related issues. Unfortunately this kernel version produces a very annoying problem with the IP6/IP6 tunnels. We're having two tunnels, which are linked to two different eth interfaces.
The issue: All of the packets, independently from the tunnel interface leaves the box via eth1 with the correct source address. Instead of the expected way, when the packets sent via ip6tnl1 go out on eth1, and the others (sent via ip6tnl2) go out on eth2.
We tried to reproduce this issue without mip6d, only with the ip command. I attached the setup and the test scripts. In this case, the routing works fine.
After a lot of debugging we found the following difference: mip6d creates the tunnel with remote address A. Later, it changes it to B. We found that somewhere here is the key.
1) The following data shows the internals of ip6tnl1 device's net_device structure. we dumped it from the rtnl_fill_ifinfo, which was triggered by ip -6 link ls:
Breakpoint 3, 0xc0399069 in rtnl_fill_ifinfo (skb=0xcee55300, dev=0xcede7000, type=16, pid=537, seq=1318434857, change=0, flags=2)
at /mnt/hgfs/svnOnMyMac/SZTAKI/ITSSv6/trunk/kernel/linux-2.6.35.14/net/core/rtnetlink.c:1014
1014 if (tb[IFLA_ADDRESS] &&
(gdb) p *dev
$7 = {name = "ip6tnl1\000\000\000\000\000\000\000\000", pm_qos_req = 0x0, name_hlist = {next = 0x0, pprev = 0xcf95fac8}, ifalias = 0x0, mem_end = 0, mem_start = 0, base_addr = 0,
irq = 0, if_port = 0 '\0', dma = 0 '\0', state = 3, dev_list = {next = 0xcfbd1838, prev = 0xcec1d038}, napi_list = {next = 0xcede7040, prev = 0xcede7040}, unreg_list = {
next = 0xcede7048, prev = 0xcede7048}, features = 8192, ifindex = 7, iflink = 4, stats = {rx_packets = 0, tx_packets = 2, rx_bytes = 0, tx_bytes = 176, rx_errors = 0,
tx_errors = 0, rx_dropped = 0, tx_dropped = 0, multicast = 0, collisions = 0, rx_length_errors = 0, rx_over_errors = 0, rx_crc_errors = 0, rx_frame_errors = 0, rx_fifo_errors = 0,
rx_missed_errors = 0, tx_aborted_errors = 0, tx_carrier_errors = 0, tx_fifo_errors = 0, tx_heartbeat_errors = 0, tx_window_errors = 0, rx_compressed = 0, tx_compressed = 0},
netdev_ops = 0xc0461c78, ethtool_ops = 0x0, header_ops = 0x0, flags = 145, gflags = 0, priv_flags = 1024, padded = 0, operstate = 0 '\0', link_mode = 0 '\0', mtu = 1460, type = 769,
hard_header_len = 54, needed_headroom = 0, needed_tailroom = 0, master = 0x0, perm_addr = '\0' <repeats 31 times>, addr_len = 16 '\020', dev_id = 0, addr_list_lock = {{rlock = {
raw_lock = {slock = 1}, magic = 3735899821, owner_cpu = 4294967295, owner = 0xffffffff, dep_map = {key = 0xc0b979dc, class_cache = 0xc072dd30,
name = 0xc057b8d5 "_xmit_TUNNEL6"}}, {__padding = "\001\000\000\000?N??????????", dep_map = {key = 0xc0b979dc, class_cache = 0xc072dd30,
name = 0xc057b8d5 "_xmit_TUNNEL6"}}}}, uc = {list = {next = 0xcede7120, prev = 0xcede7120}, count = 0}, mc = {list = {next = 0xcede712c, prev = 0xcede712c}, count = 0},
uc_promisc = 0, promiscuity = 0, allmulti = 0, atalk_ptr = 0x0, ip_ptr = 0xceeb5800, dn_ptr = 0x0, ip6_ptr = 0xceeb5e00, ec_ptr = 0x0, ax25_ptr = 0x0, ieee80211_ptr = 0x0,
last_rx = 0, dev_addr = 0xced57588 " \001\a8\0200\020\005PT", dev_addrs = {list = {next = 0xced57580, prev = 0xced57580}, count = 1},
broadcast = " \001\a8\0200\000\001\000\000\000\000\000\000\020", '\0' <repeats 16 times>, rx_queue = {dev = 0xcede7000, qdisc = 0xc05e16cc, state = 0, qdisc_sleeping = 0xc05e16cc,
_xmit_lock = {{rlock = {raw_lock = {slock = 1}, magic = 3735899821, owner_cpu = 4294967295, owner = 0xffffffff, dep_map = {key = 0xc0b97bb4, class_cache = 0x0,
name = 0xc057b8d5 "_xmit_TUNNEL6"}}, {__padding = "\001\000\000\000?N??????????", dep_map = {key = 0xc0b97bb4, class_cache = 0x0, name = 0xc057b8d5 "_xmit_TUNNEL6"}}}},
xmit_lock_owner = -1, trans_start = 0, tx_bytes = 0, tx_packets = 0, tx_dropped = 0}, _tx = 0xced57dc0, num_tx_queues = 1, real_num_tx_queues = 1, qdisc = 0xc05e176c,
tx_queue_len = 0, tx_global_lock = {{rlock = {raw_lock = {slock = 1}, magic = 3735899821, owner_cpu = 4294967295, owner = 0xffffffff, dep_map = {key = 0xc0b978dc, class_cache = 0x0,
name = 0xc057b3df "&(&dev->tx_global_lock)->rlock"}}, {__padding = "\001\000\000\000?N??????????", dep_map = {key = 0xc0b978dc, class_cache = 0x0,
name = 0xc057b3df "&(&dev->tx_global_lock)->rlock"}}}}, trans_start = 0, watchdog_timeo = 0, watchdog_timer = {entry = {next = 0x0, prev = 0x0}, expires = 0,
base = 0xc06609c0, function = 0xc039eb7f <dev_watchdog>, data = 3470684160, slack = -1, start_site = 0x0, start_comm = '\0' <repeats 15 times>, start_pid = -1, lockdep_map = {
key = 0xc0b98144, class_cache = 0x0, name = 0xc057ca77 "&dev->watchdog_timer"}}, refcnt = {counter = 13}, todo_list = {next = 0x0, prev = 0x0}, index_hlist = {next = 0x0,
pprev = 0xcf95fc1c}, link_watch_list = {next = 0xcede7260, prev = 0xcede7260}, reg_state = NETREG_REGISTERED, rtnl_link_state = RTNL_LINK_INITIALIZED,
destructor = 0xc038f1b1 <free_netdev>, ml_priv = 0x0, br_port = 0x0, macvlan_port = 0x0, garp_port = 0x0, dev = {parent = 0x0, p = 0xcedfe600, kobj = {name = 0xcfb24ae0 "ip6tnl1",
entry = {next = 0xcfbd1a8c, prev = 0xcf80e7fc}, parent = 0xcf99edc0, kset = 0xcf8142a0, ktype = 0xc05d414c, sd = 0xced575c0, kref = {refcount = {counter = 2}},
state_initialized = 1, state_in_sysfs = 1, state_add_uevent_sent = 1, state_remove_uevent_sent = 0, uevent_suppress = 0}, init_name = 0x0, type = 0x0, mutex = {count = {
counter = 1}, wait_lock = {{rlock = {raw_lock = {slock = 1}, magic = 3735899821, owner_cpu = 4294967295, owner = 0xffffffff, dep_map = {key = 0xc0661d9c, class_cache = 0x0,
name = 0xc051d978 "&(&lock->wait_lock)->rlock"}}, {__padding = "\001\000\000\000?N??????????", dep_map = {key = 0xc0661d9c, class_cache = 0x0,
name = 0xc051d978 "&(&lock->wait_lock)->rlock"}}}}, wait_list = {next = 0xcede72d4, prev = 0xcede72d4}, owner = 0x0, name = 0x0, magic = 0xcede72b4, dep_map = {
key = 0xc066e010, class_cache = 0x0, name = 0xc05493c7 "&__lockdep_no_validate__"}}, bus = 0x0, driver = 0x0, platform_data = 0xcede7000, power = {power_state = {event = 0},
can_wakeup = 0, should_wakeup = 0, async_suspend = 0, status = DPM_INVALID}, dma_mask = 0x0, coherent_dma_mask = 0, dma_parms = 0x0, dma_pools = {next = 0xcede731c,
prev = 0xcede731c}, dma_mem = 0x0, archdata = {acpi_handle = 0x0}, devt = 0, devres_lock = {{rlock = {raw_lock = {slock = 1}, magic = 3735899821, owner_cpu = 4294967295,
owner = 0xffffffff, dep_map = {key = 0xc0b92e54, class_cache = 0x0, name = 0xc05493e0 "&(&dev->devres_lock)->rlock"}}, {__padding = "\001\000\000\000?N??????????",
dep_map = {key = 0xc0b92e54, class_cache = 0x0, name = 0xc05493e0 "&(&dev->devres_lock)->rlock"}}}}, devres_head = {next = 0xcede734c, prev = 0xcede734c}, knode_class = {
n_klist = 0xcf9aca4c, n_node = {next = 0xcfbd1b58, prev = 0xcec1d358}, n_ref = {refcount = {counter = 1}}}, class = 0xc05e1008, groups = 0xcede7370, release = 0},
sysfs_groups = {0xc05e1044, 0x0, 0x0, 0x0}, rtnl_link_ops = 0x0, vlan_features = 0, gso_max_size = 65536, ethtool_ntuple_list = {list = {next = 0xcede738c, prev = 0xcede738c},
count = 0}}
I would highlight the ifindex and the iflink values! (ifindex = 7, iflink = 4)
2) Next, we duped out the same for the tunnels, which was created by ip -6 tunnel add. We found the following:
Breakpoint 4, 0xc0399069 in rtnl_fill_ifinfo (skb=0xced2d300, dev=0xceeb4800, type=16, pid=568, seq=1318435116, change=0, flags=2)
at /mnt/hgfs/svnOnMyMac/SZTAKI/ITSSv6/trunk/kernel/linux-2.6.35.14/net/core/rtnetlink.c:1014
1014 if (tb[IFLA_ADDRESS] &&
(gdb) p *dev
$15 = {name = "ip6test1\000\000\000\000\000\000\000", pm_qos_req = 0x0, name_hlist = {next = 0x0, pprev = 0xcf95f974}, ifalias = 0x0, mem_end = 0, mem_start = 0, base_addr = 0,
irq = 0, if_port = 0 '\0', dma = 0 '\0', state = 3, dev_list = {next = 0xceeb6838, prev = 0xcec1d038}, napi_list = {next = 0xceeb4840, prev = 0xceeb4840}, unreg_list = {
next = 0xceeb4848, prev = 0xceeb4848}, features = 8192, ifindex = 7, iflink = 7, stats = {rx_packets = 0, tx_packets = 0, rx_bytes = 0, tx_bytes = 0, rx_errors = 0, tx_errors = 0,
rx_dropped = 0, tx_dropped = 0, multicast = 0, collisions = 0, rx_length_errors = 0, rx_over_errors = 0, rx_crc_errors = 0, rx_frame_errors = 0, rx_fifo_errors = 0,
rx_missed_errors = 0, tx_aborted_errors = 0, tx_carrier_errors = 0, tx_fifo_errors = 0, tx_heartbeat_errors = 0, tx_window_errors = 0, rx_compressed = 0, tx_compressed = 0},
netdev_ops = 0xc0461c78, ethtool_ops = 0x0, header_ops = 0x0, flags = 145, gflags = 0, priv_flags = 1024, padded = 0, operstate = 0 '\0', link_mode = 0 '\0', mtu = 1460, type = 769,
hard_header_len = 54, needed_headroom = 0, needed_tailroom = 0, master = 0x0, perm_addr = '\0' <repeats 31 times>, addr_len = 16 '\020', dev_id = 0, addr_list_lock = {{rlock = {
raw_lock = {slock = 1}, magic = 3735899821, owner_cpu = 4294967295, owner = 0xffffffff, dep_map = {key = 0xc0b979dc, class_cache = 0xc072c2a0,
name = 0xc057b8d5 "_xmit_TUNNEL6"}}, {__padding = "\001\000\000\000?N??????????", dep_map = {key = 0xc0b979dc, class_cache = 0xc072c2a0,
name = 0xc057b8d5 "_xmit_TUNNEL6"}}}}, uc = {list = {next = 0xceeb4920, prev = 0xceeb4920}, count = 0}, mc = {list = {next = 0xceeb492c, prev = 0xceeb492c}, count = 0},
uc_promisc = 0, promiscuity = 0, allmulti = 0, atalk_ptr = 0x0, ip_ptr = 0xced77400, dn_ptr = 0x0, ip6_ptr = 0xced77e00, ec_ptr = 0x0, ax25_ptr = 0x0, ieee80211_ptr = 0x0,
last_rx = 0, dev_addr = 0xced58c88 " \001\a8\0200\020\004PT", dev_addrs = {list = {next = 0xced58c80, prev = 0xced58c80}, count = 1},
broadcast = " \001\a8\0200\000\001\000\000\000\000\000\000\020", '\0' <repeats 16 times>, rx_queue = {dev = 0xceeb4800, qdisc = 0xc05e16cc, state = 0, qdisc_sleeping = 0xc05e16cc,
_xmit_lock = {{rlock = {raw_lock = {slock = 1}, magic = 3735899821, owner_cpu = 4294967295, owner = 0xffffffff, dep_map = {key = 0xc0b97bb4, class_cache = 0x0,
name = 0xc057b8d5 "_xmit_TUNNEL6"}}, {__padding = "\001\000\000\000?N??????????", dep_map = {key = 0xc0b97bb4, class_cache = 0x0, name = 0xc057b8d5 "_xmit_TUNNEL6"}}}},
xmit_lock_owner = -1, trans_start = 0, tx_bytes = 0, tx_packets = 0, tx_dropped = 0}, _tx = 0xced58c40, num_tx_queues = 1, real_num_tx_queues = 1, qdisc = 0xc05e176c,
tx_queue_len = 0, tx_global_lock = {{rlock = {raw_lock = {slock = 1}, magic = 3735899821, owner_cpu = 4294967295, owner = 0xffffffff, dep_map = {key = 0xc0b978dc, class_cache = 0x0,
name = 0xc057b3df "&(&dev->tx_global_lock)->rlock"}}, {__padding = "\001\000\000\000?N??????????", dep_map = {key = 0xc0b978dc, class_cache = 0x0,
name = 0xc057b3df "&(&dev->tx_global_lock)->rlock"}}}}, trans_start = 0, watchdog_timeo = 0, watchdog_timer = {entry = {next = 0x0, prev = 0x0}, expires = 0,
base = 0xc06609c0, function = 0xc039eb7f <dev_watchdog>, data = 3471525888, slack = -1, start_site = 0x0, start_comm = '\0' <repeats 15 times>, start_pid = -1, lockdep_map = {
key = 0xc0b98144, class_cache = 0x0, name = 0xc057ca77 "&dev->watchdog_timer"}}, refcnt = {counter = 11}, todo_list = {next = 0x0, prev = 0x0}, index_hlist = {next = 0x0,
pprev = 0xcf95fc1c}, link_watch_list = {next = 0xceeb4a60, prev = 0xceeb4a60}, reg_state = NETREG_REGISTERED, rtnl_link_state = RTNL_LINK_INITIALIZED,
destructor = 0xc038f1b1 <free_netdev>, ml_priv = 0x0, br_port = 0x0, macvlan_port = 0x0, garp_port = 0x0, dev = {parent = 0x0, p = 0xceea7380, kobj = {name = 0xcfb54780 "ip6test1",
entry = {next = 0xceeb6a8c, prev = 0xcf80d7fc}, parent = 0xcf99fdc0, kset = 0xcf8142a0, ktype = 0xc05d414c, sd = 0xced58780, kref = {refcount = {counter = 2}},
state_initialized = 1, state_in_sysfs = 1, state_add_uevent_sent = 1, state_remove_uevent_sent = 0, uevent_suppress = 0}, init_name = 0x0, type = 0x0, mutex = {count = {
counter = 1}, wait_lock = {{rlock = {raw_lock = {slock = 1}, magic = 3735899821, owner_cpu = 4294967295, owner = 0xffffffff, dep_map = {key = 0xc0661d9c, class_cache = 0x0,
name = 0xc051d978 "&(&lock->wait_lock)->rlock"}}, {__padding = "\001\000\000\000?N??????????", dep_map = {key = 0xc0661d9c, class_cache = 0x0,
name = 0xc051d978 "&(&lock->wait_lock)->rlock"}}}}, wait_list = {next = 0xceeb4ad4, prev = 0xceeb4ad4}, owner = 0x0, name = 0x0, magic = 0xceeb4ab4, dep_map = {
key = 0xc066e010, class_cache = 0x0, name = 0xc05493c7 "&__lockdep_no_validate__"}}, bus = 0x0, driver = 0x0, platform_data = 0xceeb4800, power = {power_state = {event = 0},
can_wakeup = 0, should_wakeup = 0, async_suspend = 0, status = DPM_INVALID}, dma_mask = 0x0, coherent_dma_mask = 0, dma_parms = 0x0, dma_pools = {next = 0xceeb4b1c,
prev = 0xceeb4b1c}, dma_mem = 0x0, archdata = {acpi_handle = 0x0}, devt = 0, devres_lock = {{rlock = {raw_lock = {slock = 1}, magic = 3735899821, owner_cpu = 4294967295,
owner = 0xffffffff, dep_map = {key = 0xc0b92e54, class_cache = 0x0, name = 0xc05493e0 "&(&dev->devres_lock)->rlock"}}, {__padding = "\001\000\000\000?N??????????",
dep_map = {key = 0xc0b92e54, class_cache = 0x0, name = 0xc05493e0 "&(&dev->devres_lock)->rlock"}}}}, devres_head = {next = 0xceeb4b4c, prev = 0xceeb4b4c}, knode_class = {
n_klist = 0xcf9ada4c, n_node = {next = 0xceeb6b58, prev = 0xcec1d358}, n_ref = {refcount = {counter = 1}}}, class = 0xc05e1008, groups = 0xceeb4b70, release = 0},
sysfs_groups = {0xc05e1044, 0x0, 0x0, 0x0}, rtnl_link_ops = 0x0, vlan_features = 0, gso_max_size = 65536, ethtool_ntuple_list = {list = {next = 0xceeb4b8c, prev = 0xceeb4b8c},
count = 0}}
Highlight again: ifindex = 7 iflink = 7. I would like to repeat, that it is the working version, and the mip6d version is the wrong from the usage's point-of-view.
3) What we see from userspace? The ip -6 addr ls is a good help.
If we just added the interface we see:
7: ip6test1: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1460
inet6 2001:738:1030:1::3/128 scope global
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe12:3459/64 scope link
valid_lft forever preferred_lft forever
If it has been changed (by mip6d or with the ip -6 tunnel change command):
7: ip6tnl1@eth1: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1460
inet6 2001:738:1030:1::3/128 scope global home nodad
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe12:3459/64 scope link
valid_lft forever preferred_lft forever
The '@' signs that the ifindex and the iflink values are different.
4) One more addition (maybe it helps): The link-local address all of the tunnels are the same, and equals the LL address of eth0. It is quite interesting, because any of the tunnels linked to eth0. (The tunnels are linked to eth1 and eth2).
--- --- --- --- --
We would like to fix this issue very much, but we don't know what was the concept of the existing code. We're sure that the exisiting mechanism is wrong, when the change method procedures a totally different result that the add. We would appreciate any help or comment!
Thank you very much!
Regards,
András
[-- Attachment #2: test-ip6-tnls.sh --]
[-- Type: application/octet-stream, Size: 3799 bytes --]
#!/bin/sh
###
# You should edit these lines
COA_PREFIXLEN=64
HA_ADDR=2001:738:1030:1::1000
HOA_ADDR=2001:738:1030:1::3
HOA_PREFIXLEN=128
MNP_PREFIX=2001:738:1030:2003::
MNP_PREFIXLEN=64
TEST1_PEER=2a01:270:d003::1
TEST2_PEER=2a01:1450:4001:c01::93
###
# You may edit these lines
IF1=eth1
IF2=eth2
TNL1=ip6test1
TNL2=ip6test2
IF1_RR_LLADDR=fe80::20c:29ff:fe3b:4d16
IF2_RR_LLADDR=fe80::20c:29ff:fe3b:4d20
###
# Please do not edit these lines
case "$1" in
"init")
echo "Initializing"
IF1_ADDR=`ip -6 a show dev $IF1 scope global | sed -ne 's/^[ ]*inet6 \([0-f0-9:/]\+\) scope global .*$/\1/p'`
IF2_ADDR=`ip -6 a show dev $IF2 scope global | sed -ne 's/^[ ]*inet6 \([0-f0-9:/]\+\) scope global .*$/\1/p'`
PREFIXLEN=`expr \( 128 - $COA_PREFIXLEN \) / 8 / 2`
IF1_PREFIX="`ip -6 a show dev $IF1 scope global | sed -ne "s/^[ ]*inet6 \(\([a-f0-9]\+:\)\{$PREFIXLEN\}\)[a-f0-9:/]\+ scope global .*\$/\1/p"`:"
IF2_PREFIX="`ip -6 a show dev $IF2 scope global | sed -ne "s/^[ ]*inet6 \(\([a-f0-9]\+:\)\{$PREFIXLEN\}\)[a-f0-9:/]\+ scope global .*\$/\1/p"`:"
if [ "x$IF1_RR_LLADDR" = "x" ]; then
IF1_RR_LLADDR=`ip -6 neigh ls | sed -ne "s/^\([a-f0-9:]\+\) dev $IF1 lladdr .*\$/\1/p"`
fi
if [ "x$IF2_RR_LLADDR" = "x" ]; then
IF2_RR_LLADDR=`ip -6 neigh ls | sed -ne "s/^\([a-f0-9:]\+\) dev $IF2 lladdr .*\$/\1/p"`
fi
echo "$IF1 address: $IF1_ADDR"
echo "$IF2 address: $IF2_ADDR"
echo "$IF1 prefix: $IF1_PREFIX"
echo "$IF2 prefix: $IF2_PREFIX"
echo "$IF1 router's LL address: $IF1_RR_LLADDR"
echo "$IF2 router's LL address: $IF2_RR_LLADDR"
ip -6 r add default via $IF1_RR_LLADDR dev $IF1
ip -6 r add default via $IF2_RR_LLADDR dev $IF2
if [ "x`ip -6 tunnel ls | grep $TNL1`" != "x" ]; then
ip -6 tunnel del $TNL1
fi
if [ "x`ip -6 tunnel ls | grep $TNL1`" != "x" ]; then
ip -6 tunnel del $TNL2
fi
ip -6 tunnel add $TNL1 mode ip6ip6 remote $HA_ADDR local $IF1_ADDR dev $IF1 encaplimit none hoplimit 64 tclass 0x00 flowlabel 0x00000000
ip -6 tunnel add $TNL2 mode ip6ip6 remote $HA_ADDR local $IF2_ADDR dev $IF2 encaplimit none hoplimit 64 tclass 0x00 flowlabel 0x00000000
ip l set $TNL1 up
ip l set $TNL2 up
ip -6 a add $HOA_ADDR/$HOA_PREFIXLEN dev $TNL1
ip -6 a add $HOA_ADDR/$HOA_PREFIXLEN dev $TNL2
# Note: the $MNP_PREFIX/$MNP_PREFIXLEN rules for forwarded packets from MNN
ip -6 rule add from all to $MNP_PREFIX/$MNP_PREFIXLEN lookup main pref 1000
ip -6 rule add from $HOA_ADDR fwmark 0x64 lookup 100 pref 1001
ip -6 rule add from $HOA_ADDR fwmark 0xc8 lookup 200 pref 1001
ip -6 rule add from $HOA_ADDR lookup 100 pref 1002
ip -6 rule add from fe80::/64 lookup main pref 1003
ip -6 rule add from 2001:738:1030:1004::/64 lookup main pref 1003
ip -6 rule add from 2001:738:1030:1005::/64 lookup main pref 1003
ip -6 rule add from $HOA_ADDR blackhole pref 1004
ip -6 rule add from $MNP_PREFIX/$MNP_PREFIXLEN fwmark 0x64 lookup 100 pref 1006
ip -6 rule add from $MNP_PREFIX/$MNP_PREFIXLEN fwmark 0xc8 lookup 200 pref 1006
ip -6 rule add from $MNP_PREFIX/$MNP_PREFIXLEN lookup 100 pref 1007
ip -6 r add default dev $TNL1 table 100
ip -6 r add default from $MNP_PREFIX/$MNP_PREFIXLEN dev $TNL1 table 100
ip -6 r add default dev $TNL2 table 200
ip -6 r add default from $MNP_PREFIX/$MNP_PREFIXLEN dev $TNL2 table 200
ip6tables -t mangle -A OUTPUT -d $TEST1_PEER -j MARK --set-xmark 0x64/0xffffffff
ip6tables -t mangle -A OUTPUT -d $TEST2_PEER -j MARK --set-xmark 0xc8/0xffffffff
;;
"test1")
echo "Test1 with $TEST1_PEER"
echo "It should marked with 100"
echo "It should sent via $TNL1 via $IF1"
ping -I $HOA_ADDR $TEST1_PEER
;;
"test2")
echo "Test2 with $TEST2_PEER"
echo "It should marked with 200"
echo "It should sent via $TNL2 via $IF2"
ping -I $HOA_ADDR $TEST2_PEER
;;
*)
echo "Usage: $0 [init|test1|test2]"
exit 1
;;
esac
[-- Attachment #3: Type: text/plain, Size: 195 bytes --]
András Takács
MTA SZTAKI
Computer and Automation Research Institute
Hungarian Academy of Sciences
Email: andras.takacs@sztaki.hu
Office: +36-1-279-6288
Mobile: +36-70-282-5316
^ permalink raw reply
* Re: bridge: HSR support
From: Arvid Brodin @ 2011-10-12 14:24 UTC (permalink / raw)
To: David Lamparter; +Cc: netdev, Stephen Hemminger, Lennert Buytenhek
In-Reply-To: <20111012132822.GJ2840382@jupiter.n2.diac24.net>
David Lamparter wrote:
> On Wed, Oct 12, 2011 at 01:51:22AM +0200, Arvid Brodin wrote:
>> Stephen Hemminger wrote:
>>>> I want to add support for HSR ("High-availability Seamless Redundancy",
>>>> IEC-62439-3) to the bridge code. With HSR, all connected units have two network
>>>> ports and are connected in a ring. All new Ethernet packets are sent on both
>>>> ports (or passed through if the current unit is not the originating unit).
>
>
>>>> The same packet is never passed twice.
>
> How does the bridge decide whether a packet is arriving the second time?
> Is the ring pre-resolved to stop things or does this happen per-packet?
It happens per-packet. I believe a combination of source MAC address and the HSR
sequence tag is used to identify duplicates.
--
Arvid Brodin
Enea Services Stockholm AB
^ permalink raw reply
* [net-next 2/5] stmmac: allow mtu bigger than 1500 in case of normal desc (V2).
From: Giuseppe CAVALLARO @ 2011-10-12 13:38 UTC (permalink / raw)
To: netdev; +Cc: davem, Giuseppe Cavallaro, Deepak SIKRI
In-Reply-To: <1318426688-9419-1-git-send-email-peppe.cavallaro@st.com>
This patch allows to set the mtu bigger than 1500
in case of normal descriptors.
This is helping some SPEAr customers.
Signed-off-by: Deepak SIKRI <deepak.sikri@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index ba7af2c..de3e536 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1357,17 +1357,17 @@ static void stmmac_set_rx_mode(struct net_device *dev)
static int stmmac_change_mtu(struct net_device *dev, int new_mtu)
{
struct stmmac_priv *priv = netdev_priv(dev);
- int max_mtu;
+ int max_mtu = ETH_DATA_LEN;
if (netif_running(dev)) {
pr_err("%s: must be stopped to change its MTU\n", dev->name);
return -EBUSY;
}
- if (priv->plat->has_gmac)
+ if (priv->plat->enh_desc)
max_mtu = JUMBO_LEN;
else
- max_mtu = ETH_DATA_LEN;
+ max_mtu = BUF_SIZE_4KiB;
if ((new_mtu < 46) || (new_mtu > max_mtu)) {
pr_err("%s: invalid MTU, max MTU is: %d\n", dev->name, max_mtu);
--
1.7.4.4
^ permalink raw reply related
* [net-next 5/5] stmmac: update the driver version and doc (V2)
From: Giuseppe CAVALLARO @ 2011-10-12 13:38 UTC (permalink / raw)
To: netdev; +Cc: davem, Giuseppe Cavallaro
In-Reply-To: <1318426688-9419-1-git-send-email-peppe.cavallaro@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
Documentation/networking/stmmac.txt | 11 ++++++++++-
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt
index 40ec92c..8d67980 100644
--- a/Documentation/networking/stmmac.txt
+++ b/Documentation/networking/stmmac.txt
@@ -76,7 +76,16 @@ core.
4.5) DMA descriptors
Driver handles both normal and enhanced descriptors. The latter has been only
-tested on DWC Ether MAC 10/100/1000 Universal version 3.41a.
+tested on DWC Ether MAC 10/100/1000 Universal version 3.41a and later.
+
+STMMAC supports DMA descriptor to operate both in dual buffer (RING)
+and linked-list(CHAINED) mode. In RING each descriptor points to two
+data buffer pointers whereas in CHAINED mode they point to only one data
+buffer pointer. RING mode is the default.
+
+In CHAINED mode each descriptor will have pointer to next descriptor in
+the list, hence creating the explicit chaining in the descriptor itself,
+whereas such explicit chaining is not possible in RING mode.
4.6) Ethtool support
Ethtool is supported. Driver statistics and internal errors can be taken using:
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 50e95d8..49a4af3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -20,7 +20,7 @@
Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
*******************************************************************************/
-#define DRV_MODULE_VERSION "Aug_2011"
+#define DRV_MODULE_VERSION "Oct_2011"
#include <linux/stmmac.h>
#include "common.h"
--
1.7.4.4
^ permalink raw reply related
* [net-next 4/5] stmmac: Stop advertising 1000Base capabilties for non GMII iface (V2).
From: Giuseppe CAVALLARO @ 2011-10-12 13:38 UTC (permalink / raw)
To: netdev; +Cc: davem, Srinivas Kandagatla, Giuseppe Cavallaro
In-Reply-To: <1318426688-9419-1-git-send-email-peppe.cavallaro@st.com>
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
This patch stops advertising 1000Base capablities if GMAC is either
configured for MII or RMII mode and on board there is a GPHY plugged on.
Without this patch if an GBit switch is connected on MII interface,
Ethernet stops working at all.
Discovered as part of
https://bugzilla.stlinux.com/show_bug.cgi?id=14148 triage
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 7b3b6c9..08dc116 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -314,7 +314,7 @@ static int stmmac_init_phy(struct net_device *dev)
struct phy_device *phydev;
char phy_id[MII_BUS_ID_SIZE + 3];
char bus_id[MII_BUS_ID_SIZE];
-
+ int interface = priv->plat->interface;
priv->oldlink = 0;
priv->speed = 0;
priv->oldduplex = -1;
@@ -324,14 +324,21 @@ static int stmmac_init_phy(struct net_device *dev)
priv->plat->phy_addr);
pr_debug("stmmac_init_phy: trying to attach to %s\n", phy_id);
- phydev = phy_connect(dev, phy_id, &stmmac_adjust_link, 0,
- priv->plat->interface);
+ phydev = phy_connect(dev, phy_id, &stmmac_adjust_link, 0, interface);
if (IS_ERR(phydev)) {
pr_err("%s: Could not attach to PHY\n", dev->name);
return PTR_ERR(phydev);
}
+ /* Stop Advertising 1000BASE Capability if interface is not GMII */
+ if ((interface == PHY_INTERFACE_MODE_MII) ||
+ (interface == PHY_INTERFACE_MODE_RMII)) {
+ phydev->supported &= (PHY_BASIC_FEATURES | SUPPORTED_Pause |
+ SUPPORTED_Asym_Pause);
+ priv->phydev->advertising = priv->phydev->supported;
+ }
+
/*
* Broken HW is sometimes missing the pull-up resistor on the
* MDIO line, which results in reads to non-existent devices returning
--
1.7.4.4
^ permalink raw reply related
* [net-next 3/5] stmmac: protect tx process with lock (V2)
From: Giuseppe CAVALLARO @ 2011-10-12 13:38 UTC (permalink / raw)
To: netdev; +Cc: davem, Giuseppe Cavallaro
In-Reply-To: <1318426688-9419-1-git-send-email-peppe.cavallaro@st.com>
This patch fixes a problem raised on Orly ARM SMP platform
where, in case of fragmented frames, the descriptors
in the TX ring resulted broken. This was due to a missing lock
protection in the tx process.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 +
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 1434bdb..50e95d8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -70,6 +70,7 @@ struct stmmac_priv {
u32 msg_enable;
spinlock_t lock;
+ spinlock_t tx_lock;
int wolopts;
int wolenabled;
int wol_irq;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index de3e536..7b3b6c9 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -590,6 +590,8 @@ static void stmmac_tx(struct stmmac_priv *priv)
{
unsigned int txsize = priv->dma_tx_size;
+ spin_lock(&priv->tx_lock);
+
while (priv->dirty_tx != priv->cur_tx) {
int last;
unsigned int entry = priv->dirty_tx % txsize;
@@ -652,6 +654,7 @@ static void stmmac_tx(struct stmmac_priv *priv)
}
netif_tx_unlock(priv->dev);
}
+ spin_unlock(&priv->tx_lock);
}
static inline void stmmac_enable_irq(struct stmmac_priv *priv)
@@ -1038,6 +1041,8 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_BUSY;
}
+ spin_lock(&priv->tx_lock);
+
entry = priv->cur_tx % txsize;
#ifdef STMMAC_XMIT_DEBUG
@@ -1126,6 +1131,8 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
priv->hw->dma->enable_dma_transmission(priv->ioaddr);
+ spin_unlock(&priv->tx_lock);
+
return NETDEV_TX_OK;
}
@@ -1690,6 +1697,7 @@ static int stmmac_probe(struct net_device *dev)
"please, use ifconfig or nwhwconfig!\n");
spin_lock_init(&priv->lock);
+ spin_lock_init(&priv->tx_lock);
ret = register_netdev(dev);
if (ret) {
--
1.7.4.4
^ permalink raw reply related
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