Commit Graph

33962 Commits

Author SHA1 Message Date
Chaoyong He
c3b7254093 net/nfp: support IPv6 VXLAN encap flow action
Add the offload support of encap action for IPv6 VXLAN tunnel.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-25 10:53:33 +02:00
Chaoyong He
724662b4ce net/nfp: support IPv4 VXLAN encap flow action
Add the offload support of encap action for IPv4 VXLAN tunnel.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-25 10:53:33 +02:00
Chaoyong He
36fb222db9 net/nfp: prepare for IPv6 tunnel encap flow action
Add the related data structure and functions, prepare for
the encap action of IPv6 tunnel.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-25 10:53:33 +02:00
Chaoyong He
f382761cd2 net/nfp: prepare for IPv4 tunnel encap flow action
Add the related data structure and functions, prepare for
the encap action of IPv4 tunnel.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-25 10:53:33 +02:00
Chaoyong He
ea6f2fa073 net/nfp: support IPv6 VXLAN flow item
Add the corresponding data structure and logics, to support
the offload of IPv6 VXLAN item.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-25 10:53:33 +02:00
Chaoyong He
d617b75a71 net/nfp: support IPv4 VXLAN flow item
Add the corresponding data structure and logics, to support
the offload of IPv4 VXLAN item.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-25 10:53:33 +02:00
Chaoyong He
a5b876a5aa net/nfp: fix CPP bridge service exit
The CPP (Command Pull Push) bridge service is needed for some debug
tools, but if no debug tools has ever been run, the initial logic of
CPP bridge service will block in accept() function call, and the
DPDK app can't exit normally.

Fixes: bab0e6f48b ("net/nfp: fix infinite loop")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
2022-10-25 10:53:33 +02:00
Chaoyong He
39d82d2098 net/nfp: fix promiscuous mode for representor port
The original functions of promiscuous mode can't process the
representor port rightly, revise the logic to do that.

Fixes: e1124c4f8a ("net/nfp: add flower representor framework")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
2022-10-24 14:30:43 +02:00
Chaoyong He
3202b003be net/nfp: support IPv6 DSCP flow action
Add the corresponding logics to support the offload of
set IPv6 DSCP action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
9c665d70f7 net/nfp: support IPv4 DSCP flow action
Add the corresponding logics to support the offload of
set IPv4 DSCP action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
ac12e126c4 net/nfp: support TTL flow action
Add the corresponding data structure and logics, to support
the offload of set TTL action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
87986df09d net/nfp: support TP destination flow action
Add the corresponding logics to support the offload of set
TP dest port action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
fc185097bb net/nfp: support TP source flow action
Add the corresponding data structure and logics, to support
the offload of set TP source port action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
51384f79b2 net/nfp: support IPv6 destination flow action
Add the corresponding logics to support the offload of
set dest IPv6 address action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
596ae22172 net/nfp: support IPv6 source flow action
Add the corresponding data structure and logics, to support
the offload of set source IPv6 address action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
f85c1e05bf net/nfp: support IPv4 destination flow action
Add the corresponding logics to support the offload of
set dest IPv4 address action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
ab80975b0a net/nfp: support IPv4 source flow action
Add the corresponding data structure and logics, to support
the offload of set source IPv4 address action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
eb9277cb2f net/nfp: support VLAN push flow action
Add the corresponding data structure and logics, to support
the offload of push_vlan action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
0203474d75 net/nfp: support VLAN pop flow action
Add the corresponding data structure and logics, to support
the offload of pop_vlan action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
eecc7ca308 net/nfp: support MAC destination flow action
Add the corresponding logics to support the offload of
set dest MAC action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
4f69831545 net/nfp: support MAC source flow action
Add the corresponding data structure and logics, to support
the offload of set source MAC action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
cdb4743541 net/nfp: support SCTP flow item
Add the corresponding logics to support the offload
of SCTP item.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
17956c4e6f net/nfp: support UDP flow item
Add the corresponding logics to support the offload
of UDP item.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
4b768cc836 net/nfp: support TCP flow item
Add the corresponding data structure and logics, to support
the offload of TCP item.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
d965074044 net/nfp: support IPv6 flow item
Add the corresponding data structure and logics, to support
the offload of IPv6 item.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
e8abcff52e net/nfp: support IPv4 flow item
Add the corresponding data structure and logics, to support
the offload of IPv4 item.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
397fa00bf8 net/nfp: support VLAN flow item
Add the corresponding data structure and logics, to support
the offload of VLAN item.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
4d946034bf net/nfp: support basic flow actions
Add the offload support of very basic actions: count, drop
and output.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
8ad9ffa2ce net/nfp: support basic flow items
Add the offload support of very basic items: ethernet and
port id.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
30ecce5227 net/nfp: support flow API
Add the flow validate/create/query/destroy/flush API of nfp PMD.

