* Re: [RFC] [ver3 PATCH 0/6] Implement multiqueue virtio-net
From: Krishna Kumar @ 2011-11-12 5:45 UTC (permalink / raw)
To: levinsasha928
Cc: kvm, mst, netdev, rusty, virtualization, davem, Krishna Kumar
Sasha Levin <levinsasha928@gmail.com> wrote on 11/12/2011 03:32:04 AM:
> I'm seeing this BUG() sometimes when running it using a small patch I
> did for KVM tool:
>
> [ 1.281531] Call Trace:
> [ 1.281531] [<ffffffff8138a0e5>] ? free_rq_sq+0x2c/0xce
> [ 1.281531] [<ffffffff8138bb63>] ? virtnet_probe+0x81c/0x855
> [ 1.281531] [<ffffffff8129c9e7>] ? virtio_dev_probe+0xa7/0xc6
> [ 1.281531] [<ffffffff8134d2c3>] ? driver_probe_device+0xb2/0x142
> [ 1.281531] [<ffffffff8134d3a2>] ? __driver_attach+0x4f/0x6f
> [ 1.281531] [<ffffffff8134d353>] ? driver_probe_device+0x142/0x142
> [ 1.281531] [<ffffffff8134c3ab>] ? bus_for_each_dev+0x47/0x72
> [ 1.281531] [<ffffffff8134c90d>] ? bus_add_driver+0xa2/0x1e6
> [ 1.281531] [<ffffffff81cc1b36>] ? tun_init+0x89/0x89
> [ 1.281531] [<ffffffff8134db59>] ? driver_register+0x8d/0xf8
> [ 1.281531] [<ffffffff81cc1b36>] ? tun_init+0x89/0x89
> [ 1.281531] [<ffffffff81c98ac1>] ? do_one_initcall+0x78/0x130
> [ 1.281531] [<ffffffff81c98c0e>] ? kernel_init+0x95/0x113
> [ 1.281531] [<ffffffff81658274>] ? kernel_thread_helper+0x4/0x10
> [ 1.281531] [<ffffffff81c98b79>] ? do_one_initcall+0x130/0x130
> [ 1.281531] [<ffffffff81658270>] ? gs_change+0x13/0x13
> [ 1.281531] Code: c2 85 d2 48 0f 45 2d d1 39 ce 00 eb 22 65 8b 14 25
> 90 cc 00 00 48 8b 05 f0 a6 bc 00 48 63 d2 4c 89 e7 48 03 3c d0 e8 83 dd
> 00 00
> [ 1.281531] 8b 68 10 44 89 e6 48 89 ef 2b 75 18 e8 e4 f1 ff ff 8b 05
> fd
> [ 1.281531] RIP [<ffffffff810b3ac7>] free_percpu+0x9a/0x104
> [ 1.281531] RSP <ffff88001383fd50>
> [ 1.281531] CR2: 0000000000000010
> [ 1.281531] ---[ end trace 68cbc23dfe2fe62a ]---
>
> I don't have time today to dig into it, sorry.
Thanks for the report.
free_rq_sq() was being called twice in the failure path. The second
call panic'd since it had freed the same pointers earlier.
1. free_rq_sq() was being called twice in the failure path.
virtnet_setup_vqs() had already freed up rq/sq on error, and
virtnet_probe() tried to do it again. Fix it in virtnet_probe
by moving the call up.
2. Make free_rq_sq() re-entrant by setting freed pointers to NULL.
3. Remove free_stats() as it was being called only once.
Sasha, could you please try this patch on top of existing patches?
thanks!
Signed-off-by: krkumar2@in.ibm.com
---
drivers/net/virtio_net.c | 41 +++++++++++--------------------------
1 file changed, 13 insertions(+), 28 deletions(-)
diff -ruNp n6/drivers/net/virtio_net.c n7/drivers/net/virtio_net.c
--- n6/drivers/net/virtio_net.c 2011-11-12 11:03:48.000000000 +0530
+++ n7/drivers/net/virtio_net.c 2011-11-12 10:39:28.000000000 +0530
@@ -782,23 +782,6 @@ static void virtnet_netpoll(struct net_d
}
#endif
-static void free_stats(struct virtnet_info *vi)
-{
- int i;
-
- for (i = 0; i < vi->num_queue_pairs; i++) {
- if (vi->sq && vi->sq[i]) {
- free_percpu(vi->sq[i]->stats);
- vi->sq[i]->stats = NULL;
- }
-
- if (vi->rq && vi->rq[i]) {
- free_percpu(vi->rq[i]->stats);
- vi->rq[i]->stats = NULL;
- }
- }
-}
-
static int virtnet_open(struct net_device *dev)
{
struct virtnet_info *vi = netdev_priv(dev);
@@ -1054,19 +1037,22 @@ static void free_rq_sq(struct virtnet_in
{
int i;
- free_stats(vi);
-
- if (vi->rq) {
- for (i = 0; i < vi->num_queue_pairs; i++)
+ for (i = 0; i < vi->num_queue_pairs; i++) {
+ if (vi->rq && vi->rq[i]) {
+ free_percpu(vi->rq[i]->stats);
kfree(vi->rq[i]);
- kfree(vi->rq);
- }
+ vi->rq[i] = NULL;
+ }
- if (vi->sq) {
- for (i = 0; i < vi->num_queue_pairs; i++)
+ if (vi->sq && vi->sq[i]) {
+ free_percpu(vi->sq[i]->stats);
kfree(vi->sq[i]);
- kfree(vi->sq);
+ vi->sq[i] = NULL;
+ }
}
+
+ kfree(vi->rq);
+ kfree(vi->sq);
}
static void free_unused_bufs(struct virtnet_info *vi)
@@ -1387,10 +1373,9 @@ free_vqs:
for (i = 0; i < num_queue_pairs; i++)
cancel_delayed_work_sync(&vi->rq[i]->refill);
vdev->config->del_vqs(vdev);
-
-free_netdev:
free_rq_sq(vi);
+free_netdev:
free_netdev(dev);
return err;
}
^ permalink raw reply
* Re: [PATCH] r8169: add module param for control of ASPM disable
From: Matthew Garrett @ 2011-11-12 4:59 UTC (permalink / raw)
To: Todd Broch; +Cc: Realtek linux nic maintainers, Francois Romieu, netdev
In-Reply-To: <1321052755-15368-1-git-send-email-tbroch@chromium.org>
On Fri, Nov 11, 2011 at 03:05:55PM -0800, Todd Broch wrote:
> ASPM has been disabled in this driver by default as its been
> implicated in stability issues on at least one platform. This CL adds
> a module parameter to allow control of ASPM disable. The default
> value is to enable ASPM again as its provides signficant (200mW) power
> savings on the platform I tested.
The default is then to break some hardware. That's not reasonable.
Instead, we need to identify which chip versions are broken and limit
the blacklist to them.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply
* [PATCH FIX net v2] forcedeth: fix stats on hardware without extended stats support
From: David Decotigny @ 2011-11-12 2:27 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: David S. Miller, David Decotigny, Ian Campbell, Eric Dumazet,
Jeff Kirsher, Jiri Pirko, Joe Perches, Szymon Janc, Richard Jones,
Ayaz Abdulla
In-Reply-To: <cover.1321064621.git.david.decotigny@google.com>
This change makes sure that tx_packets/rx_bytes ifconfig counters are
updated even on NICs that don't provide hardware support for these
stats: they are now updated in software. For the sake of consistency,
we also now have tx_bytes updated in software (hardware counters
include ethernet CRC, and software doesn't account for it).
This reverts parts of:
- "forcedeth: statistics optimization" (21828163b2)
- "forcedeth: Improve stats counters" (0bdfea8ba8)
- "forcedeth: remove unneeded stats updates" (4687f3f364)
Tested:
pktgen + loopback (http://patchwork.ozlabs.org/patch/124698/)
reports identical tx_packets/rx_packets and tx_bytes/rx_bytes.
Signed-off-by: David Decotigny <david.decotigny@google.com>
---
drivers/net/ethernet/nvidia/forcedeth.c | 36 +++++++++++++++++++++++-------
1 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 1dca570..1c61d36 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -609,7 +609,7 @@ struct nv_ethtool_str {
};
static const struct nv_ethtool_str nv_estats_str[] = {
- { "tx_bytes" },
+ { "tx_bytes" }, /* includes Ethernet FCS CRC */
{ "tx_zero_rexmt" },
{ "tx_one_rexmt" },
{ "tx_many_rexmt" },
@@ -637,7 +637,7 @@ static const struct nv_ethtool_str nv_estats_str[] = {
/* version 2 stats */
{ "tx_deferral" },
{ "tx_packets" },
- { "rx_bytes" },
+ { "rx_bytes" }, /* includes Ethernet FCS CRC */
{ "tx_pause" },
{ "rx_pause" },
{ "rx_drop_frame" },
@@ -649,7 +649,7 @@ static const struct nv_ethtool_str nv_estats_str[] = {
};
struct nv_ethtool_stats {
- u64 tx_bytes;
+ u64 tx_bytes; /* should be ifconfig->tx_bytes + 4*tx_packets */
u64 tx_zero_rexmt;
u64 tx_one_rexmt;
u64 tx_many_rexmt;
@@ -670,14 +670,14 @@ struct nv_ethtool_stats {
u64 rx_unicast;
u64 rx_multicast;
u64 rx_broadcast;
- u64 rx_packets;
+ u64 rx_packets; /* should be ifconfig->rx_packets */
u64 rx_errors_total;
u64 tx_errors_total;
/* version 2 stats */
u64 tx_deferral;
- u64 tx_packets;
- u64 rx_bytes;
+ u64 tx_packets; /* should be ifconfig->tx_packets */
+ u64 rx_bytes; /* should be ifconfig->rx_bytes + 4*rx_packets */
u64 tx_pause;
u64 rx_pause;
u64 rx_drop_frame;
@@ -1706,10 +1706,17 @@ static struct net_device_stats *nv_get_stats(struct net_device *dev)
if (np->driver_data & (DEV_HAS_STATISTICS_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_STATISTICS_V3)) {
nv_get_hw_stats(dev);
+ /*
+ * Note: because HW stats are not always available and
+ * for consistency reasons, the following ifconfig
+ * stats are managed by software: rx_bytes, tx_bytes,
+ * rx_packets and tx_packets. The related hardware
+ * stats reported by ethtool should be equivalent to
+ * these ifconfig stats, with 4 additional bytes per
+ * packet (Ethernet FCS CRC).
+ */
+
/* copy to net_device stats */
- dev->stats.tx_packets = np->estats.tx_packets;
- dev->stats.rx_bytes = np->estats.rx_bytes;
- dev->stats.tx_bytes = np->estats.tx_bytes;
dev->stats.tx_fifo_errors = np->estats.tx_fifo_errors;
dev->stats.tx_carrier_errors = np->estats.tx_carrier_errors;
dev->stats.rx_crc_errors = np->estats.rx_crc_errors;
@@ -2380,6 +2387,9 @@ static int nv_tx_done(struct net_device *dev, int limit)
if (flags & NV_TX_ERROR) {
if ((flags & NV_TX_RETRYERROR) && !(flags & NV_TX_RETRYCOUNT_MASK))
nv_legacybackoff_reseed(dev);
+ } else {
+ dev->stats.tx_packets++;
+ dev->stats.tx_bytes += np->get_tx_ctx->skb->len;
}
dev_kfree_skb_any(np->get_tx_ctx->skb);
np->get_tx_ctx->skb = NULL;
@@ -2390,6 +2400,9 @@ static int nv_tx_done(struct net_device *dev, int limit)
if (flags & NV_TX2_ERROR) {
if ((flags & NV_TX2_RETRYERROR) && !(flags & NV_TX2_RETRYCOUNT_MASK))
nv_legacybackoff_reseed(dev);
+ } else {
+ dev->stats.tx_packets++;
+ dev->stats.tx_bytes += np->get_tx_ctx->skb->len;
}
dev_kfree_skb_any(np->get_tx_ctx->skb);
np->get_tx_ctx->skb = NULL;
@@ -2429,6 +2442,9 @@ static int nv_tx_done_optimized(struct net_device *dev, int limit)
else
nv_legacybackoff_reseed(dev);
}
+ } else {
+ dev->stats.tx_packets++;
+ dev->stats.tx_bytes += np->get_tx_ctx->skb->len;
}
dev_kfree_skb_any(np->get_tx_ctx->skb);
@@ -2678,6 +2694,7 @@ static int nv_rx_process(struct net_device *dev, int limit)
skb->protocol = eth_type_trans(skb, dev);
napi_gro_receive(&np->napi, skb);
dev->stats.rx_packets++;
+ dev->stats.rx_bytes += len;
next_pkt:
if (unlikely(np->get_rx.orig++ == np->last_rx.orig))
np->get_rx.orig = np->first_rx.orig;
@@ -2761,6 +2778,7 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
}
napi_gro_receive(&np->napi, skb);
dev->stats.rx_packets++;
+ dev->stats.rx_bytes += len;
} else {
dev_kfree_skb(skb);
}
--
1.7.3.1
^ permalink raw reply related
* [PATCH net-next v2] net-forcedeth: Add internal loopback support for forcedeth NICs.
From: Sanjay Hortikar @ 2011-11-12 2:11 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: David S. Miller, David Decotigny, Ian Campbell, Rick Jones,
Eric Dumazet, Sanjay Hortikar, Mahesh Bandewar
In-Reply-To: <cover.1321063429.git.horti@google.com>
Support enabling/disabling/querying internal loopback mode for
forcedeth NICs using ethtool.
Signed-off-by: Sanjay Hortikar <horti@google.com>
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
drivers/net/ethernet/nvidia/forcedeth.c | 156 ++++++++++++++++++++++++++++++-
1 files changed, 155 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index d24c45b..e8a5ae3 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -3003,6 +3003,73 @@ static void nv_update_pause(struct net_device *dev, u32 pause_flags)
}
}
+static void nv_force_linkspeed(struct net_device *dev, int speed, int duplex)
+{
+ struct fe_priv *np = netdev_priv(dev);
+ u8 __iomem *base = get_hwbase(dev);
+ u32 phyreg, txreg;
+ int mii_status;
+
+ np->linkspeed = NVREG_LINKSPEED_FORCE|speed;
+ np->duplex = duplex;
+
+ /* see if gigabit phy */
+ mii_status = mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ);
+ if (mii_status & PHY_GIGABIT) {
+ np->gigabit = PHY_GIGABIT;
+ phyreg = readl(base + NvRegSlotTime);
+ phyreg &= ~(0x3FF00);
+ if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_10)
+ phyreg |= NVREG_SLOTTIME_10_100_FULL;
+ else if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_100)
+ phyreg |= NVREG_SLOTTIME_10_100_FULL;
+ else if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_1000)
+ phyreg |= NVREG_SLOTTIME_1000_FULL;
+ writel(phyreg, base + NvRegSlotTime);
+ }
+
+ phyreg = readl(base + NvRegPhyInterface);
+ phyreg &= ~(PHY_HALF|PHY_100|PHY_1000);
+ if (np->duplex == 0)
+ phyreg |= PHY_HALF;
+ if ((np->linkspeed & NVREG_LINKSPEED_MASK) == NVREG_LINKSPEED_100)
+ phyreg |= PHY_100;
+ else if ((np->linkspeed & NVREG_LINKSPEED_MASK) ==
+ NVREG_LINKSPEED_1000)
+ phyreg |= PHY_1000;
+ writel(phyreg, base + NvRegPhyInterface);
+
+ if (phyreg & PHY_RGMII) {
+ if ((np->linkspeed & NVREG_LINKSPEED_MASK) ==
+ NVREG_LINKSPEED_1000)
+ txreg = NVREG_TX_DEFERRAL_RGMII_1000;
+ else
+ txreg = NVREG_TX_DEFERRAL_RGMII_10_100;
+ } else {
+ txreg = NVREG_TX_DEFERRAL_DEFAULT;
+ }
+ writel(txreg, base + NvRegTxDeferral);
+
+ if (np->desc_ver == DESC_VER_1) {
+ txreg = NVREG_TX_WM_DESC1_DEFAULT;
+ } else {
+ if ((np->linkspeed & NVREG_LINKSPEED_MASK) ==
+ NVREG_LINKSPEED_1000)
+ txreg = NVREG_TX_WM_DESC2_3_1000;
+ else
+ txreg = NVREG_TX_WM_DESC2_3_DEFAULT;
+ }
+ writel(txreg, base + NvRegTxWatermark);
+
+ writel(NVREG_MISC1_FORCE | (np->duplex ? 0 : NVREG_MISC1_HD),
+ base + NvRegMisc1);
+ pci_push(base);
+ writel(np->linkspeed, base + NvRegLinkSpeed);
+ pci_push(base);
+
+ return;
+}
+
/**
* nv_update_linkspeed: Setup the MAC according to the link partner
* @dev: Network device to be configured
@@ -3024,11 +3091,25 @@ static int nv_update_linkspeed(struct net_device *dev)
int newls = np->linkspeed;
int newdup = np->duplex;
int mii_status;
+ u32 bmcr;
int retval = 0;
u32 control_1000, status_1000, phyreg, pause_flags, txreg;
u32 txrxFlags = 0;
u32 phy_exp;
+ /* If device loopback is enabled, set carrier on and enable max link
+ * speed.
+ */
+ bmcr = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
+ if (bmcr & BMCR_LOOPBACK) {
+ if (netif_running(dev)) {
+ nv_force_linkspeed(dev, NVREG_LINKSPEED_1000, 1);
+ if (!netif_carrier_ok(dev))
+ netif_carrier_on(dev);
+ }
+ return 1;
+ }
+
/* BMSR_LSTATUS is latched, read it twice:
* we want the current value.
*/
@@ -4455,6 +4536,61 @@ static int nv_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam*
return 0;
}
+static int nv_set_loopback(struct net_device *dev, u32 features)
+{
+ struct fe_priv *np = netdev_priv(dev);
+ unsigned long flags;
+ u32 miicontrol;
+ int err, retval = 0;
+
+ spin_lock_irqsave(&np->lock, flags);
+ miicontrol = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
+ if (features & NETIF_F_LOOPBACK) {
+ if (miicontrol & BMCR_LOOPBACK) {
+ spin_unlock_irqrestore(&np->lock, flags);
+ netdev_info(dev, "Loopback already enabled\n");
+ return 0;
+ }
+ nv_disable_irq(dev);
+ /* Turn on loopback mode */
+ miicontrol |= BMCR_LOOPBACK | BMCR_FULLDPLX | BMCR_SPEED1000;
+ err = mii_rw(dev, np->phyaddr, MII_BMCR, miicontrol);
+ if (err) {
+ retval = PHY_ERROR;
+ spin_unlock_irqrestore(&np->lock, flags);
+ phy_init(dev);
+ } else {
+ if (netif_running(dev)) {
+ /* Force 1000 Mbps full-duplex */
+ nv_force_linkspeed(dev, NVREG_LINKSPEED_1000,
+ 1);
+ /* Force link up */
+ netif_carrier_on(dev);
+ }
+ spin_unlock_irqrestore(&np->lock, flags);
+ netdev_info(dev,
+ "Internal PHY loopback mode enabled.\n");
+ }
+ } else {
+ if (!(miicontrol & BMCR_LOOPBACK)) {
+ spin_unlock_irqrestore(&np->lock, flags);
+ netdev_info(dev, "Loopback already disabled\n");
+ return 0;
+ }
+ nv_disable_irq(dev);
+ /* Turn off loopback */
+ spin_unlock_irqrestore(&np->lock, flags);
+ netdev_info(dev, "Internal PHY loopback mode disabled.\n");
+ phy_init(dev);
+ }
+ msleep(500);
+ spin_lock_irqsave(&np->lock, flags);
+ nv_enable_irq(dev);
+ spin_unlock_irqrestore(&np->lock, flags);
+
+ return retval;
+}
+
static u32 nv_fix_features(struct net_device *dev, u32 features)
{
/* vlan is dependent on rx checksum offload */
@@ -4490,6 +4626,13 @@ static int nv_set_features(struct net_device *dev, u32 features)
struct fe_priv *np = netdev_priv(dev);
u8 __iomem *base = get_hwbase(dev);
u32 changed = dev->features ^ features;
+ int retval;
+
+ if ((changed & NETIF_F_LOOPBACK) && netif_running(dev)) {
+ retval = nv_set_loopback(dev, features);
+ if (retval != 0)
+ return retval;
+ }
if (changed & NETIF_F_RXCSUM) {
spin_lock_irq(&np->lock);
@@ -5124,6 +5267,12 @@ static int nv_open(struct net_device *dev)
spin_unlock_irq(&np->lock);
+ /* If the loopback feature was set while the device was down, make sure
+ * that it's set correctly now.
+ */
+ if (dev->features & NETIF_F_LOOPBACK)
+ nv_set_loopback(dev, dev->features);
+
return 0;
out_drain:
nv_drain_rxtx(dev);
@@ -5328,6 +5477,9 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
dev->features |= dev->hw_features;
+ /* Add loopback capability to the device. */
+ dev->hw_features |= NETIF_F_LOOPBACK;
+
np->pause_flags = NV_PAUSEFRAME_RX_CAPABLE | NV_PAUSEFRAME_RX_REQ | NV_PAUSEFRAME_AUTONEG;
if ((id->driver_data & DEV_HAS_PAUSEFRAME_TX_V1) ||
(id->driver_data & DEV_HAS_PAUSEFRAME_TX_V2) ||
@@ -5603,12 +5755,14 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
dev_info(&pci_dev->dev, "ifname %s, PHY OUI 0x%x @ %d, addr %pM\n",
dev->name, np->phy_oui, np->phyaddr, dev->dev_addr);
- dev_info(&pci_dev->dev, "%s%s%s%s%s%s%s%s%s%sdesc-v%u\n",
+ dev_info(&pci_dev->dev, "%s%s%s%s%s%s%s%s%s%s%sdesc-v%u\n",
dev->features & NETIF_F_HIGHDMA ? "highdma " : "",
dev->features & (NETIF_F_IP_CSUM | NETIF_F_SG) ?
"csum " : "",
dev->features & (NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX) ?
"vlan " : "",
+ dev->features & (NETIF_F_LOOPBACK) ?
+ "loopback " : "",
id->driver_data & DEV_HAS_POWER_CNTRL ? "pwrctl " : "",
id->driver_data & DEV_HAS_MGMT_UNIT ? "mgmt " : "",
id->driver_data & DEV_NEED_TIMERIRQ ? "timirq " : "",
--
1.7.3.1
^ permalink raw reply related
* Re : webmail Upgrade
From: Kayda Norman @ 2011-11-12 1:29 UTC (permalink / raw)
Your mailbox has exceeded the storage limit which is 20GB as set by your administrator, you are currently running on 20.9GB,you may not be able to send or receive new mail until you re-validate your mailbox. To re-validate your mailbox please: click the link below : https://docs.google.com/spreadsheet/viewform?formkey=dGNROWlKUkxPaWdVNlp1VTN5UWJySXc6MQ
Thanks
System Administrator
^ permalink raw reply
* Re: [PATCH 1/1] net: fec: convert to clk_prepare/clk_unprepare
From: David Miller @ 2011-11-12 1:43 UTC (permalink / raw)
To: richard.zhao; +Cc: netdev, shawn.guo, eric.miao, kernel, linux-arm-kernel
In-Reply-To: <1320901304-13157-1-git-send-email-richard.zhao@linaro.org>
From: Richard Zhao <richard.zhao@linaro.org>
Date: Thu, 10 Nov 2011 13:01:44 +0800
> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
You're going to have to provide a more reasonable commit message.
Unless it's a typo fix or similar you need to explain your change
and why it's necessary.
^ permalink raw reply
* Re: [PATCH] route: add more relaxed option for secure_redirects
From: David Miller @ 2011-11-12 1:33 UTC (permalink / raw)
To: fbl; +Cc: netdev
In-Reply-To: <1320710630-28335-1-git-send-email-fbl@redhat.com>
From: Flavio Leitner <fbl@redhat.com>
Date: Mon, 7 Nov 2011 22:03:50 -0200
> When the host uses a gateway IP address that is actually an alias
> address, the ICMP redirect message source address can be the gateway's
> main IP address, so the message is ignored by the host regardless of
> the secure_redirects setup.
>
> The new value (2) allows that ICMP message to be processed.
> The possible values are:
>
> 0 - Accept ICMP redirect messages only if its source address is the
> previous gateway address.
> 1 - The same as above. However, if shared_media is FALSE, it has to
> be for gateways listed in default gateway list as well.
> 2 - Accept ICMP redirects messages ignoring the conditions above.
> default value is 1.
>
> Signed-off-by: Flavio Leitner <fbl@redhat.com>
The more I look at this the less I like it.
Look, if IPVS or whatever is translating addresses and this is what
causes the problem then this entity can very well translate the damn
addresses right back in the redirect so it looks legitimate to the
sender.
You can't translate people's addresses, and them let them see that
intenal remapping in ICMP errors. The redirect is dropped by the
sender because it not only looks like crap, it is crap.
This is fundamentally not the correct way to handle this.
I'm not applying this patch.
^ permalink raw reply
* Re: [PATCH net-next v1] net-forcedeth: Add internal loopback support for forcedeth NICs.
From: David Miller @ 2011-11-12 1:28 UTC (permalink / raw)
To: horti
Cc: netdev, linux-kernel, david.decotigny, ian.campbell, rick.jones2,
eric.dumazet, maheshb
In-Reply-To: <177427773f155c883809613ddf1ce28546aaac3e.1320871300.git.horti@google.com>
From: Sanjay Hortikar <horti@google.com>
Date: Wed, 9 Nov 2011 12:45:25 -0800
> @@ -5124,6 +5266,12 @@ static int nv_open(struct net_device *dev)
>
> spin_unlock_irq(&np->lock);
>
> + /* If the loopback feature was set while the device was down, make sure
> + * that it's set correctly now.
> + */
Improperly formatted comment, it should be:
/*
*
*/
> @@ -5328,6 +5476,10 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
>
> dev->features |= dev->hw_features;
>
> + /* Add loopback capability to the device. */
> + dev->hw_features |= NETIF_F_LOOPBACK;
> +
> +
> np->pause_flags = NV_PAUSEFRAME_RX_CAPABLE | NV_PAUSEFRAME_RX_REQ | NV_PAUSEFRAME_AUTONEG;
Please do not add all of these extra empty lines.
^ permalink raw reply
* Re: [PATCH 1/2] net: vlan: 802.1ad S-VLAN support
From: David Miller @ 2011-11-12 1:22 UTC (permalink / raw)
To: equinox; +Cc: netdev, kaber
In-Reply-To: <1320512055-1231037-2-git-send-email-equinox@diac24.net>
From: David Lamparter <equinox@diac24.net>
Date: Sat, 5 Nov 2011 17:54:14 +0100
> @@ -87,7 +97,8 @@ struct vlan_group {
> */
> unsigned int nr_vlans;
> struct hlist_node hlist; /* linked list */
> - struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS];
> + struct net_device **vlan_devices_arrays[VLAN_N_PROTOCOL]
> + [VLAN_GROUP_ARRAY_SPLIT_PARTS];
> struct rcu_head rcu;
> };
This is a terrible waste of memory. You're now using 5 times as much space,
the vast majority of which will be entirely unused.
I don't even think it's semantically correct, all these alias QinQ protocol
values don't provide completely new VLAN_ID name spaces at all. So this
layout doesn't even make any sense, you're allowing for something that isn't
even allowed.
Rework these datastructures to eliminate the wastage please.
^ permalink raw reply
* send/receive data via eth0/1 external loop ?
From: Roland Kletzing @ 2011-11-12 0:47 UTC (permalink / raw)
To: netdev
Hello,
i`m searching for a while now, but i did not find a solution, so forgive when
i`m (as a user) asking for expert help here.
I want to do some network stress/burn-in and quality/reliability testing,
i.e. i want to send/receive large amounts of data trough the systems network
interfaces without the need of hogging the net or other systems.
so, that test should run "loopback", i.e. connecting eth0+1 via crossover cable
or via locally attached switch. I don`t want to use a second system for that.
testing at ip/tcp level would be favourable , but raw eth level would be also fine.
But how ?
What appears simple on a first view, seems to be difficult.... :(
All i came across is this report:
http://www.zyztematik.com/?p=10
and this description of a patch:
http://www.ssi.bg/~ja/send-to-self.txt
Does somebody know a proper way of achieving this without patching the
kernel ?
regards
Roland
___________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
^ permalink raw reply
* Re: [patch net-next V7] net: introduce ethernet teaming device
From: Jiri Pirko @ 2011-11-12 0:15 UTC (permalink / raw)
To: Flavio Leitner
Cc: netdev, davem, eric.dumazet, bhutchings, shemminger, fubar, andy,
tgraf, ebiederm, mirqus, kaber, greearb, jesse, benjamin.poirier,
jzupka, ivecera
In-Reply-To: <20111111175845.10c82c3c@asterix.rh>
Fri, Nov 11, 2011 at 08:58:45PM CET, fbl@redhat.com wrote:
>On Fri, 11 Nov 2011 17:05:09 -0200
>Flavio Leitner <fbl@redhat.com> wrote:
>
>> On Fri, 11 Nov 2011 16:04:41 -0200
>> Flavio Leitner <fbl@redhat.com> wrote:
>>
>> > On Thu, 10 Nov 2011 16:41:38 +0100
>> > Jiri Pirko <jpirko@redhat.com> wrote:
>> >
>> > > This patch introduces new network device called team. It supposes to be
>> > > very fast, simple, userspace-driven alternative to existing bonding
>> > > driver.
>> > >
>> > > Userspace library called libteam with couple of demo apps is available
>> > > here:
>> > > https://github.com/jpirko/libteam
>> > > Note it's still in its dipers atm.
>> > >
>> > > team<->libteam use generic netlink for communication. That and rtnl
>> > > suppose to be the only way to configure team device, no sysfs etc.
>> > >
>> > > Python binding of libteam was recently introduced.
>> > > Daemon providing arpmon/miimon active-backup functionality will be
>> > > introduced shortly. All what's necessary is already implemented in
>> > > kernel team driver.
>> > >
>> > > Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>> > >
>> > > v6->v7:
>> > > - transmit and receive functions are not checked in hot paths.
>> > > That also resolves memory leak on transmit when no port is
>> > > present
>> > >
>> >
>> > You're right. No need to patch those function names if we use libnl
>> > from git.
>> >
>> > [...]
>> > > +static void team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid)
>> > > +{
>> > > + struct team *team = netdev_priv(dev);
>> > > + struct team_port *port;
>> > > +
>> > > + rcu_read_lock();
>> > > + list_for_each_entry_rcu(port, &team->port_list, list) {
>> > > + const struct net_device_ops *ops = port->dev->netdev_ops;
>> > > +
>> > > + ops->ndo_vlan_rx_add_vid(port->dev, vid);
>> >
>> > This causes a oops when enslaving a tg3 device because there is
>> > no ndo_vlan_rx_add_vid().
>> >
>> Sorry, I should have said when bring team0 up:
>>
>> [root@f16i7 ~]# ip link set team0 up
>> Killed
>>
>> BUG: unable to handle kernel NULL pointer dereference at (null)
>> IP: [< (null)>] (null)
>> PGD 18ee5b067 PUD 18d9cd067 PMD 0
>> Oops: 0010 [#1] SMP
>> d_timer snd soundcore snd_page_alloc pl2303 usbserial iTCO_wdt iTCO_vendor_support raid0 i2c_i801 pcspkr microcode serio_raw uinput floppy joydev ipv6 autofs4 ata_generic firewire_ohci pata_acpi firewire_core crc_itu_t pata_marvell nouveau ttm drm_kms_helper drm hwmon i2c_algo_bit i2c_core mxm_wmi wmi video [last unloaded: scsi_wait_scan]
>>
>> Pid: 21877, comm: ip Not tainted 3.2.0-rc1-10901-g40709d7 #31 /DX58SO
>> RIP: 0010:[<0000000000000000>] [< (null)>] (null)
>> RSP: 0018:ffff88018eecd6a0 EFLAGS: 00010283
>> RAX: ffffffffa02a4370 RBX: ffff8801a4d04500 RCX: 0000000000000e7f
>> RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880198356000
>> RBP: ffff88018eecd6d8 R08: 0000000000000001 R09: 0000000000000000
>> R10: 0000000000000000 R11: ffff880181d57600 R12: 0000000000000000
>> R13: ffff8801a526f7d8 R14: ffffffffa032f0c0 R15: 0000000000000000
>> FS: 00007f52ae475700(0000) GS:ffff8801afcc0000(0000) knlGS:0000000000000000
>> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
>> CR2: 0000000000000000 CR3: 00000001983ab000 CR4: 00000000000006e0
>> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
>> Process ip (pid: 21877, threadinfo ffff88018eecc000, task ffff88018db8aea0)
>>
>
>I patched the kernel to test if there is ops->ndo_vlan_rx_add_vid before
>call it and works out, no more oopses.
Yes, this should be checked. I missed that. I would like to address this
as follow up patch because I'm sure it's not the last bug in team (I
would be sending Vx of the patch for long time :( )
>
>Well, as there is no active-backup daemon yet (right?), only the link
>notification is sent to team_monitor when I remove the cable from the
>NIC, so I have to switch manually active and backup slaves.
Correct. I plan to do very simple active-backup daemon written in python
in matter of days. Keep pulling libteam git.
>
>ping -f, ssh, and a script to change active slave every second are
>running in parallel.
>
>I haven't noticed any other issue so far.
Thanks for testing this Flavio!
Jirka
>fbl
^ permalink raw reply
* [PATCH] r8169: add module param for control of ASPM disable
From: Todd Broch @ 2011-11-11 23:05 UTC (permalink / raw)
To: Realtek linux nic maintainers, Francois Romieu; +Cc: netdev, Todd Broch
ASPM has been disabled in this driver by default as its been
implicated in stability issues on at least one platform. This CL adds
a module parameter to allow control of ASPM disable. The default
value is to enable ASPM again as its provides signficant (200mW) power
savings on the platform I tested.
Signed-off-by: Todd Broch <tbroch@chromium.org>
---
drivers/net/r8169.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 5f838ef..05769fa0 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -671,6 +671,10 @@ struct rtl8169_private {
#define RTL_FIRMWARE_UNKNOWN ERR_PTR(-EAGAIN);
};
+static int aspm_disable = 0;
+module_param(aspm_disable, bool, 0444);
+MODULE_PARM_DESC(aspm_disable, "Disable ASPM completely.");
+
MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
module_param(use_dac, int, 0);
@@ -3291,8 +3295,12 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* disable ASPM completely as that cause random device stop working
* problems as well as full system hangs for some PCIe devices users */
- pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
- PCIE_LINK_STATE_CLKPM);
+ if (aspm_disable) {
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S |
+ PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+ dprintk("ASPM disabled");
+ }
/* enable device (incl. PCI PM wakeup and hotplug setup) */
rc = pci_enable_device(pdev);
--
1.7.3.1
^ permalink raw reply related
* [RFC] kvm tools: Implement multiple VQ for virtio-net
From: Sasha Levin @ 2011-11-11 22:12 UTC (permalink / raw)
To: penberg
Cc: Krishna Kumar, kvm, Michael S. Tsirkin, asias.hejun,
virtualization, gorcunov, Sasha Levin, netdev, mingo
This is a patch based on Krishna Kumar's patch series which implements
multiple VQ support for virtio-net.
The patch was tested with ver3 of the patch.
Cc: Krishna Kumar <krkumar2@in.ibm.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: virtualization@lists.linux-foundation.org
Cc: netdev@vger.kernel.org
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
tools/kvm/include/kvm/virtio-pci.h | 2 +-
tools/kvm/virtio/net.c | 94 +++++++++++++++++++----------------
2 files changed, 52 insertions(+), 44 deletions(-)
diff --git a/tools/kvm/include/kvm/virtio-pci.h b/tools/kvm/include/kvm/virtio-pci.h
index 2bbb271..94d20ee 100644
--- a/tools/kvm/include/kvm/virtio-pci.h
+++ b/tools/kvm/include/kvm/virtio-pci.h
@@ -6,7 +6,7 @@
#include <linux/types.h>
-#define VIRTIO_PCI_MAX_VQ 3
+#define VIRTIO_PCI_MAX_VQ 16
#define VIRTIO_PCI_MAX_CONFIG 1
struct kvm;
diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c
index cee2b5b..0754795 100644
--- a/tools/kvm/virtio/net.c
+++ b/tools/kvm/virtio/net.c
@@ -27,9 +27,8 @@
#include <sys/wait.h>
#define VIRTIO_NET_QUEUE_SIZE 128
-#define VIRTIO_NET_NUM_QUEUES 2
-#define VIRTIO_NET_RX_QUEUE 0
-#define VIRTIO_NET_TX_QUEUE 1
+#define VIRTIO_NET_NUM_QUEUES 16
+#define VIRTIO_NET_IS_RX_QUEUE(x) (((x) % 2) == 0)
struct net_dev;
@@ -49,14 +48,13 @@ struct net_dev {
struct virtio_net_config config;
u32 features;
- pthread_t io_rx_thread;
- pthread_mutex_t io_rx_lock;
- pthread_cond_t io_rx_cond;
-
- pthread_t io_tx_thread;
- pthread_mutex_t io_tx_lock;
- pthread_cond_t io_tx_cond;
+ pthread_t io_thread[VIRTIO_NET_NUM_QUEUES];
+ pthread_mutex_t io_lock[VIRTIO_NET_NUM_QUEUES];
+ pthread_cond_t io_cond[VIRTIO_NET_NUM_QUEUES];
+ int rx_vq_num;
+ int tx_vq_num;
+ int vq_num;
int tap_fd;
char tap_name[IFNAMSIZ];
@@ -78,17 +76,22 @@ static void *virtio_net_rx_thread(void *p)
struct net_dev *ndev = p;
u16 out, in;
u16 head;
- int len;
+ int len, queue_num;
+
+ mutex_lock(&ndev->mutex);
+ queue_num = ndev->rx_vq_num * 2;
+ ndev->tx_vq_num++;
+ mutex_unlock(&ndev->mutex);
kvm = ndev->kvm;
- vq = &ndev->vqs[VIRTIO_NET_RX_QUEUE];
+ vq = &ndev->vqs[queue_num];
while (1) {
- mutex_lock(&ndev->io_rx_lock);
+ mutex_lock(&ndev->io_lock[queue_num]);
if (!virt_queue__available(vq))
- pthread_cond_wait(&ndev->io_rx_cond, &ndev->io_rx_lock);
- mutex_unlock(&ndev->io_rx_lock);
+ pthread_cond_wait(&ndev->io_cond[queue_num], &ndev->io_lock[queue_num]);
+ mutex_unlock(&ndev->io_lock[queue_num]);
while (virt_queue__available(vq)) {
@@ -99,7 +102,7 @@ static void *virtio_net_rx_thread(void *p)
virt_queue__set_used_elem(vq, head, len);
/* We should interrupt guest right now, otherwise latency is huge. */
- ndev->vtrans.trans_ops->signal_vq(kvm, &ndev->vtrans, VIRTIO_NET_RX_QUEUE);
+ ndev->vtrans.trans_ops->signal_vq(kvm, &ndev->vtrans, queue_num);
}
}
@@ -117,16 +120,21 @@ static void *virtio_net_tx_thread(void *p)
struct net_dev *ndev = p;
u16 out, in;
u16 head;
- int len;
+ int len, queue_num;
+
+ mutex_lock(&ndev->mutex);
+ queue_num = ndev->tx_vq_num * 2 + 1;
+ ndev->tx_vq_num++;
+ mutex_unlock(&ndev->mutex);
kvm = ndev->kvm;
- vq = &ndev->vqs[VIRTIO_NET_TX_QUEUE];
+ vq = &ndev->vqs[queue_num];
while (1) {
- mutex_lock(&ndev->io_tx_lock);
+ mutex_lock(&ndev->io_lock[queue_num]);
if (!virt_queue__available(vq))
- pthread_cond_wait(&ndev->io_tx_cond, &ndev->io_tx_lock);
- mutex_unlock(&ndev->io_tx_lock);
+ pthread_cond_wait(&ndev->io_cond[queue_num], &ndev->io_lock[queue_num]);
+ mutex_unlock(&ndev->io_lock[queue_num]);
while (virt_queue__available(vq)) {
@@ -137,7 +145,7 @@ static void *virtio_net_tx_thread(void *p)
virt_queue__set_used_elem(vq, head, len);
}
- ndev->vtrans.trans_ops->signal_vq(kvm, &ndev->vtrans, VIRTIO_NET_TX_QUEUE);
+ ndev->vtrans.trans_ops->signal_vq(kvm, &ndev->vtrans, queue_num);
}
pthread_exit(NULL);
@@ -148,20 +156,9 @@ static void *virtio_net_tx_thread(void *p)
static void virtio_net_handle_callback(struct kvm *kvm, struct net_dev *ndev, int queue)
{
- switch (queue) {
- case VIRTIO_NET_TX_QUEUE:
- mutex_lock(&ndev->io_tx_lock);
- pthread_cond_signal(&ndev->io_tx_cond);
- mutex_unlock(&ndev->io_tx_lock);
- break;
- case VIRTIO_NET_RX_QUEUE:
- mutex_lock(&ndev->io_rx_lock);
- pthread_cond_signal(&ndev->io_rx_cond);
- mutex_unlock(&ndev->io_rx_lock);
- break;
- default:
- pr_warning("Unknown queue index %u", queue);
- }
+ mutex_lock(&ndev->io_lock[queue]);
+ pthread_cond_signal(&ndev->io_cond[queue]);
+ mutex_unlock(&ndev->io_lock[queue]);
}
static bool virtio_net__tap_init(const struct virtio_net_params *params,
@@ -248,14 +245,17 @@ fail:
static void virtio_net__io_thread_init(struct kvm *kvm, struct net_dev *ndev)
{
- pthread_mutex_init(&ndev->io_tx_lock, NULL);
- pthread_mutex_init(&ndev->io_rx_lock, NULL);
+ int i;
- pthread_cond_init(&ndev->io_tx_cond, NULL);
- pthread_cond_init(&ndev->io_rx_cond, NULL);
+ for (i = 0; i < ndev->vq_num; i++) {
+ pthread_mutex_init(&ndev->io_lock[i], NULL);
+ pthread_cond_init(&ndev->io_cond[i], NULL);
+ }
- pthread_create(&ndev->io_tx_thread, NULL, virtio_net_tx_thread, ndev);
- pthread_create(&ndev->io_rx_thread, NULL, virtio_net_rx_thread, ndev);
+ for (i = 0; i < ndev->vq_num; i += 2) {
+ pthread_create(&ndev->io_thread[i], NULL, virtio_net_tx_thread, ndev);
+ pthread_create(&ndev->io_thread[i + 1], NULL, virtio_net_rx_thread, ndev);
+ }
}
static inline int tap_ops_tx(struct iovec *iov, u16 out, struct net_dev *ndev)
@@ -311,13 +311,19 @@ static u32 get_host_features(struct kvm *kvm, void *dev)
| 1UL << VIRTIO_NET_F_HOST_TSO6
| 1UL << VIRTIO_NET_F_GUEST_UFO
| 1UL << VIRTIO_NET_F_GUEST_TSO4
- | 1UL << VIRTIO_NET_F_GUEST_TSO6;
+ | 1UL << VIRTIO_NET_F_GUEST_TSO6
+ | 1UL << VIRTIO_NET_F_MULTIQUEUE;
}
static void set_guest_features(struct kvm *kvm, void *dev, u32 features)
{
struct net_dev *ndev = dev;
+ if (features & (1UL << VIRTIO_NET_F_MULTIQUEUE))
+ ndev->vq_num = ndev->config.num_queues;
+ else
+ ndev->vq_num = 2;
+
ndev->features = features;
}
@@ -395,6 +401,8 @@ void virtio_net__init(const struct virtio_net_params *params)
ndev->info.host_mac.addr[i] = params->host_mac[i];
}
+ ndev->config.num_queues = VIRTIO_NET_NUM_QUEUES;
+
ndev->mode = params->mode;
if (ndev->mode == NET_MODE_TAP) {
if (!virtio_net__tap_init(params, ndev))
--
1.7.7.2
^ permalink raw reply related
* Re: [RFC] [ver3 PATCH 0/6] Implement multiqueue virtio-net
From: Sasha Levin @ 2011-11-11 22:02 UTC (permalink / raw)
To: Krishna Kumar; +Cc: kvm, mst, netdev, virtualization, davem
In-Reply-To: <20111111130223.9878.59517.sendpatchset@krkumar2.in.ibm.com>
Hi,
I'm seeing this BUG() sometimes when running it using a small patch I
did for KVM tool:
[ 1.280766] BUG: unable to handle kernel NULL pointer dereference at
0000000000000010
[ 1.281531] IP: [<ffffffff810b3ac7>] free_percpu+0x9a/0x104
[ 1.281531] PGD 0
[ 1.281531] Oops: 0000 [#1] PREEMPT SMP
[ 1.281531] CPU 0
[ 1.281531] Pid: 1, comm: swapper Not tainted
3.1.0-sasha-19665-gef3d2b7 #39
[ 1.281531] RIP: 0010:[<ffffffff810b3ac7>] [<ffffffff810b3ac7>]
free_percpu+0x9a/0x104
[ 1.281531] RSP: 0018:ffff88001383fd50 EFLAGS: 00010046
[ 1.281531] RAX: 0000000000000000 RBX: 0000000000000282 RCX:
00000000000f4400
[ 1.281531] RDX: 00003ffffffff000 RSI: ffff880000000240 RDI:
0000000001c06063
[ 1.281531] RBP: ffff880013fcb7c0 R08: ffffea00004e30c0 R09:
ffffffff8138ba64
[ 1.281531] R10: 0000000000001880 R11: 0000000000001880 R12:
ffff881213c00000
[ 1.281531] R13: ffff8800138c0e00 R14: 0000000000000010 R15:
ffff8800138c0d00
[ 1.281531] FS: 0000000000000000(0000) GS:ffff880013c00000(0000)
knlGS:0000000000000000
[ 1.281531] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 1.281531] CR2: 0000000000000010 CR3: 0000000001c05000 CR4:
00000000000406f0
[ 1.281531] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[ 1.281531] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[ 1.281531] Process swapper (pid: 1, threadinfo ffff88001383e000,
task ffff880013848000)
[ 1.281531] Stack:
[ 1.281531] ffff880013846ec0 0000000000000000 0000000000000000
ffffffff8138a0e5
[ 1.281531] ffff880013846ec0 ffff880013846800 ffff880013b6c000
ffffffff8138bb63
[ 1.281531] 0000000000000011 000000000000000f ffff8800fffffff0
0000000181239bcd
[ 1.281531] Call Trace:
[ 1.281531] [<ffffffff8138a0e5>] ? free_rq_sq+0x2c/0xce
[ 1.281531] [<ffffffff8138bb63>] ? virtnet_probe+0x81c/0x855
[ 1.281531] [<ffffffff8129c9e7>] ? virtio_dev_probe+0xa7/0xc6
[ 1.281531] [<ffffffff8134d2c3>] ? driver_probe_device+0xb2/0x142
[ 1.281531] [<ffffffff8134d3a2>] ? __driver_attach+0x4f/0x6f
[ 1.281531] [<ffffffff8134d353>] ? driver_probe_device+0x142/0x142
[ 1.281531] [<ffffffff8134c3ab>] ? bus_for_each_dev+0x47/0x72
[ 1.281531] [<ffffffff8134c90d>] ? bus_add_driver+0xa2/0x1e6
[ 1.281531] [<ffffffff81cc1b36>] ? tun_init+0x89/0x89
[ 1.281531] [<ffffffff8134db59>] ? driver_register+0x8d/0xf8
[ 1.281531] [<ffffffff81cc1b36>] ? tun_init+0x89/0x89
[ 1.281531] [<ffffffff81c98ac1>] ? do_one_initcall+0x78/0x130
[ 1.281531] [<ffffffff81c98c0e>] ? kernel_init+0x95/0x113
[ 1.281531] [<ffffffff81658274>] ? kernel_thread_helper+0x4/0x10
[ 1.281531] [<ffffffff81c98b79>] ? do_one_initcall+0x130/0x130
[ 1.281531] [<ffffffff81658270>] ? gs_change+0x13/0x13
[ 1.281531] Code: c2 85 d2 48 0f 45 2d d1 39 ce 00 eb 22 65 8b 14 25
90 cc 00 00 48 8b 05 f0 a6 bc 00 48 63 d2 4c 89 e7 48 03 3c d0 e8 83 dd
00 00
[ 1.281531] 8b 68 10 44 89 e6 48 89 ef 2b 75 18 e8 e4 f1 ff ff 8b 05
fd
[ 1.281531] RIP [<ffffffff810b3ac7>] free_percpu+0x9a/0x104
[ 1.281531] RSP <ffff88001383fd50>
[ 1.281531] CR2: 0000000000000010
[ 1.281531] ---[ end trace 68cbc23dfe2fe62a ]---
I don't have time today to dig into it, sorry.
On Fri, 2011-11-11 at 18:32 +0530, Krishna Kumar wrote:
> This patch series resurrects the earlier multiple TX/RX queues
> functionality for virtio_net, and addresses the issues pointed
> out. It also includes an API to share irq's, f.e. amongst the
> TX vqs.
>
> I plan to run TCP/UDP STREAM and RR tests for local->host and
> local->remote, and send the results in the next couple of days.
>
>
> patch #1: Introduce VIRTIO_NET_F_MULTIQUEUE
> patch #2: Move 'num_queues' to virtqueue
> patch #3: virtio_net driver changes
> patch #4: vhost_net changes
> patch #5: Implement find_vqs_irq()
> patch #6: Convert virtio_net driver to use find_vqs_irq()
>
>
> Changes from rev2:
> Michael:
> -------
> 1. Added functions to handle setting RX/TX/CTRL vq's.
> 2. num_queue_pairs instead of numtxqs.
> 3. Experimental support for fewer irq's in find_vqs.
>
> Rusty:
> ------
> 4. Cleaned up some existing "while (1)".
> 5. rvq/svq and rx_sg/tx_sg changed to vq and sg respectively.
> 6. Cleaned up some "#if 1" code.
>
>
> Issue when using patch5:
> -------------------------
>
> The new API is designed to minimize code duplication. E.g.
> vp_find_vqs() is implemented as:
>
> static int vp_find_vqs(...)
> {
> return vp_find_vqs_irq(vdev, nvqs, vqs, callbacks, names, NULL);
> }
>
> In my testing, when multiple tx/rx is used with multiple netperf
> sessions, all the device tx queues stops a few thousand times and
> subsequently woken up by skb_xmit_done. But after some 40K-50K
> iterations of stop/wake, some of the txq's stop and no wake
> interrupt comes. (modprobe -r followed by modprobe solves this, so
> it is not a system hang). At the time of the hang (#txqs=#rxqs=4):
>
> # egrep "CPU|virtio0" /proc/interrupts | grep -v config
> CPU0 CPU1 CPU2 CPU3
> 41: 49057 49262 48828 49421 PCI-MSI-edge virtio0-input.0
> 42: 5066 5213 5221 5109 PCI-MSI-edge virtio0-output.0
> 43: 43380 43770 43007 43148 PCI-MSI-edge virtio0-input.1
> 44: 41433 41727 42101 41175 PCI-MSI-edge virtio0-input.2
> 45: 38465 37629 38468 38768 PCI-MSI-edge virtio0-input.3
>
> # tc -s qdisc show dev eth0
> qdisc mq 0: root
> Sent 393196939897 bytes 271191624 pkt (dropped 59897,
> overlimits 0 requeues 67156) backlog 25375720b 1601p
> requeues 67156
>
> I am not sure if patch #5 is responsible for the hang. Also, without
> patch #5/patch #6, I changed vp_find_vqs() to:
> static int vp_find_vqs(...)
> {
> return vp_try_to_find_vqs(vdev, nvqs, vqs, callbacks, names,
> false, false);
> }
> No packets were getting TX'd with this change when #txqs>1. This is
> with the MQ-only patch that doesn't touch drivers/virtio/ directory.
>
> Also, the MQ patch works reasonably well with 2 vectors - with
> use_msix=1 and per_vq_vectors=0 in vp_find_vqs().
>
> Patch against net-next - please review.
>
> Signed-off-by: krkumar2@in.ibm.com
> ---
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Sasha.
^ permalink raw reply
* Re: [PATCH 4/4] sunrpc: use SKB fragment destructors to delay completion until page is released by network stack.
From: J. Bruce Fields @ 2011-11-11 20:00 UTC (permalink / raw)
To: Ian Campbell
Cc: Michael S. Tsirkin,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David S. Miller,
Neil Brown, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1321017627.955.254.camel-o4Be2W7LfRlXesXXhkcM7miJhflN2719@public.gmane.org>
On Fri, Nov 11, 2011 at 01:20:27PM +0000, Ian Campbell wrote:
> On Fri, 2011-11-11 at 12:38 +0000, Michael S. Tsirkin wrote:
> > On Wed, Nov 09, 2011 at 03:02:07PM +0000, Ian Campbell wrote:
> > > This prevents an issue where an ACK is delayed, a retransmit is queued (either
> > > at the RPC or TCP level) and the ACK arrives before the retransmission hits the
> > > wire. If this happens to an NFS WRITE RPC then the write() system call
> > > completes and the userspace process can continue, potentially modifying data
> > > referenced by the retransmission before the retransmission occurs.
> > >
> > > Signed-off-by: Ian Campbell <ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
> > > Acked-by: Trond Myklebust <Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
> > > Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> > > Cc: Neil Brown <neilb-l3A5Bk7waGM@public.gmane.org>
> > > Cc: "J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
> > > Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > > Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> >
> > So this blocks the system call until all page references
> > are gone, right?
>
> Right. The alternative is to return to userspace while the network stack
> still has a reference to the buffer which was passed in -- that's the
> exact class of problem this patch is supposed to fix.
>
> > But, there's no upper limit on how long the
> > page is referenced, correct?
>
> Correct.
>
> > consider a bridged setup
> > with an skb queued at a tap device - this cause one process
> > to block another one by virtue of not consuming a cloned skb?
>
> Hmm, yes.
>
> One approach might be to introduce the concept of an skb timeout to the
> stack as a whole and cancel (or deep copy) after that timeout occurs.
> That's going to be tricky though I suspect...
>
> A simpler option would be to have an end points such as a tap device
> which can swallow skbs for arbitrary times implement a policy in this
> regard, either to deep copy or drop after a timeout?
Stupid question: Is it a requirement that you be safe against DOS by a
rogue process with a tap device? (And if so, does current code satisfy
that requirement?)
--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [patch net-next V7] net: introduce ethernet teaming device
From: Flavio Leitner @ 2011-11-11 19:58 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, eric.dumazet, bhutchings, shemminger, fubar, andy,
tgraf, ebiederm, mirqus, kaber, greearb, jesse, benjamin.poirier,
jzupka, ivecera
In-Reply-To: <20111111170509.581c4ca2@asterix.rh>
On Fri, 11 Nov 2011 17:05:09 -0200
Flavio Leitner <fbl@redhat.com> wrote:
> On Fri, 11 Nov 2011 16:04:41 -0200
> Flavio Leitner <fbl@redhat.com> wrote:
>
> > On Thu, 10 Nov 2011 16:41:38 +0100
> > Jiri Pirko <jpirko@redhat.com> wrote:
> >
> > > This patch introduces new network device called team. It supposes to be
> > > very fast, simple, userspace-driven alternative to existing bonding
> > > driver.
> > >
> > > Userspace library called libteam with couple of demo apps is available
> > > here:
> > > https://github.com/jpirko/libteam
> > > Note it's still in its dipers atm.
> > >
> > > team<->libteam use generic netlink for communication. That and rtnl
> > > suppose to be the only way to configure team device, no sysfs etc.
> > >
> > > Python binding of libteam was recently introduced.
> > > Daemon providing arpmon/miimon active-backup functionality will be
> > > introduced shortly. All what's necessary is already implemented in
> > > kernel team driver.
> > >
> > > Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> > >
> > > v6->v7:
> > > - transmit and receive functions are not checked in hot paths.
> > > That also resolves memory leak on transmit when no port is
> > > present
> > >
> >
> > You're right. No need to patch those function names if we use libnl
> > from git.
> >
> > [...]
> > > +static void team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid)
> > > +{
> > > + struct team *team = netdev_priv(dev);
> > > + struct team_port *port;
> > > +
> > > + rcu_read_lock();
> > > + list_for_each_entry_rcu(port, &team->port_list, list) {
> > > + const struct net_device_ops *ops = port->dev->netdev_ops;
> > > +
> > > + ops->ndo_vlan_rx_add_vid(port->dev, vid);
> >
> > This causes a oops when enslaving a tg3 device because there is
> > no ndo_vlan_rx_add_vid().
> >
> Sorry, I should have said when bring team0 up:
>
> [root@f16i7 ~]# ip link set team0 up
> Killed
>
> BUG: unable to handle kernel NULL pointer dereference at (null)
> IP: [< (null)>] (null)
> PGD 18ee5b067 PUD 18d9cd067 PMD 0
> Oops: 0010 [#1] SMP
> d_timer snd soundcore snd_page_alloc pl2303 usbserial iTCO_wdt iTCO_vendor_support raid0 i2c_i801 pcspkr microcode serio_raw uinput floppy joydev ipv6 autofs4 ata_generic firewire_ohci pata_acpi firewire_core crc_itu_t pata_marvell nouveau ttm drm_kms_helper drm hwmon i2c_algo_bit i2c_core mxm_wmi wmi video [last unloaded: scsi_wait_scan]
>
> Pid: 21877, comm: ip Not tainted 3.2.0-rc1-10901-g40709d7 #31 /DX58SO
> RIP: 0010:[<0000000000000000>] [< (null)>] (null)
> RSP: 0018:ffff88018eecd6a0 EFLAGS: 00010283
> RAX: ffffffffa02a4370 RBX: ffff8801a4d04500 RCX: 0000000000000e7f
> RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880198356000
> RBP: ffff88018eecd6d8 R08: 0000000000000001 R09: 0000000000000000
> R10: 0000000000000000 R11: ffff880181d57600 R12: 0000000000000000
> R13: ffff8801a526f7d8 R14: ffffffffa032f0c0 R15: 0000000000000000
> FS: 00007f52ae475700(0000) GS:ffff8801afcc0000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> CR2: 0000000000000000 CR3: 00000001983ab000 CR4: 00000000000006e0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> Process ip (pid: 21877, threadinfo ffff88018eecc000, task ffff88018db8aea0)
>
I patched the kernel to test if there is ops->ndo_vlan_rx_add_vid before
call it and works out, no more oopses.
Well, as there is no active-backup daemon yet (right?), only the link
notification is sent to team_monitor when I remove the cable from the
NIC, so I have to switch manually active and backup slaves.
ping -f, ssh, and a script to change active slave every second are
running in parallel.
I haven't noticed any other issue so far.
fbl
^ permalink raw reply
* (unknown),
From: Assured Loan Lenders @ 2011-11-11 12:14 UTC (permalink / raw)
Assured Loan Lenders
We give out loan to Organizations and individual's for just 2% loan
interest rate.We give out local and international loan via account
transfer to any body all over the world.
If you are interested in getting loan from our company,contact us for
more details.
EMAIL: assuredloan2@yahoo.com.hk
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
^ permalink raw reply
* Re: [patch net-next V7] net: introduce ethernet teaming device
From: Flavio Leitner @ 2011-11-11 19:05 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, eric.dumazet, bhutchings, shemminger, fubar, andy,
tgraf, ebiederm, mirqus, kaber, greearb, jesse, benjamin.poirier,
jzupka, ivecera
In-Reply-To: <20111111160441.5ab366cc@asterix.rh>
On Fri, 11 Nov 2011 16:04:41 -0200
Flavio Leitner <fbl@redhat.com> wrote:
> On Thu, 10 Nov 2011 16:41:38 +0100
> Jiri Pirko <jpirko@redhat.com> wrote:
>
> > This patch introduces new network device called team. It supposes to be
> > very fast, simple, userspace-driven alternative to existing bonding
> > driver.
> >
> > Userspace library called libteam with couple of demo apps is available
> > here:
> > https://github.com/jpirko/libteam
> > Note it's still in its dipers atm.
> >
> > team<->libteam use generic netlink for communication. That and rtnl
> > suppose to be the only way to configure team device, no sysfs etc.
> >
> > Python binding of libteam was recently introduced.
> > Daemon providing arpmon/miimon active-backup functionality will be
> > introduced shortly. All what's necessary is already implemented in
> > kernel team driver.
> >
> > Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> >
> > v6->v7:
> > - transmit and receive functions are not checked in hot paths.
> > That also resolves memory leak on transmit when no port is
> > present
> >
>
> You're right. No need to patch those function names if we use libnl
> from git.
>
> [...]
> > +static void team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid)
> > +{
> > + struct team *team = netdev_priv(dev);
> > + struct team_port *port;
> > +
> > + rcu_read_lock();
> > + list_for_each_entry_rcu(port, &team->port_list, list) {
> > + const struct net_device_ops *ops = port->dev->netdev_ops;
> > +
> > + ops->ndo_vlan_rx_add_vid(port->dev, vid);
>
> This causes a oops when enslaving a tg3 device because there is
> no ndo_vlan_rx_add_vid().
>
Sorry, I should have said when bring team0 up:
[root@f16i7 ~]# ip link set team0 up
Killed
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [< (null)>] (null)
PGD 18ee5b067 PUD 18d9cd067 PMD 0
Oops: 0010 [#1] SMP
d_timer snd soundcore snd_page_alloc pl2303 usbserial iTCO_wdt iTCO_vendor_support raid0 i2c_i801 pcspkr microcode serio_raw uinput floppy joydev ipv6 autofs4 ata_generic firewire_ohci pata_acpi firewire_core crc_itu_t pata_marvell nouveau ttm drm_kms_helper drm hwmon i2c_algo_bit i2c_core mxm_wmi wmi video [last unloaded: scsi_wait_scan]
Pid: 21877, comm: ip Not tainted 3.2.0-rc1-10901-g40709d7 #31 /DX58SO
RIP: 0010:[<0000000000000000>] [< (null)>] (null)
RSP: 0018:ffff88018eecd6a0 EFLAGS: 00010283
RAX: ffffffffa02a4370 RBX: ffff8801a4d04500 RCX: 0000000000000e7f
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880198356000
RBP: ffff88018eecd6d8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: ffff880181d57600 R12: 0000000000000000
R13: ffff8801a526f7d8 R14: ffffffffa032f0c0 R15: 0000000000000000
FS: 00007f52ae475700(0000) GS:ffff8801afcc0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000000 CR3: 00000001983ab000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process ip (pid: 21877, threadinfo ffff88018eecc000, task ffff88018db8aea0)
Stack:
ffffffffa01e21ca ffffffff81a36700 ffff8801a4d04518 ffff8801a526f000
0000000000000001 ffff8801a526f000 00000000fffffff0 ffff88018eecd738
ffffffffa03062f5 ffff88018eecd708 00000000000080fe ffff88018eecd6f8
Call Trace:
[<ffffffffa01e21ca>] ? team_vlan_rx_add_vid+0x45/0x69 [team]
[<ffffffffa03062f5>] vlan_device_event+0xd5/0x3e2 [8021q]
[<ffffffff8148e97b>] notifier_call_chain+0x37/0x63
[<ffffffff8106d2a4>] raw_notifier_call_chain+0x14/0x16
[<ffffffff813d1fb1>] call_netdevice_notifiers+0x4a/0x4f
[<ffffffff813d636d>] __dev_notify_flags+0x37/0x5b
[<ffffffff813d63d9>] dev_change_flags+0x48/0x54
[<ffffffff813e0ace>] do_setlink+0x2b0/0x7a5
[<ffffffff8123c078>] ? __nla_reserve+0x26/0x4e
[<ffffffff813e19ed>] rtnl_newlink+0x253/0x46e
[<ffffffff813e184b>] ? rtnl_newlink+0xb1/0x46e
[<ffffffff813e158f>] rtnetlink_rcv_msg+0x23b/0x251
[<ffffffff813e1354>] ? __rtnl_unlock+0x17/0x17
[<ffffffff813f55d5>] netlink_rcv_skb+0x42/0x8d
[<ffffffff813e06aa>] rtnetlink_rcv+0x26/0x2d
[<ffffffff813f5164>] netlink_unicast+0xec/0x156
[<ffffffff813f53c9>] netlink_sendmsg+0x1fb/0x233
[<ffffffff813c27f7>] sock_sendmsg+0xe6/0x109
[<ffffffff81229308>] ? radix_tree_lookup_slot+0xe/0x10
[<ffffffff810cb0c8>] ? unlock_page+0x27/0x2b
[<ffffffff810e67b8>] ? __do_fault+0x351/0x38b
[<ffffffff8103ae47>] ? should_resched+0xe/0x2d
[<ffffffff8148a03d>] ? _cond_resched+0xe/0x22
[<ffffffff8103ae47>] ? should_resched+0xe/0x2d
[<ffffffff813cc733>] ? copy_from_user+0x2f/0x31
[<ffffffff813ccb1e>] ? verify_iovec+0x52/0xa4
[<ffffffff813c2adc>] __sys_sendmsg+0x213/0x2ba
[<ffffffff810e5eaa>] ? pmd_offset+0x19/0x3f
[<ffffffff810e9008>] ? handle_mm_fault+0x103/0x118
[<ffffffff8148e8ed>] ? do_page_fault+0x343/0x39a
[<ffffffff810ed7a3>] ? do_brk+0x23f/0x293
[<ffffffff813c46ee>] sys_sendmsg+0x42/0x60
[<ffffffff81491d82>] system_call_fastpath+0x16/0x1b
Code: Bad RIP value.
RIP [< (null)>] (null)
RSP <ffff88018eecd6a0>
CR2: 0000000000000000
---[ end trace 8255e7c0eb274d5c ]---
fbl
^ permalink raw reply
* Re: [patch net-next V7] net: introduce ethernet teaming device
From: Flavio Leitner @ 2011-11-11 18:04 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, eric.dumazet, bhutchings, shemminger, fubar, andy,
tgraf, ebiederm, mirqus, kaber, greearb, jesse, benjamin.poirier,
jzupka, ivecera
In-Reply-To: <1320939698-1062-1-git-send-email-jpirko@redhat.com>
On Thu, 10 Nov 2011 16:41:38 +0100
Jiri Pirko <jpirko@redhat.com> wrote:
> This patch introduces new network device called team. It supposes to be
> very fast, simple, userspace-driven alternative to existing bonding
> driver.
>
> Userspace library called libteam with couple of demo apps is available
> here:
> https://github.com/jpirko/libteam
> Note it's still in its dipers atm.
>
> team<->libteam use generic netlink for communication. That and rtnl
> suppose to be the only way to configure team device, no sysfs etc.
>
> Python binding of libteam was recently introduced.
> Daemon providing arpmon/miimon active-backup functionality will be
> introduced shortly. All what's necessary is already implemented in
> kernel team driver.
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>
> v6->v7:
> - transmit and receive functions are not checked in hot paths.
> That also resolves memory leak on transmit when no port is
> present
>
You're right. No need to patch those function names if we use libnl
from git.
[...]
> +static void team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid)
> +{
> + struct team *team = netdev_priv(dev);
> + struct team_port *port;
> +
> + rcu_read_lock();
> + list_for_each_entry_rcu(port, &team->port_list, list) {
> + const struct net_device_ops *ops = port->dev->netdev_ops;
> +
> + ops->ndo_vlan_rx_add_vid(port->dev, vid);
This causes a oops when enslaving a tg3 device because there is
no ndo_vlan_rx_add_vid().
> + }
> + rcu_read_unlock();
> +}
> +
> +static void team_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid)
> +{
> + struct team *team = netdev_priv(dev);
> + struct team_port *port;
> +
> + rcu_read_lock();
> + list_for_each_entry_rcu(port, &team->port_list, list) {
> + const struct net_device_ops *ops = port->dev->netdev_ops;
> +
> + ops->ndo_vlan_rx_kill_vid(port->dev, vid);
Well, probably here too, though you can't reach this point without
crashing at team_vlan_rx_add_vid() first.
fbl
^ permalink raw reply
* [PATCH V2 3/6] net/ethernet/jme: Disable ASPM
From: Matthew Garrett @ 2011-11-11 16:14 UTC (permalink / raw)
To: linux-kernel; +Cc: Matthew Garrett, netdev, cooldavid
In-Reply-To: <1321028064-644-1-git-send-email-mjg@redhat.com>
http://driveragent.com/archive/30421/7-0-14 indicates that ASPM is
disabled on the 250 and 260. Duplicate for sanity.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Cc: cooldavid@cooldavid.org
---
drivers/net/ethernet/jme.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index 7becff1..88e7ce1 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/pci.h>
+#include <linux/pci-aspm.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
@@ -2860,6 +2861,9 @@ jme_init_one(struct pci_dev *pdev,
/*
* set up PCI device basics
*/
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+
rc = pci_enable_device(pdev);
if (rc) {
pr_err("Cannot enable PCI device\n");
--
1.7.7.1
^ permalink raw reply related
* [PATCH V2 2/6] net/ethernet/atl1e: Disable ASPM
From: Matthew Garrett @ 2011-11-11 16:14 UTC (permalink / raw)
To: linux-kernel; +Cc: Matthew Garrett, netdev, jcliburn, chris.snook
In-Reply-To: <1321028064-644-1-git-send-email-mjg@redhat.com>
http://www.atheros.cz/atheros-inf-file.php?inf=209&chipset=45&system=6
indicates that ASPM is disabled on all L1E hardware. Duplicate for sanity.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Cc: jcliburn@gmail.com
Cc: chris.snook@gmail.com
---
drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index 95483bc..fc74dd1 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -2264,6 +2264,9 @@ static int __devinit atl1e_probe(struct pci_dev *pdev,
int err = 0;
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+
err = pci_enable_device(pdev);
if (err) {
dev_err(&pdev->dev, "cannot enable PCI device\n");
--
1.7.7.1
^ permalink raw reply related
* [PATCH V2 1/6] net/ethernet/atl1c: Disable ASPM on various chipsets
From: Matthew Garrett @ 2011-11-11 16:14 UTC (permalink / raw)
To: linux-kernel; +Cc: Matthew Garrett, netdev, jcliburn, chris.snook
In-Reply-To: <1321028064-644-1-git-send-email-mjg@redhat.com>
The Windows driver disables ASPM support for various chipsets supported
by atl1c. This adds the same set of logic to the Linux driver. ASPM is
disabled on l1c, l2c, l2cb and l2cb2 devices except for those in Toshiba
or Lenovo devices. Data taken from
http://www.atheros.cz/atheros-inf-file.php?inf=199&chipset=51&system=6
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Cc: jcliburn@gmail.com
Cc: chris.snook@gmail.com
---
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 02c7ed8..d91dabd 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -19,6 +19,7 @@
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <linux/pci-aspm.h>
#include "atl1c.h"
#define ATL1C_DRV_VERSION "1.0.1.0-NAPI"
@@ -2652,6 +2653,20 @@ static int __devinit atl1c_probe(struct pci_dev *pdev,
int err = 0;
+ switch (pdev->device) {
+ case PCI_DEVICE_ID_ATTANSIC_L1C:
+ case PCI_DEVICE_ID_ATTANSIC_L2C:
+ case PCI_DEVICE_ID_ATHEROS_L2C_B:
+ case PCI_DEVICE_ID_ATHEROS_L2C_B2:
+ if (pdev->subsystem_vendor == PCI_VENDOR_ID_TOSHIBA ||
+ pdev->subsystem_vendor == PCI_VENDOR_ID_LENOVO)
+ break;
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S |
+ PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+ break;
+ }
+
/* enable device (incl. PCI PM wakeup and hotplug setup) */
err = pci_enable_device_mem(pdev);
if (err) {
--
1.7.7.1
^ permalink raw reply related
* [PATCH 3/6] net/ethernet/jme: Disable ASPM
From: Matthew Garrett @ 2011-11-11 16:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Matthew Garrett, netdev, cooldavid
In-Reply-To: <1321027511-31229-1-git-send-email-mjg@redhat.com>
http://driveragent.com/archive/30421/7-0-14 indicates that ASPM is
disabled on the 250 and 260. Duplicate for sanity.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Cc: cooldavid@cooldavid.org
---
drivers/net/ethernet/jme.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index 7becff1..b28a873 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -2860,6 +2860,9 @@ jme_init_one(struct pci_dev *pdev,
/*
* set up PCI device basics
*/
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+
rc = pci_enable_device(pdev);
if (rc) {
pr_err("Cannot enable PCI device\n");
--
1.7.7.1
^ permalink raw reply related
* [PATCH 2/6] net/ethernet/atl1e: Disable ASPM
From: Matthew Garrett @ 2011-11-11 16:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Matthew Garrett, netdev, jcliburn, chris.snook
In-Reply-To: <1321027511-31229-1-git-send-email-mjg@redhat.com>
http://www.atheros.cz/atheros-inf-file.php?inf=209&chipset=45&system=6
indicates that ASPM is disabled on all L1E hardware. Duplicate for sanity.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Cc: jcliburn@gmail.com
Cc: chris.snook@gmail.com
---
drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index 95483bc..fc74dd1 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -2264,6 +2264,9 @@ static int __devinit atl1e_probe(struct pci_dev *pdev,
int err = 0;
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+
err = pci_enable_device(pdev);
if (err) {
dev_err(&pdev->dev, "cannot enable PCI device\n");
--
1.7.7.1
^ permalink raw reply related
* [PATCH 1/6] net/ethernet/atl1c: Disable ASPM on various chipsets
From: Matthew Garrett @ 2011-11-11 16:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Matthew Garrett, netdev, jcliburn, chris.snook
In-Reply-To: <1321027511-31229-1-git-send-email-mjg@redhat.com>
The Windows driver disables ASPM support for various chipsets supported
by atl1c. This adds the same set of logic to the Linux driver. ASPM is
disabled on l1c, l2c, l2cb and l2cb2 devices except for those in Toshiba
or Lenovo devices. Data taken from
http://www.atheros.cz/atheros-inf-file.php?inf=199&chipset=51&system=6
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Cc: jcliburn@gmail.com
Cc: chris.snook@gmail.com
---
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 02c7ed8..d91dabd 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -19,6 +19,7 @@
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <linux/pci-aspm.h>
#include "atl1c.h"
#define ATL1C_DRV_VERSION "1.0.1.0-NAPI"
@@ -2652,6 +2653,20 @@ static int __devinit atl1c_probe(struct pci_dev *pdev,
int err = 0;
+ switch (pdev->device) {
+ case PCI_DEVICE_ID_ATTANSIC_L1C:
+ case PCI_DEVICE_ID_ATTANSIC_L2C:
+ case PCI_DEVICE_ID_ATHEROS_L2C_B:
+ case PCI_DEVICE_ID_ATHEROS_L2C_B2:
+ if (pdev->subsystem_vendor == PCI_VENDOR_ID_TOSHIBA ||
+ pdev->subsystem_vendor == PCI_VENDOR_ID_LENOVO)
+ break;
+ pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S |
+ PCIE_LINK_STATE_L1 |
+ PCIE_LINK_STATE_CLKPM);
+ break;
+ }
+
/* enable device (incl. PCI PM wakeup and hotplug setup) */
err = pci_enable_device_mem(pdev);
if (err) {
--
1.7.7.1
^ 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