> -----Original Message-----
> From: Liu, Mingxia <mingxia....@intel.com>
> Sent: Tuesday, May 30, 2023 12:00 PM
> To: Xing, Beilei <beilei.x...@intel.com>; Wu, Jingjing <jingjing...@intel.com>
> Cc: dev@dpdk.org; Wang, Xiao W <xiao.w.w...@intel.com>
> Subject: RE: [PATCH v4 13/13] net/cpfl: support hairpin bind/unbind
> 
> 
> 
> > -----Original Message-----
> > From: Xing, Beilei <beilei.x...@intel.com>
> > Sent: Friday, May 26, 2023 3:39 PM
> > To: Wu, Jingjing <jingjing...@intel.com>
> > Cc: dev@dpdk.org; Liu, Mingxia <mingxia....@intel.com>; Xing, Beilei
> > <beilei.x...@intel.com>; Wang, Xiao W <xiao.w.w...@intel.com>
> > Subject: [PATCH v4 13/13] net/cpfl: support hairpin bind/unbind
> >
> > From: Beilei Xing <beilei.x...@intel.com>
> >
> > This patch supports hairpin_bind/unbind ops.
> >
> > Signed-off-by: Xiao Wang <xiao.w.w...@intel.com>
> > Signed-off-by: Beilei Xing <beilei.x...@intel.com>
> > ---
> >  drivers/net/cpfl/cpfl_ethdev.c | 137 +++++++++++++++++++++++++++++++++
> >  drivers/net/cpfl/cpfl_rxtx.c   |  28 +++++++
> >  drivers/net/cpfl/cpfl_rxtx.h   |   2 +
> >  3 files changed, 167 insertions(+)
> >
> > diff --git a/drivers/net/cpfl/cpfl_ethdev.c
> > b/drivers/net/cpfl/cpfl_ethdev.c index
> > d6dc1672f1..4b70441e27 100644
> > --- a/drivers/net/cpfl/cpfl_ethdev.c
> > +++ b/drivers/net/cpfl/cpfl_ethdev.c
> > @@ -1114,6 +1114,141 @@ cpfl_hairpin_get_peer_ports(struct
> rte_eth_dev
> > *dev, uint16_t *peer_ports,
> >     return j;
> >  }
> >
> >
> >  static int
> > diff --git a/drivers/net/cpfl/cpfl_rxtx.c
> > b/drivers/net/cpfl/cpfl_rxtx.c index 38c48ad8c7..ef83a03c2b 100644
> > --- a/drivers/net/cpfl/cpfl_rxtx.c
> > +++ b/drivers/net/cpfl/cpfl_rxtx.c
> > @@ -1011,6 +1011,34 @@ cpfl_switch_hairpin_bufq_complq(struct
> > cpfl_vport *cpfl_vport, bool on)
> >     return err;
> >  }
> >
> > +int
> > +cpfl_switch_hairpin_complq(struct cpfl_vport *cpfl_vport, bool on) {
> > +   struct idpf_vport *vport = &cpfl_vport->base;
> > +   uint32_t type;
> > +   int err, queue_id;
> > +
> > +   type = VIRTCHNL2_QUEUE_TYPE_TX_COMPLETION;
> > +   queue_id = cpfl_vport->p2p_tx_complq->queue_id;
> > +   err = idpf_vc_ena_dis_one_queue(vport, queue_id, type, on);
> > +
> > +   return err;
> > +}
> > +
> > +int
> > +cpfl_switch_hairpin_bufq(struct cpfl_vport *cpfl_vport, bool on) {
> > +   struct idpf_vport *vport = &cpfl_vport->base;
> > +   uint32_t type;
> > +   int err, queue_id;
> > +
> > +   type = VIRTCHNL2_QUEUE_TYPE_RX_BUFFER;
> > +   queue_id = cpfl_vport->p2p_rx_bufq->queue_id;
> > +   err = idpf_vc_ena_dis_one_queue(vport, queue_id, type, on);
> > +
> > +   return err;
> > +}
> > +
> [Liu, Mingxia] Can cpfl_switch_hairpin_bufq_complq() in patch 9/13 be
> optimized by calling cpfl_switch_hairpin_complq() and
> cpfl_switch_hairpin_bufq()?

Yes, the functions are duplicated. Refined in next version.

> >  int
> >  cpfl_switch_hairpin_rxtx_queue(struct cpfl_vport *cpfl_vport,
> > uint16_t logic_qid,
> >                            bool rx, bool on)
> > diff --git a/drivers/net/cpfl/cpfl_rxtx.h
> > b/drivers/net/cpfl/cpfl_rxtx.h index
> > 42dfd07155..86e97541c4 100644
> > --- a/drivers/net/cpfl/cpfl_rxtx.h
> > +++ b/drivers/net/cpfl/cpfl_rxtx.h
> > @@ -114,6 +114,8 @@ int cpfl_hairpin_txq_config(struct idpf_vport
> > *vport, struct cpfl_tx_queue *cpfl  int
> > cpfl_hairpin_rx_bufq_config(struct cpfl_vport *cpfl_vport);  int
> > cpfl_hairpin_rxq_config(struct idpf_vport *vport, struct cpfl_rx_queue
> > *cpfl_rxq);  int cpfl_switch_hairpin_bufq_complq(struct
> > cpfl_vport *cpfl_vport, bool on);
> > +int cpfl_switch_hairpin_complq(struct cpfl_vport *cpfl_vport, bool
> > +on); int cpfl_switch_hairpin_bufq(struct cpfl_vport *cpfl_vport, bool
> > +on);
> >  int cpfl_switch_hairpin_rxtx_queue(struct cpfl_vport *cpfl_vport, uint16_t
> qid,
> >                                bool rx, bool on);
> >  #endif /* _CPFL_RXTX_H_ */
> > --
> > 2.26.2

Reply via email to