diff options
author | Matias Elo <matias.elo@nokia.com> | 2021-03-04 11:42:04 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2021-03-12 09:29:31 +0200 |
commit | d31e96781f22aae1414c06226ca15b6270e4c4a7 (patch) | |
tree | 85893aef970e473b5f2acbccf83837b6a54c3162 /platform/linux-dpdk/include | |
parent | 0d59329c6c5a2a7387930513c82b80e6543549bf (diff) |
linux-dpdk: config: sync packet config defines with linux-generic
Sync packet config define names and values with linux-generic to enable LTO
code reuse.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/include')
-rw-r--r-- | platform/linux-dpdk/include/odp_buffer_internal.h | 6 | ||||
-rw-r--r-- | platform/linux-dpdk/include/odp_config_internal.h | 13 | ||||
-rw-r--r-- | platform/linux-dpdk/include/odp_packet_internal.h | 11 |
3 files changed, 17 insertions, 13 deletions
diff --git a/platform/linux-dpdk/include/odp_buffer_internal.h b/platform/linux-dpdk/include/odp_buffer_internal.h index 213d2c35b..37e5d1b4f 100644 --- a/platform/linux-dpdk/include/odp_buffer_internal.h +++ b/platform/linux-dpdk/include/odp_buffer_internal.h @@ -43,12 +43,6 @@ extern "C" { #undef vector #endif -ODP_STATIC_ASSERT(CONFIG_PACKET_SEG_LEN_MIN >= 256, - "ODP Segment size must be a minimum of 256 bytes"); - -ODP_STATIC_ASSERT(CONFIG_PACKET_MAX_SEGS < 256, - "Maximum of 255 segments supported"); - /* Type size limits number of flow IDs supported */ #define BUF_HDR_MAX_FLOW_ID 255 diff --git a/platform/linux-dpdk/include/odp_config_internal.h b/platform/linux-dpdk/include/odp_config_internal.h index 9b361f348..fd3d075ec 100644 --- a/platform/linux-dpdk/include/odp_config_internal.h +++ b/platform/linux-dpdk/include/odp_config_internal.h @@ -100,9 +100,9 @@ extern "C" { #define CONFIG_PACKET_TAILROOM 0 /* - * Maximum number of segments per packet + * Maximum packet segment size including head- and tailrooms */ -#define CONFIG_PACKET_MAX_SEGS 60 +#define CONFIG_PACKET_SEG_SIZE (60 * 1024) /* * Minimum packet segment length @@ -120,14 +120,13 @@ extern "C" { * defined segment length (seg_len in odp_pool_param_t) must not be larger than * this. */ -#define CONFIG_PACKET_SEG_LEN_MAX (CONFIG_PACKET_MAX_SEGS * \ - (CONFIG_PACKET_SEG_LEN_MIN - \ - CONFIG_PACKET_HEADROOM - \ - CONFIG_PACKET_TAILROOM)) +#define CONFIG_PACKET_MAX_SEG_LEN (CONFIG_PACKET_SEG_SIZE - \ + CONFIG_PACKET_HEADROOM - \ + CONFIG_PACKET_TAILROOM) /* Maximum number of shared memory blocks. * - * This the the number of separate SHM areas that can be reserved concurrently + * This the number of separate SHM areas that can be reserved concurrently */ #define ODP_CONFIG_SHM_BLOCKS (ODP_CONFIG_POOLS + 48) diff --git a/platform/linux-dpdk/include/odp_packet_internal.h b/platform/linux-dpdk/include/odp_packet_internal.h index 34d5e60b0..ca789a3a1 100644 --- a/platform/linux-dpdk/include/odp_packet_internal.h +++ b/platform/linux-dpdk/include/odp_packet_internal.h @@ -31,6 +31,7 @@ extern "C" { #include <odp/api/abi/packet.h> #include <protocols/eth.h> #include <odp_queue_if.h> +#include <odp_config_internal.h> #include <rte_config.h> #if defined(__clang__) @@ -94,6 +95,16 @@ typedef struct { uint16_t l4_offset; } packet_parser_t; +/* Maximum number of segments per packet */ +#define PKT_MAX_SEGS 60 + +ODP_STATIC_ASSERT(PKT_MAX_SEGS < 256, "Maximum of 255 segments supported"); + +ODP_STATIC_ASSERT(CONFIG_PACKET_SEG_LEN_MIN >= 256, + "ODP Segment size must be a minimum of 256 bytes"); +ODP_STATIC_ASSERT(CONFIG_PACKET_MAX_SEG_LEN <= UINT16_MAX, + "ODP Segment size must fit in uint16_t"); + /** * Internal Packet header * |