From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5BFC1A0544; Fri, 27 May 2022 22:15:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0580B410DC; Fri, 27 May 2022 22:15:25 +0200 (CEST) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 592F840E78 for ; Fri, 27 May 2022 22:15:24 +0200 (CEST) Received: by mail-pl1-f169.google.com with SMTP id a13so5027521plh.6 for ; Fri, 27 May 2022 13:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KTim4fpoAN/lASNvvt5GgEZs4O6vFlFtP9IZJcmKiII=; b=gC4Noj1Ev/gZFftwz1q+FxBUlDbtyInxeOILsbLmbYmG7IYqfteud5rbwGK9wdSeSI Fe4d1yK91KoR30puj09ErpmJP/EPM1ueFX5zsMZHCBIMPGQth09PU5KMZ29PSPcGCbst K2mK3F6U5SKNoEYFer01PQdK02GbCQj9HF88FmBXsaiOhvtneleHwWNRIQBRP1Ny65VZ KAWvlgtEeUx0bveX9+IMpGMc0YxcblnqN+DbIUETuJYpNCQWOt5tWz+wYurUCma7Dpwl PJsHirRWS/r/ukwm3aqwzE8GPp46jA34/QcOHTSwPZ7DzFl5VmMlF0qdXQYdrY31woWR kNMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KTim4fpoAN/lASNvvt5GgEZs4O6vFlFtP9IZJcmKiII=; b=a2fcOlAAB+MNAtdqJI+ZhgwNQ1k5Y0nYRw4Fk+ea3AWGjCloKh66Gm1aIuOJNC/elv UcUELn8hMK5NMJmdkM+rgNLCPS8V69ogfDrPehYPtDLH1A9pn12d2zTOrmNIZP9y/f0X Y1p3LxcC7SpWAfIyNr38rO5y9irQnF2niTg3pkJ5zQ5/I257bRH7Rzm0TQ5cZQxjFIAa 8InBN524tl8u0vMtAJQXdkwuebFWtOKCxIBVBvXsxKmNXVjaQKcKdBayPaA16+rWMAtQ Cv5C9PCQ7GWglMAsbQTpj5uLOAu8AwLPhSXFDGFB4EBA2QebgEGwbMu6cwgqaIRNMX+y 89OQ== X-Gm-Message-State: AOAM531f7BoWZYochgNugv1i8nOJDviGhvFzQOA9N5Q76EVdhMADofE/ /1Ucd6YV+u+3w81KCHW06LYoqA== X-Google-Smtp-Source: ABdhPJyrQJwKz006tPMCaUlCsVjF5nVeiTg6sybIxI4szXA7gHqeVUKgQHUOxBWhkFAK5IDOxA0SVA== X-Received: by 2002:a17:90b:3b4b:b0:1e2:9a00:1c9c with SMTP id ot11-20020a17090b3b4b00b001e29a001c9cmr971519pjb.204.1653682523385; Fri, 27 May 2022 13:15:23 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id m8-20020a170902f64800b0015edfccfdb5sm4011163plg.50.2022.05.27.13.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 13:15:22 -0700 (PDT) Date: Fri, 27 May 2022 13:15:20 -0700 From: Stephen Hemminger To: Stanislaw Kardach Cc: Vladimir Medvedkin , Michal Mazurek , dev@dpdk.org, Frank Zhao , Sam Grove , mw@semihalf.com, upstream@semihalf.com Subject: Re: [PATCH v2 2/2] lpm: add a scalar version of lookupx4 function Message-ID: <20220527131520.23d9f544@hermes.local> In-Reply-To: <20220527181822.716758-2-kda@semihalf.com> References: <20220510115824.457885-1-kda@semihalf.com> <20220527181822.716758-1-kda@semihalf.com> <20220527181822.716758-2-kda@semihalf.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Fri, 27 May 2022 20:18:22 +0200 Stanislaw Kardach wrote: > +static inline void > +rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4], > + uint32_t defv) > +{ > + uint32_t nh; > + int i, ret; > + > + for (i = 0; i < 4; i++) { > + ret = rte_lpm_lookup(lpm, ((rte_xmm_t)ip).u32[i], &nh); > + hop[i] = (ret == 0) ? nh : defv; > + } > +} For performance, manually unroll the loop.