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 63341A00C4; Fri, 30 Sep 2022 13:56:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F1B6D40684; Fri, 30 Sep 2022 13:56:44 +0200 (CEST) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by mails.dpdk.org (Postfix) with ESMTP id 3CBE14003F for ; Fri, 30 Sep 2022 13:56:44 +0200 (CEST) Received: by mail-qt1-f173.google.com with SMTP id j10so2481213qtv.4 for ; Fri, 30 Sep 2022 04:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=tdT3nbGA6eLwzAnpG7S32pxbUBjG3lRnfVcksB94aFY=; b=jHLOKiLKPz/fpdl6qcC/lEte2J74vlwIifx4nW31W+ucmbDteiY7J7FVYZRmesZt+J XttRoWjXYOaJI1b6Sl38cxOouKzf5gJdPGTFDvb20+YSpKzGc66V7hwNctvu0c86z7j2 qhHrVak+WyKpv3VSC41g7oc/BI63YgiJiiHZf30uYTdDjNjKoaB31AAFZwShqiNhAYax xJdn683u3Hw4XhJ7MBvH5ajnynfv7an+IkHnQU1O5DFpEU3rkOqhEokiejIOm2i874RV wb+CAqJkMYkrtShQ94e3GIJktD1mIFYTP0x5W4t92YYKG8sYGbgmaaKXE4btOYIFYZXK PdwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=tdT3nbGA6eLwzAnpG7S32pxbUBjG3lRnfVcksB94aFY=; b=NVsB51MnTl0ThZA68+0ISZAirP7xJsFoCSI15nc5WiVjDrDRR8+qlAwWeUrF0FoXAx am3lveSiUYHAt+l12BitThVBkL3r0D/QugJpEMjHPcokPxpcrsXFMGYGgiipUeV7A1Rx iAJp0yuwTpwc7+4d9DF5s+9t81IpCqX1MgzjOY5CCw3dcyFOUVl6fcTWgwQTTVIGwgkv KI0HmbHd0IKviMoT1HdQXDwZ9hISVvlFbM0Lhsc2IAJzPVuBw3EqDnaXUz8559PuXRse eL4DdcajWTNLaZi3j8+fpG2O/aP+L4elhyRp8sYFsLJ/BGULadIFN57E++gcuTq0xyFp 1Utg== X-Gm-Message-State: ACrzQf1E5JwAiinbeau+E0KiL8JzLbbH64BP8kU0X0DqNM5fh9wleUon BLKXE+ST18zGj/4vUnkemvVa8Ag0Bjdr0FUdstKmlMSx X-Google-Smtp-Source: AMsMyM65dltzOCn0GDqNPK3KJ7dIfaGweDwYPn39nCfO9+Cl/2GZNmc1Lql6tuwckogoM90lhpo4BI7Y8rrN8JAtTxc= X-Received: by 2002:a05:622a:593:b0:35d:5acd:f0c8 with SMTP id c19-20020a05622a059300b0035d5acdf0c8mr6288442qtb.173.1664539003542; Fri, 30 Sep 2022 04:56:43 -0700 (PDT) MIME-Version: 1.0 References: <20220927024756.947272-1-feifei.wang2@arm.com> <20220927024756.947272-4-feifei.wang2@arm.com> In-Reply-To: <20220927024756.947272-4-feifei.wang2@arm.com> From: Jerin Jacob Date: Fri, 30 Sep 2022 17:26:17 +0530 Message-ID: Subject: Re: [PATCH v2 3/3] examples/l3fwd: enable direct rearm mode To: Feifei Wang Cc: dev@dpdk.org, nd@arm.com, Honnappa Nagarahalli , Ruifeng Wang Content-Type: text/plain; charset="UTF-8" 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 Tue, Sep 27, 2022 at 8:18 AM Feifei Wang wrote: > > Enable direct rearm mode in l3fwd. Users can use parameters: > '--direct-rearm=(rx_portid,rx_queueid,tx_portid,tx_queueid)' > to enable direct rearm. > > Suggested-by: Honnappa Nagarahalli > Signed-off-by: Feifei Wang > Reviewed-by: Ruifeng Wang > Reviewed-by: Honnappa Nagarahalli > --- > examples/l3fwd/l3fwd.h | 12 +++++ > examples/l3fwd/l3fwd_lpm.c | 22 +++++++++ > examples/l3fwd/main.c | 94 +++++++++++++++++++++++++++++++++++++- > 3 files changed, 127 insertions(+), 1 deletion(-) > > diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h > index 40b5f32a9e..db097e344c 100644 > --- a/examples/l3fwd/l3fwd.h > +++ b/examples/l3fwd/l3fwd.h > @@ -57,6 +57,10 @@ > #endif > #define HASH_ENTRY_NUMBER_DEFAULT 16 > > +/* MAX number of direct rearm mapping entry */ > +#define MAX_DIRECT_REARM_ENTRY_NUMBER 16 > +#define MAX_DIRECT_REARM_QUEUE_PER_PORT 8 > + > struct parm_cfg { > const char *rule_ipv4_name; > const char *rule_ipv6_name; > @@ -114,6 +118,14 @@ extern struct parm_cfg parm_config; > > extern struct acl_algorithms acl_alg[]; > > +/* Used in direct rearm mode */ > +extern bool enabled_direct_rearm; > +extern uint8_t direct_rearm_entry_number; > +extern bool queue_enabled_direct_rearm[RTE_MAX_ETHPORTS][MAX_DIRECT_REARM_QUEUE_PER_PORT]; > +extern uint16_t direct_rearm_map_tx_port[RTE_MAX_ETHPORTS][MAX_DIRECT_REARM_QUEUE_PER_PORT]; > +extern uint16_t direct_rearm_map_tx_queue[RTE_MAX_ETHPORTS][MAX_DIRECT_REARM_QUEUE_PER_PORT]; > +extern uint8_t direct_rearm_entry_idx[RTE_MAX_ETHPORTS][MAX_DIRECT_REARM_QUEUE_PER_PORT]; > + > /* Send burst of packets on an output interface */ > static inline int > send_burst(struct lcore_conf *qconf, uint16_t n, uint16_t port) > diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c > index 22d7f61a42..973fe70aae 100644 > --- a/examples/l3fwd/l3fwd_lpm.c > +++ b/examples/l3fwd/l3fwd_lpm.c > @@ -150,6 +150,8 @@ lpm_main_loop(__rte_unused void *dummy) > @@ -205,6 +221,12 @@ lpm_main_loop(__rte_unused void *dummy) > for (i = 0; i < n_rx_q; ++i) { > portid = qconf->rx_queue_list[i].port_id; > queueid = qconf->rx_queue_list[i].queue_id; > + > + if (queue_enabled_direct_rearm[portid][queueid]) { IMO, We should not change fastpath code that impacts performance on other targets for a feature which has a very constraint use case. Also need for expressing [1], kind of defeat the purpose LPM table populated. IMO, If we need to add a test case for this API, testpmd would be an ideal place with a dedicated fwd_engine just for this. [1] > + " --direct-rearm (rx_port, rx_queue, tx_port, tx_queue): Put Tx queue sw-ring buffers into Rx queue\n"