Skip to contentSkip to conversation

xdpsock problem testing multiple queues

DISCUSSION Július Milan 4 participants 6 messages Oct 2, 2019 – Oct 4, 2019

lore
Share & tools
lore
#0 lore raw

Hi all

We are trying to test multiple RX queues with sample program xdpsock from kernel on vmware virtual machine with 2 queues. The driver on the NIC is:

# ethtool -i ens192
driver: vmxnet3
version: 1.4.16.0-k-NAPI

NIC has 2 queues, I can check it by ethtool -S.

But when I try to use queue 1, I am getting following:

# ./xdpsock -i ens192 -q 1
/home/jmilan/ws/pt-xdp/linux/samples/bpf/xdpsock_user.c:xsk_configure_socket:315: errno: 1/"Operation not permitted"

Any ideas what the problem could be? Maybe vmxnet3 driver does not support some necessary operations related to queues?

Best Regards
Július

#1 lore raw

I don't think vmxnet3 has XDP driver support atm, thus just generic (i.e. skb) mode. Anyone confirming?

Il giorno mer 2 ott 2019 alle ore 14:11 Július Milan <[email protected]> ha scritto:

Quoted 19 lines

Hi all

We are trying to test multiple RX queues with sample program xdpsock from kernel on vmware virtual machine with 2 queues. The driver on the NIC is:

# ethtool -i ens192
driver: vmxnet3
version: 1.4.16.0-k-NAPI

NIC has 2 queues, I can check it by ethtool -S.

But when I try to use queue 1, I am getting following:

# ./xdpsock -i ens192 -q 1
/home/jmilan/ws/pt-xdp/linux/samples/bpf/xdpsock_user.c:xsk_configure_socket:315: errno: 1/"Operation not permitted"

Any ideas what the problem could be? Maybe vmxnet3 driver does not support some necessary operations related to queues?

Best Regards
Július

#2 lore raw
In reply to Július Milan
Quoted 9 lines · Július Milan

Hi all

We are trying to test multiple RX queues with sample program xdpsock from kernel on vmware virtual machine with 2 queues. The driver on the NIC is:

# ethtool -i ens192
driver: vmxnet3
version: 1.4.16.0-k-NAPI
Quoted 8 lines

NIC has 2 queues, I can check it by ethtool -S.

But when I try to use queue 1, I am getting following:

# ./xdpsock -i ens192 -q 1
/home/jmilan/ws/pt-xdp/linux/samples/bpf/xdpsock_user.c:xsk_configure_socket:315: errno: 1/"Operation not permitted"

Any ideas what the problem could be? Maybe vmxnet3 driver does not support some necessary operations related to queues?

XDP support is missing for that driver, but the XDP_SKB/generic mode is available, and should work.

Can you run the xdp1 application in the samples directory, to rule out that you can run XDP.

Björn

Quoted 2 lines

Best Regards
Július

#3 lore raw
Quoted 16 lines · On Wed, 2 Oct 2019 15:52:04 +0200 Björn Töpel <[email protected]> wrote:
Quoted 15 lines · Július Milan

Hi all

We are trying to test multiple RX queues with sample program xdpsock from kernel on vmware virtual machine with 2 queues. The driver on the NIC is:

# ethtool -i ens192
driver: vmxnet3
version: 1.4.16.0-k-NAPI

NIC has 2 queues, I can check it by ethtool -S.

But when I try to use queue 1, I am getting following:

# ./xdpsock -i ens192 -q 1
/home/jmilan/ws/pt-xdp/linux/samples/bpf/xdpsock_user.c:xsk_configure_socket:315: errno: 1/"Operation not permitted"
Quoted 8 lines
Quoted 2 lines

Any ideas what the problem could be? Maybe vmxnet3 driver does not support some necessary operations related to queues?

XDP support is missing for that driver, but the XDP_SKB/generic mode is available, and should work.

Can you run the xdp1 application in the samples directory, to rule out that you can run XDP.

xdp1 should work fine but I think the reason for a reported failure is because vmxnet3 driver doesn't expose the {set,get}_channels ethtool API (at least I don't see it?) which is used by libbpf's xsk part for querying the underlying driver how many queues does it has and use that info for creating that many entries in XSKMAP.

