From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: Jeff Squyres <jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] libibverbs: Allow arbitrary int values for MTU
Date: Thu, 20 Jun 2013 16:40:52 -0400 [thread overview]
Message-ID: <51C368D4.7020603@redhat.com> (raw)
In-Reply-To: <20130618184928.GE2204-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
On 06/18/2013 02:49 PM, Jason Gunthorpe wrote:
> This is simpler:
>
> {
> static char str[16];
> snprintf(str, sizeof(str), "%d", ibv_mtu_to_num(max_mtu));
> return str;
> }
That is not, however, multi-thread safe nor advisable unless you clearly
indicate in the man page to the function that subsequent calls to the
function wipe out the result of previous calls. It's not even single
thread safe if you have more than one interface and don't know that
later calls wipe this buffer out. Best to avoid library routines such
as this.
--
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
next prev parent reply other threads:[~2013-06-20 20:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-17 21:00 [PATCH] libibverbs: Allow arbitrary int values for MTU Jeff Squyres
[not found] ` <1371502807-17026-1-git-send-email-jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2013-06-18 18:49 ` Jason Gunthorpe
[not found] ` <20130618184928.GE2204-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-06-20 13:48 ` Jeff Squyres (jsquyres)
[not found] ` <EF66BBEB19BADC41AC8CCF5F684F07FC4F6939C5-nsZYYkk5h5QQ2GdVW7+PtKBKnGwkPULj@public.gmane.org>
2013-06-20 17:09 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A823736FD358BC-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-06-20 20:02 ` Jeff Squyres (jsquyres)
2013-06-20 20:40 ` Doug Ledford [this message]
[not found] ` <51C368D4.7020603-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-06-20 20:50 ` Jeff Squyres (jsquyres)
-- strict thread matches above, loose matches on Subject: below --
2013-07-01 14:23 Jeff Squyres
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51C368D4.7020603@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox