From patchwork Mon Feb 19 12:42:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 35218 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D02F7CBA; Mon, 19 Feb 2018 13:42:40 +0100 (CET) Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 47B632C66 for ; Mon, 19 Feb 2018 13:42:39 +0100 (CET) Received: from alcyon.dev.6wind.com. (unknown [10.16.0.235]) by proxy.6wind.com (Postfix) with ESMTP id C5535134CED; Mon, 19 Feb 2018 13:39:33 +0100 (CET) From: David Marchand To: dev@dpdk.org Cc: johndale@cisco.com, neescoba@cisco.com Date: Mon, 19 Feb 2018 13:42:27 +0100 Message-Id: <20180219124227.19859-1-david.marchand@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH] net/enic: add primary mac address handler X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Reused the .mac_addr_add and .mac_addr_del callbacks code to implement primary mac address handler. Signed-off-by: David Marchand --- 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, };