Netdev List
 help / color / mirror / Atom feed
* Re: v3 for tcp friends?
From: Li Yu @ 2013-01-23  6:12 UTC (permalink / raw)
  To: Bruce Curtis; +Cc: David Miller, netdev
In-Reply-To: <50FF5592.60008@gmail.com>


Oops, this hang is not since TCP friends patch!

sk_sndbuf_get() is broken by 32 bits integer overflow
because of so large value in net.ipv4.tcp_{rmem,wmem}.

but this hang also can be found in net-next.git
(3.8.0-rc3+), if we run below commands, then all new
TCP connections stop working!

# when TCP friends is disabled
sysctl -w net.ipv4.tcp_rmem="4096 4294967296 4294967296" # 4GB
sysctl -w net.ipv4.tcp_wmem="4096 4294967296 4294967296"

Thanks

Yu

于 2013年01月23日 11:14, Li Yu 写道:
> 于 2013年01月23日 05:08, Bruce Curtis 写道:
>> Thanks, Li
>>
>> Started working on friends again, v4, more soon.
>>
>>
> 
> :)
> 
> I found another odd bug in TCP friends v3, the clients
> may hang at tcp_sendmsg() -> sk_stream_wait_memory() with or
> without my refcnt fix patch.
> 
> Below shell script can reproduce this bug:
> 
> #! /bin/sh -x
> 
> sysctl -w net.ipv4.tcp_rmem="4096 1073741824 1073741824"
> sysctl -w net.ipv4.tcp_wmem="4096 1073741824 1073741824"
> 
> sysctl -w net.ipv4.tcp_friends=1
> 
> msg=64K
> buf=256M
> 
> pkill -9 netserver
> netserver
> netperf -t TCP_STREAM -l 1 -- -m ${msg} -M ${msg} -s ${buf} -S ${buf} -4
> 
> sysctl -w net.ipv4.tcp_friends=0
> pkill -9 netserver
> netserver
> netperf -t TCP_STREAM -l 1 -- -m ${msg} -M ${msg} -s ${buf} -S ${buf} -4
> ##################SCRIPT END###################
> 
> netperf kernel stack is (by cat /proc/$netperf_pid/stack)
> 
> [<ffffffff812ce939>] sk_stream_wait_memory+0x2d9/0x2f0
> [<ffffffff8131460c>] tcp_sendmsg+0xf6c/0x1240
> [<ffffffff8133c117>] inet_sendmsg+0xf7/0x110
> [<ffffffff812bedfd>] sock_sendmsg+0x7d/0xa0
> [<ffffffff812c0e4d>] sys_sendto+0x13d/0x190
> [<ffffffff8138a6c2>] system_call_fastpath+0x16/0x1b
> [<ffffffffffffffff>] 0xffffffffffffffff
> 
> netserver kernel stack is :
> 
> [<ffffffff812c46ae>] sk_wait_data+0x8e/0xe0
> [<ffffffff81315993>] tcp_recvmsg+0x5c3/0xbe0
> [<ffffffff8133aefd>] inet_recvmsg+0xed/0x110
> [<ffffffff812becf4>] sock_recvmsg+0x84/0xb0
> [<ffffffff812c0fae>] sys_recvfrom+0xee/0x170
> [<ffffffff8138a6c2>] system_call_fastpath+0x16/0x1b
> [<ffffffffffffffff>] 0xffffffffffffffff
> 
> And, "netstat -tnp" give us below results:
> 
> Active Internet connections (w/o servers)
> Proto Recv-Q Send-Q Local Address           Foreign Address
> State       PID/Program name
> tcp        0      0 127.0.0.1:35451         127.0.0.1:12865
> ESTABLISHED 2316/netperf
> tcp6       0      0 127.0.0.1:12865         127.0.0.1:35451
> ESTABLISHED 2317/netserver
> 
> (It seems that netperf hangs on the control connection of benchmark)
> 
> I also try to fix this ...
> 
> Thanks
> 
> Yu
> 
>> On Mon, Jan 21, 2013 at 12:55 AM, Li Yu <raise.sail@gmail.com
>> <mailto:raise.sail@gmail.com>> wrote:
>>
>>      2013/1/21 Li Yu <raise.sail@gmail.com <mailto:raise.sail@gmail.com>>
>>
>>          于 2013年01月21日 15:29, Li Yu 写道:
>>
>>              于 2012年09月05日 00:58, David Miller 写道:
>>
>>                  From: Bruce Curtis <brutus@google.com
>>                  <mailto:brutus@google.com>>
>>                  Date: Tue, 4 Sep 2012 08:10:23 -0700
>>
>>                      Will do, issues addressed, I'll get the patch out
>>                      later today or
>>                      tomorrow at the latest.
>>
>>
>>                  Thanks a lot Bruce.
>>                  --
>>                  To unsubscribe from this list: send the line
>>                  "unsubscribe netdev" in
>>                  the body of a message to majordomo@vger.kernel.org
>>                  <mailto:majordomo@vger.kernel.org>
>>                  More majordomo info at
>>                  http://vger.kernel.org/__majordomo-info.html
>>                  <http://vger.kernel.org/majordomo-info.html>
>>
>>
>>
>>              Hi, Bruce,
>>
>>                    I tested the TCP friends, found a bug here:
>>
>>              [  106.541372] Pid: 1765, comm: client Not tainted
>>              3.7.0-rc1+ #25
>>              [  106.543121] Call Trace:
>>              [  106.543950]  [<ffffffff8133d212>]
>>              inet_sock_destruct+0x102/0x1f0
>>              [  106.545687]  [<ffffffff812c38ad>] __sk_free+0x1d/0x110
>>              [  106.547209]  [<ffffffff812c3a1c>] sk_free+0x1c/0x20
>>              [  106.548611]  [<ffffffff8131680c>] tcp_close+0x6c/0x3f0
>>              [  106.549863]  [<ffffffff8133caea>] inet_release+0xda/0xf0
>>              [  106.551134]  [<ffffffff8133ca30>] ? inet_release+0x20/0xf0
>>              [  106.552419]  [<ffffffff8137f3de>] ? mutex_unlock+0xe/0x10
>>              [  106.553658]  [<ffffffff812bf948>] sock_release+0x28/0xa0
>>              [  106.557366]  [<ffffffff812bfd69>] sock_close+0x29/0x30
>>              [  106.558831]  [<ffffffff81128972>] __fput+0x122/0x210
>>              [  106.560541]  [<ffffffff81128a6e>] ____fput+0xe/0x10
>>              [  106.562006]  [<ffffffff8105354e>] task_work_run+0x9e/0xd0
>>              [  106.563285]  [<ffffffff810027e1>] do_notify_resume+0x61/0x70
>>              [  106.564582]  [<ffffffff8138a908>] int_signal+0x12/0x17
>>
>>
>>                    I also backported and tested it on stable kernel
>>              3.7.3/RHEL6
>>              kernel, this bug still exists. It seem that client may close
>>              listening
>>              sockets, may we need to add one reference count for listen
>>              socket
>>              before send its address to peer?
>>
>>
>>          Sorry, I lost an important line of kernel log before above them:
>>
>>          [  106.539367] IPv4: Attempt to release TCP socket in state 10
>>          ffff880074abb5c0
>>
>>          BTW: state 10 = TCP_LISTEN
>>
>>
>>      It seem this patch works for me.
>>
>>      diff --git a/net/ipv4/inet_connection_sock.c
>>      b/net/ipv4/inet_connection_sock.c
>>      index 9641215..a625c02 100644
>>      --- a/net/ipv4/inet_connection_sock.c
>>      +++ b/net/ipv4/inet_connection_sock.c
>>      @@ -623,8 +623,11 @@ struct sock *inet_csk_clone(struct sock *sk,
>>      const struct request_sock *req,
>>                               sock_hold(newsk);
>>                               was = xchg(&req->friend->sk_friend, newsk);
>>                               /* If requester already connect()ed, maybe
>>      sleeping */
>>      -                       if (was && !sock_flag(req->friend, SOCK_DEAD))
>>      -                               sk->sk_state_change(req->friend);
>>      +                       if (was) {
>>      +                               if (!sock_flag(req->friend, SOCK_DEAD))
>>      +
>>      sk->sk_state_change(req->friend);
>>      +                               sock_put(was);
>>      +                       }
>>                       }
>>                       newsk->sk_state = TCP_SYN_RECV;
>>      diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
>>      index 5917485..7a63245 100644
>>      --- a/net/ipv4/tcp_output.c
>>      +++ b/net/ipv4/tcp_output.c
>>      @@ -2277,8 +2277,10 @@ struct sk_buff *tcp_make_synack(struct sock
>>      *sk, struct dst_entry *dst,
>>               memset(&opts, 0, sizeof(opts));
>>               /* Only try to make friends if enabled */
>>      -       if (sysctl_tcp_friends)
>>      +       if (sysctl_tcp_friends) {
>>      +               sock_hold(sk);
>>                       skb->friend = sk;
>>      +       }
>>        #ifdef CONFIG_SYN_COOKIES
>>               if (unlikely(req->cookie_ts))
>>
>>
>>                    And, our TCP friends v4? :)
>>
>>                    Thanks
>>
>>              Yu
>>
>>
>>
> 

^ permalink raw reply

* Re: [PATCH net] r8169: remove the obsolete and incorrect AMD workaround
From: Timo Teras @ 2013-01-23  6:14 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev
In-Reply-To: <20130123000541.GA9515@electric-eye.fr.zoreil.com>

On Wed, 23 Jan 2013 01:05:41 +0100 Francois Romieu
<romieu@fr.zoreil.com> wrote:

> Timo Teräs <timo.teras@iki.fi> :
> [...]
> 
> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
> 
> desc->opts2 is now a bit different in the RxRes path - the only path
> where the patch can be noticed. I hope it won't uncloak something
> else.

I was wondering what you mean by this. But as it seems
rtl8169_rx_vlan_tag() is doing opts2 = 0 in receive path. So the
only effect the workaround would have had was for the error path
packets.

So if this worries you, would it make sense to just unconditionally set
opts2 to zero also in the error path?

Actually, this sounds wrong. Why is rtl8169_rx_vlan_tag() which is
fiddling opts2 invoked *after* rtl8169_mark_to_asic() ? This means it
can overwrite the tag info if the queue is full.

- Timo

^ permalink raw reply

* Re: [PATCH 1/2 net-next] net: fec: add napi support to improve proformance
From: Eric Dumazet @ 2013-01-23  6:21 UTC (permalink / raw)
  To: Frank Li
  Cc: lznuaa, shawn.guo, B38611, davem, linux-arm-kernel, netdev,
	bhutchings, s.hauer
In-Reply-To: <1358914330-3768-1-git-send-email-Frank.Li@freescale.com>

On Wed, 2013-01-23 at 12:12 +0800, Frank Li wrote:
> Add napi support
> 
> Before this patch
> 
>  iperf -s -i 1
>  ------------------------------------------------------------
>  Server listening on TCP port 5001
>  TCP window size: 85.3 KByte (default)
>  ------------------------------------------------------------
>  [  4] local 10.192.242.153 port 5001 connected with 10.192.242.138 port 50004
>  [ ID] Interval       Transfer     Bandwidth
>  [  4]  0.0- 1.0 sec  41.2 MBytes   345 Mbits/sec
>  [  4]  1.0- 2.0 sec  43.7 MBytes   367 Mbits/sec
>  [  4]  2.0- 3.0 sec  42.8 MBytes   359 Mbits/sec
>  [  4]  3.0- 4.0 sec  43.7 MBytes   367 Mbits/sec
>  [  4]  4.0- 5.0 sec  42.7 MBytes   359 Mbits/sec
>  [  4]  5.0- 6.0 sec  43.8 MBytes   367 Mbits/sec
>  [  4]  6.0- 7.0 sec  43.0 MBytes   361 Mbits/sec
> 
> After this patch
>  [  4]  2.0- 3.0 sec  51.6 MBytes   433 Mbits/sec
>  [  4]  3.0- 4.0 sec  51.8 MBytes   435 Mbits/sec
>  [  4]  4.0- 5.0 sec  52.2 MBytes   438 Mbits/sec
>  [  4]  5.0- 6.0 sec  52.1 MBytes   437 Mbits/sec
>  [  4]  6.0- 7.0 sec  52.1 MBytes   437 Mbits/sec
>  [  4]  7.0- 8.0 sec  52.3 MBytes   439 Mbits/sec

Strange, as you still call netif_rx()

NAPI should call netif_receive_skb() instead

^ permalink raw reply

* Re: [PATCH 1/2 net-next] net: fec: add napi support to improve proformance
From: Waskiewicz Jr, Peter P @ 2013-01-23  6:37 UTC (permalink / raw)
  To: Frank Li
  Cc: lznuaa, shawn.guo, B38611, davem, linux-arm-kernel, netdev,
	bhutchings, s.hauer
In-Reply-To: <1358914330-3768-1-git-send-email-Frank.Li@freescale.com>

On Wed, Jan 23, 2013 at 12:12:10PM +0800, Frank Li wrote:

[...]

> diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
> index f52ba33..8fa420c 100644
> --- a/drivers/net/ethernet/freescale/fec.c
> +++ b/drivers/net/ethernet/freescale/fec.c
> @@ -67,6 +67,8 @@
>  #endif
>  
>  #define DRIVER_NAME	"fec"
> +#define FEC_NAPI_WEIGHT	64
> +#define INT32_MAX	0x7FFFFFFF

This seems awfully big as an upper-limit to your ISR processing.  See below
for more comments.

