Hi, Steve, Best Regards, Mark
> -----Original Message----- > From: Liang, Cunming > Sent: Tuesday, October 27, 2015 1:28 PM > To: Chen, Jing D; dev at dpdk.org > Cc: Tao, Zhe; He, Shaopeng; Ananyev, Konstantin; Richardson, Bruce > Subject: Re: [PATCH v2 08/16] fm10k: add Vector RX scatter function > > Hi, > > On 10/22/2015 5:44 PM, Chen Jing D(Mark) wrote: > > From: "Chen Jing D(Mark)" <jing.d.chen at intel.com> > > > > Add func fm10k_recv_scattered_pkts_vec to receive chained packets > > with SSE instructions. > > > > Signed-off-by: Chen Jing D(Mark) <jing.d.chen at intel.com> > > --- > > drivers/net/fm10k/fm10k.h | 2 + > > drivers/net/fm10k/fm10k_rxtx_vec.c | 88 > ++++++++++++++++++++++++++++++++++++ > > 2 files changed, 90 insertions(+), 0 deletions(-) > > > [...] > > + > > +/* > > + * vPMD receive routine that reassembles scattered packets > > + * > > + * Notice: > > + * - don't support ol_flags for rss and csum err > > + * - nb_pkts < RTE_IXGBE_DESCS_PER_LOOP, just return no packet > > + * - nb_pkts > RTE_IXGBE_MAX_RX_BURST, only scan > RTE_IXGBE_MAX_RX_BURST > > + * numbers of DD bit > In order to make sure nb_pkts > RTE_IXGBE_MAX_RX_BURST, it's necessary > to do RTE_MIN(). I'll remove the improper comments. In func fm10k_recv_raw_pkts_vec, it will use nb_pkts as index to iterate properly. After then, below func will use actual received packet size nb_bufs as index to iterate. So, I think RTE_MIN() is not necessary? > > + * - floor align nb_pkts to a RTE_IXGBE_DESC_PER_LOOP power-of-two > > + */ > > +uint16_t > > +fm10k_recv_scattered_pkts_vec(void *rx_queue, > > + struct rte_mbuf **rx_pkts, > > + uint16_t nb_pkts) > > +{ > > + struct fm10k_rx_queue *rxq = rx_queue; > > + uint8_t split_flags[RTE_FM10K_MAX_RX_BURST] = {0}; > > + unsigned i = 0; > > + > > + /* get some new buffers */ > > + uint16_t nb_bufs = fm10k_recv_raw_pkts_vec(rxq, rx_pkts, nb_pkts, > > + split_flags); > > + if (nb_bufs == 0) > > + return 0; > > + > > + /* happy day case, full burst + no packets to be joined */ > > + const uint64_t *split_fl64 = (uint64_t *)split_flags; > > + if (rxq->pkt_first_seg == NULL && > > + split_fl64[0] == 0 && split_fl64[1] == 0 && > > + split_fl64[2] == 0 && split_fl64[3] == 0) > > + return nb_bufs; > > + > > + /* reassemble any packets that need reassembly*/ > > + if (rxq->pkt_first_seg == NULL) { > > + /* find the first split flag, and only reassemble then*/ > > + while (i < nb_bufs && !split_flags[i]) > > + i++; > > + if (i == nb_bufs) > > + return nb_bufs; > > + } > > + return i + fm10k_reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i, > > + &split_flags[i]); > > +}