Netdev List
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Matan Barak <matanb@mellanox.com>,
	Amir Vadai <amirv@mellanox.com>, Tal Alon <talal@mellanox.com>,
	Jack Morgenstein <jackm@dev.mellanox.co.il>,
	Or Gerlitz <ogerlitz@mellanox.com>
Subject: [PATCH V2 net-next 08/10] net/mlx4_core: Add explicit error message when rule doesn't meet configuration
Date: Thu, 11 Dec 2014 10:57:58 +0200	[thread overview]
Message-ID: <1418288280-334-9-git-send-email-ogerlitz@mellanox.com> (raw)
In-Reply-To: <1418288280-334-1-git-send-email-ogerlitz@mellanox.com>

From: Matan Barak <matanb@mellanox.com>

When a given flow steering rule is invalid in respect to the current
steering configuration, print the correct error message to the system log.

Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/mcg.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index 8728431..a3867e7 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -999,12 +999,27 @@ int mlx4_flow_attach(struct mlx4_dev *dev,
 	}
 
 	ret = mlx4_QP_FLOW_STEERING_ATTACH(dev, mailbox, size >> 2, reg_id);
-	if (ret == -ENOMEM)
+	if (ret == -ENOMEM) {
 		mlx4_err_rule(dev,
 			      "mcg table is full. Fail to register network rule\n",
 			      rule);
-	else if (ret)
-		mlx4_err_rule(dev, "Fail to register network rule\n", rule);
+	} else if (ret) {
+		if (ret == -ENXIO) {
+			if (dev->caps.steering_mode != MLX4_STEERING_MODE_DEVICE_MANAGED)
+				mlx4_err_rule(dev,
+					      "DMFS is not enabled, "
+					      "failed to register network rule.\n",
+					      rule);
+			else
+				mlx4_err_rule(dev,
+					      "Rule exceeds the dmfs_high_rate_mode limitations, "
+					      "failed to register network rule.\n",
+					      rule);
+
+		} else {
+			mlx4_err_rule(dev, "Fail to register network rule.\n", rule);
+		}
+	}
 
 	mlx4_free_cmd_mailbox(dev, mailbox);
 
-- 
1.7.1

  parent reply	other threads:[~2014-12-11  8:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11  8:57 [PATCH V2 net-next 00/10] mlx4 driver update Or Gerlitz
2014-12-11  8:57 ` [PATCH V2 net-next 01/10] net/mlx4_en: Set csum level for encapsulated packets Or Gerlitz
2014-12-11  8:57 ` [PATCH V2 net-next 02/10] net/mlx4_core: Mask out host side virtualization features for guests Or Gerlitz
2014-12-11  8:57 ` [PATCH V2 net-next 03/10] net/mlx4_core: Use tasklet for user-space CQ completion events Or Gerlitz
2014-12-11  8:57 ` [PATCH V2 net-next 04/10] net/mlx4: Change QP allocation scheme Or Gerlitz
2014-12-11  8:57 ` [PATCH V2 net-next 05/10] net/mlx4: Add a check if there are too many reserved QPs Or Gerlitz
2014-12-11  8:57 ` [PATCH V2 net-next 06/10] net/mlx4: Add mlx4_bitmap zone allocator Or Gerlitz
2014-12-11  8:57 ` [PATCH V2 net-next 07/10] net/mlx4: Add A0 hybrid steering Or Gerlitz
2014-12-11  8:57 ` Or Gerlitz [this message]
2014-12-11  8:57 ` [PATCH V2 net-next 09/10] net/mlx4: Refactor QUERY_PORT Or Gerlitz
2014-12-11  8:58 ` [PATCH V2 net-next 10/10] net/mlx4: Add support for A0 steering Or Gerlitz
2014-12-11 19:48 ` [PATCH V2 net-next 00/10] mlx4 driver update David Miller

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=1418288280-334-9-git-send-email-ogerlitz@mellanox.com \
    --to=ogerlitz@mellanox.com \
    --cc=amirv@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=jackm@dev.mellanox.co.il \
    --cc=matanb@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=talal@mellanox.com \
    /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