Netdev List
 help / color / mirror / Atom feed
* [PATCH 0/2] Bluetooth: Fix regressions for 3.0
From: Gustavo F. Padovan @ 2011-07-16  4:30 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: linville-2XuSBdqkA4R54TAoqtyWWQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-bluetooth-u79uwXL29TY76Z2rM5mHXA, Gustavo F. Padovan

From: "Gustavo F. Padovan" <padovan-Y3ZbgMPKUGA34EUeqzHoZw@public.gmane.org>

Gustavo F. Padovan (1):
  Bluetooth: Fix regression in L2CAP connection procedure

Ilia Kolomisnky (1):
  Bluetooth: Fix crash with incoming L2CAP connections

 net/bluetooth/l2cap_core.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

-- 
1.7.6

^ permalink raw reply

* Re: [PATCH net-next] bnx2: Close device if tx_timeout reset fails
From: Flavio Leitner @ 2011-07-16  3:16 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev
In-Reply-To: <1310748838-30877-1-git-send-email-mchan@broadcom.com>

On Fri, 15 Jul 2011 09:53:58 -0700
"Michael Chan" <mchan@broadcom.com> wrote:
...
> To fix it, we call dev_close() if bnx2_init_nic() fails.
> One minor wrinkle to deal with is the cancel_work_sync()
> call in bnx2_close() to cancel bnx2_reset_task().  The
> call will wait forever because it is trying to cancel
> itself and the workqueue will be stuck.
> 
> Since bnx2_reset_task() holds the rtnl_lock() and checks
> for netif_running() before proceeding, there is no need
> to cancel bnx2_reset_task() in bnx2_close() even if
> bnx2_close() and bnx2_reset_task() are running concurrently.
> The rtnl_lock() serializes the 2 calls.
> 
> We need to move the cancel_work_sync() call to
> bnx2_remove_one() to make sure it is canceled before freeing
> the netdev struct.

It looks good. I'm traveling now, so I'll test this on Monday.
thanks,
fbl

^ permalink raw reply

* Re: [PATCH] iproute2: Auto-detect the presence of setns in libc
From: Dan McGee @ 2011-07-16  0:34 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Stephen Hemminger, netdev
In-Reply-To: <m1mxgfkr3g.fsf@fess.ebiederm.org>

On Fri, Jul 15, 2011 at 7:26 PM, Eric W. Biederman
<ebiederm@xmission.com> wrote:
>
> If libc has setns present use that version instead of
> rolling the syscall wrapper by hand.
>
> Dan McGee found the following compile error:
>
>    gcc -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I../include
>    -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib/\"   -c -o ipnetns.o ipnetns.c
>    ipnetns.c:31:12: error: static declaration of ‘setns’ follows non-static
>    declaration
>    /usr/include/bits/sched.h:93:12: note: previous declaration of ‘setns’
>    was here
>    make[1]: *** [ipnetns.o] Error 1
>
> Reported-by:  Dan McGee <dan@archlinux.org>
> Tested-by:  Dan McGee <dan@archlinux.org>
Should mention that this was tested on glibc 2.14, where the setns
function was introduced.

> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>

And I forgot to be explicit, but:
Signed-off--by:  Dan McGee <dan@archlinux.org>

> ---
>  configure    |   24 ++++++++++++++++++++++++
>  ip/Makefile  |    6 ++++++
>  ip/ipnetns.c |    2 ++
>  3 files changed, 32 insertions(+), 0 deletions(-)
>
> diff --git a/configure b/configure
> index 69797ab..cfcc82a 100755
> --- a/configure
> +++ b/configure
> @@ -163,6 +163,27 @@ check_ipt_lib_dir()
>        echo "not found!"
>  }
>
> +check_setns()
> +{
> +cat >/tmp/setnstest.c <<EOF
> +#include <sched.h>
> +int main(int argc, char **argv)
> +{
> +       (void)setns(0,0);
> +       return 0;
> +}
> +EOF
> +gcc -I$INCLUDE -o /tmp/setnstest /tmp/setnstest.c >/dev/null 2>&1
> +if [ $? -eq 0 ]
> +then
> +       echo "IP_CONFIG_SETNS:=y" >>Config
> +       echo "yes"
> +else
> +       echo "no"
> +fi
> +rm -f /tmp/setnstest.c /tmp/setnstest
> +}
> +
>  echo "# Generated config based on" $INCLUDE >Config
>
>  echo "TC schedulers"
> @@ -178,3 +199,6 @@ check_ipt
>
>  echo -n "iptables modules directory: "
>  check_ipt_lib_dir
> +
> +echo -n "libc has setns: "
> +check_setns
> diff --git a/ip/Makefile b/ip/Makefile
> index 2ee4e7c..8d03993 100644
> --- a/ip/Makefile
> +++ b/ip/Makefile
> @@ -7,6 +7,12 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
>
>  RTMONOBJ=rtmon.o
>
> +include ../Config
> +
> +ifeq ($(IP_CONFIG_SETNS),y)
> +       CFLAGS += -DHAVE_SETNS
> +endif
> +
>  ALLOBJ=$(IPOBJ) $(RTMONOBJ)
>  SCRIPTS=ifcfg rtpr routel routef
>  TARGETS=ip rtmon
> diff --git a/ip/ipnetns.c b/ip/ipnetns.c
> index db7007c..dff3497 100644
> --- a/ip/ipnetns.c
> +++ b/ip/ipnetns.c
> @@ -28,6 +28,7 @@
>  #define MNT_DETACH     0x00000002      /* Just detach from the tree */
>  #endif /* MNT_DETACH */
>
> +#ifndef HAVE_SETNS
>  static int setns(int fd, int nstype)
>  {
>  #ifdef __NR_setns
> @@ -37,6 +38,7 @@ static int setns(int fd, int nstype)
>        return -1;
>  #endif
>  }
> +#endif /* HAVE_SETNS */
>
>
>  static int touch(const char *path, mode_t mode)
> --
> 1.7.5.1.217.g4e3aa
>
>

^ permalink raw reply

* [PATCH] iproute2: Fail "ip netns add" on existing network namespaces.
From: Eric W. Biederman @ 2011-07-16  0:29 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev


Use O_EXCL so that we only create and mount a new network namespace
if there is no chance an existing network namespace is present.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---

 ip/ipnetns.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index dff3497..e41a598 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -41,16 +41,6 @@ static int setns(int fd, int nstype)
 #endif /* HAVE_SETNS */
 
 
-static int touch(const char *path, mode_t mode)
-{
-	int fd;
-	fd = open(path, O_RDONLY|O_CREAT, mode);
-	if (fd < 0)
-		return -1;
-	close(fd);
-	return 0;
-}
-
 static void usage(void) __attribute__((noreturn));
 
 static void usage(void)
@@ -214,6 +204,7 @@ static int netns_add(int argc, char **argv)
 	 */
 	char netns_path[MAXPATHLEN];
 	const char *name;
