netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manish Chopra <manish.chopra@qlogic.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <Ariel.Elior@qlogic.com>,
	<Yuval.Mintz@qlogic.com>
Subject: [PATCH net-next 4/6] qed/qede: Add GENEVE tunnel slowpath configuration support
Date: Sat, 9 Apr 2016 09:17:03 -0400	[thread overview]
Message-ID: <1460207825-3622-5-git-send-email-manish.chopra@qlogic.com> (raw)
In-Reply-To: <1460207825-3622-1-git-send-email-manish.chopra@qlogic.com>

This patch configures adapter for GENEVE tunnel offloads
to be performed by the adapter.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
---
 drivers/net/ethernet/qlogic/Kconfig          | 10 ++++++++++
 drivers/net/ethernet/qlogic/qed/qed_main.c   |  5 ++++-
 drivers/net/ethernet/qlogic/qede/qede_main.c | 12 +++++++++++-
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/Kconfig b/drivers/net/ethernet/qlogic/Kconfig
index 7a65522..c0a11b5 100644
--- a/drivers/net/ethernet/qlogic/Kconfig
+++ b/drivers/net/ethernet/qlogic/Kconfig
@@ -114,4 +114,14 @@ config QEDE_VXLAN
 	  support for Virtual eXtensible Local Area Network (VXLAN)
 	  in the driver.
 
+config QEDE_GENEVE
+	bool "Generic Network Virtualization Encapsulation (GENEVE) support"
+	depends on QEDE && GENEVE && !(QEDE=y && GENEVE=m)
+	---help---
+	  This allows one to create GENEVE virtual interfaces that provide
+	  Layer 2 Networks over Layer 3 Networks. GENEVE is often used
+	  to tunnel virtual network infrastructure in virtualized environments.
+	  Say Y here if you want to enable hardware offload support for
+	  Generic Network Virtualization Encapsulation (GENEVE) in the driver.
+
 endif # NET_VENDOR_QLOGIC
diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
index 3b406ac..406de14 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
@@ -778,7 +778,10 @@ static int qed_slowpath_start(struct qed_dev *cdev,
 	data = cdev->firmware->data;
 
 	memset(&tunn_info, 0, sizeof(tunn_info));
-	tunn_info.tunn_mode |=  1 << QED_MODE_VXLAN_TUNN;
+	tunn_info.tunn_mode |=  1 << QED_MODE_VXLAN_TUNN |
+				1 << QED_MODE_L2GENEVE_TUNN |
+				1 << QED_MODE_IPGENEVE_TUNN;
+
 	tunn_info.tunn_clss_vxlan = QED_TUNN_CLSS_MAC_VLAN;
 
 	rc = qed_hw_init(cdev, &tunn_info, true,
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 9a82d42..b2cde75 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -36,6 +36,7 @@
 #include <linux/random.h>
 #include <net/ip6_checksum.h>
 #include <linux/bitops.h>
+#include <net/geneve.h>
 
 #include "qede.h"
 
@@ -1864,17 +1865,26 @@ static void qede_del_vxlan_port(struct net_device *dev,
 	set_bit(QEDE_SP_VXLAN_PORT_DELETE, &edev->sp_flags);
 	schedule_delayed_work(&edev->sp_task, 0);
 }
+#endif
 
+#if defined(CONFIG_QEDE_VXLAN) || defined(CONFIG_QEDE_GENEVE)
 static void qede_config_def_udp_tunnel_ports(struct qede_dev *edev)
 {
 	struct qed_tunn_params tunn_params;
 
 	memset(&tunn_params, 0, sizeof(tunn_params));
 
+#ifdef CONFIG_QEDE_VXLAN
 	if (!edev->vxlan_dst_port) {
 		tunn_params.update_vxlan_port = 1;
 		tunn_params.vxlan_port = VXLAN_DEF_UDP_PORT;
 	}
+#endif
+
+#ifdef CONFIG_QEDE_GENEVE
+	tunn_params.update_geneve_port = 1;
+	tunn_params.geneve_port = GENEVE_DEF_UDP_PORT;
+#endif
 
 	qed_ops->tunn_config(edev->cdev, &tunn_params);
 }
@@ -3167,7 +3177,7 @@ static int qede_load(struct qede_dev *edev, enum qede_load_mode mode)
 	edev->ops->common->get_link(edev->cdev, &link_output);
 	qede_link_update(edev, &link_output);
 
-#ifdef CONFIG_QEDE_VXLAN
+#if defined(CONFIG_QEDE_VXLAN) || defined(CONFIG_QEDE_GENEVE)
 	qede_config_def_udp_tunnel_ports(edev);
 #endif
 	DP_INFO(edev, "Ending successfully qede load\n");
-- 
2.7.2

  parent reply	other threads:[~2016-04-09 13:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-09 13:16 [PATCH net-next 0/6] qed/qede: Add tunneling support Manish Chopra
2016-04-09 13:17 ` [PATCH net-next 1/6] net: Make vxlan/geneve default udp ports public Manish Chopra
2016-04-09 16:06   ` Jesse Gross
2016-04-09 20:46     ` Manish Chopra
2016-04-09 21:48       ` Jesse Gross
2016-04-09 13:17 ` [PATCH net-next 2/6] qed: Add infrastructure support for tunneling Manish Chopra
2016-04-09 13:17 ` [PATCH net-next 3/6] qed/qede: Add VXLAN tunnel slowpath configuration support Manish Chopra
2016-04-09 16:29   ` Jesse Gross
2016-04-09 13:17 ` Manish Chopra [this message]
2016-04-09 13:17 ` [PATCH net-next 5/6] qed: Enable GRE tunnel slowpath configuration Manish Chopra
2016-04-09 13:17 ` [PATCH net-next 6/6] qede: Add fastpath support for tunneling Manish Chopra

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=1460207825-3622-5-git-send-email-manish.chopra@qlogic.com \
    --to=manish.chopra@qlogic.com \
    --cc=Ariel.Elior@qlogic.com \
    --cc=Yuval.Mintz@qlogic.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).