>  
>  /* Pause frame feild and FIFO threshold */
>  #define FEC_ENET_FCE	(1 << 5)
> @@ -565,6 +567,20 @@ fec_timeout(struct net_device *ndev)
>  }
>  
>  static void
> +fec_enet_rx_int_is_enabled(struct net_device *ndev, bool enabled)
> +{
> +	struct fec_enet_private *fep = netdev_priv(ndev);
> +	uint    int_events;
> +
> +	int_events = readl(fep->hwp + FEC_IMASK);
> +	if (enabled)
> +		int_events |= FEC_ENET_RXF;
> +	else
> +		int_events &= ~FEC_ENET_RXF;
> +	writel(int_events, fep->hwp + FEC_IMASK);
> +}
> +
> +static void
>  fec_enet_tx(struct net_device *ndev)
>  {
>  	struct	fec_enet_private *fep;
> @@ -656,8 +672,8 @@ fec_enet_tx(struct net_device *ndev)
>   * not been given to the system, we just set the empty indicator,
>   * effectively tossing the packet.
>   */
> -static void
> -fec_enet_rx(struct net_device *ndev)
> +static int
> +fec_enet_rx(struct net_device *ndev, int budget)
>  {
>  	struct fec_enet_private *fep = netdev_priv(ndev);
>  	const struct platform_device_id *id_entry =
> @@ -667,13 +683,12 @@ fec_enet_rx(struct net_device *ndev)
>  	struct	sk_buff	*skb;
>  	ushort	pkt_len;
>  	__u8 *data;
> +	int	pkt_received = 0;
>  
>  #ifdef CONFIG_M532x
>  	flush_cache_all();
>  #endif
>  
> -	spin_lock(&fep->hw_lock);
> -
>  	/* First, grab all of the stats for the incoming packet.
>  	 * These get messed up if we get called due to a busy condition.
>  	 */
> @@ -681,6 +696,10 @@ fec_enet_rx(struct net_device *ndev)
>  
>  	while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) {
>  
> +		if (pkt_received >= budget)
> +			break;
> +		pkt_received++;
> +

This seems wrong given how it's called from the ISR when NAPI isn't being
used.  If you have continuous packets coming in, you won't exit your ISR
and release your spin_lock until you hit INT32_MAX.

>  		/* Since we have allocated space to hold a complete frame,
>  		 * the last indicator should be set.
>  		 */
> @@ -796,7 +815,7 @@ rx_processing_done:
>  	}
>  	fep->cur_rx = bdp;
>  
> -	spin_unlock(&fep->hw_lock);
> +	return pkt_received;
>  }
>  
>  static irqreturn_t
> @@ -805,6 +824,7 @@ fec_enet_interrupt(int irq, void *dev_id)
>  	struct net_device *ndev = dev_id;
>  	struct fec_enet_private *fep = netdev_priv(ndev);
>  	uint int_events;
> +	ulong flags;
>  	irqreturn_t ret = IRQ_NONE;
>  
>  	do {
> @@ -813,7 +833,18 @@ fec_enet_interrupt(int irq, void *dev_id)
>  
>  		if (int_events & FEC_ENET_RXF) {
>  			ret = IRQ_HANDLED;
> -			fec_enet_rx(ndev);
> +			spin_lock_irqsave(&fep->hw_lock, flags);
> +
> +			if (fep->use_napi) {
> +				/* Disable the RX interrupt */
> +				if (napi_schedule_prep(&fep->napi)) {
> +					fec_enet_rx_int_is_enabled(ndev, false);
> +					__napi_schedule(&fep->napi);
> +				}
> +			} else
> +				fec_enet_rx(ndev, INT32_MAX);

As mentioned above, you may want to check this a bit closer since this
can run for a very, very long time if you have constant packets flowing
when not using NAPI.

Also, the code formatting here should also have braces around the else
clause since the if clause has them.

> +
> +			spin_unlock_irqrestore(&fep->hw_lock, flags);
>  		}
>  
>  		/* Transmit OK, or non-fatal error. Update the buffer
> @@ -834,7 +865,16 @@ fec_enet_interrupt(int irq, void *dev_id)
>  	return ret;
>  }
>  
> -
> +static int fec_enet_rx_napi(struct napi_struct *napi, int budget)
> +{
> +	struct net_device *ndev = napi->dev;
> +	int pkgs = fec_enet_rx(ndev, budget);
> +	if (pkgs < budget) {
> +		napi_complete(napi);
> +		fec_enet_rx_int_is_enabled(ndev, true);
> +	}
> +	return pkgs;
> +}
>  
>  /* ------------------------------------------------------------------------- */
>  static void fec_get_mac(struct net_device *ndev)
> @@ -1392,6 +1432,9 @@ fec_enet_open(struct net_device *ndev)
>  	struct fec_enet_private *fep = netdev_priv(ndev);
>  	int ret;
>  
> +	if (fep->use_napi)
> +		napi_enable(&fep->napi);
> +
>  	/* I should reset the ring buffers here, but I don't yet know
>  	 * a simple way to do that.
>  	 */
> @@ -1604,6 +1647,11 @@ static int fec_enet_init(struct net_device *ndev)
>  	ndev->netdev_ops = &fec_netdev_ops;
>  	ndev->ethtool_ops = &fec_enet_ethtool_ops;
>  
> +	if (fep->use_napi) {
> +		fec_enet_rx_int_is_enabled(ndev, false);
> +		netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, fep->napi_weight);

Make sure not to exceed 80 characters here.

> +	}
> +
>  	/* Initialize the receive buffer descriptors. */
>  	bdp = fep->rx_bd_base;
>  	for (i = 0; i < RX_RING_SIZE; i++) {
> @@ -1698,6 +1746,7 @@ fec_probe(struct platform_device *pdev)
>  	static int dev_id;
>  	struct pinctrl *pinctrl;
>  	struct regulator *reg_phy;
> +	struct device_node *np = pdev->dev.of_node;
>  
>  	of_id = of_match_device(fec_dt_ids, &pdev->dev);
>  	if (of_id)
> @@ -1811,6 +1860,11 @@ fec_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> +	fep->use_napi = !of_property_read_bool(np, "disable_napi");
> +
> +	if (of_property_read_u32(np, "napi_weight", &fep->napi_weight))
> +		fep->napi_weight = FEC_NAPI_WEIGHT; /*using default value*/
> +
>  	fec_reset_phy(pdev);
>  
>  	ret = fec_enet_init(ndev);
> diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
> index 2ebedaf..31fcdd0 100644
> --- a/drivers/net/ethernet/freescale/fec.h
> +++ b/drivers/net/ethernet/freescale/fec.h
> @@ -249,6 +249,10 @@ struct fec_enet_private {
>  	int	bufdesc_ex;
>  	int	pause_flag;
>  
> +	struct	napi_struct napi;
> +	int	napi_weight;
> +	bool	use_napi;
> +
>  	struct ptp_clock *ptp_clock;
>  	struct ptp_clock_info ptp_caps;
>  	unsigned long last_overflow_check;
> -- 
> 1.7.1
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: v3 for tcp friends?
From: Eric Dumazet @ 2013-01-23  6:46 UTC (permalink / raw)
  To: Li Yu; +Cc: Bruce Curtis, David Miller, netdev
In-Reply-To: <50FF7F64.2060902@gmail.com>

On Wed, 2013-01-23 at 14:12 +0800, Li Yu wrote:
> Oops, this hang is not since TCP friends patch!
> 
> sk_sndbuf_get() is broken by 32 bits integer overflow
> because of so large value in net.ipv4.tcp_{rmem,wmem}.
> 
> but this hang also can be found in net-next.git
> (3.8.0-rc3+), if we run below commands, then all new
> TCP connections stop working!
> 
> # when TCP friends is disabled
> sysctl -w net.ipv4.tcp_rmem="4096 4294967296 4294967296" # 4GB
> sysctl -w net.ipv4.tcp_wmem="4096 4294967296 4294967296"

Right we need to make sure we dont overflow.

Try the following fix :

diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index a25e1d2..1459145 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -549,14 +549,16 @@ static struct ctl_table ipv4_table[] = {
 		.data		= &sysctl_tcp_wmem,
 		.maxlen		= sizeof(sysctl_tcp_wmem),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec
+		.extra1		= &zero,
+		.proc_handler	= proc_dointvec_minmax
 	},
 	{
 		.procname	= "tcp_rmem",
 		.data		= &sysctl_tcp_rmem,
 		.maxlen		= sizeof(sysctl_tcp_rmem),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec
+		.extra1		= &zero,
+		.proc_handler	= proc_dointvec_minmax
 	},
 	{
 		.procname	= "tcp_app_win",

^ permalink raw reply related

* [PATCH v2 net-next 1/2] be2net: Modify GPL Marking in all source files.
From: sarveshwar.bandi @ 2013-01-23  6:52 UTC (permalink / raw)
  To: davem; +Cc: netdev, Vasundhara Volam, Sarveshwar Bandi

From: Vasundhara Volam <vasundhara.volam@emulex.com>

The following modifications have been made to copyright:
- years of copyright extended to include 2013
- specify EMULEX and SLI as trademarks of Emulex corporation
- specify emulex website
- Added a more detailed disclaimer " ALL EXPRESS OR IMPLIED CONDITIONS,
REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT,
ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO
BE LEGALLY INVALID."

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be.h         |   25 ++++++++++++++----------
 drivers/net/ethernet/emulex/benet/be_cmds.c    |   25 ++++++++++++++----------
 drivers/net/ethernet/emulex/benet/be_cmds.h    |   25 ++++++++++++++----------
 drivers/net/ethernet/emulex/benet/be_ethtool.c |   25 ++++++++++++++----------
 drivers/net/ethernet/emulex/benet/be_hw.h      |   25 ++++++++++++++----------
 drivers/net/ethernet/emulex/benet/be_main.c    |   25 ++++++++++++++----------
 drivers/net/ethernet/emulex/benet/be_roce.c    |   25 ++++++++++++++----------
 drivers/net/ethernet/emulex/benet/be_roce.h    |   25 ++++++++++++++----------
 8 files changed, 120 insertions(+), 80 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index 4eba17b..f27fe8e 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -1,18 +1,23 @@
 /*
- * Copyright (C) 2005 - 2011 Emulex
- * All rights reserved.
+ * This file is part of the Linux NIC driver for Emulex OneConnect CNA.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.  The full GNU General
- * Public License is included in this distribution in the file called COPYING.
+ * Copyright (C) 2005-2013 Emulex. All rights reserved.
  *
- * Contact Information:
+ * EMULEX and SLI are trademarks of Emulex.
+ * www.emulex.com
  * linux-drivers@emulex.com
  *
- * Emulex
- * 3333 Susan Street
- * Costa Mesa, CA 92626
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE
+ * EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+ * See the GNU General Public License for more details, a copy of which
+ * can be found in the file COPYING included with this package
  */
 
 #ifndef BE_H
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 8a250c3..d1222a4 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -1,18 +1,23 @@
 /*
- * Copyright (C) 2005 - 2011 Emulex
- * All rights reserved.
+ * This file is part of the Linux NIC driver for Emulex OneConnect CNA.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.  The full GNU General
- * Public License is included in this distribution in the file called COPYING.
+ * Copyright (C) 2005-2013 Emulex. All rights reserved.
  *
- * Contact Information:
+ * EMULEX and SLI are trademarks of Emulex.
+ * www.emulex.com
  * linux-drivers@emulex.com
  *
- * Emulex
- * 3333 Susan Street
- * Costa Mesa, CA 92626
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE
+ * EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+ * See the GNU General Public License for more details, a copy of which
+ * can be found in the file COPYING included with this package
  */
 
 #include <linux/module.h>
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index d6552e1..9bd9aa5 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -1,18 +1,23 @@
 /*
- * Copyright (C) 2005 - 2011 Emulex
- * All rights reserved.
+ * This file is part of the Linux NIC driver for Emulex OneConnect CNA.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.  The full GNU General
- * Public License is included in this distribution in the file called COPYING.
+ * Copyright (C) 2005-2013 Emulex. All rights reserved.
  *
- * Contact Information:
+ * EMULEX and SLI are trademarks of Emulex.
+ * www.emulex.com
  * linux-drivers@emulex.com
  *
- * Emulex
- * 3333 Susan Street
- * Costa Mesa, CA 92626
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE
+ * EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+ * See the GNU General Public License for more details, a copy of which
+ * can be found in the file COPYING included with this package
  */
 
 /*
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
index 76b302f..6ea33a0 100644
--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
+++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
@@ -1,18 +1,23 @@
 /*
- * Copyright (C) 2005 - 2011 Emulex
- * All rights reserved.
+ * This file is part of the Linux NIC driver for Emulex OneConnect CNA.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.  The full GNU General
- * Public License is included in this distribution in the file called COPYING.
+ * Copyright (C) 2005-2013 Emulex. All rights reserved.
  *
- * Contact Information:
+ * EMULEX and SLI are trademarks of Emulex.
+ * www.emulex.com
  * linux-drivers@emulex.com
  *
- * Emulex
- * 3333 Susan Street
- * Costa Mesa, CA 92626
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE
+ * EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+ * See the GNU General Public License for more details, a copy of which
+ * can be found in the file COPYING included with this package
  */
 
 #include "be.h"
diff --git a/drivers/net/ethernet/emulex/benet/be_hw.h b/drivers/net/ethernet/emulex/benet/be_hw.h
index 541d453..e490f73 100644
--- a/drivers/net/ethernet/emulex/benet/be_hw.h
+++ b/drivers/net/ethernet/emulex/benet/be_hw.h
@@ -1,18 +1,23 @@
 /*
- * Copyright (C) 2005 - 2011 Emulex
- * All rights reserved.
+ * This file is part of the Linux NIC driver for Emulex OneConnect CNA.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.  The full GNU General
- * Public License is included in this distribution in the file called COPYING.
+ * Copyright (C) 2005-2013 Emulex. All rights reserved.
  *
- * Contact Information:
+ * EMULEX and SLI are trademarks of Emulex.
+ * www.emulex.com
  * linux-drivers@emulex.com
  *
- * Emulex
- * 3333 Susan Street
- * Costa Mesa, CA 92626
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE
+ * EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+ * See the GNU General Public License for more details, a copy of which
+ * can be found in the file COPYING included with this package
  */
 
 /********* Mailbox door bell *************/
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 5c99570..b1cc3f2 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1,18 +1,23 @@
 /*
- * Copyright (C) 2005 - 2011 Emulex
- * All rights reserved.
+ * This file is part of the Linux NIC driver for Emulex OneConnect CNA.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.  The full GNU General
- * Public License is included in this distribution in the file called COPYING.
+ * Copyright (C) 2005-2013 Emulex. All rights reserved.
  *
- * Contact Information:
+ * EMULEX and SLI are trademarks of Emulex.
+ * www.emulex.com
  * linux-drivers@emulex.com
  *
- * Emulex
- * 3333 Susan Street
- * Costa Mesa, CA 92626
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE
+ * EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+ * See the GNU General Public License for more details, a copy of which
+ * can be found in the file COPYING included with this package
  */
 
 #include <linux/prefetch.h>
diff --git a/drivers/net/ethernet/emulex/benet/be_roce.c b/drivers/net/ethernet/emulex/benet/be_roce.c
index 55d32aa..ebc39a9 100644
--- a/drivers/net/ethernet/emulex/benet/be_roce.c
+++ b/drivers/net/ethernet/emulex/benet/be_roce.c
@@ -1,18 +1,23 @@
 /*
- * Copyright (C) 2005 - 2011 Emulex
- * All rights reserved.
+ * This file is part of the Linux NIC driver for Emulex OneConnect CNA.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation. The full GNU General
- * Public License is included in this distribution in the file called COPYING.
+ * Copyright (C) 2005-2013 Emulex. All rights reserved.
  *
- * Contact Information:
+ * EMULEX and SLI are trademarks of Emulex.
+ * www.emulex.com
  * linux-drivers@emulex.com
  *
- * Emulex
- * 3333 Susan Street
- * Costa Mesa, CA 92626
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE
+ * EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+ * See the GNU General Public License for more details, a copy of which
+ * can be found in the file COPYING included with this package
  */
 
 #include <linux/mutex.h>
diff --git a/drivers/net/ethernet/emulex/benet/be_roce.h b/drivers/net/ethernet/emulex/benet/be_roce.h
index db4ea80..3b57976 100644
--- a/drivers/net/ethernet/emulex/benet/be_roce.h
+++ b/drivers/net/ethernet/emulex/benet/be_roce.h
@@ -1,18 +1,23 @@
 /*
- * Copyright (C) 2005 - 2011 Emulex
- * All rights reserved.
+ * This file is part of the Linux NIC driver for Emulex OneConnect CNA.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation. The full GNU General
- * Public License is included in this distribution in the file called COPYING.
+ * Copyright (C) 2005-2013 Emulex. All rights reserved.
  *
- * Contact Information:
+ * EMULEX and SLI are trademarks of Emulex.
+ * www.emulex.com
  * linux-drivers@emulex.com
  *
- * Emulex
- * 3333 Susan Street
- * Costa Mesa, CA 92626
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE
+ * EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+ * See the GNU General Public License for more details, a copy of which
+ * can be found in the file COPYING included with this package
  */
 
 #ifndef BE_ROCE_H
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v2 net-next 2/2] be2net: Updating Module Author string and log message string to "Emulex Corporation"
From: sarveshwar.bandi @ 2013-01-23  6:52 UTC (permalink / raw)
  To: davem; +Cc: netdev, Sarveshwar Bandi
In-Reply-To: <1358923924-28902-1-git-send-email-sarveshwar.bandi@emulex.com>

From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>

Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be.h      |    8 ++++----
 drivers/net/ethernet/emulex/benet/be_main.c |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index f27fe8e..6b3b606 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -41,13 +41,13 @@
 
 #define DRV_VER			"4.4.161.0u"
 #define DRV_NAME		"be2net"
-#define BE_NAME			"ServerEngines BladeEngine2 10Gbps NIC"
-#define BE3_NAME		"ServerEngines BladeEngine3 10Gbps NIC"
-#define OC_NAME			"Emulex OneConnect 10Gbps NIC"
+#define BE_NAME			"Emulex BladeEngine2"
+#define BE3_NAME		"Emulex BladeEngine3"
+#define OC_NAME			"Emulex OneConnect"
 #define OC_NAME_BE		OC_NAME	"(be3)"
 #define OC_NAME_LANCER		OC_NAME "(Lancer)"
 #define OC_NAME_SH		OC_NAME "(Skyhawk)"
-#define DRV_DESC		"ServerEngines BladeEngine 10Gbps NIC Driver"
+#define DRV_DESC		"Emulex OneConnect 10Gbps NIC Driver"
 
 #define BE_VENDOR_ID 		0x19a2
 #define EMULEX_VENDOR_ID	0x10df
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index b1cc3f2..6718339 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -30,7 +30,7 @@
 MODULE_VERSION(DRV_VER);
 MODULE_DEVICE_TABLE(pci, be_dev_ids);
 MODULE_DESCRIPTION(DRV_DESC " " DRV_VER);
-MODULE_AUTHOR("ServerEngines Corporation");
+MODULE_AUTHOR("Emulex Corporation");
 MODULE_LICENSE("GPL");
 
 static unsigned int num_vfs;
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH v2 net-next 1/2] be2net: Modify GPL Marking in all source files.
From: David Miller @ 2013-01-23  7:06 UTC (permalink / raw)
  To: sarveshwar.bandi; +Cc: netdev, vasundhara.volam
In-Reply-To: <c09a42d1-150f-4d78-b2c4-2bedec3bd577@CMEXHTCAS2.ad.emulex.com>

From: <sarveshwar.bandi@emulex.com>
Date: Wed, 23 Jan 2013 12:22:03 +0530

> From: Vasundhara Volam <vasundhara.volam@emulex.com>
> 
> The following modifications have been made to copyright:
> - years of copyright extended to include 2013
> - specify EMULEX and SLI as trademarks of Emulex corporation
> - specify emulex website
> - Added a more detailed disclaimer " ALL EXPRESS OR IMPLIED CONDITIONS,
> REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT,
> ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO
> BE LEGALLY INVALID."
> 
> Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
> Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>

You're just essentially reading the contents of the patch, that's
not satisfactory.

In particular, the problem is that you aren't explaining why you're
making all of these changes.

There needs to be justification for copyright changes like this,
you are not providing them.

^ permalink raw reply

* [Patch net-next 2/2] net: add RCU annotation to sk_dst_cache field
From: Cong Wang @ 2013-01-23  7:09 UTC (permalink / raw)
  To: netdev; +Cc: Eric Dumazet, David S. Miller, Cong Wang
In-Reply-To: <1358924991-1602-1-git-send-email-amwang@redhat.com>

From: Cong Wang <amwang@redhat.com>

sock->sk_dst_cache is protected by RCU.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>

---
diff --git a/include/net/sock.h b/include/net/sock.h
index 5a34e2f..c4b64c6 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -337,7 +337,7 @@ struct sock {
 #endif
 	unsigned long 		sk_flags;
 	struct dst_entry	*sk_rx_dst;
-	struct dst_entry	*sk_dst_cache;
+	struct dst_entry __rcu	*sk_dst_cache;
 	spinlock_t		sk_dst_lock;
 	atomic_t		sk_wmem_alloc;
 	atomic_t		sk_omem_alloc;

^ permalink raw reply related

* [Patch net-next 1/2] decnet: use correct RCU API to deref sk_dst_cache field
From: Cong Wang @ 2013-01-23  7:09 UTC (permalink / raw)
  To: netdev; +Cc: linux-decnet-user, Eric Dumazet, David S. Miller, Cong Wang

From: Cong Wang <amwang@redhat.com>

sock->sk_dst_cache is protected by RCU, therefore we should
use __sk_dst_get() to deref it once we lock the sock.

This fixes several sparse warnings.

Cc: linux-decnet-user@lists.sourceforge.net
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>

---
diff --git a/include/net/dn_route.h b/include/net/dn_route.h
index 4f7d6a1..2e9d317 100644
--- a/include/net/dn_route.h
+++ b/include/net/dn_route.h
@@ -16,7 +16,7 @@
 *******************************************************************************/
 
 extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, gfp_t pri);
-extern int dn_route_output_sock(struct dst_entry **pprt, struct flowidn *, struct sock *sk, int flags);
+extern int dn_route_output_sock(struct dst_entry __rcu **pprt, struct flowidn *, struct sock *sk, int flags);
 extern int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb);
 extern void dn_rt_cache_flush(int delay);
 
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 307c322..64d9843 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -909,6 +909,7 @@ static int __dn_connect(struct sock *sk, struct sockaddr_dn *addr, int addrlen,
 	struct dn_scp *scp = DN_SK(sk);
 	int err = -EISCONN;
 	struct flowidn fld;
+	struct dst_entry *dst;
 
 	if (sock->state == SS_CONNECTED)
 		goto out;
@@ -955,10 +956,11 @@ static int __dn_connect(struct sock *sk, struct sockaddr_dn *addr, int addrlen,
 	fld.flowidn_proto = DNPROTO_NSP;
 	if (dn_route_output_sock(&sk->sk_dst_cache, &fld, sk, flags) < 0)
 		goto out;
-	sk->sk_route_caps = sk->sk_dst_cache->dev->features;
+	dst = __sk_dst_get(sk);
+	sk->sk_route_caps = dst->dev->features;
 	sock->state = SS_CONNECTING;
 	scp->state = DN_CI;
-	scp->segsize_loc = dst_metric_advmss(sk->sk_dst_cache);
+	scp->segsize_loc = dst_metric_advmss(dst);
 
 	dn_nsp_send_conninit(sk, NSP_CI);
 	err = -EINPROGRESS;
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c
index 8a96047c..1aaa51e 100644
--- a/net/decnet/dn_nsp_out.c
+++ b/net/decnet/dn_nsp_out.c
@@ -598,7 +598,7 @@ void dn_nsp_send_disc(struct sock *sk, unsigned char msgflg,
 	if (reason == 0)
 		reason = le16_to_cpu(scp->discdata_out.opt_status);
 
-	dn_nsp_do_disc(sk, msgflg, reason, gfp, sk->sk_dst_cache, ddl,
+	dn_nsp_do_disc(sk, msgflg, reason, gfp, __sk_dst_get(sk), ddl,
 		scp->discdata_out.opt_data, scp->addrrem, scp->addrloc);
 }
 
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index b57419c..1550028 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1282,7 +1282,7 @@ static int dn_route_output_key(struct dst_entry **pprt, struct flowidn *flp, int
 	return err;
 }
 
-int dn_route_output_sock(struct dst_entry **pprt, struct flowidn *fl, struct sock *sk, int flags)
+int dn_route_output_sock(struct dst_entry __rcu **pprt, struct flowidn *fl, struct sock *sk, int flags)
 {
 	int err;
 

^ permalink raw reply related

* Re: 3.7.3+:  Bad paging request in ip_rcv_finish while running NFS traffic.
From: Ben Greear @ 2013-01-23  7:14 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1358921493.12374.737.camel@edumazet-glaptop>

On 01/22/2013 10:11 PM, Eric Dumazet wrote:
> On Tue, 2013-01-22 at 18:32 -0800, Ben Greear wrote:
>
>> diff --git a/net/core/dst.c b/net/core/dst.c
>> index ee6153e..234b168 100644
>> --- a/net/core/dst.c
>> +++ b/net/core/dst.c
>> @@ -245,6 +245,7 @@ again:
>>                   dst->ops->destroy(dst);
>>           if (dst->dev)
>>                   dev_put(dst->dev);
>> +       dst->input = dst->output = 0xdeadbeef;
>>           kmem_cache_free(dst->ops->kmem_cachep, dst);
>
> Great !
>
> You could comment the kmem_cache_free() as well to get better chances to
> hit the bug, and maybe start a bisection to find the faulty commit ?

I suspect the bug goes back at least as far as 3.3.  And since
I need the NFS patches for this test case, bisecting will be pure hell.

I'll work on some more code instrumentation tomorrow.

One thing that came to mind while I was looking at the code today:

How are the non-ref-counted dst objects used safely?  Any chance
that tearing down the IP protocol on a device (or deleting a device)
could delete a dst that is referenced by an skb (and thus crashes as
I see)?

Thanks,
Ben

-- 
Ben Greear <greearb-my8/4N5VtI7c+919tysfdA@public.gmane.org>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: v3 for tcp friends?
From: Li Yu @ 2013-01-23  7:21 UTC (permalink / raw)
  To: netdev
In-Reply-To: <1358923606.12374.746.camel@edumazet-glaptop>

于 2013年01月23日 14:46, Eric Dumazet 写道:
> On Wed, 2013-01-23 at 14:12 +0800, Li Yu wrote:
>> Oops, this hang is not since TCP friends patch!
>>
>> sk_sndbuf_get() is broken by 32 bits integer overflow
>> because of so large value in net.ipv4.tcp_{rmem,wmem}.
>>
>> but this hang also can be found in net-next.git
>> (3.8.0-rc3+), if we run below commands, then all new
>> TCP connections stop working!
>>
>> # when TCP friends is disabled
>> sysctl -w net.ipv4.tcp_rmem="4096 4294967296 4294967296" # 4GB
>> sysctl -w net.ipv4.tcp_wmem="4096 4294967296 4294967296"
>
> Right we need to make sure we dont overflow.
>
> Try the following fix :
>
> diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
> index a25e1d2..1459145 100644
> --- a/net/ipv4/sysctl_net_ipv4.c
> +++ b/net/ipv4/sysctl_net_ipv4.c
> @@ -549,14 +549,16 @@ static struct ctl_table ipv4_table[] = {
>   		.data		= &sysctl_tcp_wmem,
>   		.maxlen		= sizeof(sysctl_tcp_wmem),
>   		.mode		= 0644,
> -		.proc_handler	= proc_dointvec
> +		.extra1		= &zero,
> +		.proc_handler	= proc_dointvec_minmax
>   	},
>   	{
>   		.procname	= "tcp_rmem",
>   		.data		= &sysctl_tcp_rmem,
>   		.maxlen		= sizeof(sysctl_tcp_rmem),
>   		.mode		= 0644,
> -		.proc_handler	= proc_dointvec
> +		.extra1		= &zero,
> +		.proc_handler	= proc_dointvec_minmax
>   	},
>   	{
>   		.procname	= "tcp_app_win",
>
>
>
Thanks for so quick reply, I will test it soon.

however I suspect whether this patch could fix overflow if we merged TCP 
friends patch in future.

With TCP friends, we have source like below, or TCP friends should care 
this ?

static inline int sk_sndbuf_get(const struct sock *sk)
{
         if (sk->sk_friend)
                 return sk->sk_sndbuf + sk->sk_friend->sk_rcvbuf;
         else
                 return sk->sk_sndbuf;
}

static inline bool sk_stream_memory_free(const struct sock *sk)
{
         return sk_wmem_queued_get(sk) < sk_sndbuf_get(sk);
}

So sk_sndbuf_get() still may be overflow when we have right value in 
net.ipv4.tcp_{rmem,wmem}.

Thanks

^ permalink raw reply

* Re: [PATCH 1/2 net-next] net: fec: add napi support to improve proformance
From: Sascha Hauer @ 2013-01-23  7:26 UTC (permalink / raw)
  To: Frank Li
  Cc: lznuaa, shawn.guo, B38611, davem, linux-arm-kernel, netdev,
	bhutchings
In-Reply-To: <1358914330-3768-1-git-send-email-Frank.Li@freescale.com>

On Wed, Jan 23, 2013 at 12:12:10PM +0800, Frank Li wrote:
> Add napi support
> 
> Before this patch
> 
>  iperf -s -i 1
>  ------------------------------------------------------------
>  Server listening on TCP port 5001
>  TCP window size: 85.3 KByte (default)
>  ------------------------------------------------------------
>  [  4] local 10.192.242.153 port 5001 connected with 10.192.242.138 port 50004
>  [ ID] Interval       Transfer     Bandwidth
>  [  4]  0.0- 1.0 sec  41.2 MBytes   345 Mbits/sec
>  [  4]  1.0- 2.0 sec  43.7 MBytes   367 Mbits/sec
>  [  4]  2.0- 3.0 sec  42.8 MBytes   359 Mbits/sec
>  [  4]  3.0- 4.0 sec  43.7 MBytes   367 Mbits/sec
>  [  4]  4.0- 5.0 sec  42.7 MBytes   359 Mbits/sec
>  [  4]  5.0- 6.0 sec  43.8 MBytes   367 Mbits/sec
>  [  4]  6.0- 7.0 sec  43.0 MBytes   361 Mbits/sec
> 
> After this patch
>  [  4]  2.0- 3.0 sec  51.6 MBytes   433 Mbits/sec
>  [  4]  3.0- 4.0 sec  51.8 MBytes   435 Mbits/sec
>  [  4]  4.0- 5.0 sec  52.2 MBytes   438 Mbits/sec
>  [  4]  5.0- 6.0 sec  52.1 MBytes   437 Mbits/sec
>  [  4]  6.0- 7.0 sec  52.1 MBytes   437 Mbits/sec
>  [  4]  7.0- 8.0 sec  52.3 MBytes   439 Mbits/sec
> 
> Signed-off-by: Frank Li <Frank.Li@freescale.com>
> Signed-off-by: Fugang Duan <B38611@freescale.com>
> ---
>  drivers/net/ethernet/freescale/fec.c |   68 ++++++++++++++++++++++++++++++---
>  drivers/net/ethernet/freescale/fec.h |    4 ++
>  2 files changed, 65 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
> index f52ba33..8fa420c 100644
> --- a/drivers/net/ethernet/freescale/fec.c
> +++ b/drivers/net/ethernet/freescale/fec.c
> @@ -67,6 +67,8 @@
>  #endif
>  
>  #define DRIVER_NAME	"fec"
> +#define FEC_NAPI_WEIGHT	64
> +#define INT32_MAX	0x7FFFFFFF
>  
>  /* Pause frame feild and FIFO threshold */
>  #define FEC_ENET_FCE	(1 << 5)
> @@ -565,6 +567,20 @@ fec_timeout(struct net_device *ndev)
>  }
>  
>  static void
> +fec_enet_rx_int_is_enabled(struct net_device *ndev, bool enabled)
> +{
> +	struct fec_enet_private *fep = netdev_priv(ndev);
> +	uint    int_events;
> +
> +	int_events = readl(fep->hwp + FEC_IMASK);
> +	if (enabled)
> +		int_events |= FEC_ENET_RXF;
> +	else
> +		int_events &= ~FEC_ENET_RXF;
> +	writel(int_events, fep->hwp + FEC_IMASK);
> +}
> +
> +static void
>  fec_enet_tx(struct net_device *ndev)
>  {
>  	struct	fec_enet_private *fep;
> @@ -656,8 +672,8 @@ fec_enet_tx(struct net_device *ndev)
>   * not been given to the system, we just set the empty indicator,
>   * effectively tossing the packet.
>   */
> -static void
> -fec_enet_rx(struct net_device *ndev)
> +static int
> +fec_enet_rx(struct net_device *ndev, int budget)
>  {
>  	struct fec_enet_private *fep = netdev_priv(ndev);
>  	const struct platform_device_id *id_entry =
> @@ -667,13 +683,12 @@ fec_enet_rx(struct net_device *ndev)
>  	struct	sk_buff	*skb;
>  	ushort	pkt_len;
>  	__u8 *data;
> +	int	pkt_received = 0;
>  
>  #ifdef CONFIG_M532x
>  	flush_cache_all();
>  #endif
>  
> -	spin_lock(&fep->hw_lock);
> -
>  	/* First, grab all of the stats for the incoming packet.
>  	 * These get messed up if we get called due to a busy condition.
>  	 */
> @@ -681,6 +696,10 @@ fec_enet_rx(struct net_device *ndev)
>  
>  	while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) {
>  
> +		if (pkt_received >= budget)
> +			break;
> +		pkt_received++;
> +
>  		/* Since we have allocated space to hold a complete frame,
>  		 * the last indicator should be set.
>  		 */
> @@ -796,7 +815,7 @@ rx_processing_done:
>  	}
>  	fep->cur_rx = bdp;
>  
> -	spin_unlock(&fep->hw_lock);
> +	return pkt_received;
>  }
>  
>  static irqreturn_t
> @@ -805,6 +824,7 @@ fec_enet_interrupt(int irq, void *dev_id)
>  	struct net_device *ndev = dev_id;
>  	struct fec_enet_private *fep = netdev_priv(ndev);
>  	uint int_events;
> +	ulong flags;
>  	irqreturn_t ret = IRQ_NONE;
>  
>  	do {
> @@ -813,7 +833,18 @@ fec_enet_interrupt(int irq, void *dev_id)
>  
>  		if (int_events & FEC_ENET_RXF) {
>  			ret = IRQ_HANDLED;
> -			fec_enet_rx(ndev);
> +			spin_lock_irqsave(&fep->hw_lock, flags);
> +
> +			if (fep->use_napi) {
> +				/* Disable the RX interrupt */
> +				if (napi_schedule_prep(&fep->napi)) {
> +					fec_enet_rx_int_is_enabled(ndev, false);
> +					__napi_schedule(&fep->napi);
> +				}
> +			} else
> +				fec_enet_rx(ndev, INT32_MAX);
> +
> +			spin_unlock_irqrestore(&fep->hw_lock, flags);
>  		}
>  
>  		/* Transmit OK, or non-fatal error. Update the buffer
> @@ -834,7 +865,16 @@ fec_enet_interrupt(int irq, void *dev_id)
>  	return ret;
>  }
>  
> -
> +static int fec_enet_rx_napi(struct napi_struct *napi, int budget)
> +{
> +	struct net_device *ndev = napi->dev;
> +	int pkgs = fec_enet_rx(ndev, budget);
> +	if (pkgs < budget) {
> +		napi_complete(napi);
> +		fec_enet_rx_int_is_enabled(ndev, true);
> +	}
> +	return pkgs;
> +}
>  
>  /* ------------------------------------------------------------------------- */
>  static void fec_get_mac(struct net_device *ndev)
> @@ -1392,6 +1432,9 @@ fec_enet_open(struct net_device *ndev)
>  	struct fec_enet_private *fep = netdev_priv(ndev);
>  	int ret;
>  
> +	if (fep->use_napi)
> +		napi_enable(&fep->napi);
> +
>  	/* I should reset the ring buffers here, but I don't yet know
>  	 * a simple way to do that.
>  	 */
> @@ -1604,6 +1647,11 @@ static int fec_enet_init(struct net_device *ndev)
>  	ndev->netdev_ops = &fec_netdev_ops;
>  	ndev->ethtool_ops = &fec_enet_ethtool_ops;
>  
> +	if (fep->use_napi) {
> +		fec_enet_rx_int_is_enabled(ndev, false);
> +		netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, fep->napi_weight);
> +	}
> +
>  	/* Initialize the receive buffer descriptors. */
>  	bdp = fep->rx_bd_base;
>  	for (i = 0; i < RX_RING_SIZE; i++) {
> @@ -1698,6 +1746,7 @@ fec_probe(struct platform_device *pdev)
>  	static int dev_id;
>  	struct pinctrl *pinctrl;
>  	struct regulator *reg_phy;
> +	struct device_node *np = pdev->dev.of_node;
>  
>  	of_id = of_match_device(fec_dt_ids, &pdev->dev);
>  	if (of_id)
> @@ -1811,6 +1860,11 @@ fec_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> +	fep->use_napi = !of_property_read_bool(np, "disable_napi");
> +
> +	if (of_property_read_u32(np, "napi_weight", &fep->napi_weight))
> +		fep->napi_weight = FEC_NAPI_WEIGHT; /*using default value*/

This comment seems rather unnecessary. Also it should be

	/* space left and right /*

devicetree bindings should use '-' instead of '_'. The binding
Documentation should be in the patch adding the bindings. Also
make sure the devicetree parsing is outside of the path for platform
based probing.

With this particular binding I'm unsure it should exist anyway since
it's configuration rather than hardware description. The devicetree
normally is for hardware description only.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply

* RE: [PATCH v2 net-next 1/2] be2net: Modify GPL Marking in all source files.
From: Bandi,Sarveshwar @ 2013-01-23  7:28 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, Vasundhara, Volam
In-Reply-To: <20130123.020618.638425092581514860.davem@davemloft.net>

Dave,
Can I assume that the first 3 points are acceptable (copyright being extended, adding EMULEX/SLI as trademarks, and adding website information)?

As for the last one about disclaimer, most driver had it all the time and benet did not. It  mentions section 15 "Disclaimer of Warranty" of gpl license explicitly 
(http://www.gnu.org/licenses/gpl.html). 

Is there an issue with this?

Thanks,
Sarvesh

-----Original Message-----
From: David Miller [mailto:davem@davemloft.net] 
Sent: Wednesday, January 23, 2013 12:36 PM
To: Bandi,Sarveshwar
Cc: netdev@vger.kernel.org; Vasundhara, Volam
Subject: Re: [PATCH v2 net-next 1/2] be2net: Modify GPL Marking in all source files.

From: <sarveshwar.bandi@emulex.com>
Date: Wed, 23 Jan 2013 12:22:03 +0530

> From: Vasundhara Volam <vasundhara.volam@emulex.com>
> 
> The following modifications have been made to copyright:
> - years of copyright extended to include 2013
> - specify EMULEX and SLI as trademarks of Emulex corporation
> - specify emulex website
> - Added a more detailed disclaimer " ALL EXPRESS OR IMPLIED 
> CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED 
> WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR 
> NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH 
> DISCLAIMERS ARE HELD TO BE LEGALLY INVALID."
> 
> Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
> Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>

You're just essentially reading the contents of the patch, that's not satisfactory.

In particular, the problem is that you aren't explaining why you're making all of these changes.

There needs to be justification for copyright changes like this, you are not providing them.

^ permalink raw reply

* [Patch net-next] netpoll: add RCU annotation to npinfo field
From: Cong Wang @ 2013-01-23  7:29 UTC (permalink / raw)
  To: netdev; +Cc: Eric Dumazet, David S. Miller, Cong Wang

From: Cong Wang <amwang@redhat.com>

dev->npinfo is protected by RCU.

This fixes the following sparse warnings:

net/core/netpoll.c:177:48: error: incompatible types in comparison expression (different address spaces)
net/core/netpoll.c:200:35: error: incompatible types in comparison expression (different address spaces)
net/core/netpoll.c:221:35: error: incompatible types in comparison expression (different address spaces)
net/core/netpoll.c:327:18: error: incompatible types in comparison expression (different address spaces)

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>

---
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 549f5ad..85b0949 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1272,7 +1272,7 @@ struct net_device {
 	void (*destructor)(struct net_device *dev);
 
 #ifdef CONFIG_NETPOLL
-	struct netpoll_info	*npinfo;
+	struct netpoll_info __rcu	*npinfo;
 #endif
 
 #ifdef CONFIG_NET_NS

^ permalink raw reply related

* [PATCH] sctp: set association state to established in dupcook_a handler
From: xufengzhang.main @ 2013-01-23  7:38 UTC (permalink / raw)
  To: vyasevich, sri, nhorman, davem; +Cc: linux-sctp, netdev, linux-kernel

From: Xufeng Zhang <xufeng.zhang@windriver.com>

While sctp handling a duplicate COOKIE-ECHO and the action is
'Association restart', sctp_sf_do_dupcook_a() will processing
the unexpected COOKIE-ECHO for peer restart, but it does not set
the association state to SCTP_STATE_ESTABLISHED, so the association
could stuck in SCTP_STATE_SHUTDOWN_PENDING state forever.
This violates the sctp specification:
  RFC 4960 5.2.4. Handle a COOKIE ECHO when a TCB Exists
  Action
  A) In this case, the peer may have restarted. .....
     After this, the endpoint shall enter the ESTABLISHED state.

Fix this problem by adding a SCTP_CMD_NEW_STATE cmd to the command
list so as to set the restart association to SCTP_STATE_ESTABLISHED
state properly.

Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
---
 net/sctp/sm_statefuns.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 618ec7e..528f1c8 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1779,6 +1779,8 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(struct net *net,
 
 	/* Update the content of current association. */
 	sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc));
+	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
+			SCTP_STATE(SCTP_STATE_ESTABLISHED));
 	sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
 	sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev));
 	return SCTP_DISPOSITION_CONSUME;
