]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: prefer secpath_set over secpath_dup
authorFlorian Westphal <fw@strlen.de>
Tue, 18 Dec 2018 16:15:26 +0000 (17:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Dec 2018 19:21:38 +0000 (11:21 -0800)
commitc4888bb1d757d1f4f06d7483f28eaf874bd2a8ac
tree87609cfff448eacf1b18ae19f9f841d416abee2c
parent1166a9c0d67931897353d12100b9a32e0f7f9169
xfrm: prefer secpath_set over secpath_dup

secpath_set is a wrapper for secpath_dup that will not perform
an allocation if the secpath attached to the skb has a reference count
of one, i.e., it doesn't need to be COW'ed.

Also, secpath_dup doesn't attach the secpath to the skb, it leaves
this to the caller.

Use secpath_set in places that immediately assign the return value to
skb.

This allows to remove skb->sp without touching these spots again.

secpath_dup can eventually be removed in followup patch.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
drivers/net/ethernet/intel/ixgbevf/ipsec.c
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c
net/xfrm/Kconfig
net/xfrm/xfrm_output.c