Netdev List
 help / color / mirror / Atom feed
From: Tom Herbert <tom@quantonium.net>
To: davem@davemloft.net
Cc: pablo@netfilter.org, laforge@gnumonks.org, aschultz@tpip.net,
	netdev@vger.kernel.org, rohit@quantonium.net,
	Tom Herbert <tom@quantonium.net>
Subject: [PATCH v7 net-next 01/13] vxlan: Move gro_cells_init to ndo_init
Date: Fri, 27 Oct 2017 17:09:25 -0700	[thread overview]
Message-ID: <20171028000937.2631-2-tom@quantonium.net> (raw)
In-Reply-To: <20171028000937.2631-1-tom@quantonium.net>

Move gro_cells_init to ndo_init and properly check return value.

Signed-off-by: Tom Herbert <tom@quantonium.net>
---
 drivers/net/vxlan.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index d7c49cf1d5e9..a54dd3d2a824 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2392,10 +2392,19 @@ static void vxlan_vs_add_dev(struct vxlan_sock *vs, struct vxlan_dev *vxlan,
 /* Setup stats when device is created */
 static int vxlan_init(struct net_device *dev)
 {
+	struct vxlan_dev *vxlan = netdev_priv(dev);
+	int err;
+
 	dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
 	if (!dev->tstats)
 		return -ENOMEM;
 
+	err = gro_cells_init(&vxlan->gro_cells, dev);
+	if (err) {
+		free_percpu(dev->tstats);
+		return err;
+	}
+
 	return 0;
 }
 
@@ -2653,8 +2662,6 @@ static void vxlan_setup(struct net_device *dev)
 
 	vxlan->dev = dev;
 
-	gro_cells_init(&vxlan->gro_cells, dev);
-
 	for (h = 0; h < FDB_HASH_SIZE; ++h)
 		INIT_HLIST_HEAD(&vxlan->fdb_head[h]);
 }
-- 
2.11.0

  reply	other threads:[~2017-10-28  0:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-28  0:09 [PATCH v7 net-next 00/13] gtp: Additional feature support - Part I Tom Herbert
2017-10-28  0:09 ` Tom Herbert [this message]
2017-10-28  0:58   ` [PATCH v7 net-next 01/13] vxlan: Move gro_cells_init to ndo_init Eric Dumazet
2017-10-28  0:09 ` [PATCH v7 net-next 02/13] iptunnel: Add common functions to get a tunnel route Tom Herbert
2017-10-28  0:09 ` [PATCH v7 net-next 03/13] vxlan: Call common functions to get tunnel routes Tom Herbert
2017-10-28  0:09 ` [PATCH v7 net-next 04/13] gtp: Call common functions to get tunnel routes and add dst_cache Tom Herbert
2017-10-28  0:09 ` [PATCH v7 net-next 05/13] iptunnel: Generalize tunnel update pmtu Tom Herbert
2017-10-28  0:09 ` [PATCH v7 net-next 06/13] gtp: Change to use gro_cells Tom Herbert
2017-10-28  1:00   ` Eric Dumazet
2017-10-28  0:09 ` [PATCH v7 net-next 07/13] gtp: Use goto for exceptions in gtp_udp_encap_recv funcs Tom Herbert
2017-10-28  0:09 ` [PATCH v7 net-next 08/13] gtp: udp recv clean up Tom Herbert
2017-10-28  0:09 ` [PATCH v7 net-next 09/13] gtp: Call function to update path mtu Tom Herbert
2017-10-28  0:09 ` [PATCH v7 net-next 10/13] gtp: Eliminate pktinfo and add port configuration Tom Herbert
2017-10-28  0:09 ` [PATCH v7 net-next 11/13] gtp: Experimental encapsulation of IPv6 packets Tom Herbert
2017-10-28  0:09 ` [PATCH v7 net-next 12/13] gtp: Experimental support encpasulating over IPv6 Tom Herbert
2017-10-28  0:09 ` [PATCH v7 net-next 13/13] gtp: Allow configuring GTP interface as standalone Tom Herbert
2017-10-28  8:09 ` [PATCH v7 net-next 00/13] gtp: Additional feature support - Part I Harald Welte
2017-10-28 16:16   ` Tom Herbert
2017-10-28 16:47     ` Harald Welte
2017-10-28 18:37       ` Tom Herbert
2017-10-29  1:49         ` David Miller
2017-11-12 20:56       ` Harald Welte
2017-11-13  0:25         ` Tom Herbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171028000937.2631-2-tom@quantonium.net \
    --to=tom@quantonium.net \
    --cc=aschultz@tpip.net \
    --cc=davem@davemloft.net \
    --cc=laforge@gnumonks.org \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=rohit@quantonium.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox