From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id C4F1FB62 for ; Tue, 22 Mar 2016 11:34:45 +0100 (CET) Received: by mail-wm0-f41.google.com with SMTP id r129so86042980wmr.1 for ; Tue, 22 Mar 2016 03:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=r71tJSQV28j75Sqx9AUgDKGl2eA4qMFUF8U9D9Idcz0=; b=CSeOPx+9QWDmehRzN6c3uKUDpTbB4P3n+GBrLNS0JeZiWUdw8jm6K5ymCbrslfSOwr 2fKlRaKZ4NbNy+4d1pKejO5qTImjdpYEs7Hq5OpEFDt7EnKmMCvXHO0+hZsNqLaWQek8 8W8y4GPrmg4j2AV7iSYQeCP3ozL3m9ktNfFUWczATc9vV9yc5zD8+q1eBSH+4ZcE/4Iu QEA75xVn7eHkKKJpTcvCrWLJhIA3ntZT1bpEuZvHOEZw1GQbBu1KxuVOIBqxjyQaPWXd 6AQN8dGJIPYCbcM6rQkhen7ckset885fazVhMpbHAM38qWZPDuRHNazLtzhrAIvzd9x4 wdnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=r71tJSQV28j75Sqx9AUgDKGl2eA4qMFUF8U9D9Idcz0=; b=OgAc6V3LKymXCWtJ4kNfosKSj6bc2lEeNNaG++wKsOQniv6aZdurcGUUdxZe/8ZNum z0BExwBkPZycfWjbd245JiCMrKNs1KelytoUZ9V3afq1n58VkSK3V7m5Ae3Ue+wgVLnb lHybG8t90XtLKac+DYu6f9P7L+ekR7uf42H5ACLTg3HaDTd25v3flQon+7Kd1s0Bcwjw xM2Gj+57DNvvjJcqkq3q2XwyPrlsC4OOGey17GLBdmdlMn0zaAcpTvsmTwP3Q4oXxd+8 a8AsMGUouX6bdKgq4S64Q1VETUTGTRWGirGc74es7ucFglthpEeaBeXeQy5xZ3Gsduak mkyw== X-Gm-Message-State: AD7BkJKDJ8EqHgHbr+GKg75YnnkfFCYzvHyu0q8dIXznxtO/7L7uhr9Af6LyOGHGRvIwZC++ X-Received: by 10.194.78.129 with SMTP id b1mr34831600wjx.60.1458642885636; Tue, 22 Mar 2016 03:34:45 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id j18sm16748452wmd.2.2016.03.22.03.34.44 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2016 03:34:44 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Tue, 22 Mar 2016 11:34:26 +0100 Message-Id: <1458642866-28746-1-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] mlx4: check if port is configured for Ethernet X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 10:34:45 -0000 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 --- drivers/net/mlx4/mlx4.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index cc4e9aa..fbbabf6 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -5463,6 +5463,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), -- 2.1.4