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