From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f172.google.com (mail-ig0-f172.google.com [209.85.213.172]) by dpdk.org (Postfix) with ESMTP id A5F1428F2 for ; Fri, 4 Mar 2016 21:34:40 +0100 (CET) Received: by mail-ig0-f172.google.com with SMTP id y8so19242384igp.0 for ; Fri, 04 Mar 2016 12:34:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gAmGUdDZNo9H2VmrU4igaJZ8wlLZg3LZ903DTFwP4yQ=; b=BHWTkDTt5RBLHOSuGw6t5nx+TdKlif0kBqDDRrHHeCG4yOK9yu7Sv2og/q1WCLawIH QF2oMrbwykurkjq4VYiwzZaHU8g+Gt1iDzi4tTTBfVt1T3W8dxoHJpa93WxUHKeDEXlt neEh90WAoqg2jWZO05P7Ro+Ew2WN4y0RYKVO2l9UfHOeeJjcvdECubkpTXx2OXy1rKvN 93VmWotx5SO6QJO2qE1uUQO9Mn+Hu3H/Ba4qOtziDiO1rzw2GyQqjjMJ17gcsTF4HNuR tguqciUilYMU+r9PXuXIJYcllWmwg6RE6onh28B2fsOnqjLsNjlUlEQiXx8ifUzetwgt UDHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gAmGUdDZNo9H2VmrU4igaJZ8wlLZg3LZ903DTFwP4yQ=; b=dE/IaPzDN3XZXsRtuKphrUBbcqCESFERicrc22M0jMyCiqwHYRAnGQhELptfh2LAIu yH380t1Qh+/lpeNTahDKtewEmGTZp9oFPUPQAb7o5AvmMHvS8MgvY+MjczX6fh0gZDrK 5/oGR89yLq4rFXpJFCaz2NE6HHPfy/owD8AHw5CMjopq/zb2BytKbHl/hDEPCIyg64B2 GbNTTfVANFimxKm/IavF1+HndC88w9cs70Tu0d1BQpE1RrRyzG43uT5mVef1sPAlPuOW mdXaTKTAuWjqr3ifvZsmexe1XgXwTMKB/lP4O5muvcX/rY1x0azoBh6XVm7LMJvo250/ hORw== X-Gm-Message-State: AD7BkJIoc0+f++ES7GHMnHxAU+eo+L5cGTYEt/1JW3D4v7B1dwAQutqPraoyLUm96PAO5A== X-Received: by 10.50.50.147 with SMTP id c19mr548567igo.72.1457123680124; Fri, 04 Mar 2016 12:34:40 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id qt3sm310269igb.2.2016.03.04.12.34.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Mar 2016 12:34:39 -0800 (PST) Date: Fri, 4 Mar 2016 12:34:52 -0800 From: Stephen Hemminger To: Remy Horton Message-ID: <20160304123452.047709c2@xeon-e3> In-Reply-To: <1457105124-23650-3-git-send-email-remy.horton@intel.com> References: <1457105124-23650-1-git-send-email-remy.horton@intel.com> <1457105124-23650-3-git-send-email-remy.horton@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2 2/2] drivers/net/vmxnet3: add ethdev functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2016 20:34:41 -0000 On Fri, 4 Mar 2016 15:25:24 +0000 Remy Horton wrote: > Implements driver support for setting of MAC address. > > Signed-off-by: Remy Horton > --- > 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, The version I posted is simpler and reuses existing code paths.