Ignore:
Timestamp:
Mar 18, 2020, 11:16:59 PM (4 years ago)
Author:
alain
Message:

Introduce remote_buf.c/.h & socket.c/.h files.
Update dev_nic.c/.h files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/grdxt.h

    r656 r657  
    22 * grdxt.h - Three-levels Generic Radix-tree definition.
    33 *
    4  * Authors  Alain Greiner (2016,2017,2018,2019)
     4 * Authors  Alain Greiner (2016,2017,2018,2019,2019)
    55 *
    66 * Copyright  UPMC Sorbonne Universites
     
    124124/*******************************************************************************************
    125125 * This function scan all radix-tree entries in increasing key order, starting from
    126  * the value defined by the <start_key> argument, and return a pointer on the first valid
    127  * registered item, and the found item key value.
     126 * the key defined by the <start_key> argument. It returns a pointer on the first valid
     127 * registered item, and returns in the <found_key> buffer the found item key value.
    128128 * It must be called by a local thread.
    129129 *******************************************************************************************
     
    142142
    143143/*******************************************************************************************
     144 * This function initialises the radix-tree descriptor,
     145 * and allocates memory for the first level array of pointers.
     146 * It can be called by any thread running in any cluster
     147 *******************************************************************************************
     148 * @ rt_xp     : extended pointer on the radix-tree descriptor.
     149 * @ ix1_width : number of bits in ix1 field
     150 * @ ix2_width : number of bits in ix2 field
     151 * @ ix3_width : number of bits in ix3 field
     152 * @ returns 0 if success / returns ENOMEM if no more memory.     
     153 ******************************************************************************************/
     154error_t grdxt_remote_init( xptr_t     rt_xp,
     155                           uint32_t   ix1_width,
     156                           uint32_t   ix2_width,
     157                           uint32_t   ix3_width );
     158
     159/*******************************************************************************************
     160 * This function releases all memory allocated to the radix-tree infrastructure.
     161 * A warning message is printed on the kernel TXT0 if the radix tree is not empty.
     162 * It can be called by any thread running in any cluster
     163 *******************************************************************************************
     164 * @ rt_xp    : extended pointer on the radix-tree descriptor.
     165 ******************************************************************************************/
     166void grdxt_remote_destroy( xptr_t  rt_xp );
     167
     168/*******************************************************************************************
    144169 * This function insert a new item in a - possibly remote - radix tree.
    145170 * It dynamically allocates memory for new second and third level arrays if required.
     171 * It can be called by any thread running in any cluster
    146172 *******************************************************************************************
    147173 * @ rt_xp   : extended pointer on the radix-tree descriptor.
     
    157183 * This function removes an item identified by its key from a - possibly remote - radix
    158184 * tree, and returns a local pointer on the removed item. No memory is released.
     185 * It can be called by a thread running in any cluster
    159186 *******************************************************************************************
    160187 * @ rt_xp   : pointer on the radix-tree descriptor.
    161188 * @ key     : key value.
    162  * @ returns local pointer on removed item if success / returns NULL if failure.
    163  ******************************************************************************************/
    164 void * grdxt_remote_remove( xptr_t    rt_xp,
     189 * @ returns extended pointer on removed item if success / returns XPTR_NULL if failure.
     190 ******************************************************************************************/
     191xptr_t grdxt_remote_remove( xptr_t    rt_xp,
    165192                            uint32_t  key );
    166193
     
    169196 * on the item identified by the <key> argument, from the radix tree identified by
    170197 * the <rt_xp> remote pointer.
     198 * It can be called by a thread running in any cluster
    171199 *******************************************************************************************
    172200 * @ rt_xp   : extended pointer on the radix-tree descriptor.
    173201 * @ key     : key value.
    174  * @ returns an extended pointer on found item if success / returns XPTR_NULL if failure.
     202 * @ returns extended pointer on found item if success / returns XPTR_NULL if not found.
    175203 ******************************************************************************************/
    176204xptr_t grdxt_remote_lookup( xptr_t     rt_xp,
     
    178206
    179207/*******************************************************************************************
     208 * This function scan all radix-tree entries of a - possibly remote - radix tree <rt_xp>,
     209 * in increasing key order, starting from the key defined by the <start_key> argument.
     210 * It returns an extended pointer on the first valid registered item, and returns in the
     211 * <found_key> buffer the found item key value.
     212 * It can be called by a thread running in any cluster
     213 *******************************************************************************************
     214 * @ rt_xp      : extended pointer on the radix-tree descriptor.
     215 * @ start_key  : key starting value for the scan.
     216 * @ found_key  : [out] buffer for found key value.
     217 * @ return xptr on first valid item if found / return XPTR_NULL if no item found.
     218 ******************************************************************************************/
     219xptr_t grdxt_remote_get_first( xptr_t     rt_xp,
     220                               uint32_t   start_key,
     221                               uint32_t * found_key );
     222
     223/*******************************************************************************************
    180224 * This function displays the current content of a possibly remote radix_tree.
     225 * It can be called by a thread running in any cluster
    181226 *******************************************************************************************
    182227 * @ rt      : extended pointer on the radix-tree descriptor.
Note: See TracChangeset for help on using the changeset viewer.