DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Pattan, Reshma" <reshma.pattan@intel.com>
To: "Hajkowski, MarcinX" <marcinx.hajkowski@intel.com>,
	"Hunt, David" <david.hunt@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Hajkowski, MarcinX" <marcinx.hajkowski@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 2/4] power: extend guest channel api for	reading
Date: Tue, 19 Mar 2019 15:00:47 +0000	[thread overview]
Message-ID: <3AEA2BF9852C6F48A459DA490692831F2A42F1B4@irsmsx110.ger.corp.intel.com> (raw)
In-Reply-To: <20190318134815.14928-3-marcinx.hajkowski@intel.com>



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Hajkowski
> ---
> diff --git a/lib/librte_power/channel_commands.h

> +#define CPU_POWER_CMD_NAK       2

Instead of NAK , NACK would be better I guess.


> +	if (global_fds[lcore_id] == 0) {

Is this now < 0 ?

> +		ret = read(global_fds[lcore_id],
> +				buffer, buffer_len);
> +		if (ret < 0) {

read() return value 0 also should be handled?

> +
> +int rte_power_guest_channel_receive_msg(struct channel_packet *pkt,
> +			unsigned int lcore_id)
> +{
> +	int ret;
> +
> +	struct pollfd fds;
> +	fds.fd = global_fds[lcore_id];
> +	fds.events = POLLIN;
> +
> +	ret = poll(&fds, 1, TIMEOUT);
> +	if (ret == 0) {
> +		RTE_LOG(DEBUG, GUEST_CHANNEL, "Timeout occurs during
> poll function.\n");
> +		return -1;
> +	} else if (ret < 0) {
> +		RTE_LOG(ERR, GUEST_CHANNEL, "Error occurred during poll
> function: %s\n",
> +				strerror(ret));
> +		return -1;
> +	}
> +

You can keep this function simple by moving all the code above code to power_guest_channel_read_msg(), like the way done in rte_power_guest_channel_send_msg() and guest_channel_send_msg().

Thanks,
Reshma

  parent reply	other threads:[~2019-03-19 15:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 13:48 [dpdk-dev] [PATCH v2 0/4] bidirect guest channel Hajkowski
2019-03-18 13:48 ` Hajkowski
2019-03-18 13:48 ` [dpdk-dev] [PATCH v2 1/4] power: fix invalid socket indicator value Hajkowski
2019-03-18 13:48   ` Hajkowski
2019-03-18 13:48 ` [dpdk-dev] [PATCH v2 2/4] power: extend guest channel api for reading Hajkowski
2019-03-18 13:48   ` Hajkowski
2019-03-19 15:00   ` Pattan, Reshma [this message]
2019-03-19 15:00     ` Pattan, Reshma
2019-03-18 13:48 ` [dpdk-dev] [PATCH v2 3/4] power: process incoming confirmation cmds Hajkowski
2019-03-18 13:48   ` Hajkowski
2019-03-18 13:48 ` [dpdk-dev] [PATCH v2 4/4] power: send confirmation cmd to vm guest Hajkowski
2019-03-18 13:48   ` Hajkowski

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=3AEA2BF9852C6F48A459DA490692831F2A42F1B4@irsmsx110.ger.corp.intel.com \
    --to=reshma.pattan@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=marcinx.hajkowski@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).