diff mbox series

[v8,05/18] net/bnxt: add checks for max SIMD bitwidth

Message ID 20201016081320.186775-6-ciara.power@intel.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers show
Series add max SIMD bitwidth to EAL | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Power, Ciara Oct. 16, 2020, 8:13 a.m. UTC
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: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>

Signed-off-by: Ciara Power <ciara.power@intel.com>

---
v4: Updated enum name.
---
 drivers/net/bnxt/bnxt_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Somnath Kotur Oct. 16, 2020, 9:06 a.m. UTC | #1
On Fri, Oct 16, 2020 at 1:43 PM Ciara Power <ciara.power@intel.com> wrote:
>
> 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: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Cc: Somnath Kotur <somnath.kotur@broadcom.com>
>
> Signed-off-by: Ciara Power <ciara.power@intel.com>
>
> ---
> v4: Updated enum name.
> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index 8b63134c39..07d1a1a6ab 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -1169,7 +1169,8 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev)
>                 DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
>                 DEV_RX_OFFLOAD_RSS_HASH |
>                 DEV_RX_OFFLOAD_VLAN_FILTER)) &&
> -           !BNXT_TRUFLOW_EN(bp) && BNXT_NUM_ASYNC_CPR(bp)) {
> +           !BNXT_TRUFLOW_EN(bp) && BNXT_NUM_ASYNC_CPR(bp) &&
> +               rte_get_max_simd_bitwidth() >= RTE_SIMD_128) {
>                 PMD_DRV_LOG(INFO, "Using vector mode receive for port %d\n",
>                             eth_dev->data->port_id);
>                 bp->flags |= BNXT_FLAG_RX_VECTOR_PKT_MODE;
> @@ -1202,7 +1203,8 @@ bnxt_transmit_function(__rte_unused struct rte_eth_dev *eth_dev)
>          */
>         if (!eth_dev->data->scattered_rx &&
>             !(offloads & ~DEV_TX_OFFLOAD_MBUF_FAST_FREE) &&
> -           !BNXT_TRUFLOW_EN(bp)) {
> +           !BNXT_TRUFLOW_EN(bp) &&
> +           rte_get_max_simd_bitwidth() >= RTE_SIMD_128) {
>                 PMD_DRV_LOG(INFO, "Using vector mode transmit for port %d\n",
>                             eth_dev->data->port_id);
>                 return bnxt_xmit_pkts_vec;
> --
> 2.22.0
>
Acked-by Somnath kotur <somnath.kotur@broadcom.com>
David Marchand Oct. 16, 2020, 9:10 a.m. UTC | #2
On Fri, Oct 16, 2020 at 11:06 AM Somnath Kotur
<somnath.kotur@broadcom.com> wrote:
>
> On Fri, Oct 16, 2020 at 1:43 PM Ciara Power <ciara.power@intel.com> wrote:
> >
> > 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: Ajit Khaparde <ajit.khaparde@broadcom.com>
> > Cc: Somnath Kotur <somnath.kotur@broadcom.com>
> >
> > Signed-off-by: Ciara Power <ciara.power@intel.com>
> Acked-by Somnath kotur <somnath.kotur@broadcom.com>

For patchwork to catch it, fixing:
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
diff mbox series

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 8b63134c39..07d1a1a6ab 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1169,7 +1169,8 @@  bnxt_receive_function(struct rte_eth_dev *eth_dev)
 		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_RSS_HASH |
 		DEV_RX_OFFLOAD_VLAN_FILTER)) &&
-	    !BNXT_TRUFLOW_EN(bp) && BNXT_NUM_ASYNC_CPR(bp)) {
+	    !BNXT_TRUFLOW_EN(bp) && BNXT_NUM_ASYNC_CPR(bp) &&
+		rte_get_max_simd_bitwidth() >= RTE_SIMD_128) {
 		PMD_DRV_LOG(INFO, "Using vector mode receive for port %d\n",
 			    eth_dev->data->port_id);
 		bp->flags |= BNXT_FLAG_RX_VECTOR_PKT_MODE;
@@ -1202,7 +1203,8 @@  bnxt_transmit_function(__rte_unused struct rte_eth_dev *eth_dev)
 	 */
 	if (!eth_dev->data->scattered_rx &&
 	    !(offloads & ~DEV_TX_OFFLOAD_MBUF_FAST_FREE) &&
-	    !BNXT_TRUFLOW_EN(bp)) {
+	    !BNXT_TRUFLOW_EN(bp) &&
+	    rte_get_max_simd_bitwidth() >= RTE_SIMD_128) {
 		PMD_DRV_LOG(INFO, "Using vector mode transmit for port %d\n",
 			    eth_dev->data->port_id);
 		return bnxt_xmit_pkts_vec;