-- 
1.7.0.2

^ permalink raw reply related

* Re: [PATCH 1/2 net-next] net: fec: add napi support to improve proformance
From: Frank Li @ 2013-01-23  7:37 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Frank Li, shawn.guo, B38611, davem, linux-arm-kernel, netdev,
	bhutchings, s.hauer
In-Reply-To: <1358922071.12374.743.camel@edumazet-glaptop>

2013/1/23 Eric Dumazet <eric.dumazet@gmail.com>:
> On Wed, 2013-01-23 at 12:12 +0800, Frank Li wrote:
>> Add napi support
>>
>> Before this patch
>>
>>  iperf -s -i 1
>>  ------------------------------------------------------------
>>  Server listening on TCP port 5001
>>  TCP window size: 85.3 KByte (default)
>>  ------------------------------------------------------------
>>  [  4] local 10.192.242.153 port 5001 connected with 10.192.242.138 port 50004
>>  [ ID] Interval       Transfer     Bandwidth
>>  [  4]  0.0- 1.0 sec  41.2 MBytes   345 Mbits/sec
>>  [  4]  1.0- 2.0 sec  43.7 MBytes   367 Mbits/sec
>>  [  4]  2.0- 3.0 sec  42.8 MBytes   359 Mbits/sec
>>  [  4]  3.0- 4.0 sec  43.7 MBytes   367 Mbits/sec
>>  [  4]  4.0- 5.0 sec  42.7 MBytes   359 Mbits/sec
>>  [  4]  5.0- 6.0 sec  43.8 MBytes   367 Mbits/sec
>>  [  4]  6.0- 7.0 sec  43.0 MBytes   361 Mbits/sec
>>
>> After this patch
>>  [  4]  2.0- 3.0 sec  51.6 MBytes   433 Mbits/sec
>>  [  4]  3.0- 4.0 sec  51.8 MBytes   435 Mbits/sec
>>  [  4]  4.0- 5.0 sec  52.2 MBytes   438 Mbits/sec
>>  [  4]  5.0- 6.0 sec  52.1 MBytes   437 Mbits/sec
>>  [  4]  6.0- 7.0 sec  52.1 MBytes   437 Mbits/sec
>>  [  4]  7.0- 8.0 sec  52.3 MBytes   439 Mbits/sec
>
> Strange, as you still call netif_rx()
>
> NAPI should call netif_receive_skb() instead
>

