* Re: BUG: IPv4: Attempt to release TCP socket in state 1
From: Eric Dumazet @ 2013-03-14 22:56 UTC (permalink / raw)
To: dormando; +Cc: Cong Wang, linux-kernel, netdev
In-Reply-To: <alpine.DEB.2.02.1303141359080.16308@dflat>
On Thu, 2013-03-14 at 14:21 -0700, dormando wrote:
> >
> > diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
> > index 68f6a94..1d4d97e 100644
> > --- a/net/ipv4/af_inet.c
> > +++ b/net/ipv4/af_inet.c
> > @@ -141,8 +141,9 @@ void inet_sock_destruct(struct sock *sk)
> > sk_mem_reclaim(sk);
> >
> > if (sk->sk_type == SOCK_STREAM && sk->sk_state != TCP_CLOSE) {
> > - pr_err("Attempt to release TCP socket in state %d %p\n",
> > - sk->sk_state, sk);
> > + pr_err("Attempt to release TCP socket family %d in state %d %p\n",
> > + sk->sk_family, sk->sk_state, sk);
> > + WARN_ON_ONCE(1);
> > return;
> > }
> > if (!sock_flag(sk, SOCK_DEAD)) {
>
> [58377.436522] IPv4: Attempt to release TCP socket family 2 in state 1
> ffff8813fbad9500
There is no stack information on the WARN_ON_ONCE(1) ?
^ permalink raw reply
* Re: LRO/GRO and libpcap packet reordering
From: Andy Lutomirski @ 2013-03-14 22:58 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Ben Hutchings, Network Development
In-Reply-To: <1363301695.29475.38.camel@edumazet-glaptop>
On Thu, Mar 14, 2013 at 3:54 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Thu, 2013-03-14 at 15:45 -0700, Andy Lutomirski wrote:
>
>> Hmm. What if the GRO flow hashing was something like hash(one
>> endpoint) ^ hash(the other endpoint)? (NB: I don't really know what
>> I'm talking about.)
>
> There is no hashing in GRO, but a full flow match.
>
> What you describe has to do with multi queue capability of the NIC.
>
> Each flow is handled by a separate RX queue, therefore by different
> cpus. There is no guarantee packets are delivered 'in order' in this
> case, GRO being off or on.
This happens even when there's just one rx queue. (I checked that
before scratching my head for a while.)
>
> Of course, if GRO/LRO is on, there is an additional delay to permit
> aggregation, so a big GRO/LRO packet might appear _after_ an ACK.
>
>
Right. This is the part that I'm wondering about an efficient fix to
(i.e. flush GRO state for one flow whenever a packet for the reversed
flow is seen).
--Andy
^ permalink raw reply
* Re: LRO/GRO and libpcap packet reordering
From: Ben Hutchings @ 2013-03-14 23:01 UTC (permalink / raw)
To: Andy Lutomirski; +Cc: Network Development
In-Reply-To: <CALCETrUidEuaxBeDdDwGb=Dx5iGm1CK-HGWNXRUev5xoR9fnRg@mail.gmail.com>
On Thu, 2013-03-14 at 15:45 -0700, Andy Lutomirski wrote:
> On Thu, Mar 14, 2013 at 2:58 PM, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
> > On Thu, 2013-03-14 at 13:37 -0700, Andy Lutomirski wrote:
> >> (I'm on Ubuntu's 3.5.0-23, but I haven't seen anything that would
> >> change this behavior in newer kernels.)
> >>
> >> I have a myri10ge device that's attached to a port mirror. It runs
> >> tcpdump. Most of the traffic I'm capturing has another machine
> >> attached to this switch as an endpoint. That machine is considerably
> >> faster than the machine doing the capturing.
> >>
> >> My captures show nasty artifacts: packets are reodered between a given
> >> flow and the other direction of the same flow. The nasty case is when
> >> an ACK shows up before the packet that it's acking. This thoroughly
> >> screws up Wireshark's TCP sequencing analysis. Turning off LRO and
> >> GRO fixes it.
> >>
> >> Clearly, since this interface doesn't actually have an IP address,
> >> there's no good reason to keep GRO and LRO on. Nonetheless, it would
> >> be nice if GRO didn't coalesce packets when there's an intervening
> >> packing in the other direction on the same flow. Can this be done
> >> cheaply?
> >
> > No, it would not be cheap.
> >
>
> Hmm. What if the GRO flow hashing was something like hash(one
> endpoint) ^ hash(the other endpoint)? (NB: I don't really know what
> I'm talking about.)
GRO doesn't use a flow hash; it performs an exact comparison of the
identifying fields. (And only holds aggregated skbs for up to 8 flows
at a time.)
Ben.
> > You'll probably have to disable GRO, LRO and also RSS (unless you can
> > configure the RSS hash function to produce the same result for both
> > directions of a flow).
> >
>
> RSS was already off. That was the first thing I tried.
>
> --Andy
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: atl1c issues on 3.8.2
From: Eric Dumazet @ 2013-03-14 23:06 UTC (permalink / raw)
To: Michael Büsch
Cc: Pavel Emelyanov, Eric Dumazet, linux-netdev, David S.Miller,
Mel Gorman
In-Reply-To: <20130314231746.44a93e4d@milhouse>
On Thu, 2013-03-14 at 23:17 +0100, Michael Büsch wrote:
> I can still reproduce with this fix applied.
>
> However, I noticed that I cannot reproduce, if the wireless interface (ath9k) of
> the netbook is down while testing the ethernet. The wireless does not carry any
> test traffic. It's just idle.
> I do not know if this always had been the case, because wireless was always up (and mostly
> idle) in my previous ethernet tests.
>
OK, then it must be kind of corruption issue in ath9k, or whatever ?
You could try various DEBUGing stuff, like CONFIG_DEBUG_PAGEALLOC and
CONFIG_SLUB_DEBUG_ON
^ permalink raw reply
* [PATCH net-next] drivers:net: Remove dma_alloc_coherent OOM messages
From: Joe Perches @ 2013-03-14 23:07 UTC (permalink / raw)
To: netdev
Cc: e1000-devel, linux-wireless, LKML, wil6210, b43-dev,
linux-arm-kernel
I believe these error messages are already logged
on allocation failure by warn_alloc_failed and so
get a dump_stack on OOM.
Remove the unnecessary additional error logging.
Around these deletions:
o Alignment neatening.
o Remove unnecessary casts of dma_alloc_coherent.
o Hoist assigns from ifs.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ethernet/aeroflex/greth.c | 20 ++++-------
drivers/net/ethernet/amd/sunlance.c | 5 ++-
drivers/net/ethernet/apple/macmace.c | 16 ++++-----
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 2 --
drivers/net/ethernet/cadence/at91_ether.c | 19 +++++-----
drivers/net/ethernet/dec/tulip/xircom_cb.c | 9 ++---
drivers/net/ethernet/emulex/benet/be_cmds.c | 4 +--
drivers/net/ethernet/emulex/benet/be_ethtool.c | 9 ++---
drivers/net/ethernet/emulex/benet/be_main.c | 6 +---
drivers/net/ethernet/freescale/fec.c | 6 ++--
drivers/net/ethernet/freescale/gianfar.c | 13 ++++---
drivers/net/ethernet/ibm/emac/mal.c | 8 ++---
drivers/net/ethernet/ibm/ibmveth.c | 6 ++--
drivers/net/ethernet/intel/e1000/e1000_main.c | 7 ----
drivers/net/ethernet/intel/ixgb/ixgb_main.c | 4 ---
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 --
drivers/net/ethernet/marvell/mvneta.c | 14 ++------
drivers/net/ethernet/marvell/pxa168_eth.c | 11 ++----
drivers/net/ethernet/mellanox/mlx4/cmd.c | 4 +--
drivers/net/ethernet/natsemi/jazzsonic.c | 12 +++----
drivers/net/ethernet/natsemi/macsonic.c | 12 +++----
drivers/net/ethernet/natsemi/xtsonic.c | 12 +++----
drivers/net/ethernet/nuvoton/w90p910_ether.c | 19 ++++------
drivers/net/ethernet/nxp/lpc_eth.c | 2 --
.../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 12 +++----
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | 40 ++++++++--------------
.../net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | 5 +--
drivers/net/ethernet/renesas/sh_eth.c | 9 ++---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 24 +++++--------
drivers/net/ethernet/sun/sunbmac.c | 4 +--
drivers/net/ethernet/sun/sunhme.c | 13 +++----
drivers/net/ethernet/tundra/tsi108_eth.c | 10 ++----
drivers/net/ethernet/xilinx/ll_temac_main.c | 11 ++----
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 10 ++----
drivers/net/fddi/defxx.c | 6 ++--
drivers/net/irda/bfin_sir.c | 3 +-
drivers/net/irda/smsc-ircc2.c | 10 ++----
drivers/net/wireless/ath/wil6210/txrx.c | 2 --
drivers/net/wireless/b43legacy/dma.c | 5 +--
drivers/net/wireless/iwlegacy/3945.c | 4 +--
drivers/net/wireless/iwlegacy/common.c | 5 ++-
drivers/net/wireless/iwlwifi/pcie/tx.c | 4 +--
42 files changed, 122 insertions(+), 278 deletions(-)
diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c
index 0be2195..3a9fbac 100644
--- a/drivers/net/ethernet/aeroflex/greth.c
+++ b/drivers/net/ethernet/aeroflex/greth.c
@@ -1464,14 +1464,10 @@ static int greth_of_probe(struct platform_device *ofdev)
}
/* Allocate TX descriptor ring in coherent memory */
- greth->tx_bd_base = (struct greth_bd *) dma_alloc_coherent(greth->dev,
- 1024,
- &greth->tx_bd_base_phys,
- GFP_KERNEL);
-
+ greth->tx_bd_base = dma_alloc_coherent(greth->dev, 1024,
+ &greth->tx_bd_base_phys,
+ GFP_KERNEL);
if (!greth->tx_bd_base) {
- if (netif_msg_probe(greth))
- dev_err(&dev->dev, "could not allocate descriptor memory.\n");
err = -ENOMEM;
goto error3;
}
@@ -1479,14 +1475,10 @@ static int greth_of_probe(struct platform_device *ofdev)
memset(greth->tx_bd_base, 0, 1024);
/* Allocate RX descriptor ring in coherent memory */
- greth->rx_bd_base = (struct greth_bd *) dma_alloc_coherent(greth->dev,
- 1024,
- &greth->rx_bd_base_phys,
- GFP_KERNEL);
-
+ greth->rx_bd_base = dma_alloc_coherent(greth->dev, 1024,
+ &greth->rx_bd_base_phys,
+ GFP_KERNEL);
if (!greth->rx_bd_base) {
- if (netif_msg_probe(greth))
- dev_err(greth->dev, "could not allocate descriptor memory.\n");
err = -ENOMEM;
goto error4;
}
diff --git a/drivers/net/ethernet/amd/sunlance.c b/drivers/net/ethernet/amd/sunlance.c
index 70d5430..f47b780 100644
--- a/drivers/net/ethernet/amd/sunlance.c
+++ b/drivers/net/ethernet/amd/sunlance.c
@@ -1373,10 +1373,9 @@ static int sparc_lance_probe_one(struct platform_device *op,
dma_alloc_coherent(&op->dev,
sizeof(struct lance_init_block),
&lp->init_block_dvma, GFP_ATOMIC);
- if (!lp->init_block_mem) {
- printk(KERN_ERR "SunLance: Cannot allocate consistent DMA memory.\n");
+ if (!lp->init_block_mem)
goto fail;
- }
+
lp->pio_buffer = 0;
lp->init_ring = lance_init_ring_dvma;
lp->rx = lance_rx_dvma;
diff --git a/drivers/net/ethernet/apple/macmace.c b/drivers/net/ethernet/apple/macmace.c
index a206779..4ce8ceb 100644
--- a/drivers/net/ethernet/apple/macmace.c
+++ b/drivers/net/ethernet/apple/macmace.c
@@ -386,20 +386,16 @@ static int mace_open(struct net_device *dev)
/* Allocate the DMA ring buffers */
mp->tx_ring = dma_alloc_coherent(mp->device,
- N_TX_RING * MACE_BUFF_SIZE,
- &mp->tx_ring_phys, GFP_KERNEL);
- if (mp->tx_ring == NULL) {
- printk(KERN_ERR "%s: unable to allocate DMA tx buffers\n", dev->name);
+ N_TX_RING * MACE_BUFF_SIZE,
+ &mp->tx_ring_phys, GFP_KERNEL);
+ if (mp->tx_ring == NULL)
goto out1;
- }
mp->rx_ring = dma_alloc_coherent(mp->device,
- N_RX_RING * MACE_BUFF_SIZE,
- &mp->rx_ring_phys, GFP_KERNEL);
- if (mp->rx_ring == NULL) {
- printk(KERN_ERR "%s: unable to allocate DMA rx buffers\n", dev->name);
+ N_RX_RING * MACE_BUFF_SIZE,
+ &mp->rx_ring_phys, GFP_KERNEL);
+ if (mp->rx_ring == NULL)
goto out2;
- }
mace_dma_off(dev);
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index db343a1..79cf620 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -864,7 +864,6 @@ static int bcm_enet_open(struct net_device *dev)
size = priv->rx_ring_size * sizeof(struct bcm_enet_desc);
p = dma_alloc_coherent(kdev, size, &priv->rx_desc_dma, GFP_KERNEL);
if (!p) {
- dev_err(kdev, "cannot allocate rx ring %u\n", size);
ret = -ENOMEM;
goto out_freeirq_tx;
}
@@ -877,7 +876,6 @@ static int bcm_enet_open(struct net_device *dev)
size = priv->tx_ring_size * sizeof(struct bcm_enet_desc);
p = dma_alloc_coherent(kdev, size, &priv->tx_desc_dma, GFP_KERNEL);
if (!p) {
- dev_err(kdev, "cannot allocate tx ring\n");
ret = -ENOMEM;
goto out_free_rx_ring;
}
diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 5bd7786..c6e40d6 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -47,22 +47,19 @@ static int at91ether_start(struct net_device *dev)
int i;
lp->rx_ring = dma_alloc_coherent(&lp->pdev->dev,
- MAX_RX_DESCR * sizeof(struct macb_dma_desc),
- &lp->rx_ring_dma, GFP_KERNEL);
- if (!lp->rx_ring) {
- netdev_err(dev, "unable to alloc rx ring DMA buffer\n");
+ (MAX_RX_DESCR *
+ sizeof(struct macb_dma_desc)),
+ &lp->rx_ring_dma, GFP_KERNEL);
+ if (!lp->rx_ring)
return -ENOMEM;
- }
lp->rx_buffers = dma_alloc_coherent(&lp->pdev->dev,
- MAX_RX_DESCR * MAX_RBUFF_SZ,
- &lp->rx_buffers_dma, GFP_KERNEL);
+ MAX_RX_DESCR * MAX_RBUFF_SZ,
+ &lp->rx_buffers_dma, GFP_KERNEL);
if (!lp->rx_buffers) {
- netdev_err(dev, "unable to alloc rx data DMA buffer\n");
-
dma_free_coherent(&lp->pdev->dev,
- MAX_RX_DESCR * sizeof(struct macb_dma_desc),
- lp->rx_ring, lp->rx_ring_dma);
+ MAX_RX_DESCR * sizeof(struct macb_dma_desc),
+ lp->rx_ring, lp->rx_ring_dma);
lp->rx_ring = NULL;
return -ENOMEM;
}
diff --git a/drivers/net/ethernet/dec/tulip/xircom_cb.c b/drivers/net/ethernet/dec/tulip/xircom_cb.c
index 88feced..cdbcd16 100644
--- a/drivers/net/ethernet/dec/tulip/xircom_cb.c
+++ b/drivers/net/ethernet/dec/tulip/xircom_cb.c
@@ -236,17 +236,14 @@ static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id)
private->rx_buffer = dma_alloc_coherent(d, 8192,
&private->rx_dma_handle,
GFP_KERNEL);
- if (private->rx_buffer == NULL) {
- pr_err("%s: no memory for rx buffer\n", __func__);
+ if (private->rx_buffer == NULL)
goto rx_buf_fail;
- }
+
private->tx_buffer = dma_alloc_coherent(d, 8192,
&private->tx_dma_handle,
GFP_KERNEL);
- if (private->tx_buffer == NULL) {
- pr_err("%s: no memory for tx buffer\n", __func__);
+ if (private->tx_buffer == NULL)
goto tx_buf_fail;
- }
SET_NETDEV_DEV(dev, &pdev->dev);
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 6ed4639..6fc1fe59 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -2667,10 +2667,8 @@ int be_cmd_set_mac_list(struct be_adapter *adapter, u8 *mac_array,
cmd.size = sizeof(struct be_cmd_req_set_mac_list);
cmd.va = dma_alloc_coherent(&adapter->pdev->dev, cmd.size,
&cmd.dma, GFP_KERNEL);
- if (!cmd.va) {
- dev_err(&adapter->pdev->dev, "Memory alloc failure\n");
+ if (!cmd.va)
return -ENOMEM;
- }
spin_lock_bh(&adapter->mcc_lock);
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
index 053f00d..07b7f27 100644
--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
+++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
@@ -719,10 +719,8 @@ be_test_ddr_dma(struct be_adapter *adapter)
ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test);
ddrdma_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, ddrdma_cmd.size,
&ddrdma_cmd.dma, GFP_KERNEL);
- if (!ddrdma_cmd.va) {
- dev_err(&adapter->pdev->dev, "Memory allocation failure\n");
+ if (!ddrdma_cmd.va)
return -ENOMEM;
- }
for (i = 0; i < 2; i++) {
ret = be_cmd_ddr_dma_test(adapter, pattern[i],
@@ -845,11 +843,8 @@ be_read_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
eeprom_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, eeprom_cmd.size,
&eeprom_cmd.dma, GFP_KERNEL);
- if (!eeprom_cmd.va) {
- dev_err(&adapter->pdev->dev,
- "Memory allocation failure. Could not read eeprom\n");
+ if (!eeprom_cmd.va)
return -ENOMEM;
- }
status = be_cmd_get_seeprom_data(adapter, &eeprom_cmd);
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index b8e5019..bc919be 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3457,11 +3457,9 @@ static int lancer_fw_download(struct be_adapter *adapter,
flash_cmd.size = sizeof(struct lancer_cmd_req_write_object)
+ LANCER_FW_DOWNLOAD_CHUNK;
flash_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, flash_cmd.size,
- &flash_cmd.dma, GFP_KERNEL);
+ &flash_cmd.dma, GFP_KERNEL);
if (!flash_cmd.va) {
status = -ENOMEM;
- dev_err(&adapter->pdev->dev,
- "Memory allocation failure while flashing\n");
goto lancer_fw_exit;
}
@@ -3563,8 +3561,6 @@ static int be_fw_download(struct be_adapter *adapter, const struct firmware* fw)
&flash_cmd.dma, GFP_KERNEL);
if (!flash_cmd.va) {
status = -ENOMEM;
- dev_err(&adapter->pdev->dev,
- "Memory allocation failure while flashing\n");
goto be_fw_exit;
}
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index e622494..69a4ade 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1594,11 +1594,9 @@ static int fec_enet_init(struct net_device *ndev)
/* Allocate memory for buffer descriptors. */
cbd_base = dma_alloc_coherent(NULL, PAGE_SIZE, &fep->bd_dma,
- GFP_KERNEL);
- if (!cbd_base) {
- printk("FEC: allocate descriptor memory failed?\n");
+ GFP_KERNEL);
+ if (!cbd_base)
return -ENOMEM;
- }
spin_lock_init(&fep->hw_lock);
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index d2c5441..1b468a8 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -245,14 +245,13 @@ static int gfar_alloc_skb_resources(struct net_device *ndev)
/* Allocate memory for the buffer descriptors */
vaddr = dma_alloc_coherent(dev,
- sizeof(struct txbd8) * priv->total_tx_ring_size +
- sizeof(struct rxbd8) * priv->total_rx_ring_size,
- &addr, GFP_KERNEL);
- if (!vaddr) {
- netif_err(priv, ifup, ndev,
- "Could not allocate buffer descriptors!\n");
+ (priv->total_tx_ring_size *
+ sizeof(struct txbd8)) +
+ (priv->total_rx_ring_size *
+ sizeof(struct rxbd8)),
+ &addr, GFP_KERNEL);
+ if (!vaddr)
return -ENOMEM;
- }
for (i = 0; i < priv->num_tx_queues; i++) {
tx_queue = priv->tx_queue[i];
diff --git a/drivers/net/ethernet/ibm/emac/mal.c b/drivers/net/ethernet/ibm/emac/mal.c
index 1f7ecf5..cc2db5c 100644
--- a/drivers/net/ethernet/ibm/emac/mal.c
+++ b/drivers/net/ethernet/ibm/emac/mal.c
@@ -637,13 +637,9 @@ static int mal_probe(struct platform_device *ofdev)
bd_size = sizeof(struct mal_descriptor) *
(NUM_TX_BUFF * mal->num_tx_chans +
NUM_RX_BUFF * mal->num_rx_chans);
- mal->bd_virt =
- dma_alloc_coherent(&ofdev->dev, bd_size, &mal->bd_dma,
- GFP_KERNEL);
+ mal->bd_virt = dma_alloc_coherent(&ofdev->dev, bd_size, &mal->bd_dma,
+ GFP_KERNEL);
if (mal->bd_virt == NULL) {
- printk(KERN_ERR
- "mal%d: out of memory allocating RX/TX descriptors!\n",
- index);
err = -ENOMEM;
goto fail_unmap;
}
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
index c859771..302d594 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -556,11 +556,9 @@ static int ibmveth_open(struct net_device *netdev)
adapter->rx_queue.queue_len = sizeof(struct ibmveth_rx_q_entry) *
rxq_entries;
adapter->rx_queue.queue_addr =
- dma_alloc_coherent(dev, adapter->rx_queue.queue_len,
- &adapter->rx_queue.queue_dma, GFP_KERNEL);
-
+ dma_alloc_coherent(dev, adapter->rx_queue.queue_len,
+ &adapter->rx_queue.queue_dma, GFP_KERNEL);
if (!adapter->rx_queue.queue_addr) {
- netdev_err(netdev, "unable to allocate rx queue pages\n");
rc = -ENOMEM;
goto err_out;
}
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 8502c62..d98e1d09 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1516,8 +1516,6 @@ static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
if (!txdr->desc) {
setup_tx_desc_die:
vfree(txdr->buffer_info);
- e_err(probe, "Unable to allocate memory for the Tx descriptor "
- "ring\n");
return -ENOMEM;
}
@@ -1707,10 +1705,7 @@ static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
rxdr->desc = dma_alloc_coherent(&pdev->dev, rxdr->size, &rxdr->dma,
GFP_KERNEL);
-
if (!rxdr->desc) {
- e_err(probe, "Unable to allocate memory for the Rx descriptor "
- "ring\n");
setup_rx_desc_die:
vfree(rxdr->buffer_info);
return -ENOMEM;
@@ -1729,8 +1724,6 @@ setup_rx_desc_die:
if (!rxdr->desc) {
dma_free_coherent(&pdev->dev, rxdr->size, olddesc,
olddma);
- e_err(probe, "Unable to allocate memory for the Rx "
- "descriptor ring\n");
goto setup_rx_desc_die;
}
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index ea48083..e23f023 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -720,8 +720,6 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
GFP_KERNEL);
if (!txdr->desc) {
vfree(txdr->buffer_info);
- netif_err(adapter, probe, adapter->netdev,
- "Unable to allocate transmit descriptor memory\n");
return -ENOMEM;
}
memset(txdr->desc, 0, txdr->size);
@@ -807,8 +805,6 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
if (!rxdr->desc) {
vfree(rxdr->buffer_info);
- netif_err(adapter, probe, adapter->netdev,
- "Unable to allocate receive descriptors\n");
return -ENOMEM;
}
memset(rxdr->desc, 0, rxdr->size);
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 2635b83..ac0c315 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -2423,9 +2423,6 @@ int ixgbevf_setup_rx_resources(struct ixgbevf_adapter *adapter,
&rx_ring->dma, GFP_KERNEL);
if (!rx_ring->desc) {
- hw_dbg(&adapter->hw,
- "Unable to allocate memory for "
- "the receive descriptor ring\n");
vfree(rx_ring->rx_buffer_info);
rx_ring->rx_buffer_info = NULL;
goto alloc_failed;
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index cd345b8..e48261e 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -1969,13 +1969,8 @@ static int mvneta_rxq_init(struct mvneta_port *pp,
rxq->descs = dma_alloc_coherent(pp->dev->dev.parent,
rxq->size * MVNETA_DESC_ALIGNED_SIZE,
&rxq->descs_phys, GFP_KERNEL);
- if (rxq->descs == NULL) {
- netdev_err(pp->dev,
- "rxq=%d: Can't allocate %d bytes for %d RX descr\n",
- rxq->id, rxq->size * MVNETA_DESC_ALIGNED_SIZE,
- rxq->size);
+ if (rxq->descs == NULL)
return -ENOMEM;
- }
BUG_ON(rxq->descs !=
PTR_ALIGN(rxq->descs, MVNETA_CPU_D_CACHE_LINE_SIZE));
@@ -2029,13 +2024,8 @@ static int mvneta_txq_init(struct mvneta_port *pp,
txq->descs = dma_alloc_coherent(pp->dev->dev.parent,
txq->size * MVNETA_DESC_ALIGNED_SIZE,
&txq->descs_phys, GFP_KERNEL);
- if (txq->descs == NULL) {
- netdev_err(pp->dev,
- "txQ=%d: Can't allocate %d bytes for %d TX descr\n",
- txq->id, txq->size * MVNETA_DESC_ALIGNED_SIZE,
- txq->size);
+ if (txq->descs == NULL)
return -ENOMEM;
- }
/* Make sure descriptor address is cache line size aligned */
BUG_ON(txq->descs !=
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 037ed86..3ae4c7f 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1024,11 +1024,9 @@ static int rxq_init(struct net_device *dev)
pep->rx_desc_area_size = size;
pep->p_rx_desc_area = dma_alloc_coherent(pep->dev->dev.parent, size,
&pep->rx_desc_dma, GFP_KERNEL);
- if (!pep->p_rx_desc_area) {
- printk(KERN_ERR "%s: Cannot alloc RX ring (size %d bytes)\n",
- dev->name, size);
+ if (!pep->p_rx_desc_area)
goto out;
- }
+
memset((void *)pep->p_rx_desc_area, 0, size);
/* initialize the next_desc_ptr links in the Rx descriptors ring */
p_rx_desc = pep->p_rx_desc_area;
@@ -1087,11 +1085,8 @@ static int txq_init(struct net_device *dev)
pep->tx_desc_area_size = size;
pep->p_tx_desc_area = dma_alloc_coherent(pep->dev->dev.parent, size,
&pep->tx_desc_dma, GFP_KERNEL);
- if (!pep->p_tx_desc_area) {
- printk(KERN_ERR "%s: Cannot allocate Tx Ring (size %d bytes)\n",
- dev->name, size);
+ if (!pep->p_tx_desc_area)
goto out;
- }
memset((void *)pep->p_tx_desc_area, 0, pep->tx_desc_area_size);
/* Initialize the next_desc_ptr links in the Tx descriptors ring */
p_tx_desc = pep->p_tx_desc_area;
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
index fdc5f23..05267d7 100644
--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
@@ -1837,10 +1837,8 @@ int mlx4_cmd_init(struct mlx4_dev *dev)
priv->mfunc.vhcr = dma_alloc_coherent(&(dev->pdev->dev), PAGE_SIZE,
&priv->mfunc.vhcr_dma,
GFP_KERNEL);
- if (!priv->mfunc.vhcr) {
- mlx4_err(dev, "Couldn't allocate VHCR.\n");
+ if (!priv->mfunc.vhcr)
goto err_hcr;
- }
}
priv->cmd.pool = pci_pool_create("mlx4_cmd", dev->pdev,
diff --git a/drivers/net/ethernet/natsemi/jazzsonic.c b/drivers/net/ethernet/natsemi/jazzsonic.c
index b0b3615..c20766c 100644
--- a/drivers/net/ethernet/natsemi/jazzsonic.c
+++ b/drivers/net/ethernet/natsemi/jazzsonic.c
@@ -175,13 +175,13 @@ static int sonic_probe1(struct net_device *dev)
/* Allocate the entire chunk of memory for the descriptors.
Note that this cannot cross a 64K boundary. */
- if ((lp->descriptors = dma_alloc_coherent(lp->device,
- SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
- &lp->descriptors_laddr, GFP_KERNEL)) == NULL) {
- printk(KERN_ERR "%s: couldn't alloc DMA memory for descriptors.\n",
- dev_name(lp->device));
+ lp->descriptors = dma_alloc_coherent(lp->device,
+ SIZEOF_SONIC_DESC *
+ SONIC_BUS_SCALE(lp->dma_bitmode),
+ &lp->descriptors_laddr,
+ GFP_KERNEL);
+ if (lp->descriptors == NULL)
goto out;
- }
/* Now set up the pointers to point to the appropriate places */
lp->cda = lp->descriptors;
diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c
index 0ffde69..346a4e0 100644
--- a/drivers/net/ethernet/natsemi/macsonic.c
+++ b/drivers/net/ethernet/natsemi/macsonic.c
@@ -202,13 +202,13 @@ static int macsonic_init(struct net_device *dev)
/* Allocate the entire chunk of memory for the descriptors.
Note that this cannot cross a 64K boundary. */
- if ((lp->descriptors = dma_alloc_coherent(lp->device,
- SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
- &lp->descriptors_laddr, GFP_KERNEL)) == NULL) {
- printk(KERN_ERR "%s: couldn't alloc DMA memory for descriptors.\n",
- dev_name(lp->device));
+ lp->descriptors = dma_alloc_coherent(lp->device,
+ SIZEOF_SONIC_DESC *
+ SONIC_BUS_SCALE(lp->dma_bitmode),
+ &lp->descriptors_laddr,
+ GFP_KERNEL);
+ if (lp->descriptors == NULL)
return -ENOMEM;
- }
/* Now set up the pointers to point to the appropriate places */
lp->cda = lp->descriptors;
diff --git a/drivers/net/ethernet/natsemi/xtsonic.c b/drivers/net/ethernet/natsemi/xtsonic.c
index 5e4748e..c2e0256 100644
--- a/drivers/net/ethernet/natsemi/xtsonic.c
+++ b/drivers/net/ethernet/natsemi/xtsonic.c
@@ -197,14 +197,12 @@ static int __init sonic_probe1(struct net_device *dev)
* We also allocate extra space for a pointer to allow freeing
* this structure later on (in xtsonic_cleanup_module()).
*/
- lp->descriptors =
- dma_alloc_coherent(lp->device,
- SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
- &lp->descriptors_laddr, GFP_KERNEL);
-
+ lp->descriptors = dma_alloc_coherent(lp->device,
+ SIZEOF_SONIC_DESC *
+ SONIC_BUS_SCALE(lp->dma_bitmode),
+ &lp->descriptors_laddr,
+ GFP_KERNEL);
if (lp->descriptors == NULL) {
- printk(KERN_ERR "%s: couldn't alloc DMA memory for "
- " descriptors.\n", dev_name(lp->device));
err = -ENOMEM;
goto out;
}
diff --git a/drivers/net/ethernet/nuvoton/w90p910_ether.c b/drivers/net/ethernet/nuvoton/w90p910_ether.c
index 539d202..3df8287 100644
--- a/drivers/net/ethernet/nuvoton/w90p910_ether.c
+++ b/drivers/net/ethernet/nuvoton/w90p910_ether.c
@@ -287,23 +287,16 @@ static int w90p910_init_desc(struct net_device *dev)
ether = netdev_priv(dev);
pdev = ether->pdev;
- ether->tdesc = (struct tran_pdesc *)
- dma_alloc_coherent(&pdev->dev, sizeof(struct tran_pdesc),
- ðer->tdesc_phys, GFP_KERNEL);
-
- if (!ether->tdesc) {
- dev_err(&pdev->dev, "Failed to allocate memory for tx desc\n");
+ ether->tdesc = dma_alloc_coherent(&pdev->dev, sizeof(struct tran_pdesc),
+ ðer->tdesc_phys, GFP_KERNEL);
+ if (!ether->tdesc)
return -ENOMEM;
- }
-
- ether->rdesc = (struct recv_pdesc *)
- dma_alloc_coherent(&pdev->dev, sizeof(struct recv_pdesc),
- ðer->rdesc_phys, GFP_KERNEL);
+ ether->rdesc = dma_alloc_coherent(&pdev->dev, sizeof(struct recv_pdesc),
+ ðer->rdesc_phys, GFP_KERNEL);
if (!ether->rdesc) {
- dev_err(&pdev->dev, "Failed to allocate memory for rx desc\n");
dma_free_coherent(&pdev->dev, sizeof(struct tran_pdesc),
- ether->tdesc, ether->tdesc_phys);
+ ether->tdesc, ether->tdesc_phys);
return -ENOMEM;
}
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index c4122c8..9c88c00 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -1409,9 +1409,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
dma_alloc_coherent(&pldat->pdev->dev,
pldat->dma_buff_size, &dma_handle,
GFP_KERNEL);
-
if (pldat->dma_buff_base_v == NULL) {
- dev_err(&pdev->dev, "error getting DMA region.\n");
ret = -ENOMEM;
goto err_out_free_irq;
}
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 39ab4d0..4bdca9e 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -1469,12 +1469,11 @@ pch_gbe_alloc_rx_buffers_pool(struct pch_gbe_adapter *adapter,
size = rx_ring->count * bufsz + PCH_GBE_RESERVE_MEMORY;
rx_ring->rx_buff_pool = dma_alloc_coherent(&pdev->dev, size,
- &rx_ring->rx_buff_pool_logic,
- GFP_KERNEL);
- if (!rx_ring->rx_buff_pool) {
- pr_err("Unable to allocate memory for the receive pool buffer\n");
+ &rx_ring->rx_buff_pool_logic,
+ GFP_KERNEL);
+ if (!rx_ring->rx_buff_pool)
return -ENOMEM;
- }
+
memset(rx_ring->rx_buff_pool, 0, size);
rx_ring->rx_buff_pool_size = size;
for (i = 0; i < rx_ring->count; i++) {
@@ -1777,7 +1776,6 @@ int pch_gbe_setup_tx_resources(struct pch_gbe_adapter *adapter,
&tx_ring->dma, GFP_KERNEL);
if (!tx_ring->desc) {
vfree(tx_ring->buffer_info);
- pr_err("Unable to allocate memory for the transmit descriptor ring\n");
return -ENOMEM;
}
memset(tx_ring->desc, 0, tx_ring->size);
@@ -1821,9 +1819,7 @@ int pch_gbe_setup_rx_resources(struct pch_gbe_adapter *adapter,
rx_ring->size = rx_ring->count * (int)sizeof(struct pch_gbe_rx_desc);
rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size,
&rx_ring->dma, GFP_KERNEL);
-
if (!rx_ring->desc) {
- pr_err("Unable to allocate memory for the receive descriptor ring\n");
vfree(rx_ring->buffer_info);
return -ENOMEM;
}
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
index a69097c..a0649ec 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
@@ -532,20 +532,15 @@ int qlcnic_alloc_hw_resources(struct qlcnic_adapter *adapter)
ptr = (__le32 *)dma_alloc_coherent(&pdev->dev, sizeof(u32),
&tx_ring->hw_cons_phys_addr,
GFP_KERNEL);
-
- if (ptr == NULL) {
- dev_err(&pdev->dev, "failed to allocate tx consumer\n");
+ if (ptr == NULL)
return -ENOMEM;
- }
+
tx_ring->hw_consumer = ptr;
/* cmd desc ring */
addr = dma_alloc_coherent(&pdev->dev, TX_DESC_RINGSIZE(tx_ring),
&tx_ring->phys_addr,
GFP_KERNEL);
-
if (addr == NULL) {
- dev_err(&pdev->dev,
- "failed to allocate tx desc ring\n");
err = -ENOMEM;
goto err_out_free;
}
@@ -556,11 +551,9 @@ int qlcnic_alloc_hw_resources(struct qlcnic_adapter *adapter)
for (ring = 0; ring < adapter->max_rds_rings; ring++) {
rds_ring = &recv_ctx->rds_rings[ring];
addr = dma_alloc_coherent(&adapter->pdev->dev,
- RCV_DESC_RINGSIZE(rds_ring),
- &rds_ring->phys_addr, GFP_KERNEL);
+ RCV_DESC_RINGSIZE(rds_ring),
+ &rds_ring->phys_addr, GFP_KERNEL);
if (addr == NULL) {
- dev_err(&pdev->dev,
- "failed to allocate rds ring [%d]\n", ring);
err = -ENOMEM;
goto err_out_free;
}
@@ -572,11 +565,9 @@ int qlcnic_alloc_hw_resources(struct qlcnic_adapter *adapter)
sds_ring = &recv_ctx->sds_rings[ring];
addr = dma_alloc_coherent(&adapter->pdev->dev,
- STATUS_DESC_RINGSIZE(sds_ring),
- &sds_ring->phys_addr, GFP_KERNEL);
+ STATUS_DESC_RINGSIZE(sds_ring),
+ &sds_ring->phys_addr, GFP_KERNEL);
if (addr == NULL) {
- dev_err(&pdev->dev,
- "failed to allocate sds ring [%d]\n", ring);
err = -ENOMEM;
goto err_out_free;
}
@@ -753,7 +744,7 @@ int qlcnic_82xx_get_nic_info(struct qlcnic_adapter *adapter,
size_t nic_size = sizeof(struct qlcnic_info_le);
nic_info_addr = dma_alloc_coherent(&adapter->pdev->dev, nic_size,
- &nic_dma_t, GFP_KERNEL);
+ &nic_dma_t, GFP_KERNEL);
if (!nic_info_addr)
return -ENOMEM;
memset(nic_info_addr, 0, nic_size);
@@ -804,7 +795,7 @@ int qlcnic_82xx_set_nic_info(struct qlcnic_adapter *adapter,
return err;
nic_info_addr = dma_alloc_coherent(&adapter->pdev->dev, nic_size,
- &nic_dma_t, GFP_KERNEL);
+ &nic_dma_t, GFP_KERNEL);
if (!nic_info_addr)
return -ENOMEM;
@@ -949,11 +940,10 @@ int qlcnic_get_port_stats(struct qlcnic_adapter *adapter, const u8 func,
}
stats_addr = dma_alloc_coherent(&adapter->pdev->dev, stats_size,
- &stats_dma_t, GFP_KERNEL);
- if (!stats_addr) {
- dev_err(&adapter->pdev->dev, "Unable to allocate memory\n");
+ &stats_dma_t, GFP_KERNEL);
+ if (!stats_addr)
return -ENOMEM;
- }
+
memset(stats_addr, 0, stats_size);
arg1 = func | QLCNIC_STATS_VERSION << 8 | QLCNIC_STATS_PORT << 12;
@@ -1003,12 +993,10 @@ int qlcnic_get_mac_stats(struct qlcnic_adapter *adapter,
return -ENOMEM;
stats_addr = dma_alloc_coherent(&adapter->pdev->dev, stats_size,
- &stats_dma_t, GFP_KERNEL);
- if (!stats_addr) {
- dev_err(&adapter->pdev->dev,
- "%s: Unable to allocate memory.\n", __func__);
+ &stats_dma_t, GFP_KERNEL);
+ if (!stats_addr)
return -ENOMEM;
- }
+
memset(stats_addr, 0, stats_size);
qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_GET_MAC_STATS);
cmd.req.arg[1] = stats_size << 16;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
index abbd22c..4b9bab1 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
@@ -810,11 +810,8 @@ static int __qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter,
tmp_addr = dma_alloc_coherent(&adapter->pdev->dev, temp_size,
&tmp_addr_t, GFP_KERNEL);
- if (!tmp_addr) {
- dev_err(&adapter->pdev->dev,
- "Can't get memory for FW dump template\n");
+ if (!tmp_addr)
return -ENOMEM;
- }
if (qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_GET_TEMP_HDR)) {
err = -ENOMEM;
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 33e9617..7a6471d 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -908,11 +908,8 @@ static int sh_eth_ring_init(struct net_device *ndev)
/* Allocate all Rx descriptors. */
rx_ringsize = sizeof(struct sh_eth_rxdesc) * mdp->num_rx_ring;
mdp->rx_ring = dma_alloc_coherent(NULL, rx_ringsize, &mdp->rx_desc_dma,
- GFP_KERNEL);
-
+ GFP_KERNEL);
if (!mdp->rx_ring) {
- dev_err(&ndev->dev, "Cannot allocate Rx Ring (size %d bytes)\n",
- rx_ringsize);
ret = -ENOMEM;
goto desc_ring_free;
}
@@ -922,10 +919,8 @@ static int sh_eth_ring_init(struct net_device *ndev)
/* Allocate all Tx descriptors. */
tx_ringsize = sizeof(struct sh_eth_txdesc) * mdp->num_tx_ring;
mdp->tx_ring = dma_alloc_coherent(NULL, tx_ringsize, &mdp->tx_desc_dma,
- GFP_KERNEL);
+ GFP_KERNEL);
if (!mdp->tx_ring) {
- dev_err(&ndev->dev, "Cannot allocate Tx Ring (size %d bytes)\n",
- tx_ringsize);
ret = -ENOMEM;
goto desc_ring_free;
}
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 39c6c55..d02b446 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -534,25 +534,17 @@ static void init_dma_desc_rings(struct net_device *dev)
GFP_KERNEL);
priv->rx_skbuff = kmalloc_array(rxsize, sizeof(struct sk_buff *),
GFP_KERNEL);
- priv->dma_rx =
- (struct dma_desc *)dma_alloc_coherent(priv->device,
- rxsize *
- sizeof(struct dma_desc),
- &priv->dma_rx_phy,
- GFP_KERNEL);
+ priv->dma_rx = dma_alloc_coherent(priv->device,
+ rxsize * sizeof(struct dma_desc),
+ &priv->dma_rx_phy, GFP_KERNEL);
priv->tx_skbuff = kmalloc_array(txsize, sizeof(struct sk_buff *),
GFP_KERNEL);
- priv->dma_tx =
- (struct dma_desc *)dma_alloc_coherent(priv->device,
- txsize *
- sizeof(struct dma_desc),
- &priv->dma_tx_phy,
- GFP_KERNEL);
-
- if ((priv->dma_rx == NULL) || (priv->dma_tx == NULL)) {
- pr_err("%s:ERROR allocating the DMA Tx/Rx desc\n", __func__);
+ priv->dma_tx = dma_alloc_coherent(priv->device,
+ txsize * sizeof(struct dma_desc),
+ &priv->dma_tx_phy, GFP_KERNEL);
+
+ if ((priv->dma_rx == NULL) || (priv->dma_tx == NULL))
return;
- }
DBG(probe, INFO, "stmmac (%s) DMA desc: virt addr (Rx %p, "
"Tx %p)\n\tDMA phy addr (Rx 0x%08x, Tx 0x%08x)\n",
diff --git a/drivers/net/ethernet/sun/sunbmac.c b/drivers/net/ethernet/sun/sunbmac.c
index 5fafca0..0549759 100644
--- a/drivers/net/ethernet/sun/sunbmac.c
+++ b/drivers/net/ethernet/sun/sunbmac.c
@@ -1169,10 +1169,8 @@ static int bigmac_ether_init(struct platform_device *op,
bp->bmac_block = dma_alloc_coherent(&bp->bigmac_op->dev,
PAGE_SIZE,
&bp->bblock_dvma, GFP_ATOMIC);
- if (bp->bmac_block == NULL || bp->bblock_dvma == 0) {
- printk(KERN_ERR "BIGMAC: Cannot allocate consistent DMA.\n");
+ if (bp->bmac_block == NULL || bp->bblock_dvma == 0)
goto fail_and_cleanup;
- }
/* Get the board revision of this BigMAC. */
bp->board_rev = of_getintprop_default(bp->bigmac_op->dev.of_node,
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index a1bff49..436fa9d 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -2752,10 +2752,8 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe)
&hp->hblock_dvma,
GFP_ATOMIC);
err = -ENOMEM;
- if (!hp->happy_block) {
- printk(KERN_ERR "happymeal: Cannot allocate descriptors.\n");
+ if (!hp->happy_block)
goto err_out_iounmap;
- }
/* Force check of the link first time we are brought up. */
hp->linkcheck = 0;
@@ -3068,14 +3066,11 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
hp->happy_bursts = DMA_BURSTBITS;
#endif
- hp->happy_block = (struct hmeal_init_block *)
- dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &hp->hblock_dvma, GFP_KERNEL);
-
+ hp->happy_block = dma_alloc_coherent(&pdev->dev, PAGE_SIZE,
+ &hp->hblock_dvma, GFP_KERNEL);
err = -ENODEV;
- if (!hp->happy_block) {
- printk(KERN_ERR "happymeal(PCI): Cannot get hme init block.\n");
+ if (!hp->happy_block)
goto err_out_iounmap;
- }
hp->linkcheck = 0;
hp->timer_state = asleep;
diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c
index 8fa947a..99fe3c6 100644
--- a/drivers/net/ethernet/tundra/tsi108_eth.c
+++ b/drivers/net/ethernet/tundra/tsi108_eth.c
@@ -1309,22 +1309,16 @@ static int tsi108_open(struct net_device *dev)
}
data->rxring = dma_alloc_coherent(NULL, rxring_size,
- &data->rxdma, GFP_KERNEL);
-
+ &data->rxdma, GFP_KERNEL);
if (!data->rxring) {
- printk(KERN_DEBUG
- "TSI108_ETH: failed to allocate memory for rxring!\n");
return -ENOMEM;
} else {
memset(data->rxring, 0, rxring_size);
}
data->txring = dma_alloc_coherent(NULL, txring_size,
- &data->txdma, GFP_KERNEL);
-
+ &data->txdma, GFP_KERNEL);
if (!data->txring) {
- printk(KERN_DEBUG
- "TSI108_ETH: failed to allocate memory for txring!\n");
pci_free_consistent(0, rxring_size, data->rxring, data->rxdma);
return -ENOMEM;
} else {
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 5ac43e4..a64a6d7 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -246,19 +246,14 @@ static int temac_dma_bd_init(struct net_device *ndev)
lp->tx_bd_v = dma_alloc_coherent(ndev->dev.parent,
sizeof(*lp->tx_bd_v) * TX_BD_NUM,
&lp->tx_bd_p, GFP_KERNEL);
- if (!lp->tx_bd_v) {
- dev_err(&ndev->dev,
- "unable to allocate DMA TX buffer descriptors");
+ if (!lp->tx_bd_v)
goto out;
- }
+
lp->rx_bd_v = dma_alloc_coherent(ndev->dev.parent,
sizeof(*lp->rx_bd_v) * RX_BD_NUM,
&lp->rx_bd_p, GFP_KERNEL);
- if (!lp->rx_bd_v) {
- dev_err(&ndev->dev,
- "unable to allocate DMA RX buffer descriptors");
+ if (!lp->rx_bd_v)
goto out;
- }
memset(lp->tx_bd_v, 0, sizeof(*lp->tx_bd_v) * TX_BD_NUM);
for (i = 0; i < TX_BD_NUM; i++) {
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 397d4a6..c238f98 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -205,21 +205,15 @@ static int axienet_dma_bd_init(struct net_device *ndev)
sizeof(*lp->tx_bd_v) * TX_BD_NUM,
&lp->tx_bd_p,
GFP_KERNEL);
- if (!lp->tx_bd_v) {
- dev_err(&ndev->dev, "unable to allocate DMA Tx buffer "
- "descriptors");
+ if (!lp->tx_bd_v)
goto out;
- }
lp->rx_bd_v = dma_alloc_coherent(ndev->dev.parent,
sizeof(*lp->rx_bd_v) * RX_BD_NUM,
&lp->rx_bd_p,
GFP_KERNEL);
- if (!lp->rx_bd_v) {
- dev_err(&ndev->dev, "unable to allocate DMA Rx buffer "
- "descriptors");
+ if (!lp->rx_bd_v)
goto out;
- }
memset(lp->tx_bd_v, 0, sizeof(*lp->tx_bd_v) * TX_BD_NUM);
for (i = 0; i < TX_BD_NUM; i++) {
diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
index 502c8ff..f116e51 100644
--- a/drivers/net/fddi/defxx.c
+++ b/drivers/net/fddi/defxx.c
@@ -1071,11 +1071,9 @@ static int dfx_driver_init(struct net_device *dev, const char *print_name,
bp->kmalloced = top_v = dma_alloc_coherent(bp->bus_dev, alloc_size,
&bp->kmalloced_dma,
GFP_ATOMIC);
- if (top_v == NULL) {
- printk("%s: Could not allocate memory for host buffers "
- "and structures!\n", print_name);
+ if (top_v == NULL)
return DFX_K_FAILURE;
- }
+
memset(top_v, 0, alloc_size); /* zero out memory before continuing */
top_p = bp->kmalloced_dma; /* get physical address of buffer */
diff --git a/drivers/net/irda/bfin_sir.c b/drivers/net/irda/bfin_sir.c
index fed4a05..a06fca6 100644
--- a/drivers/net/irda/bfin_sir.c
+++ b/drivers/net/irda/bfin_sir.c
@@ -389,7 +389,8 @@ static int bfin_sir_startup(struct bfin_sir_port *port, struct net_device *dev)
set_dma_callback(port->rx_dma_channel, bfin_sir_dma_rx_int, dev);
set_dma_callback(port->tx_dma_channel, bfin_sir_dma_tx_int, dev);
- port->rx_dma_buf.buf = (unsigned char *)dma_alloc_coherent(NULL, PAGE_SIZE, &dma_handle, GFP_DMA);
+ port->rx_dma_buf.buf = dma_alloc_coherent(NULL, PAGE_SIZE,
+ &dma_handle, GFP_DMA);
port->rx_dma_buf.head = 0;
port->rx_dma_buf.tail = 0;
port->rx_dma_nrows = 0;
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index 5290952..59b45c1 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -564,20 +564,14 @@ static int smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma,
self->rx_buff.head =
dma_alloc_coherent(NULL, self->rx_buff.truesize,
&self->rx_buff_dma, GFP_KERNEL);
- if (self->rx_buff.head == NULL) {
- IRDA_ERROR("%s, Can't allocate memory for receive buffer!\n",
- driver_name);
+ if (self->rx_buff.head == NULL)
goto err_out2;
- }
self->tx_buff.head =
dma_alloc_coherent(NULL, self->tx_buff.truesize,
&self->tx_buff_dma, GFP_KERNEL);
- if (self->tx_buff.head == NULL) {
- IRDA_ERROR("%s, Can't allocate memory for transmit buffer!\n",
- driver_name);
+ if (self->tx_buff.head == NULL)
goto err_out3;
- }
memset(self->rx_buff.head, 0, self->rx_buff.truesize);
memset(self->tx_buff.head, 0, self->tx_buff.truesize);
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index d1315b4..55dd95f 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -83,8 +83,6 @@ static int wil_vring_alloc(struct wil6210_priv *wil, struct vring *vring)
*/
vring->va = dma_alloc_coherent(dev, sz, &vring->pa, GFP_KERNEL);
if (!vring->va) {
- wil_err(wil, "vring_alloc [%d] failed to alloc DMA mem\n",
- vring->size);
kfree(vring->ctx);
vring->ctx = NULL;
return -ENOMEM;
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c
index 2d3c664..07d7e92 100644
--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -335,11 +335,8 @@ static int alloc_ringmemory(struct b43legacy_dmaring *ring)
B43legacy_DMA_RINGMEMSIZE,
&(ring->dmabase),
GFP_KERNEL);
- if (!ring->descbase) {
- b43legacyerr(ring->dev->wl, "DMA ringmemory allocation"
- " failed\n");
+ if (!ring->descbase)
return -ENOMEM;
- }
memset(ring->descbase, 0, B43legacy_DMA_RINGMEMSIZE);
return 0;
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index e0b9d7f..dc1e6da 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -2379,10 +2379,8 @@ il3945_hw_set_hw_params(struct il_priv *il)
il->_3945.shared_virt =
dma_alloc_coherent(&il->pci_dev->dev, sizeof(struct il3945_shared),
&il->_3945.shared_phys, GFP_KERNEL);
- if (!il->_3945.shared_virt) {
- IL_ERR("failed to allocate pci memory\n");
+ if (!il->_3945.shared_virt)
return -ENOMEM;
- }
il->hw_params.bcast_id = IL3945_BROADCAST_ID;
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index e006ea8..bd4c188 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -2941,10 +2941,9 @@ il_tx_queue_alloc(struct il_priv *il, struct il_tx_queue *txq, u32 id)
* shared with device */
txq->tfds =
dma_alloc_coherent(dev, tfd_sz, &txq->q.dma_addr, GFP_KERNEL);
- if (!txq->tfds) {
- IL_ERR("Fail to alloc TFDs\n");
+ if (!txq->tfds)
goto error;
- }
+
txq->q.id = id;
return 0;
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c
index 8595c16..7a508d8 100644
--- a/drivers/net/wireless/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
@@ -501,10 +501,8 @@ static int iwl_pcie_txq_alloc(struct iwl_trans *trans,
* shared with device */
txq->tfds = dma_alloc_coherent(trans->dev, tfd_sz,
&txq->q.dma_addr, GFP_KERNEL);
- if (!txq->tfds) {
- IWL_ERR(trans, "dma_alloc_coherent(%zd) failed\n", tfd_sz);
+ if (!txq->tfds)
goto error;
- }
BUILD_BUG_ON(IWL_HCMD_SCRATCHBUF_SIZE != sizeof(*txq->scratchbufs));
BUILD_BUG_ON(offsetof(struct iwl_pcie_txq_scratch_buf, scratch) !=
--
1.8.1.2.459.gbcd45b4.dirty
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* Re: RFC crap-patch [PATCH] net: Per CPU separate frag mem accounting
From: Hannes Frederic Sowa @ 2013-03-14 23:12 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Jesper Dangaard Brouer, Eric Dumazet, netdev, yoshfuji
In-Reply-To: <1363294743.2695.10.camel@bwh-desktop.uk.solarflarecom.com>
On Thu, Mar 14, 2013 at 08:59:03PM +0000, Ben Hutchings wrote:
> On Thu, 2013-03-14 at 09:59 +0100, Jesper Dangaard Brouer wrote:
> > On Thu, 2013-03-14 at 08:25 +0100, Jesper Dangaard Brouer wrote:
> > > This is NOT the patch I just mentioned in the other thread, of removing
> > > the LRU list. This patch does real per cpu mem acct, and LRU per CPU.
> > >
> > > I get really good performance number with this patch, but I still think
> > > this might not be the correct solution.
> >
> > The reason is this depend on fragments entering the same HW queue, some
> > NICs might not put the first fragment (which have the full header
> > tuples) and the remaining fragments on the same queue. In which case
> > this patch will loose its performance gain.
> [...]
>
> The Microsoft RSS spec only includes port numbers in the flow hash for
> TCP, presumably because TCP avoids IP fragmentation whereas datagram
> protocols cannot. Some Linux drivers allow UDP ports to be included in
> the flow hash but I don't think this is the default for any of them.
>
> In Solarflare hardware the IPv4 MF bit inhibits layer 4 flow steering,
> so all fragments will be unsteered. I don't know whether everyone else
> got that right though. :-)
Shouldn't they be steered by the IPv4 2-tuple then (if ipv4 hashing is enabled
on the card)?
^ permalink raw reply
* Re: BUG: IPv4: Attempt to release TCP socket in state 1
From: dormando @ 2013-03-14 23:15 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Cong Wang, linux-kernel, netdev
In-Reply-To: <1363301786.29475.40.camel@edumazet-glaptop>
> On Thu, 2013-03-14 at 14:21 -0700, dormando wrote:
> > >
> > > diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
> > > index 68f6a94..1d4d97e 100644
> > > --- a/net/ipv4/af_inet.c
> > > +++ b/net/ipv4/af_inet.c
> > > @@ -141,8 +141,9 @@ void inet_sock_destruct(struct sock *sk)
> > > sk_mem_reclaim(sk);
> > >
> > > if (sk->sk_type == SOCK_STREAM && sk->sk_state != TCP_CLOSE) {
> > > - pr_err("Attempt to release TCP socket in state %d %p\n",
> > > - sk->sk_state, sk);
> > > + pr_err("Attempt to release TCP socket family %d in state %d %p\n",
> > > + sk->sk_family, sk->sk_state, sk);
> > > + WARN_ON_ONCE(1);
> > > return;
> > > }
> > > if (!sock_flag(sk, SOCK_DEAD)) {
> >
> > [58377.436522] IPv4: Attempt to release TCP socket family 2 in state 1
> > ffff8813fbad9500
>
> There is no stack information on the WARN_ON_ONCE(1) ?
*sigh*. it's been a long month, sorry:
[58377.436522] IPv4: Attempt to release TCP socket family 2 in state 1
ffff8813fbad9500
[58377.436539] ------------[ cut here ]------------
[58377.436545] WARNING: at net/ipv4/af_inet.c:146
inet_sock_destruct+0x176/0x200()
[58377.436546] Hardware name: X9DR3-F
[58377.436547] Modules linked in: bridge coretemp ghash_clmulni_intel
ipmi_watchdog ipmi_devintf gpio_ich microcode ixgbe sb_edac edac_core mei
lpc_ich mfd_core mdio ipmi_si ipmi_msghandler iptable_nat nf_nat_ipv4
nf_nat isci libsas igb ptp pps_core
[58377.436563] Pid: 0, comm: swapper/0 Not tainted 3.8.2 #3
[58377.436564] Call Trace:
[58377.436566] <IRQ> [<ffffffff8104964f>] warn_slowpath_common+0x7f/0xc0
[58377.436572] [<ffffffff810496aa>] warn_slowpath_null+0x1a/0x20
[58377.436574] [<ffffffff816032e6>] inet_sock_destruct+0x176/0x200
[58377.436578] [<ffffffff815ec8e0>] ? tcp_write_timer_handler+0x1b0/0x1b0
[58377.436581] [<ffffffff8156ee8d>] __sk_free+0x1d/0x140
[58377.436583] [<ffffffff815ec8e0>] ? tcp_write_timer_handler+0x1b0/0x1b0
[58377.436585] [<ffffffff8156efd5>] sk_free+0x25/0x30
[58377.436586] [<ffffffff815ec929>] tcp_write_timer+0x49/0x70
[58377.436590] [<ffffffff81059259>] call_timer_fn+0x49/0x130
[58377.436593] [<ffffffff8107a07f>] ? scheduler_tick+0x15f/0x190
[58377.436596] [<ffffffff81059854>] run_timer_softirq+0x224/0x290
[58377.436598] [<ffffffff81058f76>] ? update_process_times+0x76/0x90
[58377.436600] [<ffffffff815ec8e0>] ? tcp_write_timer_handler+0x1b0/0x1b0
[58377.436602] [<ffffffff8108ebd4>] ? ktime_get+0x54/0xe0
[58377.436604] [<ffffffff810518a7>] __do_softirq+0xc7/0x230
[58377.436608] [<ffffffff8168fd4c>] call_softirq+0x1c/0x30
[58377.436611] [<ffffffff81004415>] do_softirq+0x55/0x90
[58377.436613] [<ffffffff810516a5>] irq_exit+0x85/0xa0
[58377.436616] [<ffffffff8169036e>] smp_apic_timer_interrupt+0x6e/0x99
[58377.436618] [<ffffffff8168f74a>] apic_timer_interrupt+0x6a/0x70
[58377.436619] <EOI> [<ffffffff816855cc>] ? __schedule+0x3ac/0x750
[58377.436625] [<ffffffff8100b1fd>] ? mwait_idle+0xad/0x1f0
[58377.436627] [<ffffffff8100a743>] cpu_idle+0xb3/0x100
[58377.436629] [<ffffffff816736a2>] rest_init+0x72/0x80
[58377.436633] [<ffffffff81cc7d0e>] start_kernel+0x3ac/0x3b9
[58377.436635] [<ffffffff81cc7790>] ? repair_env_string+0x5b/0x5b
[58377.436636] [<ffffffff81cc732d>] x86_64_start_reservations+0x131/0x136
[58377.436638] [<ffffffff81cc741f>] x86_64_start_kernel+0xed/0xf4
[58377.436639] ---[ end trace 9e57364162374433 ]---
^ pretty sure that's the WARN_ON_ONCE(1)
Then a short while later the usual:
[58394.689801] ------------[ cut here ]------------
[58394.689817] WARNING: at net/sched/sch_generic.c:254
dev_watchdog+0x258/0x270()
[58394.689820] Hardware name: X9DR3-F
[58394.689836] NETDEV WATCHDOG: eth2 (ixgbe): transmit queue 14 timed out
[58394.689837] Modules linked in: bridge coretemp ghash_clmulni_intel
ipmi_watchdog ipmi_devintf gpio_ich microcode ixgbe sb_edac edac_core mei
lpc_ich mfd_core mdio ipmi_si ipmi_msghandler iptable_nat nf_nat_ipv4
nf_nat isci libsas igb ptp pps_core
[58394.689853] Pid: 0, comm: swapper/0 Tainted: G W
3.8.2 #3
[58394.689854] Call Trace:
[58394.689856] <IRQ> [<ffffffff8104964f>] warn_slowpath_common+0x7f/0xc0
[58394.689863] [<ffffffff81049746>] warn_slowpath_fmt+0x46/0x50
[58394.689865] [<ffffffff815a1508>] dev_watchdog+0x258/0x270
[58394.689868] [<ffffffff815a12b0>] ? __netdev_watchdog_up+0x80/0x80
[58394.689872] [<ffffffff81059259>] call_timer_fn+0x49/0x130
[58394.689875] [<ffffffff8107a07f>] ? scheduler_tick+0x15f/0x190
[58394.689877] [<ffffffff81059854>] run_timer_softirq+0x224/0x290
[58394.689880] [<ffffffff81058f76>] ? update_process_times+0x76/0x90
[58394.689882] [<ffffffff815a12b0>] ? __netdev_watchdog_up+0x80/0x80
[58394.689884] [<ffffffff8108ebd4>] ? ktime_get+0x54/0xe0
[58394.689886] [<ffffffff810518a7>] __do_softirq+0xc7/0x230
[58394.689890] [<ffffffff8168fd4c>] call_softirq+0x1c/0x30
[58394.689894] [<ffffffff81004415>] do_softirq+0x55/0x90
[58394.689895] [<ffffffff810516a5>] irq_exit+0x85/0xa0
[58394.689898] [<ffffffff8169036e>] smp_apic_timer_interrupt+0x6e/0x99
[58394.689900] [<ffffffff8168f74a>] apic_timer_interrupt+0x6a/0x70
[58394.689901] <EOI> [<ffffffff816855cc>] ? __schedule+0x3ac/0x750
[58394.689907] [<ffffffff8100b1fd>] ? mwait_idle+0xad/0x1f0
[58394.689909] [<ffffffff8100a743>] cpu_idle+0xb3/0x100
[58394.689911] [<ffffffff816736a2>] rest_init+0x72/0x80
[58394.689915] [<ffffffff81cc7d0e>] start_kernel+0x3ac/0x3b9
[58394.689917] [<ffffffff81cc7790>] ? repair_env_string+0x5b/0x5b
[58394.689918] [<ffffffff81cc732d>] x86_64_start_reservations+0x131/0x136
[58394.689920] [<ffffffff81cc741f>] x86_64_start_kernel+0xed/0xf4
[58394.689922] ---[ end trace 9e57364162374434 ]---
[58394.689965] ixgbe 0000:83:00.0 eth2: Reset adapter
[58447.665326] INFO: rcu_sched self-detected stall on CPU { 8} (t=15001
jiffies g=3607787 c=3607786 q=332913)
(then tons of stuck processes getting timed out)
^ permalink raw reply
* Re: LRO/GRO and libpcap packet reordering
From: Eric Dumazet @ 2013-03-14 23:16 UTC (permalink / raw)
To: Andy Lutomirski; +Cc: Ben Hutchings, Network Development
In-Reply-To: <CALCETrUpVKLr0i_3MZS_=dbxMGFzPYkpQh8qrzYqHFbjVqaKAg@mail.gmail.com>
On Thu, 2013-03-14 at 15:58 -0700, Andy Lutomirski wrote:
> Right. This is the part that I'm wondering about an efficient fix to
> (i.e. flush GRO state for one flow whenever a packet for the reversed
> flow is seen).
It doesnt seem doable easily, because network header and tcp headers are
handled in two separate functions in GRO stack (inet_gro_receive() &
tcp_gro_receive()
What you could do is changing MAX_GRO_SKBS from 8 to 1
(basically allowing only one flow in GRO stack)
^ permalink raw reply
* Re: BUG: IPv4: Attempt to release TCP socket in state 1
From: Eric Dumazet @ 2013-03-14 23:19 UTC (permalink / raw)
To: dormando; +Cc: Cong Wang, linux-kernel, netdev
In-Reply-To: <alpine.DEB.2.02.1303141610490.16308@dflat>
On Thu, 2013-03-14 at 16:15 -0700, dormando wrote:
> *sigh*. it's been a long month, sorry:
>
> [58377.436522] IPv4: Attempt to release TCP socket family 2 in state 1
> ffff8813fbad9500
> [58377.436539] ------------[ cut here ]------------
> [58377.436545] WARNING: at net/ipv4/af_inet.c:146
> inet_sock_destruct+0x176/0x200()
> [58377.436546] Hardware name: X9DR3-F
> [58377.436547] Modules linked in: bridge coretemp ghash_clmulni_intel
> ipmi_watchdog ipmi_devintf gpio_ich microcode ixgbe sb_edac edac_core mei
> lpc_ich mfd_core mdio ipmi_si ipmi_msghandler iptable_nat nf_nat_ipv4
> nf_nat isci libsas igb ptp pps_core
> [58377.436563] Pid: 0, comm: swapper/0 Not tainted 3.8.2 #3
> [58377.436564] Call Trace:
> [58377.436566] <IRQ> [<ffffffff8104964f>] warn_slowpath_common+0x7f/0xc0
> [58377.436572] [<ffffffff810496aa>] warn_slowpath_null+0x1a/0x20
> [58377.436574] [<ffffffff816032e6>] inet_sock_destruct+0x176/0x200
> [58377.436578] [<ffffffff815ec8e0>] ? tcp_write_timer_handler+0x1b0/0x1b0
> [58377.436581] [<ffffffff8156ee8d>] __sk_free+0x1d/0x140
> [58377.436583] [<ffffffff815ec8e0>] ? tcp_write_timer_handler+0x1b0/0x1b0
> [58377.436585] [<ffffffff8156efd5>] sk_free+0x25/0x30
> [58377.436586] [<ffffffff815ec929>] tcp_write_timer+0x49/0x70
> [58377.436590] [<ffffffff81059259>] call_timer_fn+0x49/0x130
> [58377.436593] [<ffffffff8107a07f>] ? scheduler_tick+0x15f/0x190
> [58377.436596] [<ffffffff81059854>] run_timer_softirq+0x224/0x290
> [58377.436598] [<ffffffff81058f76>] ? update_process_times+0x76/0x90
> [58377.436600] [<ffffffff815ec8e0>] ? tcp_write_timer_handler+0x1b0/0x1b0
> [58377.436602] [<ffffffff8108ebd4>] ? ktime_get+0x54/0xe0
> [58377.436604] [<ffffffff810518a7>] __do_softirq+0xc7/0x230
> [58377.436608] [<ffffffff8168fd4c>] call_softirq+0x1c/0x30
> [58377.436611] [<ffffffff81004415>] do_softirq+0x55/0x90
> [58377.436613] [<ffffffff810516a5>] irq_exit+0x85/0xa0
> [58377.436616] [<ffffffff8169036e>] smp_apic_timer_interrupt+0x6e/0x99
> [58377.436618] [<ffffffff8168f74a>] apic_timer_interrupt+0x6a/0x70
> [58377.436619] <EOI> [<ffffffff816855cc>] ? __schedule+0x3ac/0x750
> [58377.436625] [<ffffffff8100b1fd>] ? mwait_idle+0xad/0x1f0
> [58377.436627] [<ffffffff8100a743>] cpu_idle+0xb3/0x100
> [58377.436629] [<ffffffff816736a2>] rest_init+0x72/0x80
> [58377.436633] [<ffffffff81cc7d0e>] start_kernel+0x3ac/0x3b9
> [58377.436635] [<ffffffff81cc7790>] ? repair_env_string+0x5b/0x5b
> [58377.436636] [<ffffffff81cc732d>] x86_64_start_reservations+0x131/0x136
> [58377.436638] [<ffffffff81cc741f>] x86_64_start_kernel+0xed/0xf4
> [58377.436639] ---[ end trace 9e57364162374433 ]---
>
> ^ pretty sure that's the WARN_ON_ONCE(1)
>
> Then a short while later the usual:
>
> [58394.689801] ------------[ cut here ]------------
> [58394.689817] WARNING: at net/sched/sch_generic.c:254
> dev_watchdog+0x258/0x270()
> [58394.689820] Hardware name: X9DR3-F
> [58394.689836] NETDEV WATCHDOG: eth2 (ixgbe): transmit queue 14 timed out
> [58394.689837] Modules linked in: bridge coretemp ghash_clmulni_intel
> ipmi_watchdog ipmi_devintf gpio_ich microcode ixgbe sb_edac edac_core mei
> lpc_ich mfd_core mdio ipmi_si ipmi_msghandler iptable_nat nf_nat_ipv4
> nf_nat isci libsas igb ptp pps_core
> [58394.689853] Pid: 0, comm: swapper/0 Tainted: G W
> 3.8.2 #3
> [58394.689854] Call Trace:
> [58394.689856] <IRQ> [<ffffffff8104964f>] warn_slowpath_common+0x7f/0xc0
> [58394.689863] [<ffffffff81049746>] warn_slowpath_fmt+0x46/0x50
> [58394.689865] [<ffffffff815a1508>] dev_watchdog+0x258/0x270
> [58394.689868] [<ffffffff815a12b0>] ? __netdev_watchdog_up+0x80/0x80
> [58394.689872] [<ffffffff81059259>] call_timer_fn+0x49/0x130
> [58394.689875] [<ffffffff8107a07f>] ? scheduler_tick+0x15f/0x190
> [58394.689877] [<ffffffff81059854>] run_timer_softirq+0x224/0x290
> [58394.689880] [<ffffffff81058f76>] ? update_process_times+0x76/0x90
> [58394.689882] [<ffffffff815a12b0>] ? __netdev_watchdog_up+0x80/0x80
> [58394.689884] [<ffffffff8108ebd4>] ? ktime_get+0x54/0xe0
> [58394.689886] [<ffffffff810518a7>] __do_softirq+0xc7/0x230
> [58394.689890] [<ffffffff8168fd4c>] call_softirq+0x1c/0x30
> [58394.689894] [<ffffffff81004415>] do_softirq+0x55/0x90
> [58394.689895] [<ffffffff810516a5>] irq_exit+0x85/0xa0
> [58394.689898] [<ffffffff8169036e>] smp_apic_timer_interrupt+0x6e/0x99
> [58394.689900] [<ffffffff8168f74a>] apic_timer_interrupt+0x6a/0x70
> [58394.689901] <EOI> [<ffffffff816855cc>] ? __schedule+0x3ac/0x750
> [58394.689907] [<ffffffff8100b1fd>] ? mwait_idle+0xad/0x1f0
> [58394.689909] [<ffffffff8100a743>] cpu_idle+0xb3/0x100
> [58394.689911] [<ffffffff816736a2>] rest_init+0x72/0x80
> [58394.689915] [<ffffffff81cc7d0e>] start_kernel+0x3ac/0x3b9
> [58394.689917] [<ffffffff81cc7790>] ? repair_env_string+0x5b/0x5b
> [58394.689918] [<ffffffff81cc732d>] x86_64_start_reservations+0x131/0x136
> [58394.689920] [<ffffffff81cc741f>] x86_64_start_kernel+0xed/0xf4
> [58394.689922] ---[ end trace 9e57364162374434 ]---
> [58394.689965] ixgbe 0000:83:00.0 eth2: Reset adapter
> [58447.665326] INFO: rcu_sched self-detected stall on CPU { 8} (t=15001
> jiffies g=3607787 c=3607786 q=332913)
>
> (then tons of stuck processes getting timed out)
Thanks thats really useful, we might miss to increment socket refcount
in a timer setup.
^ permalink raw reply
* Re: LRO/GRO and libpcap packet reordering
From: Eric Dumazet @ 2013-03-14 23:21 UTC (permalink / raw)
To: Andy Lutomirski; +Cc: Ben Hutchings, Network Development
In-Reply-To: <1363302980.29475.45.camel@edumazet-glaptop>
On Fri, 2013-03-15 at 00:16 +0100, Eric Dumazet wrote:
> On Thu, 2013-03-14 at 15:58 -0700, Andy Lutomirski wrote:
>
> > Right. This is the part that I'm wondering about an efficient fix to
> > (i.e. flush GRO state for one flow whenever a packet for the reversed
> > flow is seen).
>
> It doesnt seem doable easily, because network header and tcp headers are
> handled in two separate functions in GRO stack (inet_gro_receive() &
> tcp_gro_receive()
>
> What you could do is changing MAX_GRO_SKBS from 8 to 1
> (basically allowing only one flow in GRO stack)
>
>
Well, its not enough, some changes would be needed to force a flush each
time a new flow is detected.
^ permalink raw reply
* Re: LRO/GRO and libpcap packet reordering
From: Andy Lutomirski @ 2013-03-14 23:22 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Ben Hutchings, Network Development
In-Reply-To: <1363303289.29475.47.camel@edumazet-glaptop>
On Thu, Mar 14, 2013 at 4:21 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Fri, 2013-03-15 at 00:16 +0100, Eric Dumazet wrote:
>> On Thu, 2013-03-14 at 15:58 -0700, Andy Lutomirski wrote:
>>
>> > Right. This is the part that I'm wondering about an efficient fix to
>> > (i.e. flush GRO state for one flow whenever a packet for the reversed
>> > flow is seen).
>>
>> It doesnt seem doable easily, because network header and tcp headers are
>> handled in two separate functions in GRO stack (inet_gro_receive() &
>> tcp_gro_receive()
>>
>> What you could do is changing MAX_GRO_SKBS from 8 to 1
>> (basically allowing only one flow in GRO stack)
>>
>>
> Well, its not enough, some changes would be needed to force a flush each
> time a new flow is detected.
>
>
>
Hmm. Maybe a better "fix" would be to have some up-to-date
documentation or other indication of what needs to happen to get clean
packet captures. I'm not sure where it should go.
--Andy
--
Andy Lutomirski
AMA Capital Management, LLC
^ permalink raw reply
* Re: RFC crap-patch [PATCH] net: Per CPU separate frag mem accounting
From: Ben Hutchings @ 2013-03-14 23:39 UTC (permalink / raw)
To: Hannes Frederic Sowa
Cc: Jesper Dangaard Brouer, Eric Dumazet, netdev, yoshfuji
In-Reply-To: <20130314231250.GA7974@order.stressinduktion.org>
On Fri, 2013-03-15 at 00:12 +0100, Hannes Frederic Sowa wrote:
> On Thu, Mar 14, 2013 at 08:59:03PM +0000, Ben Hutchings wrote:
> > On Thu, 2013-03-14 at 09:59 +0100, Jesper Dangaard Brouer wrote:
> > > On Thu, 2013-03-14 at 08:25 +0100, Jesper Dangaard Brouer wrote:
> > > > This is NOT the patch I just mentioned in the other thread, of removing
> > > > the LRU list. This patch does real per cpu mem acct, and LRU per CPU.
> > > >
> > > > I get really good performance number with this patch, but I still think
> > > > this might not be the correct solution.
> > >
> > > The reason is this depend on fragments entering the same HW queue, some
> > > NICs might not put the first fragment (which have the full header
> > > tuples) and the remaining fragments on the same queue. In which case
> > > this patch will loose its performance gain.
> > [...]
> >
> > The Microsoft RSS spec only includes port numbers in the flow hash for
> > TCP, presumably because TCP avoids IP fragmentation whereas datagram
> > protocols cannot. Some Linux drivers allow UDP ports to be included in
> > the flow hash but I don't think this is the default for any of them.
> >
> > In Solarflare hardware the IPv4 MF bit inhibits layer 4 flow steering,
> > so all fragments will be unsteered. I don't know whether everyone else
> > got that right though. :-)
>
> Shouldn't they be steered by the IPv4 2-tuple then (if ipv4 hashing is enabled
> on the card)?
IP fragments should get a flow hash based on the 2-tuple, yes.
To make myself clear, my working definitions are:
- Flow steering maps specified flows to specified RX queues
- Flow hashing maps all flows to RX queues
- Flow steering rules generally override flow hashing
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [GIT net] Open vSwitch
From: Jesse Gross @ 2013-03-15 0:15 UTC (permalink / raw)
To: David Miller; +Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA
A few different bug fixes, including several for issues with userspace
communication that have gone unnoticed up until now. These are intended
for net/3.9.
The following changes since commit 19f949f52599ba7c3f67a5897ac6be14bfcb1200:
Linux 3.8 (2013-02-18 15:58:34 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch.git fixes
for you to fetch changes up to d176ca2a48ff2b5d7becfacdcbd1d72c73bd22d1:
openvswitch: remove some useless comments (2013-02-22 17:02:49 -0800)
----------------------------------------------------------------
Cong Wang (2):
openvswitch: fix the calculation of checksum for vlan header
openvswitch: remove some useless comments
Rich Lane (4):
openvswitch: Fix ovs_vport_cmd_del return value on success
openvswitch: Fix ovs_vport_cmd_new return value on success
openvswitch: Call genlmsg_end in queue_userspace_packet
openvswitch: Fix parsing invalid LLC/SNAP ethertypes
net/openvswitch/actions.c | 4 ++--
net/openvswitch/datapath.c | 3 +++
net/openvswitch/flow.c | 6 +++++-
net/openvswitch/vport-netdev.c | 3 +--
net/openvswitch/vport.c | 3 +--
5 files changed, 12 insertions(+), 7 deletions(-)
^ permalink raw reply
* [PATCH net 2/6] openvswitch: Fix ovs_vport_cmd_new return value on success
From: Jesse Gross @ 2013-03-15 0:15 UTC (permalink / raw)
To: David Miller; +Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1363306506-885-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
From: Rich Lane <rlane-oPdFNf9WwoK1Z/+hSey0Gg@public.gmane.org>
If the pointer does not represent an error then the PTR_ERR
macro may still return a nonzero value.
Signed-off-by: Rich Lane <rlane-oPdFNf9WwoK1Z/+hSey0Gg@public.gmane.org>
Signed-off-by: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
net/openvswitch/datapath.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 5e275b9..a2cd3e6 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1691,6 +1691,7 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)
if (IS_ERR(vport))
goto exit_unlock;
+ err = 0;
reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq,
OVS_VPORT_CMD_NEW);
if (IS_ERR(reply)) {
--
1.7.10.4
^ permalink raw reply related
* [PATCH net 3/6] openvswitch: Call genlmsg_end in queue_userspace_packet
From: Jesse Gross @ 2013-03-15 0:15 UTC (permalink / raw)
To: David Miller; +Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1363306506-885-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
From: Rich Lane <rlane-oPdFNf9WwoK1Z/+hSey0Gg@public.gmane.org>
Without genlmsg_end the upcall message ends (according to nlmsg_len)
after the struct ovs_header.
Signed-off-by: Rich Lane <rlane-oPdFNf9WwoK1Z/+hSey0Gg@public.gmane.org>
Signed-off-by: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
net/openvswitch/datapath.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index a2cd3e6..cae1062 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -395,6 +395,7 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex,
skb_copy_and_csum_dev(skb, nla_data(nla));
+ genlmsg_end(user_skb, upcall);
err = genlmsg_unicast(net, user_skb, upcall_info->portid);
out:
--
1.7.10.4
^ permalink raw reply related
* [PATCH net 4/6] openvswitch: Fix parsing invalid LLC/SNAP ethertypes
From: Jesse Gross @ 2013-03-15 0:15 UTC (permalink / raw)
To: David Miller; +Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1363306506-885-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
From: Rich Lane <rlane-oPdFNf9WwoK1Z/+hSey0Gg@public.gmane.org>
Before this patch, if an LLC/SNAP packet with OUI 00:00:00 had an
ethertype less than 1536 the flow key given to userspace in the upcall
would contain the invalid ethertype (for example, 3). If userspace
attempted to insert a kernel flow for this key it would be rejected
by ovs_flow_from_nlattrs.
This patch allows OVS to pass the OFTest pktact.DirectBadLlcPackets.
Signed-off-by: Rich Lane <rlane-oPdFNf9WwoK1Z/+hSey0Gg@public.gmane.org>
Signed-off-by: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
net/openvswitch/flow.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index c3294ce..0c98d40 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -484,7 +484,11 @@ static __be16 parse_ethertype(struct sk_buff *skb)
return htons(ETH_P_802_2);
__skb_pull(skb, sizeof(struct llc_snap_hdr));
- return llc->ethertype;
+
+ if (ntohs(llc->ethertype) >= 1536)
+ return llc->ethertype;
+
+ return htons(ETH_P_802_2);
}
static int parse_icmpv6(struct sk_buff *skb, struct sw_flow_key *key,
--
1.7.10.4
^ permalink raw reply related
* [PATCH net 5/6] openvswitch: fix the calculation of checksum for vlan header
From: Jesse Gross @ 2013-03-15 0:15 UTC (permalink / raw)
To: David Miller
Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
Cong Wang
In-Reply-To: <1363306506-885-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
From: Cong Wang <amwang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
In vlan_insert_tag(), we insert a 4-byte VLAN header _after_
mac header:
memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN);
...
veth->h_vlan_proto = htons(ETH_P_8021Q);
...
veth->h_vlan_TCI = htons(vlan_tci);
so after it, we should recompute the checksum to include these 4 bytes.
skb->data still points to the mac header, therefore VLAN header is at
(2 * ETH_ALEN = 12) bytes after it, not (ETH_HLEN = 14) bytes.
This can also be observed via tcpdump:
0x0000: ffff ffff ffff 5254 005d 6f6e 8100 000a
0x0010: 0806 0001 0800 0604 0001 5254 005d 6f6e
0x0020: c0a8 026e 0000 0000 0000 c0a8 0282
Similar for __pop_vlan_tci(), the vlan header we remove is the one
overwritten in:
memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN);
Therefore the VLAN_HLEN = 4 bytes after 2 * ETH_ALEN is the part
we want to sub from checksum.
Cc: David S. Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Cong Wang <amwang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
net/openvswitch/actions.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index ac2defe..d4d5363 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -58,7 +58,7 @@ static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci)
if (skb->ip_summed == CHECKSUM_COMPLETE)
skb->csum = csum_sub(skb->csum, csum_partial(skb->data
- + ETH_HLEN, VLAN_HLEN, 0));
+ + (2 * ETH_ALEN), VLAN_HLEN, 0));
vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN);
*current_tci = vhdr->h_vlan_TCI;
@@ -115,7 +115,7 @@ static int push_vlan(struct sk_buff *skb, const struct ovs_action_push_vlan *vla
if (skb->ip_summed == CHECKSUM_COMPLETE)
skb->csum = csum_add(skb->csum, csum_partial(skb->data
- + ETH_HLEN, VLAN_HLEN, 0));
+ + (2 * ETH_ALEN), VLAN_HLEN, 0));
}
__vlan_hwaccel_put_tag(skb, ntohs(vlan->vlan_tci) & ~VLAN_TAG_PRESENT);
--
1.7.10.4
^ permalink raw reply related
* [PATCH net 6/6] openvswitch: remove some useless comments
From: Jesse Gross @ 2013-03-15 0:15 UTC (permalink / raw)
To: David Miller
Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
Cong Wang
In-Reply-To: <1363306506-885-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
From: Cong Wang <amwang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
These comments are useless in upstream kernel.
Cc: David S. Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Cong Wang <amwang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
net/openvswitch/vport-netdev.c | 3 +--
net/openvswitch/vport.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c
index 670cbc3..2130d61 100644
--- a/net/openvswitch/vport-netdev.c
+++ b/net/openvswitch/vport-netdev.c
@@ -43,8 +43,7 @@ static void netdev_port_receive(struct vport *vport, struct sk_buff *skb)
/* Make our own copy of the packet. Otherwise we will mangle the
* packet for anyone who came before us (e.g. tcpdump via AF_PACKET).
- * (No one comes after us, since we tell handle_bridge() that we took
- * the packet.) */
+ */
skb = skb_share_check(skb, GFP_ATOMIC);
if (unlikely(!skb))
return;
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index 70af0be..6255e48 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -326,8 +326,7 @@ int ovs_vport_get_options(const struct vport *vport, struct sk_buff *skb)
* @skb: skb that was received
*
* Must be called with rcu_read_lock. The packet cannot be shared and
- * skb->data should point to the Ethernet header. The caller must have already
- * called compute_ip_summed() to initialize the checksumming fields.
+ * skb->data should point to the Ethernet header.
*/
void ovs_vport_receive(struct vport *vport, struct sk_buff *skb)
{
--
1.7.10.4
^ permalink raw reply related
* [PATCH net 1/6] openvswitch: Fix ovs_vport_cmd_del return value on success
From: Jesse Gross @ 2013-03-15 0:15 UTC (permalink / raw)
To: David Miller; +Cc: netdev, dev, Rich Lane, Jesse Gross
In-Reply-To: <1363306506-885-1-git-send-email-jesse@nicira.com>
From: Rich Lane <rlane@bigswitch.com>
If the pointer does not represent an error then the PTR_ERR macro may still
return a nonzero value. The fix is the same as in ovs_vport_cmd_set.
Signed-off-by: Rich Lane <rlane@bigswitch.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
---
net/openvswitch/datapath.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index f996db3..5e275b9 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1772,6 +1772,7 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
if (IS_ERR(reply))
goto exit_unlock;
+ err = 0;
ovs_dp_detach_port(vport);
genl_notify(reply, genl_info_net(info), info->snd_portid,
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH] rtnetlink: Mask the rta_type when range checking
From: Vlad Yasevich @ 2013-03-15 0:30 UTC (permalink / raw)
To: Thomas Graf; +Cc: Stephen Hemminger, netdev, davem
In-Reply-To: <20130314212821.GC25591@casper.infradead.org>
On 03/14/2013 05:28 PM, Thomas Graf wrote:
> On 03/14/13 at 01:40pm, Vlad Yasevich wrote:
>> So let me rebuff this a bit more intelligently.
>>
>> 1) NLA_F_NESTED is used by netfilter in a lot of places. It seems that
>> only rtnetlink interface doesn't account for it.
>
> Stephen is not wrong, strictly speaking this is an ABI breaker.
>
> However, we have been applying NLA_TYPE_MASK in nla_type() and
> thus in nla_parse(), nlmsg_find_attr(), etc. since the
> introduction of the current kernel netlink API.
>
> static inline int nla_type(const struct nlattr *nla)
> {
> return nla->nla_type & NLA_TYPE_MASK;
> }
>
> I have been attempting to get rid of that ugly attribute parsing
> code in rtnetlink_rcv_msg() but it's hard to get rid of. I shall
> give this another try.
>
>> 2) The following commit:
>>
>> commit 25c71c75ac87508528db053b818944f3650dd7a6
>> Author: stephen hemminger <shemminger@vyatta.com>
>> Date: Tue Nov 13 07:53:05 2012 +0000
>>
>> bridge: bridge port parameters over netlink
>>
>> introduced NLA_F_NESTED usage in rtnetlink for both setlink and
>> getlink, so one could argue that was an ABI change.
>
> You are right, user space applications that do not apply
> NLA_TYPE_MASK will no longer see the IFLA_PROTINFO attribute
> with the above commit.
>
>> prove that without the change I am introducing, one can not use the
>> above mentioned bridge API. Feel free to try it with iproute2
>> patches
>> I sent earlier ([PATCH iproute2 0/2] Add support for bridge port
>> link information).
>
> I am not against your patch but I would love to see the affected
> code paths to no longer rely on the attribute array provided by
> the rtnetlink doit function but instead call nla_parse() themselves
> for the sake of proper validation.
>
Doing a quick check on all the callers for rtnl_register and their
handlers the following do not use nla_parse:
1) dn_fib_rtm_newroute/delroute - Don't seem to care about attribute
types.
2) dn_cache_getroute() - suspect use. relies on rta_buf populated by
rtnetlink_rcv_msg
3) inet_rtm_newroute/delroute - rtm_to_fib_config() uses a custom loop
with nla_type(), so safe.
That's all that a quick look finds. Out of all of them, looks like on
dn_cache_getroute() would be broken.
-vlad
^ permalink raw reply
* RE: em1 is visible to iproute2 but not ethtool or tcpdump
From: Allan, Bruce W @ 2013-03-15 1:05 UTC (permalink / raw)
To: Andy Lutomirski; +Cc: Network Development, e1000-devel@lists.sourceforge.net
In-Reply-To: <CALCETrXrOxSOiczSLNSd3=bTHZX+G5NUQ+mvBDC71SX4PTkSPA@mail.gmail.com>
> -----Original Message-----
> From: Andy Lutomirski [mailto:luto@amacapital.net]
> Sent: Thursday, March 14, 2013 3:43 PM
> To: Allan, Bruce W
> Cc: Network Development; e1000-devel@lists.sourceforge.net
> Subject: Re: em1 is visible to iproute2 but not ethtool or tcpdump
>
> On Thu, Mar 14, 2013 at 1:45 PM, Allan, Bruce W <bruce.w.allan@intel.com>
> wrote:
> >> -----Original Message-----
> >> From: netdev-owner@vger.kernel.org [mailto:netdev-
> >> owner@vger.kernel.org] On Behalf Of Andy Lutomirski
> >> Sent: Thursday, March 14, 2013 9:54 AM
> >> To: Network Development
> >> Cc: e1000-devel@lists.sourceforge.net
> >> Subject: em1 is visible to iproute2 but not ethtool or tcpdump
> >>
> >> My e1000e device is em1. It has this rather strange behavior on
> >> Fedora's 3.8.1 (although 3.7.something did the same thing, I believe):
> >>
> >> $ ip link show dev em1
> >> 6: em1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc
> >> pfifo_fast
> >> state DOWN qlen 1000
> >> link/ether f0:de:f1:59:f6:c9 brd ff:ff:ff:ff:ff:ff
> >> $ strace -e socket,ioctl ethtool em1
> >> socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
> >> Settings for em1:
> >> ioctl(3, SIOCETHTOOL, 0x7fffa6c554d0) = -1 ENODEV (No such device)
> >> Cannot get device settings: No such device
> >> ioctl(3, SIOCETHTOOL, 0x7fffa6c554d0) = -1 ENODEV (No such device)
> >> Cannot get wake-on-lan settings: No such device
> >> ioctl(3, SIOCETHTOOL, 0x7fffa6c554d0) = -1 ENODEV (No such device)
> >> Cannot get message level: No such device
> >> ioctl(3, SIOCETHTOOL, 0x7fffa6c554d0) = -1 ENODEV (No such device)
> >> Cannot get link status: No such device
> >> No data available
> >> +++ exited with 75 +++
> >> $ sudo tcpdump -i em1
> >> tcpdump: em1: SIOETHTOOL(ETHTOOL_GTSO) ioctl failed: No such device
> >>
> >> A sufficient number of rmmod/modprobe cycles will make it work.
> >>
> >> This is, perhaps, helpful:
> >>
> >> $ sudo ip link set dev em1 name foobar
> >> RTNETLINK answers: Device or resource busy
> >> $ sudo ip link set dev em1 down
> >> $ sudo ip link set dev em1 name foobar
> >> $ sudo ethtool foobar
> >> Settings for foobar:
> >> Supported ports: [ TP ]
> >> Supported link modes: 10baseT/Half 10baseT/Full
> >> 100baseT/Half 100baseT/Full
> >> 1000baseT/Full
> >> Supported pause frame use: No
> >> Supports auto-negotiation: Yes
> >> Advertised link modes: 10baseT/Half 10baseT/Full
> >> 100baseT/Half 100baseT/Full
> >> 1000baseT/Full
> >> Advertised pause frame use: No
> >> Advertised auto-negotiation: Yes
> >> Speed: Unknown!
> >> Duplex: Unknown! (255)
> >> Port: Twisted Pair
> >> PHYAD: 1
> >> Transceiver: internal
> >> Auto-negotiation: on
> >> MDI-X: Unknown
> >> Supports Wake-on: pumbg
> >> Wake-on: g
> >> Current message level: 0x00000007 (7)
> >> drv probe link
> >> Link detected: no
> >> $ sudo ip link set dev foobar name em1
> >> $ sudo ethtool em1
> >> Settings for em1:
> >> Supported ports: [ TP ]
> >> Supported link modes: 10baseT/Half 10baseT/Full
> >> 100baseT/Half 100baseT/Full
> >> 1000baseT/Full
> >> Supported pause frame use: No
> >> Supports auto-negotiation: Yes
> >> Advertised link modes: 10baseT/Half 10baseT/Full
> >> 100baseT/Half 100baseT/Full
> >> 1000baseT/Full
> >> Advertised pause frame use: No
> >> Advertised auto-negotiation: Yes
> >> Speed: Unknown!
> >> Duplex: Unknown! (255)
> >> Port: Twisted Pair
> >> PHYAD: 1
> >> Transceiver: internal
> >> Auto-negotiation: on
> >> MDI-X: Unknown
> >> Supports Wake-on: pumbg
> >> Wake-on: g
> >> Current message level: 0x00000007 (7)
> >> drv probe link
> >> Link detected: no
> >> $
> >>
> >> This bug (?) isn't a show-stopper, but it's rather annoying. I
> >> suspect a core networking bug, not an e1000e bug, but I cc'd the e1000
> >> people just in case.
> >
> > This sounds related to some runtime power management (RPM) issues
> that have
> > already been fixed. First check whether RPM is enabled for your device -
> the file
> > /sys/devices/pciNNNN:NN/NNNN:NN:NN.N/power/control (where
> NNNN... is
> > the PCI domain, bus, slot and function of your device) will contain "auto"
> when it
> > is enabled. To disable RPM for that device, change the value in the file to
> "on".
>
> Seems to work. Oddly, I'm pretty sure I've seen this bug even when
> something's plugged in.
>
> Is the fix heading to stable?
>
> --Andy
I believe the patches have been submitted to stable.
^ permalink raw reply
* Re: [PATCH] drivers/isdn: break out of the loop after call isdn_tty_send_msg
From: Chen Gang @ 2013-03-15 2:02 UTC (permalink / raw)
To: Jiri Slaby; +Cc: Jiri Kosina, isdn, Greg KH, Alan Cox, netdev
In-Reply-To: <512F296E.1050303@suse.cz>
Hello Maintainers:
is it qualified to be applied ?
thanks.
于 2013年02月28日 17:54, Jiri Slaby 写道:
> On 02/28/2013 03:57 AM, Chen Gang wrote:
>>
>> need break out of the loop after call isdn_tty_send_msg.
>> isdn_tty_send_msg is intended to eat the rest of the string.
>> so need not scan again the string which appended "+M...".
>
> Yes, looks good.
>
>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>> ---
>> drivers/isdn/i4l/isdn_tty.c | 4 +++-
>> 1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
>> index d8a7d83..8ac7b33 100644
>> --- a/drivers/isdn/i4l/isdn_tty.c
>> +++ b/drivers/isdn/i4l/isdn_tty.c
>> @@ -3587,7 +3587,7 @@ isdn_tty_parse_at(modem_info *info)
>> case 'M': /* MESSAGE */
>> p++;
>> isdn_tty_send_msg(info, m, p);
>> - break;
>> + goto tail;
>> default:
>> PARSE_ERROR;
>> }
>> @@ -3601,6 +3601,8 @@ isdn_tty_parse_at(modem_info *info)
>> PARSE_ERROR;
>> }
>> }
>> +
>> +tail:
>> #ifdef CONFIG_ISDN_AUDIO
>> if (!info->vonline)
>> #endif
>>
>
>
--
Chen Gang
Asianux Corporation
^ permalink raw reply
* Re: [PATCH] drivers/isdn: beautify code, delete 'break' after 'return'
From: Chen Gang @ 2013-03-15 2:04 UTC (permalink / raw)
To: Jiri Kosina, isdn, Jiri Slaby; +Cc: Greg KH, alan, netdev
In-Reply-To: <512DCEDC.4030500@asianux.com>
Hello Maintainers:
is it patch ok ?
thanks.
于 2013年02月27日 17:16, Chen Gang 写道:
>
> delete 'break' statement after 'return' statement
>
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
> drivers/isdn/i4l/isdn_tty.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
> index d8a7d83..925a7ed 100644
> --- a/drivers/isdn/i4l/isdn_tty.c
> +++ b/drivers/isdn/i4l/isdn_tty.c
> @@ -3425,7 +3425,6 @@ isdn_tty_parse_at(modem_info *info)
> p++;
> isdn_tty_cmd_ATA(info);
> return;
> - break;
> case 'D':
> /* D - Dial */
> if (info->msr & UART_MSR_DCD)
>
--
Chen Gang
Asianux Corporation
^ permalink raw reply
* Re: igb_poll - device driver failed to check map error
From: Alexander Duyck @ 2013-03-15 2:18 UTC (permalink / raw)
To: christoph.paasch
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Alex Duyck,
Eric Dumazet, netdev
In-Reply-To: <7974689.msj0QTRKPV@cpaasch-mac>
On 03/12/2013 02:31 AM, Christoph Paasch wrote:
> Hello,
>
> I'm seeing a warning while booting my machine when DMA_API_DEBUG is set:
>
> [ 36.402824] ------------[ cut here ]------------
> [ 36.458070] WARNING: at /home/cpaasch/builder/net-next/lib/dma-debug.c:934
> check_unmap+0x648/0x702()
> [ 36.567377] Hardware name: ProLiant DL165 G7
> [ 36.618452] igb 0000:04:00.0: DMA-API: device driver failed to check map
> error[device address=0x0000000233d9b232] [size=154 bytes] [mapped as single]
> [ 36.776640] Modules linked in:
> [ 36.815446] Pid: 0, comm: swapper/7 Not tainted 3.9.0-rc1-mptcp+ #101
> [ 36.892515] Call Trace:
> [ 36.921745] <IRQ> [<ffffffff8102ad7f>] warn_slowpath_common+0x80/0x9a
> [ 37.001023] [<ffffffff8102ae2d>] warn_slowpath_fmt+0x41/0x43
> [ 37.069771] [<ffffffff811db17f>] check_unmap+0x648/0x702
> [ 37.134363] [<ffffffff811db3e9>] debug_dma_unmap_page+0x50/0x52
> [ 37.206234] [<ffffffff8136676a>] igb_poll+0x144/0xf7c
> [ 37.267706] [<ffffffff8104dd19>] ? sched_clock_cpu+0x46/0xd1
> [ 37.336456] [<ffffffff814458ce>] net_rx_action+0xa7/0x1d0
> [ 37.402085] [<ffffffff81030b65>] __do_softirq+0xb4/0x16f
> [ 37.466673] [<ffffffff81030c90>] irq_exit+0x40/0x87
> [ 37.526067] [<ffffffff81002db1>] do_IRQ+0x98/0xaf
> [ 37.583378] [<ffffffff815210aa>] common_interrupt+0x6a/0x6a
> [ 37.651086] <EOI> [<ffffffff8105d4be>] ?
> __tick_nohz_idle_enter+0x116/0x31f
> [ 37.736595] [<ffffffff81008a04>] ? default_idle+0x24/0x39
> [ 37.802224] [<ffffffff81008c62>] cpu_idle+0x68/0xa4
> [ 37.861616] [<ffffffff81519f78>] start_secondary+0x1a9/0x1ad
> [ 37.930364] ---[ end trace 01b5bb0fd75a464c ]---
>
>
> It happens shortly after mounting the NFS-root filesystem.
>
> I tried to understand what is going on, but I am now at my wit's end.
>
> By adding some print-statements, here is what I found out (not sure if this is
> anyhow helpful):
>
> The difference between tx_buffer->time_stamp and the current 'jiffies' is up
> to 2000 jiffies (HZ==1000) at the first time the above warning happens (this
> seems too much for me). From then on, I see my print 3-4 times appear but
> without such a big difference between the timestamps (difference around 1 and
> 2 jiffies).
>
> Some other stuff, I printed:
> tx_buffer->skb: ffff880235054c80
> tx_buffer->bytecount: 154
> tx_buffer->gso_segs: 1
> tx_buffer->protocol: 8
> tx_buffer->tx_flags 0x20
>
>
> One last thing:
> Am I right that after each call to dma_map_single/page a call to
> dma_mapping_error is needed? If that's the case, I have some patches that add
> this statement at missing places in the e1000, e1000e and ixgb driver. But
> these patches do not fix my above problem.
>
>
> Thanks for your help,
> Christoph
>
Christoph,
One thing that might be useful would be to reproduce this with a
standard 3.9-rc kernel instead of one using the multipath TCP patches.
This will help us to verify that the issue is reproducible with a stock
kernel and is not related to any ongoing work you may have only in your
tree.
Thanks,
Alex
^ permalink raw reply
* Re: [PATCH v2 2/7] USB: serial: handle suspend failure path correctly
From: Ming Lei @ 2013-03-15 3:04 UTC (permalink / raw)
To: Johan Hovold
Cc: David S. Miller, Greg Kroah-Hartman, Jiri Kosina, Alan Stern,
Oliver Neukum, netdev, linux-usb, linux-input
In-Reply-To: <20130314111010.GA15776@localhost>
On Thu, Mar 14, 2013 at 7:10 PM, Johan Hovold <jhovold@gmail.com> wrote:
> On Fri, Mar 08, 2013 at 12:15:19AM +0800, Ming Lei wrote:
>> This patch kills traffic even though type->suspend returns
>> failure inside usb_serial_suspend from system sleep context
>> because USB core ignores the failiure and lets system sleep
>> go ahread, so the serial URB traffic need to be killed
>> in this case.
>>
>> Cc: Johan Hovold <jhovold@gmail.com>
>> Signed-off-by: Ming Lei <ming.lei@canonical.com>
>> ---
>> drivers/usb/serial/usb-serial.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
>> index a19ed74..9d0b9c8 100644
>> --- a/drivers/usb/serial/usb-serial.c
>> +++ b/drivers/usb/serial/usb-serial.c
>> @@ -1142,10 +1142,11 @@ int usb_serial_suspend(struct usb_interface *intf, pm_message_t message)
>>
>> if (serial->type->suspend) {
>> r = serial->type->suspend(serial, message);
>> - if (r < 0) {
>> + if (r < 0 && PMSG_IS_AUTO(message)) {
>> serial->suspending = 0;
>> goto err_out;
>> }
>> + /* TODO: resume() might need to handle suspend failure */
>> }
>>
>> for (i = 0; i < serial->num_ports; ++i) {
>
> Sorry for the late reply.
>
> The usb-serial subdriver suspend callbacks do not and must not return
> non-zero if !PMSG_IS_AUTO(message) so adding code to handle that case
> merely obfuscates this fact.
>
> I'd rather see this documented with a comment just as Bjørn suggested
> for cdc_mbim and qmi_wwan.
No problem, will do it in v3.
Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
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