Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b45386ef authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

net: rename IP_INC_STATS_BH()



Rename IP_INC_STATS_BH() to __IP_INC_STATS(), to
better express this is used in non preemptible context.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 08e3baef
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -187,7 +187,7 @@ void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb,
			   unsigned int len);
			   unsigned int len);


#define IP_INC_STATS(net, field)	SNMP_INC_STATS64((net)->mib.ip_statistics, field)
#define IP_INC_STATS(net, field)	SNMP_INC_STATS64((net)->mib.ip_statistics, field)
#define IP_INC_STATS_BH(net, field)	SNMP_INC_STATS64_BH((net)->mib.ip_statistics, field)
#define __IP_INC_STATS(net, field)	SNMP_INC_STATS64_BH((net)->mib.ip_statistics, field)
#define IP_ADD_STATS(net, field, val)	SNMP_ADD_STATS64((net)->mib.ip_statistics, field, val)
#define IP_ADD_STATS(net, field, val)	SNMP_ADD_STATS64((net)->mib.ip_statistics, field, val)
#define IP_ADD_STATS_BH(net, field, val) SNMP_ADD_STATS64_BH((net)->mib.ip_statistics, field, val)
#define IP_ADD_STATS_BH(net, field, val) SNMP_ADD_STATS64_BH((net)->mib.ip_statistics, field, val)
#define IP_UPD_PO_STATS(net, field, val) SNMP_UPD_PO_STATS64((net)->mib.ip_statistics, field, val)
#define IP_UPD_PO_STATS(net, field, val) SNMP_UPD_PO_STATS64((net)->mib.ip_statistics, field, val)
+3 −3
Original line number Original line Diff line number Diff line
@@ -217,13 +217,13 @@ static int br_validate_ipv4(struct net *net, struct sk_buff *skb)


	len = ntohs(iph->tot_len);
	len = ntohs(iph->tot_len);
	if (skb->len < len) {
	if (skb->len < len) {
		IP_INC_STATS_BH(net, IPSTATS_MIB_INTRUNCATEDPKTS);
		__IP_INC_STATS(net, IPSTATS_MIB_INTRUNCATEDPKTS);
		goto drop;
		goto drop;
	} else if (len < (iph->ihl*4))
	} else if (len < (iph->ihl*4))
		goto inhdr_error;
		goto inhdr_error;


	if (pskb_trim_rcsum(skb, len)) {
	if (pskb_trim_rcsum(skb, len)) {
		IP_INC_STATS_BH(net, IPSTATS_MIB_INDISCARDS);
		__IP_INC_STATS(net, IPSTATS_MIB_INDISCARDS);
		goto drop;
		goto drop;
	}
	}


@@ -236,7 +236,7 @@ static int br_validate_ipv4(struct net *net, struct sk_buff *skb)
	return 0;
	return 0;


inhdr_error:
inhdr_error:
	IP_INC_STATS_BH(net, IPSTATS_MIB_INHDRERRORS);
	__IP_INC_STATS(net, IPSTATS_MIB_INHDRERRORS);
drop:
drop:
	return -1;
	return -1;
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -462,7 +462,7 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
	security_skb_classify_flow(skb, flowi4_to_flowi(&fl4));
	security_skb_classify_flow(skb, flowi4_to_flowi(&fl4));
	rt = ip_route_output_flow(net, &fl4, sk);
	rt = ip_route_output_flow(net, &fl4, sk);
	if (IS_ERR(rt)) {
	if (IS_ERR(rt)) {
		IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES);
		__IP_INC_STATS(net, IPSTATS_MIB_OUTNOROUTES);
		return NULL;
		return NULL;
	}
	}


+2 −2
Original line number Original line Diff line number Diff line
@@ -427,7 +427,7 @@ struct dst_entry *inet_csk_route_req(const struct sock *sk,
route_err:
route_err:
	ip_rt_put(rt);
	ip_rt_put(rt);
no_route:
no_route:
	IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES);
	__IP_INC_STATS(net, IPSTATS_MIB_OUTNOROUTES);
	return NULL;
	return NULL;
}
}
EXPORT_SYMBOL_GPL(inet_csk_route_req);
EXPORT_SYMBOL_GPL(inet_csk_route_req);
@@ -466,7 +466,7 @@ struct dst_entry *inet_csk_route_child_sock(const struct sock *sk,
	ip_rt_put(rt);
	ip_rt_put(rt);
no_route:
no_route:
	rcu_read_unlock();
	rcu_read_unlock();
	IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES);
	__IP_INC_STATS(net, IPSTATS_MIB_OUTNOROUTES);
	return NULL;
	return NULL;
}
}
EXPORT_SYMBOL_GPL(inet_csk_route_child_sock);
EXPORT_SYMBOL_GPL(inet_csk_route_child_sock);
+2 −2
Original line number Original line Diff line number Diff line
@@ -65,7 +65,7 @@ static int ip_forward_finish(struct net *net, struct sock *sk, struct sk_buff *s
{
{
	struct ip_options *opt	= &(IPCB(skb)->opt);
	struct ip_options *opt	= &(IPCB(skb)->opt);


	IP_INC_STATS_BH(net, IPSTATS_MIB_OUTFORWDATAGRAMS);
	__IP_INC_STATS(net, IPSTATS_MIB_OUTFORWDATAGRAMS);
	IP_ADD_STATS_BH(net, IPSTATS_MIB_OUTOCTETS, skb->len);
	IP_ADD_STATS_BH(net, IPSTATS_MIB_OUTOCTETS, skb->len);


	if (unlikely(opt->optlen))
	if (unlikely(opt->optlen))
@@ -157,7 +157,7 @@ int ip_forward(struct sk_buff *skb)


too_many_hops:
too_many_hops:
	/* Tell the sender its packet died... */
	/* Tell the sender its packet died... */
	IP_INC_STATS_BH(net, IPSTATS_MIB_INHDRERRORS);
	__IP_INC_STATS(net, IPSTATS_MIB_INHDRERRORS);
	icmp_send(skb, ICMP_TIME_EXCEEDED, ICMP_EXC_TTL, 0);
	icmp_send(skb, ICMP_TIME_EXCEEDED, ICMP_EXC_TTL, 0);
drop:
drop:
	kfree_skb(skb);
	kfree_skb(skb);
Loading