DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/nfp: fix add redundant read configure operations
@ 2023-06-14  5:51 Chaoyong He
  2023-06-20 17:53 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Chaoyong He @ 2023-06-14  5:51 UTC (permalink / raw)
  To: dev
  Cc: oss-drivers, niklas.soderlund, Qin Ke, stable, Chaoyong He, Peng Zhang

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

Performance is reduced because of adding redundant read configure
operations in nfp_net_parse_ptype() called by nfp_net_recv_pkts(),
which cause every received packet to spend more time.

Fix the performance issue by deleting the redundant code directly.

Fixes: 2e7c36128be ("net/nfp: report packet type by Rx descriptor")
Cc: stable@dpdk.org

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>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_rxtx.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index 9867db4388..297864450b 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -317,7 +317,8 @@ nfp_net_parse_meta(struct nfp_net_rx_desc *rxds,
  *   Mbuf to set the packet type.
  */
 static void
-nfp_net_set_ptype(const struct nfp_ptype_parsed *nfp_ptype, struct rte_mbuf *mb)
+nfp_net_set_ptype(const struct nfp_ptype_parsed *nfp_ptype,
+		struct rte_mbuf *mb)
 {
 	uint32_t mbuf_ptype = RTE_PTYPE_L2_ETHER;
 	uint8_t nfp_tunnel_ptype = nfp_ptype->tunnel_ptype;
@@ -420,31 +421,19 @@ nfp_net_set_ptype(const struct nfp_ptype_parsed *nfp_ptype, struct rte_mbuf *mb)
  *
  * @param rxds
  *   Rx descriptor including the offloading info of packet type.
- * @param hw
- *   Device.
  * @param mb
  *   Mbuf to set the packet type.
  */
 static void
 nfp_net_parse_ptype(struct nfp_net_rx_desc *rxds,
-		struct nfp_net_hw *hw,
 		struct rte_mbuf *mb)
 {
-	uint32_t cap_extend;
-	uint32_t ctrl_extend;
 	struct nfp_ptype_parsed nfp_ptype;
 	uint16_t rxd_ptype = rxds->rxd.offload_info;
 
 	if (rxd_ptype == 0 || (rxds->rxd.flags & PCIE_DESC_RX_VLAN) != 0)
 		return;
 
-	cap_extend = nn_cfg_readl(hw, NFP_NET_CFG_CAP_WORD1);
-	ctrl_extend = nn_cfg_readl(hw, NFP_NET_CFG_CTRL_WORD1);
-
-	if ((cap_extend & NFP_NET_CFG_CTRL_PKT_TYPE) == 0 ||
-			(ctrl_extend & NFP_NET_CFG_CTRL_PKT_TYPE) == 0)
-		return;
-
 	nfp_ptype.l4_ptype = (rxd_ptype & NFP_NET_PTYPE_L4_MASK) >>
 			NFP_NET_PTYPE_L4_OFFSET;
 	nfp_ptype.l3_ptype = (rxd_ptype & NFP_NET_PTYPE_L3_MASK) >>
@@ -593,7 +582,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		struct nfp_meta_parsed meta = {};
 		nfp_net_parse_meta(rxds, rxq, hw, mb, &meta);
 
-		nfp_net_parse_ptype(rxds, hw, mb);
+		nfp_net_parse_ptype(rxds, mb);
 
 		/* Checking the checksum flag */
 		nfp_net_rx_cksum(rxq, rxds, mb);
-- 
2.39.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/nfp: fix add redundant read configure operations
  2023-06-14  5:51 [PATCH] net/nfp: fix add redundant read configure operations Chaoyong He
@ 2023-06-20 17:53 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2023-06-20 17:53 UTC (permalink / raw)
  To: Chaoyong He, dev
  Cc: oss-drivers, niklas.soderlund, Qin Ke, stable, Peng Zhang

On 6/14/2023 6:51 AM, Chaoyong He wrote:
> From: Qin Ke <qin.ke@corigine.com>
> 
> Performance is reduced because of adding redundant read configure
> operations in nfp_net_parse_ptype() called by nfp_net_recv_pkts(),
> which cause every received packet to spend more time.
> 
> Fix the performance issue by deleting the redundant code directly.
> 
> Fixes: 2e7c36128be ("net/nfp: report packet type by Rx descriptor")
> Cc: stable@dpdk.org
> 
> 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>
> Reviewed-by: Peng Zhang <peng.zhang@corigine.com>

Applied to dpdk-next-net/main, thanks.

<...>

> diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
> index 9867db4388..297864450b 100644
> --- a/drivers/net/nfp/nfp_rxtx.c
> +++ b/drivers/net/nfp/nfp_rxtx.c
> @@ -317,7 +317,8 @@ nfp_net_parse_meta(struct nfp_net_rx_desc *rxds,
>   *   Mbuf to set the packet type.
>   */
>  static void
> -nfp_net_set_ptype(const struct nfp_ptype_parsed *nfp_ptype, struct rte_mbuf *mb)
> +nfp_net_set_ptype(const struct nfp_ptype_parsed *nfp_ptype,
> +		struct rte_mbuf *mb)

Above unrelated modification dropped while merging.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-20 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14  5:51 [PATCH] net/nfp: fix add redundant read configure operations Chaoyong He
2023-06-20 17:53 ` Ferruh Yigit

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).