So in that case you're limited to use queue 0 because the XSKMAP map has only single entry.

Maciej

Quoted 6 lines

Björn

Quoted 2 lines

Best Regards
Július

#4 lore raw

Many Thanks folks

Quoted 41 lines
Quoted 16 lines · On Wed, 2 Oct 2019 15:52:04 +0200 Björn Töpel <[email protected]> wrote:
Quoted 15 lines · Július Milan

Hi all

We are trying to test multiple RX queues with sample program xdpsock from kernel on vmware virtual machine with 2 queues. The driver on the NIC is:

# ethtool -i ens192
driver: vmxnet3
version: 1.4.16.0-k-NAPI

NIC has 2 queues, I can check it by ethtool -S.

But when I try to use queue 1, I am getting following:

# ./xdpsock -i ens192 -q 1
/home/jmilan/ws/pt-xdp/linux/samples/bpf/xdpsock_user.c:xsk_configure_socket:315: errno: 1/"Operation not permitted"
Quoted 8 lines
Quoted 2 lines

Any ideas what the problem could be? Maybe vmxnet3 driver does not support some necessary operations related to queues?

XDP support is missing for that driver, but the XDP_SKB/generic mode is available, and should work.

Can you run the xdp1 application in the samples directory, to rule out that you can run XDP.

Xdp1 should work fine but I think the reason for a reported failure is because
Vmxnet3 driver doesn't expose the {set,get}_channels ethtool API (at least I don't see it?) which is used by libbpf's xsk part for querying the underlying driver how many queues does it has and use that info for creating that many entries in XSKMAP.

So in that case you're limited to use queue 0 because the XSKMAP map has only single entry.

Maciej

Quoted 6 lines

Björn

Quoted 2 lines

Best Regards
Július

#5 lore raw
In reply to Maciej Fijalkowski
Quoted 28 lines · On Wed, 2 Oct 2019 18:28:57 +0200 Maciej Fijalkowski…
Quoted 16 lines · On Wed, 2 Oct 2019 15:52:04 +0200 Björn Töpel <[email protected]> wrote:
Quoted 15 lines · Július Milan

Hi all

We are trying to test multiple RX queues with sample program xdpsock from kernel on vmware virtual machine with 2 queues. The driver on the NIC is:

# ethtool -i ens192
driver: vmxnet3
version: 1.4.16.0-k-NAPI

NIC has 2 queues, I can check it by ethtool -S.

But when I try to use queue 1, I am getting following:

# ./xdpsock -i ens192 -q 1
/home/jmilan/ws/pt-xdp/linux/samples/bpf/xdpsock_user.c:xsk_configure_socket:315: errno: 1/"Operation not permitted"
Quoted 8 lines
Quoted 2 lines

Any ideas what the problem could be? Maybe vmxnet3 driver does not support some necessary operations related to queues?

XDP support is missing for that driver, but the XDP_SKB/generic mode is available, and should work.

Can you run the xdp1 application in the samples directory, to rule out that you can run XDP.

Quoted 8 lines

xdp1 should work fine but I think the reason for a reported failure is because vmxnet3 driver doesn't expose the {set,get}_channels ethtool API (at least I don't see it?) which is used by libbpf's xsk part for querying the underlying driver how many queues does it has and use that info for creating that many entries in XSKMAP.

So in that case you're limited to use queue 0 because the XSKMAP map has only single entry.

After putting some thoughts into it, I am wondering whether we really need to query the driver for its max queue count via ethtool during the XSKMAP creation.

eBPF resources are being created *after* the bind() syscall, so at that time if it succeeded we are sure that the queue id provided by user is valid, no? Network drivers are usually allocating queues per each CPU on the system, so IMO using the libbpf_num_possible_cpus() for XSKMAP entries would be just fine. Obviously, mlx5 is a special case here, but we can double the value we got in case the xsk->queue_id is higher than the cpu count.

Thoughts?

Quoted 10 lines

Maciej

Quoted 6 lines

Björn

Quoted 2 lines

Best Regards
Július