linux/drivers/infiniband/hw/irdma
Gustavo A. R. Silva 38313c6d2a RDMA/irdma: Replace one-element array with flexible-array member
One-element and zero-length arrays are deprecated. So, replace
one-element array in struct irdma_qvlist_info with flexible-array
member.

A patch for this was sent a while ago[1]. However, it seems that, at
the time, the changes were partially folded[2][3], and the actual
flexible-array transformation was omitted. This patch fixes that.

The only binary difference seen before/after changes is shown below:

|  drivers/infiniband/hw/irdma/hw.o
| @@ -868,7 +868,7 @@
| drivers/infiniband/hw/irdma/hw.c:484 (discriminator 2)
|	size += struct_size(iw_qvlist, qv_info, rf->msix_count);
|      55b:      imul   $0x45c,%rdi,%rdi
|-     562:      add    $0x10,%rdi
|+     562:      add    $0x4,%rdi

which is, of course, expected as it reflects the mistake made
while folding the patch I've mentioned above.

Worth mentioning is the fact that with this change we save 12 bytes
of memory, as can be inferred from the diff snapshot above. Notice
that:

$ pahole -C rdma_qv_info idrivers/infiniband/hw/irdma/hw.o
struct irdma_qv_info {
	u32                        v_idx;                /*     0     4 */
	u16                        ceq_idx;              /*     4     2 */
	u16                        aeq_idx;              /*     6     2 */
	u8                         itr_idx;              /*     8     1 */

	/* size: 12, cachelines: 1, members: 4 */
	/* padding: 3 */
	/* last cacheline: 12 bytes */
};

Link: https://lore.kernel.org/linux-hardening/20210525230038.GA175516@embeddedor/ [1]
Link: https://lore.kernel.org/linux-hardening/bf46b428deef4e9e89b0ea1704b1f0e5@intel.com/ [2]
Link: https://lore.kernel.org/linux-rdma/20210520143809.819-1-shiraz.saleem@intel.com/T/#u [3]
Fixes: 44d9e52977 ("RDMA/irdma: Implement device initialization definitions")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/ZMpsQrZadBaJGkt4@work
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2023-08-03 21:11:18 +03:00
..
cm.c RDMA/irdma: Cleanup and rename irdma_netdev_vlan_ipv6() 2023-07-26 15:05:36 +03:00
cm.h RDMA/irdma: Increase iWARP CM default rexmit count 2023-03-19 11:37:56 +02:00
ctrl.c RDMA/irdma: Drop a local in irdma_sc_get_next_aeqe 2023-07-26 15:05:36 +03:00
defs.h RDMA/irdma: Refactor HW statistics 2023-03-19 11:36:03 +02:00
hmc.c RDMA/irdma: Remove enum irdma_status_code 2022-02-23 15:24:18 -04:00
hmc.h RDMA/irdma: Remove enum irdma_status_code 2022-02-23 15:24:18 -04:00
hw.c RDMA/irdma: Fix one kernel-doc comment 2023-07-31 10:38:53 +03:00
i40iw_hw.c RDMA/irdma: Use HW specific minimum WQ size 2023-07-30 15:43:00 +03:00
i40iw_hw.h RDMA/irdma: Use HW specific minimum WQ size 2023-07-30 15:43:00 +03:00
i40iw_if.c RDMA/irdma: Fix Passthrough mode in VM 2022-02-28 12:07:40 -04:00
icrdma_hw.c RDMA/irdma: Use HW specific minimum WQ size 2023-07-30 15:43:00 +03:00
icrdma_hw.h RDMA/irdma: Use HW specific minimum WQ size 2023-07-30 15:43:00 +03:00
irdma.h RDMA/irdma: Use HW specific minimum WQ size 2023-07-30 15:43:00 +03:00
Kconfig RDMA/irdma: Use correct kconfig symbol for AUXILIARY_BUS 2021-08-19 10:28:49 -03:00
main.c RDMA/irdma: Add support for address handle re-use 2022-03-15 16:22:55 -03:00
main.h RDMA/irdma: Replace one-element array with flexible-array member 2023-08-03 21:11:18 +03:00
Makefile RDMA/irdma: Add irdma Kconfig/Makefile and remove i40iw 2021-06-02 20:06:36 -03:00
osdep.h RDMA/irdma: Remove enum irdma_status_code 2022-02-23 15:24:18 -04:00
pble.c RDMA/irdma: Refactor PBLE functions 2023-03-19 11:36:33 +02:00
pble.h RDMA/irdma: Refactor PBLE functions 2023-03-19 11:36:33 +02:00
protos.h RDMA/irdma: Refactor HW statistics 2023-03-19 11:36:03 +02:00
puda.c RDMA/irdma: Remove the redundant variable 2022-04-04 10:50:24 -03:00
puda.h RDMA/irdma: Remove enum irdma_status_code 2022-02-23 15:24:18 -04:00
trace_cm.h RDMA: Constify netdev->dev_addr accesses 2021-10-25 14:33:09 -03:00
trace.c RDMA/irdma: Add dynamic tracing for CM 2021-06-02 19:55:19 -03:00
trace.h RDMA/irdma: Add dynamic tracing for CM 2021-06-02 19:55:19 -03:00
type.h RDMA/irdma: Refactor HW statistics 2023-03-19 11:36:03 +02:00
uda_d.h RDMA/irdma: Add RoCEv2 UD OP support 2021-06-02 19:55:18 -03:00
uda.c RDMA/irdma: Make irdma_create_mg_ctx return a void 2022-02-28 11:32:42 -04:00
uda.h RDMA/irdma: Remove enum irdma_status_code 2022-02-23 15:24:18 -04:00
uk.c RDMA: Remove unnecessary ternary operators 2023-07-31 15:16:12 +03:00
user.h RDMA/irdma: Use HW specific minimum WQ size 2023-07-30 15:43:00 +03:00
utils.c RDMA/irdma: Add table based lookup for CQ pointer during an event 2023-07-26 15:05:36 +03:00
verbs.c RDMA: Remove unnecessary ternary operators 2023-07-31 15:16:12 +03:00
verbs.h RDMA/irdma: Allow accurate reporting on QP max send/recv WR 2023-07-30 15:43:00 +03:00
ws.c RDMA/irdma: Remove enum irdma_status_code 2022-02-23 15:24:18 -04:00
ws.h RDMA/irdma: Remove enum irdma_status_code 2022-02-23 15:24:18 -04:00