On Tue, Oct 11, 2022 at 12:58 PM Feifei Wang <feifei.wa...@arm.com> wrote:
>
>
>
> > -----邮件原件-----
> > 发件人: Jerin Jacob <jerinjac...@gmail.com>
> > 发送时间: Friday, September 30, 2022 7:56 PM
> > 收件人: Feifei Wang <feifei.wa...@arm.com>
> > 抄送: dev@dpdk.org; nd <n...@arm.com>; Honnappa Nagarahalli
> > <honnappa.nagaraha...@arm.com>; Ruifeng Wang
> > <ruifeng.w...@arm.com>
> > 主题: Re: [PATCH v2 3/3] examples/l3fwd: enable direct rearm mode
> >
> > On Tue, Sep 27, 2022 at 8:18 AM Feifei Wang <feifei.wa...@arm.com>
> > 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 <honnappa.nagaraha...@arm.com>
> > > Signed-off-by: Feifei Wang <feifei.wa...@arm.com>
> > > Reviewed-by: Ruifeng Wang <ruifeng.w...@arm.com>
> > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagaraha...@arm.com>
> > > ---
> > >  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_REAR
> > M_QUEUE_P
> > > +ER_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_REAR
> > M_QUEUE_PE
> > > +R_PORT]; extern uint8_t
> > >
> > +direct_rearm_entry_idx[RTE_MAX_ETHPORTS][MAX_DIRECT_REARM_QUE
> > UE_PER_P
> > > +ORT];
> > > +
> > >  /* 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"
> Thanks very much for your comments. This patch here is mainly to facilitate 
> verification test
> and show how to use direct-rearm API.

IMO, it should be other way around. for PMD and ethdev API
verification, Please use testpmd.

>
> After 'direct-rearm' matures, we will consider to enable direct-rearm in 
> testpmd or other
> application in dpdk.

Reply via email to