DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: John Miller <john.miller@atomicrules.com>, <dev@dpdk.org>
Cc: <shepard.siegel@atomicrules.com>
Subject: Re: [PATCH] net/ark: support multi-port pkt generation
Date: Mon, 28 Feb 2022 14:51:36 +0000	[thread overview]
Message-ID: <cc782c3a-f805-dc8c-82ba-882b21151014@intel.com> (raw)
In-Reply-To: <20220226124454.68600-1-john.miller@atomicrules.com>

On 2/26/2022 12:44 PM, John Miller wrote:
> Added support for packet generation in
> multi-port Arkville implementations. The packet
> generator is a singleton within the device but is
> capable of generating packets for any port within
> one device.
> 
> Signed-off-by: John Miller <john.miller@atomicrules.com>
> ---
>   drivers/net/ark/ark_ethdev.c | 4 +++-
>   drivers/net/ark/ark_global.h | 1 +
>   2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
> index 230a1272e9..980e1a4a3b 100644
> --- a/drivers/net/ark/ark_ethdev.c
> +++ b/drivers/net/ark/ark_ethdev.c
> @@ -441,6 +441,7 @@ ark_config_device(struct rte_eth_dev *dev)
>   	 * known state
>   	 */
>   	ark->start_pg = 0;
> +	ark->pg_running = 0;
>   	ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
>   	if (ark->pg == NULL)
>   		return -1;
> @@ -562,7 +563,7 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
>   	if (ark->start_pg)
>   		ark_pktchkr_run(ark->pc);
>   
> -	if (ark->start_pg && (dev->data->port_id == 0)) {
> +	if (ark->start_pg && !ark->pg_running) {
>   		pthread_t thread;
>   
>   		/* Delay packet generatpr start allow the hardware to be ready
> @@ -574,6 +575,7 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
>   				    "starter thread\n");
>   			return -1;
>   		}
> +		ark->pg_running = 1;

Should there be a place 'ark->pg_running' set back to '0',
like 'eth_ark_dev_stop()'?

Or is this delay thread is only required once in first init
per port?


Btw, if there will change, you may consider thread name,
"ark-delay-pg", get port_id to differentiate multiple threads,
like "ark-delay-pg_0", "ark-delay-pg_1" ...

>   	}
>   
>   	if (ark->user_ext.dev_start)
> diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
> index 49193ac5b3..3c3a712bc8 100644
> --- a/drivers/net/ark/ark_global.h
> +++ b/drivers/net/ark/ark_global.h
> @@ -107,6 +107,7 @@ struct ark_adapter {
>   
>   	/* Pointers to packet generator and checker */
>   	int start_pg;
> +	uint16_t pg_running;
>   	ark_pkt_gen_t pg;
>   	ark_pkt_chkr_t pc;
>   	ark_pkt_dir_t pd;


      reply	other threads:[~2022-02-28 14:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-26 12:44 John Miller
2022-02-28 14:51 ` Ferruh Yigit [this message]

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=cc782c3a-f805-dc8c-82ba-882b21151014@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=john.miller@atomicrules.com \
    --cc=shepard.siegel@atomicrules.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).