All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mlx4_core: Enhance device capabilities flags debug printouts
@ 2015-01-26 14:30 Yuval Shaia
       [not found] ` <1422282623-3744-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Yuval Shaia @ 2015-01-26 14:30 UTC (permalink / raw)
  To: yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA,
	matanb-VPRAkNaXOzVWk0Htik3J/w, gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

1. Add descriptions of all features.
2. Add indication whether feature is supported or not.
With this enhancement all device features will be printed along with flags that shows if feature is supported by FW, Driver or both.

Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
 drivers/net/ethernet/mellanox/mlx4/fw.c | 54 +++++++++++++++++++++++++++------
 include/linux/mlx4/device.h             | 52 +++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index 982861d..34a7ab3 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -77,6 +77,19 @@ MODULE_PARM_DESC(enable_qos, "Enable Quality of Service support in the HCA (defa
 		}						      \
 	} while (0)
 
+void dump_cap_flags(struct mlx4_dev *dev, u64 fw_flags, u64 drv_flags,
+		    const char** fname, int fname_sz)
+{
+	int i;
+	for (i = 0; i < fname_sz; ++i) {
+		if (fname[i])
+			mlx4_dbg(dev, "\t(%c%c) %s\n",
+				 (fw_flags & (1LL << i)) ? '+' : '-',
+				 (drv_flags & (1LL << i)) ? '+' : '-',
+				 fname[i]);
+	}
+}
+
 static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 {
 	static const char *fname[] = {
@@ -91,7 +104,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 		[ 8] = "P_Key violation counter",
 		[ 9] = "Q_Key violation counter",
 		[10] = "VMM",
+		[11] = "Fibre Channel Protocol On Ethernet Ports support",
 		[12] = "Dual Port Different Protocol (DPDP) support",
+		[13] = "Raw Ethertype support",
+		[14] = "Raw IPv6 support",
 		[15] = "Big LSO headers",
 		[16] = "MW support",
 		[17] = "APM support",
@@ -99,33 +115,53 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 		[19] = "Raw multicast support",
 		[20] = "Address vector port checking support",
 		[21] = "UD multicast support",
+		[22] = "UD IPv4 Multicast support",
 		[24] = "Demand paging support",
 		[25] = "Router support",
+		[26] = "L2 Ethernet Multicast support",
+		[28] = "Software parsing support for UD transport",
+		[29] = "TCP checksum off-load support (ipv6)",
 		[30] = "IBoE support",
+		[31] = "FCoE T11 frame format support",
 		[32] = "Unicast loopback support",
+		[32] = "Multicast loopback support",
 		[34] = "FCS header control",
-		[38] = "Wake On LAN support",
+		[35] = "Address Path ud_force_mgid support",
+		[36] = "Header-Data Split support",
+		[37] = "Wake On LAN support on port 1",
+		[38] = "Wake On LAN support on port 2",
+		[39] = "Fatal Warning Event upon a thermal warning condition",
 		[40] = "UDP RSS support",
 		[41] = "Unicast VEP steering support",
 		[42] = "Multicast VEP steering support",
+		[43] = "VLAN Steering mechanism support",
+		[44] = "Steering according to EtherType support",
+		[45] = "WQE format version 1 support",
+		[46] = "Keep Alive Validiation support",
+		[47] = "PTP1588 support",
 		[48] = "Counters support",
+		[49] = "Advanced Counters support",
+		[50] = "Force Ethernet user priority from QPC support",
+		[51] = "RX Port Num check disabled",
+		[52] = "RSS on fragmented IP datagram support",
 		[53] = "Port ETS Scheduler support",
 		[55] = "Port link type sensing support",
+		[56] = "Reliable Multicast support",
+		[57] = "Fast Drop support",
+		[58] = "Protected FMR support",
 		[59] = "Port management change event support",
 		[61] = "64 byte EQE support",
 		[62] = "64 byte CQE support",
 	};
-	int i;
 
 	mlx4_dbg(dev, "DEV_CAP flags:\n");
-	for (i = 0; i < ARRAY_SIZE(fname); ++i)
-		if (fname[i] && (flags & (1LL << i)))
-			mlx4_dbg(dev, "    %s\n", fname[i]);
+	dump_cap_flags(dev, flags, MLX4_DEV_CAP_FLAG_ALL, fname,
+		       ARRAY_SIZE(fname));
 }
 
 static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
 {
-	static const char * const fname[] = {
+	static const char *fname[] = {
 		[0] = "RSS support",
 		[1] = "RSS Toeplitz Hash Function support",
 		[2] = "RSS XOR Hash Function support",
@@ -147,11 +183,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
 		[18] = "More than 80 VFs support",
 		[19] = "Performance optimized for limited rule configuration flow steering support"
 	};
-	int i;
 
-	for (i = 0; i < ARRAY_SIZE(fname); ++i)
-		if (fname[i] && (flags & (1LL << i)))
-			mlx4_dbg(dev, "    %s\n", fname[i]);
+	dump_cap_flags(dev, flags, MLX4_DEV_CAP_FLAG2_ALL, fname,
+		       ARRAY_SIZE(fname));
 }
 
 int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 25c791e..e84badc 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -180,6 +180,37 @@ enum {
 	MLX4_DEV_CAP_FLAG_64B_CQE	= 1LL << 62
 };
 
+#define MLX4_DEV_CAP_FLAG_ALL	MLX4_DEV_CAP_FLAG_RC | \
+				MLX4_DEV_CAP_FLAG_UC | \
+				MLX4_DEV_CAP_FLAG_UD | \
+				MLX4_DEV_CAP_FLAG_XRC | \
+				MLX4_DEV_CAP_FLAG_SRQ | \
+				MLX4_DEV_CAP_FLAG_IPOIB_CSUM | \
+				MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR	 | \
+				MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR	 | \
+				MLX4_DEV_CAP_FLAG_DPDP | \
+				MLX4_DEV_CAP_FLAG_BLH | \
+				MLX4_DEV_CAP_FLAG_MEM_WINDOW | \
+				MLX4_DEV_CAP_FLAG_APM | \
+				MLX4_DEV_CAP_FLAG_ATOMIC | \
+				MLX4_DEV_CAP_FLAG_RAW_MCAST | \
+				MLX4_DEV_CAP_FLAG_UD_AV_PORT | \
+				MLX4_DEV_CAP_FLAG_UD_MCAST | \
+				MLX4_DEV_CAP_FLAG_IBOE | \
+				MLX4_DEV_CAP_FLAG_UC_LOOPBACK | \
+				MLX4_DEV_CAP_FLAG_FCS_KEEP | \
+				MLX4_DEV_CAP_FLAG_WOL_PORT1 | \
+				MLX4_DEV_CAP_FLAG_WOL_PORT2 | \
+				MLX4_DEV_CAP_FLAG_UDP_RSS | \
+				MLX4_DEV_CAP_FLAG_VEP_UC_STEER | \
+				MLX4_DEV_CAP_FLAG_VEP_MC_STEER | \
+				MLX4_DEV_CAP_FLAG_COUNTERS | \
+				MLX4_DEV_CAP_FLAG_SET_ETH_SCHED  | \
+				MLX4_DEV_CAP_FLAG_SENSE_SUPPORT	 | \
+				MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV  | \
+				MLX4_DEV_CAP_FLAG_64B_EQE | \
+				MLX4_DEV_CAP_FLAG_64B_CQE
+
 enum {
 	MLX4_DEV_CAP_FLAG2_RSS			= 1LL <<  0,
 	MLX4_DEV_CAP_FLAG2_RSS_TOP		= 1LL <<  1,
@@ -203,6 +234,27 @@ enum {
 	MLX4_DEV_CAP_FLAG2_FS_A0		= 1LL <<  19
 };
 
+#define MLX4_DEV_CAP_FLAG2_ALL	MLX4_DEV_CAP_FLAG2_RSS | \
+				MLX4_DEV_CAP_FLAG2_RSS_TOP | \
+				MLX4_DEV_CAP_FLAG2_RSS_XOR | \
+				MLX4_DEV_CAP_FLAG2_FS_EN | \
+				MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN | \
+				MLX4_DEV_CAP_FLAG2_TS | \
+				MLX4_DEV_CAP_FLAG2_VLAN_CONTROL | \
+				MLX4_DEV_CAP_FLAG2_FSM | \
+				MLX4_DEV_CAP_FLAG2_UPDATE_QP | \
+				MLX4_DEV_CAP_FLAG2_DMFS_IPOIB | \
+				MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS | \
+				MLX4_DEV_CAP_FLAG2_MAD_DEMUX | \
+				MLX4_DEV_CAP_FLAG2_CQE_STRIDE | \
+				MLX4_DEV_CAP_FLAG2_EQE_STRIDE | \
+				MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL | \
+				MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP | \
+				MLX4_DEV_CAP_FLAG2_CONFIG_DEV | \
+				MLX4_DEV_CAP_FLAG2_SYS_EQS | \
+				MLX4_DEV_CAP_FLAG2_80_VFS | \
+				MLX4_DEV_CAP_FLAG2_FS_A0
+
 enum {
 	MLX4_QUERY_FUNC_FLAGS_BF_RES_QP		= 1LL << 0,
 	MLX4_QUERY_FUNC_FLAGS_A0_RES_QP		= 1LL << 1
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH] mlx4_core: Enhance device capabilities flags debug printouts
       [not found] ` <1422282623-3744-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2015-02-16 17:32   ` Yuval Shaia
  2015-02-17 12:47     ` Matan Barak
  0 siblings, 1 reply; 17+ messages in thread
From: Yuval Shaia @ 2015-02-16 17:32 UTC (permalink / raw)
  To: matanb-VPRAkNaXOzVWk0Htik3J/w, gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

ping

On Mon, Jan 26, 2015 at 06:30:23AM -0800, Yuval Shaia wrote:
> 1. Add descriptions of all features.
> 2. Add indication whether feature is supported or not.
> With this enhancement all device features will be printed along with flags that shows if feature is supported by FW, Driver or both.
> 
> Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/net/ethernet/mellanox/mlx4/fw.c | 54 +++++++++++++++++++++++++++------
>  include/linux/mlx4/device.h             | 52 +++++++++++++++++++++++++++++++
>  2 files changed, 96 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
> index 982861d..34a7ab3 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/fw.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
> @@ -77,6 +77,19 @@ MODULE_PARM_DESC(enable_qos, "Enable Quality of Service support in the HCA (defa
>  		}						      \
>  	} while (0)
>  
> +void dump_cap_flags(struct mlx4_dev *dev, u64 fw_flags, u64 drv_flags,
> +		    const char** fname, int fname_sz)
> +{
> +	int i;
> +	for (i = 0; i < fname_sz; ++i) {
> +		if (fname[i])
> +			mlx4_dbg(dev, "\t(%c%c) %s\n",
> +				 (fw_flags & (1LL << i)) ? '+' : '-',
> +				 (drv_flags & (1LL << i)) ? '+' : '-',
> +				 fname[i]);
> +	}
> +}
> +
>  static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>  {
>  	static const char *fname[] = {
> @@ -91,7 +104,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>  		[ 8] = "P_Key violation counter",
>  		[ 9] = "Q_Key violation counter",
>  		[10] = "VMM",
> +		[11] = "Fibre Channel Protocol On Ethernet Ports support",
>  		[12] = "Dual Port Different Protocol (DPDP) support",
> +		[13] = "Raw Ethertype support",
> +		[14] = "Raw IPv6 support",
>  		[15] = "Big LSO headers",
>  		[16] = "MW support",
>  		[17] = "APM support",
> @@ -99,33 +115,53 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>  		[19] = "Raw multicast support",
>  		[20] = "Address vector port checking support",
>  		[21] = "UD multicast support",
> +		[22] = "UD IPv4 Multicast support",
>  		[24] = "Demand paging support",
>  		[25] = "Router support",
> +		[26] = "L2 Ethernet Multicast support",
> +		[28] = "Software parsing support for UD transport",
> +		[29] = "TCP checksum off-load support (ipv6)",
>  		[30] = "IBoE support",
> +		[31] = "FCoE T11 frame format support",
>  		[32] = "Unicast loopback support",
> +		[32] = "Multicast loopback support",
>  		[34] = "FCS header control",
> -		[38] = "Wake On LAN support",
> +		[35] = "Address Path ud_force_mgid support",
> +		[36] = "Header-Data Split support",
> +		[37] = "Wake On LAN support on port 1",
> +		[38] = "Wake On LAN support on port 2",
> +		[39] = "Fatal Warning Event upon a thermal warning condition",
>  		[40] = "UDP RSS support",
>  		[41] = "Unicast VEP steering support",
>  		[42] = "Multicast VEP steering support",
> +		[43] = "VLAN Steering mechanism support",
> +		[44] = "Steering according to EtherType support",
> +		[45] = "WQE format version 1 support",
> +		[46] = "Keep Alive Validiation support",
> +		[47] = "PTP1588 support",
>  		[48] = "Counters support",
> +		[49] = "Advanced Counters support",
> +		[50] = "Force Ethernet user priority from QPC support",
> +		[51] = "RX Port Num check disabled",
> +		[52] = "RSS on fragmented IP datagram support",
>  		[53] = "Port ETS Scheduler support",
>  		[55] = "Port link type sensing support",
> +		[56] = "Reliable Multicast support",
> +		[57] = "Fast Drop support",
> +		[58] = "Protected FMR support",
>  		[59] = "Port management change event support",
>  		[61] = "64 byte EQE support",
>  		[62] = "64 byte CQE support",
>  	};
> -	int i;
>  
>  	mlx4_dbg(dev, "DEV_CAP flags:\n");
> -	for (i = 0; i < ARRAY_SIZE(fname); ++i)
> -		if (fname[i] && (flags & (1LL << i)))
> -			mlx4_dbg(dev, "    %s\n", fname[i]);
> +	dump_cap_flags(dev, flags, MLX4_DEV_CAP_FLAG_ALL, fname,
> +		       ARRAY_SIZE(fname));
>  }
>  
>  static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
>  {
> -	static const char * const fname[] = {
> +	static const char *fname[] = {
>  		[0] = "RSS support",
>  		[1] = "RSS Toeplitz Hash Function support",
>  		[2] = "RSS XOR Hash Function support",
> @@ -147,11 +183,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
>  		[18] = "More than 80 VFs support",
>  		[19] = "Performance optimized for limited rule configuration flow steering support"
>  	};
> -	int i;
>  
> -	for (i = 0; i < ARRAY_SIZE(fname); ++i)
> -		if (fname[i] && (flags & (1LL << i)))
> -			mlx4_dbg(dev, "    %s\n", fname[i]);
> +	dump_cap_flags(dev, flags, MLX4_DEV_CAP_FLAG2_ALL, fname,
> +		       ARRAY_SIZE(fname));
>  }
>  
>  int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
> diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
> index 25c791e..e84badc 100644
> --- a/include/linux/mlx4/device.h
> +++ b/include/linux/mlx4/device.h
> @@ -180,6 +180,37 @@ enum {
>  	MLX4_DEV_CAP_FLAG_64B_CQE	= 1LL << 62
>  };
>  
> +#define MLX4_DEV_CAP_FLAG_ALL	MLX4_DEV_CAP_FLAG_RC | \
> +				MLX4_DEV_CAP_FLAG_UC | \
> +				MLX4_DEV_CAP_FLAG_UD | \
> +				MLX4_DEV_CAP_FLAG_XRC | \
> +				MLX4_DEV_CAP_FLAG_SRQ | \
> +				MLX4_DEV_CAP_FLAG_IPOIB_CSUM | \
> +				MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR	 | \
> +				MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR	 | \
> +				MLX4_DEV_CAP_FLAG_DPDP | \
> +				MLX4_DEV_CAP_FLAG_BLH | \
> +				MLX4_DEV_CAP_FLAG_MEM_WINDOW | \
> +				MLX4_DEV_CAP_FLAG_APM | \
> +				MLX4_DEV_CAP_FLAG_ATOMIC | \
> +				MLX4_DEV_CAP_FLAG_RAW_MCAST | \
> +				MLX4_DEV_CAP_FLAG_UD_AV_PORT | \
> +				MLX4_DEV_CAP_FLAG_UD_MCAST | \
> +				MLX4_DEV_CAP_FLAG_IBOE | \
> +				MLX4_DEV_CAP_FLAG_UC_LOOPBACK | \
> +				MLX4_DEV_CAP_FLAG_FCS_KEEP | \
> +				MLX4_DEV_CAP_FLAG_WOL_PORT1 | \
> +				MLX4_DEV_CAP_FLAG_WOL_PORT2 | \
> +				MLX4_DEV_CAP_FLAG_UDP_RSS | \
> +				MLX4_DEV_CAP_FLAG_VEP_UC_STEER | \
> +				MLX4_DEV_CAP_FLAG_VEP_MC_STEER | \
> +				MLX4_DEV_CAP_FLAG_COUNTERS | \
> +				MLX4_DEV_CAP_FLAG_SET_ETH_SCHED  | \
> +				MLX4_DEV_CAP_FLAG_SENSE_SUPPORT	 | \
> +				MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV  | \
> +				MLX4_DEV_CAP_FLAG_64B_EQE | \
> +				MLX4_DEV_CAP_FLAG_64B_CQE
> +
>  enum {
>  	MLX4_DEV_CAP_FLAG2_RSS			= 1LL <<  0,
>  	MLX4_DEV_CAP_FLAG2_RSS_TOP		= 1LL <<  1,
> @@ -203,6 +234,27 @@ enum {
>  	MLX4_DEV_CAP_FLAG2_FS_A0		= 1LL <<  19
>  };
>  
> +#define MLX4_DEV_CAP_FLAG2_ALL	MLX4_DEV_CAP_FLAG2_RSS | \
> +				MLX4_DEV_CAP_FLAG2_RSS_TOP | \
> +				MLX4_DEV_CAP_FLAG2_RSS_XOR | \
> +				MLX4_DEV_CAP_FLAG2_FS_EN | \
> +				MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN | \
> +				MLX4_DEV_CAP_FLAG2_TS | \
> +				MLX4_DEV_CAP_FLAG2_VLAN_CONTROL | \
> +				MLX4_DEV_CAP_FLAG2_FSM | \
> +				MLX4_DEV_CAP_FLAG2_UPDATE_QP | \
> +				MLX4_DEV_CAP_FLAG2_DMFS_IPOIB | \
> +				MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS | \
> +				MLX4_DEV_CAP_FLAG2_MAD_DEMUX | \
> +				MLX4_DEV_CAP_FLAG2_CQE_STRIDE | \
> +				MLX4_DEV_CAP_FLAG2_EQE_STRIDE | \
> +				MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL | \
> +				MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP | \
> +				MLX4_DEV_CAP_FLAG2_CONFIG_DEV | \
> +				MLX4_DEV_CAP_FLAG2_SYS_EQS | \
> +				MLX4_DEV_CAP_FLAG2_80_VFS | \
> +				MLX4_DEV_CAP_FLAG2_FS_A0
> +
>  enum {
>  	MLX4_QUERY_FUNC_FLAGS_BF_RES_QP		= 1LL << 0,
>  	MLX4_QUERY_FUNC_FLAGS_A0_RES_QP		= 1LL << 1
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] mlx4_core: Enhance device capabilities flags debug printouts
  2015-02-16 17:32   ` Yuval Shaia
@ 2015-02-17 12:47     ` Matan Barak
       [not found]       ` <54E33847.5090001-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Matan Barak @ 2015-02-17 12:47 UTC (permalink / raw)
  To: Yuval Shaia, gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA



On 2/16/2015 7:32 PM, Yuval Shaia wrote:
> ping
>
> On Mon, Jan 26, 2015 at 06:30:23AM -0800, Yuval Shaia wrote:
>> 1. Add descriptions of all features.
>> 2. Add indication whether feature is supported or not.
>> With this enhancement all device features will be printed along with flags that shows if feature is supported by FW, Driver or both.
>>
>> Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
>> ---
>>   drivers/net/ethernet/mellanox/mlx4/fw.c | 54 +++++++++++++++++++++++++++------
>>   include/linux/mlx4/device.h             | 52 +++++++++++++++++++++++++++++++
>>   2 files changed, 96 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
>> index 982861d..34a7ab3 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/fw.c
>> +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
>> @@ -77,6 +77,19 @@ MODULE_PARM_DESC(enable_qos, "Enable Quality of Service support in the HCA (defa
>>   		}						      \
>>   	} while (0)
>>
>> +void dump_cap_flags(struct mlx4_dev *dev, u64 fw_flags, u64 drv_flags,
>> +		    const char** fname, int fname_sz)
>> +{
>> +	int i;
>> +	for (i = 0; i < fname_sz; ++i) {
>> +		if (fname[i])
>> +			mlx4_dbg(dev, "\t(%c%c) %s\n",
>> +				 (fw_flags & (1LL << i)) ? '+' : '-',
>> +				 (drv_flags & (1LL << i)) ? '+' : '-',
>> +				 fname[i]);
>> +	}
>> +}
>> +

I think using + and - for both the driver and FW is a bit confusing.
Maybe F/X, D/X for supported/unsupported?

>>   static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>>   {
>>   	static const char *fname[] = {
>> @@ -91,7 +104,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>>   		[ 8] = "P_Key violation counter",
>>   		[ 9] = "Q_Key violation counter",
>>   		[10] = "VMM",
>> +		[11] = "Fibre Channel Protocol On Ethernet Ports support",
>>   		[12] = "Dual Port Different Protocol (DPDP) support",
>> +		[13] = "Raw Ethertype support",
>> +		[14] = "Raw IPv6 support",
>>   		[15] = "Big LSO headers",
>>   		[16] = "MW support",
>>   		[17] = "APM support",
>> @@ -99,33 +115,53 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>>   		[19] = "Raw multicast support",
>>   		[20] = "Address vector port checking support",
>>   		[21] = "UD multicast support",
>> +		[22] = "UD IPv4 Multicast support",
>>   		[24] = "Demand paging support",
>>   		[25] = "Router support",
>> +		[26] = "L2 Ethernet Multicast support",
>> +		[28] = "Software parsing support for UD transport",
>> +		[29] = "TCP checksum off-load support (ipv6)",
>>   		[30] = "IBoE support",
>> +		[31] = "FCoE T11 frame format support",
>>   		[32] = "Unicast loopback support",
>> +		[32] = "Multicast loopback support",
>>   		[34] = "FCS header control",
>> -		[38] = "Wake On LAN support",
>> +		[35] = "Address Path ud_force_mgid support",
>> +		[36] = "Header-Data Split support",
>> +		[37] = "Wake On LAN support on port 1",
>> +		[38] = "Wake On LAN support on port 2",
>> +		[39] = "Fatal Warning Event upon a thermal warning condition",
>>   		[40] = "UDP RSS support",
>>   		[41] = "Unicast VEP steering support",
>>   		[42] = "Multicast VEP steering support",
>> +		[43] = "VLAN Steering mechanism support",
>> +		[44] = "Steering according to EtherType support",
>> +		[45] = "WQE format version 1 support",
>> +		[46] = "Keep Alive Validiation support",
>> +		[47] = "PTP1588 support",
>>   		[48] = "Counters support",
>> +		[49] = "Advanced Counters support",
>> +		[50] = "Force Ethernet user priority from QPC support",
>> +		[51] = "RX Port Num check disabled",
>> +		[52] = "RSS on fragmented IP datagram support",
>>   		[53] = "Port ETS Scheduler support",
>>   		[55] = "Port link type sensing support",
>> +		[56] = "Reliable Multicast support",
>> +		[57] = "Fast Drop support",
>> +		[58] = "Protected FMR support",
>>   		[59] = "Port management change event support",
>>   		[61] = "64 byte EQE support",
>>   		[62] = "64 byte CQE support",
>>   	};
>> -	int i;
>>
>>   	mlx4_dbg(dev, "DEV_CAP flags:\n");
>> -	for (i = 0; i < ARRAY_SIZE(fname); ++i)
>> -		if (fname[i] && (flags & (1LL << i)))
>> -			mlx4_dbg(dev, "    %s\n", fname[i]);
>> +	dump_cap_flags(dev, flags, MLX4_DEV_CAP_FLAG_ALL, fname,
>> +		       ARRAY_SIZE(fname));
>>   }
>>
>>   static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
>>   {
>> -	static const char * const fname[] = {
>> +	static const char *fname[] = {
>>   		[0] = "RSS support",
>>   		[1] = "RSS Toeplitz Hash Function support",
>>   		[2] = "RSS XOR Hash Function support",
>> @@ -147,11 +183,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
>>   		[18] = "More than 80 VFs support",
>>   		[19] = "Performance optimized for limited rule configuration flow steering support"
>>   	};
>> -	int i;
>>
>> -	for (i = 0; i < ARRAY_SIZE(fname); ++i)
>> -		if (fname[i] && (flags & (1LL << i)))
>> -			mlx4_dbg(dev, "    %s\n", fname[i]);
>> +	dump_cap_flags(dev, flags, MLX4_DEV_CAP_FLAG2_ALL, fname,
>> +		       ARRAY_SIZE(fname));
>>   }
>>
>>   int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
>> diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
>> index 25c791e..e84badc 100644
>> --- a/include/linux/mlx4/device.h
>> +++ b/include/linux/mlx4/device.h
>> @@ -180,6 +180,37 @@ enum {
>>   	MLX4_DEV_CAP_FLAG_64B_CQE	= 1LL << 62
>>   };
>>
>> +#define MLX4_DEV_CAP_FLAG_ALL	MLX4_DEV_CAP_FLAG_RC | \
>> +				MLX4_DEV_CAP_FLAG_UC | \
>> +				MLX4_DEV_CAP_FLAG_UD | \
>> +				MLX4_DEV_CAP_FLAG_XRC | \
>> +				MLX4_DEV_CAP_FLAG_SRQ | \
>> +				MLX4_DEV_CAP_FLAG_IPOIB_CSUM | \
>> +				MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR	 | \
>> +				MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR	 | \
>> +				MLX4_DEV_CAP_FLAG_DPDP | \
>> +				MLX4_DEV_CAP_FLAG_BLH | \
>> +				MLX4_DEV_CAP_FLAG_MEM_WINDOW | \
>> +				MLX4_DEV_CAP_FLAG_APM | \
>> +				MLX4_DEV_CAP_FLAG_ATOMIC | \
>> +				MLX4_DEV_CAP_FLAG_RAW_MCAST | \
>> +				MLX4_DEV_CAP_FLAG_UD_AV_PORT | \
>> +				MLX4_DEV_CAP_FLAG_UD_MCAST | \
>> +				MLX4_DEV_CAP_FLAG_IBOE | \
>> +				MLX4_DEV_CAP_FLAG_UC_LOOPBACK | \
>> +				MLX4_DEV_CAP_FLAG_FCS_KEEP | \
>> +				MLX4_DEV_CAP_FLAG_WOL_PORT1 | \
>> +				MLX4_DEV_CAP_FLAG_WOL_PORT2 | \
>> +				MLX4_DEV_CAP_FLAG_UDP_RSS | \
>> +				MLX4_DEV_CAP_FLAG_VEP_UC_STEER | \
>> +				MLX4_DEV_CAP_FLAG_VEP_MC_STEER | \
>> +				MLX4_DEV_CAP_FLAG_COUNTERS | \
>> +				MLX4_DEV_CAP_FLAG_SET_ETH_SCHED  | \
>> +				MLX4_DEV_CAP_FLAG_SENSE_SUPPORT	 | \
>> +				MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV  | \
>> +				MLX4_DEV_CAP_FLAG_64B_EQE | \
>> +				MLX4_DEV_CAP_FLAG_64B_CQE
>> +

I don't really like the idea that adding a flag is done both here and 
both in the enum. However, I don't see other option right now.

>>   enum {
>>   	MLX4_DEV_CAP_FLAG2_RSS			= 1LL <<  0,
>>   	MLX4_DEV_CAP_FLAG2_RSS_TOP		= 1LL <<  1,
>> @@ -203,6 +234,27 @@ enum {
>>   	MLX4_DEV_CAP_FLAG2_FS_A0		= 1LL <<  19
>>   };
>>
>> +#define MLX4_DEV_CAP_FLAG2_ALL	MLX4_DEV_CAP_FLAG2_RSS | \
>> +				MLX4_DEV_CAP_FLAG2_RSS_TOP | \
>> +				MLX4_DEV_CAP_FLAG2_RSS_XOR | \
>> +				MLX4_DEV_CAP_FLAG2_FS_EN | \
>> +				MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN | \
>> +				MLX4_DEV_CAP_FLAG2_TS | \
>> +				MLX4_DEV_CAP_FLAG2_VLAN_CONTROL | \
>> +				MLX4_DEV_CAP_FLAG2_FSM | \
>> +				MLX4_DEV_CAP_FLAG2_UPDATE_QP | \
>> +				MLX4_DEV_CAP_FLAG2_DMFS_IPOIB | \
>> +				MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS | \
>> +				MLX4_DEV_CAP_FLAG2_MAD_DEMUX | \
>> +				MLX4_DEV_CAP_FLAG2_CQE_STRIDE | \
>> +				MLX4_DEV_CAP_FLAG2_EQE_STRIDE | \
>> +				MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL | \
>> +				MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP | \
>> +				MLX4_DEV_CAP_FLAG2_CONFIG_DEV | \
>> +				MLX4_DEV_CAP_FLAG2_SYS_EQS | \
>> +				MLX4_DEV_CAP_FLAG2_80_VFS | \
>> +				MLX4_DEV_CAP_FLAG2_FS_A0
>> +
>>   enum {
>>   	MLX4_QUERY_FUNC_FLAGS_BF_RES_QP		= 1LL << 0,
>>   	MLX4_QUERY_FUNC_FLAGS_A0_RES_QP		= 1LL << 1
>> --
>> 1.9.1
>>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] mlx4_core: Enhance device capabilities flags debug printouts
       [not found]       ` <54E33847.5090001-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2015-02-18  7:12         ` Yuval Shaia
  0 siblings, 0 replies; 17+ messages in thread
From: Yuval Shaia @ 2015-02-18  7:12 UTC (permalink / raw)
  To: Matan Barak
  Cc: gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Tue, Feb 17, 2015 at 02:47:03PM +0200, Matan Barak wrote:
> 
> 
> On 2/16/2015 7:32 PM, Yuval Shaia wrote:
> >ping
> >
> >On Mon, Jan 26, 2015 at 06:30:23AM -0800, Yuval Shaia wrote:
> >>1. Add descriptions of all features.
> >>2. Add indication whether feature is supported or not.
> >>With this enhancement all device features will be printed along with flags that shows if feature is supported by FW, Driver or both.
> >>
> >>Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> >>---
> >>  drivers/net/ethernet/mellanox/mlx4/fw.c | 54 +++++++++++++++++++++++++++------
> >>  include/linux/mlx4/device.h             | 52 +++++++++++++++++++++++++++++++
> >>  2 files changed, 96 insertions(+), 10 deletions(-)
> >>
> >>diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
> >>index 982861d..34a7ab3 100644
> >>--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
> >>+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
> >>@@ -77,6 +77,19 @@ MODULE_PARM_DESC(enable_qos, "Enable Quality of Service support in the HCA (defa
> >>  		}						      \
> >>  	} while (0)
> >>
> >>+void dump_cap_flags(struct mlx4_dev *dev, u64 fw_flags, u64 drv_flags,
> >>+		    const char** fname, int fname_sz)
> >>+{
> >>+	int i;
> >>+	for (i = 0; i < fname_sz; ++i) {
> >>+		if (fname[i])
> >>+			mlx4_dbg(dev, "\t(%c%c) %s\n",
> >>+				 (fw_flags & (1LL << i)) ? '+' : '-',
> >>+				 (drv_flags & (1LL << i)) ? '+' : '-',
> >>+				 fname[i]);
> >>+	}
> >>+}
> >>+
> 
> I think using + and - for both the driver and FW is a bit confusing.
> Maybe F/X, D/X for supported/unsupported?
Agree.
It will be much more readable for one that unfamiliar with the code.
> 
> >>  static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
> >>  {
> >>  	static const char *fname[] = {
> >>@@ -91,7 +104,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
> >>  		[ 8] = "P_Key violation counter",
> >>  		[ 9] = "Q_Key violation counter",
> >>  		[10] = "VMM",
> >>+		[11] = "Fibre Channel Protocol On Ethernet Ports support",
> >>  		[12] = "Dual Port Different Protocol (DPDP) support",
> >>+		[13] = "Raw Ethertype support",
> >>+		[14] = "Raw IPv6 support",
> >>  		[15] = "Big LSO headers",
> >>  		[16] = "MW support",
> >>  		[17] = "APM support",
> >>@@ -99,33 +115,53 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
> >>  		[19] = "Raw multicast support",
> >>  		[20] = "Address vector port checking support",
> >>  		[21] = "UD multicast support",
> >>+		[22] = "UD IPv4 Multicast support",
> >>  		[24] = "Demand paging support",
> >>  		[25] = "Router support",
> >>+		[26] = "L2 Ethernet Multicast support",
> >>+		[28] = "Software parsing support for UD transport",
> >>+		[29] = "TCP checksum off-load support (ipv6)",
> >>  		[30] = "IBoE support",
> >>+		[31] = "FCoE T11 frame format support",
> >>  		[32] = "Unicast loopback support",
> >>+		[32] = "Multicast loopback support",
> >>  		[34] = "FCS header control",
> >>-		[38] = "Wake On LAN support",
> >>+		[35] = "Address Path ud_force_mgid support",
> >>+		[36] = "Header-Data Split support",
> >>+		[37] = "Wake On LAN support on port 1",
> >>+		[38] = "Wake On LAN support on port 2",
> >>+		[39] = "Fatal Warning Event upon a thermal warning condition",
> >>  		[40] = "UDP RSS support",
> >>  		[41] = "Unicast VEP steering support",
> >>  		[42] = "Multicast VEP steering support",
> >>+		[43] = "VLAN Steering mechanism support",
> >>+		[44] = "Steering according to EtherType support",
> >>+		[45] = "WQE format version 1 support",
> >>+		[46] = "Keep Alive Validiation support",
> >>+		[47] = "PTP1588 support",
> >>  		[48] = "Counters support",
> >>+		[49] = "Advanced Counters support",
> >>+		[50] = "Force Ethernet user priority from QPC support",
> >>+		[51] = "RX Port Num check disabled",
> >>+		[52] = "RSS on fragmented IP datagram support",
> >>  		[53] = "Port ETS Scheduler support",
> >>  		[55] = "Port link type sensing support",
> >>+		[56] = "Reliable Multicast support",
> >>+		[57] = "Fast Drop support",
> >>+		[58] = "Protected FMR support",
> >>  		[59] = "Port management change event support",
> >>  		[61] = "64 byte EQE support",
> >>  		[62] = "64 byte CQE support",
> >>  	};
> >>-	int i;
> >>
> >>  	mlx4_dbg(dev, "DEV_CAP flags:\n");
> >>-	for (i = 0; i < ARRAY_SIZE(fname); ++i)
> >>-		if (fname[i] && (flags & (1LL << i)))
> >>-			mlx4_dbg(dev, "    %s\n", fname[i]);
> >>+	dump_cap_flags(dev, flags, MLX4_DEV_CAP_FLAG_ALL, fname,
> >>+		       ARRAY_SIZE(fname));
> >>  }
> >>
> >>  static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> >>  {
> >>-	static const char * const fname[] = {
> >>+	static const char *fname[] = {
> >>  		[0] = "RSS support",
> >>  		[1] = "RSS Toeplitz Hash Function support",
> >>  		[2] = "RSS XOR Hash Function support",
> >>@@ -147,11 +183,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> >>  		[18] = "More than 80 VFs support",
> >>  		[19] = "Performance optimized for limited rule configuration flow steering support"
> >>  	};
> >>-	int i;
> >>
> >>-	for (i = 0; i < ARRAY_SIZE(fname); ++i)
> >>-		if (fname[i] && (flags & (1LL << i)))
> >>-			mlx4_dbg(dev, "    %s\n", fname[i]);
> >>+	dump_cap_flags(dev, flags, MLX4_DEV_CAP_FLAG2_ALL, fname,
> >>+		       ARRAY_SIZE(fname));
> >>  }
> >>
> >>  int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
> >>diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
> >>index 25c791e..e84badc 100644
> >>--- a/include/linux/mlx4/device.h
> >>+++ b/include/linux/mlx4/device.h
> >>@@ -180,6 +180,37 @@ enum {
> >>  	MLX4_DEV_CAP_FLAG_64B_CQE	= 1LL << 62
> >>  };
> >>
> >>+#define MLX4_DEV_CAP_FLAG_ALL	MLX4_DEV_CAP_FLAG_RC | \
> >>+				MLX4_DEV_CAP_FLAG_UC | \
> >>+				MLX4_DEV_CAP_FLAG_UD | \
> >>+				MLX4_DEV_CAP_FLAG_XRC | \
> >>+				MLX4_DEV_CAP_FLAG_SRQ | \
> >>+				MLX4_DEV_CAP_FLAG_IPOIB_CSUM | \
> >>+				MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR	 | \
> >>+				MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR	 | \
> >>+				MLX4_DEV_CAP_FLAG_DPDP | \
> >>+				MLX4_DEV_CAP_FLAG_BLH | \
> >>+				MLX4_DEV_CAP_FLAG_MEM_WINDOW | \
> >>+				MLX4_DEV_CAP_FLAG_APM | \
> >>+				MLX4_DEV_CAP_FLAG_ATOMIC | \
> >>+				MLX4_DEV_CAP_FLAG_RAW_MCAST | \
> >>+				MLX4_DEV_CAP_FLAG_UD_AV_PORT | \
> >>+				MLX4_DEV_CAP_FLAG_UD_MCAST | \
> >>+				MLX4_DEV_CAP_FLAG_IBOE | \
> >>+				MLX4_DEV_CAP_FLAG_UC_LOOPBACK | \
> >>+				MLX4_DEV_CAP_FLAG_FCS_KEEP | \
> >>+				MLX4_DEV_CAP_FLAG_WOL_PORT1 | \
> >>+				MLX4_DEV_CAP_FLAG_WOL_PORT2 | \
> >>+				MLX4_DEV_CAP_FLAG_UDP_RSS | \
> >>+				MLX4_DEV_CAP_FLAG_VEP_UC_STEER | \
> >>+				MLX4_DEV_CAP_FLAG_VEP_MC_STEER | \
> >>+				MLX4_DEV_CAP_FLAG_COUNTERS | \
> >>+				MLX4_DEV_CAP_FLAG_SET_ETH_SCHED  | \
> >>+				MLX4_DEV_CAP_FLAG_SENSE_SUPPORT	 | \
> >>+				MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV  | \
> >>+				MLX4_DEV_CAP_FLAG_64B_EQE | \
> >>+				MLX4_DEV_CAP_FLAG_64B_CQE
> >>+
> 
> I don't really like the idea that adding a flag is done both here
> and both in the enum. However, I don't see other option right now.
Same with me, no other choice.
Other ideas are welcome.
> 
> >>  enum {
> >>  	MLX4_DEV_CAP_FLAG2_RSS			= 1LL <<  0,
> >>  	MLX4_DEV_CAP_FLAG2_RSS_TOP		= 1LL <<  1,
> >>@@ -203,6 +234,27 @@ enum {
> >>  	MLX4_DEV_CAP_FLAG2_FS_A0		= 1LL <<  19
> >>  };
> >>
> >>+#define MLX4_DEV_CAP_FLAG2_ALL	MLX4_DEV_CAP_FLAG2_RSS | \
> >>+				MLX4_DEV_CAP_FLAG2_RSS_TOP | \
> >>+				MLX4_DEV_CAP_FLAG2_RSS_XOR | \
> >>+				MLX4_DEV_CAP_FLAG2_FS_EN | \
> >>+				MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN | \
> >>+				MLX4_DEV_CAP_FLAG2_TS | \
> >>+				MLX4_DEV_CAP_FLAG2_VLAN_CONTROL | \
> >>+				MLX4_DEV_CAP_FLAG2_FSM | \
> >>+				MLX4_DEV_CAP_FLAG2_UPDATE_QP | \
> >>+				MLX4_DEV_CAP_FLAG2_DMFS_IPOIB | \
> >>+				MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS | \
> >>+				MLX4_DEV_CAP_FLAG2_MAD_DEMUX | \
> >>+				MLX4_DEV_CAP_FLAG2_CQE_STRIDE | \
> >>+				MLX4_DEV_CAP_FLAG2_EQE_STRIDE | \
> >>+				MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL | \
> >>+				MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP | \
> >>+				MLX4_DEV_CAP_FLAG2_CONFIG_DEV | \
> >>+				MLX4_DEV_CAP_FLAG2_SYS_EQS | \
> >>+				MLX4_DEV_CAP_FLAG2_80_VFS | \
> >>+				MLX4_DEV_CAP_FLAG2_FS_A0
> >>+
> >>  enum {
> >>  	MLX4_QUERY_FUNC_FLAGS_BF_RES_QP		= 1LL << 0,
> >>  	MLX4_QUERY_FUNC_FLAGS_A0_RES_QP		= 1LL << 1
> >>--
> >>1.9.1
> >>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts
       [not found]                 ` <CAJ3xEMhespfjA1Epf6qS0wFf_a1wxSODg4L7tpLzAaNpnXiO8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2015-01-25 10:20                   ` Yuval Shaia
@ 2015-01-29 12:17                   ` Yuval Shaia
  1 sibling, 0 replies; 17+ messages in thread
From: Yuval Shaia @ 2015-01-29 12:17 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Matan Barak, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Mon, Dec 15, 2014 at 06:14:31PM +0200, Or Gerlitz wrote:
> >>
> >> NO, as Matan wrote you "except for Or's comments" - we do want to dump
> > Sure, was not ignoring this one, it was just a warn :)
> >> what is supported by both the device (firmware) and the driver, and
> >> not more. A subset of your patch can be used, let me know if you want
> >> me to prepare it.
> > Yes please do as i have no idea from where this info can be retrieved.
> 
> 
> Oh, that's easy, just follow on the MLX4_DEV_CAP_FLAG_YYY enum values
> and look for holes in the string array.
> 
> Or.
Sent new patch for review
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH] mlx4_core: Enhance device capabilities flags debug printouts
@ 2015-01-27  7:45 Yuval Shaia
  0 siblings, 0 replies; 17+ messages in thread
