MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx5_devx_hrxq_new

Function mlx5_devx_hrxq_new

dpdk/drivers/net/mlx5/mlx5_devx.c:906–948  ·  view source on GitHub ↗

* Create an Rx Hash queue. * * @param dev * Pointer to Ethernet device. * @param hrxq * Pointer to Rx Hash queue. * @param tunnel * Tunnel type. * * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */

Source from the content-addressed store, hash-verified

904 * 0 on success, a negative errno value otherwise and rte_errno is set.
905 */
906static int
907mlx5_devx_hrxq_new(struct rte_eth_dev *dev, struct mlx5_hrxq *hrxq,
908 int tunnel __rte_unused)
909{
910 struct mlx5_priv *priv = dev->data->dev_private;
911 struct mlx5_devx_tir_attr tir_attr = {0};
912 int err;
913
914 mlx5_devx_tir_attr_set(dev, hrxq->rss_key, hrxq->hash_fields,
915 hrxq->ind_table, tunnel, hrxq->symmetric_hash_function,
916 &tir_attr);
917 hrxq->tir = mlx5_devx_cmd_create_tir(priv->sh->cdev->ctx, &tir_attr);
918 if (!hrxq->tir) {
919 DRV_LOG(ERR, "Port %u cannot create DevX TIR.",
920 dev->data->port_id);
921 rte_errno = errno;
922 goto error;
923 }
924#if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)
925#ifdef HAVE_MLX5_HWS_SUPPORT
926 if (hrxq->hws_flags) {
927 hrxq->action = mlx5dr_action_create_dest_tir
928 (priv->dr_ctx,
929 (struct mlx5dr_devx_obj *)hrxq->tir, hrxq->hws_flags, true);
930 if (!hrxq->action)
931 goto error;
932 return 0;
933 }
934#endif
935 if (mlx5_flow_os_create_flow_action_dest_devx_tir(hrxq->tir,
936 &hrxq->action)) {
937 rte_errno = errno;
938 goto error;
939 }
940#endif
941 return 0;
942error:
943 err = rte_errno; /* Save rte_errno before cleanup. */
944 if (hrxq->tir)
945 claim_zero(mlx5_devx_cmd_destroy(hrxq->tir));
946 rte_errno = err; /* Restore rte_errno. */
947 return -rte_errno;
948}
949
950/**
951 * Destroy a DevX TIR object.

Callers 1

Tested by

no test coverage detected