Netdev List
 help / color / mirror / Atom feed
* Re: [Pv-drivers] [PATCH 1/1] VSOCK: Introduce VM Sockets
From: Greg KH @ 2013-01-26  0:22 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: acking, Neil Horman, pv-drivers, netdev, linux-kernel,
	virtualization, davem
In-Reply-To: <2312112.Fz0qTjDOJB@dtor-d630.eng.vmware.com>

On Fri, Jan 25, 2013 at 04:15:19PM -0800, Dmitry Torokhov wrote:
> Hi Neil,
> 
> On Friday, January 25, 2013 06:59:53 PM Neil Horman wrote:
> > On Fri, Jan 25, 2013 at 09:37:50AM -0800, acking@vmware.com wrote:
> > > +
> > > +config VMWARE_VSOCK
> > > +	tristate "Virtual Socket protocol"
> > > +	depends on VMWARE_VMCI
> > 
> > What is CONFIG_VMWARE_VMCI?  I don't find that in any Kconfig in the tree?
> > 
> > I''m still looking over the rest, but I get build issues if I just remove
> > the dependency.
> 
> VMCI is in linux-next at the moment.

>From the char-misc-next git tree to be specific.

thanks,

greg k-h

^ permalink raw reply

* Re: [Pv-drivers] [PATCH 1/1] VSOCK: Introduce VM Sockets
From: Dmitry Torokhov @ 2013-01-26  0:15 UTC (permalink / raw)
  To: pv-drivers
  Cc: Neil Horman, acking, netdev, linux-kernel, virtualization, gregkh,
	davem
In-Reply-To: <20130125235953.GA4833@hmsreliant.think-freely.org>

Hi Neil,

On Friday, January 25, 2013 06:59:53 PM Neil Horman wrote:
> On Fri, Jan 25, 2013 at 09:37:50AM -0800, acking@vmware.com wrote:
> > +
> > +config VMWARE_VSOCK
> > +	tristate "Virtual Socket protocol"
> > +	depends on VMWARE_VMCI
> 
> What is CONFIG_VMWARE_VMCI?  I don't find that in any Kconfig in the tree?
> 
> I''m still looking over the rest, but I get build issues if I just remove
> the dependency.

VMCI is in linux-next at the moment.

Thanks,
Dmitry

^ permalink raw reply

* Re: [PATCH 1/1] VSOCK: Introduce VM Sockets
From: Neil Horman @ 2013-01-25 23:59 UTC (permalink / raw)
  To: acking; +Cc: netdev, linux-kernel, virtualization, gregkh, davem, pv-drivers
In-Reply-To: <1359135470-30677-2-git-send-email-acking@vmware.com>

On Fri, Jan 25, 2013 at 09:37:50AM -0800, acking@vmware.com wrote:
> From: Andy King <acking@vmware.com>
> 
> VM Sockets allows communication between virtual machines and the hypervisor.
> User level applications both in a virtual machine and on the host can use the
> VM Sockets API, which facilitates fast and efficient communication between
> guest virtual machines and their host.  A socket address family, designed to be
> compatible with UDP and TCP at the interface level, is provided.
> 
> Today, VM Sockets is used by various VMware Tools components inside the guest
> for zero-config, network-less access to VMware host services.  In addition to
> this, VMware's users are using VM Sockets for various applications, where
> network access of the virtual machine is restricted or non-existent.  Examples
> of this are VMs communicating with device proxies for proprietary hardware
> running as host applications and automated testing of applications running
> within virtual machines.
> 
> The VMware VM Sockets are similar to other socket types, like Berkeley UNIX
> socket interface.  The VM Sockets module supports both connection-oriented
> stream sockets like TCP, and connectionless datagram sockets like UDP. The VM
> Sockets protocol family is defined as "AF_VSOCK" and the socket operations
> split for SOCK_DGRAM and SOCK_STREAM.
> 
> For additional information about the use of VM Sockets, please refer to the VM
> Sockets Programming Guide available at:
> 
> https://www.vmware.com/support/developer/vmci-sdk/
> 
> Signed-off-by: George Zhang <georgezhang@vmware.com>
> Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
> Signed-off-by: Andy king <acking@vmware.com>
> index 0000000..95e2568
> --- /dev/null
> +++ b/net/vmw_vsock/Kconfig
> @@ -0,0 +1,14 @@
> +#
> +# Vsock protocol
> +#
> +
> +config VMWARE_VSOCK
> +	tristate "Virtual Socket protocol"
> +	depends on VMWARE_VMCI
What is CONFIG_VMWARE_VMCI?  I don't find that in any Kconfig in the tree?

I''m still looking over the rest, but I get build issues if I just remove the
dependency.

Neil

^ permalink raw reply

* Re: [PATCH 15/19] sunrpc: don't warn for unused variable 'buf'
From: Arnd Bergmann @ 2013-01-25 23:45 UTC (permalink / raw)
  To: Myklebust, Trond
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	J. Bruce Fields,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <4FA345DA4F4AE44899BD2B03EEEC2FA91833C205-UCI0kNdgLrHLJmV3vhxcH3OR4cbS7gtM96Bgd4bDwmQ@public.gmane.org>

On Friday 25 January 2013, Myklebust, Trond wrote:
> > -----Original Message-----
> > From: Arnd Bergmann [mailto:arnd-r2nGTMty4D4@public.gmane.org]
> > Marking it as __maybe_unused avoids a harmless gcc warning.
> 
> Alternatively, just declare it using the RPC_IFDEBUG() macro.

Right, makes sense: that's more consistent with other functions
doing the same thing. Thanks for taking a look.

	Arnd

8<----

>From 3b2baeac061bd60dbf14bb61bcc03cbd64c85ac4 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Date: Mon, 26 Nov 2012 22:46:26 +0000
Subject: [PATCH] sunrpc: don't warn for unused variable 'buf'

When RPC_DEBUG is unset, the dprintk() macro does nothing,
causing the 'buf' variable in svc_printk to become unused.
Enclosing it in RPC_IFDEBUG avoids a harmless gcc warning.

Without this patch, building at91_dt_defconfig results in:

