public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Saeed Mahameed <saeedm@mellanox.com>
Subject: [net-next 13/13] net/mlx5e: Issue direct lookup on vxlan ports by vport representors
Date: Fri, 27 Jul 2018 14:15:18 -0700	[thread overview]
Message-ID: <20180727211518.1916-14-saeedm@mellanox.com> (raw)
In-Reply-To: <20180727211518.1916-1-saeedm@mellanox.com>

Remove uplink representor netdevice private structure lookup, and use
mlx5 core handle directly from representor private structure to lookup
vxlan ports.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 288a57f76e84..c28fe469b04a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -1124,16 +1124,12 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv,
 			skb_flow_dissector_target(f->dissector,
 						  FLOW_DISSECTOR_KEY_ENC_PORTS,
 						  f->mask);
-		struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
-		struct mlx5e_rep_priv *uplink_rpriv = mlx5_eswitch_get_uplink_priv(esw, REP_ETH);
-		struct net_device *up_dev = uplink_rpriv->netdev;
-		struct mlx5e_priv *up_priv = netdev_priv(up_dev);
 
 		/* Full udp dst port must be given */
 		if (memchr_inv(&mask->dst, 0xff, sizeof(mask->dst)))
 			goto vxlan_match_offload_err;
 
-		if (mlx5_vxlan_lookup_port(up_priv->mdev->vxlan, be16_to_cpu(key->dst)) &&
+		if (mlx5_vxlan_lookup_port(priv->mdev->vxlan, be16_to_cpu(key->dst)) &&
 		    MLX5_CAP_ESW(priv->mdev, vxlan_encap_decap))
 			parse_vxlan_attr(spec, f);
 		else {
@@ -2533,11 +2529,7 @@ static int mlx5e_attach_encap(struct mlx5e_priv *priv,
 			      struct mlx5e_tc_flow *flow)
 {
 	struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
-	struct mlx5e_rep_priv *uplink_rpriv = mlx5_eswitch_get_uplink_priv(esw,
-									   REP_ETH);
-	struct net_device *up_dev = uplink_rpriv->netdev;
 	unsigned short family = ip_tunnel_info_af(tun_info);
-	struct mlx5e_priv *up_priv = netdev_priv(up_dev);
 	struct mlx5_esw_flow_attr *attr = flow->esw_attr;
 	struct ip_tunnel_key *key = &tun_info->key;
 	struct mlx5e_encap_entry *e;
@@ -2557,7 +2549,7 @@ static int mlx5e_attach_encap(struct mlx5e_priv *priv,
 		return -EOPNOTSUPP;
 	}
 
-	if (mlx5_vxlan_lookup_port(up_priv->mdev->vxlan, be16_to_cpu(key->tp_dst)) &&
+	if (mlx5_vxlan_lookup_port(priv->mdev->vxlan, be16_to_cpu(key->tp_dst)) &&
 	    MLX5_CAP_ESW(priv->mdev, vxlan_encap_decap)) {
 		tunnel_type = MLX5_HEADER_TYPE_VXLAN;
 	} else {
-- 
2.17.0

      parent reply	other threads:[~2018-07-27 22:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 21:15 [pull request][net-next 00/13] Mellanox, mlx5 updates 2018-07-27 (Vxlan updates) Saeed Mahameed
2018-07-27 21:15 ` [net-next 01/13] net/mlx5e: Vxlan, reflect 4789 UDP port default addition to software database Saeed Mahameed
2018-07-27 21:15 ` [net-next 02/13] net/mlx5e: Vxlan, check maximum number of UDP ports Saeed Mahameed
2018-07-27 21:15 ` [net-next 03/13] net/mlx5e: Vxlan, replace ports radix-tree with hash table Saeed Mahameed
2018-07-27 21:15 ` [net-next 04/13] net/mlx5e: Vxlan, replace spinlock with read-write lock Saeed Mahameed
2018-07-27 21:48   ` Stephen Hemminger
2018-07-27 22:29     ` Saeed Mahameed
2018-07-27 21:15 ` [net-next 05/13] net/mlx5e: Vxlan, cleanup an unused member in vxlan work Saeed Mahameed
2018-07-27 21:15 ` [net-next 06/13] net/mlx5e: Vxlan, add direct delete function Saeed Mahameed
2018-07-27 21:15 ` [net-next 07/13] net/mlx5e: Vxlan, move netdev only logic to en_main.c Saeed Mahameed
2018-07-27 21:15 ` [net-next 08/13] net/mlx5e: Vxlan, rename struct mlx5e_vxlan to mlx5_vxlan_port Saeed Mahameed
2018-07-27 21:15 ` [net-next 09/13] net/mlx5e: Vxlan, rename from mlx5e to mlx5 Saeed Mahameed
2018-07-27 21:15 ` [net-next 10/13] net/mlx5e: Vxlan, return values for add/del port Saeed Mahameed
2018-07-27 21:15 ` [net-next 11/13] net/mlx5e: Vxlan, add sync lock for add/del vxlan port Saeed Mahameed
2018-07-27 21:15 ` [net-next 12/13] net/mlx5e: Vxlan, move vxlan logic to core driver Saeed Mahameed
2018-07-27 21:15 ` Saeed Mahameed [this message]

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=20180727211518.1916-14-saeedm@mellanox.com \
    --to=saeedm@mellanox.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