All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] net/ena: Fix build warning in ena_xdp_set()
@ 2020-04-28  4:49 Gavin Shan
  2020-04-28 14:55 ` Agroskin, Shay
  2020-04-28 20:58 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Gavin Shan @ 2020-04-28  4:49 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, netanel, akiyano, gtzalik, davem, gshan, shan.gavin

This fixes the following build warning in ena_xdp_set(), which is
observed on aarch64 with 64KB page size.

   In file included from ./include/net/inet_sock.h:19,
      from ./include/net/ip.h:27,
      from drivers/net/ethernet/amazon/ena/ena_netdev.c:46:
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function         \
   ‘ena_xdp_set’:                                                    \
   drivers/net/ethernet/amazon/ena/ena_netdev.c:557:6: warning:      \
   format ‘%lu’                                                      \
   expects argument of type ‘long unsigned int’, but argument 4      \
   has type ‘int’                                                    \
   [-Wformat=] "Failed to set xdp program, the current MTU (%d) is   \
   larger than the maximum allowed MTU (%lu) while xdp is on",

Signed-off-by: Gavin Shan <gshan@redhat.com>
---
v2: Make ENA_PAGE_SIZE to be "unsigned long" and verify on aarch64
    with 4KB or 64KB page size configuration
---
 drivers/net/ethernet/amazon/ena/ena_netdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h
index 97dfd0c67e84..9e1860d81908 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.h
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.h
@@ -69,7 +69,7 @@
  * 16kB.
  */
 #if PAGE_SIZE > SZ_16K
-#define ENA_PAGE_SIZE SZ_16K
+#define ENA_PAGE_SIZE (_AC(SZ_16K, UL))
 #else
 #define ENA_PAGE_SIZE PAGE_SIZE
 #endif
-- 
2.23.0


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

* Re: [PATCH v2] net/ena: Fix build warning in ena_xdp_set()
  2020-04-28  4:49 [PATCH v2] net/ena: Fix build warning in ena_xdp_set() Gavin Shan
@ 2020-04-28 14:55 ` Agroskin, Shay
  2020-04-28 20:58 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Agroskin, Shay @ 2020-04-28 14:55 UTC (permalink / raw)
  To: Gavin Shan
  Cc: netdev, linux-kernel, Belgazal, Netanel, Kiyanovski, Arthur,
	Tzalik, Guy, davem, shan.gavin, agrosshay


Gavin Shan <gshan@redhat.com> writes:

> This fixes the following build warning in ena_xdp_set(), which is
> observed on aarch64 with 64KB page size.
>
>    In file included from ./include/net/inet_sock.h:19,
>       from ./include/net/ip.h:27,
>       from drivers/net/ethernet/amazon/ena/ena_netdev.c:46:
>    drivers/net/ethernet/amazon/ena/ena_netdev.c: In function         \
>    ‘ena_xdp_set’:                                                    \
>    drivers/net/ethernet/amazon/ena/ena_netdev.c:557:6: warning:      \
>    format ‘%lu’                                                      \
>    expects argument of type ‘long unsigned int’, but argument 4      \
>    has type ‘int’                                                    \
>    [-Wformat=] "Failed to set xdp program, the current MTU (%d) is   \
>    larger than the maximum allowed MTU (%lu) while xdp is on",
>
> Signed-off-by: Gavin Shan <gshan@redhat.com>
> ---
> v2: Make ENA_PAGE_SIZE to be "unsigned long" and verify on aarch64
>     with 4KB or 64KB page size configuration
> ---
>  drivers/net/ethernet/amazon/ena/ena_netdev.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h
> index 97dfd0c67e84..9e1860d81908 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.h
> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.h
> @@ -69,7 +69,7 @@
>   * 16kB.
>   */
>  #if PAGE_SIZE > SZ_16K
> -#define ENA_PAGE_SIZE SZ_16K
> +#define ENA_PAGE_SIZE (_AC(SZ_16K, UL))
>  #else
>  #define ENA_PAGE_SIZE PAGE_SIZE
>  #endif

thanks for this fix

Acked-by: Shay Agroskin <shayagr@amazon.com>

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

* Re: [PATCH v2] net/ena: Fix build warning in ena_xdp_set()
  2020-04-28  4:49 [PATCH v2] net/ena: Fix build warning in ena_xdp_set() Gavin Shan
  2020-04-28 14:55 ` Agroskin, Shay
@ 2020-04-28 20:58 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-04-28 20:58 UTC (permalink / raw)
  To: gshan; +Cc: netdev, linux-kernel, netanel, akiyano, gtzalik, shan.gavin

From: Gavin Shan <gshan@redhat.com>
Date: Tue, 28 Apr 2020 14:49:45 +1000

> This fixes the following build warning in ena_xdp_set(), which is
> observed on aarch64 with 64KB page size.
> 
>    In file included from ./include/net/inet_sock.h:19,
>       from ./include/net/ip.h:27,
>       from drivers/net/ethernet/amazon/ena/ena_netdev.c:46:
>    drivers/net/ethernet/amazon/ena/ena_netdev.c: In function         \
>    ‘ena_xdp_set’:                                                    \
>    drivers/net/ethernet/amazon/ena/ena_netdev.c:557:6: warning:      \
>    format ‘%lu’                                                      \
>    expects argument of type ‘long unsigned int’, but argument 4      \
>    has type ‘int’                                                    \
>    [-Wformat=] "Failed to set xdp program, the current MTU (%d) is   \
>    larger than the maximum allowed MTU (%lu) while xdp is on",
> 
> Signed-off-by: Gavin Shan <gshan@redhat.com>
> ---
> v2: Make ENA_PAGE_SIZE to be "unsigned long" and verify on aarch64
>     with 4KB or 64KB page size configuration

Applied, thank you.

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

end of thread, other threads:[~2020-04-28 20:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28  4:49 [PATCH v2] net/ena: Fix build warning in ena_xdp_set() Gavin Shan
2020-04-28 14:55 ` Agroskin, Shay
2020-04-28 20:58 ` David Miller

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.