From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id A4C6AAA9E for ; Sat, 10 Mar 2018 23:49:52 +0100 (CET) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id w2AMnm06014066; Sat, 10 Mar 2018 14:49:49 -0800 From: Rahul Lakkireddy To: dev@dpdk.org Cc: kumaras@chelsio.com, nirranjan@chelsio.com, indranil@chelsio.com Date: Sun, 11 Mar 2018 04:18:27 +0530 Message-Id: <9af0874f8d116fba0d84032d789f8eee020ffcb6.1520720053.git.rahul.lakkireddy@chelsio.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 09/13] cxgbe: add support to set mac address 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: , X-List-Received-Date: Sat, 10 Mar 2018 22:49:53 -0000 From: Kumar Sanghvi Signed-off-by: Kumar Sanghvi Signed-off-by: Rahul Lakkireddy --- drivers/net/cxgbe/cxgbe_ethdev.c | 17 +++++++++++++++++ drivers/net/cxgbe/cxgbe_pfvf.h | 1 + drivers/net/cxgbe/cxgbevf_ethdev.c | 1 + 3 files changed, 19 insertions(+) diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c index e84facd33..fdea65ba6 100644 --- a/drivers/net/cxgbe/cxgbe_ethdev.c +++ b/drivers/net/cxgbe/cxgbe_ethdev.c @@ -1030,6 +1030,22 @@ static int cxgbe_get_regs(struct rte_eth_dev *eth_dev, return 0; } +void cxgbe_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *addr) +{ + struct port_info *pi = (struct port_info *)(dev->data->dev_private); + struct adapter *adapter = pi->adapter; + int ret; + + ret = t4_change_mac(adapter, adapter->mbox, pi->viid, + pi->xact_addr_filt, (u8 *)addr, true, true); + if (ret < 0) { + dev_err(adapter, "failed to set mac addr; err = %d\n", + ret); + return; + } + pi->xact_addr_filt = ret; +} + static const struct eth_dev_ops cxgbe_eth_dev_ops = { .dev_start = cxgbe_dev_start, .dev_stop = cxgbe_dev_stop, @@ -1061,6 +1077,7 @@ static const struct eth_dev_ops cxgbe_eth_dev_ops = { .get_reg = cxgbe_get_regs, .rss_hash_update = cxgbe_dev_rss_hash_update, .rss_hash_conf_get = cxgbe_dev_rss_hash_conf_get, + .mac_addr_set = cxgbe_mac_addr_set, }; /* diff --git a/drivers/net/cxgbe/cxgbe_pfvf.h b/drivers/net/cxgbe/cxgbe_pfvf.h index 19bfd6d92..0c1c17071 100644 --- a/drivers/net/cxgbe/cxgbe_pfvf.h +++ b/drivers/net/cxgbe/cxgbe_pfvf.h @@ -16,6 +16,7 @@ void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev); void cxgbe_dev_promiscuous_disable(struct rte_eth_dev *eth_dev); void cxgbe_dev_allmulticast_enable(struct rte_eth_dev *eth_dev); void cxgbe_dev_allmulticast_disable(struct rte_eth_dev *eth_dev); +void cxgbe_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *addr); int cxgbe_dev_configure(struct rte_eth_dev *eth_dev); int cxgbe_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id, diff --git a/drivers/net/cxgbe/cxgbevf_ethdev.c b/drivers/net/cxgbe/cxgbevf_ethdev.c index 27308c71f..4885b9748 100644 --- a/drivers/net/cxgbe/cxgbevf_ethdev.c +++ b/drivers/net/cxgbe/cxgbevf_ethdev.c @@ -95,6 +95,7 @@ static const struct eth_dev_ops cxgbevf_eth_dev_ops = { .rx_queue_stop = cxgbe_dev_rx_queue_stop, .rx_queue_release = cxgbe_dev_rx_queue_release, .stats_get = cxgbevf_dev_stats_get, + .mac_addr_set = cxgbe_mac_addr_set, }; /* -- 2.14.1