Bug 545 - l3fwd doesn't check offload configuration
Summary: l3fwd doesn't check offload configuration
Status: UNCONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: examples (show other bugs)
Version: 20.08
Hardware: All All
: Normal enhancement
Target Milestone: ---
Assignee: dev
URL:
Depends on:
Blocks:
 
Reported: 2020-09-28 11:17 CEST by Anatoly Burakov
Modified: 2021-03-09 13:47 CET (History)
2 users (show)



Attachments

Description Anatoly Burakov 2020-09-28 11:17:19 CEST
When initializing l3fwd, the offload configuration is not checked, leading to requesting offloads from the device that might not be supported. This is easily verified by attempting to use a pcap vdev in l3fwd.
Comment 1 Zhang, RobinX 2021-02-04 07:42:28 CET
Hi Anatoly, could you please provide your reproduce steps, environment, expect results and actual results in detail? Thanks.
Comment 2 Anatoly Burakov 2021-02-04 12:14:17 CET
Like i said, just trying to use pcap PMD in l3fwd will cause that issue:

```
xxxx@xxxx:~/build/DPDK$ sudo examples/dpdk-l3fwd -l 1,2 --vdev="net_pcap0,iface=enp8s0f0" -- -p 1 --config="(0,0,2)"
EAL: Detected 64 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: No available 2048 kB hugepages reported
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: No legacy callbacks, legacy socket not created
LPM or EM none selected, default LPM on
Initializing port 0 ... Creating queues: nb_rxq=1 nb_txq=2... Port 0 modified RSS hash function based on hardware support,requested:0xa38c configured:0
Ethdev port_id=0 nb_tx_queues=2 > 1
EAL: Error - exiting with code: 1
  Cause: Cannot configure device: err=-22, port=0
```
Comment 3 Ajit Khaparde 2021-03-09 05:05:10 CET
Robin, Do you plan to take a look at this? Thanks
Comment 4 Anatoly Burakov 2021-03-09 13:47:42 CET
Apologies, the above log is a little bit incorrect. Here's the correct log:

```
xxxx@xxxx:~/build/DPDK$ sudo examples/dpdk-l3fwd -l 1 --vdev="net_pcap0,iface=enp8s0f0" -- -p 1 --config="(0,0,1)"
EAL: Detected 64 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: No available 2048 kB hugepages reported
EAL: Probing VFIO support...
EAL: VFIO support initialized
LPM or EM none selected, default LPM on
Initializing port 0 ... Creating queues: nb_rxq=1 nb_txq=1... Port 0 modified RSS hash function based on hardware support,requested:0xa38c configured:0
Ethdev port_id=0 requested Rx offloads 0xe doesn't match Rx offloads capabilities 0x0 in rte_eth_dev_configure()
EAL: Error - exiting with code: 1
  Cause: Cannot configure device: err=-22, port=0
```

As can be seen from above log, the offloads requested and offloads supported don't match in case of pcap driver, because DPDK apparently attempts to request unsupported offloads unconditionally. If this is intended behavior (i.e. if l3fwd is not meant to be working without certain offloads), perhaps the error message should be more descriptive?

Note You need to log in before you can comment on or make changes to this bug.