From: Yuval Shaia @ 2015-01-27  7:45 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA

1. Add descriptions of all features.
2. Add indication whether feature is supported or not.
With this enhancement all device features will be printed along with flags that shows if feature is supported by FW, Driver or both.

Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
 drivers/net/ethernet/mellanox/mlx4/fw.c | 54 +++++++++++++++++++++++++++------
 include/linux/mlx4/device.h             | 52 +++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index 982861d..34a7ab3 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -77,6 +77,19 @@ MODULE_PARM_DESC(enable_qos, "Enable Quality of Service support in the HCA (defa
 		}						      \
 	} while (0)
 
+void dump_cap_flags(struct mlx4_dev *dev, u64 fw_flags, u64 drv_flags,
+		    const char** fname, int fname_sz)
+{
+	int i;
+	for (i = 0; i < fname_sz; ++i) {
+		if (fname[i])
+			mlx4_dbg(dev, "\t(%c%c) %s\n",
+				 (fw_flags & (1LL << i)) ? '+' : '-',
+				 (drv_flags & (1LL << i)) ? '+' : '-',
+				 fname[i]);
+	}
+}
+
 static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 {
 	static const char *fname[] = {
@@ -91,7 +104,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 		[ 8] = "P_Key violation counter",
 		[ 9] = "Q_Key violation counter",
 		[10] = "VMM",
+		[11] = "Fibre Channel Protocol On Ethernet Ports support",
 		[12] = "Dual Port Different Protocol (DPDP) support",
+		[13] = "Raw Ethertype support",
+		[14] = "Raw IPv6 support",
 		[15] = "Big LSO headers",
 		[16] = "MW support",
 		[17] = "APM support",
@@ -99,33 +115,53 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 		[19] = "Raw multicast support",
 		[20] = "Address vector port checking support",
 		[21] = "UD multicast support",
+		[22] = "UD IPv4 Multicast support",
 		[24] = "Demand paging support",
 		[25] = "Router support",
+		[26] = "L2 Ethernet Multicast support",
+		[28] = "Software parsing support for UD transport",
+		[29] = "TCP checksum off-load support (ipv6)",
 		[30] = "IBoE support",
+		[31] = "FCoE T11 frame format support",
 		[32] = "Unicast loopback support",
+		[32] = "Multicast loopback support",
 		[34] = "FCS header control",
-		[38] = "Wake On LAN support",
+		[35] = "Address Path ud_force_mgid support",
+		[36] = "Header-Data Split support",
+		[37] = "Wake On LAN support on port 1",
+		[38] = "Wake On LAN support on port 2",
+		[39] = "Fatal Warning Event upon a thermal warning condition",
 		[40] = "UDP RSS support",
 		[41] = "Unicast VEP steering support",
 		[42] = "Multicast VEP steering support",
+		[43] = "VLAN Steering mechanism support",
+		[44] = "Steering according to EtherType support",
+		[45] = "WQE format version 1 support",
+		[46] = "Keep Alive Validiation support",
+		[47] = "PTP1588 support",
 		[48] = "Counters support",
+		[49] = "Advanced Counters support",
+		[50] = "Force Ethernet user priority from QPC support",
+		[51] = "RX Port Num check disabled",
+		[52] = "RSS on fragmented IP datagram support",
 		[53] = "Port ETS Scheduler support",
 		[55] = "Port link type sensing support",
+		[56] = "Reliable Multicast support",
+		[57] = "Fast Drop support",
+		[58] = "Protected FMR support",
 		[59] = "Port management change event support",
 		[61] = "64 byte EQE support",
 		[62] = "64 byte CQE support",
 	};
-	int i;
 
 	mlx4_dbg(dev, "DEV_CAP flags:\n");
-	for (i = 0; i < ARRAY_SIZE(fname); ++i)
-		if (fname[i] && (flags & (1LL << i)))
-			mlx4_dbg(dev, "    %s\n", fname[i]);
+	dump_cap_flags(dev, flags, MLX4_DEV_CAP_FLAG_ALL, fname,
+		       ARRAY_SIZE(fname));
 }
 
 static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
 {
-	static const char * const fname[] = {
+	static const char *fname[] = {
 		[0] = "RSS support",
 		[1] = "RSS Toeplitz Hash Function support",
 		[2] = "RSS XOR Hash Function support",
@@ -147,11 +183,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
 		[18] = "More than 80 VFs support",
 		[19] = "Performance optimized for limited rule configuration flow steering support"
 	};
-	int i;
 
-	for (i = 0; i < ARRAY_SIZE(fname); ++i)
-		if (fname[i] && (flags & (1LL << i)))
-			mlx4_dbg(dev, "    %s\n", fname[i]);
+	dump_cap_flags(dev, flags, MLX4_DEV_CAP_FLAG2_ALL, fname,
+		       ARRAY_SIZE(fname));
 }
 
 int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 25c791e..e84badc 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -180,6 +180,37 @@ enum {
 	MLX4_DEV_CAP_FLAG_64B_CQE	= 1LL << 62
 };
 
+#define MLX4_DEV_CAP_FLAG_ALL	MLX4_DEV_CAP_FLAG_RC | \
+				MLX4_DEV_CAP_FLAG_UC | \
+				MLX4_DEV_CAP_FLAG_UD | \
+				MLX4_DEV_CAP_FLAG_XRC | \
+				MLX4_DEV_CAP_FLAG_SRQ | \
+				MLX4_DEV_CAP_FLAG_IPOIB_CSUM | \
+				MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR	 | \
+				MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR	 | \
+				MLX4_DEV_CAP_FLAG_DPDP | \
+				MLX4_DEV_CAP_FLAG_BLH | \
+				MLX4_DEV_CAP_FLAG_MEM_WINDOW | \
+				MLX4_DEV_CAP_FLAG_APM | \
+				MLX4_DEV_CAP_FLAG_ATOMIC | \
+				MLX4_DEV_CAP_FLAG_RAW_MCAST | \
+				MLX4_DEV_CAP_FLAG_UD_AV_PORT | \
+				MLX4_DEV_CAP_FLAG_UD_MCAST | \
+				MLX4_DEV_CAP_FLAG_IBOE | \
+				MLX4_DEV_CAP_FLAG_UC_LOOPBACK | \
+				MLX4_DEV_CAP_FLAG_FCS_KEEP | \
+				MLX4_DEV_CAP_FLAG_WOL_PORT1 | \
+				MLX4_DEV_CAP_FLAG_WOL_PORT2 | \
+				MLX4_DEV_CAP_FLAG_UDP_RSS | \
+				MLX4_DEV_CAP_FLAG_VEP_UC_STEER | \
+				MLX4_DEV_CAP_FLAG_VEP_MC_STEER | \
+				MLX4_DEV_CAP_FLAG_COUNTERS | \
+				MLX4_DEV_CAP_FLAG_SET_ETH_SCHED  | \
+				MLX4_DEV_CAP_FLAG_SENSE_SUPPORT	 | \
+				MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV  | \
+				MLX4_DEV_CAP_FLAG_64B_EQE | \
+				MLX4_DEV_CAP_FLAG_64B_CQE
+
 enum {
 	MLX4_DEV_CAP_FLAG2_RSS			= 1LL <<  0,
 	MLX4_DEV_CAP_FLAG2_RSS_TOP		= 1LL <<  1,
@@ -203,6 +234,27 @@ enum {
 	MLX4_DEV_CAP_FLAG2_FS_A0		= 1LL <<  19
 };
 
+#define MLX4_DEV_CAP_FLAG2_ALL	MLX4_DEV_CAP_FLAG2_RSS | \
+				MLX4_DEV_CAP_FLAG2_RSS_TOP | \
+				MLX4_DEV_CAP_FLAG2_RSS_XOR | \
+				MLX4_DEV_CAP_FLAG2_FS_EN | \
+				MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN | \
+				MLX4_DEV_CAP_FLAG2_TS | \
+				MLX4_DEV_CAP_FLAG2_VLAN_CONTROL | \
+				MLX4_DEV_CAP_FLAG2_FSM | \
+				MLX4_DEV_CAP_FLAG2_UPDATE_QP | \
+				MLX4_DEV_CAP_FLAG2_DMFS_IPOIB | \
+				MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS | \
+				MLX4_DEV_CAP_FLAG2_MAD_DEMUX | \
+				MLX4_DEV_CAP_FLAG2_CQE_STRIDE | \
+				MLX4_DEV_CAP_FLAG2_EQE_STRIDE | \
+				MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL | \
+				MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP | \
+				MLX4_DEV_CAP_FLAG2_CONFIG_DEV | \
+				MLX4_DEV_CAP_FLAG2_SYS_EQS | \
+				MLX4_DEV_CAP_FLAG2_80_VFS | \
+				MLX4_DEV_CAP_FLAG2_FS_A0
+
 enum {
 	MLX4_QUERY_FUNC_FLAGS_BF_RES_QP		= 1LL << 0,
 	MLX4_QUERY_FUNC_FLAGS_A0_RES_QP		= 1LL << 1
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts
       [not found]           ` <CAJ3xEMght7jLakWzDOHvqTT_gNSqJJHAjLu_F6gD0j+=Narqmg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2014-12-15 12:25             ` Yuval Shaia
@ 2015-01-25 10:36             ` Yuval Shaia
  1 sibling, 0 replies; 17+ messages in thread
From: Yuval Shaia @ 2015-01-25 10:36 UTC (permalink / raw)
  To: Matan Barak; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> >> >-                       mlx4_dbg(dev, "    %s\n", fname[i]);
> >> >+               if (fname[i])
> >> >+                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> >> >+                                '*' : ' ', fname[i]);
> >> >  }
> >>
> >> I think that the strings should be displayed only if both driver and
> >> FW supports them. You could add a QUERY_DEV_CAP_SUPPORTED_FLAGS
> >> which ors all the supported flags in device.h and check if (flags &
> >> QUERY_DEV_CAP_SUPPORTED_FLAGS) & (1LL << i)).
But that would add an extra place to maintain when new feature will be added to driver, isn't it?
At present, when new feature is added to driver enum and string array needs to be updated.
With this new approach, string array is full, need only to add new enum and to update QUERY_DEV_CAP_SUPPORTED_FLAGS.
Again, two places in the code to change.
Up to you folks, which one you like better?
I like the new approach, it is less error prone.
> >>
> >> >
> >> >  static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> >> >@@ -144,8 +172,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> >> >         int i;
> >> >
> >> >         for (i =; i < ARRAY_SIZE(fname); ++i)
> >> >-               if (fname[i] && (flags & (1LL << i)))
> >> >-                       mlx4_dbg(dev, "    %s\n", fname[i]);
> >> >+               if (fname[i])
> >> >+                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> >> >+                                '*' : ' ', fname[i]);
> >> >  }
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts
       [not found]                 ` <CAJ3xEMhespfjA1Epf6qS0wFf_a1wxSODg4L7tpLzAaNpnXiO8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-01-25 10:20                   ` Yuval Shaia
  2015-01-29 12:17                   ` Yuval Shaia
  1 sibling, 0 replies; 17+ messages in thread
From: Yuval Shaia @ 2015-01-25 10:20 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Matan Barak, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Mon, Dec 15, 2014 at 06:14:31PM +0200, Or Gerlitz wrote:
> >> >> >+               [52] =RSS on fragmented IP datagram support",
> >> >>
> >> >> Hi,
> >> >>
> >> >> Except for Or's comments, [55] exists twice. Furthermore, please
> >> >> move [56]-[57] to be after [55] =Port link type sensing support".
> >> > Thanks,
> >> > Will send a revise patch soon.
> >> > By accepting this patch it is agreed that function will dump device capabilities flag and not the combination of dev & driver capabilities.
> >> > (as the name suggest)
> >>
> >> NO, as Matan wrote you "except for Or's comments" - we do want to dump
> > Sure, was not ignoring this one, it was just a warn :)
> >> what is supported by both the device (firmware) and the driver, and
> >> not more. A subset of your patch can be used, let me know if you want
> >> me to prepare it.
> > Yes please do as i have no idea from where this info can be retrieved.
> 
> 
> Oh, that's easy, just follow on the MLX4_DEV_CAP_FLAG_YYY enum values
> and look for holes in the string array.
Let me try to understand - are you using the holes in the string array to know which are supported by driver?
So currently there is no way for one to tell what FW supports unless it is support by driver.
In that case then all needs to be done is to fill only the features that has MLX4_DEV_CAP_FLAG* but no entry in the string array (e.x MLX4_DEV_CAP_FLAG_WOL_PORT2).
If this is the case then there are some that needs to be removed, i.e holes in enum but filled in the string array, for example "Demand paging support" and "Router support".
> 
> Or.
> 
> > How about the idea of maintaining drv_caps_flags field equivalent to dev_caps_flags?
> >>
> >> Or.
> >>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts
  2014-12-15 12:25             ` Yuval Shaia
@ 2014-12-15 16:14               ` Or Gerlitz
       [not found]                 ` <CAJ3xEMhespfjA1Epf6qS0wFf_a1wxSODg4L7tpLzAaNpnXiO8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Or Gerlitz @ 2014-12-15 16:14 UTC (permalink / raw)
  To: Yuval Shaia; +Cc: Matan Barak, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Mon, Dec 15, 2014 at 2:25 PM, Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> On Mon, Dec 15, 2014 at 11:35:52AM +0200, Or Gerlitz wrote:
>> On Mon, Dec 15, 2014 at 11:21 AM, Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
>> > On Wed, Dec 10, 2014 at 12:10:07PM +0200, Matan Barak wrote:
>> >>
>> >>
>> >> On 12/8/2014 1:48 AM, Yuval Shaia wrote:
>> >> >1. Add indication whether feature is supported or not.
>> >> >2. Add descriptions of all features.
>> >> >Without this fix there is no way to tell if feature is not supported or that description is not exist.
>> >> >
>> >> >Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
>> >> >---
>> >> >  drivers/net/ethernet/mellanox/mlx4/fw.c |   37 +++++++++++++++++++++++++++---
>> >> >  1 files changed, 33 insertions(+), 4 deletions(-)
>> >> >
>> >> >diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
>> >> >index 2e88a23..79ab326 100644
>> >> >--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
>> >> >+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
>> >> >@@ -91,7 +91,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>> >> >                 [ 8] =P_Key violation counter",
>> >> >                 [ 9] =Q_Key violation counter",
>> >> >                 [10] =VMM",
>> >> >+               [11] =Fibre Channel Protocol On Ethernet Ports support",
>> >> >                 [12] =Dual Port Different Protocol (DPDP) support",
>> >> >+               [13] =Raw Ethertype support",
>> >> >+               [14] =Raw IPv6 support",
>> >> >                 [15] =Big LSO headers",
>> >> >                 [16] =MW support",
>> >> >                 [17] =APM support",
>> >> >@@ -99,16 +102,40 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>> >> >                 [19] =Raw multicast support",
>> >> >                 [20] =Address vector port checking support",
>> >> >                 [21] =UD multicast support",
>> >> >+               [22] =UD IPv4 Multicast support",
>> >> >                 [24] =Demand paging support",
>> >> >                 [25] =Router support",
>> >> >+               [26] =L2 Ethernet Multicast support",
>> >> >+               [28] =Software parsing support for UD transport",
>> >> >+               [29] =TCP checksum off-load support",
>> >> >                 [30] =IBoE support",
>> >> >+               [31] =FCoE T11 frame format support",
>> >> >                 [32] =Unicast loopback support",
>> >> >+               [33] =Multicast loopback support",
>> >> >                 [34] =FCS header control",
>> >> >+               [35] =Address Path ud_force_mgid support",
>> >> >+               [36] =Header-Data Split support",
>> >> >+               [37] =Wake On LAN support on port 1",
>> >> >+               [38] =Wake On LAN support on port 2",
>> >> >+               [39] =Fatal Warning Event upon a thermal warning condition",
>> >> >                 [38] =Wake On LAN support",
>> >> >                 [40] =UDP RSS support",
>> >> >                 [41] =Unicast VEP steering support",
>> >> >                 [42] =Multicast VEP steering support",
>> >> >+               [43] =VLAN Steering mechanism support",
>> >> >+               [44] =Steering according to EtherType support",
>> >> >+               [45] =WQE format version 1 support",
>> >> >+               [46] =Keep Alive Validiation support",
>> >> >+               [47] =PTP1588 support",
>> >> >                 [48] =Counters support",
>> >> >+               [49] =Advanced Counters support",
>> >> >+               [50] =Force Ethernet user priority from QPC support",
>> >> >+               [51] =RX Port Num check disabled",
>> >> >+               [52] =RSS on fragmented IP datagram support",
>> >>
>> >> Hi,
>> >>
>> >> Except for Or's comments, [55] exists twice. Furthermore, please
>> >> move [56]-[57] to be after [55] =Port link type sensing support".
>> > Thanks,
>> > Will send a revise patch soon.
>> > By accepting this patch it is agreed that function will dump device capabilities flag and not the combination of dev & driver capabilities.
>> > (as the name suggest)
>>
>> NO, as Matan wrote you "except for Or's comments" - we do want to dump
> Sure, was not ignoring this one, it was just a warn :)
>> what is supported by both the device (firmware) and the driver, and
>> not more. A subset of your patch can be used, let me know if you want
>> me to prepare it.
> Yes please do as i have no idea from where this info can be retrieved.


Oh, that's easy, just follow on the MLX4_DEV_CAP_FLAG_YYY enum values
and look for holes in the string array.

Or.

> How about the idea of maintaining drv_caps_flags field equivalent to dev_caps_flags?
>>
>> Or.
>>
>> >>
>> >> >+               [55] =Link Sensing support",
>> >> >+               [56] =Reliable Multicast support",
>> >> >+               [57] =Fast Drop support",
>> >> >+               [58] =Protected FMR support",
>> >> >                 [53] =Port ETS Scheduler support",
>> >> >                 [55] =Port link type sensing support",
>> >> >                 [59] =Port management change event support",
>> >> >@@ -119,8 +146,9 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>> >> >
>> >> >         mlx4_dbg(dev, "DEV_CAP flags:\n");
>> >> >         for (i =; i < ARRAY_SIZE(fname); ++i)
>> >> >-               if (fname[i] && (flags & (1LL << i)))
>> >> >-                       mlx4_dbg(dev, "    %s\n", fname[i]);
>> >> >+               if (fname[i])
>> >> >+                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
>> >> >+                                '*' : ' ', fname[i]);
>> >> >  }
>> >>
>> >> I think that the strings should be displayed only if both driver and
>> >> FW supports them. You could add a QUERY_DEV_CAP_SUPPORTED_FLAGS
>> >> which ors all the supported flags in device.h and check if (flags &
>> >> QUERY_DEV_CAP_SUPPORTED_FLAGS) & (1LL << i)).
>> >>
>> >> >
>> >> >  static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
>> >> >@@ -144,8 +172,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
>> >> >         int i;
>> >> >
>> >> >         for (i =; i < ARRAY_SIZE(fname); ++i)
>> >> >-               if (fname[i] && (flags & (1LL << i)))
>> >> >-                       mlx4_dbg(dev, "    %s\n", fname[i]);
>> >> >+               if (fname[i])
>> >> >+                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
>> >> >+                                '*' : ' ', fname[i]);
>> >> >  }
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts
       [not found]           ` <CAJ3xEMght7jLakWzDOHvqTT_gNSqJJHAjLu_F6gD0j+=Narqmg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-12-15 12:25             ` Yuval Shaia
  2014-12-15 16:14               ` Or Gerlitz
  2015-01-25 10:36             ` Yuval Shaia
  1 sibling, 1 reply; 17+ messages in thread
From: Yuval Shaia @ 2014-12-15 12:25 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Matan Barak, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Mon, Dec 15, 2014 at 11:35:52AM +0200, Or Gerlitz wrote:
> On Mon, Dec 15, 2014 at 11:21 AM, Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> > On Wed, Dec 10, 2014 at 12:10:07PM +0200, Matan Barak wrote:
> >>
> >>
> >> On 12/8/2014 1:48 AM, Yuval Shaia wrote:
> >> >1. Add indication whether feature is supported or not.
> >> >2. Add descriptions of all features.
> >> >Without this fix there is no way to tell if feature is not supported or that description is not exist.
> >> >
> >> >Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> >> >---
> >> >  drivers/net/ethernet/mellanox/mlx4/fw.c |   37 +++++++++++++++++++++++++++---
> >> >  1 files changed, 33 insertions(+), 4 deletions(-)
> >> >
> >> >diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
> >> >index 2e88a23..79ab326 100644
> >> >--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
> >> >+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
> >> >@@ -91,7 +91,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
> >> >                 [ 8] =P_Key violation counter",
> >> >                 [ 9] =Q_Key violation counter",
> >> >                 [10] =VMM",
> >> >+               [11] =Fibre Channel Protocol On Ethernet Ports support",
> >> >                 [12] =Dual Port Different Protocol (DPDP) support",
> >> >+               [13] =Raw Ethertype support",
> >> >+               [14] =Raw IPv6 support",
> >> >                 [15] =Big LSO headers",
> >> >                 [16] =MW support",
> >> >                 [17] =APM support",
> >> >@@ -99,16 +102,40 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
> >> >                 [19] =Raw multicast support",
> >> >                 [20] =Address vector port checking support",
> >> >                 [21] =UD multicast support",
> >> >+               [22] =UD IPv4 Multicast support",
> >> >                 [24] =Demand paging support",
> >> >                 [25] =Router support",
> >> >+               [26] =L2 Ethernet Multicast support",
> >> >+               [28] =Software parsing support for UD transport",
> >> >+               [29] =TCP checksum off-load support",
> >> >                 [30] =IBoE support",
> >> >+               [31] =FCoE T11 frame format support",
> >> >                 [32] =Unicast loopback support",
> >> >+               [33] =Multicast loopback support",
> >> >                 [34] =FCS header control",
> >> >+               [35] =Address Path ud_force_mgid support",
> >> >+               [36] =Header-Data Split support",
> >> >+               [37] =Wake On LAN support on port 1",
> >> >+               [38] =Wake On LAN support on port 2",
> >> >+               [39] =Fatal Warning Event upon a thermal warning condition",
> >> >                 [38] =Wake On LAN support",
> >> >                 [40] =UDP RSS support",
> >> >                 [41] =Unicast VEP steering support",
> >> >                 [42] =Multicast VEP steering support",
> >> >+               [43] =VLAN Steering mechanism support",
> >> >+               [44] =Steering according to EtherType support",
> >> >+               [45] =WQE format version 1 support",
> >> >+               [46] =Keep Alive Validiation support",
> >> >+               [47] =PTP1588 support",
> >> >                 [48] =Counters support",
> >> >+               [49] =Advanced Counters support",
> >> >+               [50] =Force Ethernet user priority from QPC support",
> >> >+               [51] =RX Port Num check disabled",
> >> >+               [52] =RSS on fragmented IP datagram support",
> >>
> >> Hi,
> >>
> >> Except for Or's comments, [55] exists twice. Furthermore, please
> >> move [56]-[57] to be after [55] =Port link type sensing support".
> > Thanks,
> > Will send a revise patch soon.
> > By accepting this patch it is agreed that function will dump device capabilities flag and not the combination of dev & driver capabilities.
> > (as the name suggest)
> 
> NO, as Matan wrote you "except for Or's comments" - we do want to dump
Sure, was not ignoring this one, it was just a warn :)
> what is supported by both the device (firmware) and the driver, and
> not more. A subset of your patch can be used, let me know if you want
> me to prepare it.
Yes please do as i have no idea from where this info can be retrieved.
How about the idea of maintaining drv_caps_flags field equivalent to dev_caps_flags?
> 
> Or.
> 
> >>
> >> >+               [55] =Link Sensing support",
> >> >+               [56] =Reliable Multicast support",
> >> >+               [57] =Fast Drop support",
> >> >+               [58] =Protected FMR support",
> >> >                 [53] =Port ETS Scheduler support",
> >> >                 [55] =Port link type sensing support",
> >> >                 [59] =Port management change event support",
> >> >@@ -119,8 +146,9 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
> >> >
> >> >         mlx4_dbg(dev, "DEV_CAP flags:\n");
> >> >         for (i =; i < ARRAY_SIZE(fname); ++i)
> >> >-               if (fname[i] && (flags & (1LL << i)))
> >> >-                       mlx4_dbg(dev, "    %s\n", fname[i]);
> >> >+               if (fname[i])
> >> >+                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> >> >+                                '*' : ' ', fname[i]);
> >> >  }
> >>
> >> I think that the strings should be displayed only if both driver and
> >> FW supports them. You could add a QUERY_DEV_CAP_SUPPORTED_FLAGS
> >> which ors all the supported flags in device.h and check if (flags &
> >> QUERY_DEV_CAP_SUPPORTED_FLAGS) & (1LL << i)).
> >>
> >> >
> >> >  static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> >> >@@ -144,8 +172,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> >> >         int i;
> >> >
> >> >         for (i =; i < ARRAY_SIZE(fname); ++i)
> >> >-               if (fname[i] && (flags & (1LL << i)))
> >> >-                       mlx4_dbg(dev, "    %s\n", fname[i]);
> >> >+               if (fname[i])
> >> >+                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> >> >+                                '*' : ' ', fname[i]);
> >> >  }
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts
  2014-12-15  9:21       ` Yuval Shaia
@ 2014-12-15  9:35         ` Or Gerlitz
       [not found]           ` <CAJ3xEMght7jLakWzDOHvqTT_gNSqJJHAjLu_F6gD0j+=Narqmg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Or Gerlitz @ 2014-12-15  9:35 UTC (permalink / raw)
  To: Yuval Shaia; +Cc: Matan Barak, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Mon, Dec 15, 2014 at 11:21 AM, Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> On Wed, Dec 10, 2014 at 12:10:07PM +0200, Matan Barak wrote:
>>
>>
>> On 12/8/2014 1:48 AM, Yuval Shaia wrote:
>> >1. Add indication whether feature is supported or not.
>> >2. Add descriptions of all features.
>> >Without this fix there is no way to tell if feature is not supported or that description is not exist.
>> >
>> >Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
>> >---
>> >  drivers/net/ethernet/mellanox/mlx4/fw.c |   37 +++++++++++++++++++++++++++---
>> >  1 files changed, 33 insertions(+), 4 deletions(-)
>> >
>> >diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
>> >index 2e88a23..79ab326 100644
>> >--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
>> >+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
>> >@@ -91,7 +91,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>> >                 [ 8] =P_Key violation counter",
>> >                 [ 9] =Q_Key violation counter",
>> >                 [10] =VMM",
>> >+               [11] =Fibre Channel Protocol On Ethernet Ports support",
>> >                 [12] =Dual Port Different Protocol (DPDP) support",
>> >+               [13] =Raw Ethertype support",
>> >+               [14] =Raw IPv6 support",
>> >                 [15] =Big LSO headers",
>> >                 [16] =MW support",
>> >                 [17] =APM support",
>> >@@ -99,16 +102,40 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>> >                 [19] =Raw multicast support",
>> >                 [20] =Address vector port checking support",
>> >                 [21] =UD multicast support",
>> >+               [22] =UD IPv4 Multicast support",
>> >                 [24] =Demand paging support",
>> >                 [25] =Router support",
>> >+               [26] =L2 Ethernet Multicast support",
>> >+               [28] =Software parsing support for UD transport",
>> >+               [29] =TCP checksum off-load support",
>> >                 [30] =IBoE support",
>> >+               [31] =FCoE T11 frame format support",
>> >                 [32] =Unicast loopback support",
>> >+               [33] =Multicast loopback support",
>> >                 [34] =FCS header control",
>> >+               [35] =Address Path ud_force_mgid support",
>> >+               [36] =Header-Data Split support",
>> >+               [37] =Wake On LAN support on port 1",
>> >+               [38] =Wake On LAN support on port 2",
>> >+               [39] =Fatal Warning Event upon a thermal warning condition",
>> >                 [38] =Wake On LAN support",
>> >                 [40] =UDP RSS support",
>> >                 [41] =Unicast VEP steering support",
>> >                 [42] =Multicast VEP steering support",
>> >+               [43] =VLAN Steering mechanism support",
>> >+               [44] =Steering according to EtherType support",
>> >+               [45] =WQE format version 1 support",
>> >+               [46] =Keep Alive Validiation support",
>> >+               [47] =PTP1588 support",
>> >                 [48] =Counters support",
>> >+               [49] =Advanced Counters support",
>> >+               [50] =Force Ethernet user priority from QPC support",
>> >+               [51] =RX Port Num check disabled",
>> >+               [52] =RSS on fragmented IP datagram support",
>>
>> Hi,
>>
>> Except for Or's comments, [55] exists twice. Furthermore, please
>> move [56]-[57] to be after [55] =Port link type sensing support".
> Thanks,
> Will send a revise patch soon.
> By accepting this patch it is agreed that function will dump device capabilities flag and not the combination of dev & driver capabilities.
> (as the name suggest)

NO, as Matan wrote you "except for Or's comments" - we do want to dump
what is supported by both the device (firmware) and the driver, and
not more. A subset of your patch can be used, let me know if you want
me to prepare it.

Or.

>>
>> >+               [55] =Link Sensing support",
>> >+               [56] =Reliable Multicast support",
>> >+               [57] =Fast Drop support",
>> >+               [58] =Protected FMR support",
>> >                 [53] =Port ETS Scheduler support",
>> >                 [55] =Port link type sensing support",
>> >                 [59] =Port management change event support",
>> >@@ -119,8 +146,9 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>> >
>> >         mlx4_dbg(dev, "DEV_CAP flags:\n");
>> >         for (i =; i < ARRAY_SIZE(fname); ++i)
>> >-               if (fname[i] && (flags & (1LL << i)))
>> >-                       mlx4_dbg(dev, "    %s\n", fname[i]);
>> >+               if (fname[i])
>> >+                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
>> >+                                '*' : ' ', fname[i]);
>> >  }
>>
>> I think that the strings should be displayed only if both driver and
>> FW supports them. You could add a QUERY_DEV_CAP_SUPPORTED_FLAGS
>> which ors all the supported flags in device.h and check if (flags &
>> QUERY_DEV_CAP_SUPPORTED_FLAGS) & (1LL << i)).
>>
>> >
>> >  static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
>> >@@ -144,8 +172,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
>> >         int i;
>> >
>> >         for (i =; i < ARRAY_SIZE(fname); ++i)
>> >-               if (fname[i] && (flags & (1LL << i)))
>> >-                       mlx4_dbg(dev, "    %s\n", fname[i]);
>> >+               if (fname[i])
>> >+                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
>> >+                                '*' : ' ', fname[i]);
>> >  }
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts
       [not found]     ` <54881BFF.2030008-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2014-12-15  9:21       ` Yuval Shaia
  2014-12-15  9:35         ` Or Gerlitz
  0 siblings, 1 reply; 17+ messages in thread
From: Yuval Shaia @ 2014-12-15  9:21 UTC (permalink / raw)
  To: Matan Barak; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, Dec 10, 2014 at 12:10:07PM +0200, Matan Barak wrote:
> 
> 
> On 12/8/2014 1:48 AM, Yuval Shaia wrote:
> >1. Add indication whether feature is supported or not.
> >2. Add descriptions of all features.
> >Without this fix there is no way to tell if feature is not supported or that description is not exist.
> >
> >Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> >---
> >  drivers/net/ethernet/mellanox/mlx4/fw.c |   37 +++++++++++++++++++++++++++---
> >  1 files changed, 33 insertions(+), 4 deletions(-)
> >
> >diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
> >index 2e88a23..79ab326 100644
> >--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
> >+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
> >@@ -91,7 +91,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
> >                 [ 8] =P_Key violation counter",
> >                 [ 9] =Q_Key violation counter",
> >                 [10] =VMM",
> >+               [11] =Fibre Channel Protocol On Ethernet Ports support",
> >                 [12] =Dual Port Different Protocol (DPDP) support",
> >+               [13] =Raw Ethertype support",
> >+               [14] =Raw IPv6 support",
> >                 [15] =Big LSO headers",
> >                 [16] =MW support",
> >                 [17] =APM support",
> >@@ -99,16 +102,40 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
> >                 [19] =Raw multicast support",
> >                 [20] =Address vector port checking support",
> >                 [21] =UD multicast support",
> >+               [22] =UD IPv4 Multicast support",
> >                 [24] =Demand paging support",
> >                 [25] =Router support",
> >+               [26] =L2 Ethernet Multicast support",
> >+               [28] =Software parsing support for UD transport",
> >+               [29] =TCP checksum off-load support",
> >                 [30] =IBoE support",
> >+               [31] =FCoE T11 frame format support",
> >                 [32] =Unicast loopback support",
> >+               [33] =Multicast loopback support",
> >                 [34] =FCS header control",
> >+               [35] =Address Path ud_force_mgid support",
> >+               [36] =Header-Data Split support",
> >+               [37] =Wake On LAN support on port 1",
> >+               [38] =Wake On LAN support on port 2",
> >+               [39] =Fatal Warning Event upon a thermal warning condition",
> >                 [38] =Wake On LAN support",
> >                 [40] =UDP RSS support",
> >                 [41] =Unicast VEP steering support",
> >                 [42] =Multicast VEP steering support",
> >+               [43] =VLAN Steering mechanism support",
> >+               [44] =Steering according to EtherType support",
> >+               [45] =WQE format version 1 support",
> >+               [46] =Keep Alive Validiation support",
> >+               [47] =PTP1588 support",
> >                 [48] =Counters support",
> >+               [49] =Advanced Counters support",
> >+               [50] =Force Ethernet user priority from QPC support",
> >+               [51] =RX Port Num check disabled",
> >+               [52] =RSS on fragmented IP datagram support",
> 
> Hi,
> 
> Except for Or's comments, [55] exists twice. Furthermore, please
> move [56]-[57] to be after [55] =Port link type sensing support".
Thanks,
Will send a revise patch soon.
By accepting this patch it is agreed that function will dump device capabilities flag and not the combination of dev & driver capabilities.
(as the name suggest)
> 
> >+               [55] =Link Sensing support",
> >+               [56] =Reliable Multicast support",
> >+               [57] =Fast Drop support",
> >+               [58] =Protected FMR support",
> >                 [53] =Port ETS Scheduler support",
> >                 [55] =Port link type sensing support",
> >                 [59] =Port management change event support",
> >@@ -119,8 +146,9 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
> >
> >         mlx4_dbg(dev, "DEV_CAP flags:\n");
> >         for (i =; i < ARRAY_SIZE(fname); ++i)
> >-               if (fname[i] && (flags & (1LL << i)))
> >-                       mlx4_dbg(dev, "    %s\n", fname[i]);
> >+               if (fname[i])
> >+                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> >+                                '*' : ' ', fname[i]);
> >  }
> 
> I think that the strings should be displayed only if both driver and
> FW supports them. You could add a QUERY_DEV_CAP_SUPPORTED_FLAGS
> which ors all the supported flags in device.h and check if (flags &
> QUERY_DEV_CAP_SUPPORTED_FLAGS) & (1LL << i)).
> 
> >
> >  static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> >@@ -144,8 +172,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> >         int i;
> >
> >         for (i =; i < ARRAY_SIZE(fname); ++i)
> >-               if (fname[i] && (flags & (1LL << i)))
> >-                       mlx4_dbg(dev, "    %s\n", fname[i]);
> >+               if (fname[i])
> >+                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> >+                                '*' : ' ', fname[i]);
> >  }
> >
> >  int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
> >--
> >1.7.1
> >
> >--
> >To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> >the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> >More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> 
> Regards,
> Matan
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH] mlx4_core: Enhance device capabilities flags debug printouts
@ 2014-12-14 19:18 Yuval Shaia
  0 siblings, 0 replies; 17+ messages in thread
From: Yuval Shaia @ 2014-12-14 19:18 UTC (permalink / raw)
  To: yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA, linux-rdma-u79uwXL29TY76Z2rM5mHXA

1. Add indication whether feature is supported or not.
2. Add descriptions of all features.
Without this fix there is no way to tell if feature is not supported or that description is not exist.

Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
 drivers/net/ethernet/mellanox/mlx4/fw.c |   36 +++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index 2e88a23..4fd00e4 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -91,7 +91,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 		[ 8] = "P_Key violation counter",
 		[ 9] = "Q_Key violation counter",
 		[10] = "VMM",
+		[11] = "Fibre Channel Protocol On Ethernet Ports support",
 		[12] = "Dual Port Different Protocol (DPDP) support",
+		[13] = "Raw Ethertype support",
+		[14] = "Raw IPv6 support",
 		[15] = "Big LSO headers",
 		[16] = "MW support",
 		[17] = "APM support",
@@ -99,18 +102,41 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 		[19] = "Raw multicast support",
 		[20] = "Address vector port checking support",
 		[21] = "UD multicast support",
+		[22] = "UD IPv4 Multicast support",
 		[24] = "Demand paging support",
 		[25] = "Router support",
+		[26] = "L2 Ethernet Multicast support",
+		[28] = "Software parsing support for UD transport",
+		[29] = "TCP checksum off-load support",
 		[30] = "IBoE support",
+		[31] = "FCoE T11 frame format support",
 		[32] = "Unicast loopback support",
+		[33] = "Multicast loopback support",
 		[34] = "FCS header control",
+		[35] = "Address Path ud_force_mgid support",
+		[36] = "Header-Data Split support",
+		[37] = "Wake On LAN support on port 1",
+		[38] = "Wake On LAN support on port 2",
+		[39] = "Fatal Warning Event upon a thermal warning condition",
 		[38] = "Wake On LAN support",
 		[40] = "UDP RSS support",
 		[41] = "Unicast VEP steering support",
 		[42] = "Multicast VEP steering support",
+		[43] = "VLAN Steering mechanism support",
+		[44] = "Steering according to EtherType support",
+		[45] = "WQE format version 1 support",
+		[46] = "Keep Alive Validiation support",
+		[47] = "PTP1588 support",
 		[48] = "Counters support",
+		[49] = "Advanced Counters support",
+		[50] = "Force Ethernet user priority from QPC support",
+		[51] = "RX Port Num check disabled",
+		[52] = "RSS on fragmented IP datagram support",
 		[53] = "Port ETS Scheduler support",
 		[55] = "Port link type sensing support",
+		[56] = "Reliable Multicast support",
+		[57] = "Fast Drop support",
+		[58] = "Protected FMR support",
 		[59] = "Port management change event support",
 		[61] = "64 byte EQE support",
 		[62] = "64 byte CQE support",
@@ -119,8 +145,9 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 
 	mlx4_dbg(dev, "DEV_CAP flags:\n");
 	for (i = 0; i < ARRAY_SIZE(fname); ++i)
-		if (fname[i] && (flags & (1LL << i)))
-			mlx4_dbg(dev, "    %s\n", fname[i]);
+		if (fname[i])
+			mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
+				 '*' : ' ', fname[i]);
 }
 
 static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
@@ -144,8 +171,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(fname); ++i)
-		if (fname[i] && (flags & (1LL << i)))
-			mlx4_dbg(dev, "    %s\n", fname[i]);
+		if (fname[i])
+			mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
+				 '*' : ' ', fname[i]);
 }
 
 int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts
       [not found] ` <1417996112-19060-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  2014-12-09 17:55   ` Or Gerlitz
@ 2014-12-10 10:10   ` Matan Barak
       [not found]     ` <54881BFF.2030008-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  1 sibling, 1 reply; 17+ messages in thread
From: Matan Barak @ 2014-12-10 10:10 UTC (permalink / raw)
  To: Yuval Shaia, linux-rdma-u79uwXL29TY76Z2rM5mHXA



On 12/8/2014 1:48 AM, Yuval Shaia wrote:
> 1. Add indication whether feature is supported or not.
> 2. Add descriptions of all features.
> Without this fix there is no way to tell if feature is not supported or that description is not exist.
>
> Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---
>   drivers/net/ethernet/mellanox/mlx4/fw.c |   37 +++++++++++++++++++++++++++---
>   1 files changed, 33 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
> index 2e88a23..79ab326 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/fw.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
> @@ -91,7 +91,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>                  [ 8] =P_Key violation counter",
>                  [ 9] =Q_Key violation counter",
>                  [10] =VMM",
> +               [11] =Fibre Channel Protocol On Ethernet Ports support",
>                  [12] =Dual Port Different Protocol (DPDP) support",
> +               [13] =Raw Ethertype support",
> +               [14] =Raw IPv6 support",
>                  [15] =Big LSO headers",
>                  [16] =MW support",
>                  [17] =APM support",
> @@ -99,16 +102,40 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>                  [19] =Raw multicast support",
>                  [20] =Address vector port checking support",
>                  [21] =UD multicast support",
> +               [22] =UD IPv4 Multicast support",
>                  [24] =Demand paging support",
>                  [25] =Router support",
> +               [26] =L2 Ethernet Multicast support",
> +               [28] =Software parsing support for UD transport",
> +               [29] =TCP checksum off-load support",
>                  [30] =IBoE support",
> +               [31] =FCoE T11 frame format support",
>                  [32] =Unicast loopback support",
> +               [33] =Multicast loopback support",
>                  [34] =FCS header control",
> +               [35] =Address Path ud_force_mgid support",
> +               [36] =Header-Data Split support",
> +               [37] =Wake On LAN support on port 1",
> +               [38] =Wake On LAN support on port 2",
> +               [39] =Fatal Warning Event upon a thermal warning condition",
>                  [38] =Wake On LAN support",
>                  [40] =UDP RSS support",
>                  [41] =Unicast VEP steering support",
>                  [42] =Multicast VEP steering support",
> +               [43] =VLAN Steering mechanism support",
> +               [44] =Steering according to EtherType support",
> +               [45] =WQE format version 1 support",
> +               [46] =Keep Alive Validiation support",
> +               [47] =PTP1588 support",
>                  [48] =Counters support",
> +               [49] =Advanced Counters support",
> +               [50] =Force Ethernet user priority from QPC support",
> +               [51] =RX Port Num check disabled",
> +               [52] =RSS on fragmented IP datagram support",

Hi,

Except for Or's comments, [55] exists twice. Furthermore, please move 
[56]-[57] to be after [55] =Port link type sensing support".

> +               [55] =Link Sensing support",
> +               [56] =Reliable Multicast support",
> +               [57] =Fast Drop support",
> +               [58] =Protected FMR support",
>                  [53] =Port ETS Scheduler support",
>                  [55] =Port link type sensing support",
>                  [59] =Port management change event support",
> @@ -119,8 +146,9 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>
>          mlx4_dbg(dev, "DEV_CAP flags:\n");
>          for (i =; i < ARRAY_SIZE(fname); ++i)
> -               if (fname[i] && (flags & (1LL << i)))
> -                       mlx4_dbg(dev, "    %s\n", fname[i]);
> +               if (fname[i])
> +                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> +                                '*' : ' ', fname[i]);
>   }

I think that the strings should be displayed only if both driver and FW 
supports them. You could add a QUERY_DEV_CAP_SUPPORTED_FLAGS which ors 
all the supported flags in device.h and check if (flags & 
QUERY_DEV_CAP_SUPPORTED_FLAGS) & (1LL << i)).

>
>   static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> @@ -144,8 +172,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
>          int i;
>
>          for (i =; i < ARRAY_SIZE(fname); ++i)
> -               if (fname[i] && (flags & (1LL << i)))
> -                       mlx4_dbg(dev, "    %s\n", fname[i]);
> +               if (fname[i])
> +                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> +                                '*' : ' ', fname[i]);
>   }
>
>   int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Regards,
Matan
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts
       [not found]     ` <CAJ3xEMgjP0V7h7mRTr84NLW3Rib-QLN8j0rbEk5_MRvORXbDMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-12-10  8:25       ` Yuval Shaia
  0 siblings, 0 replies; 17+ messages in thread
From: Yuval Shaia @ 2014-12-10  8:25 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Tue, Dec 09, 2014 at 07:55:07PM +0200, Or Gerlitz wrote:
> On Mon, Dec 8, 2014 at 1:48 AM, Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> > 1. Add indication whether feature is supported or not.
> > 2. Add descriptions of all features.
> > Without this fix there is no way to tell if feature is not supported or that description is not exist.
> 
> 
> The problem with this patch is that the current practice is to only
> advertize a feature as a string in this table when **both** the driver
> and the firmware support it.
I proposed this fix when faced feature which supported by FW and by the driver but was not printed out (auto-sense).
This shows that the current practice is hard to maintain, when developer implement feature in driver he *must remember* also to add string here.

The function is called dump_dev_cap_flags so why not used it to dump device capability flags?
> 
> We can make a fix here to add dumping for features which are currently
> supported on that level but not dumped today (e.g WoL and such).
See my note above - this will be hard to maintain.
Maybe, as suggestion, we should have the equivalent priv.driver_cap_flags, and dump function will print the merged flags (binary and them)?
> 
> You can have a look on the MLX4_DEV_CAP_FLAG_ enum under
> include/linux/mlx4/device.h to pick up such values (used by the driver
> but aren't dumped as dev-caps)
> 
> Or.
> 
> 
> >
> > Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> > ---
> >  drivers/net/ethernet/mellanox/mlx4/fw.c |   37 +++++++++++++++++++++++++++---
> >  1 files changed, 33 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
> > index 2e88a23..79ab326 100644
> > --- a/drivers/net/ethernet/mellanox/mlx4/fw.c
> > +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
> > @@ -91,7 +91,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
> >                 [ 8] = "P_Key violation counter",
> >                 [ 9] = "Q_Key violation counter",
> >                 [10] = "VMM",
> > +               [11] = "Fibre Channel Protocol On Ethernet Ports support",
> >                 [12] = "Dual Port Different Protocol (DPDP) support",
> > +               [13] = "Raw Ethertype support",
> > +               [14] = "Raw IPv6 support",
> >                 [15] = "Big LSO headers",
> >                 [16] = "MW support",
> >                 [17] = "APM support",
> > @@ -99,16 +102,40 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
> >                 [19] = "Raw multicast support",
> >                 [20] = "Address vector port checking support",
> >                 [21] = "UD multicast support",
> > +               [22] = "UD IPv4 Multicast support",
> >                 [24] = "Demand paging support",
> >                 [25] = "Router support",
> > +               [26] = "L2 Ethernet Multicast support",
> > +               [28] = "Software parsing support for UD transport",
> > +               [29] = "TCP checksum off-load support",
> >                 [30] = "IBoE support",
> > +               [31] = "FCoE T11 frame format support",
> >                 [32] = "Unicast loopback support",
> > +               [33] = "Multicast loopback support",
> >                 [34] = "FCS header control",
> > +               [35] = "Address Path ud_force_mgid support",
> > +               [36] = "Header-Data Split support",
> > +               [37] = "Wake On LAN support on port 1",
> > +               [38] = "Wake On LAN support on port 2",
> > +               [39] = "Fatal Warning Event upon a thermal warning condition",
> >                 [38] = "Wake On LAN support",
> >                 [40] = "UDP RSS support",
> >                 [41] = "Unicast VEP steering support",
> >                 [42] = "Multicast VEP steering support",
> > +               [43] = "VLAN Steering mechanism support",
> > +               [44] = "Steering according to EtherType support",
> > +               [45] = "WQE format version 1 support",
> > +               [46] = "Keep Alive Validiation support",
> > +               [47] = "PTP1588 support",
> >                 [48] = "Counters support",
> > +               [49] = "Advanced Counters support",
> > +               [50] = "Force Ethernet user priority from QPC support",
> > +               [51] = "RX Port Num check disabled",
> > +               [52] = "RSS on fragmented IP datagram support",
> > +               [55] = "Link Sensing support",
> > +               [56] = "Reliable Multicast support",
> > +               [57] = "Fast Drop support",
> > +               [58] = "Protected FMR support",
> >                 [53] = "Port ETS Scheduler support",
> >                 [55] = "Port link type sensing support",
> >                 [59] = "Port management change event support",
> > @@ -119,8 +146,9 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
> >
> >         mlx4_dbg(dev, "DEV_CAP flags:\n");
> >         for (i = 0; i < ARRAY_SIZE(fname); ++i)
> > -               if (fname[i] && (flags & (1LL << i)))
> > -                       mlx4_dbg(dev, "    %s\n", fname[i]);
> > +               if (fname[i])
> > +                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> > +                                '*' : ' ', fname[i]);
> >  }
> >
> >  static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> > @@ -144,8 +172,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> >         int i;
> >
> >         for (i = 0; i < ARRAY_SIZE(fname); ++i)
> > -               if (fname[i] && (flags & (1LL << i)))
> > -                       mlx4_dbg(dev, "    %s\n", fname[i]);
> > +               if (fname[i])
> > +                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> > +                                '*' : ' ', fname[i]);
> >  }
> >
> >  int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
> > --
> > 1.7.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts
       [not found] ` <1417996112-19060-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2014-12-09 17:55   ` Or Gerlitz
       [not found]     ` <CAJ3xEMgjP0V7h7mRTr84NLW3Rib-QLN8j0rbEk5_MRvORXbDMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2014-12-10 10:10   ` Matan Barak
  1 sibling, 1 reply; 17+ messages in thread
From: Or Gerlitz @ 2014-12-09 17:55 UTC (permalink / raw)
  To: Yuval Shaia; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Mon, Dec 8, 2014 at 1:48 AM, Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> 1. Add indication whether feature is supported or not.
> 2. Add descriptions of all features.
> Without this fix there is no way to tell if feature is not supported or that description is not exist.


The problem with this patch is that the current practice is to only
advertize a feature as a string in this table when **both** the driver
and the firmware support it.

We can make a fix here to add dumping for features which are currently
supported on that level but not dumped today (e.g WoL and such).

You can have a look on the MLX4_DEV_CAP_FLAG_ enum under
include/linux/mlx4/device.h to pick up such values (used by the driver
but aren't dumped as dev-caps)

Or.


>
> Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/net/ethernet/mellanox/mlx4/fw.c |   37 +++++++++++++++++++++++++++---
>  1 files changed, 33 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
> index 2e88a23..79ab326 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/fw.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
> @@ -91,7 +91,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>                 [ 8] = "P_Key violation counter",
>                 [ 9] = "Q_Key violation counter",
>                 [10] = "VMM",
> +               [11] = "Fibre Channel Protocol On Ethernet Ports support",
>                 [12] = "Dual Port Different Protocol (DPDP) support",
> +               [13] = "Raw Ethertype support",
> +               [14] = "Raw IPv6 support",
>                 [15] = "Big LSO headers",
>                 [16] = "MW support",
>                 [17] = "APM support",
> @@ -99,16 +102,40 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>                 [19] = "Raw multicast support",
>                 [20] = "Address vector port checking support",
>                 [21] = "UD multicast support",
> +               [22] = "UD IPv4 Multicast support",
>                 [24] = "Demand paging support",
>                 [25] = "Router support",
> +               [26] = "L2 Ethernet Multicast support",
> +               [28] = "Software parsing support for UD transport",
> +               [29] = "TCP checksum off-load support",
>                 [30] = "IBoE support",
> +               [31] = "FCoE T11 frame format support",
>                 [32] = "Unicast loopback support",
> +               [33] = "Multicast loopback support",
>                 [34] = "FCS header control",
> +               [35] = "Address Path ud_force_mgid support",
> +               [36] = "Header-Data Split support",
> +               [37] = "Wake On LAN support on port 1",
> +               [38] = "Wake On LAN support on port 2",
> +               [39] = "Fatal Warning Event upon a thermal warning condition",
>                 [38] = "Wake On LAN support",
>                 [40] = "UDP RSS support",
>                 [41] = "Unicast VEP steering support",
>                 [42] = "Multicast VEP steering support",
> +               [43] = "VLAN Steering mechanism support",
> +               [44] = "Steering according to EtherType support",
> +               [45] = "WQE format version 1 support",
> +               [46] = "Keep Alive Validiation support",
> +               [47] = "PTP1588 support",
>                 [48] = "Counters support",
> +               [49] = "Advanced Counters support",
> +               [50] = "Force Ethernet user priority from QPC support",
> +               [51] = "RX Port Num check disabled",
> +               [52] = "RSS on fragmented IP datagram support",
> +               [55] = "Link Sensing support",
> +               [56] = "Reliable Multicast support",
> +               [57] = "Fast Drop support",
> +               [58] = "Protected FMR support",
>                 [53] = "Port ETS Scheduler support",
>                 [55] = "Port link type sensing support",
>                 [59] = "Port management change event support",
> @@ -119,8 +146,9 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
>
>         mlx4_dbg(dev, "DEV_CAP flags:\n");
>         for (i = 0; i < ARRAY_SIZE(fname); ++i)
> -               if (fname[i] && (flags & (1LL << i)))
> -                       mlx4_dbg(dev, "    %s\n", fname[i]);
> +               if (fname[i])
> +                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> +                                '*' : ' ', fname[i]);
>  }
>
>  static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> @@ -144,8 +172,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
>         int i;
>
>         for (i = 0; i < ARRAY_SIZE(fname); ++i)
> -               if (fname[i] && (flags & (1LL << i)))
> -                       mlx4_dbg(dev, "    %s\n", fname[i]);
> +               if (fname[i])
> +                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> +                                '*' : ' ', fname[i]);
>  }
>
>  int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts
@ 2014-12-07 23:48 Yuval Shaia
       [not found] ` <1417996112-19060-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Yuval Shaia @ 2014-12-07 23:48 UTC (permalink / raw)
  To: yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA, linux-rdma-u79uwXL29TY76Z2rM5mHXA

