Message ID | 1460447801-8686-4-git-send-email-anders.roxell@linaro.org |
---|---|
State | New |
Headers | show |
I added comments for v2 for that patch. I still think that we don't need to add prefix to each function and declaring #pragma can be used for same functionality. Maxim. On 04/12/16 10:56, Anders Roxell wrote: > Internal functions should not be visible in the ABI. > > Signed-off-by: Anders Roxell <anders.roxell@linaro.org> > --- > .../linux-generic/include/odp_buffer_internal.h | 7 +- > .../include/odp_classification_internal.h | 42 ++++++------ > platform/linux-generic/include/odp_internal.h | 12 ++-- > .../include/odp_name_table_internal.h | 23 +++---- > .../linux-generic/include/odp_packet_internal.h | 27 ++++---- > .../linux-generic/include/odp_packet_io_internal.h | 61 +++++++++--------- > .../linux-generic/include/odp_packet_io_queue.h | 25 ++++---- > platform/linux-generic/include/odp_packet_socket.h | 29 +++++---- > .../linux-generic/include/odp_pkt_queue_internal.h | 24 +++---- > platform/linux-generic/include/odp_pool_internal.h | 3 +- > .../linux-generic/include/odp_queue_internal.h | 75 ++++++++++++---------- > .../linux-generic/include/odp_schedule_internal.h | 12 ++-- > .../include/odp_sorted_list_internal.h | 42 ++++++------ > .../include/odp_timer_wheel_internal.h | 29 +++++---- > platform/linux-generic/odp_packet_io.c | 2 +- > platform/linux-generic/odp_schedule.c | 5 +- > platform/linux-generic/pktio/socket.c | 5 +- > 17 files changed, 228 insertions(+), 195 deletions(-) > > diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h > index 7a06b00..fd6c1da 100644 > --- a/platform/linux-generic/include/odp_buffer_internal.h > +++ b/platform/linux-generic/include/odp_buffer_internal.h > @@ -30,6 +30,7 @@ extern "C" { > #include <odp/api/thread.h> > #include <odp/api/event.h> > #include <odp_forward_typedefs_internal.h> > +#include <odp_internal.h> > > #define ODP_BITSIZE(x) \ > ((x) <= 2 ? 1 : \ > @@ -164,9 +165,9 @@ typedef struct { > #define ODP_FREEBUF -1 > > /* Forward declarations */ > -odp_buffer_t buffer_alloc(odp_pool_t pool, size_t size); > -int buffer_alloc_multi(odp_pool_t pool_hdl, size_t size, > - odp_buffer_t buf[], int num); > +odp_buffer_t HIDDEN buffer_alloc(odp_pool_t pool, size_t size); > +int HIDDEN buffer_alloc_multi(odp_pool_t pool_hdl, size_t size, > + odp_buffer_t buf[], int num); > > #ifdef __cplusplus > } > diff --git a/platform/linux-generic/include/odp_classification_internal.h b/platform/linux-generic/include/odp_classification_internal.h > index 86b40fc..c69a8f8 100644 > --- a/platform/linux-generic/include/odp_classification_internal.h > +++ b/platform/linux-generic/include/odp_classification_internal.h > @@ -25,6 +25,7 @@ extern "C" { > #include <odp/api/packet_io.h> > #include <odp_packet_io_internal.h> > #include <odp_classification_datamodel.h> > +#include <odp_internal.h> > > /** Classification Internal function **/ > > @@ -40,8 +41,8 @@ with the PKTIO interface. > Returns the default cos if the packet does not match any PMR > Returns the error_cos if the packet has an error > **/ > -cos_t *pktio_select_cos(pktio_entry_t *pktio, const uint8_t *pkt_addr, > - odp_packet_hdr_t *pkt_hdr); > +cos_t HIDDEN *pktio_select_cos(pktio_entry_t *pktio, const uint8_t *pkt_addr, > + odp_packet_hdr_t *pkt_hdr); > > /** > @internal > @@ -51,8 +52,8 @@ Select a CoS for the given Packet based on QoS values > This function returns the COS object matching the L2 and L3 QoS > based on the l3_preference value of the pktio > **/ > -cos_t *match_qos_cos(pktio_entry_t *entry, const uint8_t *pkt_addr, > - odp_packet_hdr_t *hdr); > +cos_t HIDDEN *match_qos_cos(pktio_entry_t *entry, const uint8_t *pkt_addr, > + odp_packet_hdr_t *hdr); > /** > Packet Classifier > > @@ -61,14 +62,14 @@ This function calls Classifier module internal functions for a given packet and > enqueues the packet to specific Queue based on PMR and CoS selected. > The packet is allocated from the pool associated with the CoS > **/ > -int packet_classifier(odp_pktio_t pktio, odp_packet_t pkt); > +int HIDDEN packet_classifier(odp_pktio_t pktio, odp_packet_t pkt); > > /** > @internal > > Same as packet classifier uses linux-generic internal pktio struct > **/ > -int _odp_packet_classifier(pktio_entry_t *entry, odp_packet_t pkt); > +int HIDDEN _odp_packet_classifier(pktio_entry_t *entry, odp_packet_t pkt); > > /** > Packet IO classifier init > @@ -76,7 +77,7 @@ Packet IO classifier init > This function does initialization of classifier object associated with pktio. > This function should be called during pktio initialization. > **/ > -int pktio_classifier_init(pktio_entry_t *pktio); > +int HIDDEN pktio_classifier_init(pktio_entry_t *pktio); > > /** > @internal > @@ -87,16 +88,16 @@ This function gets called recursively to check the chained PMR Term value > with the packet. > > **/ > -cos_t *match_pmr_cos(cos_t *cos, const uint8_t *pkt_addr, pmr_t *pmr, > - odp_packet_hdr_t *hdr); > +cos_t HIDDEN *match_pmr_cos(cos_t *cos, const uint8_t *pkt_addr, pmr_t *pmr, > + odp_packet_hdr_t *hdr); > /** > @internal > CoS associated with L3 QoS value > > This function returns the CoS associated with L3 QoS value > **/ > -cos_t *match_qos_l3_cos(pmr_l3_cos_t *l3_cos, const uint8_t *pkt_addr, > - odp_packet_hdr_t *hdr); > +cos_t HIDDEN *match_qos_l3_cos(pmr_l3_cos_t *l3_cos, const uint8_t *pkt_addr, > + odp_packet_hdr_t *hdr); > > /** > @internal > @@ -104,8 +105,8 @@ CoS associated with L2 QoS value > > This function returns the CoS associated with L2 QoS value > **/ > -cos_t *match_qos_l2_cos(pmr_l2_cos_t *l2_cos, const uint8_t *pkt_addr, > - odp_packet_hdr_t *hdr); > +cos_t HIDDEN *match_qos_l2_cos(pmr_l2_cos_t *l2_cos, const uint8_t *pkt_addr, > + odp_packet_hdr_t *hdr); > /** > @internal > Flow Signature Calculation > @@ -113,39 +114,39 @@ Flow Signature Calculation > This function calculates the Flow Signature for a packet based on > CoS and updates in Packet Meta Data > **/ > -int update_flow_signature(uint8_t *pkt_addr, cos_t *cos); > +int HIDDEN update_flow_signature(uint8_t *pkt_addr, cos_t *cos); > > /** > @internal > Allocate a odp_pmr_t Handle > */ > -odp_pmr_t alloc_pmr(pmr_t **pmr); > +odp_pmr_t HIDDEN alloc_pmr(pmr_t **pmr); > > /** > @internal > Pointer to pmr_t Handle > This function checks for validity of odp_pmr_t Handle > */ > -pmr_t *get_pmr_entry(odp_pmr_t pmr_id); > +pmr_t HIDDEN *get_pmr_entry(odp_pmr_t pmr_id); > > /** > @internal > Pointer to pmr_t Handle > */ > -pmr_t *get_pmr_entry_internal(odp_pmr_t pmr_id); > +pmr_t HIDDEN *get_pmr_entry_internal(odp_pmr_t pmr_id); > > /** > @internal > Pointer to odp_cos_t Handle > */ > -cos_t *get_cos_entry(odp_cos_t cos_id); > +cos_t HIDDEN *get_cos_entry(odp_cos_t cos_id); > > /** > @internal > Pointer to odp_cos_t Handle > This function checks for validity of odp_cos_t Handle > */ > -cos_t *get_cos_entry_internal(odp_cos_t cos_id); > +cos_t HIDDEN *get_cos_entry_internal(odp_cos_t cos_id); > > /** > @internal > @@ -155,7 +156,8 @@ This function goes through each PMR_TERM value in pmr_t structure and > calls verification function for each term.Returns 1 if PMR matches or 0 > Otherwise. > **/ > -int verify_pmr(pmr_t *pmr, const uint8_t *pkt_addr, odp_packet_hdr_t *pkt_hdr); > +int HIDDEN verify_pmr(pmr_t *pmr, const uint8_t *pkt_addr, > + odp_packet_hdr_t *pkt_hdr); > > #ifdef __cplusplus > } > diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h > index 08624ae..01d7630 100644 > --- a/platform/linux-generic/include/odp_internal.h > +++ b/platform/linux-generic/include/odp_internal.h > @@ -28,7 +28,7 @@ extern "C" { > # define HIDDEN > #endif > > -extern __thread int __odp_errno; > +extern __thread int HIDDEN __odp_errno; > > #define MAX_CPU_NUMBER 128 > > @@ -69,8 +69,8 @@ enum init_stage { > > extern struct odp_global_data_s odp_global_data; > > -int _odp_term_global(enum init_stage stage); > -int _odp_term_local(enum init_stage stage); > +int HIDDEN _odp_term_global(enum init_stage stage); > +int HIDDEN _odp_term_local(enum init_stage stage); > > int odp_system_info_init(void); > int odp_system_info_term(void); > @@ -117,10 +117,10 @@ int odp_time_term_global(void); > int odp_tm_init_global(void); > int odp_tm_term_global(void); > > -int _odp_int_name_tbl_init_global(void); > -int _odp_int_name_tbl_term_global(void); > +int HIDDEN _odp_int_name_tbl_init_global(void); > +int HIDDEN _odp_int_name_tbl_term_global(void); > > -void _odp_flush_caches(void); > +void HIDDEN _odp_flush_caches(void); > > int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo); > uint64_t odp_cpu_hz_current(int id); > diff --git a/platform/linux-generic/include/odp_name_table_internal.h b/platform/linux-generic/include/odp_name_table_internal.h > index fba8080..c89316b 100644 > --- a/platform/linux-generic/include/odp_name_table_internal.h > +++ b/platform/linux-generic/include/odp_name_table_internal.h > @@ -15,6 +15,7 @@ extern "C" { > > #include <stdint.h> > #include <odp.h> > +#include <odp_internal.h> > > typedef enum { > ODP_COS_HANDLE, > @@ -37,23 +38,23 @@ typedef uint32_t _odp_int_name_t; > > #define _ODP_INT_NAME_LEN 32 > > -_odp_int_name_t _odp_int_name_tbl_add(const char *name, > - uint8_t name_kind, > - uint64_t user_data); > +_odp_int_name_t HIDDEN _odp_int_name_tbl_add(const char *name, > + uint8_t name_kind, > + uint64_t user_data); > > -_odp_int_name_t _odp_int_name_tbl_lookup(const char *name, > - uint8_t name_kind); > +_odp_int_name_t HIDDEN _odp_int_name_tbl_lookup(const char *name, > + uint8_t name_kind); > > -int _odp_int_name_tbl_delete(_odp_int_name_t odp_name); > +int HIDDEN _odp_int_name_tbl_delete(_odp_int_name_t odp_name); > > -const char *_odp_int_name_tbl_name(_odp_int_name_t odp_name); > +const char HIDDEN *_odp_int_name_tbl_name(_odp_int_name_t odp_name); > > -uint64_t _odp_int_name_tbl_user_data(_odp_int_name_t odp_name); > +uint64_t HIDDEN _odp_int_name_tbl_user_data(_odp_int_name_t odp_name); > > -void _odp_int_name_tbl_stats_print(void); > +void HIDDEN _odp_int_name_tbl_stats_print(void); > > -int _odp_int_name_tbl_init_global(void); > -int _odp_int_name_tbl_term_global(void); > +int HIDDEN _odp_int_name_tbl_init_global(void); > +int HIDDEN _odp_int_name_tbl_term_global(void); > > #ifdef __cplusplus > } > diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h > index 92b770f..f5f8bae 100644 > --- a/platform/linux-generic/include/odp_packet_internal.h > +++ b/platform/linux-generic/include/odp_packet_internal.h > @@ -27,6 +27,7 @@ extern "C" { > #include <odp/api/packet_io.h> > #include <odp/api/crypto.h> > #include <odp_crypto_internal.h> > +#include <odp_internal.h> > > #define PACKET_JUMBO_LEN (9 * 1024) > > @@ -244,28 +245,29 @@ static inline int packet_parse_not_complete(odp_packet_hdr_t *pkt_hdr) > } > > /* Forward declarations */ > -int _odp_packet_copy_to_packet(odp_packet_t srcpkt, uint32_t srcoffset, > - odp_packet_t dstpkt, uint32_t dstoffset, > - uint32_t len); > +int HIDDEN _odp_packet_copy_to_packet(odp_packet_t srcpkt, uint32_t srcoffset, > + odp_packet_t dstpkt, uint32_t dstoffset, > + uint32_t len); > > -void _odp_packet_copy_md_to_packet(odp_packet_t srcpkt, odp_packet_t dstpkt); > +void HIDDEN _odp_packet_copy_md_to_packet(odp_packet_t srcpkt, > + odp_packet_t dstpkt); > > -odp_packet_t packet_alloc(odp_pool_t pool_hdl, uint32_t len, int parse); > +odp_packet_t HIDDEN packet_alloc(odp_pool_t pool_hdl, uint32_t len, int parse); > > /* Fill in parser metadata for L2 */ > -void packet_parse_l2(odp_packet_hdr_t *pkt_hdr); > +void HIDDEN packet_parse_l2(odp_packet_hdr_t *pkt_hdr); > > /* Perform full packet parse */ > -int packet_parse_full(odp_packet_hdr_t *pkt_hdr); > +int HIDDEN packet_parse_full(odp_packet_hdr_t *pkt_hdr); > > /* Reset parser metadata for a new parse */ > -void packet_parse_reset(odp_packet_hdr_t *pkt_hdr); > +void HIDDEN packet_parse_reset(odp_packet_hdr_t *pkt_hdr); > > /* Convert a packet handle to a buffer handle */ > -odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); > +odp_buffer_t HIDDEN _odp_packet_to_buffer(odp_packet_t pkt); > > /* Convert a buffer handle to a packet handle */ > -odp_packet_t _odp_packet_from_buffer(odp_buffer_t buf); > +odp_packet_t HIDDEN _odp_packet_from_buffer(odp_buffer_t buf); > > static inline int packet_hdr_has_l2(odp_packet_hdr_t *pkt_hdr) > { > @@ -282,9 +284,10 @@ static inline int packet_hdr_has_eth(odp_packet_hdr_t *pkt_hdr) > return pkt_hdr->input_flags.eth; > } > > -int _odp_parse_common(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr); > +int HIDDEN _odp_parse_common(odp_packet_hdr_t *pkt_hdr, > + const uint8_t *parseptr); > > -int _odp_cls_parse(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr); > +int HIDDEN _odp_cls_parse(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr); > > #ifdef __cplusplus > } > diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h > index cca5c39..0573e3c 100644 > --- a/platform/linux-generic/include/odp_packet_io_internal.h > +++ b/platform/linux-generic/include/odp_packet_io_internal.h > @@ -23,6 +23,7 @@ extern "C" { > #include <odp_classification_datamodel.h> > #include <odp_align_internal.h> > #include <odp_debug_internal.h> > +#include <odp_internal.h> > > #include <odp/api/config.h> > #include <odp/api/hints.h> > @@ -133,7 +134,7 @@ typedef struct { > pktio_entry_t entries[ODP_CONFIG_PKTIO_ENTRIES]; > } pktio_table_t; > > -int is_free(pktio_entry_t *entry); > +int HIDDEN is_free(pktio_entry_t *entry); > > typedef struct pktio_if_ops { > const char *name; > @@ -168,10 +169,10 @@ typedef struct pktio_if_ops { > odp_packet_t packets[], int num); > } pktio_if_ops_t; > > -int _odp_packet_cls_enq(pktio_entry_t *pktio_entry, const uint8_t *base, > - uint16_t buf_len, odp_packet_t *pkt_ret); > +int HIDDEN _odp_packet_cls_enq(pktio_entry_t *pktio_entry, const uint8_t *base, > + uint16_t buf_len, odp_packet_t *pkt_ret); > > -extern void *pktio_entry_ptr[]; > +extern void HIDDEN *pktio_entry_ptr[]; > > static inline int pktio_to_id(odp_pktio_t pktio) > { > @@ -202,38 +203,38 @@ static inline void pktio_cls_enabled_set(pktio_entry_t *entry, int ena) > entry->s.cls_enabled = ena; > } > > -int pktin_poll(pktio_entry_t *entry, int num_queue, int index[]); > +int HIDDEN pktin_poll(pktio_entry_t *entry, int num_queue, int index[]); > > /* > * Dummy single queue implementations of multi-queue API > */ > -int single_capability(odp_pktio_capability_t *capa); > -int single_input_queues_config(pktio_entry_t *entry, > - const odp_pktin_queue_param_t *param); > -int single_output_queues_config(pktio_entry_t *entry, > - const odp_pktout_queue_param_t *param); > -int single_recv_queue(pktio_entry_t *entry, int index, odp_packet_t packets[], > - int num); > -int single_send_queue(pktio_entry_t *entry, int index, odp_packet_t packets[], > - int num); > - > -extern const pktio_if_ops_t netmap_pktio_ops; > -extern const pktio_if_ops_t dpdk_pktio_ops; > -extern const pktio_if_ops_t sock_mmsg_pktio_ops; > -extern const pktio_if_ops_t sock_mmap_pktio_ops; > -extern const pktio_if_ops_t loopback_pktio_ops; > +int HIDDEN single_capability(odp_pktio_capability_t *capa); > +int HIDDEN single_input_queues_config(pktio_entry_t *entry, > + const odp_pktin_queue_param_t *param); > +int HIDDEN single_output_queues_config(pktio_entry_t *entry, > + const odp_pktout_queue_param_t *param); > +int HIDDEN single_recv_queue(pktio_entry_t *entry, int index, > + odp_packet_t packets[], int num); > +int HIDDEN single_send_queue(pktio_entry_t *entry, int index, > + odp_packet_t packets[], int num); > + > +extern const HIDDEN pktio_if_ops_t netmap_pktio_ops; > +extern const HIDDEN pktio_if_ops_t dpdk_pktio_ops; > +extern const HIDDEN pktio_if_ops_t sock_mmsg_pktio_ops; > +extern const HIDDEN pktio_if_ops_t sock_mmap_pktio_ops; > +extern const HIDDEN pktio_if_ops_t loopback_pktio_ops; > #ifdef HAVE_PCAP > -extern const pktio_if_ops_t pcap_pktio_ops; > +extern const HIDDEN pktio_if_ops_t pcap_pktio_ops; > #endif > -extern const pktio_if_ops_t tap_pktio_ops; > -extern const pktio_if_ops_t * const pktio_if_ops[]; > - > -int sysfs_stats(pktio_entry_t *pktio_entry, > - odp_pktio_stats_t *stats); > -int sock_stats_fd(pktio_entry_t *pktio_entry, > - odp_pktio_stats_t *stats, > - int fd); > -int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd); > +extern const HIDDEN pktio_if_ops_t tap_pktio_ops; > +extern const HIDDEN pktio_if_ops_t * const pktio_if_ops[]; > + > +int HIDDEN sysfs_stats(pktio_entry_t *pktio_entry, > + odp_pktio_stats_t *stats); > +int HIDDEN sock_stats_fd(pktio_entry_t *pktio_entry, > + odp_pktio_stats_t *stats, > + int fd); > +int HIDDEN sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd); > > #ifdef __cplusplus > } > diff --git a/platform/linux-generic/include/odp_packet_io_queue.h b/platform/linux-generic/include/odp_packet_io_queue.h > index 12e2b9f..39d9bfb 100644 > --- a/platform/linux-generic/include/odp_packet_io_queue.h > +++ b/platform/linux-generic/include/odp_packet_io_queue.h > @@ -20,6 +20,7 @@ extern "C" { > > #include <odp_queue_internal.h> > #include <odp_buffer_internal.h> > +#include <odp_internal.h> > > /** Max nbr of pkts to receive in one burst (keep same as QUEUE_MULTI_MAX) */ > #define ODP_PKTIN_QUEUE_MAX_BURST 16 > @@ -27,21 +28,23 @@ extern "C" { > _ODP_STATIC_ASSERT(ODP_PKTIN_QUEUE_MAX_BURST >= QUEUE_MULTI_MAX, > "ODP_PKTIN_DEQ_MULTI_MAX_ERROR"); > > -int pktin_enqueue(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, int sustain); > -odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *queue); > +int HIDDEN pktin_enqueue(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, > + int sustain); > +odp_buffer_hdr_t HIDDEN *pktin_dequeue(queue_entry_t *queue); > > -int pktin_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num, > - int sustain); > -int pktin_deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num); > +int HIDDEN pktin_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], > + int num, int sustain); > +int HIDDEN pktin_deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], > + int num); > > > -int pktout_enqueue(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr); > -odp_buffer_hdr_t *pktout_dequeue(queue_entry_t *queue); > +int HIDDEN pktout_enqueue(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr); > +odp_buffer_hdr_t HIDDEN *pktout_dequeue(queue_entry_t *queue); > > -int pktout_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], > - int num); > -int pktout_deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], > - int num); > +int HIDDEN pktout_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], > + int num); > +int HIDDEN pktout_deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], > + int num); > > #ifdef __cplusplus > } > diff --git a/platform/linux-generic/include/odp_packet_socket.h b/platform/linux-generic/include/odp_packet_socket.h > index bc83e80..333044a 100644 > --- a/platform/linux-generic/include/odp_packet_socket.h > +++ b/platform/linux-generic/include/odp_packet_socket.h > @@ -22,6 +22,8 @@ > > #include <linux/version.h> > > +#include <odp_internal.h> > + > /* > * Packet socket config: > */ > @@ -100,27 +102,27 @@ ethaddrs_equal(unsigned char mac_a[], unsigned char mac_b[]) > /** > * Read the MAC address from a packet socket > */ > -int mac_addr_get_fd(int fd, const char *name, unsigned char mac_dst[]); > +int HIDDEN mac_addr_get_fd(int fd, const char *name, unsigned char mac_dst[]); > > /** > * Read the MTU from a packet socket > */ > -uint32_t mtu_get_fd(int fd, const char *name); > +uint32_t HIDDEN mtu_get_fd(int fd, const char *name); > > /** > * Enable/Disable promisc mode for a packet socket > */ > -int promisc_mode_set_fd(int fd, const char *name, int enable); > +int HIDDEN promisc_mode_set_fd(int fd, const char *name, int enable); > > /** > * Return promisc mode of a packet socket > */ > -int promisc_mode_get_fd(int fd, const char *name); > +int HIDDEN promisc_mode_get_fd(int fd, const char *name); > > /** > * Return link status of a packet socket (up/down) > */ > -int link_status_fd(int fd, const char *name); > +int HIDDEN link_status_fd(int fd, const char *name); > > /** > * Get enabled RSS hash protocols of a packet socket > @@ -131,8 +133,8 @@ int link_status_fd(int fd, const char *name); > * > * @returns Number enabled hash protocols > */ > -int rss_conf_get_fd(int fd, const char *name, > - odp_pktin_hash_proto_t *hash_proto); > +int HIDDEN rss_conf_get_fd(int fd, const char *name, > + odp_pktin_hash_proto_t *hash_proto); > > /** > * Get supported RSS hash protocols of a packet socket > @@ -145,8 +147,8 @@ int rss_conf_get_fd(int fd, const char *name, > * > * @returns Number of supported hash protocols > */ > -int rss_conf_get_supported_fd(int fd, const char *name, > - odp_pktin_hash_proto_t *hash_proto); > +int HIDDEN rss_conf_get_supported_fd(int fd, const char *name, > + odp_pktin_hash_proto_t *hash_proto); > > /** > * Set RSS hash protocols of a packet socket > @@ -158,19 +160,20 @@ int rss_conf_get_supported_fd(int fd, const char *name, > * @retval 0 on success > * @retval <0 on failure > */ > -int rss_conf_set_fd(int fd, const char *name, > - const odp_pktin_hash_proto_t *proto); > +int HIDDEN rss_conf_set_fd(int fd, const char *name, > + const odp_pktin_hash_proto_t *proto); > > /** > * Print enabled RSS hash protocols > * > * @param hash_proto Hash protocols > */ > -void rss_conf_print(const odp_pktin_hash_proto_t *hash_proto); > +void HIDDEN rss_conf_print(const odp_pktin_hash_proto_t *hash_proto); > > /** > * Get ethtool statistics of a packet socket > */ > -int ethtool_stats_get_fd(int fd, const char *name, odp_pktio_stats_t *stats); > +int HIDDEN ethtool_stats_get_fd(int fd, const char *name, > + odp_pktio_stats_t *stats); > > #endif > diff --git a/platform/linux-generic/include/odp_pkt_queue_internal.h b/platform/linux-generic/include/odp_pkt_queue_internal.h > index 85cdada..dac7809 100644 > --- a/platform/linux-generic/include/odp_pkt_queue_internal.h > +++ b/platform/linux-generic/include/odp_pkt_queue_internal.h > @@ -15,6 +15,7 @@ extern "C" { > > #include <stdint.h> > #include <odp.h> > +#include <odp_internal.h> > > typedef uint64_t _odp_int_queue_pool_t; > typedef uint32_t _odp_int_pkt_queue_t; > @@ -38,22 +39,23 @@ typedef uint32_t _odp_int_pkt_queue_t; > */ > > /* max_num_queues must be <= 16 * 1024 * 1024. */ > -_odp_int_queue_pool_t _odp_queue_pool_create(uint32_t max_num_queues, > - uint32_t max_queued_pkts); > +_odp_int_queue_pool_t HIDDEN _odp_queue_pool_create(uint32_t max_num_queues, > + uint32_t max_queued_pkts); > > -_odp_int_pkt_queue_t _odp_pkt_queue_create(_odp_int_queue_pool_t queue_pool); > +_odp_int_pkt_queue_t > +HIDDEN _odp_pkt_queue_create(_odp_int_queue_pool_t queue_pool); > > -int _odp_pkt_queue_append(_odp_int_queue_pool_t queue_pool, > - _odp_int_pkt_queue_t pkt_queue, > - odp_packet_t pkt); > +int HIDDEN _odp_pkt_queue_append(_odp_int_queue_pool_t queue_pool, > + _odp_int_pkt_queue_t pkt_queue, > + odp_packet_t pkt); > > -int _odp_pkt_queue_remove(_odp_int_queue_pool_t queue_pool, > - _odp_int_pkt_queue_t pkt_queue, > - odp_packet_t *pkt); > +int HIDDEN _odp_pkt_queue_remove(_odp_int_queue_pool_t queue_pool, > + _odp_int_pkt_queue_t pkt_queue, > + odp_packet_t *pkt); > > -void _odp_pkt_queue_stats_print(_odp_int_queue_pool_t queue_pool); > +void HIDDEN _odp_pkt_queue_stats_print(_odp_int_queue_pool_t queue_pool); > > -void _odp_queue_pool_destroy(_odp_int_queue_pool_t queue_pool); > +void HIDDEN _odp_queue_pool_destroy(_odp_int_queue_pool_t queue_pool); > > #ifdef __cplusplus > } > diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h > index 062507c..f3b1a72 100644 > --- a/platform/linux-generic/include/odp_pool_internal.h > +++ b/platform/linux-generic/include/odp_pool_internal.h > @@ -30,6 +30,7 @@ extern "C" { > #include <odp/api/atomic.h> > #include <odp/api/thread.h> > #include <string.h> > +#include <odp_internal.h> > > /** > * Buffer initialization routine prototype > @@ -153,7 +154,7 @@ typedef union pool_entry_u { > uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct pool_entry_s))]; > } pool_entry_t; > > -extern void *pool_entry_ptr[]; > +extern void HIDDEN *pool_entry_ptr[]; > > #if defined(ODP_CONFIG_SECURE_POOLS) && (ODP_CONFIG_SECURE_POOLS == 1) > #define buffer_is_secure(buf) (buf->flags.zeroized) > diff --git a/platform/linux-generic/include/odp_queue_internal.h b/platform/linux-generic/include/odp_queue_internal.h > index 2e352ae..ab9d67e 100644 > --- a/platform/linux-generic/include/odp_queue_internal.h > +++ b/platform/linux-generic/include/odp_queue_internal.h > @@ -25,6 +25,7 @@ extern "C" { > #include <odp/api/packet_io.h> > #include <odp/api/align.h> > #include <odp/api/hints.h> > +#include <odp_internal.h> > > > #define USE_TICKETLOCK > @@ -93,41 +94,47 @@ union queue_entry_u { > }; > > > -queue_entry_t *get_qentry(uint32_t queue_id); > +queue_entry_t HIDDEN *get_qentry(uint32_t queue_id); > > -int queue_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, int sustain); > -int ordered_queue_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, > - int systain, queue_entry_t *origin_qe, uint64_t order); > -odp_buffer_hdr_t *queue_deq(queue_entry_t *queue); > - > -int queue_enq_internal(odp_buffer_hdr_t *buf_hdr); > - > -int queue_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num, > - int sustain); > -int queue_deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num); > - > -int queue_pktout_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, > +int HIDDEN queue_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, > int sustain); > -int queue_pktout_enq_multi(queue_entry_t *queue, > - odp_buffer_hdr_t *buf_hdr[], int num, int sustain); > - > -int queue_tm_reenq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, > - int sustain); > -int queue_tm_reenq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], > - int num, int sustain); > -int queue_tm_reorder(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr); > - > -void queue_lock(queue_entry_t *queue); > -void queue_unlock(queue_entry_t *queue); > - > -int queue_sched_atomic(odp_queue_t handle); > - > -int release_order(queue_entry_t *origin_qe, uint64_t order, > - odp_pool_t pool, int enq_called); > -void get_sched_order(queue_entry_t **origin_qe, uint64_t *order); > -void get_sched_sync(queue_entry_t **origin_qe, uint64_t **sync, uint32_t ndx); > -void sched_enq_called(void); > -void sched_order_resolved(odp_buffer_hdr_t *buf_hdr); > +int HIDDEN ordered_queue_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, > + int systain, queue_entry_t *origin_qe, > + uint64_t order); > +odp_buffer_hdr_t HIDDEN *queue_deq(queue_entry_t *queue); > + > +int HIDDEN queue_enq_internal(odp_buffer_hdr_t *buf_hdr); > + > +int HIDDEN queue_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], > + int num, int sustain); > +int HIDDEN queue_deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], > + int num); > + > +int HIDDEN queue_pktout_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, > + int sustain); > +int HIDDEN queue_pktout_enq_multi(queue_entry_t *queue, > + odp_buffer_hdr_t *buf_hdr[], int num, > + int sustain); > + > +int HIDDEN queue_tm_reenq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, > + int sustain); > +int HIDDEN queue_tm_reenq_multi(queue_entry_t *queue, > + odp_buffer_hdr_t *buf_hdr[], > + int num, int sustain); > +int HIDDEN queue_tm_reorder(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr); > + > +void HIDDEN queue_lock(queue_entry_t *queue); > +void HIDDEN queue_unlock(queue_entry_t *queue); > + > +int HIDDEN queue_sched_atomic(odp_queue_t handle); > + > +int HIDDEN release_order(queue_entry_t *origin_qe, uint64_t order, > + odp_pool_t pool, int enq_called); > +void HIDDEN get_sched_order(queue_entry_t **origin_qe, uint64_t *order); > +void HIDDEN get_sched_sync(queue_entry_t **origin_qe, uint64_t **sync, > + uint32_t ndx); > +void HIDDEN sched_enq_called(void); > +void HIDDEN sched_order_resolved(odp_buffer_hdr_t *buf_hdr); > > static inline uint32_t queue_to_id(odp_queue_t handle) > { > @@ -387,7 +394,7 @@ static inline void get_queue_order(queue_entry_t **origin_qe, uint64_t *order, > } > } > > -void queue_destroy_finalize(queue_entry_t *qe); > +void HIDDEN queue_destroy_finalize(queue_entry_t *qe); > > #ifdef __cplusplus > } > diff --git a/platform/linux-generic/include/odp_schedule_internal.h b/platform/linux-generic/include/odp_schedule_internal.h > index 8a8c932..6b46dcf 100644 > --- a/platform/linux-generic/include/odp_schedule_internal.h > +++ b/platform/linux-generic/include/odp_schedule_internal.h > @@ -19,13 +19,15 @@ extern "C" { > #include <odp/api/queue.h> > #include <odp/api/packet_io.h> > #include <odp_queue_internal.h> > +#include <odp_internal.h> > > -int schedule_queue_init(queue_entry_t *qe); > -void schedule_queue_destroy(queue_entry_t *qe); > -int schedule_queue(const queue_entry_t *qe); > -void schedule_pktio_start(odp_pktio_t pktio, int num_in_queue, > +int HIDDEN schedule_queue_init(queue_entry_t *qe); > +void HIDDEN schedule_queue_destroy(queue_entry_t *qe); > +int HIDDEN schedule_queue(const queue_entry_t *qe); > +void HIDDEN schedule_pktio_start(odp_pktio_t pktio, > + int num_in_queue, > int in_queue_idx[]); > -void _schedule_release_context(void); > +void HIDDEN _schedule_release_context(void); > > #ifdef __cplusplus > } > diff --git a/platform/linux-generic/include/odp_sorted_list_internal.h b/platform/linux-generic/include/odp_sorted_list_internal.h > index 832ac5c..a69ab4f 100644 > --- a/platform/linux-generic/include/odp_sorted_list_internal.h > +++ b/platform/linux-generic/include/odp_sorted_list_internal.h > @@ -14,6 +14,7 @@ extern "C" { > #endif > > #include <stdint.h> > +#include <odp_internal.h> > > typedef uint64_t _odp_int_sorted_pool_t; > typedef uint32_t _odp_int_sorted_list_t; > @@ -21,21 +22,22 @@ typedef uint32_t _odp_int_sorted_list_t; > #define _ODP_INT_SORTED_POOL_INVALID 0 > #define _ODP_INT_SORTED_LIST_INVALID 0 > > -_odp_int_sorted_pool_t _odp_sorted_pool_create(uint32_t max_sorted_lists); > +_odp_int_sorted_pool_t > +HIDDEN _odp_sorted_pool_create(uint32_t max_sorted_lists); > > _odp_int_sorted_list_t > -_odp_sorted_list_create(_odp_int_sorted_pool_t sorted_pool, > - uint32_t max_entries); > +HIDDEN _odp_sorted_list_create(_odp_int_sorted_pool_t sorted_pool, > + uint32_t max_entries); > > /* Enters the pair <sort_key, user_data> into a list of such entries, all > * sorted by sort_key (lowest value first with ties going to the oldest > * entry). The user_data is an arbitrary/opaque value. It is returned later > * when a _odp_int_sorted_list_remove() call is made. > */ > -int _odp_sorted_list_insert(_odp_int_sorted_pool_t sorted_pool, > - _odp_int_sorted_list_t sorted_list, > - uint64_t sort_key, > - uint64_t user_data); > +int HIDDEN _odp_sorted_list_insert(_odp_int_sorted_pool_t sorted_pool, > + _odp_int_sorted_list_t sorted_list, > + uint64_t sort_key, > + uint64_t user_data); > > /* The odp_sorted_list_find function returns 1 iff a <sort_key, user_data> > * pair exists in the linked list whose user_data field matches the given > @@ -44,17 +46,17 @@ int _odp_sorted_list_insert(_odp_int_sorted_pool_t sorted_pool, > * If the optional sort_key_ptr argument is supplied, then if the matching > * entry is found, it's sort_key is returned via this pointer, > */ > -int _odp_sorted_list_find(_odp_int_sorted_pool_t sorted_pool, > - _odp_int_sorted_list_t sorted_list, > - uint64_t user_data, > - uint64_t *sort_key_ptr); > +int HIDDEN _odp_sorted_list_find(_odp_int_sorted_pool_t sorted_pool, > + _odp_int_sorted_list_t sorted_list, > + uint64_t user_data, > + uint64_t *sort_key_ptr); > > /* Deletes a <sort_key, user_data> pair from the given sorted list. Returns 0 > * if the pair is found, otherwise returns -1. > */ > -int _odp_sorted_list_delete(_odp_int_sorted_pool_t sorted_pool, > - _odp_int_sorted_list_t sorted_list, > - uint64_t user_data); > +int HIDDEN _odp_sorted_list_delete(_odp_int_sorted_pool_t sorted_pool, > + _odp_int_sorted_list_t sorted_list, > + uint64_t user_data); > > /* Removes and returns the list entry with the smallest sort_key. The > * sort_key is returned via the out ptr sort_key_ptr, and the opaque user data > @@ -62,14 +64,14 @@ int _odp_sorted_list_delete(_odp_int_sorted_pool_t sorted_pool, > * sorted_list is empty (or upon an error), in which case the value pointed to > * by sort_key_ptr remains unchanged. > */ > -int _odp_sorted_list_remove(_odp_int_sorted_pool_t sorted_pool, > - _odp_int_sorted_list_t sorted_list, > - uint64_t *sort_key_ptr, > - uint64_t *user_data_ptr); > +int HIDDEN _odp_sorted_list_remove(_odp_int_sorted_pool_t sorted_pool, > + _odp_int_sorted_list_t sorted_list, > + uint64_t *sort_key_ptr, > + uint64_t *user_data_ptr); > > -void _odp_sorted_list_stats_print(_odp_int_sorted_pool_t sorted_pool); > +void HIDDEN _odp_sorted_list_stats_print(_odp_int_sorted_pool_t sorted_pool); > > -void _odp_sorted_pool_destroy(_odp_int_sorted_pool_t sorted_pool); > +void HIDDEN _odp_sorted_pool_destroy(_odp_int_sorted_pool_t sorted_pool); > > #ifdef __cplusplus > } > diff --git a/platform/linux-generic/include/odp_timer_wheel_internal.h b/platform/linux-generic/include/odp_timer_wheel_internal.h > index e17e263..5c4590b 100644 > --- a/platform/linux-generic/include/odp_timer_wheel_internal.h > +++ b/platform/linux-generic/include/odp_timer_wheel_internal.h > @@ -14,23 +14,26 @@ extern "C" { > #endif > > #include <stdint.h> > +#include <odp_internal.h> > > typedef uint64_t _odp_timer_wheel_t; > > #define _ODP_INT_TIMER_WHEEL_INVALID 0 > > -_odp_timer_wheel_t _odp_timer_wheel_create(uint32_t max_concurrent_timers, > - void *tm_system); > +_odp_timer_wheel_t > +HIDDEN _odp_timer_wheel_create(uint32_t max_concurrent_timers, > + void *tm_system); > > -void _odp_timer_wheel_start(_odp_timer_wheel_t timer_wheel, > - uint64_t current_time); > +void HIDDEN _odp_timer_wheel_start(_odp_timer_wheel_t timer_wheel, > + uint64_t current_time); > > /* _odp_int_timer_wheel_curr_time_update should be called before the first > * call to _odp_int_timer_wheel_insert, _odp_int_timer_wheel_next, etc.. > * It returns > 0 if there are timers expired. > */ > -uint32_t _odp_timer_wheel_curr_time_update(_odp_timer_wheel_t timer_wheel, > - uint64_t current_time); > +uint32_t > +HIDDEN _odp_timer_wheel_curr_time_update(_odp_timer_wheel_t timer_wheel, > + uint64_t current_time); > > /* Maximum wakeup_time is 100 seconds in the future (though a wakeup time > * greater than a dozen seconds or so is of questionable value), and in > @@ -40,25 +43,25 @@ uint32_t _odp_timer_wheel_curr_time_update(_odp_timer_wheel_t timer_wheel, > * STRESSED - user_ptr is not an arbitrary 64-bit pointer, BUT MUST be > * non-zero and have its bottom two bits being 0! > */ > -int _odp_timer_wheel_insert(_odp_timer_wheel_t timer_wheel, > - uint64_t wakeup_time, > - void *user_ptr); > +int HIDDEN _odp_timer_wheel_insert(_odp_timer_wheel_t timer_wheel, > + uint64_t wakeup_time, > + void *user_ptr); > > /* Returns the exact same user_ptr value as was passed to > * _odp_int_timer_wheel_insert(). > */ > -void *_odp_timer_wheel_next_expired(_odp_timer_wheel_t timer_wheel); > +void HIDDEN *_odp_timer_wheel_next_expired(_odp_timer_wheel_t timer_wheel); > > /* Returns the number of timers that have been inserted but not yet passed > * back to the user. This number includes the number of timers that have > * internally expired and are in the expired list, but have not yet been > * retrieved via an odp_timer_wheel_next_expired call. > */ > -uint32_t _odp_timer_wheel_count(_odp_timer_wheel_t timer_wheel); > +uint32_t HIDDEN _odp_timer_wheel_count(_odp_timer_wheel_t timer_wheel); > > -void _odp_timer_wheel_stats_print(_odp_timer_wheel_t timer_wheel); > +void HIDDEN _odp_timer_wheel_stats_print(_odp_timer_wheel_t timer_wheel); > > -void _odp_timer_wheel_destroy(_odp_timer_wheel_t timer_wheel); > +void HIDDEN _odp_timer_wheel_destroy(_odp_timer_wheel_t timer_wheel); > > #ifdef __cplusplus > } > diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c > index f927c15..0fa7ded 100644 > --- a/platform/linux-generic/odp_packet_io.c > +++ b/platform/linux-generic/odp_packet_io.c > @@ -25,7 +25,7 @@ > #include <ifaddrs.h> > #include <errno.h> > > -pktio_table_t *pktio_tbl; > +pktio_table_t HIDDEN *pktio_tbl; > > /* pktio pointer entries ( for inlines) */ > void *pktio_entry_ptr[ODP_CONFIG_PKTIO_ENTRIES]; > diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c > index bcb8b92..75df706 100644 > --- a/platform/linux-generic/odp_schedule.c > +++ b/platform/linux-generic/odp_schedule.c > @@ -20,11 +20,12 @@ > #include <odp/api/spinlock.h> > #include <odp/api/hints.h> > #include <odp/api/cpu.h> > +#include <odp_internal.h> > > #include <odp_queue_internal.h> > #include <odp_packet_io_internal.h> > > -odp_thrmask_t sched_mask_all; > +odp_thrmask_t HIDDEN sched_mask_all; > > /* Number of schedule commands. > * One per scheduled queue and packet interface */ > @@ -117,7 +118,7 @@ static sched_t *sched; > static __thread sched_local_t sched_local; > > /* Internal routine to get scheduler thread mask addrs */ > -odp_thrmask_t *thread_sched_grp_mask(int index); > +odp_thrmask_t HIDDEN *thread_sched_grp_mask(int index); > > static void sched_local_init(void) > { > diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c > index edc36a1..23c9161 100644 > --- a/platform/linux-generic/pktio/socket.c > +++ b/platform/linux-generic/pktio/socket.c > @@ -42,6 +42,7 @@ > #include <odp_classification_inlines.h> > #include <odp_classification_internal.h> > #include <odp/api/hints.h> > +#include <odp_internal.h> > > #include <odp/helper/eth.h> > #include <odp/helper/ip.h> > @@ -52,8 +53,8 @@ static int sock_stats_reset(pktio_entry_t *pktio_entry); > * As it is implemented as a weak symbol, it has zero effect on systems > * with both. > */ > -int sendmmsg(int fd, struct mmsghdr *vmessages, unsigned int vlen, > - int flags) __attribute__((weak)); > +int HIDDEN sendmmsg(int fd, struct mmsghdr *vmessages, unsigned int vlen, > + int flags) __attribute__((weak)); > int sendmmsg(int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) > { > #ifdef SYS_sendmmsg
diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 7a06b00..fd6c1da 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -30,6 +30,7 @@ extern "C" { #include <odp/api/thread.h> #include <odp/api/event.h> #include <odp_forward_typedefs_internal.h> +#include <odp_internal.h> #define ODP_BITSIZE(x) \ ((x) <= 2 ? 1 : \ @@ -164,9 +165,9 @@ typedef struct { #define ODP_FREEBUF -1 /* Forward declarations */ -odp_buffer_t buffer_alloc(odp_pool_t pool, size_t size); -int buffer_alloc_multi(odp_pool_t pool_hdl, size_t size, - odp_buffer_t buf[], int num); +odp_buffer_t HIDDEN buffer_alloc(odp_pool_t pool, size_t size); +int HIDDEN buffer_alloc_multi(odp_pool_t pool_hdl, size_t size, + odp_buffer_t buf[], int num); #ifdef __cplusplus } diff --git a/platform/linux-generic/include/odp_classification_internal.h b/platform/linux-generic/include/odp_classification_internal.h index 86b40fc..c69a8f8 100644 --- a/platform/linux-generic/include/odp_classification_internal.h +++ b/platform/linux-generic/include/odp_classification_internal.h @@ -25,6 +25,7 @@ extern "C" { #include <odp/api/packet_io.h> #include <odp_packet_io_internal.h> #include <odp_classification_datamodel.h> +#include <odp_internal.h> /** Classification Internal function **/ @@ -40,8 +41,8 @@ with the PKTIO interface. Returns the default cos if the packet does not match any PMR Returns the error_cos if the packet has an error **/ -cos_t *pktio_select_cos(pktio_entry_t *pktio, const uint8_t *pkt_addr, - odp_packet_hdr_t *pkt_hdr); +cos_t HIDDEN *pktio_select_cos(pktio_entry_t *pktio, const uint8_t *pkt_addr, + odp_packet_hdr_t *pkt_hdr); /** @internal @@ -51,8 +52,8 @@ Select a CoS for the given Packet based on QoS values This function returns the COS object matching the L2 and L3 QoS based on the l3_preference value of the pktio **/ -cos_t *match_qos_cos(pktio_entry_t *entry, const uint8_t *pkt_addr, - odp_packet_hdr_t *hdr); +cos_t HIDDEN *match_qos_cos(pktio_entry_t *entry, const uint8_t *pkt_addr, + odp_packet_hdr_t *hdr); /** Packet Classifier @@ -61,14 +62,14 @@ This function calls Classifier module internal functions for a given packet and enqueues the packet to specific Queue based on PMR and CoS selected. The packet is allocated from the pool associated with the CoS **/ -int packet_classifier(odp_pktio_t pktio, odp_packet_t pkt); +int HIDDEN packet_classifier(odp_pktio_t pktio, odp_packet_t pkt); /** @internal Same as packet classifier uses linux-generic internal pktio struct **/ -int _odp_packet_classifier(pktio_entry_t *entry, odp_packet_t pkt); +int HIDDEN _odp_packet_classifier(pktio_entry_t *entry, odp_packet_t pkt); /** Packet IO classifier init @@ -76,7 +77,7 @@ Packet IO classifier init This function does initialization of classifier object associated with pktio. This function should be called during pktio initialization. **/ -int pktio_classifier_init(pktio_entry_t *pktio); +int HIDDEN pktio_classifier_init(pktio_entry_t *pktio); /** @internal @@ -87,16 +88,16 @@ This function gets called recursively to check the chained PMR Term value with the packet. **/ -cos_t *match_pmr_cos(cos_t *cos, const uint8_t *pkt_addr, pmr_t *pmr, - odp_packet_hdr_t *hdr); +cos_t HIDDEN *match_pmr_cos(cos_t *cos, const uint8_t *pkt_addr, pmr_t *pmr, + odp_packet_hdr_t *hdr); /** @internal CoS associated with L3 QoS value This function returns the CoS associated with L3 QoS value **/ -cos_t *match_qos_l3_cos(pmr_l3_cos_t *l3_cos, const uint8_t *pkt_addr, - odp_packet_hdr_t *hdr); +cos_t HIDDEN *match_qos_l3_cos(pmr_l3_cos_t *l3_cos, const uint8_t *pkt_addr, + odp_packet_hdr_t *hdr); /** @internal @@ -104,8 +105,8 @@ CoS associated with L2 QoS value This function returns the CoS associated with L2 QoS value **/ -cos_t *match_qos_l2_cos(pmr_l2_cos_t *l2_cos, const uint8_t *pkt_addr, - odp_packet_hdr_t *hdr); +cos_t HIDDEN *match_qos_l2_cos(pmr_l2_cos_t *l2_cos, const uint8_t *pkt_addr, + odp_packet_hdr_t *hdr); /** @internal Flow Signature Calculation @@ -113,39 +114,39 @@ Flow Signature Calculation This function calculates the Flow Signature for a packet based on CoS and updates in Packet Meta Data **/ -int update_flow_signature(uint8_t *pkt_addr, cos_t *cos); +int HIDDEN update_flow_signature(uint8_t *pkt_addr, cos_t *cos); /** @internal Allocate a odp_pmr_t Handle */ -odp_pmr_t alloc_pmr(pmr_t **pmr); +odp_pmr_t HIDDEN alloc_pmr(pmr_t **pmr); /** @internal Pointer to pmr_t Handle This function checks for validity of odp_pmr_t Handle */ -pmr_t *get_pmr_entry(odp_pmr_t pmr_id); +pmr_t HIDDEN *get_pmr_entry(odp_pmr_t pmr_id); /** @internal Pointer to pmr_t Handle */ -pmr_t *get_pmr_entry_internal(odp_pmr_t pmr_id); +pmr_t HIDDEN *get_pmr_entry_internal(odp_pmr_t pmr_id); /** @internal Pointer to odp_cos_t Handle */ -cos_t *get_cos_entry(odp_cos_t cos_id); +cos_t HIDDEN *get_cos_entry(odp_cos_t cos_id); /** @internal Pointer to odp_cos_t Handle This function checks for validity of odp_cos_t Handle */ -cos_t *get_cos_entry_internal(odp_cos_t cos_id); +cos_t HIDDEN *get_cos_entry_internal(odp_cos_t cos_id); /** @internal @@ -155,7 +156,8 @@ This function goes through each PMR_TERM value in pmr_t structure and calls verification function for each term.Returns 1 if PMR matches or 0 Otherwise. **/ -int verify_pmr(pmr_t *pmr, const uint8_t *pkt_addr, odp_packet_hdr_t *pkt_hdr); +int HIDDEN verify_pmr(pmr_t *pmr, const uint8_t *pkt_addr, + odp_packet_hdr_t *pkt_hdr); #ifdef __cplusplus } diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 08624ae..01d7630 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -28,7 +28,7 @@ extern "C" { # define HIDDEN #endif -extern __thread int __odp_errno; +extern __thread int HIDDEN __odp_errno; #define MAX_CPU_NUMBER 128 @@ -69,8 +69,8 @@ enum init_stage { extern struct odp_global_data_s odp_global_data; -int _odp_term_global(enum init_stage stage); -int _odp_term_local(enum init_stage stage); +int HIDDEN _odp_term_global(enum init_stage stage); +int HIDDEN _odp_term_local(enum init_stage stage); int odp_system_info_init(void); int odp_system_info_term(void); @@ -117,10 +117,10 @@ int odp_time_term_global(void); int odp_tm_init_global(void); int odp_tm_term_global(void); -int _odp_int_name_tbl_init_global(void); -int _odp_int_name_tbl_term_global(void); +int HIDDEN _odp_int_name_tbl_init_global(void); +int HIDDEN _odp_int_name_tbl_term_global(void); -void _odp_flush_caches(void); +void HIDDEN _odp_flush_caches(void); int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo); uint64_t odp_cpu_hz_current(int id); diff --git a/platform/linux-generic/include/odp_name_table_internal.h b/platform/linux-generic/include/odp_name_table_internal.h index fba8080..c89316b 100644 --- a/platform/linux-generic/include/odp_name_table_internal.h +++ b/platform/linux-generic/include/odp_name_table_internal.h @@ -15,6 +15,7 @@ extern "C" { #include <stdint.h> #include <odp.h> +#include <odp_internal.h> typedef enum { ODP_COS_HANDLE, @@ -37,23 +38,23 @@ typedef uint32_t _odp_int_name_t; #define _ODP_INT_NAME_LEN 32 -_odp_int_name_t _odp_int_name_tbl_add(const char *name, - uint8_t name_kind, - uint64_t user_data); +_odp_int_name_t HIDDEN _odp_int_name_tbl_add(const char *name, + uint8_t name_kind, + uint64_t user_data); -_odp_int_name_t _odp_int_name_tbl_lookup(const char *name, - uint8_t name_kind); +_odp_int_name_t HIDDEN _odp_int_name_tbl_lookup(const char *name, + uint8_t name_kind); -int _odp_int_name_tbl_delete(_odp_int_name_t odp_name); +int HIDDEN _odp_int_name_tbl_delete(_odp_int_name_t odp_name); -const char *_odp_int_name_tbl_name(_odp_int_name_t odp_name); +const char HIDDEN *_odp_int_name_tbl_name(_odp_int_name_t odp_name); -uint64_t _odp_int_name_tbl_user_data(_odp_int_name_t odp_name); +uint64_t HIDDEN _odp_int_name_tbl_user_data(_odp_int_name_t odp_name); -void _odp_int_name_tbl_stats_print(void); +void HIDDEN _odp_int_name_tbl_stats_print(void); -int _odp_int_name_tbl_init_global(void); -int _odp_int_name_tbl_term_global(void); +int HIDDEN _odp_int_name_tbl_init_global(void); +int HIDDEN _odp_int_name_tbl_term_global(void); #ifdef __cplusplus } diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 92b770f..f5f8bae 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -27,6 +27,7 @@ extern "C" { #include <odp/api/packet_io.h> #include <odp/api/crypto.h> #include <odp_crypto_internal.h> +#include <odp_internal.h> #define PACKET_JUMBO_LEN (9 * 1024) @@ -244,28 +245,29 @@ static inline int packet_parse_not_complete(odp_packet_hdr_t *pkt_hdr) } /* Forward declarations */ -int _odp_packet_copy_to_packet(odp_packet_t srcpkt, uint32_t srcoffset, - odp_packet_t dstpkt, uint32_t dstoffset, - uint32_t len); +int HIDDEN _odp_packet_copy_to_packet(odp_packet_t srcpkt, uint32_t srcoffset, + odp_packet_t dstpkt, uint32_t dstoffset, + uint32_t len); -void _odp_packet_copy_md_to_packet(odp_packet_t srcpkt, odp_packet_t dstpkt); +void HIDDEN _odp_packet_copy_md_to_packet(odp_packet_t srcpkt, + odp_packet_t dstpkt); -odp_packet_t packet_alloc(odp_pool_t pool_hdl, uint32_t len, int parse); +odp_packet_t HIDDEN packet_alloc(odp_pool_t pool_hdl, uint32_t len, int parse); /* Fill in parser metadata for L2 */ -void packet_parse_l2(odp_packet_hdr_t *pkt_hdr); +void HIDDEN packet_parse_l2(odp_packet_hdr_t *pkt_hdr); /* Perform full packet parse */ -int packet_parse_full(odp_packet_hdr_t *pkt_hdr); +int HIDDEN packet_parse_full(odp_packet_hdr_t *pkt_hdr); /* Reset parser metadata for a new parse */ -void packet_parse_reset(odp_packet_hdr_t *pkt_hdr); +void HIDDEN packet_parse_reset(odp_packet_hdr_t *pkt_hdr); /* Convert a packet handle to a buffer handle */ -odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); +odp_buffer_t HIDDEN _odp_packet_to_buffer(odp_packet_t pkt); /* Convert a buffer handle to a packet handle */ -odp_packet_t _odp_packet_from_buffer(odp_buffer_t buf); +odp_packet_t HIDDEN _odp_packet_from_buffer(odp_buffer_t buf); static inline int packet_hdr_has_l2(odp_packet_hdr_t *pkt_hdr) { @@ -282,9 +284,10 @@ static inline int packet_hdr_has_eth(odp_packet_hdr_t *pkt_hdr) return pkt_hdr->input_flags.eth; } -int _odp_parse_common(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr); +int HIDDEN _odp_parse_common(odp_packet_hdr_t *pkt_hdr, + const uint8_t *parseptr); -int _odp_cls_parse(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr); +int HIDDEN _odp_cls_parse(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr); #ifdef __cplusplus } diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index cca5c39..0573e3c 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -23,6 +23,7 @@ extern "C" { #include <odp_classification_datamodel.h> #include <odp_align_internal.h> #include <odp_debug_internal.h> +#include <odp_internal.h> #include <odp/api/config.h> #include <odp/api/hints.h> @@ -133,7 +134,7 @@ typedef struct { pktio_entry_t entries[ODP_CONFIG_PKTIO_ENTRIES]; } pktio_table_t; -int is_free(pktio_entry_t *entry); +int HIDDEN is_free(pktio_entry_t *entry); typedef struct pktio_if_ops { const char *name; @@ -168,10 +169,10 @@ typedef struct pktio_if_ops { odp_packet_t packets[], int num); } pktio_if_ops_t; -int _odp_packet_cls_enq(pktio_entry_t *pktio_entry, const uint8_t *base, - uint16_t buf_len, odp_packet_t *pkt_ret); +int HIDDEN _odp_packet_cls_enq(pktio_entry_t *pktio_entry, const uint8_t *base, + uint16_t buf_len, odp_packet_t *pkt_ret); -extern void *pktio_entry_ptr[]; +extern void HIDDEN *pktio_entry_ptr[]; static inline int pktio_to_id(odp_pktio_t pktio) { @@ -202,38 +203,38 @@ static inline void pktio_cls_enabled_set(pktio_entry_t *entry, int ena) entry->s.cls_enabled = ena; } -int pktin_poll(pktio_entry_t *entry, int num_queue, int index[]); +int HIDDEN pktin_poll(pktio_entry_t *entry, int num_queue, int index[]); /* * Dummy single queue implementations of multi-queue API */ -int single_capability(odp_pktio_capability_t *capa); -int single_input_queues_config(pktio_entry_t *entry, - const odp_pktin_queue_param_t *param); -int single_output_queues_config(pktio_entry_t *entry, - const odp_pktout_queue_param_t *param); -int single_recv_queue(pktio_entry_t *entry, int index, odp_packet_t packets[], - int num); -int single_send_queue(pktio_entry_t *entry, int index, odp_packet_t packets[], - int num); - -extern const pktio_if_ops_t netmap_pktio_ops; -extern const pktio_if_ops_t dpdk_pktio_ops; -extern const pktio_if_ops_t sock_mmsg_pktio_ops; -extern const pktio_if_ops_t sock_mmap_pktio_ops; -extern const pktio_if_ops_t loopback_pktio_ops; +int HIDDEN single_capability(odp_pktio_capability_t *capa); +int HIDDEN single_input_queues_config(pktio_entry_t *entry, + const odp_pktin_queue_param_t *param); +int HIDDEN single_output_queues_config(pktio_entry_t *entry, + const odp_pktout_queue_param_t *param); +int HIDDEN single_recv_queue(pktio_entry_t *entry, int index, + odp_packet_t packets[], int num); +int HIDDEN single_send_queue(pktio_entry_t *entry, int index, + odp_packet_t packets[], int num); + +extern const HIDDEN pktio_if_ops_t netmap_pktio_ops; +extern const HIDDEN pktio_if_ops_t dpdk_pktio_ops; +extern const HIDDEN pktio_if_ops_t sock_mmsg_pktio_ops; +extern const HIDDEN pktio_if_ops_t sock_mmap_pktio_ops; +extern const HIDDEN pktio_if_ops_t loopback_pktio_ops; #ifdef HAVE_PCAP -extern const pktio_if_ops_t pcap_pktio_ops; +extern const HIDDEN pktio_if_ops_t pcap_pktio_ops; #endif -extern const pktio_if_ops_t tap_pktio_ops; -extern const pktio_if_ops_t * const pktio_if_ops[]; - -int sysfs_stats(pktio_entry_t *pktio_entry, - odp_pktio_stats_t *stats); -int sock_stats_fd(pktio_entry_t *pktio_entry, - odp_pktio_stats_t *stats, - int fd); -int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd); +extern const HIDDEN pktio_if_ops_t tap_pktio_ops; +extern const HIDDEN pktio_if_ops_t * const pktio_if_ops[]; + +int HIDDEN sysfs_stats(pktio_entry_t *pktio_entry, + odp_pktio_stats_t *stats); +int HIDDEN sock_stats_fd(pktio_entry_t *pktio_entry, + odp_pktio_stats_t *stats, + int fd); +int HIDDEN sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd); #ifdef __cplusplus } diff --git a/platform/linux-generic/include/odp_packet_io_queue.h b/platform/linux-generic/include/odp_packet_io_queue.h index 12e2b9f..39d9bfb 100644 --- a/platform/linux-generic/include/odp_packet_io_queue.h +++ b/platform/linux-generic/include/odp_packet_io_queue.h @@ -20,6 +20,7 @@ extern "C" { #include <odp_queue_internal.h> #include <odp_buffer_internal.h> +#include <odp_internal.h> /** Max nbr of pkts to receive in one burst (keep same as QUEUE_MULTI_MAX) */ #define ODP_PKTIN_QUEUE_MAX_BURST 16 @@ -27,21 +28,23 @@ extern "C" { _ODP_STATIC_ASSERT(ODP_PKTIN_QUEUE_MAX_BURST >= QUEUE_MULTI_MAX, "ODP_PKTIN_DEQ_MULTI_MAX_ERROR"); -int pktin_enqueue(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, int sustain); -odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *queue); +int HIDDEN pktin_enqueue(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, + int sustain); +odp_buffer_hdr_t HIDDEN *pktin_dequeue(queue_entry_t *queue); -int pktin_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num, - int sustain); -int pktin_deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num); +int HIDDEN pktin_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], + int num, int sustain); +int HIDDEN pktin_deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], + int num); -int pktout_enqueue(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr); -odp_buffer_hdr_t *pktout_dequeue(queue_entry_t *queue); +int HIDDEN pktout_enqueue(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr); +odp_buffer_hdr_t HIDDEN *pktout_dequeue(queue_entry_t *queue); -int pktout_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], - int num); -int pktout_deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], - int num); +int HIDDEN pktout_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], + int num); +int HIDDEN pktout_deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], + int num); #ifdef __cplusplus } diff --git a/platform/linux-generic/include/odp_packet_socket.h b/platform/linux-generic/include/odp_packet_socket.h index bc83e80..333044a 100644 --- a/platform/linux-generic/include/odp_packet_socket.h +++ b/platform/linux-generic/include/odp_packet_socket.h @@ -22,6 +22,8 @@ #include <linux/version.h> +#include <odp_internal.h> + /* * Packet socket config: */ @@ -100,27 +102,27 @@ ethaddrs_equal(unsigned char mac_a[], unsigned char mac_b[]) /** * Read the MAC address from a packet socket */ -int mac_addr_get_fd(int fd, const char *name, unsigned char mac_dst[]); +int HIDDEN mac_addr_get_fd(int fd, const char *name, unsigned char mac_dst[]); /** * Read the MTU from a packet socket */ -uint32_t mtu_get_fd(int fd, const char *name); +uint32_t HIDDEN mtu_get_fd(int fd, const char *name); /** * Enable/Disable promisc mode for a packet socket */ -int promisc_mode_set_fd(int fd, const char *name, int enable); +int HIDDEN promisc_mode_set_fd(int fd, const char *name, int enable); /** * Return promisc mode of a packet socket */ -int promisc_mode_get_fd(int fd, const char *name); +int HIDDEN promisc_mode_get_fd(int fd, const char *name); /** * Return link status of a packet socket (up/down) */ -int link_status_fd(int fd, const char *name); +int HIDDEN link_status_fd(int fd, const char *name); /** * Get enabled RSS hash protocols of a packet socket @@ -131,8 +133,8 @@ int link_status_fd(int fd, const char *name); * * @returns Number enabled hash protocols */ -int rss_conf_get_fd(int fd, const char *name, - odp_pktin_hash_proto_t *hash_proto); +int HIDDEN rss_conf_get_fd(int fd, const char *name, + odp_pktin_hash_proto_t *hash_proto); /** * Get supported RSS hash protocols of a packet socket @@ -145,8 +147,8 @@ int rss_conf_get_fd(int fd, const char *name, * * @returns Number of supported hash protocols */ -int rss_conf_get_supported_fd(int fd, const char *name, - odp_pktin_hash_proto_t *hash_proto); +int HIDDEN rss_conf_get_supported_fd(int fd, const char *name, + odp_pktin_hash_proto_t *hash_proto); /** * Set RSS hash protocols of a packet socket @@ -158,19 +160,20 @@ int rss_conf_get_supported_fd(int fd, const char *name, * @retval 0 on success * @retval <0 on failure */ -int rss_conf_set_fd(int fd, const char *name, - const odp_pktin_hash_proto_t *proto); +int HIDDEN rss_conf_set_fd(int fd, const char *name, + const odp_pktin_hash_proto_t *proto); /** * Print enabled RSS hash protocols * * @param hash_proto Hash protocols */ -void rss_conf_print(const odp_pktin_hash_proto_t *hash_proto); +void HIDDEN rss_conf_print(const odp_pktin_hash_proto_t *hash_proto); /** * Get ethtool statistics of a packet socket */ -int ethtool_stats_get_fd(int fd, const char *name, odp_pktio_stats_t *stats); +int HIDDEN ethtool_stats_get_fd(int fd, const char *name, + odp_pktio_stats_t *stats); #endif diff --git a/platform/linux-generic/include/odp_pkt_queue_internal.h b/platform/linux-generic/include/odp_pkt_queue_internal.h index 85cdada..dac7809 100644 --- a/platform/linux-generic/include/odp_pkt_queue_internal.h +++ b/platform/linux-generic/include/odp_pkt_queue_internal.h @@ -15,6 +15,7 @@ extern "C" { #include <stdint.h> #include <odp.h> +#include <odp_internal.h> typedef uint64_t _odp_int_queue_pool_t; typedef uint32_t _odp_int_pkt_queue_t; @@ -38,22 +39,23 @@ typedef uint32_t _odp_int_pkt_queue_t; */ /* max_num_queues must be <= 16 * 1024 * 1024. */ -_odp_int_queue_pool_t _odp_queue_pool_create(uint32_t max_num_queues, - uint32_t max_queued_pkts); +_odp_int_queue_pool_t HIDDEN _odp_queue_pool_create(uint32_t max_num_queues, + uint32_t max_queued_pkts); -_odp_int_pkt_queue_t _odp_pkt_queue_create(_odp_int_queue_pool_t queue_pool); +_odp_int_pkt_queue_t +HIDDEN _odp_pkt_queue_create(_odp_int_queue_pool_t queue_pool); -int _odp_pkt_queue_append(_odp_int_queue_pool_t queue_pool, - _odp_int_pkt_queue_t pkt_queue, - odp_packet_t pkt); +int HIDDEN _odp_pkt_queue_append(_odp_int_queue_pool_t queue_pool, + _odp_int_pkt_queue_t pkt_queue, + odp_packet_t pkt); -int _odp_pkt_queue_remove(_odp_int_queue_pool_t queue_pool, - _odp_int_pkt_queue_t pkt_queue, - odp_packet_t *pkt); +int HIDDEN _odp_pkt_queue_remove(_odp_int_queue_pool_t queue_pool, + _odp_int_pkt_queue_t pkt_queue, + odp_packet_t *pkt); -void _odp_pkt_queue_stats_print(_odp_int_queue_pool_t queue_pool); +void HIDDEN _odp_pkt_queue_stats_print(_odp_int_queue_pool_t queue_pool); -void _odp_queue_pool_destroy(_odp_int_queue_pool_t queue_pool); +void HIDDEN _odp_queue_pool_destroy(_odp_int_queue_pool_t queue_pool); #ifdef __cplusplus } diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 062507c..f3b1a72 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -30,6 +30,7 @@ extern "C" { #include <odp/api/atomic.h> #include <odp/api/thread.h> #include <string.h> +#include <odp_internal.h> /** * Buffer initialization routine prototype @@ -153,7 +154,7 @@ typedef union pool_entry_u { uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct pool_entry_s))]; } pool_entry_t; -extern void *pool_entry_ptr[]; +extern void HIDDEN *pool_entry_ptr[]; #if defined(ODP_CONFIG_SECURE_POOLS) && (ODP_CONFIG_SECURE_POOLS == 1) #define buffer_is_secure(buf) (buf->flags.zeroized) diff --git a/platform/linux-generic/include/odp_queue_internal.h b/platform/linux-generic/include/odp_queue_internal.h index 2e352ae..ab9d67e 100644 --- a/platform/linux-generic/include/odp_queue_internal.h +++ b/platform/linux-generic/include/odp_queue_internal.h @@ -25,6 +25,7 @@ extern "C" { #include <odp/api/packet_io.h> #include <odp/api/align.h> #include <odp/api/hints.h> +#include <odp_internal.h> #define USE_TICKETLOCK @@ -93,41 +94,47 @@ union queue_entry_u { }; -queue_entry_t *get_qentry(uint32_t queue_id); +queue_entry_t HIDDEN *get_qentry(uint32_t queue_id); -int queue_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, int sustain); -int ordered_queue_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, - int systain, queue_entry_t *origin_qe, uint64_t order); -odp_buffer_hdr_t *queue_deq(queue_entry_t *queue); - -int queue_enq_internal(odp_buffer_hdr_t *buf_hdr); - -int queue_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num, - int sustain); -int queue_deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num); - -int queue_pktout_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, +int HIDDEN queue_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, int sustain); -int queue_pktout_enq_multi(queue_entry_t *queue, - odp_buffer_hdr_t *buf_hdr[], int num, int sustain); - -int queue_tm_reenq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, - int sustain); -int queue_tm_reenq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], - int num, int sustain); -int queue_tm_reorder(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr); - -void queue_lock(queue_entry_t *queue); -void queue_unlock(queue_entry_t *queue); - -int queue_sched_atomic(odp_queue_t handle); - -int release_order(queue_entry_t *origin_qe, uint64_t order, - odp_pool_t pool, int enq_called); -void get_sched_order(queue_entry_t **origin_qe, uint64_t *order); -void get_sched_sync(queue_entry_t **origin_qe, uint64_t **sync, uint32_t ndx); -void sched_enq_called(void); -void sched_order_resolved(odp_buffer_hdr_t *buf_hdr); +int HIDDEN ordered_queue_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, + int systain, queue_entry_t *origin_qe, + uint64_t order); +odp_buffer_hdr_t HIDDEN *queue_deq(queue_entry_t *queue); + +int HIDDEN queue_enq_internal(odp_buffer_hdr_t *buf_hdr); + +int HIDDEN queue_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], + int num, int sustain); +int HIDDEN queue_deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], + int num); + +int HIDDEN queue_pktout_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, + int sustain); +int HIDDEN queue_pktout_enq_multi(queue_entry_t *queue, + odp_buffer_hdr_t *buf_hdr[], int num, + int sustain); + +int HIDDEN queue_tm_reenq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr, + int sustain); +int HIDDEN queue_tm_reenq_multi(queue_entry_t *queue, + odp_buffer_hdr_t *buf_hdr[], + int num, int sustain); +int HIDDEN queue_tm_reorder(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr); + +void HIDDEN queue_lock(queue_entry_t *queue); +void HIDDEN queue_unlock(queue_entry_t *queue); + +int HIDDEN queue_sched_atomic(odp_queue_t handle); + +int HIDDEN release_order(queue_entry_t *origin_qe, uint64_t order, + odp_pool_t pool, int enq_called); +void HIDDEN get_sched_order(queue_entry_t **origin_qe, uint64_t *order); +void HIDDEN get_sched_sync(queue_entry_t **origin_qe, uint64_t **sync, + uint32_t ndx); +void HIDDEN sched_enq_called(void); +void HIDDEN sched_order_resolved(odp_buffer_hdr_t *buf_hdr); static inline uint32_t queue_to_id(odp_queue_t handle) { @@ -387,7 +394,7 @@ static inline void get_queue_order(queue_entry_t **origin_qe, uint64_t *order, } } -void queue_destroy_finalize(queue_entry_t *qe); +void HIDDEN queue_destroy_finalize(queue_entry_t *qe); #ifdef __cplusplus } diff --git a/platform/linux-generic/include/odp_schedule_internal.h b/platform/linux-generic/include/odp_schedule_internal.h index 8a8c932..6b46dcf 100644 --- a/platform/linux-generic/include/odp_schedule_internal.h +++ b/platform/linux-generic/include/odp_schedule_internal.h @@ -19,13 +19,15 @@ extern "C" { #include <odp/api/queue.h> #include <odp/api/packet_io.h> #include <odp_queue_internal.h> +#include <odp_internal.h> -int schedule_queue_init(queue_entry_t *qe); -void schedule_queue_destroy(queue_entry_t *qe); -int schedule_queue(const queue_entry_t *qe); -void schedule_pktio_start(odp_pktio_t pktio, int num_in_queue, +int HIDDEN schedule_queue_init(queue_entry_t *qe); +void HIDDEN schedule_queue_destroy(queue_entry_t *qe); +int HIDDEN schedule_queue(const queue_entry_t *qe); +void HIDDEN schedule_pktio_start(odp_pktio_t pktio, + int num_in_queue, int in_queue_idx[]); -void _schedule_release_context(void); +void HIDDEN _schedule_release_context(void); #ifdef __cplusplus } diff --git a/platform/linux-generic/include/odp_sorted_list_internal.h b/platform/linux-generic/include/odp_sorted_list_internal.h index 832ac5c..a69ab4f 100644 --- a/platform/linux-generic/include/odp_sorted_list_internal.h +++ b/platform/linux-generic/include/odp_sorted_list_internal.h @@ -14,6 +14,7 @@ extern "C" { #endif #include <stdint.h> +#include <odp_internal.h> typedef uint64_t _odp_int_sorted_pool_t; typedef uint32_t _odp_int_sorted_list_t; @@ -21,21 +22,22 @@ typedef uint32_t _odp_int_sorted_list_t; #define _ODP_INT_SORTED_POOL_INVALID 0 #define _ODP_INT_SORTED_LIST_INVALID 0 -_odp_int_sorted_pool_t _odp_sorted_pool_create(uint32_t max_sorted_lists); +_odp_int_sorted_pool_t +HIDDEN _odp_sorted_pool_create(uint32_t max_sorted_lists); _odp_int_sorted_list_t -_odp_sorted_list_create(_odp_int_sorted_pool_t sorted_pool, - uint32_t max_entries); +HIDDEN _odp_sorted_list_create(_odp_int_sorted_pool_t sorted_pool, + uint32_t max_entries); /* Enters the pair <sort_key, user_data> into a list of such entries, all * sorted by sort_key (lowest value first with ties going to the oldest * entry). The user_data is an arbitrary/opaque value. It is returned later * when a _odp_int_sorted_list_remove() call is made. */ -int _odp_sorted_list_insert(_odp_int_sorted_pool_t sorted_pool, - _odp_int_sorted_list_t sorted_list, - uint64_t sort_key, - uint64_t user_data); +int HIDDEN _odp_sorted_list_insert(_odp_int_sorted_pool_t sorted_pool, + _odp_int_sorted_list_t sorted_list, + uint64_t sort_key, + uint64_t user_data); /* The odp_sorted_list_find function returns 1 iff a <sort_key, user_data> * pair exists in the linked list whose user_data field matches the given @@ -44,17 +46,17 @@ int _odp_sorted_list_insert(_odp_int_sorted_pool_t sorted_pool, * If the optional sort_key_ptr argument is supplied, then if the matching * entry is found, it's sort_key is returned via this pointer, */ -int _odp_sorted_list_find(_odp_int_sorted_pool_t sorted_pool, - _odp_int_sorted_list_t sorted_list, - uint64_t user_data, - uint64_t *sort_key_ptr); +int HIDDEN _odp_sorted_list_find(_odp_int_sorted_pool_t sorted_pool, + _odp_int_sorted_list_t sorted_list, + uint64_t user_data, + uint64_t *sort_key_ptr); /* Deletes a <sort_key, user_data> pair from the given sorted list. Returns 0 * if the pair is found, otherwise returns -1. */ -int _odp_sorted_list_delete(_odp_int_sorted_pool_t sorted_pool, - _odp_int_sorted_list_t sorted_list, - uint64_t user_data); +int HIDDEN _odp_sorted_list_delete(_odp_int_sorted_pool_t sorted_pool, + _odp_int_sorted_list_t sorted_list, + uint64_t user_data); /* Removes and returns the list entry with the smallest sort_key. The * sort_key is returned via the out ptr sort_key_ptr, and the opaque user data @@ -62,14 +64,14 @@ int _odp_sorted_list_delete(_odp_int_sorted_pool_t sorted_pool, * sorted_list is empty (or upon an error), in which case the value pointed to * by sort_key_ptr remains unchanged. */ -int _odp_sorted_list_remove(_odp_int_sorted_pool_t sorted_pool, - _odp_int_sorted_list_t sorted_list, - uint64_t *sort_key_ptr, - uint64_t *user_data_ptr); +int HIDDEN _odp_sorted_list_remove(_odp_int_sorted_pool_t sorted_pool, + _odp_int_sorted_list_t sorted_list, + uint64_t *sort_key_ptr, + uint64_t *user_data_ptr); -void _odp_sorted_list_stats_print(_odp_int_sorted_pool_t sorted_pool); +void HIDDEN _odp_sorted_list_stats_print(_odp_int_sorted_pool_t sorted_pool); -void _odp_sorted_pool_destroy(_odp_int_sorted_pool_t sorted_pool); +void HIDDEN _odp_sorted_pool_destroy(_odp_int_sorted_pool_t sorted_pool); #ifdef __cplusplus } diff --git a/platform/linux-generic/include/odp_timer_wheel_internal.h b/platform/linux-generic/include/odp_timer_wheel_internal.h index e17e263..5c4590b 100644 --- a/platform/linux-generic/include/odp_timer_wheel_internal.h +++ b/platform/linux-generic/include/odp_timer_wheel_internal.h @@ -14,23 +14,26 @@ extern "C" { #endif #include <stdint.h> +#include <odp_internal.h> typedef uint64_t _odp_timer_wheel_t; #define _ODP_INT_TIMER_WHEEL_INVALID 0 -_odp_timer_wheel_t _odp_timer_wheel_create(uint32_t max_concurrent_timers, - void *tm_system); +_odp_timer_wheel_t +HIDDEN _odp_timer_wheel_create(uint32_t max_concurrent_timers, + void *tm_system); -void _odp_timer_wheel_start(_odp_timer_wheel_t timer_wheel, - uint64_t current_time); +void HIDDEN _odp_timer_wheel_start(_odp_timer_wheel_t timer_wheel, + uint64_t current_time); /* _odp_int_timer_wheel_curr_time_update should be called before the first * call to _odp_int_timer_wheel_insert, _odp_int_timer_wheel_next, etc.. * It returns > 0 if there are timers expired. */ -uint32_t _odp_timer_wheel_curr_time_update(_odp_timer_wheel_t timer_wheel, - uint64_t current_time); +uint32_t +HIDDEN _odp_timer_wheel_curr_time_update(_odp_timer_wheel_t timer_wheel, + uint64_t current_time); /* Maximum wakeup_time is 100 seconds in the future (though a wakeup time * greater than a dozen seconds or so is of questionable value), and in @@ -40,25 +43,25 @@ uint32_t _odp_timer_wheel_curr_time_update(_odp_timer_wheel_t timer_wheel, * STRESSED - user_ptr is not an arbitrary 64-bit pointer, BUT MUST be * non-zero and have its bottom two bits being 0! */ -int _odp_timer_wheel_insert(_odp_timer_wheel_t timer_wheel, - uint64_t wakeup_time, - void *user_ptr); +int HIDDEN _odp_timer_wheel_insert(_odp_timer_wheel_t timer_wheel, + uint64_t wakeup_time, + void *user_ptr); /* Returns the exact same user_ptr value as was passed to * _odp_int_timer_wheel_insert(). */ -void *_odp_timer_wheel_next_expired(_odp_timer_wheel_t timer_wheel); +void HIDDEN *_odp_timer_wheel_next_expired(_odp_timer_wheel_t timer_wheel); /* Returns the number of timers that have been inserted but not yet passed * back to the user. This number includes the number of timers that have * internally expired and are in the expired list, but have not yet been * retrieved via an odp_timer_wheel_next_expired call. */ -uint32_t _odp_timer_wheel_count(_odp_timer_wheel_t timer_wheel); +uint32_t HIDDEN _odp_timer_wheel_count(_odp_timer_wheel_t timer_wheel); -void _odp_timer_wheel_stats_print(_odp_timer_wheel_t timer_wheel); +void HIDDEN _odp_timer_wheel_stats_print(_odp_timer_wheel_t timer_wheel); -void _odp_timer_wheel_destroy(_odp_timer_wheel_t timer_wheel); +void HIDDEN _odp_timer_wheel_destroy(_odp_timer_wheel_t timer_wheel); #ifdef __cplusplus } diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index f927c15..0fa7ded 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -25,7 +25,7 @@ #include <ifaddrs.h> #include <errno.h> -pktio_table_t *pktio_tbl; +pktio_table_t HIDDEN *pktio_tbl; /* pktio pointer entries ( for inlines) */ void *pktio_entry_ptr[ODP_CONFIG_PKTIO_ENTRIES]; diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index bcb8b92..75df706 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -20,11 +20,12 @@ #include <odp/api/spinlock.h> #include <odp/api/hints.h> #include <odp/api/cpu.h> +#include <odp_internal.h> #include <odp_queue_internal.h> #include <odp_packet_io_internal.h> -odp_thrmask_t sched_mask_all; +odp_thrmask_t HIDDEN sched_mask_all; /* Number of schedule commands. * One per scheduled queue and packet interface */ @@ -117,7 +118,7 @@ static sched_t *sched; static __thread sched_local_t sched_local; /* Internal routine to get scheduler thread mask addrs */ -odp_thrmask_t *thread_sched_grp_mask(int index); +odp_thrmask_t HIDDEN *thread_sched_grp_mask(int index); static void sched_local_init(void) { diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index edc36a1..23c9161 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -42,6 +42,7 @@ #include <odp_classification_inlines.h> #include <odp_classification_internal.h> #include <odp/api/hints.h> +#include <odp_internal.h> #include <odp/helper/eth.h> #include <odp/helper/ip.h> @@ -52,8 +53,8 @@ static int sock_stats_reset(pktio_entry_t *pktio_entry); * As it is implemented as a weak symbol, it has zero effect on systems * with both. */ -int sendmmsg(int fd, struct mmsghdr *vmessages, unsigned int vlen, - int flags) __attribute__((weak)); +int HIDDEN sendmmsg(int fd, struct mmsghdr *vmessages, unsigned int vlen, + int flags) __attribute__((weak)); int sendmmsg(int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) { #ifdef SYS_sendmmsg
Internal functions should not be visible in the ABI. Signed-off-by: Anders Roxell <anders.roxell@linaro.org> --- .../linux-generic/include/odp_buffer_internal.h | 7 +- .../include/odp_classification_internal.h | 42 ++++++------ platform/linux-generic/include/odp_internal.h | 12 ++-- .../include/odp_name_table_internal.h | 23 +++---- .../linux-generic/include/odp_packet_internal.h | 27 ++++---- .../linux-generic/include/odp_packet_io_internal.h | 61 +++++++++--------- .../linux-generic/include/odp_packet_io_queue.h | 25 ++++---- platform/linux-generic/include/odp_packet_socket.h | 29 +++++---- .../linux-generic/include/odp_pkt_queue_internal.h | 24 +++---- platform/linux-generic/include/odp_pool_internal.h | 3 +- .../linux-generic/include/odp_queue_internal.h | 75 ++++++++++++---------- .../linux-generic/include/odp_schedule_internal.h | 12 ++-- .../include/odp_sorted_list_internal.h | 42 ++++++------ .../include/odp_timer_wheel_internal.h | 29 +++++---- platform/linux-generic/odp_packet_io.c | 2 +- platform/linux-generic/odp_schedule.c | 5 +- platform/linux-generic/pktio/socket.c | 5 +- 17 files changed, 228 insertions(+), 195 deletions(-)