*
* @param rss
* RSS context to attach to.
+ *
+ * @return
+ * 0 on success, a negative errno value otherwise and rte_errno is set.
*/
int mlx4_rss_attach(struct mlx4_rss *rss)
{
int ret;
if (!rte_is_power_of_2(RTE_DIM(ind_tbl))) {
+ ret = EINVAL;
msg = "number of RSS queues must be a power of two";
goto error;
}
if (id < priv->dev->data->nb_rx_queues)
rxq = priv->dev->data->rx_queues[id];
if (!rxq) {
+ ret = EINVAL;
msg = "RSS target queue is not configured";
goto error;
}
.comp_mask = 0,
});
if (!rss->ind) {
+ ret = errno ? errno : EINVAL;
msg = "RSS indirection table creation failure";
goto error;
}
},
});
if (!rss->qp) {
+ ret = errno ? errno : EINVAL;
msg = "RSS hash QP creation failure";
goto error;
}
}
return 0;
error:
+ if (rss->qp) {
+ claim_zero(ibv_destroy_qp(rss->qp));
+ rss->qp = NULL;
+ }
+ if (rss->ind) {
+ claim_zero(ibv_destroy_rwq_ind_table(rss->ind));
+ rss->ind = NULL;
+ }
ERROR("mlx4: %s", msg);
--rss->usecnt;
- rte_errno = EINVAL;
- return -rte_errno;
+ rte_errno = ret;
+ return -ret;
}
/**