DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matan Azrad <matan@mellanox.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3] ethdev: silence error message on rte_eth_dev_owner_unset
Date: Tue, 21 Aug 2018 15:53:34 +0000	[thread overview]
Message-ID: <AM0PR0502MB4019CA920C027AF3EFC2D2E5D2310@AM0PR0502MB4019.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20180821084515.2a802429@xeon-e3>

Hi

From: Stephen Hemminger
> From 74ad4c60262b1451a5a2fabf79a2df89c6c5373d Mon Sep 17 00:00:00 2001
> From: Stephen Hemminger <stephen@networkplumber.org>
> Date: Thu, 16 Aug 2018 15:37:14 -0700
> Subject: [PATCH 1/5] ethdev: silence error message on
> rte_eth_dev_owner_unset
> 
> The rte_eth_dev_owner_unset function always generates a log message
> because the unset value for owner id is 0.
> 
> Also, when rte_eth_dev_owner_delete is called with a valid owner id, the
> log message should be at NOTICE not ERROR severity.
> 
> Fixes: 5b7ba31148a8 ("ethdev: add port ownership")
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> v3 - handle rte_eth_dev_owner_delete
>      leave other cleanups to later patch series
> 
>  lib/librte_ethdev/rte_ethdev.c | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 4c320250589a..56dd9c2e83d9 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -393,11 +393,8 @@ static int
>  rte_eth_is_valid_owner_id(uint64_t owner_id)  {
>  	if (owner_id == RTE_ETH_DEV_NO_OWNER ||
> -	    rte_eth_dev_shared_data->next_owner_id <= owner_id) {
> -		RTE_ETHDEV_LOG(ERR, "Invalid owner_id=%016"PRIx64"\n",
> -			owner_id);
> +	    rte_eth_dev_shared_data->next_owner_id <= owner_id)
>  		return 0;
> -	}
>  	return 1;
>  }
> 
> @@ -444,8 +441,12 @@ _rte_eth_dev_owner_set(const uint16_t port_id,
> const uint64_t old_owner_id,
>  	}
> 
>  	if (!rte_eth_is_valid_owner_id(new_owner->id) &&
> -	    !rte_eth_is_valid_owner_id(old_owner_id))
> +	    !rte_eth_is_valid_owner_id(old_owner_id)) {
> +		RTE_ETHDEV_LOG(ERR,
> +			       "Invalid owner old_id=%016"PRIx64"
> new_id=%016"PRIx64"\n",
> +			       old_owner_id, new_owner->id);
>  		return -EINVAL;
> +	}
> 
>  	port_owner = &rte_eth_devices[port_id].data->owner;
>  	if (port_owner->id != old_owner_id) {
> @@ -516,9 +517,13 @@ rte_eth_dev_owner_delete(const uint64_t
> owner_id)
>  			if (rte_eth_devices[port_id].data->owner.id ==
> owner_id)
>  				memset(&rte_eth_devices[port_id].data-
> >owner, 0,
>  				       sizeof(struct rte_eth_dev_owner));
> -		RTE_ETHDEV_LOG(ERR,
> +		RTE_ETHDEV_LOG(NOTICE,
>  			"All port owners owned by %016"PRIx64" identifier
> have removed\n",
>  			owner_id);
> +	} else {
> +		RTE_ETHDEV_LOG(ERR,
> +			       "Invalid owner id=%016"PRIx64"\n",
> +			       owner_id);
>  	}
> 
>  	rte_spinlock_unlock(&rte_eth_dev_shared_data->ownership_lock);
> --
> 2.18.0
> 

I think the title should be:
ethdev: fix port ownership logs

while adding the fixes commits (at list 2 because of the NOTICE change)
and updating stable.

Besides that,
Acked-by: Matan Azrad <matan@mellanox.com>

  reply	other threads:[~2018-08-21 15:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14  0:19 [dpdk-dev] [PATCH] ethdev: fix rte_eth_dev_owner_unset Stephen Hemminger
2018-08-14  5:52 ` Matan Azrad
2018-08-14 16:55   ` Stephen Hemminger
2018-08-14 19:46     ` Matan Azrad
2018-08-24 13:55       ` Ferruh Yigit
2018-08-24 14:42         ` Stephen Hemminger
2018-08-16 22:44 ` [dpdk-dev] [PATCH 0/2] ethdev: minor ownership changes Stephen Hemminger
2018-08-16 22:44   ` [dpdk-dev] [PATCH 1/2] ethdev: silence error message on rte_eth_dev_owner_unset Stephen Hemminger
2018-08-21 10:04     ` Matan Azrad
2018-08-21 15:45     ` [dpdk-dev] [PATCH v3] " Stephen Hemminger
2018-08-21 15:53       ` Matan Azrad [this message]
2018-08-27 13:01         ` Ferruh Yigit
2018-08-16 22:44   ` [dpdk-dev] [PATCH 2/2] ethdev: make rte_eth_is_valid_owner_id return bool Stephen Hemminger
2018-08-21 10:20     ` Matan Azrad
2018-08-21 15:06       ` Stephen Hemminger
2018-08-21 15:48         ` Matan Azrad
2018-08-21 18:31           ` Stephen Hemminger
2018-08-26  7:49             ` Matan Azrad

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=AM0PR0502MB4019CA920C027AF3EFC2D2E5D2310@AM0PR0502MB4019.eurprd05.prod.outlook.com \
    --to=matan@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /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).