1. Add indication whether feature is supported or not.
2. Add descriptions of all features.
Without this fix there is no way to tell if feature is not supported or that description is not exist.

Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
 drivers/net/ethernet/mellanox/mlx4/fw.c |   37 +++++++++++++++++++++++++++---
 1 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index 2e88a23..79ab326 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -91,7 +91,10 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 		[ 8] = "P_Key violation counter",
 		[ 9] = "Q_Key violation counter",
 		[10] = "VMM",
+		[11] = "Fibre Channel Protocol On Ethernet Ports support",
 		[12] = "Dual Port Different Protocol (DPDP) support",
+		[13] = "Raw Ethertype support",
+		[14] = "Raw IPv6 support",
 		[15] = "Big LSO headers",
 		[16] = "MW support",
 		[17] = "APM support",
@@ -99,16 +102,40 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 		[19] = "Raw multicast support",
 		[20] = "Address vector port checking support",
 		[21] = "UD multicast support",
+		[22] = "UD IPv4 Multicast support",
 		[24] = "Demand paging support",
 		[25] = "Router support",
+		[26] = "L2 Ethernet Multicast support",
+		[28] = "Software parsing support for UD transport",
+		[29] = "TCP checksum off-load support",
 		[30] = "IBoE support",
+		[31] = "FCoE T11 frame format support",
 		[32] = "Unicast loopback support",
