mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
Merge branch 'gtp-minor-enhancements'
Nicolas Dichtel says: ==================== gtp: minor enhancements The first patch removes a useless rcu lock and the second relax alloc constraints when a PDP context is added. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -1036,7 +1036,7 @@ static void pdp_context_delete(struct pdp_ctx *pctx)
|
|||||||
call_rcu(&pctx->rcu_head, pdp_context_free);
|
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)
|
static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info)
|
||||||
{
|
{
|
||||||
@@ -1071,7 +1071,6 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtnl_lock();
|
rtnl_lock();
|
||||||
rcu_read_lock();
|
|
||||||
|
|
||||||
gtp = gtp_find_dev(sock_net(skb->sk), info->attrs);
|
gtp = gtp_find_dev(sock_net(skb->sk), info->attrs);
|
||||||
if (!gtp) {
|
if (!gtp) {
|
||||||
@@ -1095,12 +1094,11 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info)
|
|||||||
if (IS_ERR(pctx)) {
|
if (IS_ERR(pctx)) {
|
||||||
err = PTR_ERR(pctx);
|
err = PTR_ERR(pctx);
|
||||||
} else {
|
} else {
|
||||||
gtp_tunnel_notify(pctx, GTP_CMD_NEWPDP);
|
gtp_tunnel_notify(pctx, GTP_CMD_NEWPDP, GFP_KERNEL);
|
||||||
err = 0;
|
err = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
rcu_read_unlock();
|
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@@ -1168,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",
|
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);
|
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);
|
pdp_context_delete(pctx);
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
@@ -1222,12 +1220,12 @@ nla_put_failure:
|
|||||||
return -EMSGSIZE;
|
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;
|
struct sk_buff *msg;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
|
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, allocation);
|
||||||
if (!msg)
|
if (!msg)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user