udp: remove obsolete SNMP TODO
Subsystems (3)
PATCH 1/1 udp: remove obsolete SNMP TODO
The TODO comment demands SNMP counters be increased, and that is already implemented by the callers of __udp_enqueue_schedule_skb() which are __udp_queue_rcv_skb() and __udpv6_queue_rcv_skb().
That makes the TODO obsolete.
--- net/ipv4/udp.c | 1 - 1 file changed, 1 deletion(-)
net/ipv4/udp.c +0 -1
@@ -1797,7 +1797,6 @@ int __udp_enqueue_schedule_skb(struct sock *sk, struct sk_buff *skb) skb = to_drop; to_drop = skb->next;skb_mark_not_on_list (skb); -/* TODO: update SNMP values. */ sk_skb_reason_drop (sk, skb,SKB_DROP_REASON_PROTO_MEM ); }numa_drop_add (&udp_sk (sk)->drop_counters, nb);
Signature · 1 line
2.34.1
Quoted 6 lines · Mahdi Faramarzpour
The TODO comment demands SNMP counters be increased, and that is already implemented by the callers of
__udp_enqueue_schedule_skb()which are__udp_queue_rcv_skb()and__udpv6_queue_rcv_skb().That makes the TODO obsolete.
This is not true.
Please carefully read commit b650bf0977d3 ("udp: remove busylock and add per NUMA queues")
And perhaps you will see what needs to be changed, thus the TODO .
hint : to_drop can contain more than one skb.
Quoted 21 lines
Signed-off-by Mahdi Faramarzpour <[email protected]>--- net/ipv4/udp.c | 1 - 1 file changed, 1 deletion(-)net/ipv4/udp.c +0
-2@@ -1797,7 +1797,6 @@ int __udp_enqueue_schedule_skb(struct sock *sk, struct sk_buff *skb) skb = to_drop; to_drop = skb->next;skb_mark_not_on_list (skb); -/* TODO: update SNMP values. */ sk_skb_reason_drop (sk, skb,SKB_DROP_REASON_PROTO_MEM ); }numa_drop_add (&udp_sk (sk)->drop_counters, nb); --2.34.1
Quoted 23 lines · Eric Dumazet
Quoted 6 lines · Mahdi Faramarzpour
The TODO comment demands SNMP counters be increased, and that is already implemented by the callers of
__udp_enqueue_schedule_skb()which are__udp_queue_rcv_skb()and__udpv6_queue_rcv_skb().That makes the TODO obsolete.
This is not true.
Please carefully read commit
b650bf0977d3("udp: remove busylock and add per NUMA queues")
And perhaps you will see what needs to be changed, thus the TODO .hint :
to_dropcan contain more than one skb.Quoted 6 lines
Signed-off-by Mahdi Faramarzpour <[email protected]>--- net/ipv4/udp.c | 1 - 1 file changed, 1 deletion(-)
Quoted 15 lines
Quoted 13 lines
net/ipv4/udp.c +0
-2@@ -1797,7 +1797,6 @@ int __udp_enqueue_schedule_skb(struct sock *sk, struct sk_buff *skb) skb = to_drop; to_drop = skb->next;skb_mark_not_on_list (skb); -/* TODO: update SNMP values. */ sk_skb_reason_drop (sk, skb,SKB_DROP_REASON_PROTO_MEM ); }numa_drop_add (&udp_sk (sk)->drop_counters, nb); --Quoted 2 lines
2.34.1
Hi Eric, thanks for your response. Yes I read that commit and now one thing remains: SNMP stats are per-cpu. Is it necessary that the counter corresponding to the original cpu which put the skb in the prod queue be increased? Or can we just do with increasing that of the cpu which drops them?
The only place that I saw we use those counters is net/ipv4/proc.c which calculates their sum with snmp_get_cpu_field_batch_cnt, so their individual values does not seem to concern us at this point. Sorry if the question sounds noobie, it's actually my first time contributing.
If you're positive with that, I'll submit another patch.
cheers
Mahdi