On Mon, May 24, 2021 at 6:36 PM <[email protected]> wrote:
>
> From: Pavan Nikhilesh <[email protected]>
>
> Add event vector support for cnxk event Rx adapter, add control path
> APIs to get vector limits and ability to configure event vectorization
> on a given Rx queue.
>
> Signed-off-by: Pavan Nikhilesh <[email protected]>
> +
> +static int
> +cn10k_sso_rx_adapter_vector_config(
> + const struct rte_eventdev *event_dev, const struct rte_eth_dev
> *eth_dev,
> + int32_t rx_queue_id,
> + const struct rte_event_eth_rx_adapter_event_vector_config *config)
> +{
> + struct cnxk_eth_dev *cnxk_eth_dev;
> + struct cnxk_sso_evdev *dev;
> + int i, rc;
> +
> + rc = strncmp(eth_dev->device->driver->name, "net_cn10k", 8);
> + if (rc)
> + return -EINVAL;
> +
> + dev = cnxk_sso_pmd_priv(event_dev);
> + cnxk_eth_dev = cnxk_eth_pmd_priv(eth_dev);
> + if (rx_queue_id < 0) {
> + for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
> + cnxk_sso_updt_xae_cnt(dev, config->vector_mp,
> + RTE_EVENT_TYPE_ETHDEV_VECTOR);
> + rc = cnxk_sso_xae_reconfigure(
> + (struct rte_eventdev *)(uintptr_t)event_dev);
> + rc = cnxk_sso_rx_adapter_vwqe_enable(
> + cnxk_eth_dev, eth_dev->data->port_id, i,
> + config->vector_sz, config->vector_timeout_ns,
> + config->vector_mp);
> + if (rc)
> + return -EINVAL;
> + }
See below
> + } else {
> +
> + cnxk_sso_updt_xae_cnt(dev, config->vector_mp,
> + RTE_EVENT_TYPE_ETHDEV_VECTOR);
> + rc = cnxk_sso_xae_reconfigure(
> + (struct rte_eventdev *)(uintptr_t)event_dev);
> + rc = cnxk_sso_rx_adapter_vwqe_enable(
> + cnxk_eth_dev, eth_dev->data->port_id, rx_queue_id,
> + config->vector_sz, config->vector_timeout_ns,
> + config->vector_mp);
> + if (rc)
> + return -EINVAL;
> + }
Parameterize and move this separate function to avoid code duplication.
> +
> + return 0;
> +}
> +
# Add update this feature in doc/guides/eventdevs/cnxk.rst.
# Please add a new section in the release not for the enhancement of
event cnxk driver and add new feature there
as you update the feature in code.