All of lore.kernel.org
 help / color / mirror / Atom feed
From: tndave <tushar.n.dave@oracle.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] i40e: Kernel unaligned access due to 'struct i40e_dma_mem' being 'packed'
Date: Wed, 27 Jan 2016 17:50:14 -0800	[thread overview]
Message-ID: <56A973D6.4060202@oracle.com> (raw)

Hi,

i40e driver has 'struct i40e_dma_mem' defined with 'packed' directive
causing kernel unaligned errors on sparc (when 40e_allocate_dma_mem_d()
is being called)

log_unaligned: 1031 callbacks suppressed
Kernel unaligned access at TPC[448ae8] dma_4v_alloc_coherent+0x188/0x2e0
Kernel unaligned access at TPC[448ae8] dma_4v_alloc_coherent+0x188/0x2e0
Kernel unaligned access at TPC[448ae8] dma_4v_alloc_coherent+0x188/0x2e0
Kernel unaligned access at TPC[448ae8] dma_4v_alloc_coherent+0x188/0x2e0

This can be fixed with get_unaligned/put_unaligned(). However I don't
see 'struct i40e_dma_mem' is being directly shoved into NIC hardware.
But instead fields of the struct are being read and used for hardware
(e.g. dma_addr_t pa). For the test, I remove __packed, and i40e driver
and HW works fine. (of course kernel unaligned errors are gone too).
My question is, does 'struct i40e_dma_mem' required to be __packed?

Thanks.

-Tushar

WARNING: multiple messages have this Message-ID (diff)
From: tndave <tushar.n.dave@oracle.com>
To: netdev@vger.kernel.org, "Kirsher,
	Jeffrey T" <jeffrey.t.kirsher@intel.com>,
	"Brandeburg, Jesse" <jesse.brandeburg@intel.com>,
	"Nelson, Shannon" <shannon.nelson@intel.com>,
	"Wyborny, Carolyn" <carolyn.wyborny@intel.com>,
	"Skidmore, Donald C" <donald.c.skidmore@intel.com>,
	"Allan, Bruce W" <bruce.w.allan@intel.com>,
	"Ronciak, John" <john.ronciak@intel.com>,
	mitch.a.williams@intel.com, intel-wired-lan@lists.osuosl.org
Cc: tushar.n.dave@oracle.com
Subject: i40e: Kernel unaligned access due to 'struct i40e_dma_mem' being 'packed'
Date: Wed, 27 Jan 2016 17:50:14 -0800	[thread overview]
Message-ID: <56A973D6.4060202@oracle.com> (raw)

Hi,

i40e driver has 'struct i40e_dma_mem' defined with 'packed' directive
causing kernel unaligned errors on sparc (when 40e_allocate_dma_mem_d()
is being called)

log_unaligned: 1031 callbacks suppressed
Kernel unaligned access at TPC[448ae8] dma_4v_alloc_coherent+0x188/0x2e0
Kernel unaligned access at TPC[448ae8] dma_4v_alloc_coherent+0x188/0x2e0
Kernel unaligned access at TPC[448ae8] dma_4v_alloc_coherent+0x188/0x2e0
Kernel unaligned access at TPC[448ae8] dma_4v_alloc_coherent+0x188/0x2e0

This can be fixed with get_unaligned/put_unaligned(). However I don't
see 'struct i40e_dma_mem' is being directly shoved into NIC hardware.
But instead fields of the struct are being read and used for hardware
(e.g. dma_addr_t pa). For the test, I remove __packed, and i40e driver
and HW works fine. (of course kernel unaligned errors are gone too).
My question is, does 'struct i40e_dma_mem' required to be __packed?

Thanks.

-Tushar

             reply	other threads:[~2016-01-28  1:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28  1:50 tndave [this message]
2016-01-28  1:50 ` i40e: Kernel unaligned access due to 'struct i40e_dma_mem' being 'packed' tndave
2016-01-28  6:56 ` [Intel-wired-lan] " David Miller
2016-01-28  6:56   ` David Miller
2016-01-29 22:47   ` [Intel-wired-lan] " tndave
2016-01-29 22:47     ` tndave
2016-02-14  0:22     ` [Intel-wired-lan] " tndave
2016-02-14  0:22       ` tndave

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=56A973D6.4060202@oracle.com \
    --to=tushar.n.dave@oracle.com \
    --cc=intel-wired-lan@osuosl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.