linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH libibverbs] init.c: increase sysfs read buffer size to 16
@ 2015-12-03 23:09 Jeff Squyres
       [not found] ` <1449184181-25676-1-git-send-email-jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Squyres @ 2015-12-03 23:09 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Jeff Squyres, Xuyang Wang

The default value of 8 is too small to read
/sys/class/infiniband/usnic_x/node_type, which contains "6: usNIC
UDP".  Per a7a73a8c1b39362f1701256bc772d82847832f9c, the too-small
buffer causes a stderr warning to be emitted from ibv_devinfo when
reading usNIC devices.

This commit therefore increases the buffer size to 16, which is long
enough to read the usNIC node_type value.

Signed-off-by: Jeff Squyres <jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Xuyang Wang <xuywang-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
---
 src/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/init.c b/src/init.c
index dbdd795..ef78871 100644
--- a/src/init.c
+++ b/src/init.c
@@ -351,7 +351,7 @@ static struct ibv_device *try_driver(struct ibv_driver *driver,
 {
 	struct verbs_device *vdev;
 	struct ibv_device *dev;
-	char value[8];
+	char value[16];
 
 	if (driver->init_func) {
 		dev = driver->init_func(sysfs_dev->sysfs_path, sysfs_dev->abi_ver);
-- 
2.4.3

--
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] 4+ messages in thread

* Re: [PATCH libibverbs] init.c: increase sysfs read buffer size to 16
       [not found] ` <1449184181-25676-1-git-send-email-jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
@ 2015-12-07 13:27   ` Haggai Eran
       [not found]     ` <56658940.5040506-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Haggai Eran @ 2015-12-07 13:27 UTC (permalink / raw)
  To: Jeff Squyres, linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Xuyang Wang

On 12/04/2015 01:09 AM, Jeff Squyres wrote:
> The default value of 8 is too small to read
> /sys/class/infiniband/usnic_x/node_type, which contains "6: usNIC
> UDP".  Per a7a73a8c1b39362f1701256bc772d82847832f9c, the too-small
> buffer causes a stderr warning to be emitted from ibv_devinfo when
> reading usNIC devices.
> 
> This commit therefore increases the buffer size to 16, which is long
> enough to read the usNIC node_type value.

Reviewed-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
--
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] 4+ messages in thread

* Re: [PATCH libibverbs] init.c: increase sysfs read buffer size to 16
       [not found]     ` <56658940.5040506-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2015-12-09 15:05       ` Jeff Squyres (jsquyres)
       [not found]         ` <8CCFAB20-21D8-4915-98C6-3DE6130BF389-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Squyres (jsquyres) @ 2015-12-09 15:05 UTC (permalink / raw)
  To: Haggai Eran
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Xuyang Wang (xuywang)

Any further comments on this?

Doug -- does it look ok to you?


> On Dec 7, 2015, at 5:27 AM, Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
> 
> On 12/04/2015 01:09 AM, Jeff Squyres wrote:
>> The default value of 8 is too small to read
>> /sys/class/infiniband/usnic_x/node_type, which contains "6: usNIC
>> UDP".  Per a7a73a8c1b39362f1701256bc772d82847832f9c, the too-small
>> buffer causes a stderr warning to be emitted from ibv_devinfo when
>> reading usNIC devices.
>> 
>> This commit therefore increases the buffer size to 16, which is long
>> enough to read the usNIC node_type value.
> 
> Reviewed-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>


-- 
Jeff Squyres
jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/

--
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] 4+ messages in thread

* Re: [PATCH libibverbs] init.c: increase sysfs read buffer size to 16
       [not found]         ` <8CCFAB20-21D8-4915-98C6-3DE6130BF389-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
@ 2015-12-09 21:36           ` Doug Ledford
  0 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2015-12-09 21:36 UTC (permalink / raw)
  To: Jeff Squyres (jsquyres), Haggai Eran
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Xuyang Wang (xuywang)

[-- Attachment #1: Type: text/plain, Size: 962 bytes --]

On 12/09/2015 10:05 AM, Jeff Squyres (jsquyres) wrote:
> Any further comments on this?
> 
> Doug -- does it look ok to you?
> 
> 
>> On Dec 7, 2015, at 5:27 AM, Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
>>
>> On 12/04/2015 01:09 AM, Jeff Squyres wrote:
>>> The default value of 8 is too small to read
>>> /sys/class/infiniband/usnic_x/node_type, which contains "6: usNIC
>>> UDP".  Per a7a73a8c1b39362f1701256bc772d82847832f9c, the too-small
>>> buffer causes a stderr warning to be emitted from ibv_devinfo when
>>> reading usNIC devices.
>>>
>>> This commit therefore increases the buffer size to 16, which is long
>>> enough to read the usNIC node_type value.
>>
>> Reviewed-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> 

Yeah, looks fine to me.  I'll pull it in shortly.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

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

end of thread, other threads:[~2015-12-09 21:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-03 23:09 [PATCH libibverbs] init.c: increase sysfs read buffer size to 16 Jeff Squyres
     [not found] ` <1449184181-25676-1-git-send-email-jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2015-12-07 13:27   ` Haggai Eran
     [not found]     ` <56658940.5040506-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-09 15:05       ` Jeff Squyres (jsquyres)
     [not found]         ` <8CCFAB20-21D8-4915-98C6-3DE6130BF389-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2015-12-09 21:36           ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).