DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: "Yang, Qiming" <qiming.yang@intel.com>
Cc: dev@dpdk.org, "Dai, Wei" <wei.dai@intel.com>
Subject: Re: [dpdk-dev] [PATCH v7 1/3] ethdev: fix adding invalid MAC addr
Date: Fri, 05 May 2017 16:07:58 +0200	[thread overview]
Message-ID: <2884082.25luyXgJup@xps> (raw)
In-Reply-To: <F5DF4F0E3AFEF648ADC1C3C33AD4DBF16EE06476@SHSMSX101.ccr.corp.intel.com>

05/05/2017 03:46, Yang, Qiming:
> Hi, Dai wei
> 
> >  static void
> > diff --git a/drivers/net/e1000/igb_ethdev.c
> > b/drivers/net/e1000/igb_ethdev.c index b6b81cb..e8c6282 100644
> > --- a/drivers/net/e1000/igb_ethdev.c
> > +++ b/drivers/net/e1000/igb_ethdev.c
> > @@ -171,9 +171,9 @@ static int eth_igb_led_off(struct rte_eth_dev *dev);
> > 
> >  static void igb_intr_disable(struct e1000_hw *hw);  static int
> > igb_get_rx_buffer_size(struct e1000_hw *hw);
> > -static void
> > eth_igb_rar_set(struct rte_eth_dev *dev,
> > -		struct ether_addr *mac_addr,
> > -		uint32_t index, uint32_t pool);
> > +static int eth_igb_rar_set(struct rte_eth_dev *dev,
> > +			   struct ether_addr *mac_addr,
> > +			   uint32_t index, uint32_t pool);
> >  static void eth_igb_rar_clear(struct rte_eth_dev *dev, uint32_t index);
> > static void eth_igb_default_mac_addr_set(struct rte_eth_dev *dev,
> >  		struct ether_addr *addr);
> > @@ -3079,7 +3079,7 @@ eth_igb_flow_ctrl_set(struct rte_eth_dev *dev,
> > struct rte_eth_fc_conf *fc_conf)  }
> > 
> >  #define E1000_RAH_POOLSEL_SHIFT      (18)
> > -static void
> > +static int
> >  eth_igb_rar_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
> >  	        uint32_t index, __rte_unused uint32_t pool)  { @@ -3090,6
> > +3090,7 @@ eth_igb_rar_set(struct rte_eth_dev *dev, struct ether_addr
> > *mac_addr,
> >  	rah = E1000_READ_REG(hw, E1000_RAH(index));
> >  	rah |= (0x1 << (E1000_RAH_POOLSEL_SHIFT + pool));
> >  	E1000_WRITE_REG(hw, E1000_RAH(index), rah);
> > +	return 0;
> >  }
> What's the meaning to add a return here? Return 0 can't represent adding an invalid or valid address, it's meaningless.

Because
drivers/net/e1000/igb_ethdev.c: .mac_addr_add         = eth_igb_rar_set,
and .mac_addr_add is changed to return an error code.

  reply	other threads:[~2017-05-05 14:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-30  4:11 [dpdk-dev] [PATCH v5 0/3] MAC address fail to be added shouldn't be stored Wei Dai
2017-04-30  4:11 ` [dpdk-dev] [PATCH v5 1/3] ethdev: fix adding invalid MAC addr Wei Dai
2017-04-30  4:11 ` [dpdk-dev] [PATCH v5 2/3] doc: change type of return value of adding " Wei Dai
2017-04-30  4:11 ` [dpdk-dev] [PATCH v5 3/3] app/testpmd: add a command to add many MAC addrs Wei Dai
2017-04-30 22:59 ` [dpdk-dev] [PATCH v5 0/3] MAC address fail to be added shouldn't be stored Thomas Monjalon
2017-05-02 12:44 ` [dpdk-dev] [PATCH v6 " Wei Dai
2017-05-02 12:44   ` [dpdk-dev] [PATCH v6 1/3] ethdev: fix adding invalid MAC addr Wei Dai
2017-05-03  0:57     ` Lu, Wenzhuo
2017-05-03  1:46     ` Yuanhan Liu
2017-05-05  0:16       ` Dai, Wei
2017-05-02 12:44   ` [dpdk-dev] [PATCH v6 2/3] doc: change type of return value of adding " Wei Dai
2017-05-02 12:44   ` [dpdk-dev] [PATCH v6 3/3] app/testpmd: add a command to add many MAC addrs Wei Dai
2017-05-05  0:39   ` [dpdk-dev] [PATCH v7 0/3] MAC address fail to be added shouldn't be stored Wei Dai
2017-05-05  0:40     ` [dpdk-dev] [PATCH v7 1/3] ethdev: fix adding invalid MAC addr Wei Dai
2017-05-05  1:46       ` Yang, Qiming
2017-05-05 14:07         ` Thomas Monjalon [this message]
2017-05-05 14:21       ` Thomas Monjalon
2017-05-07  4:39         ` Yuanhan Liu
2017-05-05 14:24       ` Thomas Monjalon
2017-05-05  0:40     ` [dpdk-dev] [PATCH v7 2/3] doc: change type of return value of adding " Wei Dai
2017-05-05 14:23       ` Thomas Monjalon
2017-05-05  0:40     ` [dpdk-dev] [PATCH v7 3/3] app/testpmd: add a command to add many MAC addrs Wei Dai
2017-05-05 14:24       ` Thomas Monjalon
2017-05-08  1:01         ` Wu, Jingjing
2017-05-08  6:17           ` Wu, Jingjing

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=2884082.25luyXgJup@xps \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=qiming.yang@intel.com \
    --cc=wei.dai@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).