DPDK patches and discussions
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 2/7] mlx5: check if port is configured as Ethernet device
Date: Thu,  3 Mar 2016 15:27:35 +0100	[thread overview]
Message-ID: <1457015260-3041-3-git-send-email-adrien.mazarguil@6wind.com> (raw)
In-Reply-To: <1457015260-3041-1-git-send-email-adrien.mazarguil@6wind.com>

From: Or Ami <ora@mellanox.com>

If the port link layer is not Ethernet, notify the user.

Signed-off-by: Or Ami <ora@mellanox.com>
---
 doc/guides/rel_notes/release_16_04.rst | 5 +++++
 drivers/net/mlx5/mlx5.c                | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst
index 953eaa1..73d0cfc 100644
--- a/doc/guides/rel_notes/release_16_04.rst
+++ b/doc/guides/rel_notes/release_16_04.rst
@@ -154,6 +154,11 @@ Drivers
 
   A crash could occur when failing to allocate private device context.
 
+* **mlx5: Added port type check.**
+
+  Done to prevent port initialization on non-Ethernet link layers and
+  to report an error.
+
 
 Libraries
 ~~~~~~~~~
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 41dcbbf..ae2576f 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -348,6 +348,13 @@ mlx5_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

  parent reply	other threads:[~2016-03-03 14:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22 18:18 [dpdk-dev] [PATCH 0/7] Assorted fixes for mlx4 and mlx5 Adrien Mazarguil
2016-02-22 18:18 ` [dpdk-dev] [PATCH 1/7] mlx5: fix possible crash during initialization Adrien Mazarguil
2016-02-22 18:18 ` [dpdk-dev] [PATCH 2/7] mlx5: check if port is configured as Ethernet device Adrien Mazarguil
2016-02-22 18:18 ` [dpdk-dev] [PATCH 3/7] mlx5: manage all special flow types at once Adrien Mazarguil
2016-02-22 18:18 ` [dpdk-dev] [PATCH 4/7] mlx5: remove redundant debugging message Adrien Mazarguil
2016-02-22 18:18 ` [dpdk-dev] [PATCH 5/7] mlx5: apply VLAN filtering to broadcast and IPv6 multicast flows Adrien Mazarguil
2016-02-22 18:18 ` [dpdk-dev] [PATCH 6/7] mlx5: fix RX checksum offload in non L3/L4 packets Adrien Mazarguil
2016-02-22 18:18 ` [dpdk-dev] [PATCH 7/7] mlx4: make sure that number of RX queues is a power of 2 Adrien Mazarguil
2016-03-03 14:27 ` [dpdk-dev] [PATCH v2 0/7] Assorted fixes for mlx4 and mlx5 Adrien Mazarguil
2016-03-03 14:27   ` [dpdk-dev] [PATCH v2 1/7] mlx5: fix possible crash during initialization Adrien Mazarguil
2016-03-03 14:27   ` Adrien Mazarguil [this message]
2016-03-03 14:27   ` [dpdk-dev] [PATCH v2 3/7] mlx5: manage all special flow types at once Adrien Mazarguil
2016-03-03 14:27   ` [dpdk-dev] [PATCH v2 4/7] mlx5: remove redundant debugging message Adrien Mazarguil
2016-03-03 14:27   ` [dpdk-dev] [PATCH v2 5/7] mlx5: apply VLAN filtering to broadcast and IPv6 multicast flows Adrien Mazarguil
2016-03-03 14:27   ` [dpdk-dev] [PATCH v2 6/7] mlx5: fix RX checksum offload in non L3/L4 packets Adrien Mazarguil
2016-03-03 14:27   ` [dpdk-dev] [PATCH v2 7/7] mlx4: make sure that number of RX queues is a power of 2 Adrien Mazarguil
2016-03-10 22:15   ` [dpdk-dev] [PATCH v2 0/7] Assorted fixes for mlx4 and mlx5 Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457015260-3041-3-git-send-email-adrien.mazarguil@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).