diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2020-08-28 15:30:56 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-08-31 12:24:34 -0700 |
commit | 151ea46f3de136f350c69562ce377e6d0200ece0 (patch) | |
tree | 0a01b3c0f495fcbd4f3a7ef10f9fd400f21ec0a1 | |
parent | e2d1baca2b3396371db0a6e1643e487519122069 (diff) |
gtp: relax alloc constraint when adding a pdp
When a PDP context is added, the rtnl lock is held, thus no need to force
a GFP_ATOMIC.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/gtp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 6f871ec31393..2ed1e82a8ad8 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1036,7 +1036,7 @@ static void pdp_context_delete(struct pdp_ctx *pctx) call_rcu(&pctx->rcu_head, pdp_context_free); } -static int gtp_tunnel_notify(struct pdp_ctx *pctx, u8 cmd); +static int gtp_tunnel_notify(struct pdp_ctx *pctx, u8 cmd, gfp_t allocation); static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) { @@ -1094,7 +1094,7 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) if (IS_ERR(pctx)) { err = PTR_ERR(pctx); } else { - gtp_tunnel_notify(pctx, GTP_CMD_NEWPDP); + gtp_tunnel_notify(pctx, GTP_CMD_NEWPDP, GFP_KERNEL); err = 0; } @@ -1166,7 +1166,7 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) netdev_dbg(pctx->dev, "GTPv1-U: deleting tunnel id = %x/%x (pdp %p)\n", pctx->u.v1.i_tei, pctx->u.v1.o_tei, pctx); - gtp_tunnel_notify(pctx, GTP_CMD_DELPDP); + gtp_tunnel_notify(pctx, GTP_CMD_DELPDP, GFP_ATOMIC); pdp_context_delete(pctx); out_unlock: @@ -1220,12 +1220,12 @@ nla_put_failure: return -EMSGSIZE; } -static int gtp_tunnel_notify(struct pdp_ctx *pctx, u8 cmd) +static int gtp_tunnel_notify(struct pdp_ctx *pctx, u8 cmd, gfp_t allocation) { struct sk_buff *msg; int ret; - msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, allocation); if (!msg) return -ENOMEM; |