+	int fd;
 
 	if (argc < 1) {
 		fprintf(stderr, "No netns name specified\n");
@@ -227,11 +218,13 @@ static int netns_add(int argc, char **argv)
 	mkdir(NETNS_RUN_DIR, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
 
 	/* Create the filesystem state */
-	if (touch(netns_path, 0) < 0) {
+	fd = open(netns_path, O_RDONLY|O_CREAT|O_EXCL, 0);
+	if (fd < 0) {
 		fprintf(stderr, "Could not create %s: %s\n",
 			netns_path, strerror(errno));
-		goto out_delete;
+		return -1;
 	}
+	close(fd);
 	if (unshare(CLONE_NEWNET) < 0) {
 		fprintf(stderr, "Failed to create a new network namespace: %s\n",
 			strerror(errno));
-- 
1.7.5.1.217.g4e3aa


^ permalink raw reply related

* [PATCH] iproute2: Auto-detect the presence of setns in libc
From: Eric W. Biederman @ 2011-07-16  0:26 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Dan McGee


If libc has setns present use that version instead of
rolling the syscall wrapper by hand.

Dan McGee found the following compile error:

    gcc -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I../include
    -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib/\"   -c -o ipnetns.o ipnetns.c
    ipnetns.c:31:12: error: static declaration of ‘setns’ follows non-static
    declaration
    /usr/include/bits/sched.h:93:12: note: previous declaration of ‘setns’
    was here
    make[1]: *** [ipnetns.o] Error 1

Reported-by:  Dan McGee <dan@archlinux.org>
Tested-by:  Dan McGee <dan@archlinux.org>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 configure    |   24 ++++++++++++++++++++++++
 ip/Makefile  |    6 ++++++
 ip/ipnetns.c |    2 ++
 3 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 69797ab..cfcc82a 100755
--- a/configure
+++ b/configure
@@ -163,6 +163,27 @@ check_ipt_lib_dir()
 	echo "not found!"
 }
 
+check_setns()
+{
+cat >/tmp/setnstest.c <<EOF
+#include <sched.h>
+int main(int argc, char **argv) 
+{
+	(void)setns(0,0);
+	return 0;
+}
+EOF
+gcc -I$INCLUDE -o /tmp/setnstest /tmp/setnstest.c >/dev/null 2>&1
+if [ $? -eq 0 ]
+then
+	echo "IP_CONFIG_SETNS:=y" >>Config
+	echo "yes"
+else
+	echo "no"
+fi
+rm -f /tmp/setnstest.c /tmp/setnstest
+}
+
 echo "# Generated config based on" $INCLUDE >Config
 
 echo "TC schedulers"
@@ -178,3 +199,6 @@ check_ipt
 
 echo -n "iptables modules directory: "
 check_ipt_lib_dir
+
+echo -n "libc has setns: "
+check_setns
diff --git a/ip/Makefile b/ip/Makefile
index 2ee4e7c..8d03993 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -7,6 +7,12 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
 
 RTMONOBJ=rtmon.o
 
+include ../Config
+
+ifeq ($(IP_CONFIG_SETNS),y)
+	CFLAGS += -DHAVE_SETNS
+endif
+
 ALLOBJ=$(IPOBJ) $(RTMONOBJ)
 SCRIPTS=ifcfg rtpr routel routef
 TARGETS=ip rtmon
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index db7007c..dff3497 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -28,6 +28,7 @@
 #define MNT_DETACH	0x00000002	/* Just detach from the tree */
 #endif /* MNT_DETACH */
 
+#ifndef HAVE_SETNS
 static int setns(int fd, int nstype)
 {
 #ifdef __NR_setns
@@ -37,6 +38,7 @@ static int setns(int fd, int nstype)
 	return -1;
 #endif
 }
+#endif /* HAVE_SETNS */
 
 
 static int touch(const char *path, mode_t mode)
-- 
1.7.5.1.217.g4e3aa


^ permalink raw reply related

* Re: recommended way to support duplicate IP addresses on different VLANs?
From: Eric W. Biederman @ 2011-07-16  0:24 UTC (permalink / raw)
  To: Rémi Denis-Courmont; +Cc: Chris Friesen, netdev
In-Reply-To: <201107111804.26500.remi@remlab.net>

"Rémi Denis-Courmont" <remi@remlab.net> writes:

> Le lundi 11 juillet 2011 17:58:14 Chris Friesen, vous avez écrit :
>> Hi all,
>> 
>> We've got a server that sits on multiple VLANs.  Each VLAN is segregated
>> and doesn't know about the others.  The IP address ranges in each of the
>> VLANs may overlap, and the server may be assigned the same IP address in
>> multiple VLANs.
>> 
>> We've got a messy solution now involving unique internal addresses and
>> NATing between those and the duplicate external addresses, but I'm
>> wondering if there is a cleaner way to handle this.
>> 
>> It seems like network namespaces would work, but it would require
>> multiple instances of our software which is a dealbreaker.
>> 
>> Is there any other way to deal with this scenario?
>
> Namespace file descriptors if/when they get accepted.

For reference.

The namespace file descriptor code is in 3.0.  setns is present in the
latest glibc.  And the iproute support is just finishing up.

What doesn't exist at the moment is a handy socketat library
function to make it a userspace program that uses multiple network
namespaces trivial.  But that is only a few lines of code.

It sounds like you don't need the full generality of network
namespaces but if you do the functionality is present.

Eric

^ permalink raw reply

* Re: [PATCH] Rename static setns() function
From: Dan McGee @ 2011-07-16  0:02 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: netdev
In-Reply-To: <m1d3hbm7s7.fsf@fess.ebiederm.org>

On Fri, Jul 15, 2011 at 6:41 PM, Eric W. Biederman
<ebiederm@xmission.com> wrote:
>
> Dan can you try this patch I think it does a better job at dealing
> with libc defining setns but I don't have a brand new libc handy
> to test with.

Works perfectly (as long as one remembers to rerun ./configure first).
It also works fine with my other configure patch I sent to the list.

-Dan

> From: "Eric W. Biederman" <ebiederm@xmission.com>
> Date: Fri, 15 Jul 2011 16:36:33 -0700
> Subject: [PATCH] iproute2: Auto-detect the presence of setns in libc
>
> If libc has setns present use that version instead of
> rolling the syscall wrapper by hand.
>
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
> ---
>  configure    |   24 ++++++++++++++++++++++++
>  ip/Makefile  |    6 ++++++
>  ip/ipnetns.c |    2 ++
>  3 files changed, 32 insertions(+), 0 deletions(-)
>
> diff --git a/configure b/configure
> index 69797ab..cfcc82a 100755
> --- a/configure
> +++ b/configure
> @@ -163,6 +163,27 @@ check_ipt_lib_dir()
>        echo "not found!"
>  }
>
> +check_setns()
> +{
> +cat >/tmp/setnstest.c <<EOF
> +#include <sched.h>
> +int main(int argc, char **argv)
> +{
> +       (void)setns(0,0);
> +       return 0;
> +}
> +EOF
> +gcc -I$INCLUDE -o /tmp/setnstest /tmp/setnstest.c >/dev/null 2>&1
> +if [ $? -eq 0 ]
> +then
> +       echo "IP_CONFIG_SETNS:=y" >>Config
> +       echo "yes"
> +else
> +       echo "no"
> +fi
> +rm -f /tmp/setnstest.c /tmp/setnstest
> +}
> +
>  echo "# Generated config based on" $INCLUDE >Config
>
>  echo "TC schedulers"
> @@ -178,3 +199,6 @@ check_ipt
>
>  echo -n "iptables modules directory: "
>  check_ipt_lib_dir
> +
> +echo -n "libc has setns: "
> +check_setns
> diff --git a/ip/Makefile b/ip/Makefile
> index 2ee4e7c..8d03993 100644
> --- a/ip/Makefile
> +++ b/ip/Makefile
> @@ -7,6 +7,12 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
>
>  RTMONOBJ=rtmon.o
>
> +include ../Config
> +
> +ifeq ($(IP_CONFIG_SETNS),y)
> +       CFLAGS += -DHAVE_SETNS
> +endif
> +
>  ALLOBJ=$(IPOBJ) $(RTMONOBJ)
>  SCRIPTS=ifcfg rtpr routel routef
>  TARGETS=ip rtmon
> diff --git a/ip/ipnetns.c b/ip/ipnetns.c
> index db7007c..dff3497 100644
> --- a/ip/ipnetns.c
> +++ b/ip/ipnetns.c
> @@ -28,6 +28,7 @@
>  #define MNT_DETACH     0x00000002      /* Just detach from the tree */
>  #endif /* MNT_DETACH */
>
> +#ifndef HAVE_SETNS
>  static int setns(int fd, int nstype)
>  {
>  #ifdef __NR_setns
> @@ -37,6 +38,7 @@ static int setns(int fd, int nstype)
>        return -1;
>  #endif
>  }
> +#endif /* HAVE_SETNS */
>
>
>  static int touch(const char *path, mode_t mode)
> --
> 1.7.5.1.217.g4e3aa
>
>

^ permalink raw reply

* Re: [PATCH] Rename static setns() function
From: Eric W. Biederman @ 2011-07-15 23:41 UTC (permalink / raw)
  To: Dan McGee; +Cc: netdev
In-Reply-To: <1310755099-32438-1-git-send-email-dan@archlinux.org>


Dan can you try this patch I think it does a better job at dealing
with libc defining setns but I don't have a brand new libc handy
to test with.

Eric

From: "Eric W. Biederman" <ebiederm@xmission.com>
Date: Fri, 15 Jul 2011 16:36:33 -0700
Subject: [PATCH] iproute2: Auto-detect the presence of setns in libc

If libc has setns present use that version instead of
rolling the syscall wrapper by hand.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 configure    |   24 ++++++++++++++++++++++++
 ip/Makefile  |    6 ++++++
 ip/ipnetns.c |    2 ++
 3 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 69797ab..cfcc82a 100755
--- a/configure
+++ b/configure
@@ -163,6 +163,27 @@ check_ipt_lib_dir()
 	echo "not found!"
 }
 
+check_setns()
+{
+cat >/tmp/setnstest.c <<EOF
+#include <sched.h>
+int main(int argc, char **argv) 
+{
+	(void)setns(0,0);
+	return 0;
+}
+EOF
+gcc -I$INCLUDE -o /tmp/setnstest /tmp/setnstest.c >/dev/null 2>&1
+if [ $? -eq 0 ]
+then
+	echo "IP_CONFIG_SETNS:=y" >>Config
+	echo "yes"
+else
+	echo "no"
+fi
+rm -f /tmp/setnstest.c /tmp/setnstest
+}
+
 echo "# Generated config based on" $INCLUDE >Config
 
 echo "TC schedulers"
@@ -178,3 +199,6 @@ check_ipt
 
 echo -n "iptables modules directory: "
 check_ipt_lib_dir
+
+echo -n "libc has setns: "
+check_setns
diff --git a/ip/Makefile b/ip/Makefile
index 2ee4e7c..8d03993 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -7,6 +7,12 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
 
 RTMONOBJ=rtmon.o
 
+include ../Config
+
+ifeq ($(IP_CONFIG_SETNS),y)
+	CFLAGS += -DHAVE_SETNS
+endif
+
 ALLOBJ=$(IPOBJ) $(RTMONOBJ)
 SCRIPTS=ifcfg rtpr routel routef
 TARGETS=ip rtmon
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index db7007c..dff3497 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -28,6 +28,7 @@
 #define MNT_DETACH	0x00000002	/* Just detach from the tree */
 #endif /* MNT_DETACH */
 
+#ifndef HAVE_SETNS
 static int setns(int fd, int nstype)
 {
 #ifdef __NR_setns
@@ -37,6 +38,7 @@ static int setns(int fd, int nstype)
 	return -1;
 #endif
 }
+#endif /* HAVE_SETNS */
 
 
 static int touch(const char *path, mode_t mode)
-- 
1.7.5.1.217.g4e3aa


^ permalink raw reply related

* Re: [patch net-next-2.6 00/22] vlan cleanup round1
From: Jiri Pirko @ 2011-07-15 23:07 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: netdev, davem, shemminger, eric.dumazet, greearb
In-Reply-To: <CAHXqBFJiNx3N+Rs_dxMqSThN59kvmYauU=-mWvZEf9pUQ-MoZA@mail.gmail.com>

Sat, Jul 16, 2011 at 12:15:42AM CEST, mirqus@gmail.com wrote:
>2011/7/15 Jiri Pirko <jpirko@redhat.com>:
>> This patchset converts several drivers to new vlan model.
>> Also kills several vlan helpers:
>> vlan_hwaccel_receive_skb,
>> lro_vlan_hwaccel_receive_frags,
>> lro_vlan_hwaccel_receive_skb
>
>It looks like most drivers that implement rx_add/kill_vid also need
>bitmap recording all enabled VLANs. I think this could be done in
>networking core for those devices in a generic way (set/clear before
>corresponding rx_add/kill_vid call). The bitmap should be dynamically
>allocated when needed (either on device registration time, or adding
>first VLAN).

Right, I'm going to think about it. I might repost this patchset after
that, So Dave please do not apply right away, thanks.

Jirka
>
>This might be out of scope for this cleanup, though.
>
>Looks good otherwise.
>
>Best Regards,
>Michał Mirosław

^ permalink raw reply

* Re: [PATCH] gianfar: rx parser
From: David Miller @ 2011-07-15 23:00 UTC (permalink / raw)
  To: jpirko; +Cc: sebastian.belden, netdev, sandeep.kumar
In-Reply-To: <20110715195133.GA3499@minipsycho.orion>

From: Jiri Pirko <jpirko@redhat.com>
Date: Fri, 15 Jul 2011 21:51:34 +0200

> From: Sebastian Pöhn <sebastian.belden@googlemail.com>
> Subject: [patch net-next-2.6] gianfar: rx parser
> 
> Only let the rx parser be enabled if it is necessary (if VLAN extraction,
> IP or TCP checksumming or the rx queue filer are enabled). Otherwise
> disable it.
> 
> The new routine gfar_check_rx_parser_mode should be run after every
> change on this features and will enable/disable the parser as necessary.
> 
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> Signed-off-by: Sebastian Poehn <sebastian.poehn@belden.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] Rename static setns() function
From: David Miller @ 2011-07-15 22:58 UTC (permalink / raw)
  To: dan; +Cc: netdev, ebiederm
In-Reply-To: <1310755099-32438-1-git-send-email-dan@archlinux.org>

From: Dan McGee <dan@archlinux.org>
Date: Fri, 15 Jul 2011 13:38:19 -0500

> Fixes the following error:
> 
>     gcc -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I../include
>     -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib/\"   -c -o ipnetns.o ipnetns.c
>     ipnetns.c:31:12: error: static declaration of ‘setns’ follows non-static
>     declaration
>     /usr/include/bits/sched.h:93:12: note: previous declaration of ‘setns’
>     was here
>     make[1]: *** [ipnetns.o] Error 1
> 
> Fixes issue introduced in commit 0dc34c7713bb7055.
> 
> Signed-off-by: Dan McGee <dan@archlinux.org>

Thanks for fixing this:

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

^ permalink raw reply

* Re: [PATCH 03/10] net: add APIs for manipulating skb page fragments.
From: Michał Mirosław @ 2011-07-15 22:34 UTC (permalink / raw)
  To: Ian Campbell
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-nfs-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1310728031-19569-3-git-send-email-ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>

2011/7/15 Ian Campbell <ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>:
[...]
> +static inline dma_addr_t skb_frag_pci_map(struct pci_dev *hwdev,
> +                                         const skb_frag_t *frag,
> +                                         unsigned long offset,
> +                                         size_t size,
> +                                         int direction)
> +
> +{
> +       return pci_map_page(hwdev, __skb_frag_page(frag),
> +                           frag->page_offset + offset, size, direction);
> +}

You can get rid of this one, as drivers should be converted to generic
DMA API instead. The change is only in passing &pci_dev->dev instead
of pci_dev.

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

^ permalink raw reply

* Re: [patch net-next-2.6 00/22] vlan cleanup round1
From: Michał Mirosław @ 2011-07-15 22:15 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, davem, shemminger, eric.dumazet, greearb
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

2011/7/15 Jiri Pirko <jpirko@redhat.com>:
> This patchset converts several drivers to new vlan model.
> Also kills several vlan helpers:
> vlan_hwaccel_receive_skb,
> lro_vlan_hwaccel_receive_frags,
> lro_vlan_hwaccel_receive_skb

It looks like most drivers that implement rx_add/kill_vid also need
bitmap recording all enabled VLANs. I think this could be done in
networking core for those devices in a generic way (set/clear before
corresponding rx_add/kill_vid call). The bitmap should be dynamically
allocated when needed (either on device registration time, or adding
first VLAN).

This might be out of scope for this cleanup, though.

Looks good otherwise.

Best Regards,
Michał Mirosław

^ permalink raw reply

* [patch net-next-2.6 14/21] mlx4: do vlan cleanup
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

- unify vlan and nonvlan path
- kill priv->vlgrp and mlx4_en_vlan_rx_register

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/mlx4/en_netdev.c |   49 +++++++++--------------------------------
 drivers/net/mlx4/en_port.c   |   23 +++++++------------
 drivers/net/mlx4/en_rx.c     |   24 +++++++++++---------
 drivers/net/mlx4/mlx4_en.h   |    6 +++-
 4 files changed, 37 insertions(+), 65 deletions(-)

diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c
index 61850ad..9d3f57e 100644
--- a/drivers/net/mlx4/en_netdev.c
+++ b/drivers/net/mlx4/en_netdev.c
@@ -45,25 +45,6 @@
 #include "mlx4_en.h"
 #include "en_port.h"
 
-
-static void mlx4_en_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
-{
-	struct mlx4_en_priv *priv = netdev_priv(dev);
-	struct mlx4_en_dev *mdev = priv->mdev;
-	int err;
-
-	en_dbg(HW, priv, "Registering VLAN group:%p\n", grp);
-	priv->vlgrp = grp;
-
-	mutex_lock(&mdev->state_lock);
-	if (mdev->device_up && priv->port_up) {
-		err = mlx4_SET_VLAN_FLTR(mdev->dev, priv->port, grp);
-		if (err)
-			en_err(priv, "Failed configuring VLAN filter\n");
-	}
-	mutex_unlock(&mdev->state_lock);
-}
-
 static void mlx4_en_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
