From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 89C97A0561;
	Thu, 18 Mar 2021 16:49:09 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 4AA5F406B4;
	Thu, 18 Mar 2021 16:49:09 +0100 (CET)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [216.205.24.124])
 by mails.dpdk.org (Postfix) with ESMTP id 964B440698
 for <dev@dpdk.org>; Thu, 18 Mar 2021 16:49:07 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1616082546;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=2EwiXl/f7SmRB7uEhhV3H//l7VKmoMe02cNhfvjnl/o=;
 b=jUAUuGV1EwAecJqz8A1mddVWfHItWGM3FxMJfDHzoM03HCFtSjjc+NQ6dxOjhy8Qi3bniT
 1tzqM/kLQmwAfVKlCOSOyb+38vD8SIF5qfAI/VbhLlwQqc9UWvn6FbOIIp1f5lbhGDZN+e
 qQYmevtSKWgEZilUpqlF9253sH/uiEM=
Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com
 [209.85.217.70]) (Using TLS) by relay.mimecast.com with ESMTP id
 us-mta-463-Vj0rqukUO3qvhU_G_E6uHA-1; Thu, 18 Mar 2021 11:49:01 -0400
X-MC-Unique: Vj0rqukUO3qvhU_G_E6uHA-1
Received: by mail-vs1-f70.google.com with SMTP id s63so10742391vss.18
 for <dev@dpdk.org>; Thu, 18 Mar 2021 08:49:01 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=2EwiXl/f7SmRB7uEhhV3H//l7VKmoMe02cNhfvjnl/o=;
 b=oz+QnV582hlUsXlpio5Kum7sjsManfMlna7LG7vpUae+GZaScWZMFopocDl/XymXAo
 nq2g62zIhSSSZQd8/yI+9UphTefGgCawEXEf2Pu6dDELwPQBmKgLFMMdYHISnwTdxCB9
 W4T2rrNbecGeQ4dtSjeorul5n7QUsJEoz2Cl9HpI9WH1nPqxNVkixLXIxkoIARLHPlVQ
 QxP6nn5jmOKL/Gwi2NZv6LKn2greiQXgpNtYAbzxerYNtZ0PaHlBNLU616UuHNS0wrNU
 k+WolZXZ5O3YVCKJWQh51ZrQXmSXaQXDkpow50Fyp4L9o7uQIbjzYrS5vmDUo9g8BqnG
 7qlA==
X-Gm-Message-State: AOAM530Q+Y2/8KHeO7MShkSpGgplBWcrnmrfE22B1F5xZjpLIMoyNifq
 d8CgcFtxge8h2Vj3PtkTGgGcPSw4LVVvK3QPCWs0NWKSKn6vg0FZRYVqvGy493BU4OR6Dz0tY6q
 F3KcofdDuY7GE9U58kLw=
X-Received: by 2002:ab0:30d4:: with SMTP id c20mr1201878uam.86.1616082540794; 
 Thu, 18 Mar 2021 08:49:00 -0700 (PDT)
X-Google-Smtp-Source: ABdhPJy1iYnO/vYa1cH8DjS/zlJpGTiJLN/tWcMJ2nyysI3M4xQYoAERr/m2I+cFjnlXCXAOx9F3L8im+sokMDYc1MU=
X-Received: by 2002:ab0:30d4:: with SMTP id c20mr1201863uam.86.1616082540605; 
 Thu, 18 Mar 2021 08:49:00 -0700 (PDT)
MIME-Version: 1.0
References: <1616029240-26588-1-git-send-email-navasile@linux.microsoft.com>
 <1616029240-26588-2-git-send-email-navasile@linux.microsoft.com>
In-Reply-To: <1616029240-26588-2-git-send-email-navasile@linux.microsoft.com>
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 18 Mar 2021 16:48:49 +0100
Message-ID: <CAJFAV8wHu8cc0iNpC_HMpVbsMFJtUK_jUo6MuSH5SZ=ppf8=kQ@mail.gmail.com>
To: Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>
Cc: dev <dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>, 
 Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>, Khoa To <khot@microsoft.com>,
 navasile@microsoft.com, 
 "Dmitry Malloy (MESHCHANINOV)" <dmitrym@microsoft.com>, roretzla@microsoft.com,
 Omar Cardona <ocardona@microsoft.com>,
 Bruce Richardson <bruce.richardson@intel.com>, 
 Pallavi Kadam <pallavi.kadam@intel.com>
