From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by dpdk.org (Postfix) with ESMTP id 71A441396 for ; Fri, 29 May 2015 17:20:19 +0200 (CEST) Received: by pdbqa5 with SMTP id qa5so55901049pdb.0 for ; Fri, 29 May 2015 08:20:18 -0700 (PDT) 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-type:content-transfer-encoding; bh=o/YGzexrI8Eq+jMX4/eA4Xnsk+pacDx55clk8c/43e8=; b=i2riK9HoWK1oZV5gzpHdaCWXGBHPPibt6LOxzJQ1Mo3qEdUgtgCuuFLNbh1QP0Y0XZ oqps+OQN31kMTPhJ26UtcBO2/Bt1EFk1KLvMdiltNJOFiW+YhpX/ljtSM1QiKosePhdm unAO4LURpWonqocqfGgnzLvkCpIYkhdbOek4dxWX09DhSZ4haVhUu1xo9Yj8wWhOzhMv wgD4ddEjHdRQUwtWOW6+v22zqDw3W3JzA1z3YdGh/xCAxrshQjATvfU5SG8Ew9hgcoKn gK1mvlte09xR6MRy+FvehbjAVJEYQ3oJq6L8MUHNZdxalzCfhOJF+wMUkJT1d2iAG97l RIsA== X-Gm-Message-State: ALoCoQlHJbJDUhGuTqLR46glvEdlv5G6eAnPz+c3bR+3/Kes+GoAfDVbc4c2Wj4Vs6qauh+uuvFX X-Received: by 10.70.43.10 with SMTP id s10mr15872445pdl.57.1432912818795; Fri, 29 May 2015 08:20:18 -0700 (PDT) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id pw9sm5947375pac.27.2015.05.29.08.20.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 08:20:18 -0700 (PDT) Date: Fri, 29 May 2015 08:20:21 -0700 From: Stephen Hemminger To: Liang-Min Larry Wang Message-ID: <20150529082021.16147bb5@urahara> In-Reply-To: <1432905309-912-2-git-send-email-liang-min.wang@intel.com> References: <1432905309-912-1-git-send-email-liang-min.wang@intel.com> <1432905309-912-2-git-send-email-liang-min.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, aharton@cisco.com, bruce.richardson@intle.com Subject: Re: [dpdk-dev] [PATCH 1/2] ethdev: add api to set default mac address 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, 29 May 2015 15:20:20 -0000 On Fri, 29 May 2015 09:15:08 -0400 Liang-Min Larry Wang wrote: > } > > int > +rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) > +{ > + struct rte_eth_dev *dev; > + const int index = 0; > + const uint32_t pool = 0; > + > + if (!rte_eth_dev_is_valid_port(port_id)) { > + PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); > + return -ENODEV; > + } > + > + dev = &rte_eth_devices[port_id]; > + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_remove, -ENOTSUP); > + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_add, -ENOTSUP); > + > + /* Update NIC default MAC address*/ > + (*dev->dev_ops->mac_addr_remove)(dev, index); > + (*dev->dev_ops->mac_addr_add)(dev, addr, index, pool); > + > + /* Update default address in NIC data structure */ > + ether_addr_copy(addr, &dev->data->mac_addrs[index]); > + > + return 0; > +} > + No. this won't work. for some devices. Please use mac_addr_set hook added in recent DPDK