@@ -71,16 +52,14 @@ static void mlx4_en_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
 	int err;
 	int idx;
 
-	if (!priv->vlgrp)
-		return;
+	en_dbg(HW, priv, "adding VLAN:%d\n", vid);
 
-	en_dbg(HW, priv, "adding VLAN:%d (vlgrp entry:%p)\n",
-	       vid, vlan_group_get_device(priv->vlgrp, vid));
+	set_bit(vid, priv->active_vlans);
 
 	/* Add VID to port VLAN filter */
 	mutex_lock(&mdev->state_lock);
 	if (mdev->device_up && priv->port_up) {
-		err = mlx4_SET_VLAN_FLTR(mdev->dev, priv->port, priv->vlgrp);
+		err = mlx4_SET_VLAN_FLTR(mdev->dev, priv);
 		if (err)
 			en_err(priv, "Failed configuring VLAN filter\n");
 	}
@@ -97,12 +76,9 @@ static void mlx4_en_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 	int err;
 	int idx;
 
-	if (!priv->vlgrp)
-		return;
+	en_dbg(HW, priv, "Killing VID:%d\n", vid);
 
-	en_dbg(HW, priv, "Killing VID:%d (vlgrp:%p vlgrp entry:%p)\n",
-	       vid, priv->vlgrp, vlan_group_get_device(priv->vlgrp, vid));
-	vlan_group_set_device(priv->vlgrp, vid, NULL);
+	clear_bit(vid, priv->active_vlans);
 
 	/* Remove VID from port VLAN filter */
 	mutex_lock(&mdev->state_lock);
@@ -112,7 +88,7 @@ static void mlx4_en_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 		en_err(priv, "could not find vid %d in cache\n", vid);
 
 	if (mdev->device_up && priv->port_up) {
-		err = mlx4_SET_VLAN_FLTR(mdev->dev, priv->port, priv->vlgrp);
+		err = mlx4_SET_VLAN_FLTR(mdev->dev, priv);
 		if (err)
 			en_err(priv, "Failed configuring VLAN filter\n");
 	}
@@ -265,12 +241,10 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
 				priv->flags |= MLX4_EN_FLAG_MC_PROMISC;
 			}
 
-			if (priv->vlgrp) {
-				/* Disable port VLAN filter */
-				err = mlx4_SET_VLAN_FLTR(mdev->dev, priv->port, NULL);
-				if (err)
-					en_err(priv, "Failed disabling VLAN filter\n");
-			}
+			/* Disable port VLAN filter */
+			err = mlx4_SET_VLAN_FLTR(mdev->dev, priv);
+			if (err)
+				en_err(priv, "Failed disabling VLAN filter\n");
 		}
 		goto out;
 	}
@@ -304,7 +278,7 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
 		}
 
 		/* Enable port VLAN filter */
-		err = mlx4_SET_VLAN_FLTR(mdev->dev, priv->port, priv->vlgrp);
+		err = mlx4_SET_VLAN_FLTR(mdev->dev, priv);
 		if (err)
 			en_err(priv, "Failed enabling VLAN filter\n");
 	}
@@ -1046,7 +1020,6 @@ static const struct net_device_ops mlx4_netdev_ops = {
 	.ndo_validate_addr	= eth_validate_addr,
 	.ndo_change_mtu		= mlx4_en_change_mtu,
 	.ndo_tx_timeout		= mlx4_en_tx_timeout,
-	.ndo_vlan_rx_register	= mlx4_en_vlan_rx_register,
 	.ndo_vlan_rx_add_vid	= mlx4_en_vlan_rx_add_vid,
 	.ndo_vlan_rx_kill_vid	= mlx4_en_vlan_rx_kill_vid,
 #ifdef CONFIG_NET_POLL_CONTROLLER
diff --git a/drivers/net/mlx4/en_port.c b/drivers/net/mlx4/en_port.c
index f2a4f5d..2a74bc8 100644
--- a/drivers/net/mlx4/en_port.c
+++ b/drivers/net/mlx4/en_port.c
@@ -48,7 +48,7 @@ int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port,
 			MLX4_CMD_SET_MCAST_FLTR, MLX4_CMD_TIME_CLASS_B);
 }
 
-int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, u8 port, struct vlan_group *grp)
+int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, struct mlx4_en_priv *priv)
 {
 	struct mlx4_cmd_mailbox *mailbox;
 	struct mlx4_set_vlan_fltr_mbox *filter;
@@ -63,20 +63,15 @@ int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, u8 port, struct vlan_group *grp)
 		return PTR_ERR(mailbox);
 
 	filter = mailbox->buf;
-	if (grp) {
-		memset(filter, 0, sizeof *filter);
-		for (i = VLAN_FLTR_SIZE - 1; i >= 0; i--) {
-			entry = 0;
-			for (j = 0; j < 32; j++)
-				if (vlan_group_get_device(grp, index++))
-					entry |= 1 << j;
-			filter->entry[i] = cpu_to_be32(entry);
-		}
-	} else {
-		/* When no vlans are configured we block all vlans */
-		memset(filter, 0, sizeof(*filter));
+	memset(filter, 0, sizeof(*filter));
+	for (i = VLAN_FLTR_SIZE - 1; i >= 0; i--) {
+		entry = 0;
+		for (j = 0; j < 32; j++)
+			if (test_bit(index++, priv->active_vlans))
+				entry |= 1 << j;
+		filter->entry[i] = cpu_to_be32(entry);
 	}
-	err = mlx4_cmd(dev, mailbox->dma, port, 0, MLX4_CMD_SET_VLAN_FLTR,
+	err = mlx4_cmd(dev, mailbox->dma, priv->port, 0, MLX4_CMD_SET_VLAN_FLTR,
 		       MLX4_CMD_TIME_CLASS_B);
 	mlx4_free_cmd_mailbox(dev, mailbox);
 	return err;
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
index 5197b50..37cc9e5 100644
--- a/drivers/net/mlx4/en_rx.c
+++ b/drivers/net/mlx4/en_rx.c
@@ -611,11 +611,14 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
 					gro_skb->truesize += length;
 					gro_skb->ip_summed = CHECKSUM_UNNECESSARY;
 
-					if (priv->vlgrp && (cqe->vlan_my_qpn &
-							    cpu_to_be32(MLX4_CQE_VLAN_PRESENT_MASK)))
-						vlan_gro_frags(&cq->napi, priv->vlgrp, be16_to_cpu(cqe->sl_vid));
-					else
-						napi_gro_frags(&cq->napi);
+					if (cqe->vlan_my_qpn &
+					    cpu_to_be32(MLX4_CQE_VLAN_PRESENT_MASK)) {
+						u16 vid = be16_to_cpu(cqe->sl_vid);
+
+						__vlan_hwaccel_put_tag(gro_skb, vid);
+					}
+
+					napi_gro_frags(&cq->napi);
 
 					goto next;
 				}
@@ -647,13 +650,12 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
 		skb->protocol = eth_type_trans(skb, dev);
 		skb_record_rx_queue(skb, cq->ring);
 
+		if (be32_to_cpu(cqe->vlan_my_qpn) &
+		    MLX4_CQE_VLAN_PRESENT_MASK)
+			__vlan_hwaccel_put_tag(skb, be16_to_cpu(cqe->sl_vid));
+
 		/* Push it up the stack */
-		if (priv->vlgrp && (be32_to_cpu(cqe->vlan_my_qpn) &
-				    MLX4_CQE_VLAN_PRESENT_MASK)) {
-			vlan_hwaccel_receive_skb(skb, priv->vlgrp,
-						be16_to_cpu(cqe->sl_vid));
-		} else
-			netif_receive_skb(skb);
+		netif_receive_skb(skb);
 
 next:
 		++cq->mcq.cons_index;
diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h
index 0b5150d..ed84811 100644
--- a/drivers/net/mlx4/mlx4_en.h
+++ b/drivers/net/mlx4/mlx4_en.h
@@ -34,10 +34,12 @@
 #ifndef _MLX4_EN_H_
 #define _MLX4_EN_H_
 
+#include <linux/bitops.h>
 #include <linux/compiler.h>
 #include <linux/list.h>
 #include <linux/mutex.h>
 #include <linux/netdevice.h>
+#include <linux/if_vlan.h>
 
 #include <linux/mlx4/device.h>
 #include <linux/mlx4/qp.h>
@@ -418,7 +420,7 @@ struct mlx4_en_priv {
 	struct mlx4_en_dev *mdev;
 	struct mlx4_en_port_profile *prof;
 	struct net_device *dev;
-	struct vlan_group *vlgrp;
+	unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
 	struct net_device_stats stats;
 	struct net_device_stats ret_stats;
 	struct mlx4_en_port_state port_state;
@@ -553,7 +555,7 @@ int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring);
 void mlx4_en_rx_irq(struct mlx4_cq *mcq);
 
 int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port, u64 mac, u64 clear, u8 mode);
