Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH v4 1/2] vhost-net: fix handle_rx buffer size
From: Eric W. Biederman @ 2012-05-11 23:05 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Basil Gor, David S. Miller, netdev
In-Reply-To: <20120508192732.GA28536@redhat.com>

"Michael S. Tsirkin" <mst@redhat.com> writes:

> On Fri, May 04, 2012 at 12:55:23PM +0400, Basil Gor wrote:
>> Take vlan header length into account, when vlan id is stored as
>> vlan_tci. Otherwise tagged packets comming from macvtap will be
>> truncated.
>> 
>> Signed-off-by: Basil Gor <basil.gor@gmail.com>
>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
>
> This doesn't fix packet socket backends but that can be
> handled separately later.

Yes that seems good enough.

Let me recommend just taking the packet out of the socket queue
instead of calling the recvmsg method.  Since vhost/net.c is
already munging with the queue directly that should make
it easy to avoid the peculiarities of pf_packet sockets
for reporting vlan information.

Eric

^ permalink raw reply

* Re: [PATCH net-next] sch_htb: report backlog information in htb classes
From: Eric Dumazet @ 2012-05-11 22:41 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <1336775494.31653.297.camel@edumazet-glaptop>

On Sat, 2012-05-12 at 00:31 +0200, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> htb classes at level 0 can copy their qdisc child backlog to provide to
> "tc -s class" users more relevant information. (packet counter is
> correct but byte counter (backlog) is 0)
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  net/sched/sch_htb.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Please disregard this patch, more work is needed.

Thanks

^ permalink raw reply

* Re: [PATCH RESEND 2/5] net: fec: adopt pinctrl support
From: David Miller @ 2012-05-11 22:31 UTC (permalink / raw)
  To: shawn.guo; +Cc: arnd, netdev, s.hauer, olof, dong.aisheng, linux-arm-kernel
In-Reply-To: <1336352040-28447-3-git-send-email-shawn.guo@linaro.org>

From: Shawn Guo <shawn.guo@linaro.org>
Date: Mon,  7 May 2012 08:53:57 +0800

> Cc: netdev@vger.kernel.org
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply

* [PATCH net-next] sch_htb: report backlog information in htb classes
From: Eric Dumazet @ 2012-05-11 22:31 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

From: Eric Dumazet <edumazet@google.com>

htb classes at level 0 can copy their qdisc child backlog to provide to
"tc -s class" users more relevant information. (packet counter is
correct but byte counter (backlog) is 0)

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/sched/sch_htb.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 9d75b77..0f4d534 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1073,9 +1073,10 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg,
 	spin_lock_bh(root_lock);
 	tcm->tcm_parent = cl->parent ? cl->parent->common.classid : TC_H_ROOT;
 	tcm->tcm_handle = cl->common.classid;
-	if (!cl->level && cl->un.leaf.q)
+	if (!cl->level && cl->un.leaf.q) {
 		tcm->tcm_info = cl->un.leaf.q->handle;
-
+		sch->qstats.backlog = cl->un.leaf.q->qstats.backlog;
+	}
 	nest = nla_nest_start(skb, TCA_OPTIONS);
 	if (nest == NULL)
 		goto nla_put_failure;

^ permalink raw reply related

* Re: [net-next 2/2] igb: Add Support for new i210/i211 devices.
From: David Miller @ 2012-05-11 22:27 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: carolyn.wyborny, netdev, gospo, sassmann
In-Reply-To: <1336723282-3130-3-git-send-email-jeffrey.t.kirsher@intel.com>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 11 May 2012 01:01:22 -0700

> +s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
> +{
> +	s32 ret_val;
> +
> +	ret_val = igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
> +
> +	return ret_val;
> +}

Please, this is just unnecessary syntactic masterbation, simplify this
to:

s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
{
	return igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
}

And:

> +void igb_release_nvm_i210(struct e1000_hw *hw)
> +{
> +
> +	igb_release_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
> +}

Please get rid of that unnecessary empty line.

I can really tell when someone is extremely careless when removing
their debugging code, and I can almost guarentee that's what has
happened here.

^ permalink raw reply

* Re: [PATCH] ks8851: Update link status during link change interrupt
From: David Miller @ 2012-05-11 22:23 UTC (permalink / raw)
  To: sboyd; +Cc: netdev, linux-kernel, ben-linux
In-Reply-To: <1336690290-21304-1-git-send-email-sboyd@codeaurora.org>

From: Stephen Boyd <sboyd@codeaurora.org>
Date: Thu, 10 May 2012 15:51:30 -0700

