DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
To: dev@dpdk.org
Cc: kumaras@chelsio.com, nirranjan@chelsio.com, indranil@chelsio.com
Subject: [dpdk-dev] [PATCH 09/13] cxgbe: add support to set mac address
Date: Sun, 11 Mar 2018 04:18:27 +0530	[thread overview]
Message-ID: <9af0874f8d116fba0d84032d789f8eee020ffcb6.1520720053.git.rahul.lakkireddy@chelsio.com> (raw)
In-Reply-To: <cover.1520720053.git.rahul.lakkireddy@chelsio.com>
In-Reply-To: <cover.1520720053.git.rahul.lakkireddy@chelsio.com>

From: Kumar Sanghvi <kumaras@chelsio.com>

Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 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

  parent reply	other threads:[~2018-03-10 22:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-10 22:48 [dpdk-dev] [PATCH 00/13] cxgbe: add CXGBE VF PMD and updates Rahul Lakkireddy
2018-03-10 22:48 ` [dpdk-dev] [PATCH 01/13] cxgbe: add skeleton VF driver Rahul Lakkireddy
2018-03-10 22:48 ` [dpdk-dev] [PATCH 02/13] cxgbe: add VF firmware mailbox support Rahul Lakkireddy
2018-03-10 22:48 ` [dpdk-dev] [PATCH 03/13] cxgbe: add base for enabling VF ports Rahul Lakkireddy
2018-03-10 22:48 ` [dpdk-dev] [PATCH 04/13] cxgbe: add probe to initialize VF devices Rahul Lakkireddy
2018-03-10 22:48 ` [dpdk-dev] [PATCH 05/13] cxgbe: initialize SGE and queues for VF Rahul Lakkireddy
2018-03-10 22:48 ` [dpdk-dev] [PATCH 06/13] cxgbe: enable RSS " Rahul Lakkireddy
2018-03-10 22:48 ` [dpdk-dev] [PATCH 07/13] cxgbe: update TX and RX path " Rahul Lakkireddy
2018-03-10 22:48 ` [dpdk-dev] [PATCH 08/13] cxgbe: add VF port statistics Rahul Lakkireddy
2018-03-10 22:48 ` Rahul Lakkireddy [this message]
2018-03-10 22:48 ` [dpdk-dev] [PATCH 10/13] cxgbe: fix check to close other ports properly Rahul Lakkireddy
2018-03-28 17:24   ` Ferruh Yigit
2018-03-10 22:48 ` [dpdk-dev] [PATCH 11/13] cxgbe: export supported RSS hash functions Rahul Lakkireddy
2018-03-28 17:25   ` Ferruh Yigit
2018-03-10 22:48 ` [dpdk-dev] [PATCH 12/13] cxgbe: convert to SPDX license tags Rahul Lakkireddy
2018-03-10 22:48 ` [dpdk-dev] [PATCH 13/13] cxgbe: add option to keep outer VLAN tag in Q-in-Q Rahul Lakkireddy
2018-03-26 20:51 ` [dpdk-dev] [PATCH 00/13] cxgbe: add CXGBE VF PMD and updates Ferruh Yigit
2018-03-27  7:01   ` Rahul Lakkireddy
2018-03-27 17:26     ` Ferruh Yigit
2018-03-28  7:44       ` Rahul Lakkireddy
2018-03-28  4:49     ` Shahaf Shuler
2018-03-28  7:39       ` Rahul Lakkireddy
2018-03-28  8:30         ` Shahaf Shuler
2018-03-28  9:29           ` Rahul Lakkireddy
2018-03-28 14:06             ` Ferruh Yigit
2018-03-28 17:25 ` 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=9af0874f8d116fba0d84032d789f8eee020ffcb6.1520720053.git.rahul.lakkireddy@chelsio.com \
    --to=rahul.lakkireddy@chelsio.com \
    --cc=dev@dpdk.org \
    --cc=indranil@chelsio.com \
    --cc=kumaras@chelsio.com \
    --cc=nirranjan@chelsio.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).