net/sunrpc/svc.c: In function 'svc_printk':
net/sunrpc/svc.c:1051:7: warning: unused variable 'buf' [-Wunused-variable]

Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: "J. Bruce Fields" <bfields-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Trond Myklebust <Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index dbf12ac..9485e66 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1047,7 +1047,7 @@ void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
 {
 	struct va_format vaf;
 	va_list args;
-	char 	buf[RPC_MAX_ADDRBUFLEN];
+	RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
 
 	va_start(args, fmt);
 


--
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 related

* Re: [Web10g-user] Web10g TCP statistics patch - mainlining into kernel?
From: Tom Herbert @ 2013-01-25 23:34 UTC (permalink / raw)
  To: rapier
  Cc: Valdis.Kletnieks, netdev, web10g-user, linux-kernel,
	Dominic Hamon, Matt Mathis
In-Reply-To: <5102E63E.1020508@psc.edu>

> The user side of the list has been pretty quiet to be sure. Most of the
> discussion happens internal to the team. The primary KIS developer is out
> the office until next week but I'll try to make sure he addresses this as
> soon as he can. I agree entirely with the more eyes approach and none of us
> have a lot of ego sunk into the details of the code in and of itself. As
> researchers, more than anything else, we want the concept moved forward. We
> believe, strongly, that having these metrics in the mainline can really do a
> lot to help the entire user community and spur some really neat development.
>
> Chris
>
Hi Chris, Valdis,

This is certainly interesting, and something that we'd really want to
try to get in upstream Linux since it's is so intrusive in the stack
(we have actually done quite a bit of work in this area already that
might be applicable).  Posting patches against davem's net-next branch
seems appropriate and you could certainly post them as RFC to start
some conversation.

Tom

> --
> 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: [PATCH 15/19] sunrpc: don't warn for unused variable 'buf'
From: Myklebust, Trond @ 2013-01-25 23:04 UTC (permalink / raw)
  To: Arnd Bergmann, linux-arm-kernel@lists.infradead.org
  Cc: linux-kernel@vger.kernel.org, J. Bruce Fields,
	linux-nfs@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <1359153858-31992-16-git-send-email-arnd@arndb.de>

> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd@arndb.de]
> Sent: Friday, January 25, 2013 5:44 PM
> To: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org; Arnd Bergmann; J. Bruce Fields;
> Myklebust, Trond; linux-nfs@vger.kernel.org; netdev@vger.kernel.org
> Subject: [PATCH 15/19] sunrpc: don't warn for unused variable 'buf'
> 
> When RPC_DEBUG is unset, the dprintk() macro does nothing, causing the
> 'buf' variable in svc_printk to become unused.
> Marking it as __maybe_unused avoids a harmless gcc warning.
> 
> Without this patch, building at91_dt_defconfig results in:
> 
> net/sunrpc/svc.c: In function 'svc_printk':
> net/sunrpc/svc.c:1051:7: warning: unused variable 'buf' [-Wunused-variable]
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: "J. Bruce Fields" <bfields@redhat.com>
> Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
> Cc: linux-nfs@vger.kernel.org
> Cc: netdev@vger.kernel.org
> ---
>  net/sunrpc/svc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index dbf12ac..b1f5223
> 100644
> --- a/net/sunrpc/svc.c
> +++ b/net/sunrpc/svc.c
> @@ -1047,7 +1047,7 @@ void svc_printk(struct svc_rqst *rqstp, const char
> *fmt, ...)  {
>  	struct va_format vaf;
>  	va_list args;
> -	char 	buf[RPC_MAX_ADDRBUFLEN];
> +	char buf[RPC_MAX_ADDRBUFLEN] __maybe_unused;
> 
>  	va_start(args, fmt);

Alternatively, just declare it using the RPC_IFDEBUG() macro.

Cheers
  Trond

^ permalink raw reply

* Alx driver doesn't work on 3.7.x
From: Ongun Kanat @ 2013-01-25 22:54 UTC (permalink / raw)
  To: netdev; +Cc: nic-devel

Hello,
I don't know wheter it is the right place for it but I want to report
a bug(I think it is).
I'm a Asus N56VZ user with ArchLinux on it. It has an Atheros AR8161 ,
so I use alx driver. It was working with 3.6 series kernel but now
with 3.7.3 and
3.7.4 it stopped working. I was upgraded compat driver version
2012-12-19 to use alx with 3.7 series. When It generated errors I
tried also compat 3.7.1
and 2013-01-10-2u. Also tried a solution which says comment some lines
on 3.6.8-snpc (which is given in
http://www.linuxfoundation.org/collaborate/workgroups/networking/alx).
The first two caused same error below when I got ip connection both
with NetworkManager and ifconfig. The last solution wih 3.6.8 worked
but connection
drops always after a while.

The output of dmesg when I connected:
Jan 22 20:21:49 localhost kernel: [   33.468071] Pid: 0, comm:
swapper/0 Tainted: P           O 3.7.3-1-ARCH #1
Jan 22 20:21:49 localhost kernel: [   33.468072] Call Trace:
Jan 22 20:21:49 localhost kernel: [   33.468074]  <IRQ>
[<ffffffff8105750f>] warn_slowpath_common+0x7f/0xc0
Jan 22 20:21:49 localhost kernel: [   33.468081]  [<ffffffff81057606>]
warn_slowpath_fmt+0x46/0x50
Jan 22 20:21:49 localhost kernel: [   33.468086]  [<ffffffff814ac6be>]
? _raw_spin_unlock+0x2e/0x40
Jan 22 20:21:49 localhost kernel: [   33.468090]  [<ffffffff813ca0e3>]
dev_watchdog+0x273/0x280
Jan 22 20:21:49 localhost kernel: [   33.468093]  [<ffffffff813c9e70>]
? pfifo_fast_dequeue+0xe0/0xe0
Jan 22 20:21:49 localhost kernel: [   33.468096]  [<ffffffff810674aa>]
call_timer_fn+0x3a/0x180
Jan 22 20:21:49 localhost kernel: [   33.468098]  [<ffffffff813c9e70>]
? pfifo_fast_dequeue+0xe0/0xe0
Jan 22 20:21:49 localhost kernel: [   33.468101]  [<ffffffff81067fac>]
run_timer_softirq+0x21c/0x2c0
Jan 22 20:21:49 localhost kernel: [   33.468105]  [<ffffffff8101ca99>]
? read_tsc+0x9/0x20
Jan 22 20:21:49 localhost kernel: [   33.468108]  [<ffffffff8105ff18>]
__do_softirq+0xc8/0x240
Jan 22 20:21:49 localhost kernel: [   33.468113]  [<ffffffff810afe44>]
? tick_program_event+0x24/0x30
Jan 22 20:21:49 localhost kernel: [   33.468117]  [<ffffffff814b569c>]
call_softirq+0x1c/0x30
Jan 22 20:21:49 localhost kernel: [   33.468120]  [<ffffffff810177c5>]
do_softirq+0x65/0xa0
Jan 22 20:21:49 localhost kernel: [   33.468123]  [<ffffffff810601f6>]
irq_exit+0x96/0xc0
Jan 22 20:21:49 localhost kernel: [   33.468126]  [<ffffffff814b600e>]
smp_apic_timer_interrupt+0x6e/0x99
Jan 22 20:21:49 localhost kernel: [   33.468129]  [<ffffffff814b4f5d>]
apic_timer_interrupt+0x6d/0x80
Jan 22 20:21:49 localhost kernel: [   33.468130]  <EOI>
[<ffffffff8107ff42>] ? hrtimer_get_next_event+0xd2/0xe0
Jan 22 20:21:49 localhost kernel: [   33.468138]  [<ffffffff812c4ba0>]
? intel_idle+0xf0/0x150
Jan 22 20:21:49 localhost kernel: [   33.468140]  [<ffffffff812c4b7e>]
? intel_idle+0xce/0x150
Jan 22 20:21:49 localhost kernel: [   33.468144]  [<ffffffff81377899>]
cpuidle_enter+0x19/0x20
Jan 22 20:21:49 localhost kernel: [   33.468146]  [<ffffffff81377f86>]
cpuidle_idle_call+0xa6/0x340
Jan 22 20:21:49 localhost kernel: [   33.468149]  [<ffffffff8101ef3f>]
cpu_idle+0xbf/0x130
Jan 22 20:21:49 localhost kernel: [   33.468152]  [<ffffffff814857a0>]
rest_init+0x80/0x90
Jan 22 20:21:49 localhost kernel: [   33.468155]  [<ffffffff818cac45>]
start_kernel+0x3d1/0x3de
Jan 22 20:21:49 localhost kernel: [   33.468157]  [<ffffffff818ca673>]
? repair_env_string+0x5e/0x5e
Jan 22 20:21:49 localhost kernel: [   33.468160]  [<ffffffff818ca356>]
x86_64_start_reservations+0x131/0x135
Jan 22 20:21:49 localhost kernel: [   33.468162]  [<ffffffff818ca45a>]
x86_64_start_kernel+0x100/0x10f
Jan 22 20:21:49 localhost kernel: [   33.468164] ---[ end trace
e2e9c1c2dadb3509 ]---
Jan 22 20:21:49 localhost kernel: [   33.468168] alx 0000:04:00.0
eth0: -----------------TPD-ring(0)------------------
Jan 22 20:21:49 localhost kernel: [   33.468171] alx 0000:04:00.0
eth0: F8: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468172] alx 0000:04:00.0
eth0: F9: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468174] alx 0000:04:00.0
eth0: FA: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468176] alx 0000:04:00.0
eth0: FB: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468177] alx 0000:04:00.0
eth0: FC: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468179] alx 0000:04:00.0
eth0: FD: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468181] alx 0000:04:00.0
eth0: FE: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468182] alx 0000:04:00.0
eth0: FF: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468184] alx 0000:04:00.0
eth0: 0: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468186] alx 0000:04:00.0
eth0: 1: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468188] alx 0000:04:00.0
eth0: 2: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468189] alx 0000:04:00.0
eth0: 3: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468191] alx 0000:04:00.0
eth0: -----------------TPD-ring(1)------------------
Jan 22 20:21:49 localhost kernel: [   33.468193] alx 0000:04:00.0
eth0: F8: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468194] alx 0000:04:00.0
eth0: F9: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468196] alx 0000:04:00.0
eth0: FA: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468198] alx 0000:04:00.0
eth0: FB: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468199] alx 0000:04:00.0
eth0: FC: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468201] alx 0000:04:00.0
eth0: FD: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468203] alx 0000:04:00.0
eth0: FE: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468204] alx 0000:04:00.0
eth0: FF: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468206] alx 0000:04:00.0
eth0: 0: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468208] alx 0000:04:00.0
eth0: 1: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468209] alx 0000:04:00.0
eth0: 2: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468211] alx 0000:04:00.0
eth0: 3: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468212] alx 0000:04:00.0
eth0: -----------------TPD-ring(2)------------------
Jan 22 20:21:49 localhost kernel: [   33.468214] alx 0000:04:00.0
eth0: F8: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468216] alx 0000:04:00.0
eth0: F9: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468218] alx 0000:04:00.0
eth0: FA: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468219] alx 0000:04:00.0
eth0: FB: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468221] alx 0000:04:00.0
eth0: FC: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468222] alx 0000:04:00.0
eth0: FD: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468224] alx 0000:04:00.0
eth0: FE: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468226] alx 0000:04:00.0
eth0: FF: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468227] alx 0000:04:00.0
eth0: 0: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468229] alx 0000:04:00.0
eth0: 1: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468231] alx 0000:04:00.0
eth0: 2: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468232] alx 0000:04:00.0
eth0: 3: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468234] alx 0000:04:00.0
eth0: -----------------TPD-ring(3)------------------
Jan 22 20:21:49 localhost kernel: [   33.468236] alx 0000:04:00.0
eth0: F9: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468237] alx 0000:04:00.0
eth0: FA: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468239] alx 0000:04:00.0
eth0: FB: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468241] alx 0000:04:00.0
eth0: FC: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468243] alx 0000:04:00.0
eth0: FD: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468244] alx 0000:04:00.0
eth0: FE: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468246] alx 0000:04:00.0
eth0: FF: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468248] alx 0000:04:00.0
eth0: 0: W0=0000005A, W1=80000000, W2=224D8802
Jan 22 20:21:49 localhost kernel: [   33.468250] alx 0000:04:00.0
eth0: 1: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468251] alx 0000:04:00.0
eth0: 2: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468253] alx 0000:04:00.0
eth0: 3: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468254] alx 0000:04:00.0
eth0: 4: W0=00000000, W1=00000000, W2=0
Jan 22 20:21:49 localhost kernel: [   33.468256] alx 0000:04:00.0
eth0: ---------------dump registers-----------------
Jan 22 20:21:49 localhost kernel: [   33.468308] alx 0000:04:00.0
eth0: 1400: C0020CE0,00000000,00000064,00001C01
Jan 22 20:21:49 localhost kernel: [   33.468319] alx 0000:04:00.0
eth0: 1410: 00002800,474019AA,03FF000D,00000000
Jan 22 20:21:49 localhost kernel: [   33.468331] alx 0000:04:00.0
eth0: 1420: 00000000,E03EBB60,00000240,CF01C831
Jan 22 20:21:49 localhost kernel: [   33.468342] alx 0000:04:00.0
eth0: 1430: 0000CC01,00000000,00000000,00000010
Jan 22 20:21:49 localhost kernel: [   33.468353] alx 0000:04:00.0
eth0: 1440: 8010020C,00000020,0007801A,00000180
Jan 22 20:21:49 localhost kernel: [   33.468365] alx 0000:04:00.0
eth0: 1450: 00000000,14700040,00000040,00000000
Jan 22 20:21:49 localhost kernel: [   33.468376] alx 0000:04:00.0
eth0: 1460: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468386] alx 0000:04:00.0
eth0: 1470: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468398] alx 0000:04:00.0
eth0: 1480: 64105CEF,60405060,4828A001,000010BF
Jan 22 20:21:49 localhost kernel: [   33.468409] alx 0000:04:00.0
eth0: 1490: 80000000,40000000,07A1F037,000005F2
Jan 22 20:21:49 localhost kernel: [   33.468420] alx 0000:04:00.0
eth0: 14A0: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468431] alx 0000:04:00.0
eth0: 14B0: 3BED200D,14364D17,6A3E67EA,B855AABE
Jan 22 20:21:49 localhost kernel: [   33.468443] alx 0000:04:00.0
eth0: 14C0: E214AD3D,EA49AF7C,A54F2BEC,2A94B30D
Jan 22 20:21:49 localhost kernel: [   33.468454] alx 0000:04:00.0
eth0: 14D0: 1805EC6C,E291D73D,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468465] alx 0000:04:00.0
eth0: 14E0: 22183000,22182000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468476] alx 0000:04:00.0
eth0: 14F0: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468487] alx 0000:04:00.0
eth0: 1500: 05FF05E0,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468498] alx 0000:04:00.0
eth0: 1510: 00000020,00000000,0BDF0BC0,00000020
Jan 22 20:21:49 localhost kernel: [   33.468509] alx 0000:04:00.0
eth0: 1520: 05DF0000,000005E0,0BBF0600,000005C0
Jan 22 20:21:49 localhost kernel: [   33.468520] alx 0000:04:00.0
eth0: 1530: 06000BE0,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468531] alx 0000:04:00.0
eth0: 1540: 00000002,00000002,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468542] alx 0000:04:00.0
eth0: 1550: 22186000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468554] alx 0000:04:00.0
eth0: 1560: 00000200,000005F8,22184000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468565] alx 0000:04:00.0
eth0: 1570: 00000000,00000000,00000200,22181000
Jan 22 20:21:49 localhost kernel: [   33.468576] alx 0000:04:00.0
eth0: 1580: 22180000,00000100,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468587] alx 0000:04:00.0
eth0: 1590: 020000F5,000008BF,01800080,00000000
Jan 22 20:21:49 localhost kernel: [   33.468599] alx 0000:04:00.0
eth0: 15A0: AC8100BF,00001210,00C0044E,00000100
Jan 22 20:21:49 localhost kernel: [   33.468610] alx 0000:04:00.0
eth0: 15B0: 0F22B217,00000001,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468621] alx 0000:04:00.0
eth0: 15C0: 04047C24,00030D40,00000055,000000C8
Jan 22 20:21:49 localhost kernel: [   33.468633] alx 0000:04:00.0
eth0: 15D0: 00214321,00000000,00438765,00000000
Jan 22 20:21:49 localhost kernel: [   33.468644] alx 0000:04:00.0
eth0: 15E0: 000001FF,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468655] alx 0000:04:00.0
eth0: 15F0: 00000000,00000000,00000020,00000000
Jan 22 20:21:49 localhost kernel: [   33.468667] alx 0000:04:00.0
eth0: 1600: 01711081,7C0F96E7,00004E20,00000000
Jan 22 20:21:49 localhost kernel: [   33.468678] alx 0000:04:00.0
eth0: 1610: FFFFFFFB,00000000,00000001,00000001
Jan 22 20:21:49 localhost kernel: [   33.468689] alx 0000:04:00.0
eth0: 1620: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468700] alx 0000:04:00.0
eth0: 1630: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468711] alx 0000:04:00.0
eth0: 1640: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468721] alx 0000:04:00.0
eth0: 1650: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468732] alx 0000:04:00.0
eth0: 1660: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468743] alx 0000:04:00.0
eth0: 1670: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468755] alx 0000:04:00.0
eth0: 1680: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468766] alx 0000:04:00.0
eth0: 1690: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468776] alx 0000:04:00.0
eth0: 16A0: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468788] alx 0000:04:00.0
eth0: 16B0: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468799] alx 0000:04:00.0
eth0: 16C0: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468809] alx 0000:04:00.0
eth0: 16D0: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468820] alx 0000:04:00.0
eth0: 16E0: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468831] alx 0000:04:00.0
eth0: 16F0: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468842] alx 0000:04:00.0
eth0: 1700: 00000005,00000003,00000002,00000000
Jan 22 20:21:49 localhost kernel: [   33.468853] alx 0000:04:00.0
eth0: 1710: 00000000,00000000,00000000,000001AC
Jan 22 20:21:49 localhost kernel: [   33.468864] alx 0000:04:00.0
eth0: 1720: 00000000,00000000,00000001,00000007
Jan 22 20:21:49 localhost kernel: [   33.468875] alx 0000:04:00.0
eth0: 1730: 0000000D,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468886] alx 0000:04:00.0
eth0: 1740: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468897] alx 0000:04:00.0
eth0: 1750: 00000000,0000010A,000000A2,00000010
Jan 22 20:21:49 localhost kernel: [   33.468908] alx 0000:04:00.0
eth0: 1760: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468918] alx 0000:04:00.0
eth0: 1770: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468928] alx 0000:04:00.0
eth0: 1780: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468939] alx 0000:04:00.0
eth0: 1790: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468951] alx 0000:04:00.0
eth0: 17A0: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468962] alx 0000:04:00.0
eth0: 17B0: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468973] alx 0000:04:00.0
eth0: 17C0: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468985] alx 0000:04:00.0
eth0: 17D0: 00000000,00000001,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.468996] alx 0000:04:00.0
eth0: 17E0: 00000000,0000005A,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.469007] alx 0000:04:00.0
eth0: 17F0: 00000000,00000000,00000000,00000000
Jan 22 20:21:49 localhost kernel: [   33.469023] alx 0000:04:00.0
eth0: task:alx_reinit