Thank you point out.
After re-test, I found performance is almost no change if use netif_receive_skb.
I am not sure if it is my NAPI implement problem.

napi_gro_received is better than netif_receive_skb, but worse than netif_rx.

>From performance point view,

netif_rx                    --- fastest
napi_gro_received   --- middle, near to netif_rx
netif_receive_skb    --- slowest, almost the same as original no-napi version.

Do you have any idea about this phenomena?

best regards
Frank Li

>
>

^ permalink raw reply

* Re: [PATCH] CMAC support for CryptoAPI, fixed patch issues, indent, and testmgr build issues
From: Steffen Klassert @ 2013-01-23  7:41 UTC (permalink / raw)
  To: Tom St Denis; +Cc: linux-kernel, Herbert Xu, David Miller, linux-crypto, netdev
In-Reply-To: <436404741.94502.1358773048618.JavaMail.root@elliptictech.com>

(Cc netdev@vger.kernel.org)

On Mon, Jan 21, 2013 at 07:57:28AM -0500, Tom St Denis wrote:
> Hey all,
> 
> Here's an updated patch which addresses a couple of build issues and coding style complaints.  
> 
> I still can't get it to run via testmgr I get 
> 
> [  162.407807] alg: No test for cmac(aes) (cmac(aes-generic))
> 
> Despite the fact I have an entry for cmac(aes) (much like xcbc(aes)...).
> 
> Here's the patch to bring 3.8-rc4 up with CMAC ...
> 

