lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 24 Aug 2020 12:42:31 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Tony Nguyen <anthony.l.nguyen@...el.com>
Cc:     davem@...emloft.net, Alice Michael <alice.michael@...el.com>,
        netdev@...r.kernel.org, nhorman@...hat.com, sassmann@...hat.com,
        jeffrey.t.kirsher@...el.com, Alan Brady <Alan.Brady@...el.com>,
        Phani Burra <phani.r.burra@...el.com>,
        Joshua Hay <joshua.a.hay@...el.com>,
        Madhu Chittim <madhu.chittim@...el.com>,
        Pavan Kumar Linga <Pavan.Kumar.Linga@...el.com>,
        Donald Skidmore <donald.c.skidmore@...el.com>,
        Jesse Brandeburg <jesse.brandeburg@...el.com>,
        Sridhar Samudrala <sridhar.samudrala@...el.com>
Subject: Re: [net-next v5 01/15] virtchnl: Extend AVF ops

On Mon, 24 Aug 2020 10:32:52 -0700 Tony Nguyen wrote:
> +struct virtchnl_rss_hash {
> +	u64 hash;
> +	u16 vport_id;
> +};
> +
> +VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_rss_hash);

I've added 32bit builds to my local setup since v4 was posted - 
looks like there's a number of errors here. You can't assume u64 
forces a 64bit alignment. Best to specify the padding explicitly.

FWIW these are the errors I got but there may be more:

In file included from ../drivers/net/ethernet/intel/ice/ice.h:37,
                 from ../drivers/net/ethernet/intel/ice/ice_common.h:7,
                 from ../drivers/net/ethernet/intel/ice/ice_sched.h:7,
                 from ../drivers/net/ethernet/intel/ice/ice_sched.c:4:
../include/linux/avf/virtchnl.h:175:36: warning: division by zero [-Wdiv-by-zero]
  175 |  { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      |                                    ^
../include/linux/avf/virtchnl.h:809:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
  809 | VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_get_capabilities);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
../include/linux/avf/virtchnl.h:809:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_get_capabilities’ is not an integer constant
  809 | VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_get_capabilities);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~
../include/linux/avf/virtchnl.h:175:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
  175 |  { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      |                                                     ^
../include/linux/avf/virtchnl.h:175:36: warning: division by zero [-Wdiv-by-zero]
  175 |  { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      |                                    ^
../include/linux/avf/virtchnl.h:891:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
  891 | VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_txq_info_v2);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
../include/linux/avf/virtchnl.h:891:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_txq_info_v2’ is not an integer constant
  891 | VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_txq_info_v2);
      |                               ^~~~~~~~~~~~~~~~~~~~
../include/linux/avf/virtchnl.h:175:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
  175 |  { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      |                                                     ^
../include/linux/avf/virtchnl.h:175:36: warning: division by zero [-Wdiv-by-zero]
  175 |  { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      |                                    ^
../include/linux/avf/virtchnl.h:907:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
  907 | VIRTCHNL_CHECK_STRUCT_LEN(48, virtchnl_config_tx_queues);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
../include/linux/avf/virtchnl.h:907:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_config_tx_queues’ is not an integer constant
  907 | VIRTCHNL_CHECK_STRUCT_LEN(48, virtchnl_config_tx_queues);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~
../include/linux/avf/virtchnl.h:175:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
  175 |  { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      |                                                     ^
../include/linux/avf/virtchnl.h:175:36: warning: division by zero [-Wdiv-by-zero]
  175 |  { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      |                                    ^
../include/linux/avf/virtchnl.h:937:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
  937 | VIRTCHNL_CHECK_STRUCT_LEN(72, virtchnl_rxq_info_v2);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
../include/linux/avf/virtchnl.h:937:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_rxq_info_v2’ is not an integer constant
  937 | VIRTCHNL_CHECK_STRUCT_LEN(72, virtchnl_rxq_info_v2);
      |                               ^~~~~~~~~~~~~~~~~~~~
../include/linux/avf/virtchnl.h:175:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
  175 |  { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      |                                                     ^
../include/linux/avf/virtchnl.h:175:36: warning: division by zero [-Wdiv-by-zero]
  175 |  { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      |                                    ^
../include/linux/avf/virtchnl.h:952:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
  952 | VIRTCHNL_CHECK_STRUCT_LEN(80, virtchnl_config_rx_queues);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
../include/linux/avf/virtchnl.h:952:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_config_rx_queues’ is not an integer constant
  952 | VIRTCHNL_CHECK_STRUCT_LEN(80, virtchnl_config_rx_queues);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~
../include/linux/avf/virtchnl.h:175:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
  175 |  { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      |                                                     ^
../include/linux/avf/virtchnl.h:175:36: warning: division by zero [-Wdiv-by-zero]
  175 |  { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      |                                    ^
../include/linux/avf/virtchnl.h:1090:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
 1090 | VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_rss_hash);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
../include/linux/avf/virtchnl.h:1090:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_rss_hash’ is not an integer constant
 1090 | VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_rss_hash);
      |                               ^~~~~~~~~~~~~~~~~
../include/linux/avf/virtchnl.h:175:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
  175 |  { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