-int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, u8 port, struct vlan_group *grp);
+int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, struct mlx4_en_priv *priv);
 int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
 			  u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx);
 int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 17/21] spider_net: do not mention dying vlan_hwaccel_receive_skb
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus, kou.ishizaki,
	jens
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/spider_net.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 9bc6c20..1ff3491c 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1004,9 +1004,7 @@ spider_net_pass_skb_up(struct spider_net_descr *descr,
 	}
 
 	if (data_status & SPIDER_NET_VLAN_PACKET) {
-		/* further enhancements: HW-accel VLAN
-		 * vlan_hwaccel_receive_skb
-		 */
+		/* further enhancements: HW-accel VLAN */
 	}
 
 	/* update netdevice statistics */
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 05/21] atl1c: do vlan cleanup
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

- unify vlan and nonvlan rx path
- kill adapter->vlgrp and atl1c_vlan_rx_register
- enable vlan hw accel always

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/atl1c/atl1c.h      |    1 -
 drivers/net/atl1c/atl1c_main.c |   51 ++++-----------------------------------
 2 files changed, 6 insertions(+), 46 deletions(-)

diff --git a/drivers/net/atl1c/atl1c.h b/drivers/net/atl1c/atl1c.h
index 0f481b9..ca70e16 100644
--- a/drivers/net/atl1c/atl1c.h
+++ b/drivers/net/atl1c/atl1c.h
@@ -555,7 +555,6 @@ struct atl1c_smb {
 struct atl1c_adapter {
 	struct net_device   *netdev;
 	struct pci_dev      *pdev;
-	struct vlan_group   *vlgrp;
 	struct napi_struct  napi;
 	struct atl1c_hw        hw;
 	struct atl1c_hw_stats  hw_stats;
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c
index 1269ba5..2abef19 100644
--- a/drivers/net/atl1c/atl1c_main.c
+++ b/drivers/net/atl1c/atl1c_main.c
@@ -411,41 +411,6 @@ static void atl1c_set_multi(struct net_device *netdev)
 	}
 }
 
-static void atl1c_vlan_rx_register(struct net_device *netdev,
-				   struct vlan_group *grp)
-{
-	struct atl1c_adapter *adapter = netdev_priv(netdev);
-	struct pci_dev *pdev = adapter->pdev;
-	u32 mac_ctrl_data = 0;
-
-	if (netif_msg_pktdata(adapter))
-		dev_dbg(&pdev->dev, "atl1c_vlan_rx_register\n");
-
-	atl1c_irq_disable(adapter);
-
-	adapter->vlgrp = grp;
-	AT_READ_REG(&adapter->hw, REG_MAC_CTRL, &mac_ctrl_data);
-
-	if (grp) {
-		/* enable VLAN tag insert/strip */
-		mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
-	} else {
-		/* disable VLAN tag insert/strip */
-		mac_ctrl_data &= ~MAC_CTRL_RMV_VLAN;
-	}
-
-	AT_WRITE_REG(&adapter->hw, REG_MAC_CTRL, mac_ctrl_data);
-	atl1c_irq_enable(adapter);
-}
-
-static void atl1c_restore_vlan(struct atl1c_adapter *adapter)
-{
-	struct pci_dev *pdev = adapter->pdev;
-
-	if (netif_msg_pktdata(adapter))
-		dev_dbg(&pdev->dev, "atl1c_restore_vlan !");
-	atl1c_vlan_rx_register(adapter->netdev, adapter->vlgrp);
-}
 /*
  * atl1c_set_mac - Change the Ethernet Address of the NIC
  * @netdev: network interface device structure
@@ -1433,8 +1398,7 @@ static void atl1c_setup_mac_ctrl(struct atl1c_adapter *adapter)
 	mac_ctrl_data |= ((hw->preamble_len & MAC_CTRL_PRMLEN_MASK) <<
 			MAC_CTRL_PRMLEN_SHIFT);
 
-	if (adapter->vlgrp)
-		mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
+	mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
 
 	mac_ctrl_data |= MAC_CTRL_BC_EN;
 	if (netdev->flags & IFF_PROMISC)
@@ -1878,14 +1842,14 @@ rrs_checked:
 		skb_put(skb, length - ETH_FCS_LEN);
 		skb->protocol = eth_type_trans(skb, netdev);
 		atl1c_rx_checksum(adapter, skb, rrs);
-		if (unlikely(adapter->vlgrp) && rrs->word3 & RRS_VLAN_INS) {
+		if (rrs->word3 & RRS_VLAN_INS) {
 			u16 vlan;
 
 			AT_TAG_TO_VLAN(rrs->vlan_tag, vlan);
 			vlan = le16_to_cpu(vlan);
-			vlan_hwaccel_receive_skb(skb, adapter->vlgrp, vlan);
-		} else
-			netif_receive_skb(skb);
+			__vlan_hwaccel_put_tag(skb, vlan);
+		}
+		netif_receive_skb(skb);
 
 		(*work_done)++;
 		count++;
@@ -2320,7 +2284,6 @@ static int atl1c_up(struct atl1c_adapter *adapter)
 	netif_carrier_off(netdev);
 	atl1c_init_ring_ptrs(adapter);
 	atl1c_set_multi(netdev);
-	atl1c_restore_vlan(adapter);
 
 	for (i = 0; i < adapter->num_rx_queues; i++) {
 		num = atl1c_alloc_rx_buffer(adapter, i);
@@ -2507,8 +2470,7 @@ static int atl1c_suspend(struct device *dev)
 		/* clear phy interrupt */
 		atl1c_read_phy_reg(hw, MII_ISR, &mii_intr_status_data);
 		/* Config MAC Ctrl register */
-		if (adapter->vlgrp)
-			mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
+		mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
 
 		/* magic packet maybe Broadcast&multicast&Unicast frame */
 		if (wufc & AT_WUFC_MAG)
@@ -2588,7 +2550,6 @@ static const struct net_device_ops atl1c_netdev_ops = {
 	.ndo_do_ioctl		= atl1c_ioctl,
 	.ndo_tx_timeout		= atl1c_tx_timeout,
 	.ndo_get_stats		= atl1c_get_stats,
-	.ndo_vlan_rx_register	= atl1c_vlan_rx_register,
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller	= atl1c_netpoll,
 #endif
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 02/21] ehea: unify vlan and nonvlan rx path
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus, leitao
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/ehea/ehea_main.c |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 3fd5a24..8dffb80 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -686,21 +686,13 @@ static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe,
 	int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) &&
 			      pr->port->vgrp);
 
