Skip to content

Commit 7e2c734

Browse files
committed
netstacklat: upstream removed filter_nonempty_sockqueue
As the filter_min_sockqueue_len can replaced it. This was also part of PR#129 merge, but it makes it easier to review, to keep this in a seperate commit. xdp-project/bpf-examples#129 Signed-off-by: Jesper Dangaard Brouer <hawk@kernel.org>
1 parent 10a331e commit 7e2c734

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

examples/netstacklat.bpf.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const struct netstacklat_bpf_config user_config = {
3535
.filter_pid = false,
3636
.filter_ifindex = true,
3737
.filter_cgroup = true,
38-
.filter_nonempty_sockqueue = false,
3938
.groupby_ifindex = false, /* If true also define CONFIG_GROUPBY_IFINDEX */
4039
.groupby_cgroup = true,
4140
};
@@ -424,39 +423,11 @@ static bool filter_current_task()
424423
return ok;
425424
}
426425

427-
/**
428-
* skb_queue_empty - check if a queue is empty
429-
* @list: queue head
430-
*
431-
* Returns true if the queue is empty, false otherwise.
432-
*
433-
* Copied from /include/linux/skbuff.h
434-
*/
435-
static inline int skb_queue_empty(const struct sk_buff_head *list)
436-
{
437-
return READ_ONCE(list->next) == (const struct sk_buff *)list;
438-
}
439-
440426
static inline bool sk_backlog_empty(const struct sock *sk)
441427
{
442428
return READ_ONCE(sk->sk_backlog.tail) == NULL;
443429
}
444430

445-
static bool filter_nonempty_sockqueue(struct sock *sk)
446-
{
447-
if (!user_config.filter_nonempty_sockqueue)
448-
return true;
449-
450-
if (!skb_queue_empty(&sk->sk_receive_queue))
451-
return true;
452-
453-
/* Packets can also be on the sk_backlog */
454-
if (!sk_backlog_empty(sk))
455-
return true;
456-
457-
return false;
458-
}
459-
460431
/* To lower runtime overhead, skip recording timestamps for sockets with very
461432
* few packets. Use sk_buff_head->qlen to see if e.g. queue have more than 2
462433
* elements
@@ -490,9 +461,6 @@ static bool filter_min_sockqueue_len(struct sock *sk)
490461
static __always_inline bool filter_socket(struct sock *sk, struct sk_buff *skb,
491462
u64 *cgroup_id, const enum netstacklat_hook hook)
492463
{
493-
if (!filter_nonempty_sockqueue(sk))
494-
return false;
495-
496464
if (!filter_min_sockqueue_len(sk))
497465
return false;
498466

examples/netstacklat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ struct netstacklat_bpf_config {
8585
bool filter_pid;
8686
bool filter_ifindex;
8787
bool filter_cgroup;
88-
bool filter_nonempty_sockqueue;
8988
bool groupby_ifindex;
9089
bool groupby_cgroup;
9190
};

0 commit comments

Comments
 (0)