linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David.Laight@ACULAB.COM" <David.Laight@ACULAB.COM>,
	"arnd@arndb.de" <arnd@arndb.de>
Cc: "cai@lca.pw" <cai@lca.pw>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Moshe Shemesh <moshe@mellanox.com>,
	Feras Daoud <ferasda@mellanox.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Eran Ben Elisha <eranbe@mellanox.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"leon@kernel.org" <leon@kernel.org>,
	Erez Shitrit <erezsh@mellanox.com>
Subject: Re: [PATCH] net/mlx5: reduce stack usage in FW tracer
Date: Tue, 10 Sep 2019 19:13:04 +0000	[thread overview]
Message-ID: <005fe3efd5ce73ed0179cec8d743362ef0fd4f85.camel@mellanox.com> (raw)
In-Reply-To: <d50f78334e64476bad033862035c734c@AcuMS.aculab.com>

On Tue, 2019-09-10 at 15:38 +0000, David Laight wrote:
> From: Arnd Bergmann
> > Sent: 10 September 2019 09:15
> ...
> > > I am not sure how this would work, since the format parameters
> > > can
> > > changes depending on the FW string and the specific traces.
> > 
> > Ah, so the format string comes from the firmware? I didn't look
> > at the code in enough detail to understand why it's done like this,
> > only enough to notice that it's rather unusual.
> 
> If the format string comes from the firmware you really shouldn't
> pass it to any standard printf function.
> You must ensure that it doesn't contain any format effectors
> that might dereference parameters.
> (The code might try to do that.)
> 
> Given that 'pointer' format effectors can't be used, the firmware
> must also supply the relevant integer ones?
> This should mean that all the processing is deferrable until the
> trace record is read.
> 

Point taken, i will discuss this with the team next week, since i am
traveling this week. and we will provide a proper solution. for now,
off the top of my head, FW strings and parameters are well defined and
very simple, many of the problems here do not apply, but will verify.

> 'noinline' just papers over the cracks.
> Especially since vasprintf() is likely to use a lot of stack.

Right i also tend to agree with noinline as a temporary solution until
we address all the points provided here.

> 
> 	David
> 
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes,
> MK1 1PT, UK
> Registration No: 1397386 (Wales)

      reply	other threads:[~2019-09-10 19:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 15:11 [PATCH] net/mlx5: reduce stack usage in FW tracer Arnd Bergmann
2019-09-09 19:39 ` Saeed Mahameed
2019-09-09 20:18   ` Arnd Bergmann
2019-09-09 21:53     ` Saeed Mahameed
2019-09-10  8:14       ` Arnd Bergmann
2019-09-10 15:38         ` David Laight
2019-09-10 19:13           ` Saeed Mahameed [this message]

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=005fe3efd5ce73ed0179cec8d743362ef0fd4f85.camel@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=arnd@arndb.de \
    --cc=cai@lca.pw \
    --cc=davem@davemloft.net \
    --cc=eranbe@mellanox.com \
    --cc=erezsh@mellanox.com \
    --cc=ferasda@mellanox.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=moshe@mellanox.com \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).