X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fiavf%2Fiavf_rxtx_vec_common.h;h=7ad1e0f68a229ef853d15a3374cade2a49e8d487;hb=ecf1474a618ba77ef3c4471fdc004a8c5f3b4d11;hp=db509d71fe0d0bbab1d6e0f2db942e4bdbd8e32e;hpb=02d212ca3125444a70952aae79a1d679e2f83973;p=dpdk.git diff --git a/drivers/net/iavf/iavf_rxtx_vec_common.h b/drivers/net/iavf/iavf_rxtx_vec_common.h index db509d71fe..7ad1e0f68a 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_common.h +++ b/drivers/net/iavf/iavf_rxtx_vec_common.h @@ -33,6 +33,7 @@ reassemble_packets(struct iavf_rx_queue *rxq, struct rte_mbuf **rx_bufs, if (!split_flags[buf_idx]) { /* it's the last packet of the set */ start->hash = end->hash; + start->vlan_tci = end->vlan_tci; start->ol_flags = end->ol_flags; /* we need to strip crc for the whole packet */ start->pkt_len -= rxq->crc_len; @@ -207,4 +208,72 @@ iavf_rxq_vec_setup_default(struct iavf_rx_queue *rxq) rxq->mbuf_initializer = *(uint64_t *)p; return 0; } + +static inline int +iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq) +{ + if (!rxq) + return -1; + + if (!rte_is_power_of_2(rxq->nb_rx_desc)) + return -1; + + if (rxq->rx_free_thresh < IAVF_VPMD_RX_MAX_BURST) + return -1; + + if (rxq->nb_rx_desc % rxq->rx_free_thresh) + return -1; + + if (rxq->proto_xtr != IAVF_PROTO_XTR_NONE) + return -1; + + return 0; +} + +static inline int +iavf_tx_vec_queue_default(struct iavf_tx_queue *txq) +{ + if (!txq) + return -1; + + if (txq->offloads & IAVF_NO_VECTOR_FLAGS) + return -1; + + if (txq->rs_thresh < IAVF_VPMD_TX_MAX_BURST || + txq->rs_thresh > IAVF_VPMD_TX_MAX_FREE_BUF) + return -1; + + return 0; +} + +static inline int +iavf_rx_vec_dev_check_default(struct rte_eth_dev *dev) +{ + int i; + struct iavf_rx_queue *rxq; + + for (i = 0; i < dev->data->nb_rx_queues; i++) { + rxq = dev->data->rx_queues[i]; + if (iavf_rx_vec_queue_default(rxq)) + return -1; + } + + return 0; +} + +static inline int +iavf_tx_vec_dev_check_default(struct rte_eth_dev *dev) +{ + int i; + struct iavf_tx_queue *txq; + + for (i = 0; i < dev->data->nb_tx_queues; i++) { + txq = dev->data->tx_queues[i]; + if (iavf_tx_vec_queue_default(txq)) + return -1; + } + + return 0; +} + #endif