Thanks.

^ permalink raw reply

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

Waskiewicz Jr, Peter P <peter.p.waskiewicz.jr@intel.com> :
[...]
> Also, when you're disabling interrupts above, you're doing that in your
> HW interrupt handler, you should be using spin_lock_irqsave()/irq_restore().

Does the platform forbid to defer FEC_EIR / FEC_IEVENT write to the napi
poll handler and only disable the irq through FEC_EIMR / FEC_IMASK in
fec_enet_interrupt so as to remove the spinlock ?

(Frank, please keep an empty line between variables declarations and
function body).

-- 
Ueimor

^ permalink raw reply

* [PATCH 15/19] sunrpc: don't warn for unused variable 'buf'
From: Arnd Bergmann @ 2013-01-25 22:44 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-nfs, J. Bruce Fields, Arnd Bergmann, netdev,
	Trond Myklebust, linux-kernel
In-Reply-To: <1359153858-31992-1-git-send-email-arnd@arndb.de>

When RPC_DEBUG is unset, the dprintk() macro does nothing,
causing the 'buf' variable in svc_printk to become unused.
Marking it as __maybe_unused avoids a harmless gcc warning.

Without this patch, building at91_dt_defconfig results in:

net/sunrpc/svc.c: In function 'svc_printk':
net/sunrpc/svc.c:1051:7: warning: unused variable 'buf' [-Wunused-variable]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: "J. Bruce Fields" <bfields@redhat.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Cc: netdev@vger.kernel.org
---
 net/sunrpc/svc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index dbf12ac..b1f5223 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1047,7 +1047,7 @@ void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
 {
 	struct va_format vaf;
 	va_list args;
-	char 	buf[RPC_MAX_ADDRBUFLEN];
+	char buf[RPC_MAX_ADDRBUFLEN] __maybe_unused;
 
 	va_start(args, fmt);
 
-- 
1.8.0

^ permalink raw reply related

* RE: [PATCH net-next 1/3] net: stmmac: add gmac autoneg set for SGMII, TBI, and RTBI
From: Byungho An @ 2013-01-25 22:01 UTC (permalink / raw)
  To: 'Giuseppe CAVALLARO'
  Cc: netdev, linux-kernel, davem, jeffrey.t.kirsher, kgene.kim, cpgs
In-Reply-To: <50FFB094.5000100@st.com>


On 1/23/2013 1:43 PM, Giuseppe CAVALLARO write:
> On 1/18/2013 6:41 PM, Byungho An wrote:
> > On 1/15/2013 11:28 PM, Giuseppe CAVALLARO write:
> >> On 1/15/2013 10:45 PM, Byungho An wrote:
> >>>
> >>> This patch adds gmac autoneg set function for SGMII, TBI, or RTBI
> >>> interface. In case of PHY's autoneg is set, gmac's autoneg enable
> >>> bit should set. After checking phy's autoneg if phydev's autoneg is
'1'
> >>> gmac's ANE bit set for those interface.
> >>
> >> Sorry I've some doubts about these patches.
> >>
> >> Firstly if the MAC is able to manage RGMII/SGMII etc this should be
> > verified
> >> by looking at the HW cap register: i.e. PCS bit.
> >>
> >>     (I have no HW that support this so I cannot do any tests).
> >>
> > I agree with you and actually I tried to use a PCS bit previously.
> > (PCS bit indicates TBI, SGMII, or RTBI PHY interface) But I was
> > confused which one I should use among PSC, ACTPHYIF or phydev to
> > recognize the interface.
> > At this time, I want to add auto-negotiation enable because sgmii
> > interface is not working without ANE using PCS bit(in H/W feature
register).
> >
> 
> really strange, from the synopsys databook we should only look at the RO
bit
> in the HW cap reg just to understand if the feature is supported.
> 
I modified this part like below

@@ -1044,12 +1046,8 @@ static int stmmac_open(struct net_device *dev)
        priv->hw->mac->core_init(priv->ioaddr);

        /* Enable auto-negotiation for SGMII, TBI or RTBI */
-       if (interface == PHY_INTERFACE_MODE_SGMII ||
-           interface == PHY_INTERFACE_MODE_TBI ||
-           interface == PHY_INTERFACE_MODE_RTBI) {
-               if (priv->phydev->autoneg)
-                       priv->hw->mac->set_autoneg(priv->ioaddr);
-       }
+       if (priv->dma_cap.pcs)
+               priv->hw->mac->ctrl_ane(priv->ioaddr, 0);

        /* Request the IRQ lines */
        ret = request_irq(dev->irq, stmmac_interrupt,

As you may know, auto-negotiation is essential for SGMII, TBI, or RTBI
interface.

And ctrl_ane funciont is like that

@@ -311,6 +317,18 @@ static void dwmac1000_set_autoneg(void __iomem *ioaddr)
        writel(value, ioaddr + GMAC_AN_CTRL);
 }

+static void dwmac1000_ctrl_ane(void __iomem *ioaddr, bool restart)
+{
+       u32 value;
+
+       value = readl(ioaddr + GMAC_AN_CTRL);
+     /* auto negotiation enable and External Loopback enable */
+       value = GMAC_AN_CTRL__ANE | GMAC_AN_CTRL__ELE; 
+
+       if (restart)
+               value |= GMAC_AN_CTRL_RAN; 
+
+       writel(value, ioaddr + GMAC_AN_CTRL);
+}

 static const struct stmmac_ops dwmac1000_ops = {
        .core_init = dwmac1000_core_init,

> >> In case of this feature is actually supported then the driver could
> >> manage everything bypassing the MDIO.
> >> IMO, we could not need to call the stmmac_phy_init and we should not
> >> use the PHYLIB.
> >> I mean if we have the PCS module we could have a minimal support to
> >> get link status, restart ANE etc w/o using at all the PHYLIB (so w/o
> >> touching
> > the
> >> PHY regs via the MDIO/MDC).
> >>
> > Yes. For example SGMII/RGMII/SMII Status Register is useful to know
> > status so we can use this register to manage status of
> > SGMII/RGMII/SMII
> >
> >
> >>     It could also be useful to complete the support with the RGMII...
no
> >>     extra effort should be needed while adding SGMII if you look at the
> >>     core registers.
> >>     If you add the RGMII on some platforms we could guarantee to manage
> >>     the fix_mac_speed (see stmmac doc).
> >>
> > Unfortunately I have only the SGMII.
> 
> no problem, I'll complete it by my hand later.
> 
> >
> >> Looking at the other your patches, the ethtool support is not
> >> completed. I expected to restart ANE, get/set link property etc.
> >>
> > What is link property? It means link up, speed and duplex mode.
> > Are there anything else?
> > I think get link property is already working using ethtool.
> > In case of SGMII/RGMII/SMII, I think we can use SGMII/RGMII/SMII
> > Status Register for link status.
> >
> > I have a question regarding it.
> > In the mainline code, there is hardcode interrupt mask in
> > dwmac1000_core_init function.
> > When I try to get interrupt for link change, interrupt is not occurred
> > because of this mask.
> > Can we modify that?
> 
> yes you can. I had wrote an initial patch that started doing something.
> I have tested it on my boards and I can send it to the mailing list to be
> reviewed. Maybe you can build your patch on top of it.
> 
I've  changed restart AN like below.

@@ -610,6 +607,27 @@ static int stmmac_set_coalesce(struct net_device *dev,
        return 0;
 }

+static int
+stmmac_nway_reset(struct net_device *netdev)
+{
+       struct stmmac_priv *priv = netdev_priv(netdev);
+       struct phy_device *phy = priv->phydev;
+       int ret = 0;
+
+       spin_lock(&priv->lock);
+
+       if (netif_running(netdev)) {
+               phy_stop(phy);
+               phy_start(phy);
+               ret = phy_start_aneg(phy);
+               if (priv->dma_cap.pcs)
+                       priv->hw->mac->ctrl_ane(priv->ioaddr, true);
+       }
+
+       spin_unlock(&priv->lock);
+       return ret;
+}
+
 static const struct ethtool_ops stmmac_ethtool_ops = {
        .begin = stmmac_check_if_running,
        .get_drvinfo = stmmac_ethtool_getdrvinfo,



> >> Also pay attention to properly treat EEE. Maybe, as first stage we
> >> should disable the feature in this case. We will see it later.
> >> The question is that we could not be able to use some extra features
> >> that currently need to dialog more with the PHY device. I mean what
> >> we actually do by using PHYLIB.
> > OK. As I understood, using gmac register instead of phydev or phylib...
> > I agree. In my opinion gmac and phy communicate using mdio each other,
> > after that gmac can get updated status.
> 
> yep, this is the point :-)
> 
> >>
> >>>
> >>> Signed-off-by: Byungho An <bh74.an@samsung.com>
> >>> ---
> >>>    drivers/net/ethernet/stmicro/stmmac/common.h         |    1 +
> >>>    drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c |   11
> >> +++++++++++
> >>>    drivers/net/ethernet/stmicro/stmmac/stmmac_main.c    |    9
> +++++++++
> >>>    3 files changed, 21 insertions(+)
> >>>
> >>> diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h
> >>> b/drivers/net/ethernet/stmicro/stmmac/common.h
> >>> index 186d148..72ba769 100644
> >>> --- a/drivers/net/ethernet/stmicro/stmmac/common.h
> >>> +++ b/drivers/net/ethernet/stmicro/stmmac/common.h
> >>> @@ -344,6 +344,7 @@ struct stmmac_ops {
> >>>    	void (*reset_eee_mode) (void __iomem *ioaddr);
> >>>    	void (*set_eee_timer) (void __iomem *ioaddr, int ls, int
tw);
> >>>    	void (*set_eee_pls) (void __iomem *ioaddr, int link);
> >>> +	void (*set_autoneg) (void __iomem *ioaddr);
> >>>    };
> >>>
> >>>    struct mac_link {
> >>> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> >>> b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> >>> index bfe0226..a0737b39 100644
> >>> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> >>> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> >>> @@ -297,6 +297,16 @@ static void  dwmac1000_set_eee_timer(void
> >> __iomem
> >>> *ioaddr, int ls, int tw)
> >>>    	writel(value, ioaddr + LPI_TIMER_CTRL);
> >>>    }
> >>>
> >>> +static void dwmac1000_set_autoneg(void __iomem *ioaddr) {
> >>> +	u32 value;
> >>> +
> >>> +	value = readl(ioaddr + GMAC_AN_CTRL);
> >>> +	value |= 0x1000;
> >>
> >> pls use define instead of raw values ... see below.
> >>
> >>> +	writel(value, ioaddr + GMAC_AN_CTRL); }
> >>> +
> >>> +
> >>>    static const struct stmmac_ops dwmac1000_ops = {
> >>>    	.core_init = dwmac1000_core_init,
> >>>    	.rx_ipc = dwmac1000_rx_ipc_enable, @@ -311,6 +321,7 @@
static
> >>> const struct stmmac_ops dwmac1000_ops = {
> >>>    	.reset_eee_mode =  dwmac1000_reset_eee_mode,
> >>>    	.set_eee_timer =  dwmac1000_set_eee_timer,
> >>>    	.set_eee_pls =  dwmac1000_set_eee_pls,
> >>> +	.set_autoneg =  dwmac1000_set_autoneg,
> >>>    };
> >>>
> >>>    struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr)
> >>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> >>> b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> >>> index f07c061..3e28934 100644
> >>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> >>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> >>> @@ -1007,6 +1007,7 @@ static int stmmac_open(struct net_device *dev)
> >>>    {
> >>>    	struct stmmac_priv *priv = netdev_priv(dev);
> >>>    	int ret;
> >>> +	int interface = priv->plat->interface;
> >>>
> >>>    	clk_prepare_enable(priv->stmmac_clk);
> >>>
> >>> @@ -1041,6 +1042,14 @@ static int stmmac_open(struct net_device
> *dev)
> >>>    	/* Initialize the MAC Core */
> >>>    	priv->hw->mac->core_init(priv->ioaddr);
> >>>
> >>> +	/* If phy autoneg is on, set gmac autoneg for SGMII, TBI and RTBI*/
> >>> +	if (interface == PHY_INTERFACE_MODE_SGMII ||
> >>> +	    interface == PHY_INTERFACE_MODE_TBI ||
> >>> +	    interface == PHY_INTERFACE_MODE_RTBI) {
> >>> +		if (priv->phydev->autoneg)
> >>> +			priv->hw->mac->set_autoneg(priv->ioaddr);
> >>> +	}
> >>
> >> we could use the following instead of priv->hw->mac->set_autoneg:
> >>
> >> static void dwmac1000_ctrl_ane(void __iomem *ioaddr, bool restart) {
> >>       int value = GMAC_CTRL_ANE_EN;
> >>
> >>       if (restart)
> >>           value |= GMAC_CTRL_ANE_RESTART;
> >>
> >>       writel(value, ioaddr +GMAC_AN_CTRL); }
> >>
> >> where we should defines all the missing macros for the registers 48,
> >> 49
> > ...
> > Actually I tested this code for restart autonegotiation, but even
> > though I changed link (1Gb -> 100Mb) phy's link is not changed.
> > For more detail, first time 1Gb I changed the link during system
> > working and then check speed using ethtool/mii-tool.
> > I think phy also should do autonegotiation (I'm not sure this is just
> > for the SGMII). Without phy auto negotiation  gmac is not working.
> >
> > OK, I'll try to check functionality and make macros.
> > Anyway as a first step, I want to complete to the code regarding ANE
> > (ctrl function, macros, ethtool support for link status etc..) I'll
> > send new code before making patch soon.
> 
> thanks you
> 
I think whenever link is changed, phy->state is changed and call
stmmac_adjust_link. It would update gmac's link.
I can get autonegotiation complete and link change irqs if we need something
we can add code in the handler but I'm not sure which one is need yet.
As of now I just added phy_state = PHY_CHANGELINK as a test code in the link
change irq handler.

@@ -1624,8 +1629,43 @@ static irqreturn_t stmmac_interrupt(int irq, void
*dev_id)
                                priv->xstats.mmc_rx_csum_offload_irq_n++;
                        if (status & core_irq_receive_pmt_irq)
                                priv->xstats.irq_receive_pmt_irq_n++;
+                       if (status & core_irq_pcs_autoneg_complete)
+                                priv->core_pcs_an = true;
+                       if (status & core_irq_pcs_link_status_change) {
+                               priv->core_pcs_link_change = true;
+                               status = readl(priv->ioaddr +
GMAC_AN_STATUS);
+                               if (status & GMAC_AN_STATUS_LS)
+                                       if ((priv->speed != phy->speed) ||
(priv->oldduplex != phy->duplex)) 
+                                       phy->state = PHY_CHANGELINK;  /* for
test */
+                       }

                        /* For LPI we need to save the tx status */
                        if (status & core_irq_tx_path_in_lpi_mode) {

I have a question, how to hand over phy's irq number, as I analyzed
phydev->irq is irqlist and irqlist is like below but I can not find a way to
set phy's irq number.
How to register or set priv->mii_irq or mdio_bus_data->irqs.

        if (mdio_bus_data->irqs)
                irqlist = mdio_bus_data->irqs;
        else
                irqlist = priv->mii_irq; 

I added some defines for AN like below
@@ -97,6 +97,20 @@ enum power_event {
 #define GMAC_TBI       0x000000d4      /* TBI extend status */
 #define GMAC_GMII_STATUS 0x000000d8    /* S/R-GMII status */

+/* AN Configuration defines */
+#define GMAC_AN_CTRL_RAN       0x00000200      /* Restart Auto-Negotiation
*/
+#define GMAC_AN_CTRL_ANE       0x00001000      /* Auto-Negotiation Enable
*/
+#define GMAC_AN_CTRL_ELE       0x00004000      /* External Loopback Enable
*/
+#define GMAC_AN_CTRL_ECD       0x00010000      /* Enable Comma Detect */
+#define GMAC_AN_CTRL_LR        0x00020000      /* Lock to Reference */
+#define GMAC_AN_CTRL_SGMRAL    0x00040000      /* SGMII RAL Control */
+
+/* AN Status defines */
+#define GMAC_AN_STATUS_LS      0x00000004      /* Link Status 0:down 1:up
*/
+#define GMAC_AN_STATUS_ANA     0x00000008      /* Auto-Negotiation Ability
*/
+#define GMAC_AN_STATUS_ANC     0x00000020      /* Auto-Negotiation Complete
*/
+#define GMAC_AN_STATUS_ES      0x00000100      /* Extended Status */
+
 /* GMAC Configuration defines */
 #define GMAC_CONTROL_TC        0x01000000      /* Transmit Conf. in
RGMII/SGMII */
 #define GMAC_CONTROL_WD        0x00800000      /* Disable Watchdog on
receive */


> >>
> >> /* RGMI/SGMII defines */
> >> #define GMAC_CTRL_ANE_SGMII_RAL (1 << 18)
> >> #define GMAC_CTRL_ANE_EN       (1 << 12)
> >> #define GMAC_CTRL_ANE_RESTART  (1 << 9)
> >>
> >> The handler should store the link status that will be used to pass
> >> the
> > info to
> >> the ethtool for example. We need to manage speed and duplex etc.
> >>
> >> What happens if you run "ethtool eth0" command?
> >> Or if you run mii-tool?
> >> I expect to get the right speed and duplex at least.
> > So far, I can get right data speed and duplex and autoneg.
> >
> >>
> >> Concerning the stmmac_set_pauseparam I'm also not sure you are doing
> >> the right thing. Note that you are not restarting the ANE at all ...
> >> (this is
> > what the
> >> phy_start_aneg does). If set the bit 12 then you are enabling the
> >> ane. To restart it, you need to set the bit 9 in the reg 48.
> >>
> >> I can support you on all the points above. Let me know.
> >>
> >> BR,
> >> peppe
> >>
> > OK, thank you and happy new year.
> 
> Also to you :-)
> 
> let me know for any progresses etc.
> 
> Peppe

BR, 
Byungho An

> 
> > Byungho An
> >
> >>> +
> >>>    	/* Request the IRQ lines */
> >>>    	ret = request_irq(dev->irq, stmmac_interrupt,
> >>>    			 IRQF_SHARED, dev->name, dev);
> >>>
> >
> >
> >

^ permalink raw reply

* Re: [Pv-drivers] [PATCH 0/6] VSOCK for Linux upstreaming
From: Andy King @ 2013-01-25 21:33 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: pv-drivers, gregkh, linux-kernel, virtualization, netdev,
	David Miller
In-Reply-To: <1426158581.24554896.1357785777229.JavaMail.root@vmware.com>

> > > Our position is that VSOCK feature set is more complete and that
> > > it
> > > should be possible to use transports other than VMCI for VSOCK
> > > traffic, should interested parties implement them,
> > 
> > Implementing other transports requires restructing vsock (and vmci)
> > first as the current vsock code is not a hypervisor neutral
> > service.
> 
> I'm going to bite the bullet and spend the next couple of days doing
> just that: factoring out the VMCI bits and hiding them behind a
> transport layer.  It'll be a bit rough, but it'll be a start.  We'll
> submit another patch series next week with that.  I'm hoping that'll
> get us over this hump, since it should by hypervisor agnostic at
> that point.  It'll be up to you guys to add virtio, though :)

I sent out a patch series this morning that splits out our code into a
core part, containing the socket family/operations, and a VMCI-specific
part.  The core makes callbacks via a new transport layer into VMCI.
It's not perfect -- there's still some cruft in the core socket
structure -- but it lays the foundation of a hypervisor-neutral channel,
and hopefully we can build on this with your help.  It'd be great if
you could take a look.

Thanks!
- Andy

^ permalink raw reply

* RE: [PATCH] mwifiex: don't return zero on failure paths in mwifiex_pcie_init()
From: Bing Zhao @ 2013-01-25 21:03 UTC (permalink / raw)
  To: Alexey Khoroshilov
  Cc: John W. Linville, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	ldv-project@linuxtesting.org
In-Reply-To: <1359147363-9587-1-git-send-email-khoroshilov@ispras.ru>

Hi Alexey,

Thanks for the patch.

> If pci_iomap() fails in mwifiex_pcie_init(), it breaks off initialization,
> deallocates all resources, but returns zero.
> The patch adds -EIO as return value in this case.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>

Acked-by: Bing Zhao <bzhao@marvell.com>

Thanks,
Bing

> ---
>  drivers/net/wireless/mwifiex/pcie.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
> index 13fbc4e..9d9349c 100644
> --- a/drivers/net/wireless/mwifiex/pcie.c
> +++ b/drivers/net/wireless/mwifiex/pcie.c
> @@ -1739,6 +1739,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter)
>  	card->pci_mmap = pci_iomap(pdev, 0, 0);
>  	if (!card->pci_mmap) {
>  		dev_err(adapter->dev, "iomap(0) error\n");
> +		ret = -EIO;
>  		goto err_iomap0;
>  	}
>  	ret = pci_request_region(pdev, 2, DRV_NAME);
> @@ -1749,6 +1750,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter)
>  	card->pci_mmap1 = pci_iomap(pdev, 2, 0);
>  	if (!card->pci_mmap1) {
>  		dev_err(adapter->dev, "iomap(2) error\n");
> +		ret = -EIO;
>  		goto err_iomap2;
>  	}
> 
> --
> 1.7.9.5

^ permalink raw reply

* [PATCH] mwifiex: don't return zero on failure paths in mwifiex_pcie_init()
From: Alexey Khoroshilov @ 2013-01-25 20:56 UTC (permalink / raw)
  To: Bing Zhao
  Cc: Alexey Khoroshilov, John W. Linville, linux-wireless, netdev,
	linux-kernel, ldv-project

If pci_iomap() fails in mwifiex_pcie_init(), it breaks off initialization,
deallocates all resources, but returns zero.
The patch adds -EIO as return value in this case.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
 drivers/net/wireless/mwifiex/pcie.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 13fbc4e..9d9349c 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -1739,6 +1739,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter)
 	card->pci_mmap = pci_iomap(pdev, 0, 0);
 	if (!card->pci_mmap) {
 		dev_err(adapter->dev, "iomap(0) error\n");
+		ret = -EIO;
 		goto err_iomap0;
 	}
 	ret = pci_request_region(pdev, 2, DRV_NAME);
@@ -1749,6 +1750,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter)
 	card->pci_mmap1 = pci_iomap(pdev, 2, 0);
 	if (!card->pci_mmap1) {
 		dev_err(adapter->dev, "iomap(2) error\n");
+		ret = -EIO;
 		goto err_iomap2;
 	}
 
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH] vmxnet3: set carrier state properly on probe
From: Neil Horman @ 2013-01-25 20:54 UTC (permalink / raw)
  To: netdev; +Cc: Neil Horman, David S. Miller, VMware, Inc.

