ethdev: new Rx/Tx offloads API
authorWei Dai <wei.dai@intel.com>
Thu, 10 May 2018 11:56:55 +0000 (19:56 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:31:51 +0000 (22:31 +0100)
commita4996bd89c42590f8886454a06a994f71acf89dd
tree473add5786efaaa017690953bf7f3994a2a5e9e0
parentdf428ceef4fdbceacda8d50341c25ddd46a76a39
ethdev: new Rx/Tx offloads API

This patch check if a input requested offloading is valid or not.
Any reuqested offloading must be supported in the device capabilities.
Any offloading is disabled by default if it is not set in the parameter
dev_conf->[rt]xmode.offloads to rte_eth_dev_configure() and
[rt]x_conf->offloads to rte_eth_[rt]x_queue_setup().
If any offloading is enabled in rte_eth_dev_configure() by application,
it is enabled on all queues no matter whether it is per-queue or
per-port type and no matter whether it is set or cleared in
[rt]x_conf->offloads to rte_eth_[rt]x_queue_setup().
If a per-queue offloading hasn't be enabled in rte_eth_dev_configure(),
it can be enabled or disabled for individual queue in
ret_eth_[rt]x_queue_setup().
A new added offloading is the one which hasn't been enabled in
rte_eth_dev_configure() and is reuqested to be enabled in
rte_eth_[rt]x_queue_setup(), it must be per-queue type,
otherwise trigger an error log.
The underlying PMD must be aware that the requested offloadings
to PMD specific queue_setup() function only carries those
new added offloadings of per-queue type.

This patch can make above such checking in a common way in rte_ethdev
layer to avoid same checking in underlying PMD.

This patch assumes that all PMDs in 18.05-rc2 have already
converted to offload API defined in 17.11 . It also assumes
that all PMDs can return correct offloading capabilities
in rte_eth_dev_infos_get().

In the beginning of [rt]x_queue_setup() of underlying PMD,
add offloads = [rt]xconf->offloads |
dev->data->dev_conf.[rt]xmode.offloads; to keep same as offload API
defined in 17.11 to avoid upper application broken due to offload
API change.
PMD can use the info that input [rt]xconf->offloads only carry
the new added per-queue offloads to do some optimization or some
code change on base of this patch.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
33 files changed:
doc/guides/prog_guide/poll_mode_drv.rst
doc/guides/rel_notes/release_18_05.rst
drivers/net/avf/avf_rxtx.c
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/cxgbe/cxgbe_ethdev.c
drivers/net/dpaa/dpaa_ethdev.c
drivers/net/dpaa2/dpaa2_ethdev.c
drivers/net/e1000/em_ethdev.c
drivers/net/e1000/em_rxtx.c
drivers/net/e1000/igb_rxtx.c
drivers/net/ena/ena_ethdev.c
drivers/net/failsafe/failsafe_ops.c
drivers/net/fm10k/fm10k_ethdev.c
drivers/net/i40e/i40e_rxtx.c
drivers/net/ixgbe/ixgbe_ethdev.c
drivers/net/ixgbe/ixgbe_rxtx.c
drivers/net/mlx4/mlx4_rxq.c
drivers/net/mlx4/mlx4_txq.c
drivers/net/mlx5/mlx5_ethdev.c
drivers/net/mlx5/mlx5_rxq.c
drivers/net/mlx5/mlx5_txq.c
drivers/net/mvpp2/mrvl_ethdev.c
drivers/net/nfp/nfp_net.c
drivers/net/octeontx/octeontx_ethdev.c
drivers/net/sfc/sfc_rx.c
drivers/net/sfc/sfc_tx.c
drivers/net/tap/rte_eth_tap.c
drivers/net/thunderx/nicvf_ethdev.c
drivers/net/virtio/virtio_rxtx.c
drivers/net/vmxnet3/vmxnet3_ethdev.c
drivers/net/vmxnet3/vmxnet3_rxtx.c
lib/librte_ethdev/rte_ethdev.c
lib/librte_ethdev/rte_ethdev.h