* include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses
@ 2024-07-24 1:08 kernel test robot
0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2024-07-24 1:08 UTC (permalink / raw)
To: Breno Leitao; +Cc: oe-kbuild-all, linux-kernel, Jakub Kicinski, Vladimir Oltean
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5ad7ff8738b8bd238ca899df08badb1f61bcc39e
commit: 782fe08e9861d00ce8aca370453dd9ceb9a23d50 soc: fsl: qbman: FSL_DPAA depends on COMPILE_TEST
date: 9 days ago
config: arm-randconfig-r123-20240723 (https://download.01.org/0day-ci/archive/20240724/202407240923.IiSHts5M-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project ad154281230d83ee551e12d5be48bb956ef47ed3)
reproduce: (https://download.01.org/0day-ci/archive/20240724/202407240923.IiSHts5M-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407240923.IiSHts5M-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/soc/fsl/qbman/qman_ccsr.c:31:
In file included from drivers/soc/fsl/qbman/qman_priv.h:31:
In file included from drivers/soc/fsl/qbman/dpaa_sys.h:46:
In file included from arch/arm/include/asm/cacheflush.h:10:
In file included from include/linux/mm.h:2258:
include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
In file included from drivers/soc/fsl/qbman/qman_ccsr.c:31:
In file included from drivers/soc/fsl/qbman/qman_priv.h:33:
>> include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses [-Wunaligned-access]
383 | } context_a;
| ^
2 warnings generated.
vim +383 include/soc/fsl/qman.h
c535e923bb97a4 Claudiu Manoil 2016-09-22 346
c535e923bb97a4 Claudiu Manoil 2016-09-22 347 struct qm_fqd {
c535e923bb97a4 Claudiu Manoil 2016-09-22 348 /* _res[6-7], orprws[3-5], oa[2], olws[0-1] */
c535e923bb97a4 Claudiu Manoil 2016-09-22 349 u8 orpc;
c535e923bb97a4 Claudiu Manoil 2016-09-22 350 u8 cgid;
c535e923bb97a4 Claudiu Manoil 2016-09-22 351 __be16 fq_ctrl; /* See QM_FQCTRL_<...> */
c535e923bb97a4 Claudiu Manoil 2016-09-22 352 __be16 dest_wq; /* channel[3-15], wq[0-2] */
c535e923bb97a4 Claudiu Manoil 2016-09-22 353 __be16 ics_cred; /* 15-bit */
c535e923bb97a4 Claudiu Manoil 2016-09-22 354 /*
c535e923bb97a4 Claudiu Manoil 2016-09-22 355 * For "Initialize Frame Queue" commands, the write-enable mask
c535e923bb97a4 Claudiu Manoil 2016-09-22 356 * determines whether 'td' or 'oac_init' is observed. For query
c535e923bb97a4 Claudiu Manoil 2016-09-22 357 * commands, this field is always 'td', and 'oac_query' (below) reflects
c535e923bb97a4 Claudiu Manoil 2016-09-22 358 * the Overhead ACcounting values.
c535e923bb97a4 Claudiu Manoil 2016-09-22 359 */
c535e923bb97a4 Claudiu Manoil 2016-09-22 360 union {
c535e923bb97a4 Claudiu Manoil 2016-09-22 361 __be16 td; /* "Taildrop": _res[13-15], mant[5-12], exp[0-4] */
c535e923bb97a4 Claudiu Manoil 2016-09-22 362 struct qm_fqd_oac oac_init;
c535e923bb97a4 Claudiu Manoil 2016-09-22 363 };
c535e923bb97a4 Claudiu Manoil 2016-09-22 364 __be32 context_b;
c535e923bb97a4 Claudiu Manoil 2016-09-22 365 union {
c535e923bb97a4 Claudiu Manoil 2016-09-22 366 /* Treat it as 64-bit opaque */
c535e923bb97a4 Claudiu Manoil 2016-09-22 367 __be64 opaque;
c535e923bb97a4 Claudiu Manoil 2016-09-22 368 struct {
c535e923bb97a4 Claudiu Manoil 2016-09-22 369 __be32 hi;
c535e923bb97a4 Claudiu Manoil 2016-09-22 370 __be32 lo;
c535e923bb97a4 Claudiu Manoil 2016-09-22 371 };
c535e923bb97a4 Claudiu Manoil 2016-09-22 372 /* Treat it as s/w portal stashing config */
c535e923bb97a4 Claudiu Manoil 2016-09-22 373 /* see "FQD Context_A field used for [...]" */
c535e923bb97a4 Claudiu Manoil 2016-09-22 374 struct {
c535e923bb97a4 Claudiu Manoil 2016-09-22 375 struct qm_fqd_stashing stashing;
c535e923bb97a4 Claudiu Manoil 2016-09-22 376 /*
c535e923bb97a4 Claudiu Manoil 2016-09-22 377 * 48-bit address of FQ context to
c535e923bb97a4 Claudiu Manoil 2016-09-22 378 * stash, must be cacheline-aligned
c535e923bb97a4 Claudiu Manoil 2016-09-22 379 */
c535e923bb97a4 Claudiu Manoil 2016-09-22 380 __be16 context_hi;
c535e923bb97a4 Claudiu Manoil 2016-09-22 381 __be32 context_lo;
c535e923bb97a4 Claudiu Manoil 2016-09-22 382 } __packed;
c535e923bb97a4 Claudiu Manoil 2016-09-22 @383 } context_a;
c535e923bb97a4 Claudiu Manoil 2016-09-22 384 struct qm_fqd_oac oac_query;
c535e923bb97a4 Claudiu Manoil 2016-09-22 385 } __packed;
c535e923bb97a4 Claudiu Manoil 2016-09-22 386
:::::: The code at line 383 was first introduced by commit
:::::: c535e923bb97a4b361e89a6383693482057f8b0c soc/fsl: Introduce DPAA 1.x QMan device driver
:::::: TO: Claudiu Manoil <claudiu.manoil@nxp.com>
:::::: CC: Scott Wood <oss@buserror.net>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread
* include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses
@ 2025-04-09 8:55 kernel test robot
2025-04-09 11:18 ` Breno Leitao
0 siblings, 1 reply; 7+ messages in thread
From: kernel test robot @ 2025-04-09 8:55 UTC (permalink / raw)
To: Breno Leitao; +Cc: oe-kbuild-all, linux-kernel, Jakub Kicinski, Vladimir Oltean
Hi Breno,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a24588245776dafc227243a01bfbeb8a59bafba9
commit: 782fe08e9861d00ce8aca370453dd9ceb9a23d50 soc: fsl: qbman: FSL_DPAA depends on COMPILE_TEST
date: 9 months ago
config: arm-randconfig-r063-20250409 (https://download.01.org/0day-ci/archive/20250409/202504091657.OgPuMa8C-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250409/202504091657.OgPuMa8C-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504091657.OgPuMa8C-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/soc/fsl/qbman/qman_ccsr.c:31:
In file included from drivers/soc/fsl/qbman/qman_priv.h:33:
>> include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses [-Wunaligned-access]
} context_a;
^
1 warning generated.
vim +383 include/soc/fsl/qman.h
c535e923bb97a4 Claudiu Manoil 2016-09-22 346
c535e923bb97a4 Claudiu Manoil 2016-09-22 347 struct qm_fqd {
c535e923bb97a4 Claudiu Manoil 2016-09-22 348 /* _res[6-7], orprws[3-5], oa[2], olws[0-1] */
c535e923bb97a4 Claudiu Manoil 2016-09-22 349 u8 orpc;
c535e923bb97a4 Claudiu Manoil 2016-09-22 350 u8 cgid;
c535e923bb97a4 Claudiu Manoil 2016-09-22 351 __be16 fq_ctrl; /* See QM_FQCTRL_<...> */
c535e923bb97a4 Claudiu Manoil 2016-09-22 352 __be16 dest_wq; /* channel[3-15], wq[0-2] */
c535e923bb97a4 Claudiu Manoil 2016-09-22 353 __be16 ics_cred; /* 15-bit */
c535e923bb97a4 Claudiu Manoil 2016-09-22 354 /*
c535e923bb97a4 Claudiu Manoil 2016-09-22 355 * For "Initialize Frame Queue" commands, the write-enable mask
c535e923bb97a4 Claudiu Manoil 2016-09-22 356 * determines whether 'td' or 'oac_init' is observed. For query
c535e923bb97a4 Claudiu Manoil 2016-09-22 357 * commands, this field is always 'td', and 'oac_query' (below) reflects
c535e923bb97a4 Claudiu Manoil 2016-09-22 358 * the Overhead ACcounting values.
c535e923bb97a4 Claudiu Manoil 2016-09-22 359 */
c535e923bb97a4 Claudiu Manoil 2016-09-22 360 union {
c535e923bb97a4 Claudiu Manoil 2016-09-22 361 __be16 td; /* "Taildrop": _res[13-15], mant[5-12], exp[0-4] */
c535e923bb97a4 Claudiu Manoil 2016-09-22 362 struct qm_fqd_oac oac_init;
c535e923bb97a4 Claudiu Manoil 2016-09-22 363 };
c535e923bb97a4 Claudiu Manoil 2016-09-22 364 __be32 context_b;
c535e923bb97a4 Claudiu Manoil 2016-09-22 365 union {
c535e923bb97a4 Claudiu Manoil 2016-09-22 366 /* Treat it as 64-bit opaque */
c535e923bb97a4 Claudiu Manoil 2016-09-22 367 __be64 opaque;
c535e923bb97a4 Claudiu Manoil 2016-09-22 368 struct {
c535e923bb97a4 Claudiu Manoil 2016-09-22 369 __be32 hi;
c535e923bb97a4 Claudiu Manoil 2016-09-22 370 __be32 lo;
c535e923bb97a4 Claudiu Manoil 2016-09-22 371 };
c535e923bb97a4 Claudiu Manoil 2016-09-22 372 /* Treat it as s/w portal stashing config */
c535e923bb97a4 Claudiu Manoil 2016-09-22 373 /* see "FQD Context_A field used for [...]" */
c535e923bb97a4 Claudiu Manoil 2016-09-22 374 struct {
c535e923bb97a4 Claudiu Manoil 2016-09-22 375 struct qm_fqd_stashing stashing;
c535e923bb97a4 Claudiu Manoil 2016-09-22 376 /*
c535e923bb97a4 Claudiu Manoil 2016-09-22 377 * 48-bit address of FQ context to
c535e923bb97a4 Claudiu Manoil 2016-09-22 378 * stash, must be cacheline-aligned
c535e923bb97a4 Claudiu Manoil 2016-09-22 379 */
c535e923bb97a4 Claudiu Manoil 2016-09-22 380 __be16 context_hi;
c535e923bb97a4 Claudiu Manoil 2016-09-22 381 __be32 context_lo;
c535e923bb97a4 Claudiu Manoil 2016-09-22 382 } __packed;
c535e923bb97a4 Claudiu Manoil 2016-09-22 @383 } context_a;
c535e923bb97a4 Claudiu Manoil 2016-09-22 384 struct qm_fqd_oac oac_query;
c535e923bb97a4 Claudiu Manoil 2016-09-22 385 } __packed;
c535e923bb97a4 Claudiu Manoil 2016-09-22 386
:::::: The code at line 383 was first introduced by commit
:::::: c535e923bb97a4b361e89a6383693482057f8b0c soc/fsl: Introduce DPAA 1.x QMan device driver
:::::: TO: Claudiu Manoil <claudiu.manoil@nxp.com>
:::::: CC: Scott Wood <oss@buserror.net>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses
2025-04-09 8:55 kernel test robot
@ 2025-04-09 11:18 ` Breno Leitao
2025-04-09 12:01 ` Vladimir Oltean
0 siblings, 1 reply; 7+ messages in thread
From: Breno Leitao @ 2025-04-09 11:18 UTC (permalink / raw)
To: kernel test robot, vladimir.oltean, sean.anderson, bigeasy,
horia.geanta, madalin.bucur, hristophe.leroy
Cc: oe-kbuild-all, linux-kernel, Jakub Kicinski, Vladimir Oltean
On Wed, Apr 09, 2025 at 04:55:16PM +0800, kernel test robot wrote:
> >> include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses [-Wunaligned-access]
> } context_a;
<snip>
> c535e923bb97a4 Claudiu Manoil 2016-09-22 346
> c535e923bb97a4 Claudiu Manoil 2016-09-22 347 struct qm_fqd {
> c535e923bb97a4 Claudiu Manoil 2016-09-22 348 /* _res[6-7], orprws[3-5], oa[2], olws[0-1] */
> c535e923bb97a4 Claudiu Manoil 2016-09-22 349 u8 orpc;
> c535e923bb97a4 Claudiu Manoil 2016-09-22 350 u8 cgid;
> c535e923bb97a4 Claudiu Manoil 2016-09-22 351 __be16 fq_ctrl; /* See QM_FQCTRL_<...> */
> c535e923bb97a4 Claudiu Manoil 2016-09-22 352 __be16 dest_wq; /* channel[3-15], wq[0-2] */
> c535e923bb97a4 Claudiu Manoil 2016-09-22 353 __be16 ics_cred; /* 15-bit */
> c535e923bb97a4 Claudiu Manoil 2016-09-22 354 /*
> c535e923bb97a4 Claudiu Manoil 2016-09-22 355 * For "Initialize Frame Queue" commands, the write-enable mask
> c535e923bb97a4 Claudiu Manoil 2016-09-22 356 * determines whether 'td' or 'oac_init' is observed. For query
> c535e923bb97a4 Claudiu Manoil 2016-09-22 357 * commands, this field is always 'td', and 'oac_query' (below) reflects
> c535e923bb97a4 Claudiu Manoil 2016-09-22 358 * the Overhead ACcounting values.
> c535e923bb97a4 Claudiu Manoil 2016-09-22 359 */
> c535e923bb97a4 Claudiu Manoil 2016-09-22 360 union {
> c535e923bb97a4 Claudiu Manoil 2016-09-22 361 __be16 td; /* "Taildrop": _res[13-15], mant[5-12], exp[0-4] */
> c535e923bb97a4 Claudiu Manoil 2016-09-22 362 struct qm_fqd_oac oac_init;
> c535e923bb97a4 Claudiu Manoil 2016-09-22 363 };
> c535e923bb97a4 Claudiu Manoil 2016-09-22 364 __be32 context_b;
> c535e923bb97a4 Claudiu Manoil 2016-09-22 365 union {
> c535e923bb97a4 Claudiu Manoil 2016-09-22 366 /* Treat it as 64-bit opaque */
> c535e923bb97a4 Claudiu Manoil 2016-09-22 367 __be64 opaque;
> c535e923bb97a4 Claudiu Manoil 2016-09-22 368 struct {
> c535e923bb97a4 Claudiu Manoil 2016-09-22 369 __be32 hi;
> c535e923bb97a4 Claudiu Manoil 2016-09-22 370 __be32 lo;
> c535e923bb97a4 Claudiu Manoil 2016-09-22 371 };
> c535e923bb97a4 Claudiu Manoil 2016-09-22 372 /* Treat it as s/w portal stashing config */
> c535e923bb97a4 Claudiu Manoil 2016-09-22 373 /* see "FQD Context_A field used for [...]" */
> c535e923bb97a4 Claudiu Manoil 2016-09-22 374 struct {
> c535e923bb97a4 Claudiu Manoil 2016-09-22 375 struct qm_fqd_stashing stashing;
> c535e923bb97a4 Claudiu Manoil 2016-09-22 376 /*
> c535e923bb97a4 Claudiu Manoil 2016-09-22 377 * 48-bit address of FQ context to
> c535e923bb97a4 Claudiu Manoil 2016-09-22 378 * stash, must be cacheline-aligned
> c535e923bb97a4 Claudiu Manoil 2016-09-22 379 */
Looking at pahole, I am not sure this is caacheline-aligned, as
suggested above.
# pahole -C qm_fqd
struct qm_fqd {
u8 orpc; /* 0 1 */
u8 cgid; /* 1 1 */
__be16 fq_ctrl; /* 2 2 */
__be16 dest_wq; /* 4 2 */
__be16 ics_cred; /* 6 2 */
union {
__be16 td; /* 8 2 */
struct qm_fqd_oac oac_init; /* 8 2 */
}; /* 8 2 */
__be32 context_b; /* 10 4 */
union {
__be64 opaque; /* 14 8 */
struct {
__be32 hi; /* 14 4 */
__be32 lo; /* 18 4 */
}; /* 14 8 */
struct {
struct qm_fqd_stashing stashing; /* 14 2 */
__be16 context_hi; /* 16 2 */
__be32 context_lo; /* 18 4 */
}; /* 14 8 */
} context_a; /* 14 8 */
struct qm_fqd_oac oac_query; /* 22 2 */
/* size: 24, cachelines: 1, members: 9 */
/* last cacheline: 24 bytes */
} __attribute__((__packed__));
> c535e923bb97a4 Claudiu Manoil 2016-09-22 380 __be16 context_hi;
> c535e923bb97a4 Claudiu Manoil 2016-09-22 381 __be32 context_lo;
> c535e923bb97a4 Claudiu Manoil 2016-09-22 382 } __packed;
I am wondering if we should use __attribute__((aligned(8))) instead of
__packed, according to the document above.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses
2025-04-09 11:18 ` Breno Leitao
@ 2025-04-09 12:01 ` Vladimir Oltean
2025-04-10 12:37 ` Breno Leitao
0 siblings, 1 reply; 7+ messages in thread
From: Vladimir Oltean @ 2025-04-09 12:01 UTC (permalink / raw)
To: Breno Leitao
Cc: kernel test robot, sean.anderson, bigeasy, horia.geanta,
madalin.bucur, hristophe.leroy, oe-kbuild-all, linux-kernel,
Jakub Kicinski
Hi Breno,
On Wed, Apr 09, 2025 at 04:18:04AM -0700, Breno Leitao wrote:
> On Wed, Apr 09, 2025 at 04:55:16PM +0800, kernel test robot wrote:
> > >> include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses [-Wunaligned-access]
> > } context_a;
>
> <snip>
>
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 346
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 347 struct qm_fqd {
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 348 /* _res[6-7], orprws[3-5], oa[2], olws[0-1] */
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 349 u8 orpc;
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 350 u8 cgid;
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 351 __be16 fq_ctrl; /* See QM_FQCTRL_<...> */
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 352 __be16 dest_wq; /* channel[3-15], wq[0-2] */
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 353 __be16 ics_cred; /* 15-bit */
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 354 /*
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 355 * For "Initialize Frame Queue" commands, the write-enable mask
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 356 * determines whether 'td' or 'oac_init' is observed. For query
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 357 * commands, this field is always 'td', and 'oac_query' (below) reflects
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 358 * the Overhead ACcounting values.
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 359 */
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 360 union {
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 361 __be16 td; /* "Taildrop": _res[13-15], mant[5-12], exp[0-4] */
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 362 struct qm_fqd_oac oac_init;
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 363 };
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 364 __be32 context_b;
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 365 union {
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 366 /* Treat it as 64-bit opaque */
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 367 __be64 opaque;
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 368 struct {
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 369 __be32 hi;
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 370 __be32 lo;
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 371 };
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 372 /* Treat it as s/w portal stashing config */
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 373 /* see "FQD Context_A field used for [...]" */
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 374 struct {
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 375 struct qm_fqd_stashing stashing;
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 376 /*
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 377 * 48-bit address of FQ context to
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 378 * stash, must be cacheline-aligned
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 379 */
>
> Looking at pahole, I am not sure this is caacheline-aligned, as
> suggested above.
>
> # pahole -C qm_fqd
> struct qm_fqd {
> u8 orpc; /* 0 1 */
> u8 cgid; /* 1 1 */
> __be16 fq_ctrl; /* 2 2 */
> __be16 dest_wq; /* 4 2 */
> __be16 ics_cred; /* 6 2 */
> union {
> __be16 td; /* 8 2 */
> struct qm_fqd_oac oac_init; /* 8 2 */
> }; /* 8 2 */
> __be32 context_b; /* 10 4 */
> union {
> __be64 opaque; /* 14 8 */
> struct {
> __be32 hi; /* 14 4 */
> __be32 lo; /* 18 4 */
> }; /* 14 8 */
> struct {
> struct qm_fqd_stashing stashing; /* 14 2 */
> __be16 context_hi; /* 16 2 */
> __be32 context_lo; /* 18 4 */
> }; /* 14 8 */
> } context_a; /* 14 8 */
> struct qm_fqd_oac oac_query; /* 22 2 */
>
> /* size: 24, cachelines: 1, members: 9 */
> /* last cacheline: 24 bytes */
> } __attribute__((__packed__));
>
>
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 380 __be16 context_hi;
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 381 __be32 context_lo;
> > c535e923bb97a4 Claudiu Manoil 2016-09-22 382 } __packed;
>
> I am wondering if we should use __attribute__((aligned(8))) instead of
> __packed, according to the document above.
Since you've replied, could you please help me also understand the issue?
It says "field context_a within 'struct qm_fqd' is less aligned than
'union (unnamed union at include/soc/fsl/qman.h:365:2)'", but at line 365,
the unnamed union _is_ field context_a, no? What is it saying?
I _suspect_, but I'm not sure, that it's complaining about context_a.opaque
being a 64-bit field which is not aligned to a 64-bit boundary. Though
I'm not getting that from reading the description.
But struct qm_fqd is embedded in other structures, and the alignment of
the fields changes in that case. I think that context_a.opaque is 64-bit
aligned in all cases.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses
2025-04-09 12:01 ` Vladimir Oltean
@ 2025-04-10 12:37 ` Breno Leitao
2025-04-10 20:53 ` Vladimir Oltean
0 siblings, 1 reply; 7+ messages in thread
From: Breno Leitao @ 2025-04-10 12:37 UTC (permalink / raw)
To: Vladimir Oltean
Cc: kernel test robot, sean.anderson, bigeasy, horia.geanta,
madalin.bucur, hristophe.leroy, oe-kbuild-all, linux-kernel,
Jakub Kicinski
On Wed, Apr 09, 2025 at 03:01:38PM +0300, Vladimir Oltean wrote:
> Hi Breno,
>
> On Wed, Apr 09, 2025 at 04:18:04AM -0700, Breno Leitao wrote:
> > On Wed, Apr 09, 2025 at 04:55:16PM +0800, kernel test robot wrote:
> > > >> include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses [-Wunaligned-access]
> > > } context_a;
> >
> > <snip>
> >
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 346
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 347 struct qm_fqd {
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 348 /* _res[6-7], orprws[3-5], oa[2], olws[0-1] */
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 349 u8 orpc;
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 350 u8 cgid;
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 351 __be16 fq_ctrl; /* See QM_FQCTRL_<...> */
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 352 __be16 dest_wq; /* channel[3-15], wq[0-2] */
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 353 __be16 ics_cred; /* 15-bit */
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 354 /*
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 355 * For "Initialize Frame Queue" commands, the write-enable mask
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 356 * determines whether 'td' or 'oac_init' is observed. For query
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 357 * commands, this field is always 'td', and 'oac_query' (below) reflects
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 358 * the Overhead ACcounting values.
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 359 */
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 360 union {
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 361 __be16 td; /* "Taildrop": _res[13-15], mant[5-12], exp[0-4] */
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 362 struct qm_fqd_oac oac_init;
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 363 };
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 364 __be32 context_b;
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 365 union {
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 366 /* Treat it as 64-bit opaque */
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 367 __be64 opaque;
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 368 struct {
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 369 __be32 hi;
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 370 __be32 lo;
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 371 };
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 372 /* Treat it as s/w portal stashing config */
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 373 /* see "FQD Context_A field used for [...]" */
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 374 struct {
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 375 struct qm_fqd_stashing stashing;
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 376 /*
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 377 * 48-bit address of FQ context to
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 378 * stash, must be cacheline-aligned
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 379 */
> >
> > Looking at pahole, I am not sure this is caacheline-aligned, as
> > suggested above.
> >
> > # pahole -C qm_fqd
> > struct qm_fqd {
> > u8 orpc; /* 0 1 */
> > u8 cgid; /* 1 1 */
> > __be16 fq_ctrl; /* 2 2 */
> > __be16 dest_wq; /* 4 2 */
> > __be16 ics_cred; /* 6 2 */
> > union {
> > __be16 td; /* 8 2 */
> > struct qm_fqd_oac oac_init; /* 8 2 */
> > }; /* 8 2 */
> > __be32 context_b; /* 10 4 */
> > union {
> > __be64 opaque; /* 14 8 */
> > struct {
> > __be32 hi; /* 14 4 */
> > __be32 lo; /* 18 4 */
> > }; /* 14 8 */
> > struct {
> > struct qm_fqd_stashing stashing; /* 14 2 */
> > __be16 context_hi; /* 16 2 */
> > __be32 context_lo; /* 18 4 */
> > }; /* 14 8 */
> > } context_a; /* 14 8 */
> > struct qm_fqd_oac oac_query; /* 22 2 */
> >
> > /* size: 24, cachelines: 1, members: 9 */
> > /* last cacheline: 24 bytes */
> > } __attribute__((__packed__));
> >
> >
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 380 __be16 context_hi;
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 381 __be32 context_lo;
> > > c535e923bb97a4 Claudiu Manoil 2016-09-22 382 } __packed;
> >
> > I am wondering if we should use __attribute__((aligned(8))) instead of
> > __packed, according to the document above.
>
> Since you've replied, could you please help me also understand the issue?
> It says "field context_a within 'struct qm_fqd' is less aligned than
> 'union (unnamed union at include/soc/fsl/qman.h:365:2)'", but at line 365,
> the unnamed union _is_ field context_a, no? What is it saying?
>
> I _suspect_, but I'm not sure, that it's complaining about context_a.opaque
> being a 64-bit field which is not aligned to a 64-bit boundary. Though
> I'm not getting that from reading the description.
In fact, the whole union is not aligned, and because "struct qm_fqd" is
also packed, it cannot add a padding before the union (which would be
the compiler decision, since the union contains a packed field).
> But struct qm_fqd is embedded in other structures, and the alignment
> of the fields changes in that case. I think that context_a.opaque is
> 64-bit aligned in all cases.
I don't think it is ever aligned. Check the pahole above, and the union
starts at byte 14th, which is not aligned if my math is correct.
--breno
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses
2025-04-10 12:37 ` Breno Leitao
@ 2025-04-10 20:53 ` Vladimir Oltean
0 siblings, 0 replies; 7+ messages in thread
From: Vladimir Oltean @ 2025-04-10 20:53 UTC (permalink / raw)
To: Breno Leitao
Cc: kernel test robot, sean.anderson, bigeasy, horia.geanta,
madalin.bucur, hristophe.leroy, oe-kbuild-all, linux-kernel,
Jakub Kicinski
On Thu, Apr 10, 2025 at 05:37:59AM -0700, Breno Leitao wrote:
> On Wed, Apr 09, 2025 at 03:01:38PM +0300, Vladimir Oltean wrote:
> > Hi Breno,
> >
> > On Wed, Apr 09, 2025 at 04:18:04AM -0700, Breno Leitao wrote:
> > > On Wed, Apr 09, 2025 at 04:55:16PM +0800, kernel test robot wrote:
> > > > >> include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses [-Wunaligned-access]
> > > > } context_a;
> > >
> > > <snip>
> > >
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 346
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 347 struct qm_fqd {
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 348 /* _res[6-7], orprws[3-5], oa[2], olws[0-1] */
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 349 u8 orpc;
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 350 u8 cgid;
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 351 __be16 fq_ctrl; /* See QM_FQCTRL_<...> */
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 352 __be16 dest_wq; /* channel[3-15], wq[0-2] */
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 353 __be16 ics_cred; /* 15-bit */
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 354 /*
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 355 * For "Initialize Frame Queue" commands, the write-enable mask
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 356 * determines whether 'td' or 'oac_init' is observed. For query
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 357 * commands, this field is always 'td', and 'oac_query' (below) reflects
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 358 * the Overhead ACcounting values.
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 359 */
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 360 union {
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 361 __be16 td; /* "Taildrop": _res[13-15], mant[5-12], exp[0-4] */
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 362 struct qm_fqd_oac oac_init;
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 363 };
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 364 __be32 context_b;
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 365 union {
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 366 /* Treat it as 64-bit opaque */
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 367 __be64 opaque;
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 368 struct {
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 369 __be32 hi;
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 370 __be32 lo;
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 371 };
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 372 /* Treat it as s/w portal stashing config */
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 373 /* see "FQD Context_A field used for [...]" */
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 374 struct {
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 375 struct qm_fqd_stashing stashing;
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 376 /*
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 377 * 48-bit address of FQ context to
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 378 * stash, must be cacheline-aligned
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 379 */
> > >
> > > Looking at pahole, I am not sure this is caacheline-aligned, as
> > > suggested above.
> > >
> > > # pahole -C qm_fqd
> > > struct qm_fqd {
> > > u8 orpc; /* 0 1 */
> > > u8 cgid; /* 1 1 */
> > > __be16 fq_ctrl; /* 2 2 */
> > > __be16 dest_wq; /* 4 2 */
> > > __be16 ics_cred; /* 6 2 */
> > > union {
> > > __be16 td; /* 8 2 */
> > > struct qm_fqd_oac oac_init; /* 8 2 */
> > > }; /* 8 2 */
> > > __be32 context_b; /* 10 4 */
> > > union {
> > > __be64 opaque; /* 14 8 */
> > > struct {
> > > __be32 hi; /* 14 4 */
> > > __be32 lo; /* 18 4 */
> > > }; /* 14 8 */
> > > struct {
> > > struct qm_fqd_stashing stashing; /* 14 2 */
> > > __be16 context_hi; /* 16 2 */
> > > __be32 context_lo; /* 18 4 */
> > > }; /* 14 8 */
> > > } context_a; /* 14 8 */
> > > struct qm_fqd_oac oac_query; /* 22 2 */
> > >
> > > /* size: 24, cachelines: 1, members: 9 */
> > > /* last cacheline: 24 bytes */
> > > } __attribute__((__packed__));
> > >
> > >
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 380 __be16 context_hi;
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 381 __be32 context_lo;
> > > > c535e923bb97a4 Claudiu Manoil 2016-09-22 382 } __packed;
> > >
> > > I am wondering if we should use __attribute__((aligned(8))) instead of
> > > __packed, according to the document above.
> >
> > Since you've replied, could you please help me also understand the issue?
> > It says "field context_a within 'struct qm_fqd' is less aligned than
> > 'union (unnamed union at include/soc/fsl/qman.h:365:2)'", but at line 365,
> > the unnamed union _is_ field context_a, no? What is it saying?
> >
> > I _suspect_, but I'm not sure, that it's complaining about context_a.opaque
> > being a 64-bit field which is not aligned to a 64-bit boundary. Though
> > I'm not getting that from reading the description.
>
> In fact, the whole union is not aligned, and because "struct qm_fqd" is
> also packed, it cannot add a padding before the union (which would be
> the compiler decision, since the union contains a packed field).
>
> > But struct qm_fqd is embedded in other structures, and the alignment
> > of the fields changes in that case. I think that context_a.opaque is
> > 64-bit aligned in all cases.
>
> I don't think it is ever aligned. Check the pahole above, and the union
> starts at byte 14th, which is not aligned if my math is correct.
>
> --breno
When it's part of struct qm_mcc_initfq or struct qm_mcr_queryfq, it's
actually aligned properly, because the outer structures (QMan management
commands) offer that alignment. It's ok to not add padding, you still
want to talk to the QMan properly...
The problem might be its standalone use, qpool_cleanup() and cgr_cleanup(),
where we give a pointer to an on-stack "fqd" variable to qman_query_fq(),
and we expect it to do the following copy:
*fqd = mcr->queryfq.fqd;
with "*fqd" being unaligned and mcr->queryfq.fqd being aligned.
At least on arm64, I see the code decompiles to the following.
*fqd = mcr->queryfq.fqd;
1d84: f841a109 ldur x9, [x8, #0x1a]
1d88: f841210a ldur x10, [x8, #0x12]
1d8c: f840a108 ldur x8, [x8, #0xa]
1d90: a900a66a stp x10, x9, [x19, #0x8]
1d94: f9000268 str x8, [x19]
Three 64-bit "load unscaled register" instructions to read
mcr->queryfq.fqd, and two instructions (store pair, store register) to
write to *fqd. So it's not doing the transfer field by field, and not
dereferencing the unaligned fqd.context_a in that process.
In fact, nowhere does the code seem to be dereferencing the 64-bit context_a.opaque,
so that can in principle be removed if that is a problem.
The code paths that dereference context_a through other mechanisms are:
qm_fqd_stashing_set64() - goes through the 16-bit context_hi and 32-bit context_lo
- used by qman_init_fq()
qm_fqd_context_a_set64() - goes through the 32-bit hi and 32-bit lo, used by:
- dpaa_fq_init()
- create_caam_req_fq()
qm_fqd_set_stashing() - goes through the struct qm_fqd_stashing that is
16 bits in size, used by:
- dpaa_fq_init()
- init_handler() in drivers/soc/fsl/qbman/qman_test_stash.c
- alloc_rsp_fq_cpu() in drivers/crypto/caam/qi.c
All of the above functions operate on the fqd structure embedded within
struct qm_mcc_initfq initfq, therefore prepend 10 more bytes and see how
that makes things properly aligned.
I'm not seeing alignment issues in actual use, and I still don't
understand exactly what the compiler is saying.
^ permalink raw reply [flat|nested] 7+ messages in thread
* include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses
@ 2025-05-20 18:36 kernel test robot
0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2025-05-20 18:36 UTC (permalink / raw)
To: Breno Leitao
Cc: llvm, oe-kbuild-all, linux-kernel, Jakub Kicinski,
Vladimir Oltean
Hi Breno,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a5806cd506af5a7c19bcd596e4708b5c464bfd21
commit: 782fe08e9861d00ce8aca370453dd9ceb9a23d50 soc: fsl: qbman: FSL_DPAA depends on COMPILE_TEST
date: 10 months ago
config: arm-randconfig-001-20250521 (https://download.01.org/0day-ci/archive/20250521/202505210229.ucGZlmoj-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250521/202505210229.ucGZlmoj-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505210229.ucGZlmoj-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c:13:
In file included from include/linux/fsl/ptp_qoriq.h:11:
In file included from include/linux/ptp_clock_kernel.h:15:
In file included from include/linux/skbuff.h:17:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:8:
In file included from include/linux/cacheflush.h:5:
In file included from arch/arm/include/asm/cacheflush.h:10:
In file included from include/linux/mm.h:2258:
include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
In file included from drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c:15:
In file included from drivers/net/ethernet/freescale/dpaa/dpaa_eth.h:12:
>> include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses [-Wunaligned-access]
383 | } context_a;
| ^
2 warnings generated.
vim +383 include/soc/fsl/qman.h
c535e923bb97a4 Claudiu Manoil 2016-09-22 346
c535e923bb97a4 Claudiu Manoil 2016-09-22 347 struct qm_fqd {
c535e923bb97a4 Claudiu Manoil 2016-09-22 348 /* _res[6-7], orprws[3-5], oa[2], olws[0-1] */
c535e923bb97a4 Claudiu Manoil 2016-09-22 349 u8 orpc;
c535e923bb97a4 Claudiu Manoil 2016-09-22 350 u8 cgid;
c535e923bb97a4 Claudiu Manoil 2016-09-22 351 __be16 fq_ctrl; /* See QM_FQCTRL_<...> */
c535e923bb97a4 Claudiu Manoil 2016-09-22 352 __be16 dest_wq; /* channel[3-15], wq[0-2] */
c535e923bb97a4 Claudiu Manoil 2016-09-22 353 __be16 ics_cred; /* 15-bit */
c535e923bb97a4 Claudiu Manoil 2016-09-22 354 /*
c535e923bb97a4 Claudiu Manoil 2016-09-22 355 * For "Initialize Frame Queue" commands, the write-enable mask
c535e923bb97a4 Claudiu Manoil 2016-09-22 356 * determines whether 'td' or 'oac_init' is observed. For query
c535e923bb97a4 Claudiu Manoil 2016-09-22 357 * commands, this field is always 'td', and 'oac_query' (below) reflects
c535e923bb97a4 Claudiu Manoil 2016-09-22 358 * the Overhead ACcounting values.
c535e923bb97a4 Claudiu Manoil 2016-09-22 359 */
c535e923bb97a4 Claudiu Manoil 2016-09-22 360 union {
c535e923bb97a4 Claudiu Manoil 2016-09-22 361 __be16 td; /* "Taildrop": _res[13-15], mant[5-12], exp[0-4] */
c535e923bb97a4 Claudiu Manoil 2016-09-22 362 struct qm_fqd_oac oac_init;
c535e923bb97a4 Claudiu Manoil 2016-09-22 363 };
c535e923bb97a4 Claudiu Manoil 2016-09-22 364 __be32 context_b;
c535e923bb97a4 Claudiu Manoil 2016-09-22 365 union {
c535e923bb97a4 Claudiu Manoil 2016-09-22 366 /* Treat it as 64-bit opaque */
c535e923bb97a4 Claudiu Manoil 2016-09-22 367 __be64 opaque;
c535e923bb97a4 Claudiu Manoil 2016-09-22 368 struct {
c535e923bb97a4 Claudiu Manoil 2016-09-22 369 __be32 hi;
c535e923bb97a4 Claudiu Manoil 2016-09-22 370 __be32 lo;
c535e923bb97a4 Claudiu Manoil 2016-09-22 371 };
c535e923bb97a4 Claudiu Manoil 2016-09-22 372 /* Treat it as s/w portal stashing config */
c535e923bb97a4 Claudiu Manoil 2016-09-22 373 /* see "FQD Context_A field used for [...]" */
c535e923bb97a4 Claudiu Manoil 2016-09-22 374 struct {
c535e923bb97a4 Claudiu Manoil 2016-09-22 375 struct qm_fqd_stashing stashing;
c535e923bb97a4 Claudiu Manoil 2016-09-22 376 /*
c535e923bb97a4 Claudiu Manoil 2016-09-22 377 * 48-bit address of FQ context to
c535e923bb97a4 Claudiu Manoil 2016-09-22 378 * stash, must be cacheline-aligned
c535e923bb97a4 Claudiu Manoil 2016-09-22 379 */
c535e923bb97a4 Claudiu Manoil 2016-09-22 380 __be16 context_hi;
c535e923bb97a4 Claudiu Manoil 2016-09-22 381 __be32 context_lo;
c535e923bb97a4 Claudiu Manoil 2016-09-22 382 } __packed;
c535e923bb97a4 Claudiu Manoil 2016-09-22 @383 } context_a;
c535e923bb97a4 Claudiu Manoil 2016-09-22 384 struct qm_fqd_oac oac_query;
c535e923bb97a4 Claudiu Manoil 2016-09-22 385 } __packed;
c535e923bb97a4 Claudiu Manoil 2016-09-22 386
:::::: The code at line 383 was first introduced by commit
:::::: c535e923bb97a4b361e89a6383693482057f8b0c soc/fsl: Introduce DPAA 1.x QMan device driver
:::::: TO: Claudiu Manoil <claudiu.manoil@nxp.com>
:::::: CC: Scott Wood <oss@buserror.net>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-05-20 18:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-24 1:08 include/soc/fsl/qman.h:383:4: warning: field context_a within 'struct qm_fqd' is less aligned than 'union (unnamed union at include/soc/fsl/qman.h:365:2)' and is usually due to 'struct qm_fqd' being packed, which can lead to unaligned accesses kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2025-04-09 8:55 kernel test robot
2025-04-09 11:18 ` Breno Leitao
2025-04-09 12:01 ` Vladimir Oltean
2025-04-10 12:37 ` Breno Leitao
2025-04-10 20:53 ` Vladimir Oltean
2025-05-20 18:36 kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox