netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ethernet/sfc/ warnings with 32-bit dma_addr_t
@ 2020-08-19  0:28 Randy Dunlap
  2020-08-19 10:37 ` Edward Cree
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2020-08-19  0:28 UTC (permalink / raw)
  To: netdev@vger.kernel.org
  Cc: Michael Brown, Solarflare linux maintainers, Edward Cree,
	Martin Habets

Hi,

Does the drivers/net/ethernet/sfc/sfc driver require (expect)
dma_addr_t to be 64 bits (as opposed to 32 bits)?

I see that several #defines in ef100_regs.h are 64...

When used with DMA_BIT_MASK(64), does the value just need to be
truncated to 32 bits?  Will that work?


When I build this driver on i386 with 32-bit dma_addr_t, I see
the following build warnings:


  CC      drivers/net/ethernet/sfc/ef100.o
In file included from ../include/linux/skbuff.h:31:0,
                 from ../include/linux/if_ether.h:19,
                 from ../include/uapi/linux/ethtool.h:19,
                 from ../include/linux/ethtool.h:18,
                 from ../include/linux/netdevice.h:37,
                 from ../drivers/net/ethernet/sfc/net_driver.h:13,
                 from ../drivers/net/ethernet/sfc/ef100.c:12:
../drivers/net/ethernet/sfc/ef100.c: In function ‘ef100_pci_parse_continue_entry’:
../include/linux/dma-mapping.h:139:25: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                         ^
../drivers/net/ethernet/sfc/ef100.c:145:6: note: in expansion of macro ‘DMA_BIT_MASK’
      DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
      ^~~~~~~~~~~~
../include/linux/dma-mapping.h:139:25: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                         ^
../drivers/net/ethernet/sfc/ef100.c:163:6: note: in expansion of macro ‘DMA_BIT_MASK’
      DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
      ^~~~~~~~~~~~
../drivers/net/ethernet/sfc/ef100.c: In function ‘ef100_pci_parse_xilinx_cap’:
../include/linux/dma-mapping.h:139:25: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                         ^
../drivers/net/ethernet/sfc/ef100.c:337:5: note: in expansion of macro ‘DMA_BIT_MASK’
     DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
     ^~~~~~~~~~~~
../drivers/net/ethernet/sfc/ef100.c: In function ‘ef100_pci_probe’:
../include/linux/dma-mapping.h:139:25: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                         ^
../drivers/net/ethernet/sfc/ef100.c:498:5: note: in expansion of macro ‘DMA_BIT_MASK’
     DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
     ^~~~~~~~~~~~


thanks.
-- 
~Randy


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-19 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-19  0:28 ethernet/sfc/ warnings with 32-bit dma_addr_t Randy Dunlap
2020-08-19 10:37 ` Edward Cree
2020-08-19 14:51   ` Christoph Hellwig
2020-08-19 14:57   ` Randy Dunlap

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).