From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <wei.dai@intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id CC0A3D586
 for <dev@dpdk.org>; Sat,  4 Feb 2017 09:32:17 +0100 (CET)
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by orsmga103.jf.intel.com with ESMTP; 04 Feb 2017 00:32:15 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.33,333,1477983600"; d="scan'208";a="39629411"
Received: from dpdk4.bj.intel.com ([172.16.182.178])
 by orsmga002.jf.intel.com with ESMTP; 04 Feb 2017 00:32:14 -0800
From: Wei Dai <wei.dai@intel.com>
To: dev@dpdk.org
Cc: helin.zhang@intel.com, konstantin.ananyev@intel.com,
 Wei Dai <wei.dai@intel.com>
Date: Sat,  4 Feb 2017 16:28:20 +0800
Message-Id: <1486196900-33658-1-git-send-email-wei.dai@intel.com>
X-Mailer: git-send-email 2.7.4
Subject: [dpdk-dev] [PATCH] net/ixgbe: output details on failure to
	configure filter
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Sat, 04 Feb 2017 08:32:18 -0000

Add more details when the filter mode can't be successfully configured.
These details tell user what filter configuration is right.

Reported-by: Yulong Pei <yulong.pei@intel.com>
Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/ixgbe_fdir.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 3b9d60c..a23581f 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -628,16 +628,25 @@ ixgbe_fdir_configure(struct rte_eth_dev *dev)
 		hw->mac.type != ixgbe_mac_X540 &&
 		hw->mac.type != ixgbe_mac_X550 &&
 		hw->mac.type != ixgbe_mac_X550EM_x &&
-		hw->mac.type != ixgbe_mac_X550EM_a)
+		hw->mac.type != ixgbe_mac_X550EM_a) {
+		PMD_INIT_LOG(err, "Only when ixgbe MAC type is 82599EB or X540 or X550 "
+			"or X550EM_x or X550EM_a, a filter mode can be supported. "
+			"Current MAC type = %d", (int)(hw->mac.type));
 		return -ENOSYS;
+	}
 
 	/* x550 supports mac-vlan and tunnel mode but other NICs not */
 	if (hw->mac.type != ixgbe_mac_X550 &&
 	    hw->mac.type != ixgbe_mac_X550EM_x &&
 	    hw->mac.type != ixgbe_mac_X550EM_a &&
 	    mode != RTE_FDIR_MODE_SIGNATURE &&
-	    mode != RTE_FDIR_MODE_PERFECT)
+	    mode != RTE_FDIR_MODE_PERFECT) {
+		PMD_INIT_LOG(err, "If ixgbe MAC type is not X550 or X550EM_x or "
+			"X550EM_a, the filter mode must be signature or perfect, other mode "
+			"is not supported ! Current MAC type = %d filter mode = %d",
+			(int)(hw->mac.type), (int)mode);
 		return -ENOSYS;
+	}
 
 	err = configure_fdir_flags(&dev->data->dev_conf.fdir_conf, &fdirctrl);
 	if (err)
-- 
2.7.4