lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 4 Apr 2019 04:16:21 -0400
From:   Bo YU <tsu.yubo@...il.com>
To:     ast@...nel.org, daniel@...earbox.net, kafai@...com,
        songliubraving@...com, netdev@...r.kernel.org, yhs@...com
Cc:     linux-kernel@...r.kernel.org, bpf@...r.kernel.org
Subject: [PATCH] bpf:sample: fix field 'lock' has incomplete type in hbm.h

When compiling sample/bpf:

samples/bpf/hbm.h:12:23: error: field ‘lock’ has incomplete type
  struct bpf_spin_lock lock;

Fixes: 187d0738ff35(bpf: Sample HBM BPF program to limit egress bw)
Signed-off-by: Bo YU <tsu.yubo@...il.com>
---
 samples/bpf/hbm.h          | 2 +-
 samples/bpf/hbm_out_kern.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/samples/bpf/hbm.h b/samples/bpf/hbm.h
index 518e8147d084..7ce18cb9e365 100644
--- a/samples/bpf/hbm.h
+++ b/samples/bpf/hbm.h
@@ -9,7 +9,7 @@
  * Include file for Host Bandwidth Management (HBM) programs
  */
 struct hbm_vqueue {
-	struct bpf_spin_lock lock;
+	struct bpf_spin_lock *lock;
 	/* 4 byte hole */
 	unsigned long long lasttime;	/* In ns */
 	int credit;			/* In bytes */
diff --git a/samples/bpf/hbm_out_kern.c b/samples/bpf/hbm_out_kern.c
index f806863d0b79..04c4f3d6ab9a 100644
--- a/samples/bpf/hbm_out_kern.c
+++ b/samples/bpf/hbm_out_kern.c
@@ -90,7 +90,7 @@ int _hbm_out_cg(struct __sk_buff *skb)
 	curtime = bpf_ktime_get_ns();

 	// Begin critical section
-	bpf_spin_lock(&qdp->lock);
+	bpf_spin_lock(qdp->lock);
 	credit = qdp->credit;
 	delta = curtime - qdp->lasttime;
 	/* delta < 0 implies that another process with a curtime greater
@@ -105,7 +105,7 @@ int _hbm_out_cg(struct __sk_buff *skb)
 	}
 	credit -= len;
 	qdp->credit = credit;
-	bpf_spin_unlock(&qdp->lock);
+	bpf_spin_unlock(qdp->lock);
 	// End critical section

 	// Check if we should update rate
--
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