From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v3 1/3] kni: support for MAC addr change Date: Sun, 21 Jan 2018 22:07:57 +0000 Message-ID: <5ab068df-3263-d82b-750f-13a8ce8b8723@intel.com> References: <1514284608-9263-1-git-send-email-hemant.agrawal@nxp.com> <1516255980-25092-1-git-send-email-hemant.agrawal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit To: Hemant Agrawal , dev@dpdk.org Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5F9491200A for ; Sun, 21 Jan 2018 23:07:59 +0100 (CET) In-Reply-To: <1516255980-25092-1-git-send-email-hemant.agrawal@nxp.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.