From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id CC35B4C7F for ; Tue, 6 Mar 2018 17:41:42 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2018 08:41:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,432,1515484800"; d="scan'208";a="23395334" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.62]) ([10.237.221.62]) by orsmga006.jf.intel.com with ESMTP; 06 Mar 2018 08:41:39 -0800 To: Vipin Varghese , dev@dpdk.org, pascal.mazon@6wind.com Cc: deepak.k.jain@intel.com References: <1518446689-26839-1-git-send-email-vipin.varghese@intel.com> From: Ferruh Yigit Message-ID: <10f2be07-18cd-a650-e2d2-9f9acd63c14b@intel.com> Date: Tue, 6 Mar 2018 16:41:39 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1518446689-26839-1-git-send-email-vipin.varghese@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v1] net/tap: allow user MAC to be passed as args 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: Tue, 06 Mar 2018 16:41:43 -0000 On 2/12/2018 2:44 PM, Vipin Varghese wrote: > Allow TAP PMD to pass user desired MAC address as argument. > The argument value is processed as string delimited by ':', > is parsed and converted to HEX MAC address after validation. > > Signed-off-by: Vipin Varghese > Signed-off-by: Pascal Mazon <...> > @@ -1589,7 +1630,7 @@ enum ioctl_mode { > int speed; > char tap_name[RTE_ETH_NAME_MAX_LEN]; > char remote_iface[RTE_ETH_NAME_MAX_LEN]; > - int fixed_mac_type = 0; > + struct ether_addr user_mac; > > name = rte_vdev_device_name(dev); > params = rte_vdev_device_args(dev); > @@ -1626,7 +1667,7 @@ enum ioctl_mode { > ret = rte_kvargs_process(kvlist, > ETH_TAP_MAC_ARG, > &set_mac_type, > - &fixed_mac_type); > + &user_mac); > if (ret == -1) > goto leave; > } > @@ -1637,7 +1678,7 @@ enum ioctl_mode { > RTE_LOG(NOTICE, PMD, "Initializing pmd_tap for %s as %s\n", > name, tap_name); > > - ret = eth_dev_tap_create(dev, tap_name, remote_iface, fixed_mac_type); > + ret = eth_dev_tap_create(dev, tap_name, remote_iface, &user_mac); "user_mac" without initial value is leading error when no "mac" argument is provided. It should be zeroed out.