Thread (29 messages) 29 messages, 4 authors, 2021-02-23

Re: [PATCH bpf-next v2 05/11] bpf: add hashtab support for bpf_for_each_map_elem() helper

From: Yonghong Song <hidden>
Date: 2021-02-23 18:42:04


On 2/22/21 2:56 PM, Alexei Starovoitov wrote:
On Wed, Feb 17, 2021 at 10:18:08AM -0800, Yonghong Song wrote:
quoted
+			ret = BPF_CAST_CALL(callback_fn)((u64)(long)map,
+					(u64)(long)key, (u64)(long)val,
+					(u64)(long)callback_ctx, 0);
+			if (ret) {
+				rcu_read_unlock();
+				ret = (ret == 1) ? 0 : -EINVAL;
+				goto out;
There is a tnum(0,1) check in patch 4.
I'm missing the purpose of this additional check.
I missed this one after I added tnum(0, 1) checking. Will fix in the 
next revision.
quoted
+			}
+		}
+		rcu_read_unlock();
+	}
+out:
+	migrate_enable();
+	return ret ?: num_calls;
+}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help