As already pointed out by David Dillow, the above comments should go
after the '---' separator. Please use the subject line and commit
message from the previous version of this patch when you resend,
this was ok.

> Signed-off-by: Tom St Denis <tstdenis@elliptictech.com>
> 
> ---
>  crypto/Kconfig               |   8 ++
>  crypto/Makefile              |   1 +
>  crypto/cmac.c                | 317 +++++++++++++++++++++++++++++++++++++++++++
>  crypto/testmgr.c             |   9 ++
>  crypto/testmgr.h             |  52 +++++++
>  include/uapi/linux/pfkeyv2.h |   1 +
>  net/xfrm/xfrm_algo.c         |  17 +++
>  7 files changed, 405 insertions(+)
>  create mode 100644 crypto/cmac.c
> 
> diff --git a/crypto/Kconfig b/crypto/Kconfig
> index 4641d95..5ac2c7f 100644
> --- a/crypto/Kconfig
> +++ b/crypto/Kconfig
> @@ -301,6 +301,14 @@ config CRYPTO_XCBC
>  		http://csrc.nist.gov/encryption/modes/proposedmodes/
>  		 xcbc-mac/xcbc-mac-spec.pdf
>  
> +config CRYPTO_CMAC
> +	tristate "CMAC support"
> +	depends on EXPERIMENTAL