The flow create API construct a control cmsg and send it to
firmware, then add this flow  to the hash table.

The flow query API get flow stats from the flow_priv structure.
Note there exist an rte_spin_lock to prevent the update and query
action occur at the same time.

The flow destroy API construct a control cmsg and send it to
firmware, then adelete this flow from the hash table.

The flow flush API just iterate the flows in hash table and
call the flow destroy API.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
5c30647de8 net/nfp: add stats logic in ctrl VNIC service
Add the flow stats process logic in the ctrl VNIC service.
The flower firmware pass the flow stats to nfp driver through
control message, we store them in the flow_priv structure.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
ac09376096 net/nfp: add structures and functions for flow offload
Add the structures and functions to process mask table, flow
table, and flow stats id, which are used in the rte_flow
offload logics.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
bab0e6f48b net/nfp: fix infinite loop
The services don't have a method to break the infinite loop, and
this will cause the DPDK app can't end normally.

Fixes: a36634e87e ("net/nfp: add flower ctrl VNIC Rx/Tx")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
2022-10-21 15:00:25 +02:00
Chaoyong He
dee23e6c36 net/nfp: fix CPP bridge service requirement
The CPP (Command Pull Push) bridge service is needed for some debug
tools, and should be optional, so remove the mandatory requirement of
service lcore parameter.

Fixes: b188042195 ("net/nfp: add initial flower firmware support")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
2022-10-21 15:00:25 +02:00
Peng Zhang
dbad6f64f9 net/nfp: fix internal buffer size and MTU check
When MTU is bigger than hw->flbufsz, it can't work. hw->flbufsz is set
in the nfp_net_rx_queue_setup().

At first, in the nfp_net_configure(), the hw->flbufsz isn't set the
value, it just judge the initialized value and MTU, it is unreasonable.

Now, it just check the MTU can't be more than the NFP_FRAME_SIZE_MAX in
the nfp_net_configure(), when hw->flbufsz is set the value, in the
nfp_net_start(), judge the hw->flbufsz and MTU.

Fixes: 5c305e218f ("net/nfp: fix initialization")
Cc: stable@dpdk.org

Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-21 11:56:59 +02:00
Chengwen Feng
020dbb4c2a app/testpmd: remove jumbo offload
The jumbo offload was removed from patch [1], but testpmd still exist
jumbo offload related code, this patch removes it, and also updates
the rst file.

[1] ethdev: remove jumbo offload flag

Fixes: b563c14212 ("ethdev: remove jumbo offload flag")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2022-10-20 09:20:55 +02:00
Chengwen Feng
c622735dd3 net/bonding: call Tx prepare before Tx burst
Normally, to use the HW offloads capability (e.g. checksum and TSO) in
the Tx direction, the application needs to call rte_eth_tx_prepare() to
do some adjustment with the packets before sending them. But the
tx_prepare callback of the bonding driver is not implemented. Therefore,
the sent packets may have errors (e.g. checksum errors).

However, it is difficult to design the tx_prepare callback for bonding
driver. Because when a bonded device sends packets, the bonded device
allocates the packets to different slave devices based on the real-time
link status and bonding mode. That is, it is very difficult for the
bonded device to determine which slave device's prepare function should
be invoked.

So in this patch, the tx_prepare callback of bonding driver is not
implemented. Instead, the rte_eth_tx_prepare() will be called before
rte_eth_tx_burst(). In this way, all tx_offloads can be processed
correctly for all NIC devices.

Note: because it is rara that bond different PMDs together, so just
call tx-prepare once in broadcast bonding mode.

Also the following description was added to the rte_eth_tx_burst()
function:
"@note This function must not modify mbufs (including packets data)
unless the refcnt is 1. The exception is the bonding PMD, which does not
have tx-prepare function, in this case, mbufs maybe modified."

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Chas Williams <3chas3@gmail.com>
2022-10-20 08:36:34 +02:00
Ivan Malov
df810d1b6e net/bonding: fix flow flush order on close
The current code first removes all back-end devices of
the bonded device and then invokes flush operation to
remove flows in such back-end devices, which makes no
sense. Fix that by re-ordering the steps accordingly.

