remarkable-linux/include/linux/mlx5
Matan Barak b4ff3a36d3 net/mlx5: Use offset based reserved field names in the IFC header file
mlx5_ifc.h is a header file representing the API and ABI between
the driver to the firmware and hardware. This file is used from
both the mlx5_ib and mlx5_core drivers.

Previously, this file used incrementing counter to indicate
reserved fields, for example:

struct mlx5_ifc_odp_per_transport_service_cap_bits {
        u8         send[0x1];
        u8         receive[0x1];
        u8         write[0x1];
        u8         read[0x1];
        u8         reserved_0[0x1];
        u8         srq_receive[0x1];
        u8         reserved_1[0x1a];
};

If one developer implements through net-next feature A that uses
reserved_0, they replace it with featureA and renames reserved_1 to
reserved_0. In the same kernel cycle, a 2nd developer could implement
feature B through the rdma tree, that uses reserved_1 and split it to
featureB and a smaller reserved_1 field. This will cause a conflict
when the two trees are merged.

The source of this conflict is that the 1st developer changed *all*
reserved fields.

As Linus suggested, we change the layout of structs to:

struct mlx5_ifc_odp_per_transport_service_cap_bits {
	u8         send[0x1];
	u8         receive[0x1];
	u8         write[0x1];
	u8         read[0x1];
	u8         reserved_at_4[0x1];
	u8         srq_receive[0x1];
	u8         reserved_at_6[0x1a];
};

This makes the conflicts much more rare and preserves the locality of
changes.

Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Alaa Hleihel <alaa@mellanox.com>
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-16 15:21:47 -05:00
..
cmd.h net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
cq.h net/mlx5_core: Fix trimming down IRQ number 2016-01-17 12:08:04 -05:00
device.h Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00
doorbell.h net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
driver.h Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00
fs.h IB/mlx5: Add flow steering support 2016-01-11 17:48:53 -05:00
mlx5_ifc.h net/mlx5: Use offset based reserved field names in the IFC header file 2016-02-16 15:21:47 -05:00
qp.h {IB, net}/mlx5: Move the modify QP operation table to mlx5_ib 2016-01-21 12:01:09 -05:00
srq.h net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
transobj.h IB/mlx5: Support setting Ethernet priority for Raw Packet QPs 2016-01-21 12:01:09 -05:00
vport.h Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00