Skip to content

Commit bddf3ce

Browse files
PlagueCZbyteocean
authored andcommitted
Remove soon to be obsolete __rte_packed
1 parent b3f95cf commit bddf3ce

File tree

9 files changed

+33
-33
lines changed

9 files changed

+33
-33
lines changed

include/dp_flow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ enum dp_flow_nat_type {
6262
DP_FLOW_LB_TYPE_LOCAL_NEIGH_TRAFFIC,
6363
DP_FLOW_LB_TYPE_RECIRC,
6464
DP_FLOW_LB_TYPE_FORWARD,
65-
} __rte_packed;
65+
} __attribute__((__packed__));
6666

6767
enum dp_flow_tcp_state {
6868
DP_FLOW_TCP_STATE_NONE,
@@ -84,7 +84,7 @@ struct flow_key {
8484
uint16_t type_src; /* ICMP */
8585
} src;
8686
uint32_t vni;
87-
} __rte_packed;
87+
} __attribute__((__packed__));
8888
static_assert(sizeof(((struct flow_key *)0)->vnf_type) == 1,
8989
"enum dp_vnf_type is unnecessarily big");
9090

include/dp_ipaddr.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ union dp_ipv6 {
3131
rte_be64_t _suffix;
3232
};
3333
const uint8_t bytes[DP_IPV6_ADDR_SIZE];
34-
struct __rte_packed {
34+
struct __attribute__((__packed__)) {
3535
uint8_t prefix[DP_IPV6_ADDR_SIZE - sizeof(rte_be32_t)];
3636
rte_be32_t ipv4;
3737
} _nat64;
38-
struct __rte_packed {
38+
struct __attribute__((__packed__)) {
3939
rte_be64_t prefix;
4040
uint8_t type;
4141
uint8_t subtype;
@@ -184,7 +184,7 @@ struct dp_ip_address {
184184
bool _is_v6;
185185
const bool is_v6;
186186
};
187-
} __rte_packed;
187+
} __attribute__((__packed__));
188188

189189
static __rte_always_inline
190190
int dp_ipv6_from_ipaddr(union dp_ipv6 *ipv6, const struct dp_ip_address *addr)

include/dp_lb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extern "C" {
2121
struct lb_key {
2222
uint32_t vni;
2323
struct dp_ip_address ip;
24-
} __rte_packed;
24+
} __attribute__((__packed__));
2525

2626
struct lb_port {
2727
uint8_t protocol;

include/dp_mbuf_dyn.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ extern "C" {
2424
enum dp_flow_type {
2525
DP_FLOW_WEST_EAST,
2626
DP_FLOW_SOUTH_NORTH,
27-
} __rte_packed;
27+
} __attribute__((__packed__));
2828

2929
enum dp_pkt_offload_state {
3030
DP_FLOW_NON_OFFLOAD,
3131
DP_FLOW_OFFLOAD_INSTALL,
3232
DP_FLOW_OFFLOADED,
33-
} __rte_packed;
33+
} __attribute__((__packed__));
3434

3535
enum dp_flow_dir {
3636
DP_FLOW_DIR_ORG,
3737
DP_FLOW_DIR_REPLY,
38-
} __rte_packed;
38+
} __attribute__((__packed__));
3939
#define DP_FLOW_DIR_CAPACITY 2
4040

4141
enum dp_nat_type {
@@ -46,7 +46,7 @@ enum dp_nat_type {
4646
DP_LB_RECIRC,
4747
DP_NAT_64_CHG_SRC_IP,
4848
DP_NAT_64_CHG_DST_IP,
49-
} __rte_packed;
49+
} __attribute__((__packed__));
5050

5151
struct dp_flow {
5252
enum dp_flow_type flow_type : 1;

include/dp_nat.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extern "C" {
2626
struct nat_key {
2727
uint32_t ip;
2828
uint32_t vni;
29-
} __rte_packed;
29+
} __attribute__((__packed__));
3030

3131
struct nat_entry {
3232
uint32_t nat_ip;
@@ -54,7 +54,7 @@ struct netnat_portmap_key {
5454
uint32_t vni;
5555
struct dp_ip_address src_ip;
5656
uint16_t iface_src_port;
57-
} __rte_packed;
57+
} __attribute__((__packed__));
5858

5959
struct netnat_portmap_data {
6060
uint32_t nat_ip;
@@ -68,7 +68,7 @@ struct netnat_portoverload_tbl_key {
6868
uint32_t dst_ip;
6969
uint16_t dst_port;
7070
uint8_t l4_type;
71-
} __rte_packed;
71+
} __attribute__((__packed__));
7272

7373
struct nat_check_result {
7474
bool is_vip_natted;

include/dp_vnf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ struct dp_grpc_responder;
2323

2424
enum dp_vnf_type {
2525
DP_VNF_TYPE_UNDEFINED,
26-
DP_VNF_TYPE_INTERFACE_IP,
2726
DP_VNF_TYPE_VIP,
2827
DP_VNF_TYPE_NAT,
2928
DP_VNF_TYPE_LB,
3029
DP_VNF_TYPE_LB_ALIAS_PFX,
3130
DP_VNF_TYPE_ALIAS_PFX,
32-
} __rte_packed; // for 'struct dp_flow' and 'struct flow_key'
31+
DP_VNF_TYPE_INTERFACE_IP,
32+
} __attribute__((__packed__)); // for 'struct dp_flow' and 'struct flow_key'
3333

3434
struct dp_vnf_prefix {
3535
struct dp_ip_address ol;

include/dp_vni.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extern struct rte_hash *vni_handle_tbl;
3030

3131
struct dp_vni_key {
3232
uint32_t vni;
33-
} __rte_packed;
33+
} __attribute__((__packed__));
3434

3535
struct dp_vni_data {
3636
struct rte_rib *ipv4[DP_NB_SOCKETS];

include/protocols/dp_dhcpv6.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,73 +67,73 @@ struct dhcpv6_packet {
6767
uint8_t msg_type;
6868
uint8_t transaction_id[3];
6969
uint8_t options[];
70-
} __rte_packed;
70+
} __attribute__((__packed__));
7171

7272
struct dhcpv6_option {
7373
rte_be16_t op_code;
7474
rte_be16_t op_len;
7575
uint8_t data[];
76-
} __rte_packed;
76+
} __attribute__((__packed__));
7777

7878
struct dhcpv6_opt_dns_servers {
7979
uint16_t opt_code;
8080
uint16_t opt_len;
8181
struct in6_addr dns_server_addrs[]; // Array of IPv6 addresses
82-
} __rte_packed;
82+
} __attribute__((__packed__));
8383

8484
// client id can be of any type, this is the maximum size allowed
8585
struct dhcpv6_opt_client_id {
8686
rte_be16_t op_code;
8787
rte_be16_t op_len;
8888
uint8_t id[128];
89-
} __rte_packed;
89+
} __attribute__((__packed__));
9090

9191
struct dhcpv6_ia_na {
9292
rte_be32_t iaid;
9393
rte_be32_t t1;
9494
rte_be32_t t2;
9595
struct dhcpv6_option options[];
96-
} __rte_packed;
96+
} __attribute__((__packed__));
9797

9898
struct dhcpv6_opt_ia_na {
9999
rte_be16_t op_code;
100100
rte_be16_t op_len;
101101
struct dhcpv6_ia_na ia_na;
102-
} __rte_packed;
102+
} __attribute__((__packed__));
103103

104104
struct dhcpv6_opt_vnd_cls {
105105
rte_be16_t op_code;
106106
rte_be16_t op_len;
107107
rte_be32_t entp_id;
108108
rte_be16_t opq_data_len;
109109
uint8_t opq_data[];
110-
} __rte_packed;
110+
} __attribute__((__packed__));
111111

112112
struct dhcpv6_opt_usr_cls {
113113
rte_be16_t op_code;
114114
rte_be16_t op_len;
115115
rte_be16_t sub_opt_len;
116116
uint8_t sub_opt_data[];
117-
} __rte_packed;
117+
} __attribute__((__packed__));
118118

119119
struct dhcpv6_ia_addr {
120120
uint8_t ipv6[16];
121121
rte_be32_t preferred_lifetime;
122122
rte_be32_t valid_lifetime;
123123
struct dhcpv6_option options[];
124-
} __rte_packed;
124+
} __attribute__((__packed__));
125125

126126
struct dhcpv6_opt_ia_addr {
127127
rte_be16_t op_code;
128128
rte_be16_t op_len;
129129
struct dhcpv6_ia_addr addr;
130-
} __rte_packed;
130+
} __attribute__((__packed__));
131131

132132
struct dhcpv6_opt_status_code {
133133
rte_be16_t op_code;
134134
rte_be16_t op_len;
135135
rte_be16_t status;
136-
} __rte_packed;
136+
} __attribute__((__packed__));
137137

138138
struct dhcpv6_duid_ll {
139139
rte_be16_t type;
@@ -154,31 +154,31 @@ struct dhcpv6_ia_addr_status {
154154
rte_be32_t preferred_lifetime;
155155
rte_be32_t valid_lifetime;
156156
struct dhcpv6_opt_status_code options[1];
157-
} __rte_packed;
157+
} __attribute__((__packed__));
158158

159159
struct dhcpv6_opt_ia_addr_status {
160160
rte_be16_t op_code;
161161
rte_be16_t op_len;
162162
struct dhcpv6_ia_addr_status addr;
163-
} __rte_packed;
163+
} __attribute__((__packed__));
164164

165165
struct dhcpv6_ia_na_single_addr_status {
166166
rte_be32_t iaid;
167167
rte_be32_t t1;
168168
rte_be32_t t2;
169169
struct dhcpv6_opt_ia_addr_status options[1];
170-
} __rte_packed;
170+
} __attribute__((__packed__));
171171

172172
struct dhcpv6_opt_ia_na_single_addr_status {
173173
rte_be16_t op_code;
174174
rte_be16_t op_len;
175175
struct dhcpv6_ia_na_single_addr_status ia_na;
176-
} __rte_packed;
176+
} __attribute__((__packed__));
177177

178178
struct dhcpv6_opt_boot_file_url {
179179
rte_be16_t op_code;
180180
rte_be16_t op_len;
181181
char boot_file_url[DHCPV6_BOOT_FILE_BUF_LEN];
182-
} __rte_packed;
182+
} __attribute__((__packed__));
183183

184184
#endif

src/dp_virtsvc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct dp_virtsvc_conn_key {
3434
uint16_t vf_port_id;
3535
rte_be16_t vf_l4_port;
3636
rte_be32_t vf_ip;
37-
} __rte_packed;
37+
} __attribute__((__packed__));
3838

3939
static struct dp_virtsvc *dp_virtservices;
4040
static struct dp_virtsvc *dp_virtservices_end;

0 commit comments

Comments
 (0)