From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: davem@davemloft.net
Cc: oss-drivers@netronome.com, netdev@vger.kernel.org,
John Hurley <john.hurley@netronome.com>
Subject: [PATCH net-next 8/9] nfp: flower: offload tos and tunnel flags for ipv4 udp tunnels
Date: Fri, 29 Jun 2018 17:04:41 -0700 [thread overview]
Message-ID: <20180630000442.27353-9-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20180630000442.27353-1-jakub.kicinski@netronome.com>
From: John Hurley <john.hurley@netronome.com>
Extract the tos and the tunnel flags from the tunnel key and offload these
action fields. Only the checksum and tunnel key flags are implemented in
fw so reject offloads of other flags. The tunnel key flag is always
considered set in the fw so enforce that it is set in the rule. Note that
the compulsory setting of the tunnel key flag and optional setting of
checksum is inline with how tc currently generates ipv4 udp tunnel
actions.
Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
---
drivers/net/ethernet/netronome/nfp/flower/action.c | 9 +++++++++
drivers/net/ethernet/netronome/nfp/flower/cmsg.h | 4 ++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/flower/action.c b/drivers/net/ethernet/netronome/nfp/flower/action.c
index d421b7fbce96..e56b815a8dc6 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/action.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/action.c
@@ -45,6 +45,8 @@
#include "main.h"
#include "../nfp_net_repr.h"
+#define NFP_FL_SUPPORTED_IPV4_UDP_TUN_FLAGS (TUNNEL_CSUM | TUNNEL_KEY)
+
static void nfp_fl_pop_vlan(struct nfp_fl_pop_vlan *pop_vlan)
{
size_t act_size = sizeof(struct nfp_fl_pop_vlan);
@@ -274,6 +276,13 @@ nfp_fl_set_ipv4_udp_tun(struct nfp_fl_set_ipv4_udp_tun *set_tun,
set_tun->ttl = net->ipv4.sysctl_ip_default_ttl;
}
+ set_tun->tos = ip_tun->key.tos;
+
+ if (!(ip_tun->key.tun_flags & TUNNEL_KEY) ||
+ ip_tun->key.tun_flags & ~NFP_FL_SUPPORTED_IPV4_UDP_TUN_FLAGS)
+ return -EOPNOTSUPP;
+ set_tun->tun_flags = ip_tun->key.tun_flags;
+
/* Complete pre_tunnel action. */
pre_tun->ipv4_dst = ip_tun->key.u.ipv4.dst;
diff --git a/drivers/net/ethernet/netronome/nfp/flower/cmsg.h b/drivers/net/ethernet/netronome/nfp/flower/cmsg.h
index 4a7f3510a296..15f1eacd76b6 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/cmsg.h
+++ b/drivers/net/ethernet/netronome/nfp/flower/cmsg.h
@@ -203,9 +203,9 @@ struct nfp_fl_set_ipv4_udp_tun {
__be16 reserved;
__be64 tun_id __packed;
__be32 tun_type_index;
- __be16 reserved2;
+ __be16 tun_flags;
u8 ttl;
- u8 reserved3;
+ u8 tos;
__be32 extra[2];
};
--
2.17.1
next prev parent reply other threads:[~2018-06-30 0:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-30 0:04 [PATCH net-next 0/9] nfp: flower updates and netconsole Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 1/9] nfp: expose ring stats of inactive rings via ethtool Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 2/9] nfp: fail probe if serial or interface id is missing Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 3/9] nfp: implement netpoll ndo (thus enabling netconsole) Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 4/9] nfp: make use of napi_consume_skb() Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 5/9] nfp: populate bus-info on representors Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 6/9] nfp: flower: ignore checksum actions when performing pedit actions Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 7/9] nfp: flower: extract ipv4 udp tunnel ttl from route Jakub Kicinski
2018-06-30 0:04 ` Jakub Kicinski [this message]
2018-06-30 0:04 ` [PATCH net-next 9/9] nfp: flower: enabled offloading of Team LAG Jakub Kicinski
2018-06-30 12:32 ` [PATCH net-next 0/9] nfp: flower updates and netconsole David Miller
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=20180630000442.27353-9-jakub.kicinski@netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=davem@davemloft.net \
--cc=john.hurley@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/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