---
name: "rte_lpm6_delete_all"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_lpm6.h"
---

# rte\_lpm6\_delete\_all(3)

Part of [rte\_lpm6.h(3)](/rte_lpm6.h/3.md).

## NAME

rte\_lpm6.h

## SYNOPSIS

`#include <stdint.h>`\
 `#include <rte_common.h>`\
 `#include <rte_ip6.h>`\

### Data Structures

struct **rte\_lpm6\_config**\

### Macros

\#define **RTE\_LPM6\_NAMESIZE**   32\

### Functions

struct rte\_lpm6 \* **rte\_lpm6\_create** (const char \*name, int socket\_id, const struct **rte\_lpm6\_config** \*config)\
 struct rte\_lpm6 \* **rte\_lpm6\_find\_existing** (const char \*name)\
 void **rte\_lpm6\_free** (struct rte\_lpm6 \*lpm)\
 int **rte\_lpm6\_add** (struct rte\_lpm6 \*lpm, const struct **rte\_ipv6\_addr** \*ip, uint8\_t depth, uint32\_t next\_hop)\
 int **rte\_lpm6\_is\_rule\_present** (struct rte\_lpm6 \*lpm, const struct **rte\_ipv6\_addr** \*ip, uint8\_t depth, uint32\_t \*next\_hop)\
 int **rte\_lpm6\_delete** (struct rte\_lpm6 \*lpm, const struct **rte\_ipv6\_addr** \*ip, uint8\_t depth)\
 int **rte\_lpm6\_delete\_bulk\_func** (struct rte\_lpm6 \*lpm, struct **rte\_ipv6\_addr** \*ips, uint8\_t \*depths, unsigned int n)\
 void **rte\_lpm6\_delete\_all** (struct rte\_lpm6 \*lpm)\
 int **rte\_lpm6\_lookup** (const struct rte\_lpm6 \*lpm, const struct **rte\_ipv6\_addr** \*ip, uint32\_t \*next\_hop)\
 int **rte\_lpm6\_lookup\_bulk\_func** (const struct rte\_lpm6 \*lpm, struct **rte\_ipv6\_addr** \*ips, int32\_t \*next\_hops, unsigned int n)\

## Detailed Description

RTE Longest Prefix Match for IPv6 (LPM6)

Definition in file **rte\_lpm6.h**.

## Macro Definition Documentation

### #define RTE\_LPM6\_NAMESIZE 32

Max number of characters in LPM name.

Definition at line **25** of file **rte\_lpm6.h**.

## Function Documentation

### struct rte\_lpm6 \* rte\_lpm6\_create (const char \* name, int socket\_id, const struct rte\_lpm6\_config \* config)

Create an LPM object.

**Parameters**

*name* LPM object name \
 *socket\_id* NUMA socket ID for LPM table memory allocation \
 *config* Structure containing the configuration

**Returns**

Handle to LPM object on success, NULL otherwise with rte\_errno set to an appropriate values. Possible rte\_errno values include:

- •

  E\_RTE\_NO\_CONFIG - function could not get pointer to rte\_config structure

- •

  E\_RTE\_SECONDARY - function was called from a secondary process instance

- •

  EINVAL - invalid parameter passed to function

- •

  ENOSPC - the maximum number of memzones has already been allocated

- •

  EEXIST - a memzone with the same name already exists

- •

  ENOMEM - no appropriate memory area found in which to create memzone

### struct rte\_lpm6 \* rte\_lpm6\_find\_existing (const char \* name)

Find an existing LPM object and return a pointer to it.

**Parameters**

*name* Name of the lpm object as passed to **rte\_lpm6\_create()**

**Returns**

Pointer to lpm object or NULL if object not found with rte\_errno set appropriately. Possible rte\_errno values include:

- •

  ENOENT - required entry not available to return.

### void rte\_lpm6\_free (struct rte\_lpm6 \* lpm)

Free an LPM object.

**Parameters**

*lpm* LPM object handle If lpm is NULL, no operation is performed.

### int rte\_lpm6\_add (struct rte\_lpm6 \* lpm, const struct rte\_ipv6\_addr \* ip, uint8\_t depth, uint32\_t next\_hop)

Add a rule to the LPM table.

**Parameters**

*lpm* LPM object handle \
 *ip* IP of the rule to be added to the LPM table \
 *depth* Depth of the rule to be added to the LPM table \
 *next\_hop* Next hop of the rule to be added to the LPM table

**Returns**

0 on success, negative value otherwise

### int rte\_lpm6\_is\_rule\_present (struct rte\_lpm6 \* lpm, const struct rte\_ipv6\_addr \* ip, uint8\_t depth, uint32\_t \* next\_hop)

Check if a rule is present in the LPM table, and provide its next hop if it is.

**Parameters**

*lpm* LPM object handle \
 *ip* IP of the rule to be searched \
 *depth* Depth of the rule to searched \
 *next\_hop* Next hop of the rule (valid only if it is found)

**Returns**

1 if the rule exists, 0 if it does not, a negative value on failure

### int rte\_lpm6\_delete (struct rte\_lpm6 \* lpm, const struct rte\_ipv6\_addr \* ip, uint8\_t depth)

Delete a rule from the LPM table.

**Parameters**

*lpm* LPM object handle \
 *ip* IP of the rule to be deleted from the LPM table \
 *depth* Depth of the rule to be deleted from the LPM table

**Returns**

0 on success, negative value otherwise

### int rte\_lpm6\_delete\_bulk\_func (struct rte\_lpm6 \* lpm, struct rte\_ipv6\_addr \* ips, uint8\_t \* depths, unsigned int n)

Delete a rule from the LPM table.

**Parameters**

*lpm* LPM object handle \
 *ips* Array of IPs to be deleted from the LPM table \
 *depths* Array of depths of the rules to be deleted from the LPM table \
 *n* Number of rules to be deleted from the LPM table

**Returns**

0 on success, negative value otherwise.

### void rte\_lpm6\_delete\_all (struct rte\_lpm6 \* lpm)

Delete all rules from the LPM table.

**Parameters**

*lpm* LPM object handle

### int rte\_lpm6\_lookup (const struct rte\_lpm6 \* lpm, const struct rte\_ipv6\_addr \* ip, uint32\_t \* next\_hop)

Lookup an IP into the LPM table.

**Parameters**

*lpm* LPM object handle \
 *ip* IP to be looked up in the LPM table \
 *next\_hop* Next hop of the most specific rule found for IP (valid on lookup hit only)

**Returns**

\-EINVAL for incorrect arguments, -ENOENT on lookup miss, 0 on lookup hit

### int rte\_lpm6\_lookup\_bulk\_func (const struct rte\_lpm6 \* lpm, struct rte\_ipv6\_addr \* ips, int32\_t \* next\_hops, unsigned int n)

Lookup multiple IP addresses in an LPM table.

**Parameters**

*lpm* LPM object handle \
 *ips* Array of IPs to be looked up in the LPM table \
 *next\_hops* Next hop of the most specific rule found for IP (valid on lookup hit only). This is an array of two byte values. The next hop will be stored on each position on success; otherwise the position will be set to -1. \
 *n* Number of elements in ips (and next\_hops) array to lookup.

**Returns**

\-EINVAL for incorrect arguments, otherwise 0

## Author

Generated automatically by Doxygen for DPDK from the source code.
