* [PATCH] net/nfp: add quick exit logic for parse packet type
@ 2023-11-03 6:19 Chaoyong He
2023-11-03 15:00 ` Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: Chaoyong He @ 2023-11-03 6:19 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Chaoyong He, Long Wu, Peng Zhang
Add quick exit logic for parse packet type function, when the control
switch for this feature is off, the function can return quickly.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
drivers/net/nfp/nfp_rxtx.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index b2a9ba6875..f21e120a43 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -584,18 +584,25 @@ nfp_net_set_ptype(const struct nfp_ptype_parsed *nfp_ptype,
/**
* Parse the packet type from Rx descriptor and set to mbuf.
*
+ * @param rxq
+ * Rx queue
* @param rxds
* Rx descriptor including the offloading info of packet type.
* @param mb
* Mbuf to set the packet type.
*/
static void
-nfp_net_parse_ptype(struct nfp_net_rx_desc *rxds,
+nfp_net_parse_ptype(struct nfp_net_rxq *rxq,
+ struct nfp_net_rx_desc *rxds,
struct rte_mbuf *mb)
{
+ struct nfp_net_hw *hw = rxq->hw;
struct nfp_ptype_parsed nfp_ptype;
uint16_t rxd_ptype = rxds->rxd.offload_info;
+ if ((hw->super.cap_ext & NFP_NET_CFG_CTRL_PKT_TYPE) == 0)
+ return;
+
if (rxd_ptype == 0 || (rxds->rxd.flags & PCIE_DESC_RX_VLAN) != 0)
return;
@@ -735,7 +742,7 @@ nfp_net_recv_pkts(void *rx_queue,
struct nfp_meta_parsed meta = {};
nfp_net_parse_meta(rxds, rxq, hw, mb, &meta);
- nfp_net_parse_ptype(rxds, mb);
+ nfp_net_parse_ptype(rxq, 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: add quick exit logic for parse packet type
2023-11-03 6:19 [PATCH] net/nfp: add quick exit logic for parse packet type Chaoyong He
@ 2023-11-03 15:00 ` Ferruh Yigit
0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2023-11-03 15:00 UTC (permalink / raw)
To: Chaoyong He, dev; +Cc: oss-drivers, Long Wu, Peng Zhang
On 11/3/2023 6:19 AM, Chaoyong He wrote:
> Add quick exit logic for parse packet type function, when the control
> switch for this feature is off, the function can return quickly.
>
> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> Reviewed-by: Long Wu <long.wu@corigine.com>
> Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-03 15:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-03 6:19 [PATCH] net/nfp: add quick exit logic for parse packet type Chaoyong He
2023-11-03 15:00 ` 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).