Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

octeon_ep: assert hardware structure sizes

Clean up structure defines related to hardware data to be
asserted to fixed sizes, as padding is not allowed
by hardware.

Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Shinas Rasheed and committed by
David S. Miller
e10f4019 a792197f

+7
+3
drivers/net/ethernet/marvell/octeon_ep/octep_rx.h
··· 20 20 dma_addr_t buffer_ptr; 21 21 u64 info_ptr; 22 22 }; 23 + static_assert(sizeof(struct octep_oq_desc_hw) == 16); 23 24 24 25 #define OCTEP_OQ_DESC_SIZE (sizeof(struct octep_oq_desc_hw)) 25 26 ··· 40 39 /* checksum verified. */ 41 40 u64 csum_verified:2; 42 41 }; 42 + static_assert(sizeof(struct octep_oq_resp_hw_ext) == 8); 43 43 44 44 #define OCTEP_OQ_RESP_HW_EXT_SIZE (sizeof(struct octep_oq_resp_hw_ext)) 45 45 ··· 52 50 /* The Length of the packet. */ 53 51 __be64 length; 54 52 }; 53 + static_assert(sizeof(struct octep_oq_resp_hw) == 8); 55 54 56 55 #define OCTEP_OQ_RESP_HW_SIZE (sizeof(struct octep_oq_resp_hw)) 57 56
+4
drivers/net/ethernet/marvell/octeon_ep/octep_tx.h
··· 36 36 u16 len[4]; 37 37 dma_addr_t dma_ptr[4]; 38 38 }; 39 + static_assert(sizeof(struct octep_tx_sglist_desc) == 40); 39 40 40 41 /* Each Scatter/Gather entry sent to hardwar hold four pointers. 41 42 * So, number of entries required is (MAX_SKB_FRAGS + 1)/4, where '+1' ··· 240 239 /* Reserved3 */ 241 240 u64 reserved3:1; 242 241 }; 242 + static_assert(sizeof(struct octep_instr_hdr) == 8); 243 243 244 244 /* Hardware Tx completion response header */ 245 245 struct octep_instr_resp_hdr { ··· 265 263 /* Opcode for the return packet */ 266 264 u64 opcode:16; 267 265 }; 266 + static_assert(sizeof(struct octep_instr_hdr) == 8); 268 267 269 268 /* 64-byte Tx instruction format. 270 269 * Format of instruction for a 64-byte mode input queue. ··· 296 293 /* Additional headers available in a 64-byte instruction. */ 297 294 u64 exhdr[4]; 298 295 }; 296 + static_assert(sizeof(struct octep_tx_desc_hw) == 64); 299 297 300 298 #define OCTEP_IQ_DESC_SIZE (sizeof(struct octep_tx_desc_hw)) 301 299 #endif /* _OCTEP_TX_H_ */