mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Honggang LI <honli@redhat.com>
To: Eli Cohen <eli@mellanox.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [linux-next PATCH] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures
Date: Mon, 13 Apr 2015 17:19:38 +0800	[thread overview]
Message-ID: <20150413091937.GA23372@honli.nay.redhat.com> (raw)
In-Reply-To: <DB4PR05MB448D41F0471F690E688F6BCC5E70@DB4PR05MB448.eurprd05.prod.outlook.com>

On Mon, Apr 13, 2015 at 06:47:11AM +0000, Eli Cohen wrote:
>  On Mon, Apr 13, 2015 at 08:33:33AM +0800, Honggang LI wrote:
> > 
> > Yes, replaced all of the PAGE_MASK in the file. Please see attched new
> > patch.
> > 
> 
> I think you need to send the new patch inline in your email.
> 

I will resent the patch.

> > > 
> > > @@ -241,7 +243,7 @@ static void free_4k(struct mlx5_core_dev *dev, u64 addr)  static int alloc_system_page(struct mlx5_core_dev *dev, u16 func_id)  {
> > >     struct page *page;
> > > -   u64 addr;
> > > +   u64 addr = 0; [Eli] Why is this required?
> > 
> > For 32bit architectures, if CONFIG_ARCH_DMA_ADDR_T_64BIT disabled and
> > physical memory is less than 4GB, dma_map_page will return an u32 integer 
> > less than 0xffff_ffff. And if addr had been initialized with random
> > rubbish in the stack of alloc_system_page, the high four bytes is
> > unpredictable. The new mask, MLX5_NUM_4K_IN_PAGE, will reserve the high
> > four bytes. So, free_4k/find_fw_page will randomly failed.
> > 
> 
> Sorry, I still don't understand the issue here. MLX5_NUM_4K_IN_PAGE is
> not a mask and will always get the correct value which is fairly
> small.

Sorry. It was a typo. It should be MLX5_U64_4K_PAGE_MASK.



      reply	other threads:[~2015-04-13  9:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-12 11:05 Honggang Li
2015-04-12 15:04 ` Eli Cohen
2015-04-13  0:33   ` Honggang LI
2015-04-13  6:47     ` Eli Cohen
2015-04-13  9:19       ` Honggang LI [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=20150413091937.GA23372@honli.nay.redhat.com \
    --to=honli@redhat.com \
    --cc=eli@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --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

Powered by JetHome