From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <wenzhuo.lu@intel.com>
Received: from mga06.intel.com (mga06.intel.com [134.134.136.31])
 by dpdk.org (Postfix) with ESMTP id EC5AD1B052
 for <dev@dpdk.org>; Mon,  8 Jan 2018 02:06:40 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga007.jf.intel.com ([10.7.209.58])
 by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 07 Jan 2018 17:06:39 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.46,328,1511856000"; 
   d="scan'208";a="8596998"
Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202])
 by orsmga007.jf.intel.com with ESMTP; 07 Jan 2018 17:06:39 -0800
Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by
 fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS)
 id 14.3.319.2; Sun, 7 Jan 2018 17:06:39 -0800
Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by
 FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS)
 id 14.3.319.2; Sun, 7 Jan 2018 17:06:38 -0800
Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by
 SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002;
 Mon, 8 Jan 2018 09:06:37 +0800
From: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
CC: "dev@dpdk.org" <dev@dpdk.org>, "Wu, Jingjing" <jingjing.wu@intel.com>
Thread-Topic: [dpdk-dev] [PATCH v4 01/15] net/avf/base: add base code for
 avf PMD
Thread-Index: AQHThf37QonUq6oOeESrMCmZQf8MKKNlNKoAgAP3A3A=
Date: Mon, 8 Jan 2018 01:06:36 +0000
Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B70A8E8@shsmsx102.ccr.corp.intel.com>
References: <1511505206-97333-1-git-send-email-jingjing.wu@intel.com>
 <1515140505-38655-1-git-send-email-wenzhuo.lu@intel.com>
 <1515140505-38655-2-git-send-email-wenzhuo.lu@intel.com>
 <20180105122552.70da9a37@xeon-e3>
In-Reply-To: <20180105122552.70da9a37@xeon-e3>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH v4 01/15] net/avf/base: add base code for avf
 PMD
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 08 Jan 2018 01:06:42 -0000

Hi Stephen,

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Saturday, January 6, 2018 4:26 AM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v4 01/15] net/avf/base: add base code for =
avf
> PMD
>=20
> O
> > diff --git a/drivers/net/avf/base/avf_adminq.c
> > b/drivers/net/avf/base/avf_adminq.c
> > new file mode 100644
> > index 0000000..616e2a9
> > --- /dev/null
> > +++ b/drivers/net/avf/base/avf_adminq.c
> > @@ -0,0 +1,1010 @@
> >
> +/**************************************************************
> ******
> > +***********
> > +
> > +Copyright (c) 2013 - 2015, Intel Corporation All rights reserved.
>=20
> SPDX instead of more boilerplate.
> Copyright 2018?
>=20
> > +STATIC void avf_adminq_init_regs(struct avf_hw *hw)
>=20
> Why is there a STATIC macro??
>=20
> ...
>=20
> > +/**
> > + *  avf_config_asq_regs - configure ASQ registers
> > + *  @hw: pointer to the hardware structure
> > + *
> > + *  Configure base address and length registers for the transmit
> > +queue  **/ STATIC enum avf_status_code avf_config_asq_regs(struct
> > +avf_hw *hw) {
> > +	enum avf_status_code ret_code =3D AVF_SUCCESS;
> > +	u32 reg =3D 0;
> > +
> > +	/* Clear Head and Tail */
> > +	wr32(hw, hw->aq.asq.head, 0);
> > +	wr32(hw, hw->aq.asq.tail, 0);
> > +
> > +	/* set starting point */
> > +#ifdef INTEGRATED_VF
> > +	if (avf_is_vf(hw))
> > +		wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries |
> > +					  AVF_ATQLEN1_ATQENABLE_MASK));
> > +#else
> > +	wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries |
> > +				  AVF_ATQLEN1_ATQENABLE_MASK));
> > +#endif /* INTEGRATED_VF */
>=20
> No ifdef please? do it in header file if you have to.
> as in:
> #ifdef INTERGRATED_VF
> #define avf_is_vf(hw)	(1)
>=20
> ...
>=20
>=20
> > +/* internal (0x00XX) commands */
> > +
> > +/* Get version (direct 0x0001) */
> > +struct avf_aqc_get_version {
> > +	__le32 rom_ver;
> > +	__le32 fw_build;
> > +	__le16 fw_major;
> > +	__le16 fw_minor;
> > +	__le16 api_major;
> > +	__le16 api_minor;
> > +};
>=20
> The use of __le16 and __le32 is a Linux kernel code style, typically not =
used
> in DPDK userland.
>=20
> Are you trying to share code here?
>=20
> ...
>=20
> > +/**
> > + * virtchnl_vc_validate_vf_msg
> > + * @ver: Virtchnl version info
> > + * @v_opcode: Opcode for the message
> > + * @msg: pointer to the msg buffer
> > + * @msglen: msg length
> > + *
> > + * validate msg format against struct for each opcode  */ static
> > +inline int virtchnl_vc_validate_vf_msg(struct virtchnl_version_info
> > +*ver, u32 v_opcode,
> > +			    u8 *msg, u16 msglen)
> > +{
> >
>=20
> This function is way to big to be an inline.
Thanks for your comments. Let me explain. This is the base code, like what'=
s in ixgbe, i40e ... We have to let it be so it's much easier for us to upd=
ate it the next time. That's why the code style is a little different. And =
also some checkpatch problem not handled.=20
We have had some discussion about the copyright license here and internally=
. But unfortunately we don't achieve a conclusion internally so we have to =
keep the long license now and may change it later.