path: root/drivers/net/mlx4/mlx4.c
diff options
authorMoti Haimovsky <>2018-01-04 18:12:03 +0200
committerFerruh Yigit <>2018-01-16 18:47:49 +0100
commit2ebf5f7e925a184b3936b546a3b81ef2b873f95e (patch)
tree21297b70a3d66fbd493590c0757b73bf7aa31c2e /drivers/net/mlx4/mlx4.c
parent5dba3b9c4c131b88a78bcecfef39db23ebc47873 (diff)
net/mlx4: verify Tx max sges
Max number of Tx scatter-gather entries is a property of the device and is queried at init. This value was not changed in a while and most probably will not be changed in the future, Therefore and in order to enhance Tx performance, the Tx max-sge value is hardcoded in mlx4 PRM code. This patch adds a verification that the above assumption still holds and that the hardcoded value is still supported by the mlx4 hardware. Signed-off-by: Moti Haimovsky <> Acked-by: Adrien Mazarguil <>
Diffstat (limited to 'drivers/net/mlx4/mlx4.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 4bc4a6f..61c5bf4 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -505,6 +505,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
rte_errno = ENODEV;
goto error;
+ assert(device_attr.max_sge >= MLX4_MAX_SGE);
for (i = 0; i < device_attr.phys_port_cnt; i++) {
uint32_t port = i + 1; /* ports are indexed from one */
struct ibv_context *ctx = NULL;