> If a link change interrupt comes in we just clear the interrupt
> and continue along without notifying the upper networking layers
> that the link has changed. Use the mii_check_link() function to
> update the link status whenever a link change interrupt occurs.
> 
> Cc: Ben Dooks <ben-linux@fluff.org>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

Applied, thanks.

^ permalink raw reply

* [PATCH net-next] etherdevice: Remove now unused compare_ether_addr_64bits
From: Joe Perches @ 2012-05-11 22:21 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel
In-Reply-To: <20120510.233554.263340913611469229.davem@davemloft.net>

Move and invert the logic from the otherwise unused
compare_ether_addr_64bits to ether_addr_equal_64bits.

Neaten the logic in is_etherdev_addr.

Signed-off-by: Joe Perches <joe@perches.com>
---
 include/linux/etherdevice.h |   46 ++++++++++++------------------------------
 1 files changed, 13 insertions(+), 33 deletions(-)

diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index afacf85..dc85c1d 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -193,12 +193,12 @@ static inline unsigned long zap_last_2bytes(unsigned long value)
 }
 
 /**
- * compare_ether_addr_64bits - Compare two Ethernet addresses
+ * ether_addr_equal_64bits - Compare two Ethernet addresses
  * @addr1: Pointer to an array of 8 bytes
  * @addr2: Pointer to an other array of 8 bytes
  *
- * Compare two ethernet addresses, returns 0 if equal, non-zero otherwise.
- * Unlike memcmp(), it doesn't return a value suitable for sorting.
+ * Compare two ethernet addresses, returns true if equal, false otherwise.
+ *
  * The function doesn't need any conditional branches and possibly uses
  * word memory accesses on CPU allowing cheap unaligned memory reads.
  * arrays = { byte1, byte2, byte3, byte4, byte6, byte7, pad1, pad2}
@@ -206,45 +206,25 @@ static inline unsigned long zap_last_2bytes(unsigned long value)
  * Please note that alignment of addr1 & addr2 is only guaranted to be 16 bits.
  */
 
-static inline unsigned compare_ether_addr_64bits(const u8 addr1[6+2],
-						 const u8 addr2[6+2])
+static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
+					   const u8 addr2[6+2])
 {
 #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
 	unsigned long fold = ((*(unsigned long *)addr1) ^
 			      (*(unsigned long *)addr2));
 
 	if (sizeof(fold) == 8)
-		return zap_last_2bytes(fold) != 0;
+		return zap_last_2bytes(fold) == 0;
 
 	fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^
 				(*(unsigned long *)(addr2 + 4)));
-	return fold != 0;
+	return fold == 0;
 #else
-	return compare_ether_addr(addr1, addr2);
+	return ether_addr_equal(addr1, addr2);
 #endif
 }
 
 /**
- * ether_addr_equal_64bits - Compare two Ethernet addresses
- * @addr1: Pointer to an array of 8 bytes
- * @addr2: Pointer to an other array of 8 bytes
- *
- * Compare two ethernet addresses, returns true if equal, false otherwise.
- *
- * The function doesn't need any conditional branches and possibly uses
- * word memory accesses on CPU allowing cheap unaligned memory reads.
- * arrays = { byte1, byte2, byte3, byte4, byte6, byte7, pad1, pad2}
- *
- * Please note that alignment of addr1 & addr2 is only guaranted to be 16 bits.
- */
-
-static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
-					   const u8 addr2[6+2])
-{
-	return !compare_ether_addr_64bits(addr1, addr2);
-}
-
-/**
  * is_etherdev_addr - Tell if given Ethernet address belongs to the device.
  * @dev: Pointer to a device structure
  * @addr: Pointer to a six-byte array containing the Ethernet address
@@ -252,23 +232,23 @@ static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
  * Compare passed address with all addresses of the device. Return true if the
  * address if one of the device addresses.
  *
- * Note that this function calls compare_ether_addr_64bits() so take care of
+ * Note that this function calls ether_addr_equal_64bits() so take care of
  * the right padding.
  */
 static inline bool is_etherdev_addr(const struct net_device *dev,
 				    const u8 addr[6 + 2])
 {
 	struct netdev_hw_addr *ha;
-	int res = 1;
+	bool res = false;
 
 	rcu_read_lock();
 	for_each_dev_addr(dev, ha) {
-		res = compare_ether_addr_64bits(addr, ha->addr);
-		if (!res)
+		res = ether_addr_equal_64bits(addr, ha->addr);
+		if (res)
 			break;
 	}
 	rcu_read_unlock();
-	return !res;
+	return res;
 }
 #endif	/* __KERNEL__ */
 