CONFIG_EXPERIMENTAL is going to be removed in linux-next,
please remove this dependency.

> +	select CRYPTO_HASH
> +	select CRYPTO_MANAGER
> +	help
> +	  NIST CMAC cipher based MAC
> +

Please add some more information to the help text. Everybody who knows
what a 'NIST CMAC cipher based MAC' is will not need this help text, all
the others are left with almost no information. This help text is for
users in the first place, not for developers. So it should contain some
informations about this cipher and/or some pointers where to find
informations.

Please Cc me on your next version because we plan to route your
patch via the ipsec-next tree into the mainline.

Thanks!

^ permalink raw reply

* Re: [PATCH 1/2 net-next] net: fec: add napi support to improve proformance
From: Frank Li @ 2013-01-23  7:44 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Frank Li, shawn.guo, B38611, davem, linux-arm-kernel, netdev,
	bhutchings
In-Reply-To: <20130123072635.GO1906@pengutronix.de>

> This comment seems rather unnecessary. Also it should be
>
>         /* space left and right /*
>
> devicetree bindings should use '-' instead of '_'. The binding
> Documentation should be in the patch adding the bindings. Also
> make sure the devicetree parsing is outside of the path for platform
> based probing.
>
> With this particular binding I'm unsure it should exist anyway since
> it's configuration rather than hardware description. The devicetree
> normally is for hardware description only.
>

What's your opinion?
Using module parameter, device-tree to config it or the other method?

best regards
Frank Li

^ permalink raw reply

* Re: [PATCH 1/2 net-next] net: fec: add napi support to improve proformance
From: David Miller @ 2013-01-23  7:52 UTC (permalink / raw)
  To: lznuaa
  Cc: s.hauer, Frank.Li, shawn.guo, B38611, linux-arm-kernel, netdev,
	bhutchings
In-Reply-To: <CAHrpEqQ3-prqJaCmt1hfOr4GzDVyuRNvko1SCyQZHdALhHkhkw@mail.gmail.com>


NAPI should not be configurable, all device drivers should be NAPI
only.

^ permalink raw reply

* Re: [PATCH 1/2 net-next] net: fec: add napi support to improve proformance
From: Sascha Hauer @ 2013-01-23  7:53 UTC (permalink / raw)
  To: Frank Li
  Cc: Frank Li, shawn.guo, B38611, davem, linux-arm-kernel, netdev,
	bhutchings
In-Reply-To: <CAHrpEqQ3-prqJaCmt1hfOr4GzDVyuRNvko1SCyQZHdALhHkhkw@mail.gmail.com>

On Wed, Jan 23, 2013 at 03:44:53PM +0800, Frank Li wrote:
> > This comment seems rather unnecessary. Also it should be
> >
> >         /* space left and right /*
> >
> > devicetree bindings should use '-' instead of '_'. The binding
> > Documentation should be in the patch adding the bindings. Also
> > make sure the devicetree parsing is outside of the path for platform
> > based probing.
> >
> > With this particular binding I'm unsure it should exist anyway since
> > it's configuration rather than hardware description. The devicetree
> > normally is for hardware description only.
> >
> 
> What's your opinion?
> Using module parameter, device-tree to config it or the other method?

Why do you want to make it configurable anyway? So far no other driver
seems to need this. My suggestion is to make it unconfigurable.

For adding properties like this to the devicetree remember that they
should be OS agnostic. napi is a implementation detail relevant only
for Linux. And even Linux may decide to drop napi support in favour for
something better in the future.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply

* Re: [PATCH 1/2 net-next] net: fec: add napi support to improve proformance
From: Frank Li @ 2013-01-23  7:56 UTC (permalink / raw)
  To: Waskiewicz Jr, Peter P
  Cc: Frank Li, shawn.guo, B38611, davem, linux-arm-kernel, netdev,
	bhutchings, s.hauer
In-Reply-To: <20130123063744.GA16454@ppwaskie-mobl2.amr.corp.intel.com>

2013/1/23 Waskiewicz Jr, Peter P <peter.p.waskiewicz.jr@intel.com>:
> On Wed, Jan 23, 2013 at 12:12:10PM +0800, Frank Li wrote:
>
> [...]
>
>> diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
>> index f52ba33..8fa420c 100644
>> --- a/drivers/net/ethernet/freescale/fec.c
>> +++ b/drivers/net/ethernet/freescale/fec.c
>> @@ -67,6 +67,8 @@
>>  #endif
>>
>>  #define DRIVER_NAME  "fec"
>> +#define FEC_NAPI_WEIGHT      64
>> +#define INT32_MAX    0x7FFFFFFF
>
> This seems awfully big as an upper-limit to your ISR processing.  See below
> for more comments.
>
>>
>>  /* Pause frame feild and FIFO threshold */
>>  #define FEC_ENET_FCE (1 << 5)
>> @@ -565,6 +567,20 @@ fec_timeout(struct net_device *ndev)
>>  }
>>
>>  static void
>> +fec_enet_rx_int_is_enabled(struct net_device *ndev, bool enabled)
>> +{
>> +     struct fec_enet_private *fep = netdev_priv(ndev);
>> +     uint    int_events;
>> +
>> +     int_events = readl(fep->hwp + FEC_IMASK);
>> +     if (enabled)
>> +             int_events |= FEC_ENET_RXF;
>> +     else
>> +             int_events &= ~FEC_ENET_RXF;
>> +     writel(int_events, fep->hwp + FEC_IMASK);
>> +}
>> +
>> +static void
>>  fec_enet_tx(struct net_device *ndev)
>>  {
>>       struct  fec_enet_private *fep;
>> @@ -656,8 +672,8 @@ fec_enet_tx(struct net_device *ndev)
>>   * not been given to the system, we just set the empty indicator,
>>   * effectively tossing the packet.
>>   */
>> -static void
>> -fec_enet_rx(struct net_device *ndev)
>> +static int
>> +fec_enet_rx(struct net_device *ndev, int budget)
>>  {
>>       struct fec_enet_private *fep = netdev_priv(ndev);
>>       const struct platform_device_id *id_entry =
>> @@ -667,13 +683,12 @@ fec_enet_rx(struct net_device *ndev)
>>       struct  sk_buff *skb;
>>       ushort  pkt_len;
>>       __u8 *data;
>> +     int     pkt_received = 0;
>>
>>  #ifdef CONFIG_M532x
>>       flush_cache_all();
>>  #endif
>>
>> -     spin_lock(&fep->hw_lock);
>> -
>>       /* First, grab all of the stats for the incoming packet.
>>        * These get messed up if we get called due to a busy condition.
>>        */
>> @@ -681,6 +696,10 @@ fec_enet_rx(struct net_device *ndev)
>>
>>       while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) {
>>
>> +             if (pkt_received >= budget)
>> +                     break;
>> +             pkt_received++;
>> +
>
> This seems wrong given how it's called from the ISR when NAPI isn't being
> used.  If you have continuous packets coming in, you won't exit your ISR
> and release your spin_lock until you hit INT32_MAX.

I just the keep original execute path if napi disabled.
Original code will progress all packages in queue.
FEC is 1G network, must receive speed around 500Mbps.
CPU speed is much faster than received package.
and RX queue only 8 entry, I think it is impossible to run loop more than 10.

why I set to INT32_MAX is keep the original execute path when napi disable.
INT32_MAX is impossible value to exit loop for this case.

>
>>               /* Since we have allocated space to hold a complete frame,
>>                * the last indicator should be set.
>>                */
>> @@ -796,7 +815,7 @@ rx_processing_done:
>>       }
>>       fep->cur_rx = bdp;
>>
>> -     spin_unlock(&fep->hw_lock);
>> +     return pkt_received;
>>  }
>>
>>  static irqreturn_t
>> @@ -805,6 +824,7 @@ fec_enet_interrupt(int irq, void *dev_id)
>>       struct net_device *ndev = dev_id;
>>       struct fec_enet_private *fep = netdev_priv(ndev);
>>       uint int_events;
>> +     ulong flags;
>>       irqreturn_t ret = IRQ_NONE;
>>
>>       do {
>> @@ -813,7 +833,18 @@ fec_enet_interrupt(int irq, void *dev_id)
>>
>>               if (int_events & FEC_ENET_RXF) {
>>                       ret = IRQ_HANDLED;
>> -                     fec_enet_rx(ndev);
>> +                     spin_lock_irqsave(&fep->hw_lock, flags);
>> +
>> +                     if (fep->use_napi) {
>> +                             /* Disable the RX interrupt */
>> +                             if (napi_schedule_prep(&fep->napi)) {
>> +                                     fec_enet_rx_int_is_enabled(ndev, false);
>> +                                     __napi_schedule(&fep->napi);
>> +                             }
>> +                     } else
>> +                             fec_enet_rx(ndev, INT32_MAX);
>
> As mentioned above, you may want to check this a bit closer since this
> can run for a very, very long time if you have constant packets flowing
> when not using NAPI.
>
> Also, the code formatting here should also have braces around the else
> clause since the if clause has them.

Okay, I will update in v2 patch.

>
>> +
>> +                     spin_unlock_irqrestore(&fep->hw_lock, flags);
>>               }
>>
>>               /* Transmit OK, or non-fatal error. Update the buffer
>> @@ -834,7 +865,16 @@ fec_enet_interrupt(int irq, void *dev_id)
>>       return ret;
>>  }
>>
>> -
>> +static int fec_enet_rx_napi(struct napi_struct *napi, int budget)
>> +{
>> +     struct net_device *ndev = napi->dev;
>> +     int pkgs = fec_enet_rx(ndev, budget);
>> +     if (pkgs < budget) {
>> +             napi_complete(napi);
>> +             fec_enet_rx_int_is_enabled(ndev, true);
>> +     }
>> +     return pkgs;
>> +}
>>
>>  /* ------------------------------------------------------------------------- */
>>  static void fec_get_mac(struct net_device *ndev)
>> @@ -1392,6 +1432,9 @@ fec_enet_open(struct net_device *ndev)
>>       struct fec_enet_private *fep = netdev_priv(ndev);
>>       int ret;
>>
>> +     if (fep->use_napi)
>> +             napi_enable(&fep->napi);
>> +
>>       /* I should reset the ring buffers here, but I don't yet know
>>        * a simple way to do that.
>>        */
>> @@ -1604,6 +1647,11 @@ static int fec_enet_init(struct net_device *ndev)
>>       ndev->netdev_ops = &fec_netdev_ops;
>>       ndev->ethtool_ops = &fec_enet_ethtool_ops;
>>
>> +     if (fep->use_napi) {
>> +             fec_enet_rx_int_is_enabled(ndev, false);
>> +             netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, fep->napi_weight);
>
> Make sure not to exceed 80 characters here.
>

Okay, I will update in v2 patch.

>> +     }
>> +
>>       /* Initialize the receive buffer descriptors. */
>>       bdp = fep->rx_bd_base;
>>       for (i = 0; i < RX_RING_SIZE; i++) {
>> @@ -1698,6 +1746,7 @@ fec_probe(struct platform_device *pdev)
>>       static int dev_id;
>>       struct pinctrl *pinctrl;
>>       struct regulator *reg_phy;
>> +     struct device_node *np = pdev->dev.of_node;
>>
>>       of_id = of_match_device(fec_dt_ids, &pdev->dev);
>>       if (of_id)
>> @@ -1811,6 +1860,11 @@ fec_probe(struct platform_device *pdev)
>>               }
>>       }
>>
>> +     fep->use_napi = !of_property_read_bool(np, "disable_napi");
>> +
>> +     if (of_property_read_u32(np, "napi_weight", &fep->napi_weight))
>> +             fep->napi_weight = FEC_NAPI_WEIGHT; /*using default value*/
>> +
>>       fec_reset_phy(pdev);
>>
>>       ret = fec_enet_init(ndev);
>> diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
>> index 2ebedaf..31fcdd0 100644
>> --- a/drivers/net/ethernet/freescale/fec.h
>> +++ b/drivers/net/ethernet/freescale/fec.h
>> @@ -249,6 +249,10 @@ struct fec_enet_private {
>>       int     bufdesc_ex;
>>       int     pause_flag;
>>
>> +     struct  napi_struct napi;
>> +     int     napi_weight;
>> +     bool    use_napi;
>> +
>>       struct ptp_clock *ptp_clock;
>>       struct ptp_clock_info ptp_caps;
>>       unsigned long last_overflow_check;
>> --
>> 1.7.1
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: v3 for tcp friends?
From: Li Yu @ 2013-01-23  7:58 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Eric Dumazet, Bruce Curtis
In-Reply-To: <50FF8F75.4000903@gmail.com>

于 2013年01月23日 15:21, Li Yu 写道:
> 于 2013年01月23日 14:46, Eric Dumazet 写道:
>> On Wed, 2013-01-23 at 14:12 +0800, Li Yu wrote:
>>> Oops, this hang is not since TCP friends patch!
>>>
>>> sk_sndbuf_get() is broken by 32 bits integer overflow
>>> because of so large value in net.ipv4.tcp_{rmem,wmem}.
>>>
>>> but this hang also can be found in net-next.git
>>> (3.8.0-rc3+), if we run below commands, then all new
>>> TCP connections stop working!
>>>
>>> # when TCP friends is disabled
>>> sysctl -w net.ipv4.tcp_rmem="4096 4294967296 4294967296" # 4GB
>>> sysctl -w net.ipv4.tcp_wmem="4096 4294967296 4294967296"
>>
>> Right we need to make sure we dont overflow.
>>
>> Try the following fix :
>>
>> diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
>> index a25e1d2..1459145 100644
>> --- a/net/ipv4/sysctl_net_ipv4.c
>> +++ b/net/ipv4/sysctl_net_ipv4.c
>> @@ -549,14 +549,16 @@ static struct ctl_table ipv4_table[] = {
>>           .data        = &sysctl_tcp_wmem,
>>           .maxlen        = sizeof(sysctl_tcp_wmem),
>>           .mode        = 0644,
>> -        .proc_handler    = proc_dointvec
>> +        .extra1        = &zero,
>> +        .proc_handler    = proc_dointvec_minmax
>>       },
>>       {
>>           .procname    = "tcp_rmem",
>>           .data        = &sysctl_tcp_rmem,
>>           .maxlen        = sizeof(sysctl_tcp_rmem),
>>           .mode        = 0644,
>> -        .proc_handler    = proc_dointvec
>> +        .extra1        = &zero,
>> +        .proc_handler    = proc_dointvec_minmax
>>       },
>>       {
>>           .procname    = "tcp_app_win",
>>
>>
>>
> Thanks for so quick reply, I will test it soon.
>
> however I suspect whether this patch could fix overflow if we merged TCP
> friends patch in future.
>

Tested on 3.7.0-rc1+, but bug is still alive
with disabled TCP friends ...

Thanks

Yu

> With TCP friends, we have source like below, or TCP friends should care
> this ?
>
> static inline int sk_sndbuf_get(const struct sock *sk)
> {
>          if (sk->sk_friend)
>                  return sk->sk_sndbuf + sk->sk_friend->sk_rcvbuf;
>          else
>                  return sk->sk_sndbuf;
> }
>
> static inline bool sk_stream_memory_free(const struct sock *sk)
> {
>          return sk_wmem_queued_get(sk) < sk_sndbuf_get(sk);
> }
>
> So sk_sndbuf_get() still may be overflow when we have right value in
> net.ipv4.tcp_{rmem,wmem}.
>
> Thanks

^ permalink raw reply

* Re: [PATCH 1/2 net-next] net: fec: add napi support to improve proformance
From: Frank Li @ 2013-01-23  8:00 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Frank Li, shawn.guo, B38611, davem, linux-arm-kernel, netdev,
	bhutchings
In-Reply-To: <20130123075323.GU1906@pengutronix.de>

> Why do you want to make it configurable anyway? So far no other driver
> seems to need this. My suggestion is to make it unconfigurable.
>
> For adding properties like this to the devicetree remember that they
> should be OS agnostic. napi is a implementation detail relevant only
> for Linux. And even Linux may decide to drop napi support in favour for
> something better in the future.
>

Okay, I will remove such config in v2 version.

best regards
Frank Li

^ permalink raw reply

* pull request (net-next): ipsec-next 2013-01-23
From: Steffen Klassert @ 2013-01-23  8:18 UTC (permalink / raw)
  To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev

1) Add a statistic counter for invalid output states and
   remove a superfluous state valid check, from Li RongQing.

2) Probe for asynchronous block ciphers instead of synchronous block
   ciphers to make the asynchronous variants available even if no
   synchronous block ciphers are found, from Jussi Kivilinna.

