Commit 2fdb435b authored by Florian Westphal's avatar Florian Westphal Committed by David S. Miller

drivers: net: intel: use secpath helpers in more places

Use skb_sec_path and secpath_exists helpers where possible.
This reduces noise in followup patch that removes skb->sp pointer.

v2: no changes, preseve acks from v1.
Acked-by: default avatarShannon Nelson <shannon.lee.nelson@gmail.com>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2294be0f
...@@ -1065,11 +1065,13 @@ int ixgbe_ipsec_tx(struct ixgbe_ring *tx_ring, ...@@ -1065,11 +1065,13 @@ int ixgbe_ipsec_tx(struct ixgbe_ring *tx_ring,
struct ixgbe_adapter *adapter = netdev_priv(tx_ring->netdev); struct ixgbe_adapter *adapter = netdev_priv(tx_ring->netdev);
struct ixgbe_ipsec *ipsec = adapter->ipsec; struct ixgbe_ipsec *ipsec = adapter->ipsec;
struct xfrm_state *xs; struct xfrm_state *xs;
struct sec_path *sp;
struct tx_sa *tsa; struct tx_sa *tsa;
if (unlikely(!first->skb->sp->len)) { sp = skb_sec_path(first->skb);
if (unlikely(!sp->len)) {
netdev_err(tx_ring->netdev, "%s: no xfrm state len = %d\n", netdev_err(tx_ring->netdev, "%s: no xfrm state len = %d\n",
__func__, first->skb->sp->len); __func__, sp->len);
return 0; return 0;
} }
......
...@@ -8695,7 +8695,8 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, ...@@ -8695,7 +8695,8 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
#endif /* IXGBE_FCOE */ #endif /* IXGBE_FCOE */
#ifdef CONFIG_IXGBE_IPSEC #ifdef CONFIG_IXGBE_IPSEC
if (skb->sp && !ixgbe_ipsec_tx(tx_ring, first, &ipsec_tx)) if (secpath_exists(skb) &&
!ixgbe_ipsec_tx(tx_ring, first, &ipsec_tx))
goto out_drop; goto out_drop;
#endif #endif
tso = ixgbe_tso(tx_ring, first, &hdr_len, &ipsec_tx); tso = ixgbe_tso(tx_ring, first, &hdr_len, &ipsec_tx);
...@@ -10192,7 +10193,7 @@ ixgbe_features_check(struct sk_buff *skb, struct net_device *dev, ...@@ -10192,7 +10193,7 @@ ixgbe_features_check(struct sk_buff *skb, struct net_device *dev,
*/ */
if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID)) { if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID)) {
#ifdef CONFIG_IXGBE_IPSEC #ifdef CONFIG_IXGBE_IPSEC
if (!skb->sp) if (!secpath_exists(skb))
#endif #endif
features &= ~NETIF_F_TSO; features &= ~NETIF_F_TSO;
} }
......
...@@ -450,12 +450,14 @@ int ixgbevf_ipsec_tx(struct ixgbevf_ring *tx_ring, ...@@ -450,12 +450,14 @@ int ixgbevf_ipsec_tx(struct ixgbevf_ring *tx_ring,
struct ixgbevf_adapter *adapter = netdev_priv(tx_ring->netdev); struct ixgbevf_adapter *adapter = netdev_priv(tx_ring->netdev);
struct ixgbevf_ipsec *ipsec = adapter->ipsec; struct ixgbevf_ipsec *ipsec = adapter->ipsec;
struct xfrm_state *xs; struct xfrm_state *xs;
struct sec_path *sp;
struct tx_sa *tsa; struct tx_sa *tsa;
u16 sa_idx; u16 sa_idx;
if (unlikely(!first->skb->sp->len)) { sp = skb_sec_path(first->skb);
if (unlikely(!sp->len)) {
netdev_err(tx_ring->netdev, "%s: no xfrm state len = %d\n", netdev_err(tx_ring->netdev, "%s: no xfrm state len = %d\n",
__func__, first->skb->sp->len); __func__, sp->len);
return 0; return 0;
} }
......
...@@ -4157,7 +4157,7 @@ static int ixgbevf_xmit_frame_ring(struct sk_buff *skb, ...@@ -4157,7 +4157,7 @@ static int ixgbevf_xmit_frame_ring(struct sk_buff *skb,
first->protocol = vlan_get_protocol(skb); first->protocol = vlan_get_protocol(skb);
#ifdef CONFIG_IXGBEVF_IPSEC #ifdef CONFIG_IXGBEVF_IPSEC
if (skb->sp && !ixgbevf_ipsec_tx(tx_ring, first, &ipsec_tx)) if (secpath_exists(skb) && !ixgbevf_ipsec_tx(tx_ring, first, &ipsec_tx))
goto out_drop; goto out_drop;
#endif #endif
tso = ixgbevf_tso(tx_ring, first, &hdr_len, &ipsec_tx); tso = ixgbevf_tso(tx_ring, first, &hdr_len, &ipsec_tx);
......
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