DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Srikanth Yalavarthi" <syalavarthi@marvell.com>,
	"Nithin Dabilpuram" <ndabilpuram@marvell.com>,
	"Kiran Kumar K" <kirankumark@marvell.com>,
	"Sunil Kumar Kori" <skori@marvell.com>,
	"Satha Rao" <skoteshwar@marvell.com>
Cc: <dev@dpdk.org>, <jerinj@marvell.com>, <sshankarnara@marvell.com>
Subject: RE: [PATCH 1/1] common/cnxk: added new macros to platform layer
Date: Wed, 13 Apr 2022 09:08:16 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D86FD7@smartserver.smartshare.dk> (raw)
In-Reply-To: <20220412174224.13143-1-syalavarthi@marvell.com>

> From: Srikanth Yalavarthi [mailto:syalavarthi@marvell.com]
> Sent: Tuesday, 12 April 2022 19.42
> 
> Added new macros for pointer operations, bitwise operations,
> spinlocks and 32 bit read and write.
> 
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> ---
>  drivers/common/cnxk/roc_bits.h     | 12 ++++++++++++
>  drivers/common/cnxk/roc_platform.h | 28 +++++++++++++++++++---------
>  2 files changed, 31 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/common/cnxk/roc_bits.h
> b/drivers/common/cnxk/roc_bits.h
> index 11216d9d63..ce3dffa08d 100644
> --- a/drivers/common/cnxk/roc_bits.h
> +++ b/drivers/common/cnxk/roc_bits.h
> @@ -29,4 +29,16 @@
>  	 (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
>  #endif
> 
> +#ifndef IS_BIT_SET
> +#define IS_BIT_SET(num, n) ((num) & (1 << (n)))
> +#endif
> +
> +#ifndef SET_BIT
> +#define SET_BIT(num, n) ((num) | (1 << (n)))
> +#endif
> +
> +#ifndef CLEAR_BIT
> +#define CLEAR_BIT(num, n) ((num) &= ~((1) << (n)))
> +#endif
> +
>  #endif /* _ROC_BITS_H_ */

You could consider replacing these with explicit 32/64 bit variants, using the RTE_BIT64() and RTE_BIT32() macros instead of (1 << (n)).

Just a suggestion - I'll leave it up to you.

-Morten


  reply	other threads:[~2022-04-13  7:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 17:42 Srikanth Yalavarthi
2022-04-13  7:08 ` Morten Brørup [this message]
2022-05-14 12:20 ` Jerin Jacob
2022-05-16 17:20 ` [PATCH v2 1/1] common/cnxk: added additional platform macros Srikanth Yalavarthi
2022-05-16 17:26 ` [PATCH v2 1/1] common/cnxk: added new macros to platform layer Srikanth Yalavarthi
2022-06-13  8:23   ` Jerin Jacob

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=98CBD80474FA8B44BF855DF32C47DC35D86FD7@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    --cc=sshankarnara@marvell.com \
    --cc=syalavarthi@marvell.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).