DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Jiawen Wu <jiawenwu@trustnetic.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2 4/6] net/ngbe: add device init and uninit
Date: Fri, 19 Mar 2021 10:47:29 -0700	[thread overview]
Message-ID: <20210319104729.0390e3dc@hermes.local> (raw)
In-Reply-To: <20210319072628.10000-5-jiawenwu@trustnetic.com>

On Fri, 19 Mar 2021 15:26:26 +0800
Jiawen Wu <jiawenwu@trustnetic.com> wrote:

> +++ b/drivers/net/ngbe/base/ngbe_osdep.h
> @@ -0,0 +1,172 @@

> +#define false               0
> +#define true                1

These will conflict with normal definitions in <stdbool.h>
Why are you not using that?

> +#define min(a, b)	RTE_MIN(a, b)
> +#define max(a, b)	RTE_MAX(a, b)
> +
> +/* Bunch of defines for shared code bogosity */
> +
> +static inline void UNREFERENCED(const char *a __rte_unused, ...) {}
> +#define UNREFERENCED_PARAMETER(args...) UNREFERENCED("", ##args)
> +

I have seen that before... porting code from Windows? 

> +/* Check whether address is multicast. This is little-endian specific check.*/
> +#define NGBE_IS_MULTICAST(address) \
> +		(bool)(((u8 *)(address))[0] & ((u8)0x01))
> +

Why not rte_ether_is_multicast_ether_addr?


> +/* Check whether an address is broadcast. */
> +#define NGBE_IS_BROADCAST(address) \
> +		({typeof(address)addr = (address); \
> +		(((u8 *)(addr))[0] == ((u8)0xff)) && \
> +		(((u8 *)(addr))[1] == ((u8)0xff)); })
> +

Your code is not correct since it would match ff:ff:01:02:03:04

Why not rte_ether_is_broadcast_ether_addr?

  reply	other threads:[~2021-03-19 17:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19  7:26 [dpdk-dev] [PATCH v2 0/6] net: ngbe PMD Jiawen Wu
2021-03-19  7:26 ` [dpdk-dev] [PATCH v2 1/6] net/ngbe: add build and doc infrastructure Jiawen Wu
2021-03-19  7:26 ` [dpdk-dev] [PATCH v2 2/6] net/ngbe: add device IDs Jiawen Wu
2021-03-19  7:26 ` [dpdk-dev] [PATCH v2 3/6] net/ngbe: support probe and remove Jiawen Wu
2021-03-19  7:26 ` [dpdk-dev] [PATCH v2 4/6] net/ngbe: add device init and uninit Jiawen Wu
2021-03-19 17:47   ` Stephen Hemminger [this message]
2021-03-22  2:58     ` Jiawen Wu
2021-03-19  7:26 ` [dpdk-dev] [PATCH v2 5/6] net/ngbe: add log type and error type Jiawen Wu
2021-03-19  7:26 ` [dpdk-dev] [PATCH v2 6/6] net/ngbe: define registers Jiawen Wu

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=20210319104729.0390e3dc@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=jiawenwu@trustnetic.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).