-	if (skb->dev->features & NETIF_F_LRO) {
-		if (vlan_extracted)
-			lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb,
-						     pr->port->vgrp,
-						     cqe->vlan_tag,
-						     cqe);
-		else
-			lro_receive_skb(&pr->lro_mgr, skb, cqe);
-	} else {
-		if (vlan_extracted)
-			vlan_hwaccel_receive_skb(skb, pr->port->vgrp,
-						 cqe->vlan_tag);
-		else
-			netif_receive_skb(skb);
-	}
+	if (vlan_extracted)
+		__vlan_hwaccel_put_tag(skb, cqe->vlan_tag);
+
+	if (skb->dev->features & NETIF_F_LRO)
+		lro_receive_skb(&pr->lro_mgr, skb, cqe);
+	else
+		netif_receive_skb(skb);
 }
 
 static int ehea_proc_rwqes(struct net_device *dev,
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 21/21] vlan: kill vlan_hwaccel_receive_skb
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 include/linux/if_vlan.h |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index affa273..472f3df 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -212,19 +212,6 @@ static inline int vlan_hwaccel_rx(struct sk_buff *skb,
 }
 
 /**
- * vlan_hwaccel_receive_skb - netif_receive_skb wrapper for VLAN RX acceleration
- * @skb: buffer
- * @grp: vlan group
- * @vlan_tci: VLAN TCI as received from the card
- */
-static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb,
-					   struct vlan_group *grp,
-					   u16 vlan_tci)
-{
-	return __vlan_hwaccel_rx(skb, grp, vlan_tci, 1);
-}
-
-/**
  * vlan_insert_tag - regular VLAN tag inserting
  * @skb: skbuff to tag
  * @vlan_tci: VLAN TCI to insert
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 18/21] tehuti: do vlan cleanup
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus, baum
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

- unify vlan and nonvlan rx path
- kill priv->vlgrp and bdx_vlan_rx_register

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/tehuti.c |   37 +++++++------------------------------
 drivers/net/tehuti.h |    1 -
 2 files changed, 7 insertions(+), 31 deletions(-)

diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index 80fbee0..749bbf1 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -742,22 +742,6 @@ static void bdx_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid)
 	__bdx_vlan_rx_vid(ndev, vid, 0);
 }
 
-/*
- * bdx_vlan_rx_register - kernel hook for adding VLAN group
- * @ndev network device
- * @grp  VLAN group
- */
-static void
-bdx_vlan_rx_register(struct net_device *ndev, struct vlan_group *grp)
-{
-	struct bdx_priv *priv = netdev_priv(ndev);
-
-	ENTER;
-	DBG("device='%s', group='%p'\n", ndev->name, grp);
-	priv->vlgrp = grp;
-	RET();
-}
-
 /**
  * bdx_change_mtu - Change the Maximum Transfer Unit
  * @netdev: network interface device structure
@@ -1146,21 +1130,15 @@ NETIF_RX_MUX(struct bdx_priv *priv, u32 rxd_val1, u16 rxd_vlan,
 	     struct sk_buff *skb)
 {
 	ENTER;
-	DBG("rxdd->flags.bits.vtag=%d vlgrp=%p\n", GET_RXD_VTAG(rxd_val1),
-	    priv->vlgrp);
-	if (priv->vlgrp && GET_RXD_VTAG(rxd_val1)) {
-		DBG("%s: vlan rcv vlan '%x' vtag '%x', device name '%s'\n",
+	DBG("rxdd->flags.bits.vtag=%d\n", GET_RXD_VTAG(rxd_val1));
+	if (GET_RXD_VTAG(rxd_val1)) {
+		DBG("%s: vlan rcv vlan '%x' vtag '%x'\n",
 		    priv->ndev->name,
 		    GET_RXD_VLAN_ID(rxd_vlan),
-		    GET_RXD_VTAG(rxd_val1),
-		    vlan_group_get_device(priv->vlgrp,
-					  GET_RXD_VLAN_ID(rxd_vlan))->name);
-		/* NAPI variant of receive functions */
-		vlan_hwaccel_receive_skb(skb, priv->vlgrp,
-					 GET_RXD_VLAN_TCI(rxd_vlan));
-	} else {
-		netif_receive_skb(skb);
+		    GET_RXD_VTAG(rxd_val1));
+		__vlan_hwaccel_put_tag(skb, GET_RXD_VLAN_TCI(rxd_vlan));
 	}
+	netif_receive_skb(skb);
 }
 
 static void bdx_recycle_skb(struct bdx_priv *priv, struct rxd_desc *rxdd)
@@ -1877,7 +1855,7 @@ static void bdx_tx_push_desc_safe(struct bdx_priv *priv, void *data, int size)
 }
 
 static const struct net_device_ops bdx_netdev_ops = {
-	.ndo_open	 	= bdx_open,
+	.ndo_open		= bdx_open,
 	.ndo_stop		= bdx_close,
 	.ndo_start_xmit		= bdx_tx_transmit,
 	.ndo_validate_addr	= eth_validate_addr,
@@ -1885,7 +1863,6 @@ static const struct net_device_ops bdx_netdev_ops = {
 	.ndo_set_multicast_list = bdx_setmulti,
 	.ndo_change_mtu		= bdx_change_mtu,
 	.ndo_set_mac_address	= bdx_set_mac,
-	.ndo_vlan_rx_register	= bdx_vlan_rx_register,
 	.ndo_vlan_rx_add_vid	= bdx_vlan_rx_add_vid,
 	.ndo_vlan_rx_kill_vid	= bdx_vlan_rx_kill_vid,
 };
diff --git a/drivers/net/tehuti.h b/drivers/net/tehuti.h
index c5642fe..709ebd6 100644
--- a/drivers/net/tehuti.h
+++ b/drivers/net/tehuti.h
@@ -250,7 +250,6 @@ struct bdx_priv {
 	struct rxf_fifo rxf_fifo0;
 	struct rxdb *rxdb;	/* rx dbs to store skb pointers */
 	int napi_stop;
-	struct vlan_group *vlgrp;
 
 	/* Tx FIFOs: 1 for data desc, 1 for empty (acks) desc */
 	struct txd_fifo txd_fifo0;
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 04/21] amd8111e: do vlan cleanup
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

- unify vlan and nonvlan rx path
- kill lp->vlgrp and amd8111e_vlan_rx_register

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/amd8111e.c |   34 ++++++----------------------------
 drivers/net/amd8111e.h |    3 ---
 2 files changed, 6 insertions(+), 31 deletions(-)

diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index db6d2da..78002ef 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -661,15 +661,6 @@ static void amd8111e_free_ring(struct amd8111e_priv* lp)
 	}
 
 }
-#if AMD8111E_VLAN_TAG_USED
-/*
-This is the receive indication function for packets with vlan tag.
-*/
-static int amd8111e_vlan_rx(struct amd8111e_priv *lp, struct sk_buff *skb, u16 vlan_tag)
-{
-	return vlan_hwaccel_receive_skb(skb, lp->vlgrp,vlan_tag);
-}
-#endif
 
 /*
 This function will free all the transmit skbs that are actually transmitted by the device. It will check the ownership of the skb before freeing the skb.
@@ -764,7 +755,7 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget)
 #if AMD8111E_VLAN_TAG_USED
 			vtag = status & TT_MASK;
 			/*MAC will strip vlan tag*/
-			if(lp->vlgrp != NULL && vtag !=0)
+			if (vtag != 0)
 				min_pkt_len =MIN_PKT_LEN - 4;
 			else
 #endif
@@ -799,12 +790,12 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget)
 			skb->protocol = eth_type_trans(skb, dev);
 
 #if AMD8111E_VLAN_TAG_USED
-			if(lp->vlgrp != NULL && (vtag == TT_VLAN_TAGGED)){
-				amd8111e_vlan_rx(lp, skb,
-					 le16_to_cpu(lp->rx_ring[rx_index].tag_ctrl_info));
-			} else
+			if (vtag == TT_VLAN_TAGGED){
+				u16 vlan_tag = le16_to_cpu(lp->rx_ring[rx_index].tag_ctrl_info);
+				__vlan_hwaccel_put_tag(skb, vlan_tag);
+			}
 #endif
-				netif_receive_skb(skb);
+			netif_receive_skb(skb);
 			/*COAL update rx coalescing parameters*/
 			lp->coal_conf.rx_packets++;
 			lp->coal_conf.rx_bytes += pkt_len;
@@ -1598,16 +1589,6 @@ static int amd8111e_change_mtu(struct net_device *dev, int new_mtu)
 	return err;
 }
 
