DPDK patches and discussions
 help / color / mirror / Atom feed
From: Remy Horton <remy.horton@intel.com>
To: "Zhang, Helin" <helin.zhang@intel.com>,
	 "Xie, Huawei" <huawei.xie@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1 1/3] drivers/net/i40e: Add ethdev functions
Date: Wed, 24 Feb 2016 10:32:26 +0000	[thread overview]
Message-ID: <56CD86BA.7040702@intel.com> (raw)
In-Reply-To: <F35DEAC7BCE34641BA9FAC6BCA4A12E70A9AE917@SHSMSX104.ccr.corp.intel.com>

Comments inline.

..Remy

On 23/02/2016 02:06, Zhang, Helin wrote:
 >
 >> +static inline int
 >> +i40e_read_regs(struct i40e_hw *hw, const struct reg_info *reg,
 >> +	       uint32_t *reg_buf)
 >> +{
 >> +	unsigned int i;
 >> +
 >> +	for (i = 0; i < reg->count; i++)
 >> +		reg_buf[i] = I40E_READ_REG(hw,
 >> +			reg->base_addr + i * reg->stride);
 >> +	return reg->count;
 >> +}
 >  From FVL5, some registers should be read by AQ commands, otherwise 
it may fail to
 > read without any warning.
 > Please see my patches of which registers should be read by AQ commands.
 > Please check i40e_osdep.h from below link. Thanks!
 > http://www.dpdk.org/dev/patchwork/patch/10654/

Ok - will change for v2.

I noticed that other patches in the same patchset expose extra registers 
- are these new or were they simply not exposed previously?


 >> +	/* Only support doing full dump */
 >> +	if (regs->offset != 0 && 0)
 > '&& 0' means it will never be false, right?
 > Anything wrong here?

Oops - some dead code that slipped through.. :)


 >> +		return -ENOTSUP;
 > A message before this return to tell the uers what happened would be 
better.

Will add these into v2.


 >> +static int i40e_get_eeprom_length(__rte_unused struct rte_eth_dev *dev)
 > Why needs __rte_unused?

Good point - surprised the compiler did not complain about them, as they 
are not supposed to be there..


 >> +static void i40e_set_default_mac_addr(struct rte_eth_dev *dev,
 >> +				      struct ether_addr *mac_addr)
 >> +{
 >> +	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data-
 >>> dev_private);
 >> +
 >> +	/* Flags: 0x3 updates port address */
 >> +	i40e_aq_mac_address_write(hw, 0x3, mac_addr->addr_bytes,
 >> NULL); }
 > Checks are needed before writing the MAC address.

Will look into this.


 >> +struct reg_info {
 >> +	uint32_t base_addr;
 >> +	uint32_t count;
 >> +	uint32_t stride;
 >> +	const char *name;
 >> +} reg_info;
 > I think array definition shouldn't be added into a header file, 
otherwise any .c source
 > file which includes that header file will define that.

Since it is quite a large table I think this approach, which is also 
used in ixgbe, is the lesser of evils. i40e_ethdev.c itself is already 
pretty big, and would prefer to avoid giving a driver-specific table 
non-static visibility until it actually has to be used from other 
compilation units.

  reply	other threads:[~2016-02-24 10:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28  8:48 [dpdk-dev] [PATCH v1 0/3] Add missing ethdev driver support Remy Horton
2016-01-28  8:48 ` [dpdk-dev] [PATCH v1 1/3] drivers/net/i40e: Add ethdev functions Remy Horton
2016-02-23  2:06   ` Zhang, Helin
2016-02-24 10:32     ` Remy Horton [this message]
2016-02-24 10:43       ` Ananyev, Konstantin
2016-01-28  8:48 ` [dpdk-dev] [PATCH v1 2/3] drivers/net/virtio: " Remy Horton
2016-01-28  8:48 ` [dpdk-dev] [PATCH v1 3/3] drivers/net/vmxnet3: " Remy Horton
2016-02-16 23:42   ` Yong Wang
2016-02-16 12:02 ` [dpdk-dev] [PATCH v1 0/3] Add missing ethdev driver support Bruce Richardson
2016-02-16 18:54 ` Stephen Hemminger
2016-02-23 12:19   ` Remy Horton
2016-03-04 15:25 ` [dpdk-dev] [PATCH v2 0/2] " Remy Horton
2016-03-04 15:25   ` [dpdk-dev] [PATCH v2 1/2] drivers/net/i40e: add ethdev functions Remy Horton
2016-03-04 15:25   ` [dpdk-dev] [PATCH v2 2/2] drivers/net/vmxnet3: " Remy Horton
2016-03-04 19:12     ` Yong Wang
2016-03-04 20:34     ` Stephen Hemminger
2016-03-07 12:26       ` Remy Horton
     [not found]         ` <20160307080747.02cc1f1b@xeon-e3>
2016-03-07 17:06           ` Remy Horton
2016-03-07 19:19             ` Stephen Hemminger
2016-03-09 13:29   ` [dpdk-dev] [PATCH v3 0/1] Add missing ethdev driver support Remy Horton
2016-03-09 13:29     ` [dpdk-dev] [PATCH v3 1/1] drivers/net/i40e: add ethdev functions Remy Horton
2016-03-10 12:25       ` Mcnamara, John
2016-03-14 10:22         ` Bruce Richardson

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=56CD86BA.7040702@intel.com \
    --to=remy.horton@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=huawei.xie@intel.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).