From: Jesse Brandeburg <jesse.brandeburg@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH] virtchnl: Add missing padding to virtchnl_proto_hdrs
Date: Wed, 19 May 2021 15:16:00 -0700 [thread overview]
Message-ID: <20210519151600.00006065@intel.com> (raw)
In-Reply-To: <20210519194350.1854798-1-geert@linux-m68k.org>
Geert Uytterhoeven wrote:
> On m68k (Coldfire M547x):
>
> CC drivers/net/ethernet/intel/i40e/i40e_main.o
> In file included from drivers/net/ethernet/intel/i40e/i40e_prototype.h:9,
> from drivers/net/ethernet/intel/i40e/i40e.h:41,
> from drivers/net/ethernet/intel/i40e/i40e_main.c:12:
> include/linux/avf/virtchnl.h:153:36: warning: division by zero [-Wdiv-by-zero]
> 153 | { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
> | ^
> include/linux/avf/virtchnl.h:844:1: note: in expansion of macro ?VIRTCHNL_CHECK_STRUCT_LEN?
> 844 | VIRTCHNL_CHECK_STRUCT_LEN(2312, virtchnl_proto_hdrs);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/avf/virtchnl.h:844:33: error: enumerator value for ?virtchnl_static_assert_virtchnl_proto_hdrs? is not an integer constant
> 844 | VIRTCHNL_CHECK_STRUCT_LEN(2312, virtchnl_proto_hdrs);
> | ^~~~~~~~~~~~~~~~~~~
>
> On m68k, integers are aligned on addresses that are multiples of two,
> not four, bytes. Hence the size of a structure containing integers may
> not be divisible by 4.
>
> Fix this by adding explicit padding.
Thanks Geert, I checked and x86_64 adds this padding anyway, so doesn't
result in any functional changes AFAICS. In any case, this is more
correct for a structure that is part of an API (no implicit padding!)
BTW. the patch subject is a little wrong, should have been
[PATCH net]
But I think Tony can take care of that when sending to netdev list,
unless you want to send a v2.
> Fixes: 1f7ea1cd6a374842 ("ice: Enable FDIR Configure for AVF")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> Compile-tested only.
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
WARNING: multiple messages have this Message-ID (diff)
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Qi Zhang <qi.z.zhang@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Yahui Cao <yahui.cao@intel.com>,
Beilei Xing <beilei.xing@intel.com>,
"Simei Su" <simei.su@intel.com>, Jeff Guo <jia.guo@intel.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
<intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] virtchnl: Add missing padding to virtchnl_proto_hdrs
Date: Wed, 19 May 2021 15:16:00 -0700 [thread overview]
Message-ID: <20210519151600.00006065@intel.com> (raw)
In-Reply-To: <20210519194350.1854798-1-geert@linux-m68k.org>
Geert Uytterhoeven wrote:
> On m68k (Coldfire M547x):
>
> CC drivers/net/ethernet/intel/i40e/i40e_main.o
> In file included from drivers/net/ethernet/intel/i40e/i40e_prototype.h:9,
> from drivers/net/ethernet/intel/i40e/i40e.h:41,
> from drivers/net/ethernet/intel/i40e/i40e_main.c:12:
> include/linux/avf/virtchnl.h:153:36: warning: division by zero [-Wdiv-by-zero]
> 153 | { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
> | ^
> include/linux/avf/virtchnl.h:844:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
> 844 | VIRTCHNL_CHECK_STRUCT_LEN(2312, virtchnl_proto_hdrs);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/avf/virtchnl.h:844:33: error: enumerator value for ‘virtchnl_static_assert_virtchnl_proto_hdrs’ is not an integer constant
> 844 | VIRTCHNL_CHECK_STRUCT_LEN(2312, virtchnl_proto_hdrs);
> | ^~~~~~~~~~~~~~~~~~~
>
> On m68k, integers are aligned on addresses that are multiples of two,
> not four, bytes. Hence the size of a structure containing integers may
> not be divisible by 4.
>
> Fix this by adding explicit padding.
Thanks Geert, I checked and x86_64 adds this padding anyway, so doesn't
result in any functional changes AFAICS. In any case, this is more
correct for a structure that is part of an API (no implicit padding!)
BTW. the patch subject is a little wrong, should have been
[PATCH net]
But I think Tony can take care of that when sending to netdev list,
unless you want to send a v2.
> Fixes: 1f7ea1cd6a374842 ("ice: Enable FDIR Configure for AVF")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> Compile-tested only.
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
next prev parent reply other threads:[~2021-05-19 22:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 19:43 [Intel-wired-lan] [PATCH] virtchnl: Add missing padding to virtchnl_proto_hdrs Geert Uytterhoeven
2021-05-19 19:43 ` Geert Uytterhoeven
2021-05-19 22:16 ` Jesse Brandeburg [this message]
2021-05-19 22:16 ` Jesse Brandeburg
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=20210519151600.00006065@intel.com \
--to=jesse.brandeburg@intel.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.