[PATCH] ebpf: replace deprecated bpf_program__set_socket_filter

Haochen Tong posted 1 patch 1 year, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220527190658.169439-1-i@hexchain.org
Maintainers: Jason Wang <jasowang@redhat.com>, Andrew Melnychenko <andrew@daynix.com>, Yuri Benditovich <yuri.benditovich@daynix.com>
ebpf/ebpf_rss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] ebpf: replace deprecated bpf_program__set_socket_filter
Posted by Haochen Tong 1 year, 11 months ago
bpf_program__set_<TYPE> functions have been deprecated since libbpf 0.8.
Replace with the equivalent bpf_program__set_type call to avoid a
deprecation warning.

Signed-off-by: Haochen Tong <i@hexchain.org>
---
 ebpf/ebpf_rss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ebpf/ebpf_rss.c b/ebpf/ebpf_rss.c
index 118c68da83..cee658c158 100644
--- a/ebpf/ebpf_rss.c
+++ b/ebpf/ebpf_rss.c
@@ -49,7 +49,7 @@ bool ebpf_rss_load(struct EBPFRSSContext *ctx)
         goto error;
     }
 
-    bpf_program__set_socket_filter(rss_bpf_ctx->progs.tun_rss_steering_prog);
+    bpf_program__set_type(rss_bpf_ctx->progs.tun_rss_steering_prog, BPF_PROG_TYPE_SOCKET_FILTER);
 
     if (rss_bpf__load(rss_bpf_ctx)) {
         trace_ebpf_error("eBPF RSS", "can not load RSS program");
-- 
2.36.1
RE: [PATCH] ebpf: replace deprecated bpf_program__set_socket_filter
Posted by Zhang, Chen 1 year, 11 months ago

> -----Original Message-----
> From: Qemu-devel <qemu-devel-
> bounces+chen.zhang=intel.com@nongnu.org> On Behalf Of Haochen Tong
> Sent: Saturday, May 28, 2022 3:07 AM
> To: qemu-devel@nongnu.org
> Cc: qemu-trivial@nongnu.org; Haochen Tong <i@hexchain.org>
> Subject: [PATCH] ebpf: replace deprecated bpf_program__set_socket_filter
> 
> bpf_program__set_<TYPE> functions have been deprecated since libbpf 0.8.
> Replace with the equivalent bpf_program__set_type call to avoid a
> deprecation warning.
> 
> Signed-off-by: Haochen Tong <i@hexchain.org>

It looks good to me.
By the way, add eBPF maintainers.
Reviewed-by: Zhang Chen <chen.zhang@intel.com>

Thanks
Chen

> ---
>  ebpf/ebpf_rss.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ebpf/ebpf_rss.c b/ebpf/ebpf_rss.c index 118c68da83..cee658c158
> 100644
> --- a/ebpf/ebpf_rss.c
> +++ b/ebpf/ebpf_rss.c
> @@ -49,7 +49,7 @@ bool ebpf_rss_load(struct EBPFRSSContext *ctx)
>          goto error;
>      }
> 
> -    bpf_program__set_socket_filter(rss_bpf_ctx-
> >progs.tun_rss_steering_prog);
> +    bpf_program__set_type(rss_bpf_ctx->progs.tun_rss_steering_prog,
> + BPF_PROG_TYPE_SOCKET_FILTER);
> 
>      if (rss_bpf__load(rss_bpf_ctx)) {
>          trace_ebpf_error("eBPF RSS", "can not load RSS program");
> --
> 2.36.1
> 
Re: [PATCH] ebpf: replace deprecated bpf_program__set_socket_filter
Posted by Jason Wang 1 year, 10 months ago
On Tue, May 31, 2022 at 1:40 PM Zhang, Chen <chen.zhang@intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Qemu-devel <qemu-devel-
> > bounces+chen.zhang=intel.com@nongnu.org> On Behalf Of Haochen Tong
> > Sent: Saturday, May 28, 2022 3:07 AM
> > To: qemu-devel@nongnu.org
> > Cc: qemu-trivial@nongnu.org; Haochen Tong <i@hexchain.org>
> > Subject: [PATCH] ebpf: replace deprecated bpf_program__set_socket_filter
> >
> > bpf_program__set_<TYPE> functions have been deprecated since libbpf 0.8.
> > Replace with the equivalent bpf_program__set_type call to avoid a
> > deprecation warning.
> >
> > Signed-off-by: Haochen Tong <i@hexchain.org>
>
> It looks good to me.
> By the way, add eBPF maintainers.
> Reviewed-by: Zhang Chen <chen.zhang@intel.com>

Applied.

Thanks

>
> Thanks
> Chen
>
> > ---
> >  ebpf/ebpf_rss.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/ebpf/ebpf_rss.c b/ebpf/ebpf_rss.c index 118c68da83..cee658c158
> > 100644
> > --- a/ebpf/ebpf_rss.c
> > +++ b/ebpf/ebpf_rss.c
> > @@ -49,7 +49,7 @@ bool ebpf_rss_load(struct EBPFRSSContext *ctx)
> >          goto error;
> >      }
> >
> > -    bpf_program__set_socket_filter(rss_bpf_ctx-
> > >progs.tun_rss_steering_prog);
> > +    bpf_program__set_type(rss_bpf_ctx->progs.tun_rss_steering_prog,
> > + BPF_PROG_TYPE_SOCKET_FILTER);
> >
> >      if (rss_bpf__load(rss_bpf_ctx)) {
> >          trace_ebpf_error("eBPF RSS", "can not load RSS program");
> > --
> > 2.36.1
> >
>
Re: [PATCH] ebpf: replace deprecated bpf_program__set_socket_filter
Posted by Peter Maydell 1 year, 10 months ago
On Wed, 8 Jun 2022 at 09:17, Jason Wang <jasowang@redhat.com> wrote:
>
> On Tue, May 31, 2022 at 1:40 PM Zhang, Chen <chen.zhang@intel.com> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Qemu-devel <qemu-devel-
> > > bounces+chen.zhang=intel.com@nongnu.org> On Behalf Of Haochen Tong
> > > Sent: Saturday, May 28, 2022 3:07 AM
> > > To: qemu-devel@nongnu.org
> > > Cc: qemu-trivial@nongnu.org; Haochen Tong <i@hexchain.org>
> > > Subject: [PATCH] ebpf: replace deprecated bpf_program__set_socket_filter
> > >
> > > bpf_program__set_<TYPE> functions have been deprecated since libbpf 0.8.
> > > Replace with the equivalent bpf_program__set_type call to avoid a
> > > deprecation warning.
> > >
> > > Signed-off-by: Haochen Tong <i@hexchain.org>
> >
> > It looks good to me.
> > By the way, add eBPF maintainers.
> > Reviewed-by: Zhang Chen <chen.zhang@intel.com>
>
> Applied.

Hi -- did this patch get lost somewhere ? We just had a
report about it on irc and it doesn't seem to be in master yet.

thanks
-- PMM
Re: [PATCH] ebpf: replace deprecated bpf_program__set_socket_filter
Posted by Jason Wang 1 year, 9 months ago
On Fri, Jul 1, 2022 at 10:05 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Wed, 8 Jun 2022 at 09:17, Jason Wang <jasowang@redhat.com> wrote:
> >
> > On Tue, May 31, 2022 at 1:40 PM Zhang, Chen <chen.zhang@intel.com> wrote:
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Qemu-devel <qemu-devel-
> > > > bounces+chen.zhang=intel.com@nongnu.org> On Behalf Of Haochen Tong
> > > > Sent: Saturday, May 28, 2022 3:07 AM
> > > > To: qemu-devel@nongnu.org
> > > > Cc: qemu-trivial@nongnu.org; Haochen Tong <i@hexchain.org>
> > > > Subject: [PATCH] ebpf: replace deprecated bpf_program__set_socket_filter
> > > >
> > > > bpf_program__set_<TYPE> functions have been deprecated since libbpf 0.8.
> > > > Replace with the equivalent bpf_program__set_type call to avoid a
> > > > deprecation warning.
> > > >
> > > > Signed-off-by: Haochen Tong <i@hexchain.org>
> > >
> > > It looks good to me.
> > > By the way, add eBPF maintainers.
> > > Reviewed-by: Zhang Chen <chen.zhang@intel.com>
> >
> > Applied.
>
> Hi -- did this patch get lost somewhere ?

Kind of, actually the patch is in my queue but the pull request wasn't sent.

> We just had a
> report about it on irc and it doesn't seem to be in master yet.

Will send it soon.

Thanks

>
> thanks
> -- PMM
>