vmxnet3 fails to set netif_carrier_off on probe, meaning that when an interface
is opened the __LINK_STATE_NOCARRIER bit is already cleared, and so
/sys/class/net/<ifname>/operstate remains in the unknown state.  Correct this by
setting netif_carrier_off on probe, like other drivers do.

Also, while we're at it, lets remove the netif_carrier_ok checks from the
link_state_update function, as that check is atomically contained within the
netif_carrier_[on|off] functions anyway

Tested successfully by myself

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: "VMware, Inc." <pv-drivers@vmware.com>
---
 drivers/net/vmxnet3/vmxnet3_drv.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index b1c90f8..66c26a9 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -150,8 +150,7 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue)
 	if (ret & 1) { /* Link is up. */
 		netdev_info(adapter->netdev, "NIC Link is Up %d Mbps\n",
 			    adapter->link_speed);
-		if (!netif_carrier_ok(adapter->netdev))
-			netif_carrier_on(adapter->netdev);
+		netif_carrier_on(adapter->netdev);
 
 		if (affectTxQueue) {
 			for (i = 0; i < adapter->num_tx_queues; i++)
@@ -160,8 +159,7 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue)
 		}
 	} else {
 		netdev_info(adapter->netdev, "NIC Link is Down\n");
-		if (netif_carrier_ok(adapter->netdev))
-			netif_carrier_off(adapter->netdev);
+		netif_carrier_off(adapter->netdev);
 
 		if (affectTxQueue) {
 			for (i = 0; i < adapter->num_tx_queues; i++)
@@ -3067,6 +3065,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
 		goto err_register;
 	}
 
+	netif_carrier_off(netdev);
 	vmxnet3_check_link(adapter, false);
 	return 0;
 
-- 
1.7.11.7

^ permalink raw reply related

* Re: [patch] ipvs: freeing uninitialized pointer on error
From: Julian Anastasov @ 2013-01-25 20:56 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Wensong Zhang, Simon Horman, Pablo Neira Ayuso, Patrick McHardy,
	David S. Miller, netdev, lvs-devel, netfilter-devel, netfilter,
	coreteam, kernel-janitors
In-Reply-To: <20130125154456.GB5908@elgon.mountain>


	Hello,

On Fri, 25 Jan 2013, Dan Carpenter wrote:

> If state != IP_VS_STATE_BACKUP then tinfo->buf is uninitialized.  If
> kthread_run() fails then it means we free random memory resulting in an
> oops.

	Good catch. Simon, please apply!

	Problem is in 3.5+ caused by commit f73181c828
(ipvs: add support for sync threads)

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Julian Anastasov <ja@ssi.bg>

> diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
> index effa10c..44fd10c 100644
> --- a/net/netfilter/ipvs/ip_vs_sync.c
> +++ b/net/netfilter/ipvs/ip_vs_sync.c
> @@ -1795,6 +1795,8 @@ int start_sync_thread(struct net *net, int state, char *mcast_ifn, __u8 syncid)
>  					     GFP_KERNEL);
>  			if (!tinfo->buf)
>  				goto outtinfo;
> +		} else {
> +			tinfo->buf = NULL;
>  		}
>  		tinfo->id = id;

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply

* RE: [patch] qlcnic: silence false positive overflow warning
From: Jitendra Kalsaria @ 2013-01-25 20:48 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Sony Chacko, Dept-Eng Linux Driver, netdev,
	kernel-janitors@vger.kernel.org
In-Reply-To: <20130125064141.GB4882@elgon.mountain>

>From: Dan Carpenter [mailto:dan.carpenter@oracle.com] 
>Sent: Thursday, January 24, 2013 10:42 PM
>To: Jitendra Kalsaria
>Cc: Sony Chacko; Dept-Eng Linux Driver; netdev; kernel-janitors@vger.kernel.org
>Subject: [patch] qlcnic: silence false positive overflow warning
>
>We actually store the MAC address as well as the board_name here.  The
>longest board_name is 75 characters so there is more than enough room
>to hold the 17 character MAC and the ": " divider.  But making this
>buffer larger silences a static checker warning.
>
>Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>---
>I'm not sure if this is worth sending.  Feel free to drop this if you
>want.

Acked-By: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>

^ permalink raw reply

* [net-next PATCH 8/8] qlcnic: Bump up the version to 5.1.32
From: Jitendra Kalsaria @ 2013-01-25 20:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, sony.chacko, Dept_NX_Linux_NIC_Driver, Jitendra Kalsaria
In-Reply-To: <1359145241-5175-1-git-send-email-jitendra.kalsaria@qlogic.com>

