}
#define MLX5_VDPA_DEFAULT_RQT_SIZE 512
-static int __rte_unused
+static int
mlx5_vdpa_rqt_prepare(struct mlx5_vdpa_priv *priv)
{
struct mlx5_vdpa_virtq *virtq;
return -ENOMEM;
}
SLIST_FOREACH(virtq, &priv->virtq_list, next) {
- if (is_virtq_recvq(virtq->index, priv->nr_virtqs)) {
+ if (is_virtq_recvq(virtq->index, priv->nr_virtqs) &&
+ virtq->enable) {
attr->rq_list[i] = virtq->virtq->id;
i++;
}
return ret;
}
+int
+mlx5_vdpa_virtq_enable(struct mlx5_vdpa_virtq *virtq, int enable)
+{
+ struct mlx5_vdpa_priv *priv = virtq->priv;
+ int ret = 0;
+
+ if (virtq->enable == !!enable)
+ return 0;
+ virtq->enable = !!enable;
+ if (is_virtq_recvq(virtq->index, priv->nr_virtqs)) {
+ ret = mlx5_vdpa_rqt_prepare(priv);
+ if (ret)
+ virtq->enable = !enable;
+ }
+ return ret;
+}
+
static int __rte_unused
mlx5_vdpa_rss_flows_create(struct mlx5_vdpa_priv *priv)
{
.transport_domain = priv->td->id,
.indirect_table = priv->steer.rqt->id,
.rx_hash_symmetric = 1,
- .rx_hash_toeplitz_key = { 0x2cc681d1, 0x5bdbf4f7, 0xfca28319,
- 0xdb1a3e94, 0x6b9e38d9, 0x2c9c03d1,
- 0xad9944a7, 0xd9563d59, 0x063c25f3,
- 0xfc1fdc2a },
+ .rx_hash_toeplitz_key = { 0x2c, 0xc6, 0x81, 0xd1,
+ 0x5b, 0xdb, 0xf4, 0xf7,
+ 0xfc, 0xa2, 0x83, 0x19,
+ 0xdb, 0x1a, 0x3e, 0x94,
+ 0x6b, 0x9e, 0x38, 0xd9,
+ 0x2c, 0x9c, 0x03, 0xd1,
+ 0xad, 0x99, 0x44, 0xa7,
+ 0xd9, 0x56, 0x3d, 0x59,
+ 0x06, 0x3c, 0x25, 0xf3,
+ 0xfc, 0x1f, 0xdc, 0x2a },
};
struct {
size_t size;