All of lore.kernel.org
 help / color / mirror / Atom feed
* Redirect from NIC to TAP
@ 2021-02-09  8:31 Radu Stoenescu
  2021-02-09  9:21 ` Jesper Dangaard Brouer
  0 siblings, 1 reply; 11+ messages in thread
From: Radu Stoenescu @ 2021-02-09  8:31 UTC (permalink / raw)
  To: xdp-newbies

Hi

Is it possible to redirect packets from XDP program attached in driver
mode to a physical NIC to a TAP interface?

The same works fine if the XDP programs are attached in generic mode.

Best
-- 
Radu Stoenescu

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

* Re: Redirect from NIC to TAP
  2021-02-09  8:31 Redirect from NIC to TAP Radu Stoenescu
@ 2021-02-09  9:21 ` Jesper Dangaard Brouer
  2021-02-09  9:26   ` Radu Stoenescu
  0 siblings, 1 reply; 11+ messages in thread
From: Jesper Dangaard Brouer @ 2021-02-09  9:21 UTC (permalink / raw)
  To: Radu Stoenescu, Jason Wang; +Cc: brouer, xdp-newbies

On Tue, 9 Feb 2021 10:31:50 +0200
Radu Stoenescu <radu.stoe@gmail.com> wrote:

> Is it possible to redirect packets from XDP program attached in driver
> mode to a physical NIC to a TAP interface?

Cc. Jason Wang as I think he implemented this, but I'm not 100% sure.
Maybe Jason can remember?
(or point me to the relevant code that I can check).

> The same works fine if the XDP programs are attached in generic mode.

So, you have tried and it doesn't work.

What is your setup?

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer


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

* Re: Redirect from NIC to TAP
  2021-02-09  9:21 ` Jesper Dangaard Brouer
@ 2021-02-09  9:26   ` Radu Stoenescu
  2021-02-09  9:41     ` Maciej Fijalkowski
  2021-02-10  3:42     ` Jason Wang
  0 siblings, 2 replies; 11+ messages in thread
From: Radu Stoenescu @ 2021-02-09  9:26 UTC (permalink / raw)
  To: Jesper Dangaard Brouer; +Cc: Jason Wang, xdp-newbies

Hello

My physical NIC is a Netronome (I can come back with exact model type
and driver version).

Redirect NIC to TAP doesn't work when XDP is attached in driver mode.
It works when they are both in generic mode. I haven't tried other
combinations of attachment modes (one driver, other generic etc.).

Thanks

On Tue, Feb 9, 2021 at 11:21 AM Jesper Dangaard Brouer
<brouer@redhat.com> wrote:
>
> On Tue, 9 Feb 2021 10:31:50 +0200
> Radu Stoenescu <radu.stoe@gmail.com> wrote:
>
> > Is it possible to redirect packets from XDP program attached in driver
> > mode to a physical NIC to a TAP interface?
>
> Cc. Jason Wang as I think he implemented this, but I'm not 100% sure.
> Maybe Jason can remember?
> (or point me to the relevant code that I can check).
>
> > The same works fine if the XDP programs are attached in generic mode.
>
> So, you have tried and it doesn't work.
>
> What is your setup?
>
> --
> Best regards,
>   Jesper Dangaard Brouer
>   MSc.CS, Principal Kernel Engineer at Red Hat
>   LinkedIn: http://www.linkedin.com/in/brouer
>


-- 
Radu Stoenescu

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

* Re: Redirect from NIC to TAP
  2021-02-09  9:26   ` Radu Stoenescu
@ 2021-02-09  9:41     ` Maciej Fijalkowski
  2021-02-10  4:30       ` David Ahern
  2021-02-18 10:12       ` Simon Horman
  2021-02-10  3:42     ` Jason Wang
  1 sibling, 2 replies; 11+ messages in thread
From: Maciej Fijalkowski @ 2021-02-09  9:41 UTC (permalink / raw)
  To: Radu Stoenescu
  Cc: Jesper Dangaard Brouer, Jason Wang, xdp-newbies, simon.horman

On Tue, Feb 09, 2021 at 11:26:06AM +0200, Radu Stoenescu wrote:
> Hello
> 
> My physical NIC is a Netronome (I can come back with exact model type
> and driver version).
> 
> Redirect NIC to TAP doesn't work when XDP is attached in driver mode.
> It works when they are both in generic mode. I haven't tried other
> combinations of attachment modes (one driver, other generic etc.).

Looks like Netronome driver still doesn't support XDP_REDIRECT in native
mode.

CC: Simon

Simon, any plans on adding support for redirect?

