From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 46930325F for ; Mon, 22 Jan 2018 16:48:36 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2018 07:48:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,397,1511856000"; d="scan'208";a="21639169" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.48]) ([10.237.220.48]) by FMSMGA003.fm.intel.com with ESMTP; 22 Jan 2018 07:48:34 -0800 To: Hemant Agrawal , dev@dpdk.org References: <1514284608-9263-1-git-send-email-hemant.agrawal@nxp.com> <1516255980-25092-1-git-send-email-hemant.agrawal@nxp.com> <5ab068df-3263-d82b-750f-13a8ce8b8723@intel.com> <0ac9a03f-33b5-7311-3fc3-54111dfad242@nxp.com> From: Ferruh Yigit Message-ID: <51718d2c-330a-7096-0b5b-dae07563de80@intel.com> Date: Mon, 22 Jan 2018 15:48:34 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <0ac9a03f-33b5-7311-3fc3-54111dfad242@nxp.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 1/3] kni: support for MAC addr change 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: Mon, 22 Jan 2018 15:48:36 -0000 On 1/22/2018 5:20 AM, Hemant Agrawal wrote: > Hi Ferruh, > > On 1/22/2018 3:37 AM, Ferruh Yigit wrote: >> On 1/18/2018 6:12 AM, Hemant Agrawal wrote: >>> This patch adds following: >>> 1. Option to configure the mac address during create. Generate random >>> address only if the user has not provided any valid address. >>> 2. Inform usespace, if mac address is being changed in linux. >>> 3. Implement default handling of mac address change in the corresponding >>> ethernet device. >>> >>> Signed-off-by: Hemant Agrawal >> >> <...> >> >>> @@ -530,6 +556,14 @@ rte_kni_handle_request(struct rte_kni *kni) >>> req->result = kni->ops.config_network_if(\ >>> kni->ops.port_id, req->if_up); >>> break; >>> + case RTE_KNI_REQ_CHANGE_MAC_ADDR: /* Change MAC Address */ >>> + if (kni->ops.config_mac_address) >>> + req->result = kni->ops.config_mac_address( >>> + kni->ops.port_id, req->mac_addr); >>> + else if (kni->ops.port_id != UINT16_MAX) >> >> This won't be enough. rte_kni_alloc() can be called with NULL ops value. For >> that case m_ctx->ops won't be updated. And by default ops will have all zeros, >> not sure how to differentiate it from real port_id zero. >> > > I think, I tried to address that in the first patch. > > rte_kni_alloc(struct rte_mempool *pktmbuf_pool, > memset(ctx, 0, sizeof(struct rte_kni)); > if (ops) > memcpy(&ctx->ops, ops, sizeof(struct rte_kni_ops)); > + else > + ctx->ops.port_id = UINT16_MAX; > > Do you still see issue? You are right, this fixes it, I missed this part. So patch lgtm: Series, Acked-by: Ferruh Yigit > > Regards, > Hemant >