From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 75E85A04DC; Mon, 26 Oct 2020 14:58:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 51FD029C6; Mon, 26 Oct 2020 14:58:50 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 6DED81E2B for ; Mon, 26 Oct 2020 14:58:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603720727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Yq7WdN6uQYOIJKQgM76o19cqaEN54VekM/H+w7SD6Ow=; b=FRS9kJbR0wpPDO9dg4m8o5raUU5ijkbKj/j6ZZIQFbGhdNGhetT8vdFdNNeZRUAhnY43u3 Yr6Jj+yUH7w/IyGOsIFNUHEPcSAJzsdbKSAeYafdT6VmuRagF01iZsZEaUy6poFH136n5i /a8B86YSPimZ84ItoNFlzumb5y5NJRU= Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-580-WjPgiqZyOmO9EkYp2qJNdQ-1; Mon, 26 Oct 2020 09:58:45 -0400 X-MC-Unique: WjPgiqZyOmO9EkYp2qJNdQ-1 Received: by mail-vk1-f199.google.com with SMTP id o204so596699vke.14 for ; Mon, 26 Oct 2020 06:58:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Yq7WdN6uQYOIJKQgM76o19cqaEN54VekM/H+w7SD6Ow=; b=QrrkMQFRoL2xhGj5ixUpsWN8MZxm7Up/RzTLo4PyRDnH7OWShToz8bJCMC3F1EwjDx baOCEkpLge4FX8SULGfznv5T+O+meENEXiqtBMY5zUMgLZVPNj3c+wm2A5pMUwZk1qWj kx+mAr4RvshMtHx8cYCkwtaOHMvlVP/K6C/TOPbEb8USXllSAbPhQUfbxNl72dewDXFN IPt4g+kp253q/ReUFs4cahTGIpGap08fVB0u56q5DAu1Icz/Tbe5YQqBkP0qgTwMnBSF o6VkbmLe/URk3coQSt9okB8llEZbligNYkVZPYdoYy/Yccyq1b+yjJzJEWeZQBWp7xgW gDRQ== X-Gm-Message-State: AOAM531MpE9cbi6jnY+YLq63UGI/lznbb47/ms0+Pt2asnuqCvvzD+s4 Zh1/bwhQlSITIk5BdZfSLTJ08GWPMmDivChWDKdbkG6l/w0k7b1H7+GVYSPx4j4xX0DlJL911Hv fOOSuclBc/WsO2tqSnJM= X-Received: by 2002:a67:d78b:: with SMTP id q11mr11475417vsj.17.1603720724703; Mon, 26 Oct 2020 06:58:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL7jV2u0Z0pHuVUsWqf2DP93fq1653CW7XTMN8FSk9I5o86/VzAaGb3M3nbyNmiAPGpOFP+SVBQz21nJHuEYY= X-Received: by 2002:a67:d78b:: with SMTP id q11mr11475393vsj.17.1603720724442; Mon, 26 Oct 2020 06:58:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Marchand Date: Mon, 26 Oct 2020 14:58:33 +0100 Message-ID: To: Vladimir Medvedkin Cc: dev , Jerin Jacob Kollanukkaran , Ray Kinsella , Thomas Monjalon , "Ananyev, Konstantin" , Bruce Richardson , Ciara Power Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v14 1/8] fib: make lookup function type configurable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hello Vladimir, On Sun, Oct 25, 2020 at 7:08 PM Vladimir Medvedkin wrote: > diff --git a/lib/librte_fib/rte_fib.h b/lib/librte_fib/rte_fib.h > index 84ee774..2097ee5 100644 > --- a/lib/librte_fib/rte_fib.h > +++ b/lib/librte_fib/rte_fib.h > @@ -58,6 +58,21 @@ enum rte_fib_dir24_8_nh_sz { > RTE_FIB_DIR24_8_8B > }; > > +/** Type of lookup function implementation */ > +enum rte_fib_dir24_8_lookup_type { > + RTE_FIB_DIR24_8_SCALAR_MACRO, > + /**< Macro based lookup function */ > + RTE_FIB_DIR24_8_SCALAR_INLINE, > + /**< > + * Lookup implementation using inlined functions > + * for different next hop sizes > + */ > + RTE_FIB_DIR24_8_SCALAR_UNI > + /**< > + * Unified lookup function for all next hop sizes > + */ > +}; > + We can't have a generic function, with a specific type/ Let's have a generic name, in hope it will be extended later for other fib implementations. For the default behavior and selecting the "best" possible implementation, we can introduce a RTE_FIB_LOOKUP_DEFAULT magic value that would work with any fib type. How about: enum rte_fib_lookup_type { RTE_FIB_LOOKUP_DEFAULT, RTE_FIB_LOOKUP_DIR24_8_SCALAR_MACRO, RTE_FIB_LOOKUP_DIR24_8_SCALAR_INLINE, RTE_FIB_LOOKUP_DIR24_8_SCALAR_UNI, RTE_FIB_LOOKUP_DIR24_8_VECTOR_AVX512, }; > /** FIB configuration structure */ > struct rte_fib_conf { > enum rte_fib_type type; /**< Type of FIB struct */ > @@ -196,6 +211,23 @@ __rte_experimental > struct rte_rib * > rte_fib_get_rib(struct rte_fib *fib); > > +/** > + * Set lookup function based on type > + * > + * @param fib > + * FIB object handle > + * @param type > + * type of lookup function > + * > + * @return > + * -EINVAL on failure > + * 0 on success > + */ > +__rte_experimental > +int > +rte_fib_set_lookup_fn(struct rte_fib *fib, > + enum rte_fib_dir24_8_lookup_type type); > + _fn does not give much info, how about rte_fib_select_lookup ? > #ifdef __cplusplus > } > #endif -- David Marchand