netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: saeedm@mellanox.com
Cc: netdev@vger.kernel.org, ogerlitz@mellanox.com,
	eranbe@mellanox.com, talal@mellanox.com, majd@mellanox.com,
	moshel@mellanox.com
Subject: Re: [PATCH net-next V1 09/10] net/mlx5: Fix global UAR mapping
Date: Sun, 28 Feb 2016 23:28:04 -0500 (EST)	[thread overview]
Message-ID: <20160228.232804.1263072658789063316.davem@davemloft.net> (raw)
In-Reply-To: <1456672151-11749-10-git-send-email-saeedm@mellanox.com>

From: Saeed Mahameed <saeedm@mellanox.com>
Date: Sun, 28 Feb 2016 17:09:10 +0200

> We use ARCH_HAS_IOREMAP_WC to know if the current arch supports WC
> (Write combining) IO memory mapping, if it is not supported
> "uar->bf_map" will be NULL, thus we will use NC (Non Cached) mapping
> "uar->map".

This description sucks.

You're just saying what will happen if the CPP is defined or not
(uar->bf_map ends up being NULL).

Well anyone can see that from the code.

You have to explain why.

And BTW, ARCH_HAS_IOREMAP_WC doesn't even tell you if the platform
will actually give you a write-combining mapping.

So if it's the driver operates properly if a non-WC mapping is used
for uar->bf_map, then get rid of this CPP test altogether PLEASE!

Otherwise your driver is buggy, because ARCH_HAS_IOREMAP_WC only says
whether the default implementation of ioremap_wc() needs to be
provided by include/asm-generic/iomap.h It does not guarantee that a
write-combining mapping will be provided.

I really can't think of any reason why you absolutely require a
WC mapping, and the CPP test just makes your driver look more
ugly than it needs to me.

So can you please explain what the hell is happening here and why you
are doing things this way rather than just reading the code to me?

Thanks.

  reply	other threads:[~2016-02-29  4:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-28 15:09 [PATCH net-next V1 00/10] mlx5 driver updates Saeed Mahameed
2016-02-28 15:09 ` [PATCH net-next V1 01/10] net/mlx5e: Replace async events spinlock with synchronize_irq() Saeed Mahameed
2016-02-28 15:09 ` [PATCH net-next V1 02/10] net/mlx5e: Placement changed for carrier state updates Saeed Mahameed
2016-02-28 15:09 ` [PATCH net-next V1 03/10] net/mlx5e: Changed naming convention of tx queues in ethtool stats Saeed Mahameed
2016-02-28 15:09 ` [PATCH net-next V1 04/10] net/mlx5e: Move common case counters within sq_stats struct Saeed Mahameed
2016-02-28 15:09 ` [PATCH net-next V1 05/10] net/mlx5e: Set drop RQ's necessary parameters only Saeed Mahameed
2016-02-28 15:09 ` [PATCH net-next V1 06/10] net/mlx5e: Don't try to modify CQ moderation if it is not supported Saeed Mahameed
2016-02-28 15:09 ` [PATCH net-next V1 07/10] net/mlx5e: Don't modify CQ before it was created Saeed Mahameed
2016-02-28 15:09 ` [PATCH net-next V1 08/10] net/mlx5: Make command timeout way shorter Saeed Mahameed
2016-02-28 15:09 ` [PATCH net-next V1 09/10] net/mlx5: Fix global UAR mapping Saeed Mahameed
2016-02-29  4:28   ` David Miller [this message]
2016-02-29 19:41     ` Saeed Mahameed
2016-02-28 15:09 ` [PATCH net-next V1 10/10] net/mlx5: Avoid double mapping of io mapped memory Saeed Mahameed

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=20160228.232804.1263072658789063316.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eranbe@mellanox.com \
    --cc=majd@mellanox.com \
    --cc=moshel@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=saeedm@mellanox.com \
    --cc=talal@mellanox.com \
    /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).