* [PATCH bpf-next] net-veth: add type safety to veth_xdp_to_ptr() and veth_ptr_to_xdp()
@ 2020-08-19 2:00 Maciej Żenczykowski
2020-08-19 21:16 ` Alexei Starovoitov
0 siblings, 1 reply; 2+ messages in thread
From: Maciej Żenczykowski @ 2020-08-19 2:00 UTC (permalink / raw)
To: Maciej Żenczykowski, Alexei Starovoitov, Daniel Borkmann
Cc: Linux Network Development Mailing List,
Linux Kernel Mailing List, BPF Mailing List, David S . Miller
From: Maciej Żenczykowski <maze@google.com>
This reduces likelihood of incorrect use.
Test: builds
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
drivers/net/veth.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index e56cd562a664..b80cbffeb88e 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -234,14 +234,14 @@ static bool veth_is_xdp_frame(void *ptr)
return (unsigned long)ptr & VETH_XDP_FLAG;
}
-static void *veth_ptr_to_xdp(void *ptr)
+static struct xdp_frame *veth_ptr_to_xdp(void *ptr)
{
return (void *)((unsigned long)ptr & ~VETH_XDP_FLAG);
}
-static void *veth_xdp_to_ptr(void *ptr)
+static void *veth_xdp_to_ptr(struct xdp_frame *xdp)
{
- return (void *)((unsigned long)ptr | VETH_XDP_FLAG);
+ return (void *)((unsigned long)xdp | VETH_XDP_FLAG);
}
static void veth_ptr_free(void *ptr)
--
2.28.0.220.ged08abb693-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH bpf-next] net-veth: add type safety to veth_xdp_to_ptr() and veth_ptr_to_xdp()
2020-08-19 2:00 [PATCH bpf-next] net-veth: add type safety to veth_xdp_to_ptr() and veth_ptr_to_xdp() Maciej Żenczykowski
@ 2020-08-19 21:16 ` Alexei Starovoitov
0 siblings, 0 replies; 2+ messages in thread
From: Alexei Starovoitov @ 2020-08-19 21:16 UTC (permalink / raw)
To: Maciej Żenczykowski
Cc: Maciej Żenczykowski, Alexei Starovoitov, Daniel Borkmann,
Linux Network Development Mailing List,
Linux Kernel Mailing List, BPF Mailing List, David S . Miller
On Tue, Aug 18, 2020 at 7:00 PM Maciej Żenczykowski
<zenczykowski@gmail.com> wrote:
>
> From: Maciej Żenczykowski <maze@google.com>
>
> This reduces likelihood of incorrect use.
>
> Test: builds
I kept this in the commit log though it's a pointless comment.
Please reconsider for the future.
If you want to mention how you've tested it, please say so after "---" line.
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
Applied. Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-19 21:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19 2:00 [PATCH bpf-next] net-veth: add type safety to veth_xdp_to_ptr() and veth_ptr_to_xdp() Maciej Żenczykowski
2020-08-19 21:16 ` Alexei Starovoitov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.