diff mbox

IB core sysfs: Add port_xmit_wait_counter V2

Message ID alpine.DEB.2.20.1607071231550.20276@east.gentwo.org (mailing list archive)
State Superseded
Headers show

Commit Message

Christoph Lameter (Ampere) July 7, 2016, 5:36 p.m. UTC
V1->V2
- Tested. Found that we missed modifying one table.


Add the missing port_xmit_wait counter. This counter is displayed through
some tools like perfquery but is not available via sysfs.

For the PORT_PMA_ATTR macro the _counter field is set to zero
allowing us to specify the offset directly like with PORT_PMA_ATTR_EXT

See also the earlier work in 2008 by Vladimir Skolovsky

https://www.mail-archive.com/general@lists.openfabrics.org/msg20313.html

Tested-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Christoph Lameter <cl@linux.com>

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

Comments

Hal Rosenstock July 8, 2016, 2:08 p.m. UTC | #1
On 7/7/2016 1:36 PM, Christoph Lameter wrote:
> 
> V1->V2
> - Tested. Found that we missed modifying one table.
> 
> 
> Add the missing port_xmit_wait counter. This counter is displayed through
> some tools like perfquery but is not available via sysfs.
> 
> For the PORT_PMA_ATTR macro the _counter field is set to zero
> allowing us to specify the offset directly like with PORT_PMA_ATTR_EXT

I'm not following the relationship of _counter field to the offset other
than they are combined in the index and then I don't see counter part of
index ever being used. So it looks to me like _counter can be
deprecated/removed which is what Roland wrote in the thread you
referenced below.

> 
> See also the earlier work in 2008 by Vladimir Skolovsky
> 
> https://www.mail-archive.com/general@lists.openfabrics.org/msg20313.html
> 
> Tested-by: Christoph Lameter <cl@linux.com>
> Signed-off-by: Christoph Lameter <cl@linux.com>

Reviewed-by: Hal Rosenstock <hal@mellanox.com>

> 
> Index: rh73alpha/drivers/infiniband/core/sysfs.c
> ===================================================================
> --- rh73alpha.orig/drivers/infiniband/core/sysfs.c
> +++ rh73alpha/drivers/infiniband/core/sysfs.c
> @@ -530,6 +530,7 @@ static PORT_PMA_ATTR(port_xmit_data
>  static PORT_PMA_ATTR(port_rcv_data		    , 13, 32, 224);
>  static PORT_PMA_ATTR(port_xmit_packets		    , 14, 32, 256);
>  static PORT_PMA_ATTR(port_rcv_packets		    , 15, 32, 288);
> +static PORT_PMA_ATTR(port_xmit_wait		    ,  0, 32, 320);
> 
>  /*
>   * Counters added by extended set
> @@ -560,6 +561,7 @@ static struct attribute *pma_attrs[] = {
>  	&port_pma_attr_port_rcv_data.attr.attr,
>  	&port_pma_attr_port_xmit_packets.attr.attr,
>  	&port_pma_attr_port_rcv_packets.attr.attr,
> +	&port_pma_attr_port_xmit_wait.attr.attr,
>  	NULL
>  };
> 
> @@ -579,6 +581,7 @@ static struct attribute *pma_attrs_ext[]
>  	&port_pma_attr_ext_port_xmit_data.attr.attr,
>  	&port_pma_attr_ext_port_rcv_data.attr.attr,
>  	&port_pma_attr_ext_port_xmit_packets.attr.attr,
> +	&port_pma_attr_port_xmit_wait.attr.attr,
>  	&port_pma_attr_ext_port_rcv_packets.attr.attr,
>  	&port_pma_attr_ext_unicast_rcv_packets.attr.attr,
>  	&port_pma_attr_ext_unicast_xmit_packets.attr.attr,
> @@ -604,6 +607,7 @@ static struct attribute *pma_attrs_noiet
>  	&port_pma_attr_ext_port_rcv_data.attr.attr,
>  	&port_pma_attr_ext_port_xmit_packets.attr.attr,
>  	&port_pma_attr_ext_port_rcv_packets.attr.attr,
> +	&port_pma_attr_port_xmit_wait.attr.attr,
>  	NULL
>  };
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Lameter (Ampere) July 8, 2016, 2:12 p.m. UTC | #2
On Fri, 8 Jul 2016, Hal Rosenstock wrote:

> I'm not following the relationship of _counter field to the offset other
> than they are combined in the index and then I don't see counter part of
> index ever being used. So it looks to me like _counter can be
> deprecated/removed which is what Roland wrote in the thread you
> referenced below.

Yup. I think so too. But the rest of the discussion refers to some bit
that correlates with _counter. There may be something I missed.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hal Rosenstock July 8, 2016, 2:36 p.m. UTC | #3
On 7/8/2016 10:12 AM, Christoph Lameter wrote:
> On Fri, 8 Jul 2016, Hal Rosenstock wrote:
> 
>> I'm not following the relationship of _counter field to the offset other
>> than they are combined in the index and then I don't see counter part of
>> index ever being used. So it looks to me like _counter can be
>> deprecated/removed which is what Roland wrote in the thread you
>> referenced below.
> 
> Yup. I think so too. But the rest of the discussion refers to some bit
> that correlates with _counter. There may be something I missed.

Didn't that have to do with set counter ? There is no set counter
support and it seems unlikely to me that it would be added in as this
needs to be done on "manager" and not agent/client side.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Leon Romanovsky July 8, 2016, 2:58 p.m. UTC | #4
On Thu, Jul 07, 2016 at 12:36:00PM -0500, Christoph Lameter wrote:
> 
> V1->V2
> - Tested. Found that we missed modifying one table.
> 
> 
> Add the missing port_xmit_wait counter. This counter is displayed through
> some tools like perfquery but is not available via sysfs.
> 
> For the PORT_PMA_ATTR macro the _counter field is set to zero
> allowing us to specify the offset directly like with PORT_PMA_ATTR_EXT
> 
> See also the earlier work in 2008 by Vladimir Skolovsky
> 
> https://www.mail-archive.com/general@lists.openfabrics.org/msg20313.html
> 
> Tested-by: Christoph Lameter <cl@linux.com>
> Signed-off-by: Christoph Lameter <cl@linux.com>

Hi Christoph,
Do you mind to improve the commit message a little bit?
1. Put versioning in [PATCH] section - {PATCH v3]. It will give clean
subject line in git history.
2. Put changelog after "---" line at the end of commit message.
3. Add Vlad's SOB (Signed-off-by: Vlad Sokolovsky <vlad@mellanox.com>).
4. Remove your Tested-by line, it goes without saying.
5. Change title to format used in this subsystem - IB/core: Add ....

Thanks
diff mbox

Patch

Index: rh73alpha/drivers/infiniband/core/sysfs.c
===================================================================
--- rh73alpha.orig/drivers/infiniband/core/sysfs.c
+++ rh73alpha/drivers/infiniband/core/sysfs.c
@@ -530,6 +530,7 @@  static PORT_PMA_ATTR(port_xmit_data
 static PORT_PMA_ATTR(port_rcv_data		    , 13, 32, 224);
 static PORT_PMA_ATTR(port_xmit_packets		    , 14, 32, 256);
 static PORT_PMA_ATTR(port_rcv_packets		    , 15, 32, 288);
+static PORT_PMA_ATTR(port_xmit_wait		    ,  0, 32, 320);

 /*
  * Counters added by extended set
@@ -560,6 +561,7 @@  static struct attribute *pma_attrs[] = {
 	&port_pma_attr_port_rcv_data.attr.attr,
 	&port_pma_attr_port_xmit_packets.attr.attr,
 	&port_pma_attr_port_rcv_packets.attr.attr,
+	&port_pma_attr_port_xmit_wait.attr.attr,
 	NULL
 };

@@ -579,6 +581,7 @@  static struct attribute *pma_attrs_ext[]
 	&port_pma_attr_ext_port_xmit_data.attr.attr,
 	&port_pma_attr_ext_port_rcv_data.attr.attr,
 	&port_pma_attr_ext_port_xmit_packets.attr.attr,
+	&port_pma_attr_port_xmit_wait.attr.attr,
 	&port_pma_attr_ext_port_rcv_packets.attr.attr,
 	&port_pma_attr_ext_unicast_rcv_packets.attr.attr,
 	&port_pma_attr_ext_unicast_xmit_packets.attr.attr,
@@ -604,6 +607,7 @@  static struct attribute *pma_attrs_noiet
 	&port_pma_attr_ext_port_rcv_data.attr.attr,
 	&port_pma_attr_ext_port_xmit_packets.attr.attr,
 	&port_pma_attr_ext_port_rcv_packets.attr.attr,
+	&port_pma_attr_port_xmit_wait.attr.attr,
 	NULL
 };