DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Stephen Hemminger <stephen@networkplumber.org>, <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 09/15] sfc: use new rte_eth_linkstatus functions
Date: Sat, 6 Jan 2018 14:10:25 +0300	[thread overview]
Message-ID: <796ae17a-2b1c-3cf7-e59d-1e5b2af5dc67@solarflare.com> (raw)
In-Reply-To: <20180106010656.9167-10-stephen@networkplumber.org>

On 01/06/2018 04:06 AM, Stephen Hemminger wrote:
> Use the new API (_rte_eth_linkstatus_set) to handle link status update.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Many thanks. Good idea since the code is definitely shorter and easier
to read/understand.

The summary should be net/sfc:, not just sfc:. In fact it is applicable
to all network driver patches.

> ---
>   drivers/net/sfc/sfc_ethdev.c | 27 +++++++--------------------
>   drivers/net/sfc/sfc_ev.c     | 23 ++++-------------------
>   2 files changed, 11 insertions(+), 39 deletions(-)
>

<...>

> diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c
> index a16dc27b380e..3e96536a9d60 100644
> --- a/drivers/net/sfc/sfc_ev.c
> +++ b/drivers/net/sfc/sfc_ev.c
> @@ -404,29 +404,14 @@ sfc_ev_link_change(void *arg, efx_link_mode_t link_mode)
>   {
>   	struct sfc_evq *evq = arg;
>   	struct sfc_adapter *sa = evq->sa;
> -	struct rte_eth_link *dev_link = &sa->eth_dev->data->dev_link;
>   	struct rte_eth_link new_link;
> -	uint64_t new_link_u64;
> -	uint64_t old_link_u64;
> -
> -	EFX_STATIC_ASSERT(sizeof(*dev_link) == sizeof(rte_atomic64_t));
>   
>   	sfc_port_link_mode_to_info(link_mode, &new_link);
> +	if (_rte_eth_linkstatus_set(sa->eth_dev, &new_link) == 0)
> +		return B_FALSE;
>   
> -	new_link_u64 = *(uint64_t *)&new_link;
> -	do {
> -		old_link_u64 = rte_atomic64_read((rte_atomic64_t *)dev_link);
> -		if (old_link_u64 == new_link_u64)
> -			break;
> -
> -		if (rte_atomic64_cmpset((volatile uint64_t *)dev_link,
> -					old_link_u64, new_link_u64)) {
> -			evq->sa->port.lsc_seq++;
> -			break;
> -		}
> -	} while (B_TRUE);
> -
> -	return B_FALSE;
> +	evq->sa->port.lsc_seq++;
> +	return B_TRUE;

It must be return B_FALSE as before the patch..

>   }
>   
>   static const efx_ev_callbacks_t sfc_ev_callbacks = {

  reply	other threads:[~2018-01-06 11:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-06  1:06 [dpdk-dev] [PATCH v2 00/15] common ethdev linkstatus functions Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 01/15] eal: introduce atomic exchange operation Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 02/15] ethdev: add linkstatus get/set helper functions Stephen Hemminger
2018-01-06 10:49   ` Andrew Rybchenko
2018-01-06 14:24     ` Stephen Hemminger
2018-01-06 14:35       ` Andrew Rybchenko
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 03/15] virtio: use eth_linkstatus_set Stephen Hemminger
2018-01-06  3:10   ` Tiwei Bie
2018-01-08 17:03     ` Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 04/15] vmxnet3: use rte_eth_linkstatus_set Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 05/15] dpaa2: " Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 06/15] nfp: use rte_eth_linkstatus functions Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 07/15] e1000: use rte_eth_linkstatus helpers Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 08/15] ixgbe: use rte_eth_linkstatus functions Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 09/15] sfc: use new " Stephen Hemminger
2018-01-06 11:10   ` Andrew Rybchenko [this message]
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 10/15] i40e: use " Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 11/15] liquidio: use _rte_eth_linkstatus_set Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 12/15] thunderx: " Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 13/15] szedata: " Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 14/15] octeontx: use rte_eth_linkstatus_set Stephen Hemminger
2018-01-06  1:06 ` [dpdk-dev] [PATCH v2 15/15] enic: use _rte_eth_linkstatus_set Stephen Hemminger

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=796ae17a-2b1c-3cf7-e59d-1e5b2af5dc67@solarflare.com \
    --to=arybchenko@solarflare.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).