^ permalink raw reply related

* Re: [PATCH v2 net-next] fq_codel: Fair Queue Codel AQM
From: David Miller @ 2012-05-11 22:17 UTC (permalink / raw)
  To: eric.dumazet
  Cc: xiaosuo, netdev, dave.taht, nichols, van, therbert, mattmathis,
	ycheng, shemminger, maze, nanditad
In-Reply-To: <1336774576.31653.289.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 12 May 2012 00:16:16 +0200

> On Fri, 2012-05-11 at 21:30 +0200, Eric Dumazet wrote:
>> From: Eric Dumazet <edumazet@google.com>
> 
> ...
> 
>> +static int fq_codel_dump_class_stats(struct Qdisc *sch, unsigned long cl,
>> +				     struct gnet_dump *d)
>> +{
>> +	struct fq_codel_sched_data *q = qdisc_priv(sch);
>> +	u32 idx = cl - 1;
>> +	struct gnet_stats_queue qs = { 0 };
>> +	struct tc_fq_codel_xstats xstats;
>> +
>> +	WARN_ON_ONCE(1);
>> +	if (idx < q->flows_cnt) {
>> +		const struct fq_codel_flow *flow = &q->flows[idx];
>> +		const struct sk_buff *skb = flow->head;
> 
> Oh well, I forgot to remove this WARN_ON_ONCE(1)

I can do it.

^ permalink raw reply

* Re: [PATCH v4 2/2] macvtap: restore vlan header on user read
From: David Miller @ 2012-05-11 22:17 UTC (permalink / raw)
  To: basil.gor; +Cc: mst, ebiederm, netdev
In-Reply-To: <1336121724-31902-2-git-send-email-basil.gor@gmail.com>

From: Basil Gor <basil.gor@gmail.com>
Date: Fri,  4 May 2012 12:55:24 +0400

> Ethernet vlan header is not on the packet and kept in the skb->vlan_tci
> when it comes from lower dev. This patch inserts vlan header in user
> buffer during skb copy on user read.
> 
> Signed-off-by: Basil Gor <basil.gor@gmail.com>

Also applied, thanks.

^ permalink raw reply

* Re: [PATCH v4 1/2] vhost-net: fix handle_rx buffer size
From: David Miller @ 2012-05-11 22:17 UTC (permalink / raw)
  To: basil.gor; +Cc: mst, ebiederm, netdev
In-Reply-To: <1336121724-31902-1-git-send-email-basil.gor@gmail.com>

From: Basil Gor <basil.gor@gmail.com>
Date: Fri,  4 May 2012 12:55:23 +0400

> Take vlan header length into account, when vlan id is stored as
> vlan_tci. Otherwise tagged packets comming from macvtap will be
> truncated.
> 
> Signed-off-by: Basil Gor <basil.gor@gmail.com>

My patience with Eric B. to review this has run out, applied,
thanks Basil.

^ permalink raw reply

* Re: [PATCH v2 net-next] fq_codel: Fair Queue Codel AQM
From: Eric Dumazet @ 2012-05-11 22:16 UTC (permalink / raw)
  To: Changli Gao
  Cc: David Miller, netdev, Dave Taht, Kathleen Nichols, Van Jacobson,
	Tom Herbert, Matt Mathis, Yuchung Cheng, Stephen Hemminger,
	Maciej Żenczykowski, Nandita Dukkipati
In-Reply-To: <1336764650.31653.277.camel@edumazet-glaptop>

On Fri, 2012-05-11 at 21:30 +0200, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>

...

> +static int fq_codel_dump_class_stats(struct Qdisc *sch, unsigned long cl,
> +				     struct gnet_dump *d)
> +{
> +	struct fq_codel_sched_data *q = qdisc_priv(sch);
> +	u32 idx = cl - 1;
> +	struct gnet_stats_queue qs = { 0 };
> +	struct tc_fq_codel_xstats xstats;
> +
> +	WARN_ON_ONCE(1);
> +	if (idx < q->flows_cnt) {
> +		const struct fq_codel_flow *flow = &q->flows[idx];
> +		const struct sk_buff *skb = flow->head;

Oh well, I forgot to remove this WARN_ON_ONCE(1)

^ permalink raw reply

* Re: [net-next 2/2] stmmac: add mixed burst for DMA
From: David Miller @ 2012-05-11 22:12 UTC (permalink / raw)
  To: peppe.cavallaro; +Cc: netdev
In-Reply-To: <1336381953-18041-2-git-send-email-peppe.cavallaro@st.com>

From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Mon,  7 May 2012 11:12:33 +0200

> -	int (*init) (void __iomem *ioaddr, int pbl, int fb, int burst_len,
> -			u32 dma_tx, u32 dma_rx);
> +	int (*init) (void __iomem *ioaddr, int pbl, int fb, int mb,
> +			int burst_len, u32 dma_tx, u32 dma_rx);

Fix the indentation of the arguments on the second line,
the first character must line up with the first column after
the function's openning parenthesis on the previous line.

> -static int dwmac1000_dma_init(void __iomem *ioaddr, int pbl, int fb,
> +static int dwmac1000_dma_init(void __iomem *ioaddr, int pbl, int fb, int mb,
>  			      int burst_len, u32 dma_tx, u32 dma_rx)

While you're here fix up that issue in the existing code here as well.

> -static int dwmac100_dma_init(void __iomem *ioaddr, int pbl, int fb,
> +static int dwmac100_dma_init(void __iomem *ioaddr, int pbl, int fb, int mb,
>  			     int burst_len, u32 dma_tx, u32 dma_rx)

Likewise.

> -	int pbl = DEFAULT_DMA_PBL, fixed_burst = 0, burst_len = 0;
> +	int pbl = DEFAULT_DMA_PBL, fixed_burst = 0, burst_len = 0,
> +	    mixed_burst = 0;

This is gross, just make a new "int" declaration for mixed_burst.

^ permalink raw reply

* Linux Plumbers Conference: Networking-bufferbloat
From: Tom Herbert @ 2012-05-11 22:12 UTC (permalink / raw)
  To: Linux Netdev List

Hi all,

I proposed a micro conference for this years Linux Plumbers Conference
for August 29-31, 2012 San Diego, California.

I'm soliciting  ideas for presentation and conversation to fill a ~2.5
hour mini-conference.  I think the major topics will be buffer bloat
(can't wait to hear more about codel :-) ) , networking performance
(including TCP enhancements), and maybe integration advanced NIC HW
features.

If you have ideas for discussion that you think would benefit from
discussion at the Plumbers Conference, please add your idea to the
wiki, and email me.

http://www.linuxplumbersconf.org/2012/
http://wiki.linuxplumbersconf.org/2012:networking-bufferbloat

Thanks,
Tom

^ permalink raw reply

* Re: [net-next 1/2] stmmac: extend mac addr reg and fix perfect filering
From: David Miller @ 2012-05-11 22:11 UTC (permalink / raw)
  To: peppe.cavallaro; +Cc: netdev, gianni.antoniazzi-ext
In-Reply-To: <1336381953-18041-1-git-send-email-peppe.cavallaro@st.com>

From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Mon,  7 May 2012 11:12:32 +0200

> +	/* Extra 16 regs are available in cores newer than the 3.40. */
> +	if (id > 34)

No magic constants, even if you describe it in the comment.  Add
an appropriate macro and use it.
> +	/* For MAC Addr registers se have to set the Address Enable (AE)
> +	 * bit that has no effect on the High Reg 0 where the bit 31 (MO)
> +	 * is RO. */

Comments should be formatted as:

	/* For MAC Addr registers se have to set the Address Enable (AE)
	 * bit that has no effect on the High Reg 0 where the bit 31 (MO)
	 * is RO.
	 */

^ permalink raw reply

* Re: pch_gbe: oops with vlan (new)
From: Eric Dumazet @ 2012-05-11 22:10 UTC (permalink / raw)
  To: Andy Cress; +Cc: netdev
In-Reply-To: <1336770777.31653.283.camel@edumazet-glaptop>

On Fri, 2012-05-11 at 23:13 +0200, Eric Dumazet wrote:
> On Fri, 2012-05-11 at 13:48 -0700, Andy Cress wrote:
> > Folks,
> > 
> > I am looking for help in debugging a pch_gbe driver oops/abort.
> > 
> > Kernel: version 2.6.32-220.el6.i686 (RHEL6.2)
> > Driver: pch_gbe version 0.91-NAPI  (source tarball we used is at
> > https://sendfile.kontron.com/message/24tdUi6MXklnUtBLnOsumq until May
> > 16)
> > NIC: 0b:00.1 Ethernet controller [0200]: Intel Corporation Platform
> > Controller Hub EG20T Gigabit Ethernet Controller [8086:8802] (rev 02)
> > 
> > Configuration, with VLAN:
> >  eth0 (not started)
> >  eth0.100 = 192.168.100.1
> >  eth0.200 = 192.168.200.1
> >  eth0.6  = 192.168.6.1
> > 
> > When starting the VLAN configuration, then doing a ping test for >= 5
> > minutes, I get a kernel oop/abort message as shown below.  This does not
> > happen without configuring VLAN.
> > Where should I look for possible causes for a transmit queue timeout
> > like this?  
> > 
> > I have contacted the OKI/LAPIS driver authors, but no response so far.
> > I thought that this group might be able to comment from similar
> > experiences.
> > 
> > Andy
> 
> typical sign of a buggy driver
> 
> A quick look in current Linus tree show a non existent synchronization
> between ndo_start_xmit and TX completion.
> 
> tx completion uses a tx_queue_lock spinlock for nothing but false sense
> of correctness.

Please try the following patch : (based on current net-next tree)

Also this driver has a strange RX path : It does a copy of incoming
frames on fixed size skbs, (2048+overhead -> kmalloc-4096 pool) instead
of using skb of the right size...



 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h      |    2 
 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c |   25 ++++------
 2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
index 9f3dbc4..b07311e 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
@@ -584,7 +584,6 @@ struct pch_gbe_hw_stats {
 /**
  * struct pch_gbe_adapter - board specific private data structure
  * @stats_lock:	Spinlock structure for status
- * @tx_queue_lock:	Spinlock structure for transmit
  * @ethtool_lock:	Spinlock structure for ethtool
  * @irq_sem:		Semaphore for interrupt
  * @netdev:		Pointer of network device structure
@@ -609,7 +608,6 @@ struct pch_gbe_hw_stats {
 
 struct pch_gbe_adapter {
 	spinlock_t stats_lock;
-	spinlock_t tx_queue_lock;
 	spinlock_t ethtool_lock;
 	atomic_t irq_sem;
 	struct net_device *netdev;
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 9dc7e50..3787c64 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
@@ -645,14 +645,11 @@ static void pch_gbe_mac_set_pause_packet(struct pch_gbe_hw *hw)
  */
 static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter)
 {
-	int size;
-
-	size = (int)sizeof(struct pch_gbe_tx_ring);
-	adapter->tx_ring = kzalloc(size, GFP_KERNEL);
+	adapter->tx_ring = kzalloc(sizeof(*adapter->tx_ring), GFP_KERNEL);
 	if (!adapter->tx_ring)
 		return -ENOMEM;
-	size = (int)sizeof(struct pch_gbe_rx_ring);
-	adapter->rx_ring = kzalloc(size, GFP_KERNEL);
+
+	adapter->rx_ring = kzalloc(sizeof(*adapter->rx_ring), GFP_KERNEL);
 	if (!adapter->rx_ring) {
 		kfree(adapter->tx_ring);
 		return -ENOMEM;
@@ -1169,7 +1166,6 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
 	struct sk_buff *tmp_skb;
 	unsigned int frame_ctrl;
 	unsigned int ring_num;
-	unsigned long flags;
 
 	/*-- Set frame control --*/
 	frame_ctrl = 0;
@@ -1216,14 +1212,14 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
 			}
 		}
 	}
-	spin_lock_irqsave(&tx_ring->tx_lock, flags);
+
 	ring_num = tx_ring->next_to_use;
 	if (unlikely((ring_num + 1) == tx_ring->count))
 		tx_ring->next_to_use = 0;
 	else
 		tx_ring->next_to_use = ring_num + 1;
 
-	spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
+
 	buffer_info = &tx_ring->buffer_info[ring_num];
 	tmp_skb = buffer_info->skb;
 
@@ -1525,7 +1521,7 @@ pch_gbe_alloc_rx_buffers_pool(struct pch_gbe_adapter *adapter,
 						&rx_ring->rx_buff_pool_logic,
 						GFP_KERNEL);
 	if (!rx_ring->rx_buff_pool) {
-		pr_err("Unable to allocate memory for the receive poll buffer\n");
+		pr_err("Unable to allocate memory for the receive pool buffer\n");
 		return -ENOMEM;
 	}
 	memset(rx_ring->rx_buff_pool, 0, size);
@@ -1644,15 +1640,17 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
 	pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n",
 		 cleaned_count);
 	/* Recover from running out of Tx resources in xmit_frame */
+	spin_lock(&tx_ring->tx_lock);
 	if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) {
 		netif_wake_queue(adapter->netdev);
 		adapter->stats.tx_restart_count++;
 		pr_debug("Tx wake queue\n");
 	}
-	spin_lock(&adapter->tx_queue_lock);
+
 	tx_ring->next_to_clean = i;
-	spin_unlock(&adapter->tx_queue_lock);
+
 	pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean);
+	spin_unlock(&tx_ring->tx_lock);
 	return cleaned;
 }
 
@@ -2043,7 +2041,6 @@ static int pch_gbe_sw_init(struct pch_gbe_adapter *adapter)
 		return -ENOMEM;
 	}
 	spin_lock_init(&adapter->hw.miim_lock);
-	spin_lock_init(&adapter->tx_queue_lock);
 	spin_lock_init(&adapter->stats_lock);
 	spin_lock_init(&adapter->ethtool_lock);
 	atomic_set(&adapter->irq_sem, 0);
@@ -2148,10 +2145,10 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 			 tx_ring->next_to_use, tx_ring->next_to_clean);
 		return NETDEV_TX_BUSY;
 	}
-	spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
 
 	/* CRC,ITAG no support */
 	pch_gbe_tx_queue(adapter, tx_ring, skb);
+	spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
 	return NETDEV_TX_OK;
 }
 

^ permalink raw reply related

* Re: pull request: batman-adv 2012-05-11
From: Sven Eckelmann @ 2012-05-11 22:10 UTC (permalink / raw)
  To: b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, David Miller
In-Reply-To: <20120511.180144.174337959525316777.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]

On Friday, May 11, 2012 06:01:44 PM David Miller wrote:
> From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
> Date: Fri, 11 May 2012 14:21:17 +0200
> 
> > this is a fixed version of the pull request issued on 2012-05-09.
> > 
> > Comments introduced in this patchset are not following the net-tree
> > guidelines. Another patch changing all the already existing comments
> > will follow later.
> > 
> > New exported functions follow the new name convention we discussed so
> > far. A patch renaming all the existing exported functions will follow.
> Pulled, but you have to cleanup the namespace on lots of other
> functions too.
> 
> For example, the packet receive handle register/unregister routines
> you added in this series as well.
> 
> Go through the entire batman-adv stack, and if the function or data
> object is not static, make sure it has a batadv_*() prefix.

The patches for this are posted on the batman-adv mailinglist [1]. I am 
currently splitting this large patch for easier consumption.

