summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_ethdev.c
diff options
context:
space:
mode:
authorDekel Peled <dekelp@mellanox.com>2019-07-22 14:52:03 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-07-23 14:31:36 +0200
commit175f1c21d0334e96d959fbe88a614a4bcc1b1e99 (patch)
tree5ac5cba1db436939afd6dfc22ac359928a6ee51a /drivers/net/mlx5/mlx5_ethdev.c
parent3075bd23e3b84199283cf6600484466addfe525f (diff)
downloaddpdk-next-eventdev-175f1c21d0334e96d959fbe88a614a4bcc1b1e99.zip
dpdk-next-eventdev-175f1c21d0334e96d959fbe88a614a4bcc1b1e99.tar.gz
dpdk-next-eventdev-175f1c21d0334e96d959fbe88a614a4bcc1b1e99.tar.xz
net/mlx5: check conditions to enable LRO
Use DevX API to read device LRO capabilities. Check if LRO is supported and can be enabled. Check if MPRQ is supported and can be used. Enable MPRQ for LRO use if not enabled by user. Added note for mlx5_mprq_enabled(), to emphasize that LRO enables MPRQ. Disable CQE compression and CRC stripping if LRO is enabled. Signed-off-by: Dekel Peled <dekelp@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_ethdev.c')
-rw-r--r--drivers/net/mlx5/mlx5_ethdev.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index cf50e6e..e627909 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -389,6 +389,7 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
const uint8_t use_app_rss_key =
!!dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key;
int ret = 0;
+ unsigned int lro_on = mlx5_lro_on(dev);
if (use_app_rss_key &&
(dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len !=
@@ -432,6 +433,12 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
dev->data->port_id, priv->rxqs_n, rxqs_n);
priv->rxqs_n = rxqs_n;
/*
+ * WHen using LRO, MPRQ is implicitly enabled.
+ * Adjust threshold value to ensure MPRQ can be enabled.
+ */
+ if (lro_on && priv->config.mprq.min_rxqs_num > priv->rxqs_n)
+ priv->config.mprq.min_rxqs_num = priv->rxqs_n;
+ /*
* If the requested number of RX queues is not a power of two,
* use the maximum indirection table size for better balancing.
* The result is always rounded to the next power of two.
@@ -453,6 +460,11 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
j = 0;
}
}
+ if (lro_on && priv->config.cqe_comp) {
+ /* CQE compressing is not supported for LRO CQEs. */
+ DRV_LOG(WARNING, "Rx CQE compression isn't supported with LRO");
+ priv->config.cqe_comp = 0;
+ }
ret = mlx5_proc_priv_init(dev);
if (ret)
return ret;