| 1238 | } |
| 1239 | |
| 1240 | static eth_rx_burst_t |
| 1241 | bnxt_receive_function(struct rte_eth_dev *eth_dev) |
| 1242 | { |
| 1243 | struct bnxt *bp = eth_dev->data->dev_private; |
| 1244 | |
| 1245 | /* Disable vector mode RX for Stingray2 for now */ |
| 1246 | if (BNXT_CHIP_SR2(bp)) { |
| 1247 | bp->flags &= ~BNXT_FLAG_RX_VECTOR_PKT_MODE; |
| 1248 | return bnxt_recv_pkts; |
| 1249 | } |
| 1250 | |
| 1251 | #if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) |
| 1252 | /* Vector mode receive cannot be enabled if scattered rx is in use. */ |
| 1253 | if (eth_dev->data->scattered_rx) |
| 1254 | goto use_scalar_rx; |
| 1255 | |
| 1256 | /* |
| 1257 | * Vector mode receive cannot be enabled if Truflow is enabled or if |
| 1258 | * asynchronous completions and receive completions can be placed in |
| 1259 | * the same completion ring. |
| 1260 | */ |
| 1261 | if (BNXT_TRUFLOW_EN(bp) || !BNXT_NUM_ASYNC_CPR(bp)) |
| 1262 | goto use_scalar_rx; |
| 1263 | |
| 1264 | /* |
| 1265 | * Vector mode receive cannot be enabled if any receive offloads outside |
| 1266 | * a limited subset have been enabled. |
| 1267 | */ |
| 1268 | if (eth_dev->data->dev_conf.rxmode.offloads & |
| 1269 | ~(RTE_ETH_RX_OFFLOAD_VLAN_STRIP | |
| 1270 | RTE_ETH_RX_OFFLOAD_KEEP_CRC | |
| 1271 | RTE_ETH_RX_OFFLOAD_IPV4_CKSUM | |
| 1272 | RTE_ETH_RX_OFFLOAD_UDP_CKSUM | |
| 1273 | RTE_ETH_RX_OFFLOAD_TCP_CKSUM | |
| 1274 | RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM | |
| 1275 | RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM | |
| 1276 | RTE_ETH_RX_OFFLOAD_RSS_HASH | |
| 1277 | RTE_ETH_RX_OFFLOAD_VLAN_FILTER)) |
| 1278 | goto use_scalar_rx; |
| 1279 | |
| 1280 | if (bp->ieee_1588) |
| 1281 | goto use_scalar_rx; |
| 1282 | |
| 1283 | #if defined(RTE_ARCH_X86) |
| 1284 | if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256 && |
| 1285 | rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1) { |
| 1286 | PMD_DRV_LOG(INFO, |
| 1287 | "Using AVX2 vector mode receive for port %d\n", |
| 1288 | eth_dev->data->port_id); |
| 1289 | bp->flags |= BNXT_FLAG_RX_VECTOR_PKT_MODE; |
| 1290 | return bnxt_recv_pkts_vec_avx2; |
| 1291 | } |
| 1292 | #endif |
| 1293 | if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { |
| 1294 | PMD_DRV_LOG(INFO, |
| 1295 | "Using SSE vector mode receive for port %d\n", |
| 1296 | eth_dev->data->port_id); |
| 1297 | bp->flags |= BNXT_FLAG_RX_VECTOR_PKT_MODE; |
no test coverage detected