DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@6wind.com>
To: Chas Williams <3chas3@gmail.com>
Cc: dev@dpdk.org, "Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
	Chas Williams <chas3@att.com>,
	Olivier Matz <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] [PATCH] net/e1000: add mac_addr_set set to em
Date: Mon, 19 Feb 2018 13:30:40 +0100	[thread overview]
Message-ID: <CALwxeUv55yNsE7NVJXq8VuUxzx=ACNkpfVKasmbfsNp1ebD=qg@mail.gmail.com> (raw)
In-Reply-To: <20180219003955.18775-1-3chas3@gmail.com>

On Mon, Feb 19, 2018 at 1:39 AM, Chas Williams <3chas3@gmail.com> wrote:
> From: Chas Williams <chas3@att.com>
>
> Based on the equivalent code in the igb driver.
>
> Signed-off-by: Chas Williams <chas3@att.com>
> ---
>  drivers/net/e1000/em_ethdev.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
> index 242375f..5bb9cc9 100644
> --- a/drivers/net/e1000/em_ethdev.c
> +++ b/drivers/net/e1000/em_ethdev.c
> @@ -94,6 +94,8 @@ static int em_get_rx_buffer_size(struct e1000_hw *hw);
>  static int eth_em_rar_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
>                           uint32_t index, uint32_t pool);
>  static void eth_em_rar_clear(struct rte_eth_dev *dev, uint32_t index);
> +static void eth_em_default_mac_addr_set(struct rte_eth_dev *dev,
> +                                        struct ether_addr *addr);
>
>  static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev,
>                                    struct ether_addr *mc_addr_set,
> @@ -190,6 +192,7 @@ static const struct eth_dev_ops eth_em_ops = {
>         .dev_led_off          = eth_em_led_off,
>         .flow_ctrl_get        = eth_em_flow_ctrl_get,
>         .flow_ctrl_set        = eth_em_flow_ctrl_set,
> +       .mac_addr_set         = eth_em_default_mac_addr_set,
>         .mac_addr_add         = eth_em_rar_set,
>         .mac_addr_remove      = eth_em_rar_clear,
>         .set_mc_addr_list     = eth_em_set_mc_addr_list,
> @@ -1809,6 +1812,15 @@ eth_em_rar_clear(struct rte_eth_dev *dev, uint32_t index)
>         e1000_rar_set(hw, addr, index);
>  }
>
> +static void
> +eth_em_default_mac_addr_set(struct rte_eth_dev *dev,
> +                           struct ether_addr *addr)
> +{
> +       eth_em_rar_clear(dev, 0);
> +
> +       eth_em_rar_set(dev, (void *)addr, 0, 0);
> +}
> +

Even if copied from igb, this cast is unneeded.
I wrote a similar patch which was in the "upstream" queue, so looks good to me.

Reviewed-by: David Marchand <david.marchand@6wind.com>


-- 
David Marchand

  reply	other threads:[~2018-02-19 12:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19  0:39 Chas Williams
2018-02-19 12:30 ` David Marchand [this message]
2018-04-02  6:17 ` Zhao1, Wei
2018-04-06  8:30   ` Zhang, Helin

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='CALwxeUv55yNsE7NVJXq8VuUxzx=ACNkpfVKasmbfsNp1ebD=qg@mail.gmail.com' \
    --to=david.marchand@6wind.com \
    --cc=3chas3@gmail.com \
    --cc=chas3@att.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    --cc=wenzhuo.lu@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).