Skip to content

Commit 6faaf06

Browse files
committed
FF_USE_PAGE_ARRAY compatible DPDK 19.11.
1 parent b9be57e commit 6faaf06

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/ff_memory.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ typedef struct _list_manager_s
9999
}StackList_t;
100100

101101
static StackList_t ff_mpage_ctl = {0};
102-
static uint64_t ff_page_start = NULL, ff_page_end = NULL;
102+
static uint64_t ff_page_start = (uint64_t)NULL, ff_page_end = (uint64_t)NULL;
103103
static phys_addr_t *ff_mpage_phy = NULL;
104104

105105
static inline void *stklist_pop(StackList_t *p);
@@ -229,7 +229,7 @@ int ff_mmap_init()
229229
{
230230
int err = 0;
231231
int i = 0;
232-
uint64_t virt_addr = NULL;
232+
uint64_t virt_addr = (uint64_t)NULL;
233233
phys_addr_t phys_addr = 0;
234234
uint64_t bsd_memsz = (ff_global_cfg.freebsd.mem_size << 20);
235235
unsigned int bsd_pagesz = 0;
@@ -318,25 +318,25 @@ static inline void ff_offload_set(struct ff_dpdk_if_context *ctx, void *m, struc
318318

319319
if (offload.ip_csum) {
320320
/* ipv6 not supported yet */
321-
struct ipv4_hdr *iph;
321+
struct rte_ipv4_hdr *iph;
322322
int iph_len;
323-
iph = (struct ipv4_hdr *)(data + ETHER_HDR_LEN);
323+
iph = (struct rte_ipv4_hdr *)(data + RTE_ETHER_HDR_LEN);
324324
iph_len = (iph->version_ihl & 0x0f) << 2;
325325

326326
head->ol_flags |= PKT_TX_IP_CKSUM | PKT_TX_IPV4;
327-
head->l2_len = ETHER_HDR_LEN;
327+
head->l2_len = RTE_ETHER_HDR_LEN;
328328
head->l3_len = iph_len;
329329
}
330330

331331
if (ctx->hw_features.tx_csum_l4) {
332-
struct ipv4_hdr *iph;
332+
struct rte_ipv4_hdr *iph;
333333
int iph_len;
334-
iph = (struct ipv4_hdr *)(data + ETHER_HDR_LEN);
334+
iph = (struct rte_ipv4_hdr *)(data + RTE_ETHER_HDR_LEN);
335335
iph_len = (iph->version_ihl & 0x0f) << 2;
336336

337337
if (offload.tcp_csum) {
338338
head->ol_flags |= PKT_TX_TCP_CKSUM;
339-
head->l2_len = ETHER_HDR_LEN;
339+
head->l2_len = RTE_ETHER_HDR_LEN;
340340
head->l3_len = iph_len;
341341
}
342342

@@ -356,9 +356,9 @@ static inline void ff_offload_set(struct ff_dpdk_if_context *ctx, void *m, struc
356356
* used as helpers.
357357
*/
358358
if (offload.tso_seg_size) {
359-
struct tcp_hdr *tcph;
359+
struct rte_tcp_hdr *tcph;
360360
int tcph_len;
361-
tcph = (struct tcp_hdr *)((char *)iph + iph_len);
361+
tcph = (struct rte_tcp_hdr *)((char *)iph + iph_len);
362362
tcph_len = (tcph->data_off & 0xf0) >> 2;
363363
tcph->cksum = rte_ipv4_phdr_cksum(iph, PKT_TX_TCP_SEG);
364364

@@ -369,7 +369,7 @@ static inline void ff_offload_set(struct ff_dpdk_if_context *ctx, void *m, struc
369369

370370
if (offload.udp_csum) {
371371
head->ol_flags |= PKT_TX_UDP_CKSUM;
372-
head->l2_len = ETHER_HDR_LEN;
372+
head->l2_len = RTE_ETHER_HDR_LEN;
373373
head->l3_len = iph_len;
374374
}
375375
}

0 commit comments

Comments
 (0)