From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>

Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 84c834d..fe7da9f 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -37,9 +37,9 @@
 #include "qlcnic_83xx_hw.h"
 
 #define _QLCNIC_LINUX_MAJOR 5
-#define _QLCNIC_LINUX_MINOR 0
-#define _QLCNIC_LINUX_SUBVERSION 31
-#define QLCNIC_LINUX_VERSIONID  "5.1.31"
+#define _QLCNIC_LINUX_MINOR 1
+#define _QLCNIC_LINUX_SUBVERSION 32
+#define QLCNIC_LINUX_VERSIONID  "5.1.32"
 #define QLCNIC_DRV_IDC_VER  0x01
 #define QLCNIC_DRIVER_VERSION  ((_QLCNIC_LINUX_MAJOR << 16) |\
 		 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
-- 
1.7.1

^ permalink raw reply related

* [net-next PATCH 7/8] qlcnic: add support for FDB netdevice ops.
From: Jitendra Kalsaria @ 2013-01-25 20:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, sony.chacko, Dept_NX_Linux_NIC_Driver, Jitendra Kalsaria
In-Reply-To: <1359145241-5175-1-git-send-email-jitendra.kalsaria@qlogic.com>

From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>

Providing communication channel between KVM and e-Switch so that it
can be informed when hypervisor configures a MAC address and VLAN.

qlcnic_mac_learn module param usage will be changed to:
	0 = MAC learning is disable
	1 = Driver learning is enable
	2 = FDB learning is enable

Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h      |   10 +++-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c   |   30 +++++++-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c   |    2 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |   84 +++++++++++++++++++++-
 4 files changed, 117 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 311d545..84c834d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -746,6 +746,11 @@ struct qlcnic_mac_list_s {
 	uint8_t mac_addr[ETH_ALEN+2];
 };
 
+/* MAC Learn */
+#define NO_MAC_LEARN		0
+#define DRV_MAC_LEARN		1
+#define FDB_MAC_LEARN		2
+
 #define QLCNIC_HOST_REQUEST	0x13
 #define QLCNIC_REQUEST		0x14
 
@@ -981,7 +986,8 @@ struct qlcnic_adapter {
 	u8 mac_addr[ETH_ALEN];
 
 	u64 dev_rst_time;
-	u8 mac_learn;
+	bool drv_mac_learn;
+	bool fdb_mac_learn;
 	unsigned long vlans[BITS_TO_LONGS(VLAN_N_VID)];
 	u8 flash_mfg_id;
 	struct qlcnic_npar_info *npars;
@@ -1421,6 +1427,8 @@ void qlcnic_post_rx_buffers(struct qlcnic_adapter *adapter,
 		struct qlcnic_host_rds_ring *rds_ring, u8 ring_id);
 int qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring, int max);
 void qlcnic_set_multi(struct net_device *netdev);
+int qlcnic_nic_add_mac(struct qlcnic_adapter *, const u8 *);
+int qlcnic_nic_del_mac(struct qlcnic_adapter *, const u8 *);
 void qlcnic_free_mac_list(struct qlcnic_adapter *adapter);
 
 int qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index 3d84c04..124a7e0 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -446,7 +446,29 @@ int qlcnic_82xx_sre_macaddr_change(struct qlcnic_adapter *adapter, u8 *addr,
 	return qlcnic_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
 }
 
-static int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, const u8 *addr)
+int qlcnic_nic_del_mac(struct qlcnic_adapter *adapter, const u8 *addr)
+{
+	struct list_head *head;
+	struct qlcnic_mac_list_s *cur;
+	int err = -EINVAL;
+
+	/* Delete MAC from the existing list */
+	list_for_each(head, &adapter->mac_list) {
+		cur = list_entry(head, struct qlcnic_mac_list_s, list);
+		if (memcmp(addr, cur->mac_addr, ETH_ALEN) == 0) {
+			err = qlcnic_sre_macaddr_change(adapter, cur->mac_addr,
+							0, QLCNIC_MAC_DEL);
+			if (err)
+				return err;
+			list_del(&cur->list);
+			kfree(cur);
+			return err;
+		}
+	}
+	return err;
+}
+
+int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, const u8 *addr)
 {
 	struct list_head *head;
 	struct qlcnic_mac_list_s *cur;
@@ -510,11 +532,11 @@ void qlcnic_set_multi(struct net_device *netdev)
 	}
 
 send_fw_cmd:
-	if (mode == VPORT_MISS_MODE_ACCEPT_ALL) {
+	if (mode == VPORT_MISS_MODE_ACCEPT_ALL && !adapter->fdb_mac_learn) {
 		qlcnic_alloc_lb_filters_mem(adapter);
-		adapter->mac_learn = 1;
+		adapter->drv_mac_learn = true;
 	} else {
-		adapter->mac_learn = 0;
+		adapter->drv_mac_learn = false;
 	}
 
 	qlcnic_nic_set_promisc(adapter, mode);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
index 0033971..fdf3483 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
@@ -521,7 +521,7 @@ netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 	if (unlikely(qlcnic_tx_pkt(adapter, first_desc, skb)))
 		goto unwind_buff;
 
-	if (adapter->mac_learn)
+	if (adapter->drv_mac_learn)
 		qlcnic_send_filter(adapter, first_desc, skb);
 
 	adapter->stats.txbytes += skb->len;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 8b0f47a..e6b363a 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -32,7 +32,8 @@ static const char qlcnic_driver_string[] = "QLogic 1/10 GbE "
 
 static int qlcnic_mac_learn;
 module_param(qlcnic_mac_learn, int, 0444);
-MODULE_PARM_DESC(qlcnic_mac_learn, "Mac Filter (0=disabled, 1=enabled)");
+MODULE_PARM_DESC(qlcnic_mac_learn,
+		 "Mac Filter (0=learning is disabled, 1=Driver learning is enabled, 2=FDB learning is enabled)");
 
 int qlcnic_use_msi = 1;
 MODULE_PARM_DESC(use_msi, "MSI interrupt (0=disabled, 1=enabled");
@@ -246,6 +247,77 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p)
 	return 0;
 }
 
+static int qlcnic_fdb_del(struct ndmsg *ndm, struct net_device *netdev,
+			const unsigned char *addr)
+{
+	struct qlcnic_adapter *adapter = netdev_priv(netdev);
+	int err = -EOPNOTSUPP;
+
+	if (!adapter->fdb_mac_learn) {
+		pr_info("%s: Driver mac learn is enabled, FDB operation not allowed\n",
+			__func__);
+		return err;
+	}
+
+	if (adapter->flags & QLCNIC_ESWITCH_ENABLED) {
+		if (is_unicast_ether_addr(addr))
+			err = qlcnic_nic_del_mac(adapter, addr);
+		else if (is_multicast_ether_addr(addr))
+			err = dev_mc_del(netdev, addr);
+		else
+			err =  -EINVAL;
+	}
+	return err;
+}
+
+static int qlcnic_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
+			struct net_device *netdev,
+			const unsigned char *addr, u16 flags)
+{
+	struct qlcnic_adapter *adapter = netdev_priv(netdev);
+	int err = 0;
+
+	if (!adapter->fdb_mac_learn) {
+		pr_info("%s: Driver mac learn is enabled, FDB operation not allowed\n",
+			__func__);
+		return -EOPNOTSUPP;
+	}
+
+	if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED)) {
+		pr_info("%s: FDB e-switch is not enabled\n", __func__);
+		return -EOPNOTSUPP;
+	}
+
+	if (ether_addr_equal(addr, adapter->mac_addr))
+		return err;
+
+	if (is_unicast_ether_addr(addr))
+		err = qlcnic_nic_add_mac(adapter, addr);
+	else if (is_multicast_ether_addr(addr))
+		err = dev_mc_add_excl(netdev, addr);
+	else
+		err = -EINVAL;
+
+	return err;
+}
+
+static int qlcnic_fdb_dump(struct sk_buff *skb, struct netlink_callback *ncb,
+			struct net_device *netdev, int idx)
+{
+	struct qlcnic_adapter *adapter = netdev_priv(netdev);
+
+	if (!adapter->fdb_mac_learn) {
+		pr_info("%s: Driver mac learn is enabled, FDB operation not allowed\n",
+			__func__);
+		return -EOPNOTSUPP;
+	}
+
+	if (adapter->flags & QLCNIC_ESWITCH_ENABLED)
+		idx = ndo_dflt_fdb_dump(skb, ncb, netdev, idx);
+
+	return idx;
+}
+
 static void qlcnic_82xx_cancel_idc_work(struct qlcnic_adapter *adapter)
 {
 	while (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
@@ -268,6 +340,9 @@ static const struct net_device_ops qlcnic_netdev_ops = {
 	.ndo_tx_timeout	   = qlcnic_tx_timeout,
 	.ndo_vlan_rx_add_vid	= qlcnic_vlan_rx_add,
 	.ndo_vlan_rx_kill_vid	= qlcnic_vlan_rx_del,
+	.ndo_fdb_add		= qlcnic_fdb_add,
+	.ndo_fdb_del		= qlcnic_fdb_del,
+	.ndo_fdb_dump		= qlcnic_fdb_dump,
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller = qlcnic_poll_controller,
 #endif
@@ -1802,7 +1877,10 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	adapter->dev_rst_time = jiffies;
 	adapter->ahw->revision_id = pdev->revision;
-	adapter->mac_learn = qlcnic_mac_learn;
+	if (qlcnic_mac_learn == FDB_MAC_LEARN)
+		adapter->fdb_mac_learn = true;
+	else if (qlcnic_mac_learn == DRV_MAC_LEARN)
+		adapter->drv_mac_learn = true;
 	adapter->max_drv_tx_rings = 1;
 
 	rwlock_init(&adapter->ahw->crb_lock);
@@ -1893,7 +1971,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (qlcnic_get_act_pci_func(adapter))
 		goto err_out_disable_mbx_intr;
 
-	if (adapter->mac_learn)
+	if (adapter->drv_mac_learn)
 		qlcnic_alloc_lb_filters_mem(adapter);
 
 	qlcnic_add_sysfs(adapter);
-- 
1.7.1

^ permalink raw reply related

* [net-next PATCH 6/8] qlcnic: sleeping function called from invalid context
From: Jitendra Kalsaria @ 2013-01-25 20:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, sony.chacko, Dept_NX_Linux_NIC_Driver, Jitendra Kalsaria
In-Reply-To: <1359145241-5175-1-git-send-email-jitendra.kalsaria@qlogic.com>

From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>

device eth0 entered promiscuous mode
BUG: sleeping function called from invalid context at mm/slub.c:930
in_atomic(): 1, irqs_disabled(): 0, pid: 5911, name: brctl
INFO: lockdep is turned off.
Pid: 5911, comm: brctl Tainted: GF       W  O 3.6.0-0.rc7.git1.4.fc18.x86_64 #1
Call Trace:
[<ffffffff810a29ca>] __might_sleep+0x18a/0x240
[<ffffffff811b5d77>] __kmalloc+0x67/0x2d0
[<ffffffffa00a61a9>] ? qlcnic_alloc_lb_filters_mem+0x59/0xa0 [qlcnic]
[<ffffffffa00a61a9>] qlcnic_alloc_lb_filters_mem+0x59/0xa0 [qlcnic]
[<ffffffffa009e1c1>] qlcnic_set_multi+0x81/0x100 [qlcnic]
[<ffffffff8159cccf>] __dev_set_rx_mode+0x5f/0xb0
[<ffffffff8159cd4f>] dev_set_rx_mode+0x2f/0x50
[<ffffffff8159d00c>] dev_set_promiscuity+0x3c/0x50
[<ffffffffa05ed728>] br_add_if+0x1e8/0x400 [bridge]
[<ffffffffa05ee2df>] add_del_if+0x5f/0x90 [bridge]
[<ffffffffa05eee0b>] br_dev_ioctl+0x4b/0x90 [bridge]
[<ffffffff8159d613>] dev_ifsioc+0x373/0x3b0
[<ffffffff8159d78f>] dev_ioctl+0x13f/0x860
[<ffffffff812dd6e1>] ? avc_has_perm_flags+0x31/0x2c0
[<ffffffff8157c18d>] sock_do_ioctl+0x5d/0x70
[<ffffffff8157c21d>] sock_ioctl+0x7d/0x2c0
[<ffffffff812df922>] ? inode_has_perm.isra.48.constprop.61+0x62/0xa0
[<ffffffff811e4979>] do_vfs_ioctl+0x99/0x5a0
[<ffffffff812df9f7>] ? file_has_perm+0x97/0xb0
[<ffffffff810d716d>] ? trace_hardirqs_on+0xd/0x10
[<ffffffff811e4f19>] sys_ioctl+0x99/0xa0
[<ffffffff816e7369>] system_call_fastpath+0x16/0x1b
br0: port 1(eth0) entered forwarding state
br0: port 1(eth0) entered forwarding state

Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 5cbf8c6..8b0f47a 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2142,7 +2142,7 @@ void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter)
 	}
 
 	head = kcalloc(adapter->fhash.fbucket_size,
-		       sizeof(struct hlist_head), GFP_KERNEL);
+		       sizeof(struct hlist_head), GFP_ATOMIC);
 
 	if (!head)
 		return;
