DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yong Wang <yongwang@vmware.com>
To: Remy Horton <remy.horton@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 2/2] drivers/net/vmxnet3: add ethdev functions
Date: Fri, 4 Mar 2016 19:12:02 +0000	[thread overview]
Message-ID: <95F70E2D-E1F8-4EFC-B13F-609D2D6E585A@vmware.com> (raw)
In-Reply-To: <1457105124-23650-3-git-send-email-remy.horton@intel.com>

On 3/4/16, 7:25 AM, "Remy Horton" <remy.horton@intel.com> wrote:


>Implements driver support for setting of MAC address.
>
>Signed-off-by: Remy Horton <remy.horton@intel.com>

Acked-by: Yong Wang <yongwang@vmware.com>

mac_hi is not initialized so the upper 16bits are random when calling
VMXNET3_WRITE_BAR1_REG().  The handler of the mac changing ignores
them so it should be fine.


>---
> doc/guides/rel_notes/release_16_04.rst |  4 ++++
> drivers/net/vmxnet3/vmxnet3_ethdev.c   | 19 +++++++++++++++++++
> 2 files changed, 23 insertions(+)
>
>diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst
>index 4e0112e..39db674 100644
>--- a/doc/guides/rel_notes/release_16_04.rst
>+++ b/doc/guides/rel_notes/release_16_04.rst
>@@ -62,6 +62,10 @@ This section should contain new features added in this release. Sample format:
>   Implemented driver functions for Register dumping, EEPROM dumping, and
>   setting of MAC address.
> 
>+* **vmxnet3: Added ethdev support functions.**
>+
>+  Implemented driver functionality for setting MAC address.
>+
> 
> Resolved Issues
> ---------------
>diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
>index c363bf6..bc83524 100644
>--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
>+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
>@@ -91,6 +91,8 @@ static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev,
> static void vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask);
> static void vmxnet3_dev_vlan_offload_set_clear(struct rte_eth_dev *dev,
> 						int mask, int clear);
>+static void vmxnet3_mac_addr_set(struct rte_eth_dev *dev,
>+				 struct ether_addr *mac_addr);
> 
> #if PROCESS_SYS_EVENTS == 1
> static void vmxnet3_process_events(struct vmxnet3_hw *);
>@@ -124,6 +126,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
> 	.rx_queue_release     = vmxnet3_dev_rx_queue_release,
> 	.tx_queue_setup       = vmxnet3_dev_tx_queue_setup,
> 	.tx_queue_release     = vmxnet3_dev_tx_queue_release,
>+	.mac_addr_set         = vmxnet3_mac_addr_set,
> };
> 
> static const struct rte_memzone *
>@@ -922,6 +925,22 @@ vmxnet3_process_events(struct vmxnet3_hw *hw)
> }
> #endif
> 
>+static void vmxnet3_mac_addr_set(struct rte_eth_dev *dev,
>+				 struct ether_addr *mac_addr)
>+{
>+	struct vmxnet3_hw *hw = dev->data->dev_private;
>+	uint32_t mac_hi, mac_lo;
>+
>+	if (!is_valid_assigned_ether_addr(mac_addr)) {
>+		PMD_DRV_LOG(ERR, "Tried to set invalid MAC address.");
>+		return;
>+	}
>+	memcpy(&mac_lo, mac_addr, 4);
>+	memcpy(&mac_hi, mac_addr + 4, 2);
>+	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_MACL, mac_lo);
>+	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_MACH, mac_hi);
>+}
>+
> static struct rte_driver rte_vmxnet3_driver = {
> 	.type = PMD_PDEV,
> 	.init = rte_vmxnet3_pmd_init,
>-- 
>2.5.0
>

  reply	other threads:[~2016-03-04 19:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28  8:48 [dpdk-dev] [PATCH v1 0/3] Add missing ethdev driver support Remy Horton
2016-01-28  8:48 ` [dpdk-dev] [PATCH v1 1/3] drivers/net/i40e: Add ethdev functions Remy Horton
2016-02-23  2:06   ` Zhang, Helin
2016-02-24 10:32     ` Remy Horton
2016-02-24 10:43       ` Ananyev, Konstantin
2016-01-28  8:48 ` [dpdk-dev] [PATCH v1 2/3] drivers/net/virtio: " Remy Horton
2016-01-28  8:48 ` [dpdk-dev] [PATCH v1 3/3] drivers/net/vmxnet3: " Remy Horton
2016-02-16 23:42   ` Yong Wang
2016-02-16 12:02 ` [dpdk-dev] [PATCH v1 0/3] Add missing ethdev driver support Bruce Richardson
2016-02-16 18:54 ` Stephen Hemminger
2016-02-23 12:19   ` Remy Horton
2016-03-04 15:25 ` [dpdk-dev] [PATCH v2 0/2] " Remy Horton
2016-03-04 15:25   ` [dpdk-dev] [PATCH v2 1/2] drivers/net/i40e: add ethdev functions Remy Horton
2016-03-04 15:25   ` [dpdk-dev] [PATCH v2 2/2] drivers/net/vmxnet3: " Remy Horton
2016-03-04 19:12     ` Yong Wang [this message]
2016-03-04 20:34     ` Stephen Hemminger
2016-03-07 12:26       ` Remy Horton
     [not found]         ` <20160307080747.02cc1f1b@xeon-e3>
2016-03-07 17:06           ` Remy Horton
2016-03-07 19:19             ` Stephen Hemminger
2016-03-09 13:29   ` [dpdk-dev] [PATCH v3 0/1] Add missing ethdev driver support Remy Horton
2016-03-09 13:29     ` [dpdk-dev] [PATCH v3 1/1] drivers/net/i40e: add ethdev functions Remy Horton
2016-03-10 12:25       ` Mcnamara, John
2016-03-14 10:22         ` Bruce Richardson

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=95F70E2D-E1F8-4EFC-B13F-609D2D6E585A@vmware.com \
    --to=yongwang@vmware.com \
    --cc=dev@dpdk.org \
    --cc=remy.horton@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).