> 
> Thanks
> 
> On Tue, Feb 9, 2021 at 11:21 AM Jesper Dangaard Brouer
> <brouer@redhat.com> wrote:
> >
> > On Tue, 9 Feb 2021 10:31:50 +0200
> > Radu Stoenescu <radu.stoe@gmail.com> wrote:
> >
> > > Is it possible to redirect packets from XDP program attached in driver
> > > mode to a physical NIC to a TAP interface?
> >
> > Cc. Jason Wang as I think he implemented this, but I'm not 100% sure.
> > Maybe Jason can remember?
> > (or point me to the relevant code that I can check).
> >
> > > The same works fine if the XDP programs are attached in generic mode.
> >
> > So, you have tried and it doesn't work.
> >
> > What is your setup?
> >
> > --
> > Best regards,
> >   Jesper Dangaard Brouer
> >   MSc.CS, Principal Kernel Engineer at Red Hat
> >   LinkedIn: http://www.linkedin.com/in/brouer
> >
> 
> 
> -- 
> Radu Stoenescu

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

* Re: Redirect from NIC to TAP
  2021-02-09  9:26   ` Radu Stoenescu
  2021-02-09  9:41     ` Maciej Fijalkowski
@ 2021-02-10  3:42     ` Jason Wang
  2021-02-10 11:35       ` Jesper Dangaard Brouer
  1 sibling, 1 reply; 11+ messages in thread
From: Jason Wang @ 2021-02-10  3:42 UTC (permalink / raw)
  To: Radu Stoenescu, Jesper Dangaard Brouer; +Cc: xdp-newbies


On 2021/2/9 下午5:26, Radu Stoenescu wrote:
> Hello
>
> My physical NIC is a Netronome (I can come back with exact model type
> and driver version).
>
> Redirect NIC to TAP doesn't work when XDP is attached in driver mode.
> It works when they are both in generic mode. I haven't tried other
> combinations of attachment modes (one driver, other generic etc.).


It should work. I tested with i40e/ixgbe/mlx4 in the past.

What eBPF program did you use? (Is it the one in samples/bpf?)

I would test it by myself.

