DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@6wind.com>
To: dev@dpdk.org
Cc: johndale@cisco.com, neescoba@cisco.com
Subject: [dpdk-dev] [PATCH] net/enic: add primary mac address handler
Date: Mon, 19 Feb 2018 13:42:27 +0100	[thread overview]
Message-ID: <20180219124227.19859-1-david.marchand@6wind.com> (raw)

Reused the .mac_addr_add and .mac_addr_del callbacks code to implement
primary mac address handler.

Signed-off-by: David Marchand <david.marchand@6wind.com>
---
 drivers/net/enic/enic_ethdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 669dbf336..802fd3623 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -610,6 +610,13 @@ static void enicpmd_remove_mac_addr(struct rte_eth_dev *eth_dev, uint32_t index)
 	enic_del_mac_address(enic, index);
 }
 
+static void enicpmd_set_mac_addr(struct rte_eth_dev *eth_dev,
+	struct ether_addr *addr)
+{
+	enicpmd_remove_mac_addr(eth_dev, 0);
+	enicpmd_add_mac_addr(eth_dev, addr, 0, 0);
+}
+
 static int enicpmd_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu)
 {
 	struct enic *enic = pmd_priv(eth_dev);
@@ -657,6 +664,7 @@ static const struct eth_dev_ops enicpmd_eth_dev_ops = {
 	.priority_flow_ctrl_set = NULL,
 	.mac_addr_add         = enicpmd_add_mac_addr,
 	.mac_addr_remove      = enicpmd_remove_mac_addr,
+	.mac_addr_set         = enicpmd_set_mac_addr,
 	.filter_ctrl          = enicpmd_dev_filter_ctrl,
 };
 
-- 
2.11.0

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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 12:42 David Marchand [this message]
2018-02-20  5:41 ` Hyong Youb Kim
2018-02-20  9:17   ` David Marchand
2018-02-20 12:16     ` Hyong Youb Kim
2018-04-06 17:33       ` Ferruh Yigit
2018-04-13 17:34         ` Ferruh Yigit
2018-04-16  9:40 ` [dpdk-dev] [PATCH v2] " David Marchand
2018-04-17  5:12   ` Hyong Youb Kim
2018-04-17 17:23     ` Ferruh Yigit

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=20180219124227.19859-1-david.marchand@6wind.com \
    --to=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    --cc=johndale@cisco.com \
    --cc=neescoba@cisco.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).