diff mbox series

[v5,1/4] net/iavf: store offload flag of Rx queue

Message ID 1618385649-44717-2-git-send-email-wenzhuo.lu@intel.com (mailing list archive)
State Accepted
Delegated to: Qi Zhang
Headers show
Series add Rx/Tx offload paths for IAVF AVX512 | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Wenzhuo Lu April 14, 2021, 7:34 a.m. UTC
Add the offload flag for RX queues to know which offload
features are set.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 4 ++++
 drivers/net/iavf/iavf_rxtx.h | 1 +
 2 files changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 541b444..bd0b7ee 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -523,9 +523,12 @@ 
 	uint8_t proto_xtr;
 	uint16_t len;
 	uint16_t rx_free_thresh;
+	uint64_t offloads;
 
 	PMD_INIT_FUNC_TRACE();
 
+	offloads = rx_conf->offloads | dev->data->dev_conf.rxmode.offloads;
+
 	if (nb_desc % IAVF_ALIGN_RING_DESC != 0 ||
 	    nb_desc > IAVF_MAX_RING_DESC ||
 	    nb_desc < IAVF_MIN_RING_DESC) {
@@ -596,6 +599,7 @@ 
 	rxq->rx_deferred_start = rx_conf->rx_deferred_start;
 	rxq->rx_hdr_len = 0;
 	rxq->vsi = vsi;
+	rxq->offloads = offloads;
 
 	if (dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_KEEP_CRC)
 		rxq->crc_len = RTE_ETHER_CRC_LEN;
diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h
index 4fbd847..f56dd74 100644
--- a/drivers/net/iavf/iavf_rxtx.h
+++ b/drivers/net/iavf/iavf_rxtx.h
@@ -198,6 +198,7 @@  struct iavf_rx_queue {
 		/* flexible descriptor metadata extraction offload flag */
 	iavf_rxd_to_pkt_fields_t rxd_to_pkt_fields;
 				/* handle flexible descriptor by RXDID */
+	uint64_t offloads;
 };
 
 struct iavf_tx_entry {