(It's near to spring festival, so I can only check after the holiday).

Thanks


>
> Thanks
>
> On Tue, Feb 9, 2021 at 11:21 AM Jesper Dangaard Brouer
> <brouer@redhat.com> wrote:
>> On Tue, 9 Feb 2021 10:31:50 +0200
>> Radu Stoenescu <radu.stoe@gmail.com> wrote:
>>
>>> Is it possible to redirect packets from XDP program attached in driver
>>> mode to a physical NIC to a TAP interface?
>> Cc. Jason Wang as I think he implemented this, but I'm not 100% sure.
>> Maybe Jason can remember?
>> (or point me to the relevant code that I can check).
>>
>>> The same works fine if the XDP programs are attached in generic mode.
>> So, you have tried and it doesn't work.
>>
>> What is your setup?
>>
>> --
>> Best regards,
>>    Jesper Dangaard Brouer
>>    MSc.CS, Principal Kernel Engineer at Red Hat
>>    LinkedIn: http://www.linkedin.com/in/brouer
>>
>


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

* Re: Redirect from NIC to TAP
  2021-02-09  9:41     ` Maciej Fijalkowski
@ 2021-02-10  4:30       ` David Ahern
  2021-02-18 10:12       ` Simon Horman
  1 sibling, 0 replies; 11+ messages in thread
From: David Ahern @ 2021-02-10  4:30 UTC (permalink / raw)
  To: Maciej Fijalkowski, Radu Stoenescu
  Cc: Jesper Dangaard Brouer, Jason Wang, xdp-newbies, simon.horman

On 2/9/21 2:41 AM, Maciej Fijalkowski wrote:
> On Tue, Feb 09, 2021 at 11:26:06AM +0200, Radu Stoenescu wrote:
>> Hello
>>
>> My physical NIC is a Netronome (I can come back with exact model type
>> and driver version).
>>
>> Redirect NIC to TAP doesn't work when XDP is attached in driver mode.
>> It works when they are both in generic mode. I haven't tried other
>> combinations of attachment modes (one driver, other generic etc.).
> 

If the driver supports XDP_REDIRECT, it does work.

Take a look at this slide deck for gotcha's with this use case:

https://netdevconf.info/0x14/pub/slides/24/netdev-0x14-XDP-and-the-cloud.pdf

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

* Re: Redirect from NIC to TAP
  2021-02-10  3:42     ` Jason Wang
@ 2021-02-10 11:35       ` Jesper Dangaard Brouer
  2021-02-18  5:48         ` Jason Wang
  0 siblings, 1 reply; 11+ messages in thread
From: Jesper Dangaard Brouer @ 2021-02-10 11:35 UTC (permalink / raw)
  To: Jason Wang; +Cc: Radu Stoenescu, xdp-newbies, brouer, Jakub Kicinski

On Wed, 10 Feb 2021 11:42:10 +0800
Jason Wang <jasowang@redhat.com> wrote:

> On 2021/2/9 下午5:26, Radu Stoenescu wrote:
> > Hello
> >
> > My physical NIC is a Netronome (I can come back with exact model type
> > and driver version).
> >
> > Redirect NIC to TAP doesn't work when XDP is attached in driver mode.
> > It works when they are both in generic mode. I haven't tried other
> > combinations of attachment modes (one driver, other generic etc.).  
> 
> 
> It should work. I tested with i40e/ixgbe/mlx4 in the past.
> 
> What eBPF program did you use? (Is it the one in samples/bpf?)
> 
> I would test it by myself.
> 
> (It's near to spring festival, so I can only check after the holiday).

As Maciej Fijalkowski pointed out:
 "Looks like Netronome driver still doesn't support XDP_REDIRECT in native
mode."

So, that is likely the problem.
-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer


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

* Re: Redirect from NIC to TAP
  2021-02-10 11:35       ` Jesper Dangaard Brouer
@ 2021-02-18  5:48         ` Jason Wang
  0 siblings, 0 replies; 11+ messages in thread
From: Jason Wang @ 2021-02-18  5:48 UTC (permalink / raw)
  To: Jesper Dangaard Brouer; +Cc: Radu Stoenescu, xdp-newbies, Jakub Kicinski


On 2021/2/10 下午7:35, Jesper Dangaard Brouer wrote:
> On Wed, 10 Feb 2021 11:42:10 +0800
> Jason Wang <jasowang@redhat.com> wrote:
>
>> On 2021/2/9 下午5:26, Radu Stoenescu wrote:
>>> Hello
>>>
>>> My physical NIC is a Netronome (I can come back with exact model type
>>> and driver version).
>>>
>>> Redirect NIC to TAP doesn't work when XDP is attached in driver mode.
>>> It works when they are both in generic mode. I haven't tried other
>>> combinations of attachment modes (one driver, other generic etc.).
>>
>> It should work. I tested with i40e/ixgbe/mlx4 in the past.
>>
>> What eBPF program did you use? (Is it the one in samples/bpf?)
>>
>> I would test it by myself.
>>
>> (It's near to spring festival, so I can only check after the holiday).
> As Maciej Fijalkowski pointed out:
>   "Looks like Netronome driver still doesn't support XDP_REDIRECT in native
> mode."
>
> So, that is likely the problem.


I see.

Thanks



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

* Re: Redirect from NIC to TAP
  2021-02-09  9:41     ` Maciej Fijalkowski
  2021-02-10  4:30       ` David Ahern
@ 2021-02-18 10:12       ` Simon Horman
  2021-02-28  6:55         ` Radu Stoenescu
  1 sibling, 1 reply; 11+ messages in thread
From: Simon Horman @ 2021-02-18 10:12 UTC (permalink / raw)
  To: Maciej Fijalkowski
  Cc: Radu Stoenescu, Jesper Dangaard Brouer, Jason Wang, xdp-newbies

Hi Maciej, Hi Radu,

On Tue, Feb 09, 2021 at 10:41:37AM +0100, Maciej Fijalkowski wrote:
> On Tue, Feb 09, 2021 at 11:26:06AM +0200, Radu Stoenescu wrote:
> > Hello
> > 
> > My physical NIC is a Netronome (I can come back with exact model type
> > and driver version).
> > 
> > Redirect NIC to TAP doesn't work when XDP is attached in driver mode.
> > It works when they are both in generic mode. I haven't tried other
> > combinations of attachment modes (one driver, other generic etc.).
> 
> Looks like Netronome driver still doesn't support XDP_REDIRECT in native
> mode.
> 
> CC: Simon

Sorry for the delay, I was on vacation.

> Simon, any plans on adding support for redirect?

Sorry (again), there are no immediate plans to add this feature
to the driver.

> > Thanks
> > 
> > On Tue, Feb 9, 2021 at 11:21 AM Jesper Dangaard Brouer
> > <brouer@redhat.com> wrote:
> > >
> > > On Tue, 9 Feb 2021 10:31:50 +0200
> > > Radu Stoenescu <radu.stoe@gmail.com> wrote:
> > >
> > > > Is it possible to redirect packets from XDP program attached in driver
> > > > mode to a physical NIC to a TAP interface?
> > >
> > > Cc. Jason Wang as I think he implemented this, but I'm not 100% sure.
> > > Maybe Jason can remember?
> > > (or point me to the relevant code that I can check).
> > >
> > > > The same works fine if the XDP programs are attached in generic mode.
> > >
> > > So, you have tried and it doesn't work.
> > >
> > > What is your setup?
> > >
> > > --
> > > Best regards,
> > >   Jesper Dangaard Brouer
> > >   MSc.CS, Principal Kernel Engineer at Red Hat
> > >   LinkedIn: http://www.linkedin.com/in/brouer
> > >
> > 
> > 
> > -- 
> > Radu Stoenescu

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

* Re: Redirect from NIC to TAP
  2021-02-18 10:12       ` Simon Horman
@ 2021-02-28  6:55         ` Radu Stoenescu
  2021-03-01 16:20           ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 11+ messages in thread
From: Radu Stoenescu @ 2021-02-28  6:55 UTC (permalink / raw)
  To: Simon Horman
  Cc: Maciej Fijalkowski, Jesper Dangaard Brouer, Jason Wang, xdp-newbies

Thanks a lot for the info.

In retrospect, was there a way I could reach this conclusion myself
(no driver support)? I'm asking this since I'm relatively new to the
environment and we run various NICs from various vendors, and I would
like to know how to perform the "due diligence" myself before reaching
out?

Best
Radu


On Thu, Feb 18, 2021 at 12:12 PM Simon Horman
<simon.horman@netronome.com> wrote:
>
> Hi Maciej, Hi Radu,
>
> On Tue, Feb 09, 2021 at 10:41:37AM +0100, Maciej Fijalkowski wrote:
> > On Tue, Feb 09, 2021 at 11:26:06AM +0200, Radu Stoenescu wrote:
> > > Hello
> > >
> > > My physical NIC is a Netronome (I can come back with exact model type
> > > and driver version).
> > >
> > > Redirect NIC to TAP doesn't work when XDP is attached in driver mode.
> > > It works when they are both in generic mode. I haven't tried other
> > > combinations of attachment modes (one driver, other generic etc.).
> >
> > Looks like Netronome driver still doesn't support XDP_REDIRECT in native
> > mode.
> >
> > CC: Simon
>
> Sorry for the delay, I was on vacation.
>
> > Simon, any plans on adding support for redirect?
>
> Sorry (again), there are no immediate plans to add this feature
> to the driver.
>
> > > Thanks
> > >
> > > On Tue, Feb 9, 2021 at 11:21 AM Jesper Dangaard Brouer
> > > <brouer@redhat.com> wrote:
> > > >
> > > > On Tue, 9 Feb 2021 10:31:50 +0200
> > > > Radu Stoenescu <radu.stoe@gmail.com> wrote:
> > > >
> > > > > Is it possible to redirect packets from XDP program attached in driver
> > > > > mode to a physical NIC to a TAP interface?
> > > >
> > > > Cc. Jason Wang as I think he implemented this, but I'm not 100% sure.
> > > > Maybe Jason can remember?
> > > > (or point me to the relevant code that I can check).
> > > >
> > > > > The same works fine if the XDP programs are attached in generic mode.
> > > >
> > > > So, you have tried and it doesn't work.
> > > >
> > > > What is your setup?
> > > >
> > > > --
> > > > Best regards,
> > > >   Jesper Dangaard Brouer
> > > >   MSc.CS, Principal Kernel Engineer at Red Hat
> > > >   LinkedIn: http://www.linkedin.com/in/brouer
> > > >
> > >
> > >
> > > --
> > > Radu Stoenescu



-- 
Radu Stoenescu

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

* Re: Redirect from NIC to TAP
  2021-02-28  6:55         ` Radu Stoenescu
@ 2021-03-01 16:20           ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 11+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-03-01 16:20 UTC (permalink / raw)
  To: Radu Stoenescu, Simon Horman
  Cc: Maciej Fijalkowski, Jesper Dangaard Brouer, Jason Wang, xdp-newbies

Radu Stoenescu <radu.stoe@gmail.com> writes:

> Thanks a lot for the info.
>
> In retrospect, was there a way I could reach this conclusion myself
> (no driver support)? I'm asking this since I'm relatively new to the
> environment and we run various NICs from various vendors, and I would
> like to know how to perform the "due diligence" myself before reaching
> out?

Grepping the source code is one. The xdp_monitor tool from samples/bpf
might have provided a hint as well, but only that something was wrong,
not the cause.

This is a long-standing issue, and there's been some discussion around
it, but let's just say that no consensus has emerged yet :/

-Toke


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

end of thread, other threads:[~2021-03-01 16:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09  8:31 Redirect from NIC to TAP Radu Stoenescu
2021-02-09  9:21 ` Jesper Dangaard Brouer
2021-02-09  9:26   ` Radu Stoenescu
2021-02-09  9:41     ` Maciej Fijalkowski
2021-02-10  4:30       ` David Ahern
2021-02-18 10:12       ` Simon Horman
2021-02-28  6:55         ` Radu Stoenescu
2021-03-01 16:20           ` Toke Høiland-Jørgensen
2021-02-10  3:42     ` Jason Wang
2021-02-10 11:35       ` Jesper Dangaard Brouer
2021-02-18  5:48         ` Jason Wang

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.