From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Or Gerlitz <ogerlitz@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>
Subject: [net-next 02/12] net/mlx5e: Add TC offloads matching on IPv6 encapsulation headers
Date: Tue, 24 Jan 2017 22:16:42 +0200 [thread overview]
Message-ID: <20170124201652.2920-3-saeedm@mellanox.com> (raw)
In-Reply-To: <20170124201652.2920-1-saeedm@mellanox.com>
From: Or Gerlitz <ogerlitz@mellanox.com>
Enhance the parsing of offloaded TC rules to set HW matching on outer
IPv6 encapsulation headers. This effectively adds support for TC tunnel
key release action (decapsulation) of SRIOV offloads over IPv6 tunnels.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 30 ++++++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index d4af5507679f..e9f0854e9509 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -298,6 +298,32 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv,
MLX5_SET_TO_ONES(fte_match_set_lyr_2_4, headers_c, ethertype);
MLX5_SET(fte_match_set_lyr_2_4, headers_v, ethertype, ETH_P_IP);
+ } else if (enc_control->addr_type == FLOW_DISSECTOR_KEY_IPV6_ADDRS) {
+ struct flow_dissector_key_ipv6_addrs *key =
+ skb_flow_dissector_target(f->dissector,
+ FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS,
+ f->key);
+ struct flow_dissector_key_ipv6_addrs *mask =
+ skb_flow_dissector_target(f->dissector,
+ FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS,
+ f->mask);
+
+ memcpy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_c,
+ src_ipv4_src_ipv6.ipv6_layout.ipv6),
+ &mask->src, MLX5_FLD_SZ_BYTES(ipv6_layout, ipv6));
+ memcpy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_v,
+ src_ipv4_src_ipv6.ipv6_layout.ipv6),
+ &key->src, MLX5_FLD_SZ_BYTES(ipv6_layout, ipv6));
+
+ memcpy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_c,
+ dst_ipv4_dst_ipv6.ipv6_layout.ipv6),
+ &mask->dst, MLX5_FLD_SZ_BYTES(ipv6_layout, ipv6));
+ memcpy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_v,
+ dst_ipv4_dst_ipv6.ipv6_layout.ipv6),
+ &key->dst, MLX5_FLD_SZ_BYTES(ipv6_layout, ipv6));
+
+ MLX5_SET_TO_ONES(fte_match_set_lyr_2_4, headers_c, ethertype);
+ MLX5_SET(fte_match_set_lyr_2_4, headers_v, ethertype, ETH_P_IPV6);
}
/* Enforce DMAC when offloading incoming tunneled flows.
@@ -358,12 +384,10 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
f->key);
switch (key->addr_type) {
case FLOW_DISSECTOR_KEY_IPV4_ADDRS:
+ case FLOW_DISSECTOR_KEY_IPV6_ADDRS:
if (parse_tunnel_attr(priv, spec, f))
return -EOPNOTSUPP;
break;
- case FLOW_DISSECTOR_KEY_IPV6_ADDRS:
- netdev_warn(priv->netdev,
- "IPv6 tunnel decap offload isn't supported\n");
default:
return -EOPNOTSUPP;
}
--
2.11.0
next prev parent reply other threads:[~2017-01-24 20:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-24 20:16 [pull request][net-next 00/12] Mellanox mlx5 updates 2017-01-24 Saeed Mahameed
2017-01-24 20:16 ` [net-next 01/12] net/mlx5: Use exact encap header size for the FW input buffer Saeed Mahameed
2017-01-24 20:16 ` Saeed Mahameed [this message]
2017-01-24 20:16 ` [net-next 03/12] net/mlx5e: TC ipv4 tunnel encap offload cosmetic changes Saeed Mahameed
2017-01-24 20:16 ` [net-next 04/12] net/mlx5e: Use the full tunnel key info for encapsulation offload house-keeping Saeed Mahameed
2017-01-24 20:16 ` [net-next 05/12] net/mlx5e: Maximize ip tunnel key usage on the TC offloading path Saeed Mahameed
2017-01-24 20:16 ` [net-next 06/12] net/mlx5e: Support SRIOV TC encapsulation offloads for IPv6 tunnels Saeed Mahameed
2017-01-24 20:16 ` [net-next 07/12] net/mlx5: E-Switch, Enlarge the FDB size for the switchdev mode Saeed Mahameed
2017-01-24 20:16 ` [net-next 08/12] net/mlx5: Add support for setting VF min rate Saeed Mahameed
2017-01-24 20:16 ` [net-next 09/12] net/mlx5: Push min-inline mode resolution helper into the core Saeed Mahameed
2017-01-24 20:16 ` [net-next 10/12] IB/mlx5: Enable Eth VFs to query their min-inline value for user-space Saeed Mahameed
2017-01-24 20:16 ` [net-next 11/12] net/mlx5e: Reduce memory consumption on kdump kernel Saeed Mahameed
2017-01-24 20:16 ` [net-next 12/12] net/mlx5e: CQE compression control code reuse Saeed Mahameed
2017-01-25 17:52 ` [pull request][net-next 00/12] Mellanox mlx5 updates 2017-01-24 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=20170124201652.2920-3-saeedm@mellanox.com \
--to=saeedm@mellanox.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.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