]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: core: allow 4-byte aligned accesses to Memory Units
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 22 May 2018 05:12:46 +0000 (22:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 May 2018 18:26:18 +0000 (14:26 -0400)
commit50f9b227df92f76f746179eb706a92289690ed76
treee1108b1a400ec293164b59016f596086fe3e19ba
parentc732869c7b527d4d3a8a48789ba1d45f9240e0e6
nfp: core: allow 4-byte aligned accesses to Memory Units

Current code doesn't enforce length requirements on 32bit accesses
with action NFP_CPP_ACTION_RW to memory units, but if the access
is only aligned to 4 bytes as well we will fall into the explicit
access case and error out.  Such accesses are correct, allow them
by lowering the width earlier.

While at it use a switch statement to improve readability.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c