-- 
1.7.1

^ permalink raw reply related

* [net-next PATCH 5/8] qlcnic: Fix LED/Beaconing tests to work on all ports of an adapter.
From: Jitendra Kalsaria @ 2013-01-25 20:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, sony.chacko, Dept_NX_Linux_NIC_Driver, Himanshu Madhani
In-Reply-To: <1359145241-5175-1-git-send-email-jitendra.kalsaria@qlogic.com>

From: Himanshu Madhani <himanshu.madhani@qlogic.com>

Provide port number in command payload for LED/Beaconing tests.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index eb1f3cc..3d84c04 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -1380,7 +1380,7 @@ int qlcnic_82xx_config_led(struct qlcnic_adapter *adapter, u32 state, u32 rate)
 	word = QLCNIC_H2C_OPCODE_CONFIG_LED | ((u64)adapter->portnum << 16);
 	req.req_hdr = cpu_to_le64(word);
 
-	req.words[0] = cpu_to_le64((u64)rate << 32);
+	req.words[0] = cpu_to_le64(((u64)rate << 32) | adapter->portnum);
 	req.words[1] = cpu_to_le64(state);
 
 	rv = qlcnic_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
-- 
1.7.1

^ permalink raw reply related

* [net-next PATCH 4/8] qlcnic: avoid mixed mode interrupts for some adapter types
From: Jitendra Kalsaria @ 2013-01-25 20:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, sony.chacko, Dept_NX_Linux_NIC_Driver, Manish chopra
In-Reply-To: <1359145241-5175-1-git-send-email-jitendra.kalsaria@qlogic.com>

From: Manish chopra <manish.chopra@qlogic.com>

o Some adapter types do not support co-existence of Legacy Interrupt with
  MSI-x or MSI among multiple functions. For those adapters, prevent attaching
  to a function during normal load, if MSI-x or MSI vectors are not available.
o Using module parameters use_msi=0 and use_msi_x=0, driver can be loaded in 
  legacy mode for all functions in the adapter.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |   35 ++++++++++++++++-----
 1 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index e460401..5cbf8c6 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -395,8 +395,9 @@ int qlcnic_enable_msix(struct qlcnic_adapter *adapter, u32 num_msix)
 	return err;
 }
 
-static void qlcnic_enable_msi_legacy(struct qlcnic_adapter *adapter)
+static int qlcnic_enable_msi_legacy(struct qlcnic_adapter *adapter)
 {
+	int err = 0;
 	u32 offset, mask_reg;
 	const struct qlcnic_legacy_intr_set *legacy_intrp;
 	struct qlcnic_hardware_context *ahw = adapter->ahw;
@@ -409,8 +410,10 @@ static void qlcnic_enable_msi_legacy(struct qlcnic_adapter *adapter)
 							    offset);
 		dev_info(&pdev->dev, "using msi interrupts\n");
 		adapter->msix_entries[0].vector = pdev->irq;
-		return;
+		return err;
 	}
+	if (qlcnic_use_msi || qlcnic_use_msi_x)
+		return -EOPNOTSUPP;
 
 	legacy_intrp = &legacy_intr[adapter->ahw->pci_func];
 	adapter->ahw->int_vec_bit = legacy_intrp->int_vec_bit;
@@ -422,11 +425,12 @@ static void qlcnic_enable_msi_legacy(struct qlcnic_adapter *adapter)
 	adapter->crb_int_state_reg = qlcnic_get_ioaddr(ahw, ISR_INT_STATE_REG);
 	dev_info(&pdev->dev, "using legacy interrupts\n");
 	adapter->msix_entries[0].vector = pdev->irq;
+	return err;
 }
 
 int qlcnic_82xx_setup_intr(struct qlcnic_adapter *adapter, u8 num_intr)
 {
-	int num_msix, err;
+	int num_msix, err = 0;
 
 	if (!num_intr)
 		num_intr = QLCNIC_DEF_NUM_STS_DESC_RINGS;
@@ -441,8 +445,11 @@ int qlcnic_82xx_setup_intr(struct qlcnic_adapter *adapter, u8 num_intr)
 	if (err == -ENOMEM || !err)
 		return err;
 
-	qlcnic_enable_msi_legacy(adapter);
-	return 0;
+	err = qlcnic_enable_msi_legacy(adapter);
+	if (!err)
+		return err;
+
+	return -EIO;
 }
 
 void qlcnic_teardown_intr(struct qlcnic_adapter *adapter)
@@ -1843,8 +1850,10 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 			board_name, adapter->ahw->revision_id);
 	}
 	err = qlcnic_setup_intr(adapter, 0);