Authentication-Results: relay.mimecast.com;
 auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH 1/3] Add EAL threads API
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Thu, Mar 18, 2021 at 2:01 AM Narcisa Ana Maria Vasile
<navasile@linux.microsoft.com> wrote:
> diff --git a/lib/librte_eal/common/eal_common_thread.c b/lib/librte_eal/common/eal_common_thread.c
> index 73a055902..5219e783e 100644
> --- a/lib/librte_eal/common/eal_common_thread.c
> +++ b/lib/librte_eal/common/eal_common_thread.c
> @@ -84,7 +84,7 @@ thread_update_affinity(rte_cpuset_t *cpusetp)
>  }
>
>  int
> -rte_thread_set_affinity(rte_cpuset_t *cpusetp)
> +rte_thread_self_set_affinity(rte_cpuset_t *cpusetp)
>  {
>         if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
>                         cpusetp) != 0) {

[snip]

> diff --git a/lib/librte_eal/include/rte_thread.h b/lib/librte_eal/include/rte_thread.h
> index e640ea185..66b112bc4 100644
> --- a/lib/librte_eal/include/rte_thread.h
> +++ b/lib/librte_eal/include/rte_thread.h

[snip]

> +/**
> + * Set the affinity of thread 'thread_id' to the cpu set
> + * specified by 'cpuset'.
> + *
> + * @param thread_id
> + *    Id of the thread for which to set the affinity.
> + *
> + * @param cpuset_size
> + *
> + * @param cpuset
> + *   Pointer to CPU affinity to set.
> + *
> + * @return
> + *   On success, return 0.
> + *   On failure, return nonzero.
> + */
> +__rte_experimental
> +int rte_thread_set_affinity(rte_thread_t thread_id, size_t cpuset_size,
> +                           const rte_cpuset_t *cpuset);
> +

[snip]

> @@ -34,7 +353,7 @@ typedef struct eal_tls_key *rte_tls_key;
>   * @return
>   *   On success, return 0; otherwise return -1;
>   */
> -int rte_thread_set_affinity(rte_cpuset_t *cpusetp);
> +int rte_thread_self_set_affinity(rte_cpuset_t *cpusetp);
>
>  /**
>   * Get core affinity of the current thread.

rte_thread_*et_affinity() are stable.
This breaks the ABI (which is bad) and this API change was not
announced previously.

The ABI check will catch it for you if you stop at this patch (the
patch 3 actually makes the check go silent because of a wrong
version.map update with duplicate symbols).

$ DPDK_ABI_REF_VERSION=v21.02 ./devtools/test-meson-builds.sh
...
[2502/2502] Linking target drivers/librte_event_octeontx2.so.21.2
Error: ABI issue reported for 'abidiff --suppr
/home/dmarchan/dpdk/devtools/../devtools/libabigail.abignore
--no-added-syms --headers-dir1
/home/dmarchan/abi/v21.02/build-gcc-shared/usr/local/include
--headers-dir2 /home/dmarchan/builds/build-gcc-shared/install/usr/local/include
/home/dmarchan/abi/v21.02/build-gcc-shared/dump/librte_eal.dump
/home/dmarchan/builds/build-gcc-shared/install/dump/librte_eal.dump'
ABIDIFF_ABI_CHANGE, this change requires a review (abidiff flagged
this as a potential issue).
ABIDIFF_ABI_INCOMPATIBLE_CHANGE, this change breaks the ABI.

$ abidiff --suppr
/home/dmarchan/dpdk/devtools/../devtools/libabigail.abignore
--no-added-syms --headers-dir1
/home/dmarchan/abi/v21.02/build-gcc-shared/usr/local/include
--headers-dir2 /home/dmarchan/builds/build-gcc-shared/install/usr/local/include
/home/dmarchan/abi/v21.02/build-gcc-shared/dump/librte_eal.dump
/home/dmarchan/builds/build-gcc-shared/install/dump/librte_eal.dump
Functions changes summary: 2 Removed, 0 Changed, 0 Added (6 filtered
out) functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
Variable symbols changes summary: 0 Removed, 0 Added variable symbol
not referenced by debug info

2 Removed functions:

  [D] 'function void rte_thread_get_affinity(rte_cpuset_t*)'
{rte_thread_get_affinity@@DPDK_21}
  [D] 'function int rte_thread_set_affinity(rte_cpuset_t*)'
{rte_thread_set_affinity@@DPDK_21}


-- 
David Marchand