Fixes: 49dad9028e ("net/bonding: support flow API")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2022-10-20 08:30:22 +02:00
Ivan Malov
339f1ba513 net/bonding: make configure method re-entrant
According to the documentation, rte_eth_dev_configure()
can be invoked repeatedly while in stopped state.
The current implementation in the bonding driver
allows for that (technically), but the user sees
warnings which say that back-end devices have
already been harnessed. Re-factor the code
to have cleanup before each (re-)configure.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Chas Williams <3chas3@gmail.com>
2022-10-19 10:23:40 +02:00
Andrew Boyer
a5b1ffd880 net/ionic: add watchdogs to protect each queue type
Ring the doorbell again for the following scenarios:
 * No receives posted but Rx queue not empty after deadline
 * No transmits posted but Tx work still pending after deadline
 * Admin queue work still pending after deadline

This will help the queues recover in the extremely rare case that
a doorbell is missed by the FW.

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
2022-10-18 23:38:26 +02:00
Andrew Boyer
13133a2883 net/ionic: retry init commands up to five times
In some configurations, the FW may return EAGAIN if it is not able
to respond to commands immediately. Retry the init commands in this
case to prevent errors from reaching the client.

Fix up some return-code stuff while here, for clarity.

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
2022-10-18 23:38:26 +02:00
Andrew Boyer
15770e9866 net/ionic: use helper variable for page size
This improves readability.

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
2022-10-18 23:38:26 +02:00
Andrew Boyer
e86a6fcc7c net/ionic: add optimized non-scattered Rx/Tx
The code is very similar, but the simple case can skip a few branches
in the hot path. This improves PPS when 10KB mbufs are used.

S/G is enabled on the Rx side by offload DEV_RX_OFFLOAD_SCATTER.
S/G is enabled on the Tx side by offload DEV_TX_OFFLOAD_MULTI_SEGS.

S/G is automatically enabled on the Rx side if the provided mbufs are
too small to hold the maximum possible frame.

To enable S/G in testpmd, add these args:
  --rx-offloads=0x2000 --tx-offloads=0x8000

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
Signed-off-by: R Mohamed Shah <mohamedshah.r@amd.com>
2022-10-18 23:38:26 +02:00
Andrew Boyer
07512941de net/ionic: allow to specify Tx free threshold
Some clients have opinions about how often to flush the
transmit ring.

The default value is the number of Tx descriptors minus the
default Tx burst size.

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
2022-10-18 23:38:26 +02:00
Andrew Boyer
c5d0bb79fd net/ionic: add alignment and socket info in allocations
This will avoid memory access penalties on NUMA systems.

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
2022-10-18 23:38:26 +02:00
Andrew Boyer
c663c7ecb0 net/ionic: use calloc for array allocations
Use rte_calloc() where appropriate.
This makes the code clearer.

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
2022-10-18 23:38:26 +02:00
Andrew Boyer
9de21005e2 net/ionic: add Q-in-CMB option
When 'ionic_cmb' is set to '1', queue memory will be allocated from
the device's onboard memory (Controller Memory Buffer). In some
configurations, this will dramatically reduce packet latency and
increase PPS.

Add the WC_ACTIVATE flag to the PCI driver flags.
Write combining must be enabled to achieve the maximum PPS.

When the queue is in the CMB, descriptors cannot be prefetched.

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
Signed-off-by: Neel Patel <neel.patel@amd.com>
2022-10-18 23:38:26 +02:00
Andrew Boyer
60625147e0 net/ionic: support Tx descriptor status
This may be useful for clients.

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
Signed-off-by: Allen Hubbe <allen.hubbe@amd.com>
2022-10-18 23:38:26 +02:00
Andrew Boyer
0983a74aee net/ionic: support Rx descriptor status
These may be useful for clients.

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
Signed-off-by: Allen Hubbe <allen.hubbe@amd.com>
2022-10-18 23:38:26 +02:00
Andrew Boyer
b5b56afdd3 net/ionic: advertise supported packet types
This improves performance, since clients may be able to skip SW
packet classification.

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
2022-10-18 23:38:26 +02:00