Skip to content

Commit

Permalink
fix lua builds
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Wiles <[email protected]>
  • Loading branch information
KeithWiles committed Oct 15, 2024
1 parent bbf2dcb commit 73420d7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 28 deletions.
17 changes: 1 addition & 16 deletions app/pktgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <time.h>

#include <pg_compat.h>
#include <pg_strings.h>
#include <rte_config.h>

#include <rte_errno.h>
Expand Down Expand Up @@ -488,22 +489,6 @@ do_command(const char *cmd, int (*display)(char *, int))
return i;
}

static __inline__ int
pg_socket_id(void)
{
int sid = rte_socket_id();

return (sid == -1) ? 0 : sid;
}

static __inline__ int
pg_eth_dev_socket_id(int pid)
{
int sid = rte_eth_dev_socket_id(pid);

return (sid == -1) ? 0 : sid;
}

#ifndef MEMPOOL_F_DMA
#define MEMPOOL_F_DMA 0
#endif
Expand Down
16 changes: 16 additions & 0 deletions lib/common/pg_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ extern "C" {
#define PG_JUMBO_ETHER_MTU 9216
#define PG_JUMBO_FRAME_LEN (PG_JUMBO_ETHER_MTU + RTE_ETHER_CRC_LEN + RTE_ETHER_HDR_LEN)

static __inline__ int
pg_socket_id(void)
{
int sid = rte_socket_id();

return (sid == -1) ? 0 : sid;
}

static __inline__ int
pg_eth_dev_socket_id(int pid)
{
int sid = rte_eth_dev_socket_id(pid);

return (sid == -1) ? 0 : sid;
}

#ifdef __cplusplus
}
#endif
Expand Down
6 changes: 2 additions & 4 deletions lib/vec/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
# Copyright(c) <2020-2024> Intel Corporation

sources = files('vec.c')
libvec = library('vec', sources,
dependencies: [utils, dpdk])
vec = declare_dependency(link_with: libvec,
include_directories: include_directories('.'))
libvec = library('vec', sources, dependencies: [common, utils, dpdk])
vec = declare_dependency(link_with: libvec, include_directories: include_directories('.'))
8 changes: 0 additions & 8 deletions lib/vec/vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@

#include "vec.h"

static __inline__ int
pg_socket_id(void)
{
int sid = rte_socket_id();

return (sid == -1) ? 0 : sid;
}

static void
vec_obj_init(struct rte_mempool *mp, void *uarg __rte_unused, void *obj, unsigned idx __rte_unused)
{
Expand Down
1 change: 1 addition & 0 deletions lib/vec/vec.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define __VEC_H

#include <rte_malloc.h>
#include <pg_compat.h>

#ifdef __cplusplus
extern "C" {
Expand Down

0 comments on commit 73420d7

Please sign in to comment.