Commit 6362a6a0 authored by Florian Westphal's avatar Florian Westphal Committed by David S. Miller

drivers: net: ethernet: mellanox: use skb_sec_path helper

Will avoid touching this when sp pointer is removed from sk_buff struct.
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2fdb435b
...@@ -254,11 +254,13 @@ struct sk_buff *mlx5e_ipsec_handle_tx_skb(struct net_device *netdev, ...@@ -254,11 +254,13 @@ struct sk_buff *mlx5e_ipsec_handle_tx_skb(struct net_device *netdev,
struct mlx5e_ipsec_metadata *mdata; struct mlx5e_ipsec_metadata *mdata;
struct mlx5e_ipsec_sa_entry *sa_entry; struct mlx5e_ipsec_sa_entry *sa_entry;
struct xfrm_state *x; struct xfrm_state *x;
struct sec_path *sp;
if (!xo) if (!xo)
return skb; return skb;
if (unlikely(skb->sp->len != 1)) { sp = skb_sec_path(skb);
if (unlikely(sp->len != 1)) {
atomic64_inc(&priv->ipsec->sw_stats.ipsec_tx_drop_bundle); atomic64_inc(&priv->ipsec->sw_stats.ipsec_tx_drop_bundle);
goto drop; goto drop;
} }
...@@ -372,10 +374,11 @@ struct sk_buff *mlx5e_ipsec_handle_rx_skb(struct net_device *netdev, ...@@ -372,10 +374,11 @@ struct sk_buff *mlx5e_ipsec_handle_rx_skb(struct net_device *netdev,
bool mlx5e_ipsec_feature_check(struct sk_buff *skb, struct net_device *netdev, bool mlx5e_ipsec_feature_check(struct sk_buff *skb, struct net_device *netdev,
netdev_features_t features) netdev_features_t features)
{ {
struct sec_path *sp = skb_sec_path(skb);
struct xfrm_state *x; struct xfrm_state *x;
if (skb->sp && skb->sp->len) { if (sp && sp->len) {
x = skb->sp->xvec[0]; x = sp->xvec[0];
if (x && x->xso.offload_handle) if (x && x->xso.offload_handle)
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment