bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] libbpf: use AF_LOCAL instead of AF_INET in xsk.c
@ 2021-02-09 22:18 Stanislav Fomichev
  2021-02-12  6:59 ` Björn Töpel
  2021-02-12 19:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Stanislav Fomichev @ 2021-02-09 22:18 UTC (permalink / raw)
  To: netdev, bpf; +Cc: ast, daniel, Stanislav Fomichev

We have the environments where usage of AF_INET is prohibited
(cgroup/sock_create returns EPERM for AF_INET). Let's use
AF_LOCAL instead of AF_INET, it should perfectly work with SIOCETHTOOL.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
---
 tools/lib/bpf/xsk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c
index 20500fb1f17e..ffbb588724d8 100644
--- a/tools/lib/bpf/xsk.c
+++ b/tools/lib/bpf/xsk.c
@@ -517,7 +517,7 @@ static int xsk_get_max_queues(struct xsk_socket *xsk)
 	struct ifreq ifr = {};
 	int fd, err, ret;
 
-	fd = socket(AF_INET, SOCK_DGRAM, 0);
+	fd = socket(AF_LOCAL, SOCK_DGRAM, 0);
 	if (fd < 0)
 		return -errno;
 
-- 
2.30.0.478.g8a0d178c01-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] libbpf: use AF_LOCAL instead of AF_INET in xsk.c
  2021-02-09 22:18 [PATCH bpf-next] libbpf: use AF_LOCAL instead of AF_INET in xsk.c Stanislav Fomichev
@ 2021-02-12  6:59 ` Björn Töpel
  2021-02-12 16:15   ` sdf
  2021-02-12 19:40 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Björn Töpel @ 2021-02-12  6:59 UTC (permalink / raw)
  To: Stanislav Fomichev; +Cc: Netdev, bpf, Alexei Starovoitov, Daniel Borkmann

On Tue, 9 Feb 2021 at 23:50, Stanislav Fomichev <sdf@google.com> wrote:
>
> We have the environments where usage of AF_INET is prohibited
> (cgroup/sock_create returns EPERM for AF_INET). Let's use
> AF_LOCAL instead of AF_INET, it should perfectly work with SIOCETHTOOL.
>
> Signed-off-by: Stanislav Fomichev <sdf@google.com>

Stanislav, apologies for the delay!

Tested-by: Björn Töpel <bjorn.topel@intel.com>
Acked-by: Björn Töpel <bjorn.topel@intel.com>


Björn

> ---
>  tools/lib/bpf/xsk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c
> index 20500fb1f17e..ffbb588724d8 100644
> --- a/tools/lib/bpf/xsk.c
> +++ b/tools/lib/bpf/xsk.c
> @@ -517,7 +517,7 @@ static int xsk_get_max_queues(struct xsk_socket *xsk)
>         struct ifreq ifr = {};
>         int fd, err, ret;
>
> -       fd = socket(AF_INET, SOCK_DGRAM, 0);
> +       fd = socket(AF_LOCAL, SOCK_DGRAM, 0);
>         if (fd < 0)
>                 return -errno;
>
> --
> 2.30.0.478.g8a0d178c01-goog
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] libbpf: use AF_LOCAL instead of AF_INET in xsk.c
  2021-02-12  6:59 ` Björn Töpel
@ 2021-02-12 16:15   ` sdf
  0 siblings, 0 replies; 4+ messages in thread
From: sdf @ 2021-02-12 16:15 UTC (permalink / raw)
  To: Björn Töpel; +Cc: Netdev, bpf, Alexei Starovoitov, Daniel Borkmann

On 02/12, Bj�rn T�pel wrote:
> On Tue, 9 Feb 2021 at 23:50, Stanislav Fomichev <sdf@google.com> wrote:
> >
> > We have the environments where usage of AF_INET is prohibited
> > (cgroup/sock_create returns EPERM for AF_INET). Let's use
> > AF_LOCAL instead of AF_INET, it should perfectly work with SIOCETHTOOL.
> >
> > Signed-off-by: Stanislav Fomichev <sdf@google.com>

> Stanislav, apologies for the delay!
No worries, thank you for the review and testing!

> Tested-by: Bj�rn T�pel <bjorn.topel@intel.com>
> Acked-by: Bj�rn T�pel <bjorn.topel@intel.com>


> Bj�rn

> > ---
> >  tools/lib/bpf/xsk.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c
> > index 20500fb1f17e..ffbb588724d8 100644
> > --- a/tools/lib/bpf/xsk.c
> > +++ b/tools/lib/bpf/xsk.c
> > @@ -517,7 +517,7 @@ static int xsk_get_max_queues(struct xsk_socket  
> *xsk)
> >         struct ifreq ifr = {};
> >         int fd, err, ret;
> >
> > -       fd = socket(AF_INET, SOCK_DGRAM, 0);
> > +       fd = socket(AF_LOCAL, SOCK_DGRAM, 0);
> >         if (fd < 0)
> >                 return -errno;
> >
> > --
> > 2.30.0.478.g8a0d178c01-goog
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] libbpf: use AF_LOCAL instead of AF_INET in xsk.c
  2021-02-09 22:18 [PATCH bpf-next] libbpf: use AF_LOCAL instead of AF_INET in xsk.c Stanislav Fomichev
  2021-02-12  6:59 ` Björn Töpel
@ 2021-02-12 19:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-12 19:40 UTC (permalink / raw)
  To: Stanislav Fomichev; +Cc: netdev, bpf, ast, daniel

Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

On Tue,  9 Feb 2021 14:18:26 -0800 you wrote:
> We have the environments where usage of AF_INET is prohibited
> (cgroup/sock_create returns EPERM for AF_INET). Let's use
> AF_LOCAL instead of AF_INET, it should perfectly work with SIOCETHTOOL.
> 
> Signed-off-by: Stanislav Fomichev <sdf@google.com>
> ---
>  tools/lib/bpf/xsk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [bpf-next] libbpf: use AF_LOCAL instead of AF_INET in xsk.c
    https://git.kernel.org/bpf/bpf-next/c/1e0aa3fb05f8

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-12 19:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 22:18 [PATCH bpf-next] libbpf: use AF_LOCAL instead of AF_INET in xsk.c Stanislav Fomichev
2021-02-12  6:59 ` Björn Töpel
2021-02-12 16:15   ` sdf
2021-02-12 19:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).