Thanks,
	Sven

[1] https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2012-May/007062.html

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH] net/ipv6/af_inet6.c: checkpatch cleanup
From: David Miller @ 2012-05-11 22:07 UTC (permalink / raw)
  To: eldad; +Cc: kuznet, jmorris, yoshfuji, kaber, netdev, linux-kernel
In-Reply-To: <1336248834-25271-1-git-send-email-eldad@fogrefinery.com>

From: Eldad Zack <eldad@fogrefinery.com>
Date: Sat,  5 May 2012 22:13:53 +0200

 ...
> Signed-off-by: Eldad Zack <eldad@fogrefinery.com>

Applied.

^ permalink raw reply

* Re: [PATCH] Net ipv6: Fixed checkpatch errors
From: David Miller @ 2012-05-11 22:06 UTC (permalink / raw)
  To: cristian.chilipirea
  Cc: kuznet, jmorris, yoshfuji, kaber, netdev, linux-kernel,
	daniel.baluta
In-Reply-To: <1336755300-6821-1-git-send-email-cristian.chilipirea@gmail.com>

From: Cristian Chilipirea <cristian.chilipirea@gmail.com>
Date: Fri, 11 May 2012 19:55:00 +0300

> Fixed all of ERROR "foo* bar" should be "foo *bar"
> 
> Signed-off-by: Cristian Chilipirea <cristian.chilipirea@gmail.com>

