Commit 4be6da1e authored by Noa Osherovich's avatar Noa Osherovich Committed by Doug Ledford

IB/mlx5: Support creation of a WQ with scatter FCS offload

Add support for creation of a WQ with scatter FCS capability, if
this capability is supported by the hardware.
Signed-off-by: default avatarNoa Osherovich <noaos@mellanox.com>
Reviewed-by: default avatarMajd Dibbiny <majd@mellanox.com>
Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent e4cc4fa7
...@@ -4604,6 +4604,7 @@ static int create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd, ...@@ -4604,6 +4604,7 @@ static int create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd,
struct ib_wq_init_attr *init_attr) struct ib_wq_init_attr *init_attr)
{ {
struct mlx5_ib_dev *dev; struct mlx5_ib_dev *dev;
int has_net_offloads;
__be64 *rq_pas0; __be64 *rq_pas0;
void *in; void *in;
void *rqc; void *rqc;
...@@ -4635,9 +4636,9 @@ static int create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd, ...@@ -4635,9 +4636,9 @@ static int create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd,
MLX5_SET(wq, wq, log_wq_pg_sz, rwq->log_page_size); MLX5_SET(wq, wq, log_wq_pg_sz, rwq->log_page_size);
MLX5_SET(wq, wq, wq_signature, rwq->wq_sig); MLX5_SET(wq, wq, wq_signature, rwq->wq_sig);
MLX5_SET64(wq, wq, dbr_addr, rwq->db.dma); MLX5_SET64(wq, wq, dbr_addr, rwq->db.dma);
has_net_offloads = MLX5_CAP_GEN(dev->mdev, eth_net_offloads);
if (init_attr->create_flags & IB_WQ_FLAGS_CVLAN_STRIPPING) { if (init_attr->create_flags & IB_WQ_FLAGS_CVLAN_STRIPPING) {
if (!(MLX5_CAP_GEN(dev->mdev, eth_net_offloads) && if (!(has_net_offloads && MLX5_CAP_ETH(dev->mdev, vlan_cap))) {
MLX5_CAP_ETH(dev->mdev, vlan_cap))) {
mlx5_ib_dbg(dev, "VLAN offloads are not supported\n"); mlx5_ib_dbg(dev, "VLAN offloads are not supported\n");
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto out; goto out;
...@@ -4645,6 +4646,14 @@ static int create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd, ...@@ -4645,6 +4646,14 @@ static int create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd,
} else { } else {
MLX5_SET(rqc, rqc, vsd, 1); MLX5_SET(rqc, rqc, vsd, 1);
} }
if (init_attr->create_flags & IB_WQ_FLAGS_SCATTER_FCS) {
if (!(has_net_offloads && MLX5_CAP_ETH(dev->mdev, scatter_fcs))) {
mlx5_ib_dbg(dev, "Scatter FCS is not supported\n");
err = -EOPNOTSUPP;
goto out;
}
MLX5_SET(rqc, rqc, scatter_fcs, 1);
}
rq_pas0 = (__be64 *)MLX5_ADDR_OF(wq, wq, pas); rq_pas0 = (__be64 *)MLX5_ADDR_OF(wq, wq, pas);
mlx5_ib_populate_pas(dev, rwq->umem, rwq->page_shift, rq_pas0, 0); mlx5_ib_populate_pas(dev, rwq->umem, rwq->page_shift, rq_pas0, 0);
err = mlx5_core_create_rq_tracked(dev->mdev, in, inlen, &rwq->core_qp); err = mlx5_core_create_rq_tracked(dev->mdev, in, inlen, &rwq->core_qp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment