From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2A3D8A0524; Fri, 19 Mar 2021 18:47:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 98D8814101E; Fri, 19 Mar 2021 18:47:41 +0100 (CET) Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by mails.dpdk.org (Postfix) with ESMTP id 4B68940143 for ; Fri, 19 Mar 2021 18:47:41 +0100 (CET) Received: by mail-pg1-f169.google.com with SMTP id u19so4182264pgh.10 for ; Fri, 19 Mar 2021 10:47:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C/ZCToGOBDxBFszWgyEKrSqdDvqlpbf21jNbYfy90Nc=; b=1mszSo6c+u+5j6kM+wPDHJZ+JLMCDugPgRmvq+o6/l718pJ+wZVlmj25o3iwf17Ihy c8BFOHA7ScQcE/0My6b7nP9BFcvAnmDgslZ5IpQ44rtlg+5Y/4T5zaCRs56Re5hxtPGg DTmMnPTPEZuPLOKzb50mvEwWp5JhNZwFqf8LwSxirnqe+ayQPF5nZETtdyUcdCrA2upx giYsGV6vNzgXxiLutSGNx8xU49kUqsNSzcexZbCevXwc/vdsIbBA/8ZJ6HkyI2LD7oxd H9hKX6VHreNI1LDRq5zaFyxcsEyGjW0QHSc9iRRmKbLNL43hwvSdk5uux3ZgYmkEEZau hSmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C/ZCToGOBDxBFszWgyEKrSqdDvqlpbf21jNbYfy90Nc=; b=t4XtdBabtmI7FF5iE31eOmaTZwV10ia0bAG8cU1eBmNGupd+owl+k3jEB2eAES0Syr QbD7Kf5Q0WC3K1PMXS86tO7E+xl/RdwD/OqxxmK595JPMePlmsC8u7fcXuD8EhEZsppu Rqi+1s5sIo8iKBlEifXbQl37hi1C5dX0SnNynKXfYxjXUE9yHs/CoGHjrcgruwI297GW j7Xx4L9jAAUAyt/UtDJ2cHbxZs3MIAeWWm4lf6urfzKcx1znriMd88aT/0CtahcSDYPh oN2bCO5K2e1Vn9y1iMw6w6Zr+Oaynh7nVoE0uJ+5NAmVUqURFcPITzew7W+nUhO0nlgq SVcg== X-Gm-Message-State: AOAM5336pKOzFBGXcXoTnpjCrhWiNF50N2A5MTxuy/58wgInfqPvBPO7 GSDt8XX4hpdOxsoBdImRg+vmT7manb2mAQ== X-Google-Smtp-Source: ABdhPJzNRfvNFHZNr4cEj3V4bRNawK6D9IawIoBa/DMcu0ebhFxc5RuNUi77qNTvn69oI0IDn+wEvg== X-Received: by 2002:a63:c601:: with SMTP id w1mr11980887pgg.11.1616176060270; Fri, 19 Mar 2021 10:47:40 -0700 (PDT) Received: from hermes.local (76-14-218-44.or.wavecable.com. [76.14.218.44]) by smtp.gmail.com with ESMTPSA id q11sm5867862pfh.132.2021.03.19.10.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 10:47:39 -0700 (PDT) Date: Fri, 19 Mar 2021 10:47:29 -0700 From: Stephen Hemminger To: Jiawen Wu Cc: dev@dpdk.org Message-ID: <20210319104729.0390e3dc@hermes.local> In-Reply-To: <20210319072628.10000-5-jiawenwu@trustnetic.com> References: <20210319072628.10000-1-jiawenwu@trustnetic.com> <20210319072628.10000-5-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 4/6] net/ngbe: add device init and uninit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 19 Mar 2021 15:26:26 +0800 Jiawen Wu 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 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?