[v3,08/18] net/fm10k: add checks for max SIMD bitwidth
Checks
Commit Message
When choosing a vector path to take, an extra condition must be
satisfied to ensure the max SIMD bitwidth allows for the CPU enabled
path.
Cc: Qi Zhang <qi.z.zhang@intel.com>
Cc: Xiao Wang <xiao.w.wang@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
---
drivers/net/fm10k/fm10k_ethdev.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
Comments
> -----Original Message-----
> From: Power, Ciara <ciara.power@intel.com>
> Sent: Wednesday, September 30, 2020 9:04 PM
> To: dev@dpdk.org
> Cc: Power, Ciara <ciara.power@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Wang, Xiao W <xiao.w.wang@intel.com>
> Subject: [PATCH v3 08/18] net/fm10k: add checks for max SIMD bitwidth
>
> When choosing a vector path to take, an extra condition must be satisfied to
> ensure the max SIMD bitwidth allows for the CPU enabled path.
>
> Cc: Qi Zhang <qi.z.zhang@intel.com>
> Cc: Xiao Wang <xiao.w.wang@intel.com>
>
> Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
> drivers/net/fm10k/fm10k_ethdev.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/fm10k/fm10k_ethdev.c
> b/drivers/net/fm10k/fm10k_ethdev.c
> index 5771d83b55..a8bc1036a3 100644
> --- a/drivers/net/fm10k/fm10k_ethdev.c
> +++ b/drivers/net/fm10k/fm10k_ethdev.c
> @@ -2930,7 +2930,9 @@ fm10k_set_tx_function(struct rte_eth_dev *dev)
> if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
> /* primary process has set the ftag flag and offloads */
> txq = dev->data->tx_queues[0];
> - if (fm10k_tx_vec_condition_check(txq)) {
> + if (fm10k_tx_vec_condition_check(txq) ||
> + rte_get_max_simd_bitwidth()
> + < RTE_MAX_128_SIMD) {
> dev->tx_pkt_burst = fm10k_xmit_pkts;
> dev->tx_pkt_prepare = fm10k_prep_pkts;
> PMD_INIT_LOG(DEBUG, "Use regular Tx func"); @@ -2949,7
> +2951,8 @@ fm10k_set_tx_function(struct rte_eth_dev *dev)
> txq = dev->data->tx_queues[i];
> txq->tx_ftag_en = tx_ftag_en;
> /* Check if Vector Tx is satisfied */
> - if (fm10k_tx_vec_condition_check(txq))
> + if (fm10k_tx_vec_condition_check(txq) ||
> + rte_get_max_simd_bitwidth() < RTE_MAX_128_SIMD)
> use_sse = 0;
> }
>
> @@ -2983,7 +2986,9 @@ fm10k_set_rx_function(struct rte_eth_dev *dev)
> * conditions to be met.
> */
> if (!fm10k_rx_vec_condition_check(dev) &&
> - dev_info->rx_vec_allowed && !rx_ftag_en) {
> + dev_info->rx_vec_allowed && !rx_ftag_en &&
> + rte_get_max_simd_bitwidth()
> + >= RTE_MAX_128_SIMD) {
> if (dev->data->scattered_rx)
> dev->rx_pkt_burst = fm10k_recv_scattered_pkts_vec;
> else
> --
> 2.17.1
@@ -2930,7 +2930,9 @@ fm10k_set_tx_function(struct rte_eth_dev *dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
/* primary process has set the ftag flag and offloads */
txq = dev->data->tx_queues[0];
- if (fm10k_tx_vec_condition_check(txq)) {
+ if (fm10k_tx_vec_condition_check(txq) ||
+ rte_get_max_simd_bitwidth()
+ < RTE_MAX_128_SIMD) {
dev->tx_pkt_burst = fm10k_xmit_pkts;
dev->tx_pkt_prepare = fm10k_prep_pkts;
PMD_INIT_LOG(DEBUG, "Use regular Tx func");
@@ -2949,7 +2951,8 @@ fm10k_set_tx_function(struct rte_eth_dev *dev)
txq = dev->data->tx_queues[i];
txq->tx_ftag_en = tx_ftag_en;
/* Check if Vector Tx is satisfied */
- if (fm10k_tx_vec_condition_check(txq))
+ if (fm10k_tx_vec_condition_check(txq) ||
+ rte_get_max_simd_bitwidth() < RTE_MAX_128_SIMD)
use_sse = 0;
}
@@ -2983,7 +2986,9 @@ fm10k_set_rx_function(struct rte_eth_dev *dev)
* conditions to be met.
*/
if (!fm10k_rx_vec_condition_check(dev) &&
- dev_info->rx_vec_allowed && !rx_ftag_en) {
+ dev_info->rx_vec_allowed && !rx_ftag_en &&
+ rte_get_max_simd_bitwidth()
+ >= RTE_MAX_128_SIMD) {
if (dev->data->scattered_rx)
dev->rx_pkt_burst = fm10k_recv_scattered_pkts_vec;
else