From: Adrien Mazarguil Date: Tue, 22 Mar 2016 10:34:26 +0000 (+0100) Subject: mlx4: check if port is configured for ethernet X-Git-Tag: spdx-start~7177 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7b06615392290705bd662c2ad71d397b519346e1;p=dpdk.git mlx4: check if port is configured for ethernet Notify user otherwise. A similar check has already been added to mlx5 in commit "mlx5: check port is configured as ethernet device". Signed-off-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 65d93ced02..a5991ce653 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -5484,6 +5484,13 @@ mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) ERROR("port query failed: %s", strerror(err)); goto port_error; } + + if (port_attr.link_layer != IBV_LINK_LAYER_ETHERNET) { + ERROR("port %d is not configured in Ethernet mode", + port); + goto port_error; + } + if (port_attr.state != IBV_PORT_ACTIVE) DEBUG("port %d is not active: \"%s\" (%d)", port, ibv_port_state_str(port_attr.state),