Skip to content

Commit ca027a1

Browse files
Jakub Kicinskiborkmann
authored andcommitted
nfp: bpf: add short busy wait for FW replies
Scheduling out and in for every FW message can slow us down unnecessarily. Our experiments show that even under heavy load the FW responds to 99.9% messages within 200 us. Add a short busy wait before entering the wait queue. Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
1 parent 7fedbb7 commit ca027a1

File tree

1 file changed

+8
-1
lines changed
  • drivers/net/ethernet/netronome/nfp/bpf

1 file changed

+8
-1
lines changed

drivers/net/ethernet/netronome/nfp/bpf/cmsg.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,14 @@ nfp_bpf_cmsg_wait_reply(struct nfp_app_bpf *bpf, enum nfp_bpf_cmsg_type type,
157157
int tag)
158158
{
159159
struct sk_buff *skb;
160-
int err;
160+
int i, err;
161+
162+
for (i = 0; i < 50; i++) {
163+
udelay(4);
164+
skb = nfp_bpf_reply(bpf, tag);
165+
if (skb)
166+
return skb;
167+
}
161168

162169
err = wait_event_interruptible_timeout(bpf->cmsg_wq,
163170
skb = nfp_bpf_reply(bpf, tag),

0 commit comments

Comments
 (0)