-#if AMD8111E_VLAN_TAG_USED
-static void amd8111e_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
-{
-	struct  amd8111e_priv *lp = netdev_priv(dev);
-	spin_lock_irq(&lp->lock);
-	lp->vlgrp = grp;
-	spin_unlock_irq(&lp->lock);
-}
-#endif
-
 static int amd8111e_enable_magicpkt(struct amd8111e_priv* lp)
 {
 	writel( VAL1|MPPLBA, lp->mmio + CMD3);
@@ -1822,9 +1803,6 @@ static const struct net_device_ops amd8111e_netdev_ops = {
 	.ndo_set_mac_address	= amd8111e_set_mac_address,
 	.ndo_do_ioctl		= amd8111e_ioctl,
 	.ndo_change_mtu		= amd8111e_change_mtu,
-#if AMD8111E_VLAN_TAG_USED
-	.ndo_vlan_rx_register	= amd8111e_vlan_rx_register,
-#endif
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller	 = amd8111e_poll,
 #endif
diff --git a/drivers/net/amd8111e.h b/drivers/net/amd8111e.h
index b5926af..2ff2e7a 100644
--- a/drivers/net/amd8111e.h
+++ b/drivers/net/amd8111e.h
@@ -783,9 +783,6 @@ struct amd8111e_priv{
 	struct net_device *next;
 	int mii;
 	struct mii_if_info mii_if;
-#if AMD8111E_VLAN_TAG_USED
-	struct vlan_group		*vlgrp;
-#endif
 	char opened;
 	unsigned int drv_rx_errors;
 	struct amd8111e_coalesce_conf coal_conf;
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 19/21] lro: unify vlan and nonvlan rx path
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 net/ipv4/inet_lro.c |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c
index e54425d..775973b 100644
--- a/net/ipv4/inet_lro.c
+++ b/net/ipv4/inet_lro.c
@@ -310,21 +310,12 @@ static void lro_flush(struct net_lro_mgr *lro_mgr,
 	skb_shinfo(lro_desc->parent)->gso_size = lro_desc->mss;
 
 	if (lro_desc->vgrp) {
-		if (lro_mgr->features & LRO_F_NAPI)
-			vlan_hwaccel_receive_skb(lro_desc->parent,
-						 lro_desc->vgrp,
-						 lro_desc->vlan_tag);
-		else
-			vlan_hwaccel_rx(lro_desc->parent,
-					lro_desc->vgrp,
-					lro_desc->vlan_tag);
+		__vlan_hwaccel_put_tag(skb, lro_desc->vlan_tag);
 
-	} else {
-		if (lro_mgr->features & LRO_F_NAPI)
-			netif_receive_skb(lro_desc->parent);
-		else
-			netif_rx(lro_desc->parent);
-	}
+	if (lro_mgr->features & LRO_F_NAPI)
+		netif_receive_skb(lro_desc->parent);
+	else
+		netif_rx(lro_desc->parent);
 
 	LRO_INC_STATS(lro_mgr, flushed);
 	lro_clear_desc(lro_desc);
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 03/21] kill lro_vlan_hwaccel_receive_skb
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

no longer used

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 include/linux/inet_lro.h |   10 ----------
 net/ipv4/inet_lro.c      |   15 ---------------
 2 files changed, 0 insertions(+), 25 deletions(-)

diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h
index c4335fa..940bbde 100644
--- a/include/linux/inet_lro.h
+++ b/include/linux/inet_lro.h
@@ -137,16 +137,6 @@ void lro_receive_skb(struct net_lro_mgr *lro_mgr,
 		     void *priv);
 
 /*
- * Processes a SKB with VLAN HW acceleration support
- */
-
-void lro_vlan_hwaccel_receive_skb(struct net_lro_mgr *lro_mgr,
-				  struct sk_buff *skb,
-				  struct vlan_group *vgrp,
-				  u16 vlan_tag,
-				  void *priv);
-
-/*
  * Processes a fragment list
  *
  * This functions aggregate fragments and generate SKBs do pass
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c
index 85a0f75..e54425d 100644
--- a/net/ipv4/inet_lro.c
+++ b/net/ipv4/inet_lro.c
@@ -523,21 +523,6 @@ void lro_receive_skb(struct net_lro_mgr *lro_mgr,
 }
 EXPORT_SYMBOL(lro_receive_skb);
 
-void lro_vlan_hwaccel_receive_skb(struct net_lro_mgr *lro_mgr,
-				  struct sk_buff *skb,
-				  struct vlan_group *vgrp,
-				  u16 vlan_tag,
-				  void *priv)
-{
-	if (__lro_proc_skb(lro_mgr, skb, vgrp, vlan_tag, priv)) {
-		if (lro_mgr->features & LRO_F_NAPI)
-			vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag);
-		else
-			vlan_hwaccel_rx(skb, vgrp, vlan_tag);
-	}
-}
-EXPORT_SYMBOL(lro_vlan_hwaccel_receive_skb);
-
 void lro_receive_frags(struct net_lro_mgr *lro_mgr,
 		       struct skb_frag_struct *frags,
 		       int len, int true_size, void *priv, __wsum sum)
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 20/21] lro: kill lro_vlan_hwaccel_receive_frags
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 include/linux/inet_lro.h |    7 -------
 net/ipv4/inet_lro.c      |   20 --------------------
 2 files changed, 0 insertions(+), 27 deletions(-)

diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h
index 940bbde..b27e773 100644
--- a/include/linux/inet_lro.h
+++ b/include/linux/inet_lro.h
@@ -155,13 +155,6 @@ void lro_receive_frags(struct net_lro_mgr *lro_mgr,
 		       struct skb_frag_struct *frags,
 		       int len, int true_size, void *priv, __wsum sum);
 
-void lro_vlan_hwaccel_receive_frags(struct net_lro_mgr *lro_mgr,
-				    struct skb_frag_struct *frags,
-				    int len, int true_size,
-				    struct vlan_group *vgrp,
-				    u16 vlan_tag,
-				    void *priv, __wsum sum);
-
 /*
  * Forward all aggregated SKBs held by lro_mgr to network stack
  */
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c
index 775973b..fd45127 100644
--- a/net/ipv4/inet_lro.c
+++ b/net/ipv4/inet_lro.c
@@ -532,26 +532,6 @@ void lro_receive_frags(struct net_lro_mgr *lro_mgr,
 }
 EXPORT_SYMBOL(lro_receive_frags);
 
-void lro_vlan_hwaccel_receive_frags(struct net_lro_mgr *lro_mgr,
-				    struct skb_frag_struct *frags,
-				    int len, int true_size,
-				    struct vlan_group *vgrp,
-				    u16 vlan_tag, void *priv, __wsum sum)
-{
-	struct sk_buff *skb;
-
-	skb = __lro_proc_segment(lro_mgr, frags, len, true_size, vgrp,
-				 vlan_tag, priv, sum);
-	if (!skb)
-		return;
-
-	if (lro_mgr->features & LRO_F_NAPI)
-		vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag);
-	else
-		vlan_hwaccel_rx(skb, vgrp, vlan_tag);
-}
-EXPORT_SYMBOL(lro_vlan_hwaccel_receive_frags);
-
 void lro_flush_all(struct net_lro_mgr *lro_mgr)
 {
 	int i;
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 00/22] vlan cleanup round1
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus

This patchset converts several drivers to new vlan model.
Also kills several vlan helpers:
vlan_hwaccel_receive_skb,
lro_vlan_hwaccel_receive_frags,
lro_vlan_hwaccel_receive_skb

note gianfar patch is dependent on "[PATCH] gianfar: rx parser"

Jiri Pirko (22):
  gianfar: rx parser
  nes: do vlan cleanup
  ehea: unify vlan and nonvlan rx path
  kill lro_vlan_hwaccel_receive_skb
  amd8111e: do vlan cleanup
  atl1c: do vlan cleanup
  atl1e: do vlan cleanup
  bnad: do vlan cleanup
  chelsio: do vlan cleanup
  cxgb4vf: do vlan cleanup
  enic: do vlan cleanup
  gianfar: do vlan cleanup
  igbvf: do vlan cleanup
  jme: do vlan cleanup
  mlx4: do vlan cleanup
  qlge: do vlan cleanup
  s2io: do vlan cleanup
  spider_net: do not mention dying vlan_hwaccel_receive_skb
  tehuti: do vlan cleanup
  lro: unify vlan and nonvlan rx path
  lro: kill lro_vlan_hwaccel_receive_frags
  vlan: kill vlan_hwaccel_receive_skb

 drivers/infiniband/hw/nes/nes_hw.c  |   19 ++---
 drivers/infiniband/hw/nes/nes_hw.h  |    4 -
 drivers/infiniband/hw/nes/nes_nic.c |   42 +++------
 drivers/net/amd8111e.c              |   34 ++------
 drivers/net/amd8111e.h              |    3 -
 drivers/net/atl1c/atl1c.h           |    1 -
 drivers/net/atl1c/atl1c_main.c      |   51 ++----------
 drivers/net/atl1e/atl1e.h           |    1 -
 drivers/net/atl1e/atl1e_main.c      |   49 ++---------
 drivers/net/bna/bnad.c              |   55 ++++--------
 drivers/net/bna/bnad.h              |    3 +-
 drivers/net/chelsio/common.h        |    2 -
 drivers/net/chelsio/cxgb2.c         |   19 +----
 drivers/net/chelsio/sge.c           |   11 +--
 drivers/net/cxgb4vf/adapter.h       |    1 -
 drivers/net/cxgb4vf/cxgb4vf_main.c  |   18 +----
 drivers/net/cxgb4vf/sge.c           |   34 ++------
 drivers/net/ehea/ehea_main.c        |   22 ++---
 drivers/net/enic/enic.h             |    1 -
 drivers/net/enic/enic_main.c        |   32 ++------
 drivers/net/gianfar.c               |   77 ++++++++++-------
 drivers/net/gianfar.h               |    6 +-
 drivers/net/gianfar_ethtool.c       |    3 +
 drivers/net/igbvf/igbvf.h           |    4 +-
 drivers/net/igbvf/netdev.c          |   51 +++++------
 drivers/net/jme.c                   |   28 +-----
 drivers/net/jme.h                   |    4 -
 drivers/net/mlx4/en_netdev.c        |   49 +++--------
 drivers/net/mlx4/en_port.c          |   23 ++---
 drivers/net/mlx4/en_rx.c            |   24 +++---
 drivers/net/mlx4/mlx4_en.h          |    6 +-
 drivers/net/qlge/qlge.h             |    3 +-
 drivers/net/qlge/qlge_main.c        |  164 +++++++++++++++++++----------------
 drivers/net/s2io.c                  |   70 ++--------------
 drivers/net/s2io.h                  |    1 -
 drivers/net/spider_net.c            |    4 +-
 drivers/net/tehuti.c                |   37 ++-------
 drivers/net/tehuti.h                |    1 -
 include/linux/if_vlan.h             |   13 ---
 include/linux/inet_lro.h            |   17 ----
 net/ipv4/inet_lro.c                 |   54 +-----------
 41 files changed, 313 insertions(+), 728 deletions(-)

-- 
1.7.6


^ permalink raw reply

* [patch net-next-2.6 01/21] nes: do vlan cleanup
From: Jiri Pirko @ 2011-07-15 21:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, shemminger, eric.dumazet, greearb, mirqus, faisal.latif
In-Reply-To: <1310765619-27827-1-git-send-email-jpirko@redhat.com>

- unify vlan and nonvlan rx path
- kill nesvnic->vlan_grp and nes_netdev_vlan_rx_register
- enable vlan stripping always

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/infiniband/hw/nes/nes_hw.c  |   19 +++++----------
 drivers/infiniband/hw/nes/nes_hw.h  |    4 ---
 drivers/infiniband/hw/nes/nes_nic.c |   42 ++++++++++------------------------
 3 files changed, 20 insertions(+), 45 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index 96fa9a4..be36cbe 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -2917,24 +2917,19 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
 					goto skip_rx_indicate0;
 
 
-				if ((cqe_misc & NES_NIC_CQE_TAG_VALID) &&
-				    (nesvnic->vlan_grp != NULL)) {
+				if (cqe_misc & NES_NIC_CQE_TAG_VALID) {
 					vlan_tag = (u16)(le32_to_cpu(
 							cq->cq_vbase[head].cqe_words[NES_NIC_CQE_TAG_PKT_TYPE_IDX])
 							>> 16);
 					nes_debug(NES_DBG_CQ, "%s: Reporting stripped VLAN packet. Tag = 0x%04X\n",
 							nesvnic->netdev->name, vlan_tag);
-					if (nes_use_lro)
-						lro_vlan_hwaccel_receive_skb(&nesvnic->lro_mgr, rx_skb,
-								nesvnic->vlan_grp, vlan_tag, NULL);
-					else
-						nes_vlan_rx(rx_skb, nesvnic->vlan_grp, vlan_tag);
-				} else {
-					if (nes_use_lro)
-						lro_receive_skb(&nesvnic->lro_mgr, rx_skb, NULL);
-					else
-						nes_netif_rx(rx_skb);
+
+					__vlan_hwaccel_put_tag(rx_skb, vlan_tag);
 				}
+				if (nes_use_lro)
+					lro_receive_skb(&nesvnic->lro_mgr, rx_skb, NULL);
+				else
+					netif_receive_skb(rx_skb);
 
 skip_rx_indicate0:
 				;
diff --git a/drivers/infiniband/hw/nes/nes_hw.h b/drivers/infiniband/hw/nes/nes_hw.h
index 9159411..c324147 100644
--- a/drivers/infiniband/hw/nes/nes_hw.h
+++ b/drivers/infiniband/hw/nes/nes_hw.h
@@ -1211,7 +1211,6 @@ struct nes_vnic {
 	/* void *mem; */
 	struct nes_device *nesdev;
 	struct net_device *netdev;
-	struct vlan_group *vlan_grp;
 	atomic_t          rx_skbs_needed;
 	atomic_t          rx_skb_timer_running;
 	int               budget;
@@ -1357,7 +1356,4 @@ struct nes_terminate_hdr {
 #define NES_LINK_RECHECK_DELAY	msecs_to_jiffies(50)
 #define NES_LINK_RECHECK_MAX	60
 
-#define nes_vlan_rx vlan_hwaccel_receive_skb
-#define nes_netif_rx netif_receive_skb
-
 #endif		/* __NES_HW_H */
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index d3a1c41..abdb326 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -127,6 +127,15 @@ static int nes_netdev_poll(struct napi_struct *napi, int budget)
 	return nescq->rx_pkts_indicated;
 }
 
+/* Enable VLAN Stripping */
+static void __net_vlan_enable(struct nes_device *nesdev)
+{
+	u32 u32temp;
+
+	u32temp = nes_read_indexed(nesdev, NES_IDX_PCIX_DIAG);
+	u32temp &= 0xfdffffff;
+	nes_write_indexed(nesdev, NES_IDX_PCIX_DIAG, u32temp);
+}
 
 /**
  * nes_netdev_open - Activate the network interface; ifconfig
@@ -248,6 +257,7 @@ static int nes_netdev_open(struct net_device *netdev)
 		nesdev->link_recheck = 1;
 		schedule_delayed_work(&nesdev->work, NES_LINK_RECHECK_DELAY);
 	}
+	__net_vlan_enable(nesdev);
 	spin_unlock_irqrestore(&nesdev->nesadapter->phy_lock, flags);
 
 	spin_lock_irqsave(&nesvnic->port_ibevent_lock, flags);
@@ -1584,42 +1594,16 @@ static const struct ethtool_ops nes_ethtool_ops = {
 	.set_pauseparam = nes_netdev_set_pauseparam,
 };
 
-
-static void nes_netdev_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
-{
-	struct nes_vnic *nesvnic = netdev_priv(netdev);
-	struct nes_device *nesdev = nesvnic->nesdev;
-	struct nes_adapter *nesadapter = nesdev->nesadapter;
-	u32 u32temp;
-	unsigned long flags;
-
-	spin_lock_irqsave(&nesadapter->phy_lock, flags);
-	nesvnic->vlan_grp = grp;
-
-	nes_debug(NES_DBG_NETDEV, "%s: %s\n", __func__, netdev->name);
-
-	/* Enable/Disable VLAN Stripping */
-	u32temp = nes_read_indexed(nesdev, NES_IDX_PCIX_DIAG);
-	if (grp)
-		u32temp &= 0xfdffffff;
-	else
-		u32temp	|= 0x02000000;
-
-	nes_write_indexed(nesdev, NES_IDX_PCIX_DIAG, u32temp);
-	spin_unlock_irqrestore(&nesadapter->phy_lock, flags);
-}
-
 static const struct net_device_ops nes_netdev_ops = {
-	.ndo_open 		= nes_netdev_open,
+	.ndo_open		= nes_netdev_open,
 	.ndo_stop		= nes_netdev_stop,
-	.ndo_start_xmit 	= nes_netdev_start_xmit,
+	.ndo_start_xmit		= nes_netdev_start_xmit,
 	.ndo_get_stats		= nes_netdev_get_stats,
-	.ndo_tx_timeout 	= nes_netdev_tx_timeout,
+	.ndo_tx_timeout		= nes_netdev_tx_timeout,
 	.ndo_set_mac_address	= nes_netdev_set_mac_address,
 	.ndo_set_multicast_list = nes_netdev_set_multicast_list,
 	.ndo_change_mtu		= nes_netdev_change_mtu,
 	.ndo_validate_addr	= eth_validate_addr,
-	.ndo_vlan_rx_register 	= nes_netdev_vlan_rx_register,
 };
 
 /**
-- 
1.7.6


^ permalink raw reply related


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