Skip to content

Commit 9a9bfd0

Browse files
edumazetdavem330
authored andcommitted
net: tcp: use NET_INC_STATS()
While LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES can only be incremented in tcp_transmit_skb() from softirq (incoming message or timer activation), it is better to use NET_INC_STATS() instead of NET_INC_STATS_BH() as tcp_transmit_skb() can be called from process context. This will avoid copy/paste confusion when/if we want to add other SNMP counters in tcp_transmit_skb() Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Hannes Frederic Sowa <hannes@stressinduktion.org> Cc: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a4572e0 commit 9a9bfd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/ipv4/tcp_output.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,8 +864,8 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
864864

865865
if (unlikely(skb->fclone == SKB_FCLONE_ORIG &&
866866
fclone->fclone == SKB_FCLONE_CLONE))
867-
NET_INC_STATS_BH(sock_net(sk),
868-
LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES);
867+
NET_INC_STATS(sock_net(sk),
868+
LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES);
869869

870870
if (unlikely(skb_cloned(skb)))
871871
skb = pskb_copy(skb, gfp_mask);

0 commit comments

Comments
 (0)