Don't ever do this.

This has already been fixed in my net-next tree since April 1st, which
is more than a month ago.  What this means is that you wrote your
patch against something other than reality and your patch won't apply
at all.

All non-bug-fix networking patches should be against the net-next
tree, doing otherwise is at your own peril.

^ permalink raw reply

* Re: [PATCH] net: of/phy: fix build error when phylib is built as a module
From: David Miller @ 2012-05-11 22:03 UTC (permalink / raw)
  To: ddaney.cavm
  Cc: sfr, netdev, linux-kernel, paul.gortmaker, rdunlap, linux-next,
	linuxppc-dev, bjorn
In-Reply-To: <4FAD532E.401@gmail.com>

From: David Daney <ddaney.cavm@gmail.com>
Date: Fri, 11 May 2012 10:58:06 -0700

> On 05/11/2012 08:47 AM, Bjørn Mork wrote:
>> CONFIG_OF_MDIO is tristate and will be m if PHYLIB is m.  Use
>> IS_ENABLED macro to prevent build error:
>>
>>   ERROR: "of_mdio_find_bus" [drivers/net/phy/mdio-mux.ko] undefined!
>>
>> Reported-by: Randy Dunlap<rdunlap@xenotime.net>
>> Cc: David Daney<david.daney@cavium.com>
>> Signed-off-by: Bjørn Mork<bjorn@mork.no>
> 
> I was able to reproduce the failure, and this patch both fixes it and
> seems correct, so...
> 
> Acked-by: David Daney<david.daney@cavium.com>

