DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Jayatheerthan, Jay" <jay.jayatheerthan@intel.com>
To: "pbhagavatula@marvell.com" <pbhagavatula@marvell.com>,
	"jerinj@marvell.com" <jerinj@marvell.com>,
	"Naga Harish K, S V" <s.v.naga.harish.k@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] eventdev: fix missing internal port checks
Date: Tue, 14 Dec 2021 05:52:33 +0000	[thread overview]
Message-ID: <DM6PR11MB4348F127EB223529B50EF4B9FD759@DM6PR11MB4348.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20211213083143.4233-1-pbhagavatula@marvell.com>

@Harish, could you take a look at this please ?

-Jay


> -----Original Message-----
> From: pbhagavatula@marvell.com <pbhagavatula@marvell.com>
> Sent: Monday, December 13, 2021 2:02 PM
> To: jerinj@marvell.com; Jayatheerthan, Jay <jay.jayatheerthan@intel.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@marvell.com>
> Subject: [PATCH] eventdev: fix missing internal port checks
> 
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> When event delivery is through internal port, stats are mainitained
> by HW and we should avoid reading SW data structures for stats.
> Fix missing internal port checks.
> 
> Fixes: 995b150c1ae1 ("eventdev/eth_rx: add queue stats API")
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  lib/eventdev/rte_event_eth_rx_adapter.c | 24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
> index 809416d9b7..da223aacac 100644
> --- a/lib/eventdev/rte_event_eth_rx_adapter.c
> +++ b/lib/eventdev/rte_event_eth_rx_adapter.c
> @@ -2984,15 +2984,17 @@ rte_event_eth_rx_adapter_queue_stats_get(uint8_t id,
>  		return -EINVAL;
>  	}
> 
> -	queue_info = &dev_info->rx_queue[rx_queue_id];
> -	event_buf = queue_info->event_buf;
> -	q_stats = queue_info->stats;
> +	if (dev_info->internal_event_port == 0) {
> +		queue_info = &dev_info->rx_queue[rx_queue_id];
> +		event_buf = queue_info->event_buf;
> +		q_stats = queue_info->stats;
> 
> -	stats->rx_event_buf_count = event_buf->count;
> -	stats->rx_event_buf_size = event_buf->events_size;
> -	stats->rx_packets = q_stats->rx_packets;
> -	stats->rx_poll_count = q_stats->rx_poll_count;
> -	stats->rx_dropped = q_stats->rx_dropped;
> +		stats->rx_event_buf_count = event_buf->count;
> +		stats->rx_event_buf_size = event_buf->events_size;
> +		stats->rx_packets = q_stats->rx_packets;
> +		stats->rx_poll_count = q_stats->rx_poll_count;
> +		stats->rx_dropped = q_stats->rx_dropped;
> +	}
> 
>  	dev = &rte_eventdevs[rx_adapter->eventdev_id];
>  	if (dev->dev_ops->eth_rx_adapter_queue_stats_get != NULL) {
> @@ -3086,8 +3088,10 @@ rte_event_eth_rx_adapter_queue_stats_reset(uint8_t id,
>  		return -EINVAL;
>  	}
> 
> -	queue_info = &dev_info->rx_queue[rx_queue_id];
> -	rxa_queue_stats_reset(queue_info);
> +	if (dev_info->internal_event_port == 0) {
> +		queue_info = &dev_info->rx_queue[rx_queue_id];
> +		rxa_queue_stats_reset(queue_info);
> +	}
> 
>  	dev = &rte_eventdevs[rx_adapter->eventdev_id];
>  	if (dev->dev_ops->eth_rx_adapter_queue_stats_reset != NULL) {
> --
> 2.34.0


  reply	other threads:[~2021-12-14  5:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-13  8:31 pbhagavatula
2021-12-14  5:52 ` Jayatheerthan, Jay [this message]
2021-12-14 10:53   ` Naga Harish K, S V
2021-12-14 11:43     ` Jayatheerthan, Jay
2022-01-20 13:25       ` Jerin Jacob

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=DM6PR11MB4348F127EB223529B50EF4B9FD759@DM6PR11MB4348.namprd11.prod.outlook.com \
    --to=jay.jayatheerthan@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=pbhagavatula@marvell.com \
    --cc=s.v.naga.harish.k@intel.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).