+		[33] = "Multicast loopback support",
 		[34] = "FCS header control",
+		[35] = "Address Path ud_force_mgid support",
+		[36] = "Header-Data Split support",
+		[37] = "Wake On LAN support on port 1",
+		[38] = "Wake On LAN support on port 2",
+		[39] = "Fatal Warning Event upon a thermal warning condition",
 		[38] = "Wake On LAN support",
 		[40] = "UDP RSS support",
 		[41] = "Unicast VEP steering support",
 		[42] = "Multicast VEP steering support",
+		[43] = "VLAN Steering mechanism support",
+		[44] = "Steering according to EtherType support",
+		[45] = "WQE format version 1 support",
+		[46] = "Keep Alive Validiation support",
+		[47] = "PTP1588 support",
 		[48] = "Counters support",
+		[49] = "Advanced Counters support",
+		[50] = "Force Ethernet user priority from QPC support",
+		[51] = "RX Port Num check disabled",
+		[52] = "RSS on fragmented IP datagram support",
+		[55] = "Link Sensing support",
+		[56] = "Reliable Multicast support",
+		[57] = "Fast Drop support",
+		[58] = "Protected FMR support",
 		[53] = "Port ETS Scheduler support",
 		[55] = "Port link type sensing support",
 		[59] = "Port management change event support",