Applied.

^ permalink raw reply

* Re: pull request: batman-adv 2012-05-11
From: David Miller @ 2012-05-11 22:01 UTC (permalink / raw)
  To: ordex-GaUfNO9RBHfsrOwW+9ziJQ
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <1336738892-7401-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Date: Fri, 11 May 2012 14:21:17 +0200

> this is a fixed version of the pull request issued on 2012-05-09.
> 
> Comments introduced in this patchset are not following the net-tree
> guidelines. Another patch changing all the already existing comments will follow
> later. 
> 
> New exported functions follow the new name convention we discussed so far.
> A patch renaming all the existing exported functions will follow.

Pulled, but you have to cleanup the namespace on lots of other
functions too.

For example, the packet receive handle register/unregister routines
you added in this series as well.

Go through the entire batman-adv stack, and if the function or data
object is not static, make sure it has a batadv_*() prefix.

^ permalink raw reply

* Re: [PATCH 00/17] Swap-over-NBD without deadlocking V10
From: Andrew Morton @ 2012-05-11 21:29 UTC (permalink / raw)
  To: David Miller
  Cc: mgorman, linux-mm, netdev, linux-kernel, neilb, a.p.zijlstra,
	michaelc, emunson
In-Reply-To: <20120511.172339.2007927803884694483.davem@davemloft.net>

On Fri, 11 May 2012 17:23:39 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: Mel Gorman <mgorman@suse.de>
> Date: Fri, 11 May 2012 16:45:40 +0100
> 
> > From my point of view, the ideal would be that all the patches go
> > through akpm's tree or yours but that probably will cause merge
> > difficulties.
> > 
> > Any recommendations?
> 
> I know there will be networking side conflicts very soon, it's not a
> matter of 'if' but 'when'.
> 
> But the trick is that I bet the 'mm' and 'slab' folks are in a similar
> situation.
> 
> In any event I'm more than happy to take it all in my tree.

I guess either is OK.  The main thing is to get it all reviewed and
tested, after all.

I can take all the patches once it's all lined up and everyone is
happy.  If the net bits later take significant damage then I can squirt them
at you once the core MM bits are merged.  That would give you a few
days to check them over and get them into Linus.  If that's a problem,
we can hold the net bits over for a cycle.

That's all assuming that the core MM parts are mergeable without the
net parts being merged.  I trust that's the case!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: [PATCH] net: of/phy: fix build error when phylib is built as a module
From: David Miller @ 2012-05-11 21:24 UTC (permalink / raw)
  To: bjorn
  Cc: sfr, david.daney, netdev, linux-kernel, paul.gortmaker, rdunlap,
	linux-next, linuxppc-dev
In-Reply-To: <1336751221-19127-1-git-send-email-bjorn@mork.no>

From: Bjørn Mork <bjorn@mork.no>
Date: Fri, 11 May 2012 17:47:01 +0200

> Should be wrapped into commit 25106022 if it works, to ensure
> bisectability.

Wrapped into?

Commits made to my net-next tree are permanent and irreversible, so we
cannot go back and change a commit.  I never rebase my tree, too many
people use it directly and pull it into their tree, so I'd break their
world if I ever did that.

^ permalink raw reply

* Re: [PATCH 00/17] Swap-over-NBD without deadlocking V10
From: David Miller @ 2012-05-11 21:23 UTC (permalink / raw)
  To: mgorman
  Cc: akpm, linux-mm, netdev, linux-kernel, neilb, a.p.zijlstra,
	michaelc, emunson
In-Reply-To: <20120511154540.GV11435@suse.de>

From: Mel Gorman <mgorman@suse.de>
Date: Fri, 11 May 2012 16:45:40 +0100

> From my point of view, the ideal would be that all the patches go
> through akpm's tree or yours but that probably will cause merge
> difficulties.
> 
> Any recommendations?

I know there will be networking side conflicts very soon, it's not a
matter of 'if' but 'when'.

But the trick is that I bet the 'mm' and 'slab' folks are in a similar
situation.

