[SRU][F:linux-bluefield][PATCH] UBUNTU: SAUCE: xfrm: IPsec Export xfrm_policy_lookup_bytype function

Tim Gardner tim.gardner at canonical.com
Tue Jul 6 19:03:25 UTC 2021


I'm not sure what to think about this. Philosophically it is no 
different then the patch set from a couple weeks ago that enforced 
EXPORT_SYMBOL_GPL and broke some out of tree drivers. Have you checked 
with the maintainers to get their opinion ? I can just about guess what 
they'll say.

rtg

On 7/1/21 10:47 AM, Bodong Wang wrote:
> From: Raed Salem <raeds at nvidia.com>
> 
> BugLink: https://launchpad.net/bugs/1934313
> 
> Export policy lookup function so drivers could lookup
> a policy that match specific criteria.
> 
> Signed-off-by: Raed Salem <raeds at nvidia.com>
> Signed-off-by: Bodong Wang <bodong at nvidia.com>
> ---
>   include/net/xfrm.h     | 4 ++++
>   net/xfrm/xfrm_policy.c | 9 +++++----
>   2 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/include/net/xfrm.h b/include/net/xfrm.h
> index bb89b6f6..f9e6b50 100644
> --- a/include/net/xfrm.h
> +++ b/include/net/xfrm.h
> @@ -345,6 +345,10 @@ int km_query(struct xfrm_state *x, struct xfrm_tmpl *t,
>   	     struct xfrm_policy *pol);
>   void km_state_expired(struct xfrm_state *x, int hard, u32 portid);
>   int __xfrm_state_delete(struct xfrm_state *x);
> +struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type,
> +					      const struct flowi *fl,
> +					      u16 family, u8 dir,
> +					      u32 if_id);
>   
>   struct xfrm_state_afinfo {
>   	u8				family;
> diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
> index cfbe490..e318ec7 100644
> --- a/net/xfrm/xfrm_policy.c
> +++ b/net/xfrm/xfrm_policy.c
> @@ -2071,10 +2071,10 @@ static int xfrm_policy_match(const struct xfrm_policy *pol,
>   	return prefer;
>   }
>   
> -static struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type,
> -						     const struct flowi *fl,
> -						     u16 family, u8 dir,
> -						     u32 if_id)
> +struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type,
> +					      const struct flowi *fl,
> +					      u16 family, u8 dir,
> +					      u32 if_id)
>   {
>   	struct xfrm_pol_inexact_candidates cand;
>   	const xfrm_address_t *daddr, *saddr;
> @@ -2135,6 +2135,7 @@ static struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type,
>   
>   	return ret;
>   }
> +EXPORT_SYMBOL(xfrm_policy_lookup_bytype);
>   
>   static struct xfrm_policy *xfrm_policy_lookup(struct net *net,
>   					      const struct flowi *fl,
> 

-- 
-----------
Tim Gardner
Canonical, Inc



More information about the kernel-team mailing list