Skip to content

Commit

Permalink
net/fm10k: fix vector Rx
Browse files Browse the repository at this point in the history
[ upstream commit 2b768c4 ]

The scattered receive path should use a wrapper function to achieve the
goal of burst maximizing.

Bugzilla ID: 516
Fixes: fe65e1e ("fm10k: add vector scatter Rx")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
Jeff Guo authored and bluca committed Nov 9, 2020
1 parent 2bce196 commit 4445ad3
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions drivers/net/fm10k/fm10k_rxtx_vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,18 +645,15 @@ fm10k_reassemble_packets(struct fm10k_rx_queue *rxq,
return pkt_idx;
}

/*
* vPMD receive routine that reassembles scattered packets
/**
* vPMD receive routine that reassembles single burst of 32 scattered packets
*
* Notice:
* - don't support ol_flags for rss and csum err
* - nb_pkts > RTE_FM10K_MAX_RX_BURST, only scan RTE_FM10K_MAX_RX_BURST
* numbers of DD bit
*/
uint16_t
fm10k_recv_scattered_pkts_vec(void *rx_queue,
struct rte_mbuf **rx_pkts,
uint16_t nb_pkts)
static uint16_t
fm10k_recv_scattered_burst_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};
Expand Down Expand Up @@ -691,6 +688,32 @@ fm10k_recv_scattered_pkts_vec(void *rx_queue,
&split_flags[i]);
}

/**
* vPMD receive routine that reassembles scattered packets.
*/
uint16_t
fm10k_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
uint16_t nb_pkts)
{
uint16_t retval = 0;

while (nb_pkts > RTE_FM10K_MAX_RX_BURST) {
uint16_t burst;

burst = fm10k_recv_scattered_burst_vec(rx_queue,
rx_pkts + retval,
RTE_FM10K_MAX_RX_BURST);
retval += burst;
nb_pkts -= burst;
if (burst < RTE_FM10K_MAX_RX_BURST)
return retval;
}

return retval + fm10k_recv_scattered_burst_vec(rx_queue,
rx_pkts + retval,
nb_pkts);
}

static const struct fm10k_txq_ops vec_txq_ops = {
.reset = fm10k_reset_tx_queue,
};
Expand Down

0 comments on commit 4445ad3

Please sign in to comment.