From patchwork Mon May 30 18:24:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Kardach X-Patchwork-Id: 112090 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1994AA0540; Mon, 30 May 2022 20:24:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F1F2440689; Mon, 30 May 2022 20:24:46 +0200 (CEST) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by mails.dpdk.org (Postfix) with ESMTP id C0F98400D6 for ; Mon, 30 May 2022 20:24:45 +0200 (CEST) Received: by mail-lf1-f53.google.com with SMTP id u23so18016245lfc.1 for ; Mon, 30 May 2022 11:24:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DUEGBou937xXZO2hVTTU9+mNu3KmWeD84Qaf9kgbcvI=; b=58vPgQ/WtxHYosIEKZaI4ic7VbVZlZM9pWQ7lIzjfXYfBSbQ79WgjjrK2UotPxElYN EaUyQHVa0ATiWPGW/HLr5ahcJzcpcwUdftzMufVK2WeOMUwsj66eXcgIYaRHdAHp60/V X3QQmrTikN40SZIW9ZhtWdetCnl6qokh1nkNd7tSMgKSlMxbSkchJyJkQvB+ZHGI/Tsz GSbDjQG8ziWKF4grwgwYydjedNFodQqxtkdri2R7jVDSL6dZHo9xY9w0d2VvJwvHWw8K 8jsT43ZRmmwv4VAzuqhdrgoCSmMw4PG1+pThhUup2iWepE5pRLfOXDcZjAcVJfGfxBtH +hpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DUEGBou937xXZO2hVTTU9+mNu3KmWeD84Qaf9kgbcvI=; b=Z2n73l5GyX8mb/Vo1VU/5/eMr2Tvh3JKfOSlrUphAzaRHneZ8+bvHX2kYr+P0NDKSq xjd9e76laFUyGHr92uWQXdXvlTcTfAnFA5QKxl4zg9Wrvyt02vCT7vDb2OpMIVsX5Fjq Fsm4pCYTBX0J1bkvcHYMPY4ysSMO2hfdxLlWTDjdElzTlel4UwLmrHkUNkMaBhioRnhR wF4X/dJX/pvRFyU6M045qh4+eF+meS5Ga+Bee4DztK/euGPGf2O+tMi6RKERnTBOxHIc +JwTWy1yQFuELvlj+gKDdFiLQcvnBGsf9KV6QY+lh2Hy6ahLqF+Uvk038fp/GYJQYI7W qtwQ== X-Gm-Message-State: AOAM532CWUCGH4c33NnulPRCIFE60fr5hViGE+r/uGJMFV58LmZkv86o hESPT6lbcmfIyAilSHbilTeu5A== X-Google-Smtp-Source: ABdhPJwrbNPynrI3TlbOJSLLwcVUm73WIC6Y+NhAXlty9MMMFdXb/yOz3foY30KqtE8Qhf2gMeDQ6Q== X-Received: by 2002:a05:6512:1093:b0:478:9c38:a227 with SMTP id j19-20020a056512109300b004789c38a227mr21284948lfg.630.1653935085310; Mon, 30 May 2022 11:24:45 -0700 (PDT) Received: from localhost.localdomain (89-73-146-138.dynamic.chello.pl. [89.73.146.138]) by smtp.gmail.com with ESMTPSA id p16-20020a2eb990000000b00253d431466asm2665972ljp.96.2022.05.30.11.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 11:24:44 -0700 (PDT) From: Stanislaw Kardach To: Vladimir Medvedkin Cc: Stanislaw Kardach , dev@dpdk.org, Frank Zhao , Sam Grove , mw@semihalf.com, upstream@semihalf.com Subject: [PATCH v3 1/2] lpm: add const to lpm arg of rte_lpm_lookup Date: Mon, 30 May 2022 20:24:36 +0200 Message-Id: <20220530182437.56853-1-kda@semihalf.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220527181822.716758-1-kda@semihalf.com> References: <20220527181822.716758-1-kda@semihalf.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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. As this function is inline, no API/ABI change happens. Signed-off-by: Stanislaw Kardach Acked-by: Stephen Hemminger Acked-by: Vladimir Medvedkin --- lib/lpm/rte_lpm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lpm/rte_lpm.h b/lib/lpm/rte_lpm.h index eb91960e81..1cf863a146 100644 --- a/lib/lpm/rte_lpm.h +++ b/lib/lpm/rte_lpm.h @@ -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;