3) Make rfc3686 asynchronous block cipher and make use of
   the new asynchronous variant, from Jussi Kivilinna.

4) Replace some rwlocks by rcu, from Cong Wang.

5) Remove some unused defines.

Please pull or let me know if there are problems.

Thanks!

The following changes since commit 483f777266f5da205459c290994bd3cda5f1f6bc:

  drivers/net: remove orphaned references to micro channel (2013-01-06 21:13:33 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git testing

for you to fetch changes up to 02bfd8ecf5cf980ede53e30a903b102924fc32f4:

  xfrm: Remove unused defines (2013-01-21 11:19:04 +0100)

----------------------------------------------------------------
Cong Wang (3):
      xfrm: replace rwlock on xfrm_state_afinfo with rcu
      xfrm: replace rwlock on xfrm_km_list with rcu
      xfrm: use separated locks to protect pointers of struct xfrm_state_afinfo

Jussi Kivilinna (3):
      xfrm_algo: probe asynchronous block ciphers instead of synchronous
      crypto: ctr - make rfc3686 asynchronous block cipher
      crypto: aesni-intel - remove rfc3686(ctr(aes)), utilize rfc3686 from ctr-module instead

Li RongQing (1):
      xfrm: removes a superfluous check and add a statistic

Steffen Klassert (1):
      xfrm: Remove unused defines

 arch/x86/crypto/aesni-intel_glue.c |   37 --------
 crypto/ctr.c                       |  173 +++++++++++++++++++++++-------------
 crypto/tcrypt.c                    |    4 +
 crypto/tcrypt.h                    |    1 +
 include/net/xfrm.h                 |    4 -
 include/uapi/linux/snmp.h          |    1 +
 net/xfrm/xfrm_algo.c               |    3 +-
 net/xfrm/xfrm_output.c             |    6 ++
 net/xfrm/xfrm_proc.c               |    1 +
 net/xfrm/xfrm_state.c              |  131 +++++++++++++--------------
 10 files changed, 185 insertions(+), 176 deletions(-)

^ 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