lpm: add const to lookup parameter
authorStanislaw Kardach <kda@semihalf.com>
Wed, 1 Jun 2022 11:15:41 +0000 (13:15 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 3 Jun 2022 09:12:43 +0000 (11:12 +0200)
All other rte_lpm_lookup* functions take lpm argument as a const. As the
basic rte_lpm_lookup() performs the same function, it should also do
that.

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
lib/lpm/rte_lpm.h

index eb91960..1cf863a 100644 (file)
@@ -279,7 +279,7 @@ rte_lpm_delete_all(struct rte_lpm *lpm);
  *   -EINVAL for incorrect arguments, -ENOENT on lookup miss, 0 on lookup hit
  */
 static inline int
-rte_lpm_lookup(struct rte_lpm *lpm, uint32_t ip, uint32_t *next_hop)
+rte_lpm_lookup(const struct rte_lpm *lpm, uint32_t ip, uint32_t *next_hop)
 {
        unsigned tbl24_index = (ip >> 8);
        uint32_t tbl_entry;