@@ -119,8 +146,9 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 
 	mlx4_dbg(dev, "DEV_CAP flags:\n");
 	for (i = 0; i < ARRAY_SIZE(fname); ++i)
-		if (fname[i] && (flags & (1LL << i)))
-			mlx4_dbg(dev, "    %s\n", fname[i]);
+		if (fname[i])
+			mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
+				 '*' : ' ', fname[i]);
 }
 
 static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
@@ -144,8 +172,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(fname); ++i)
-		if (fname[i] && (flags & (1LL << i)))
-			mlx4_dbg(dev, "    %s\n", fname[i]);
+		if (fname[i])
+			mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
+				 '*' : ' ', fname[i]);
 }
 
 int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-02-18  7:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 14:30 [PATCH] mlx4_core: Enhance device capabilities flags debug printouts Yuval Shaia
     [not found] ` <1422282623-3744-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-02-16 17:32   ` Yuval Shaia
2015-02-17 12:47     ` Matan Barak
     [not found]       ` <54E33847.5090001-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-02-18  7:12         ` Yuval Shaia
  -- strict thread matches above, loose matches on Subject: below --
2015-01-27  7:45 Yuval Shaia
2014-12-14 19:18 Yuval Shaia
2014-12-07 23:48 [PATCH ] " Yuval Shaia
     [not found] ` <1417996112-19060-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2014-12-09 17:55   ` Or Gerlitz
     [not found]     ` <CAJ3xEMgjP0V7h7mRTr84NLW3Rib-QLN8j0rbEk5_MRvORXbDMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-10  8:25       ` Yuval Shaia
2014-12-10 10:10   ` Matan Barak
     [not found]     ` <54881BFF.2030008-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-12-15  9:21       ` Yuval Shaia
2014-12-15  9:35         ` Or Gerlitz
     [not found]           ` <CAJ3xEMght7jLakWzDOHvqTT_gNSqJJHAjLu_F6gD0j+=Narqmg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-15 12:25             ` Yuval Shaia
2014-12-15 16:14               ` Or Gerlitz
     [not found]                 ` <CAJ3xEMhespfjA1Epf6qS0wFf_a1wxSODg4L7tpLzAaNpnXiO8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-25 10:20                   ` Yuval Shaia
2015-01-29 12:17                   ` Yuval Shaia
2015-01-25 10:36             ` Yuval Shaia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.