[dpdk-dev] [PATCH v4 02/17] net/ionic: add hardware structures definitions

Alfredo Cardigliano cardigliano at ntop.org
Fri Jan 3 09:22:20 CET 2020


> On 20 Dec 2019, at 01:16, Stephen Hemminger <stephen at networkplumber.org> wrote:
> 
> On Thu, 19 Dec 2019 23:18:32 +0100
> Alfredo Cardigliano <cardigliano at ntop.org> wrote:
> 
>> +
>> +#pragma pack(push, 1)
>> +
> 
> Really, packing leads to unaligned data structures and is generally
> a bad idea.


This specific file defines data structures shared with the adapter (and other OS drivers)
thus any additional padding should be avoided. Actually the pragma is unnecessary 
here, as who wrote this file worked pretty hard tweaking the structs by hand to be sure
that they are all formed such that the fields are on their appropriate byte boundaries 
and all field padding is explicitly defined.

Alfredo


More information about the dev mailing list