DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com,
	Qin Ke <qin.ke@corigine.com>,
	Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH 2/5] net/nfp: rename field and add comment for Rx descriptor
Date: Mon, 22 May 2023 16:04:57 +0800	[thread overview]
Message-ID: <20230522080500.2014001-3-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20230522080500.2014001-1-chaoyong.he@corigine.com>

From: Qin Ke <qin.ke@corigine.com>

As rxd.vlan in Rx descriptor has been out of use and can be used
for packet type offload and other offloading information based on
comprehensive evaluation, it is renamed to rxd.offload_info.

Also adds the comment for Rx descriptor structure.

Signed-off-by: Qin Ke <qin.ke@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower.c |  2 +-
 drivers/net/nfp/nfp_rxtx.c          |  2 +-
 drivers/net/nfp/nfp_rxtx.h          | 24 ++++++++++++------------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 72933e55d0..294e7431b1 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -428,7 +428,7 @@ nfp_flower_pf_recv_pkts(void *rx_queue,
 
 		if ((rxds->rxd.flags & PCIE_DESC_RX_VLAN) &&
 				(hw->ctrl & NFP_NET_CFG_CTRL_RXVLAN)) {
-			mb->vlan_tci = rte_cpu_to_le_32(rxds->rxd.vlan);
+			mb->vlan_tci = rte_cpu_to_le_32(rxds->rxd.offload_info);
 			mb->ol_flags |= RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_RX_VLAN_STRIPPED;
 		}
 
diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index 3c78557221..2f7369315d 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -245,7 +245,7 @@ nfp_net_parse_meta_vlan(const struct nfp_meta_parsed *meta,
 		}
 	} else if ((hw->ctrl & NFP_NET_CFG_CTRL_RXVLAN) != 0) {
 		if ((rxd->rxd.flags & PCIE_DESC_RX_VLAN) != 0) {
-			mb->vlan_tci = rte_cpu_to_le_32(rxd->rxd.vlan);
+			mb->vlan_tci = rte_cpu_to_le_32(rxd->rxd.offload_info);
 			mb->ol_flags |= RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_RX_VLAN_STRIPPED;
 		}
 	}
diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h
index f72c54fb25..73ef0a7c9f 100644
--- a/drivers/net/nfp/nfp_rxtx.h
+++ b/drivers/net/nfp/nfp_rxtx.h
@@ -172,25 +172,25 @@ struct nfp_net_txq {
 
 struct nfp_net_rx_desc {
 	union {
-		/* Freelist descriptor */
+		/** Freelist descriptor. */
 		struct {
-			uint16_t dma_addr_hi;
-			uint8_t spare;
-			uint8_t dd;
-
-			uint32_t dma_addr_lo;
+			uint16_t dma_addr_hi;  /**< High bits of buffer address. */
+			uint8_t spare;         /**< Reserved, must be zero. */
+			uint8_t dd;            /**< Whether descriptor available. */
+			uint32_t dma_addr_lo;  /**< Low bits of buffer address. */
 		} __rte_packed fld;
 
-		/* RX descriptor */
+		/** RX descriptor. */
 		struct {
-			uint16_t data_len;
-			uint8_t reserved;
-			uint8_t meta_len_dd;
+			uint16_t data_len;     /**< Length of frame + metadata. */
+			uint8_t reserved;      /**< Reserved, must be zero. */
+			uint8_t meta_len_dd;   /**< Length of metadata + done flag. */
 
-			uint16_t flags;
-			uint16_t vlan;
+			uint16_t flags;        /**< RX flags. */
+			uint16_t offload_info; /**< Offloading info. */
 		} __rte_packed rxd;
 
+		/** Reserved. */
 		uint32_t vals[2];
 	};
 };
-- 
2.39.1


  parent reply	other threads:[~2023-05-22  8:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22  8:04 [PATCH 0/5] Add support of report packet type Chaoyong He
2023-05-22  8:04 ` [PATCH 1/5] mailmap: update contributor entry Chaoyong He
2023-05-22  8:04 ` Chaoyong He [this message]
2023-05-22  8:04 ` [PATCH 3/5] net/nfp: standardize the logic for nfp reconfig function Chaoyong He
2023-05-22  8:04 ` [PATCH 4/5] net/nfp: remove logic of reporting packet type by hash type Chaoyong He
2023-05-22  8:05 ` [PATCH 5/5] net/nfp: report packet type by Rx descriptor Chaoyong He
2023-06-02 16:26 ` [PATCH 0/5] Add support of report packet type Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230522080500.2014001-3-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=niklas.soderlund@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=qin.ke@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).