In any event I'm more than happy to take it all in my tree.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: [PATCH 10/17] netvm: Allow skb allocation to use PFMEMALLOC reserves
From: David Miller @ 2012-05-11 21:17 UTC (permalink / raw)
  To: mgorman
  Cc: akpm, linux-mm, netdev, linux-kernel, neilb, a.p.zijlstra,
	michaelc, emunson
In-Reply-To: <20120511143218.GS11435@suse.de>

From: Mel Gorman <mgorman@suse.de>
Date: Fri, 11 May 2012 15:32:18 +0100

> On Fri, May 11, 2012 at 12:57:40AM -0400, David Miller wrote:
>> Please change this to be a static branch.
> 
> Will do. I renamed memalloc_socks to sk_memalloc_socks, made it a int as
> atomics are unnecessary and I check it directly in a branch instead of a
> static inline. It should be relatively easy for the branch predictor.

No branch predictor can beat an unconditional branch :-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: pch_gbe: oops with vlan (new)
From: Eric Dumazet @ 2012-05-11 21:12 UTC (permalink / raw)
  To: Andy Cress; +Cc: netdev
In-Reply-To: <40680C535D6FE6498883F1640FACD44DDF9105@ka-exchange-1.kontronamerica.local>

On Fri, 2012-05-11 at 13:48 -0700, Andy Cress wrote:
> Folks,
> 
> I am looking for help in debugging a pch_gbe driver oops/abort.
> 
> Kernel: version 2.6.32-220.el6.i686 (RHEL6.2)
> Driver: pch_gbe version 0.91-NAPI  (source tarball we used is at
> https://sendfile.kontron.com/message/24tdUi6MXklnUtBLnOsumq until May
> 16)
> NIC: 0b:00.1 Ethernet controller [0200]: Intel Corporation Platform
> Controller Hub EG20T Gigabit Ethernet Controller [8086:8802] (rev 02)
> 
> Configuration, with VLAN:
>  eth0 (not started)
>  eth0.100 = 192.168.100.1
>  eth0.200 = 192.168.200.1
>  eth0.6  = 192.168.6.1
> 
> When starting the VLAN configuration, then doing a ping test for >= 5
> minutes, I get a kernel oop/abort message as shown below.  This does not
> happen without configuring VLAN.
> Where should I look for possible causes for a transmit queue timeout
> like this?  
> 
> I have contacted the OKI/LAPIS driver authors, but no response so far.
> I thought that this group might be able to comment from similar
> experiences.
> 
> Andy

typical sign of a buggy driver

A quick look in current Linus tree show a non existent synchronization
between ndo_start_xmit and TX completion.

tx completion uses a tx_queue_lock spinlock for nothing but false sense
of correctness.

# find drivers/net/ethernet/oki-semi/pch_gbe -name "*.[ch]"|xargs grep -4 -n tx_queue_lock
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-583-
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-584-/**
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-585- * struct pch_gbe_adapter - board specific private data structure
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-586- * @stats_lock:	Spinlock structure for status
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h:587: * @tx_queue_lock:	Spinlock structure for transmit
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-588- * @ethtool_lock:	Spinlock structure for ethtool
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-589- * @irq_sem:		Semaphore for interrupt
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-590- * @netdev:		Pointer of network device structure
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-591- * @pdev:		Pointer of pci device structure
--
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-608- */
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-609-
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-610-struct pch_gbe_adapter {
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-611-	spinlock_t stats_lock;
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h:612:	spinlock_t tx_queue_lock;
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-613-	spinlock_t ethtool_lock;
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-614-	atomic_t irq_sem;
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-615-	struct net_device *netdev;
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h-616-	struct pci_dev *pdev;
--
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-1641-		netif_wake_queue(adapter->netdev);
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-1642-		adapter->stats.tx_restart_count++;
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-1643-		pr_debug("Tx wake queue\n");
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-1644-	}
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:1645:	spin_lock(&adapter->tx_queue_lock);
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-1646-	tx_ring->next_to_clean = i;
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:1647:	spin_unlock(&adapter->tx_queue_lock);
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-1648-	pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean);
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-1649-	return cleaned;
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-1650-}
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-1651-
--
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-2036-		pr_err("Unable to allocate memory for queues\n");
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-2037-		return -ENOMEM;
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-2038-	}
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-2039-	spin_lock_init(&adapter->hw.miim_lock);
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2040:	spin_lock_init(&adapter->tx_queue_lock);
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-2041-	spin_lock_init(&adapter->stats_lock);
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-2042-	spin_lock_init(&adapter->ethtool_lock);
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-2043-	atomic_set(&adapter->irq_sem, 0);
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c-2044-	pch_gbe_irq_disable(adapter);

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox