From patchwork Thu Feb 9 19:35:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 93780 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp163373qgi; Thu, 9 Feb 2017 11:35:54 -0800 (PST) X-Received: by 10.200.41.91 with SMTP id z27mr4827948qtz.116.1486668954776; Thu, 09 Feb 2017 11:35:54 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i66si8736346qkd.220.2017.02.09.11.35.54; Thu, 09 Feb 2017 11:35:54 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 6124460864; Thu, 9 Feb 2017 19:35:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 3A97660766; Thu, 9 Feb 2017 19:35:46 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 4C6046077E; Thu, 9 Feb 2017 19:35:43 +0000 (UTC) Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by lists.linaro.org (Postfix) with ESMTPS id 4FFAC60741 for ; Thu, 9 Feb 2017 19:35:41 +0000 (UTC) Received: by mail-oi0-f53.google.com with SMTP id j15so8309054oih.2 for ; Thu, 09 Feb 2017 11:35:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XGl2J/8s7ODwciegJHo/REotAgEFh0gE6NLeMrPwTCg=; b=UUs+5pGn7ZrcSb/QcrS+ABr0mn0LCtLhV8fU6eJfBfApC3aPlWL+8S+44V7LZlDHjl 6w5IH3075QBRSndK6rSSQkBbATntJ22EPqA0khixXVqywZXkN0hNP6mCHIV4AftK7ULs DaNbrNlIx7HBRtqYQenTlJfPu4VMy4dafpB1qQLvwRB9KWLIBsDJUYp9yujWCRA19ghE 9hi9hxuXFrhRZprfAk1L2sVm+SPWUwFJD5UlouxHpnce+8Uts4PWXw+aeLgIfel1cC0S fFHQXh4u/UZP/x6ouzGhcbxmhynLMnKegaLTMQmJKOY0W/54j/mRgY0Iuu+AbKFLtBzW c/gw== X-Gm-Message-State: AMke39kJiaa97QDjKfkh/JcCFQ/lfr0488zK4QGk/mkuHp9A5wvPUtq9um/+c9fiBcB4eylynus= X-Received: by 10.202.84.143 with SMTP id i137mr2556497oib.202.1486668940473; Thu, 09 Feb 2017 11:35:40 -0800 (PST) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id n126sm6267277oia.18.2017.02.09.11.35.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Feb 2017 11:35:39 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 9 Feb 2017 13:35:35 -0600 Message-Id: <20170209193535.21656-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0.295.gd7dffce Subject: [lng-odp] [PATCHv3] doc: helper: add missing doxygen for helper table functions X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2865 by adding missing doxygen documentation for helper table functions Signed-off-by: Bill Fischofer --- Changes for v3: - Change @private to @internal for compatibility with older doxygen levels helper/include/odp/helper/odph_cuckootable.h | 80 ++++++++++++++++++--- helper/include/odp/helper/odph_hashtable.h | 75 +++++++++++++++++++- helper/include/odp/helper/odph_iplookuptable.h | 97 ++++++++++++++++++++++---- helper/include/odp/helper/odph_lineartable.h | 65 ++++++++++++++++- helper/include/odp/helper/table.h | 10 ++- 5 files changed, 299 insertions(+), 28 deletions(-) -- 2.11.0.295.gd7dffce diff --git a/helper/include/odp/helper/odph_cuckootable.h b/helper/include/odp/helper/odph_cuckootable.h index d5699807..55f43fed 100644 --- a/helper/include/odp/helper/odph_cuckootable.h +++ b/helper/include/odp/helper/odph_cuckootable.h @@ -52,28 +52,92 @@ extern "C" { #endif +/** + * @addtogroup odph_cuckootable ODPH CUCKOO TABLE + * @{ + */ + +/** + * Create a cuckoo table + * + * @param name Name of the cuckoo table to be created + * @param capacity Number of elements table may store + * @param key_size Size of the key for each element + * @param value_size Size of the value stored for each element + * + * @return Handle of created cuckoo table + * @retval NULL Create failed + */ odph_table_t odph_cuckoo_table_create( const char *name, uint32_t capacity, uint32_t key_size, uint32_t value_size); +/** + * Lookup a cuckoo table by name + * + * @param name Name of the table to be located + * + * @return Handle of the located cuckoo table + * @retval NULL No table matching supplied name found + */ odph_table_t odph_cuckoo_table_lookup(const char *name); +/** + * Destroy a cuckoo table + * + * @param table Handle of the cuckoo table to be destroyed + * + * @retval 0 Success + * @retval < 0 Failure + */ int odph_cuckoo_table_destroy(odph_table_t table); -int odph_cuckoo_table_put_value( - odph_table_t table, - void *key, void *value); +/** + * Insert a key/value pair into a cuckoo table + * + * @param table Table into which value is to be stored + * @param key Address of an odph_table_t to be used as key + * @param value Value to be associated with specified key + * + * @retval >= 0 Success + * @retval < 0 Failure + */ +int odph_cuckoo_table_put_value(odph_table_t table, void *key, void *value); -int odph_cuckoo_table_get_value( - odph_table_t table, - void *key, void *buffer, - uint32_t buffer_size); +/** + * Retrieve a value from a cuckoo table + * + * @param table Table from which value is to be retrieved + * @param key Address of an odph_table_t to be used as key + * @param[out] buffer Address of buffer to receive resulting value + * @param buffer_size Size of supplied buffer + * + * @retval 0 Success + * @retval 1 Success + * @retval < 0 Failure + */ +int odph_cuckoo_table_get_value(odph_table_t table, + void *key, void *buffer, + uint32_t buffer_size); +/** + * Remove a value from a cuckoo table + * + * @param table Table from which value is to be removed + * @param key Address of odph_table_t to be used as key + * + * @retval >= 0 Success + * @retval < 0 Failure + */ int odph_cuckoo_table_remove_value(odph_table_t table, void *key); -extern odph_table_ops_t odph_cuckoo_table_ops; +extern odph_table_ops_t odph_cuckoo_table_ops; /**< @internal */ + +/** + * @} + */ #ifdef __cplusplus } diff --git a/helper/include/odp/helper/odph_hashtable.h b/helper/include/odp/helper/odph_hashtable.h index bb75cb9f..1f91f31e 100644 --- a/helper/include/odp/helper/odph_hashtable.h +++ b/helper/include/odp/helper/odph_hashtable.h @@ -19,22 +19,93 @@ extern "C" { #endif +/** + * @addtogroup odph_hash_table ODPH HASH TABLE + * @{ + */ + +/** + * Create a hash table + * + * @param name Name of the hash table to be created. + * @param capacity Number of elements table may store + * @param key_size Size of the key for each element + * @param value_size Size of the value stored for each element + * + * @return Handle of created hash table + * @retval NULL Create failed + */ odph_table_t odph_hash_table_create(const char *name, uint32_t capacity, uint32_t key_size, uint32_t value_size); + +/** + * Lookup a hash table by name + * + * @param name Name of the table to be located + * + * @return Handle of the located hash table + * @return NULL No table matching supplied name found + */ odph_table_t odph_hash_table_lookup(const char *name); + +/** + * Destroy a hash table + * + * @param table Handle of the hash table to be destroyed + * + * @retval 0 Success + * @retval < 0 Failure + */ int odph_hash_table_destroy(odph_table_t table); + +/** + * Insert a key/value pair into a hash table + * + * @param table Table into which value is to be stored + * @param key Address of an odph_table_t to be used as key + * @param value Value to be associated with specified key + * + * @retval >= 0 Success + * @retval < 0 Failure + */ int odph_hash_put_value(odph_table_t table, void *key, void *value); + +/** + * Retrieve a value from a hash table + * + * @param table Table from which value is to be retrieved + * @param key Address of an odph_table_t to be used as key + * @param[out] buffer Address of buffer to receive resulting value + * @param buffer_size Size of supplied buffer + * + * @retval 0 Success + * @retval 1 Success + * @retval < 0 Failure + */ int odph_hash_get_value(odph_table_t table, void *key, void *buffer, uint32_t buffer_size); + +/** + * Remove a value from a hash table + * + * @param table Table from which value is to be removed + * @param key Address of odph_table_t to be used as key + * + * @retval >= 0 Success + * @retval < 0 Failure + */ int odph_hash_remove_value(odph_table_t table, void *key); -extern odph_table_ops_t odph_hash_table_ops; +extern odph_table_ops_t odph_hash_table_ops; /**< @internal */ + +/** + * @} + */ #ifdef __cplusplus } #endif #endif - diff --git a/helper/include/odp/helper/odph_iplookuptable.h b/helper/include/odp/helper/odph_iplookuptable.h index 0ae6b376..84c2cfdd 100644 --- a/helper/include/odp/helper/odph_iplookuptable.h +++ b/helper/include/odp/helper/odph_iplookuptable.h @@ -24,32 +24,99 @@ extern "C" { #endif +/** + * @addtogroup odph_iplookuptable ODPH IP LOOKUP TABLE + * @{ + */ + +/** + * IP Lookup Prefix + */ typedef struct { - uint32_t ip; - uint8_t cidr; + uint32_t ip; /**< IPv4 address */ + uint8_t cidr; /**< CIDR value for prefix matching */ } odph_iplookup_prefix_t; -odph_table_t odph_iplookup_table_create( - const char *name, - uint32_t ODP_IGNORED_1, - uint32_t ODP_IGNORED_2, - uint32_t value_size); +/** + * Create an IP lookup table + * + * @param name Name of the table to be created + * @param ODP_IGNORED_1 Unused + * @param ODP_IGNORED_2 Unused + * @param value_size Byte size of each entry in the table + * + * @return Handle of the created ip lookup table + * @retval NULL If table create failed + */ +odph_table_t odph_iplookup_table_create(const char *name, + uint32_t ODP_IGNORED_1, + uint32_t ODP_IGNORED_2, + uint32_t value_size); +/** + * Lookup an IP lookup table by name + * + * @param name Name of the table to be located + * + * @return Handle of the located ip lookup table + * @retval NULL No table matching supplied name found + */ odph_table_t odph_iplookup_table_lookup(const char *name); +/** + * Destroy an IP lookup table + * + * @param table Handle of the ip lookup table to be destroyed + * + * @retval 0 Success + * @retval < 0 Failure + */ int odph_iplookup_table_destroy(odph_table_t table); -int odph_iplookup_table_put_value( - odph_table_t table, void *key, void *value); +/** + * Insert a key/value pair into an ip lookup table + * + * @param table Table into which value is to be stored + * @param key Address of an odph_iplookup_prefix_t to be used as key + * @param value Value to be associated with specified key + * + * @retval >= 0 Success + * @retval < 0 Failure + */ +int odph_iplookup_table_put_value(odph_table_t table, void *key, void *value); + +/** + * Retrieve a value from an iplookup table + * + * @param table Table from which value is to be retrieved + * @param key Address of an odph_iplookup_prefix_t to be used as key + * @param[out] buffer Address of buffer to receive resulting value + * @param buffer_size Size of supplied buffer + * + * @retval 0 Success + * @retval 1 Success + * @retval < 0 Failure + */ +int odph_iplookup_table_get_value(odph_table_t table, void *key, + void *buffer, uint32_t buffer_size); -int odph_iplookup_table_get_value( - odph_table_t table, void *key, - void *buffer, uint32_t buffer_size); +/** + * Remove a value from an iplookup table + * + * @param table Table from which value is to be removed + * @param key Address of odph_iplookup_prefix_t to be used as key + * + * @retval >= 0 Success + * @retval < 0 Failure + * + */ +int odph_iplookup_table_remove_value(odph_table_t table, void *key); -int odph_iplookup_table_remove_value( - odph_table_t table, void *key); +extern odph_table_ops_t odph_iplookup_table_ops; /**< @internal */ -extern odph_table_ops_t odph_iplookup_table_ops; +/** + * @} + */ #ifdef __cplusplus } diff --git a/helper/include/odp/helper/odph_lineartable.h b/helper/include/odp/helper/odph_lineartable.h index 0b56b7fa..cd9fda39 100644 --- a/helper/include/odp/helper/odph_lineartable.h +++ b/helper/include/odp/helper/odph_lineartable.h @@ -20,21 +20,82 @@ extern "C" { #endif +/** + * @addtogroup odph_lineartable ODPH LINEAR TABLE + * @{ + */ + +/** + * Create a linear table + * + * @param name Name of the linear table to be created + * @param capacity Number of elements table may store + * @param ODP_IGNORED Ignored parameter + * @param value_size Size of the value stored for each element + * + * @return Handle of created linear table + * @return NULL Create failed + */ odph_table_t odph_linear_table_create(const char *name, uint32_t capacity, uint32_t ODP_IGNORED, uint32_t value_size); + +/** + * Lookup a linear table + * + * @param name Name of the table to be located + * + * @return Handle of the located linear table + * @retval NULL No table matching supplied name found + */ odph_table_t odph_linear_table_lookup(const char *name); + +/** + * Destroy a linear table + * + * @param table Handle of linear table to be destroyed + * + * @retval 0 Success + * @retval < 0 Failure + */ int odph_linear_table_destroy(odph_table_t table); + +/** + * Insert a value into a linear table + * + * @param table Table into which value is to be stored + * @param key Index value used as key + * @param value Value to be assoceiated with specified key index + * + * @retval >= 0 Success + * @retval < 0 Failure + */ int odph_linear_put_value(odph_table_t table, void *key, void *value); + +/** + * Retrieve a value from a linear table + * + * @param table Table from which value is to be retrieved + * @param key Index value used as key + * @param[out] buffer Address of buffer to receive resulting value + * @param buffer_size Size of supplied buffer + * + * @retval 0 Success + * @retval 1 Success + * @retval < 0 Failure + */ int odph_linear_get_value(odph_table_t table, void *key, void *buffer, uint32_t buffer_size); -extern odph_table_ops_t odph_linear_table_ops; +extern odph_table_ops_t odph_linear_table_ops; /**< @internal */ + +/** + * @} + */ #ifdef __cplusplus } #endif #endif - diff --git a/helper/include/odp/helper/table.h b/helper/include/odp/helper/table.h index 81022e55..b3440ef5 100644 --- a/helper/include/odp/helper/table.h +++ b/helper/include/odp/helper/table.h @@ -80,6 +80,11 @@ extern "C" { #endif +/** + * @addtogroup odph_tables ODPH TABLES + * @{ + */ + #include /** @@ -228,9 +233,12 @@ typedef struct odph_table_ops_t { odph_table_remove_value f_remove; } odph_table_ops_t; +/** + * @} + */ + #ifdef __cplusplus } #endif #endif -