-	if (err)
+	if (err) {
+		dev_err(&pdev->dev, "Failed to setup interrupt\n");
 		goto err_out_disable_msi;
+	}
 
 	if (qlcnic_83xx_check(adapter)) {
 		err = qlcnic_83xx_setup_mbx_intr(adapter);
@@ -2976,6 +2985,12 @@ static int qlcnic_attach_func(struct pci_dev *pdev)
 	adapter->msix_entries = NULL;
 	err = qlcnic_setup_intr(adapter, 0);
 
+	if (err) {
+		kfree(adapter->msix_entries);
+		netdev_err(netdev, "failed to setup interrupt\n");
+		return err;
+	}
+
 	if (qlcnic_83xx_check(adapter)) {
 		err = qlcnic_83xx_setup_mbx_intr(adapter);
 		if (err) {
@@ -3131,9 +3146,11 @@ int qlcnic_set_max_rss(struct qlcnic_adapter *adapter, u8 data, size_t len)
 	qlcnic_detach(adapter);
 	qlcnic_teardown_intr(adapter);
 	err = qlcnic_setup_intr(adapter, data);
-	if (err)
-		dev_err(&adapter->pdev->dev,
-			"failed setting max_rss; rss disabled\n");
+	if (err) {
+		kfree(adapter->msix_entries);
+		netdev_err(netdev, "failed to setup interrupt\n");
+		return err;
+	}
 
 	if (qlcnic_83xx_check(adapter)) {
 		err = qlcnic_83xx_setup_mbx_intr(adapter);
-- 
1.7.1

^ permalink raw reply related

* [net-next PATCH 3/8] qlcnic: enable RSS for TCP over IPv6
From: Jitendra Kalsaria @ 2013-01-25 20:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, sony.chacko, Dept_NX_Linux_NIC_Driver, Shahed Shaikh
In-Reply-To: <1359145241-5175-1-git-send-email-jitendra.kalsaria@qlogic.com>

From: Shahed Shaikh <shahed.shaikh@qlogic.com>

o This patch enables RSS for TYPE-C packets to enable RSS for TCP over IPv6

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index 8e0412b..eb1f3cc 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -756,7 +756,10 @@ int qlcnic_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable)
 }
 
 
-#define RSS_HASHTYPE_IP_TCP	0x3
+#define QLCNIC_RSS_HASHTYPE_IP_TCP	0x3
+#define QLCNIC_ENABLE_TYPE_C_RSS	BIT_10
+#define QLCNIC_RSS_FEATURE_FLAG	(1ULL << 63)
+#define QLCNIC_RSS_IND_TABLE_MASK	0x7ULL
 
 int qlcnic_82xx_config_rss(struct qlcnic_adapter *adapter, int enable)
 {
@@ -783,13 +786,19 @@ int qlcnic_82xx_config_rss(struct qlcnic_adapter *adapter, int enable)
 	 *	7-6: hash_type_ipv6
 	 *	  8: enable
 	 *        9: use indirection table
-	 *    47-10: reserved
-	 *    63-48: indirection table mask
+	 *       10: type-c rss
+	 *	 11: udp rss
+	 *    47-12: reserved
+	 *    62-48: indirection table mask
+	 *	 63: feature flag
 	 */
-	word =  ((u64)(RSS_HASHTYPE_IP_TCP & 0x3) << 4) |
-		((u64)(RSS_HASHTYPE_IP_TCP & 0x3) << 6) |
+	word =  ((u64)(QLCNIC_RSS_HASHTYPE_IP_TCP & 0x3) << 4) |
+		((u64)(QLCNIC_RSS_HASHTYPE_IP_TCP & 0x3) << 6) |
 		((u64)(enable & 0x1) << 8) |
-		((0x7ULL) << 48);
+		((u64)QLCNIC_RSS_IND_TABLE_MASK << 48) |
+		(u64)QLCNIC_ENABLE_TYPE_C_RSS |
+		(u64)QLCNIC_RSS_FEATURE_FLAG;
+
 	req.words[0] = cpu_to_le64(word);
 	for (i = 0; i < 5; i++)
 		req.words[i+1] = cpu_to_le64(key[i]);
-- 
1.7.1

^ permalink raw reply related

* [net-next PATCH 2/8] qlcnic: enable LRO on IPv6 without dest ip check
From: Jitendra Kalsaria @ 2013-01-25 20:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, sony.chacko, Dept_NX_Linux_NIC_Driver, Shahed Shaikh
In-Reply-To: <1359145241-5175-1-git-send-email-jitendra.kalsaria@qlogic.com>

From: Shahed Shaikh <shahed.shaikh@qlogic.com>

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h      |    2 ++
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c   |   15 ++++++++++++++-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c   |   22 ++++++++++++++++------
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |    6 ++++++
 4 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index c1ab34e..311d545 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -436,6 +436,7 @@ struct qlcnic_hardware_context {
 	u16 act_pci_func;
 
 	u32 capabilities;
+	u32 capabilities2;
 	u32 temp;
 	u32 int_vec_bit;
 	u32 fw_hal_version;
@@ -798,6 +799,7 @@ struct qlcnic_mac_list_s {
 #define QLCNIC_FW_CAPABILITY_MORE_CAPS		BIT_31
 
 #define QLCNIC_FW_CAPABILITY_2_LRO_MAX_TCP_SEG	BIT_2
+#define QLCNIC_FW_CAP2_HW_LRO_IPV6		BIT_3
 #define QLCNIC_FW_CAPABILITY_2_OCBB		BIT_5
 
 /* module types */
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index 6f5b5eb..8e0412b 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -687,6 +687,11 @@ void qlcnic_82xx_config_intr_coalesce(struct qlcnic_adapter *adapter)
 			"Could not send interrupt coalescing parameters\n");
 }
 
+#define QLCNIC_ENABLE_IPV4_LRO		1
+#define QLCNIC_ENABLE_IPV6_LRO		2
+#define QLCNIC_NO_DEST_IPV4_CHECK	(1 << 8)
+#define QLCNIC_NO_DEST_IPV6_CHECK	(2 << 8)
+
 int qlcnic_82xx_config_hw_lro(struct qlcnic_adapter *adapter, int enable)
 {
 	struct qlcnic_nic_req req;
@@ -703,7 +708,15 @@ int qlcnic_82xx_config_hw_lro(struct qlcnic_adapter *adapter, int enable)
 	word = QLCNIC_H2C_OPCODE_CONFIG_HW_LRO | ((u64)adapter->portnum << 16);
 	req.req_hdr = cpu_to_le64(word);
 
-	req.words[0] = cpu_to_le64(enable);
+	word = 0;
+	if (enable) {
+		word = QLCNIC_ENABLE_IPV4_LRO | QLCNIC_NO_DEST_IPV4_CHECK;
+		if (adapter->ahw->capabilities2 & QLCNIC_FW_CAP2_HW_LRO_IPV6)
+			word |= QLCNIC_ENABLE_IPV6_LRO |
+				QLCNIC_NO_DEST_IPV6_CHECK;
+	}
+
+	req.words[0] = cpu_to_le64(word);
 
 	rv = qlcnic_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
 	if (rv != 0)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
index 383ecd2..0033971 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
@@ -973,6 +973,7 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter,
 	struct sk_buff *skb;
 	struct qlcnic_host_rds_ring *rds_ring;
 	struct iphdr *iph;
+	struct ipv6hdr *ipv6h;
 	struct tcphdr *th;
 	bool push, timestamp;
 	int index, l2_hdr_offset, l4_hdr_offset;
@@ -1016,12 +1017,21 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter,
 	}
 
 	skb->protocol = eth_type_trans(skb, netdev);
-	iph = (struct iphdr *)skb->data;
-	th = (struct tcphdr *)(skb->data + (iph->ihl << 2));
-	length = (iph->ihl << 2) + (th->doff << 2) + lro_length;
-	iph->tot_len = htons(length);
-	iph->check = 0;
-	iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
+
+	if (htons(skb->protocol) == ETH_P_IPV6) {
+		ipv6h = (struct ipv6hdr *)skb->data;
+		th = (struct tcphdr *)(skb->data + sizeof(struct ipv6hdr));
+		length = (th->doff << 2) + lro_length;
+		ipv6h->payload_len = htons(length);
+	} else {
+		iph = (struct iphdr *)skb->data;
+		th = (struct tcphdr *)(skb->data + (iph->ihl << 2));
+		length = (iph->ihl << 2) + (th->doff << 2) + lro_length;
+		iph->tot_len = htons(length);
+		iph->check = 0;
+		iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
+	}
+
 	th->psh = push;
 	th->seq = htonl(seq_number);
 	length = skb->len;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 5f3308a..e460401 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -781,6 +781,12 @@ qlcnic_initialize_nic(struct qlcnic_adapter *adapter)
 	adapter->ahw->max_tx_ques = nic_info.max_tx_ques;
 	adapter->ahw->max_rx_ques = nic_info.max_rx_ques;
 	adapter->ahw->capabilities = nic_info.capabilities;
+
+	if (adapter->ahw->capabilities & QLCNIC_FW_CAPABILITY_MORE_CAPS) {
+		u32 temp;
+		temp = QLCRD32(adapter, CRB_FW_CAPABILITIES_2);
+		adapter->ahw->capabilities2 = temp;
+	}
 	adapter->ahw->max_mac_filters = nic_info.max_mac_filters;
 	adapter->ahw->max_mtu = nic_info.max_mtu;
 
-- 
1.7.1

^ permalink raw reply related

* [net-next PATCH 1/8] qlcnic: set driver version in firmware
From: Jitendra Kalsaria @ 2013-01-25 20:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, sony.chacko, Dept_NX_Linux_NIC_Driver, Sritej Velaga
In-Reply-To: <1359145241-5175-1-git-send-email-jitendra.kalsaria@qlogic.com>

From: Sritej Velaga <sritej.velaga@qlogic.com>

Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h      |    2 +
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c  |   31 ++++++++++++++++++++++
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |    9 ++++++
 3 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 893cbe8..c1ab34e 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -798,6 +798,7 @@ struct qlcnic_mac_list_s {
 #define QLCNIC_FW_CAPABILITY_MORE_CAPS		BIT_31
 
 #define QLCNIC_FW_CAPABILITY_2_LRO_MAX_TCP_SEG	BIT_2
+#define QLCNIC_FW_CAPABILITY_2_OCBB		BIT_5
 
 /* module types */
 #define LINKEVENT_MODULE_NOT_PRESENT			1
@@ -1421,6 +1422,7 @@ void qlcnic_set_multi(struct net_device *netdev);
 void qlcnic_free_mac_list(struct qlcnic_adapter *adapter);
 
 int qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu);
+int qlcnic_fw_cmd_set_drv_version(struct qlcnic_adapter *);
 int qlcnic_change_mtu(struct net_device *netdev, int new_mtu);
 netdev_features_t qlcnic_fix_features(struct net_device *netdev,
 	netdev_features_t features);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
index ee68fe3..7372964 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
@@ -160,6 +160,37 @@ int qlcnic_82xx_issue_cmd(struct qlcnic_adapter *adapter,
 	return cmd->rsp.arg[0];
 }
 
+int qlcnic_fw_cmd_set_drv_version(struct qlcnic_adapter *adapter)
+{
+	struct qlcnic_cmd_args cmd;
+	u32 arg1, arg2, arg3;
+	char drv_string[12];
+	int err = 0;
+
+	memset(drv_string, 0, sizeof(drv_string));
+	snprintf(drv_string, sizeof(drv_string), "%d"".""%d"".""%d",
+		 _QLCNIC_LINUX_MAJOR, _QLCNIC_LINUX_MINOR,
+		 _QLCNIC_LINUX_SUBVERSION);
+
+	qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_SET_DRV_VER);
+	memcpy(&arg1, drv_string, sizeof(u32));
+	memcpy(&arg2, drv_string + 4, sizeof(u32));
+	memcpy(&arg3, drv_string + 8, sizeof(u32));
+
+	cmd.req.arg[1] = arg1;
+	cmd.req.arg[2] = arg2;
+	cmd.req.arg[3] = arg3;
+
+	err = qlcnic_issue_cmd(adapter, &cmd);
+	if (err) {
+		dev_info(&adapter->pdev->dev,
+			 "Failed to set driver version in firmware\n");
+		return -EIO;
+	}
+
+	return 0;
+}
+
 int
 qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu)
 {
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index fb7ac8e..5f3308a 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -1724,6 +1724,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct qlcnic_adapter *adapter = NULL;
 	struct qlcnic_hardware_context *ahw;
 	int err, pci_using_dac = -1;
+	u32 capab2;
 	char board_name[QLCNIC_MAX_BOARD_NAME_LEN];
 
 	err = pci_enable_device(pdev);
@@ -1849,6 +1850,14 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (err)
 		goto err_out_disable_mbx_intr;
 
+	if (qlcnic_82xx_check(adapter)) {
+		if (ahw->capabilities & QLCNIC_FW_CAPABILITY_MORE_CAPS) {
+			capab2 = QLCRD32(adapter, CRB_FW_CAPABILITIES_2);
+			if (capab2 & QLCNIC_FW_CAPABILITY_2_OCBB)
+				qlcnic_fw_cmd_set_drv_version(adapter);
+		}
+	}
+
 	pci_set_drvdata(pdev, adapter);
 
 	if (qlcnic_82xx_check(adapter))
-- 
1.7.1

^ permalink raw reply related

* [PATCH net-next 0/8] qlcnic: bug fix and feature updates
From: Jitendra Kalsaria @ 2013-01-25 20:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, sony.chacko, Dept_NX_Linux_NIC_Driver, Jitendra Kalsaria

From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>

Please apply it to net-next.

Thanks,
Jitendra

^ 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