From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id F08535963 for ; Sun, 4 Jan 2015 09:26:41 +0100 (CET) Received: by mail-wg0-f49.google.com with SMTP id n12so25772077wgh.8 for ; Sun, 04 Jan 2015 00:26:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=hPfea1guNGi3Q2ckYFySjFYDX1Jg6vQ3GGU7hbYgxhs=; b=d6BHVibn9JJ6hcXCBiMlNUB9BNmw6CY0Pei5AFv2XW5Z3BXr4P+h+ep+L29lufRT9w pg5z8OtYQx8weXMTQwgXUarc6t+qeQefcWoELz3Ye8zjmcrH51dxVbk0bxb6yNsVTGYu TvUb/DlMB77+PzKO36z8JhEeSQbAT/q42m103U9dbvf0Hlj0oKucNtny34ar5hc4zyEd C41QwpLnjLGnyCyZFSbbpKhJeNvS/xS8UDSllDYknP80mKEXCr7awobk6SqdYwfCMxXh uNbQaRi+opXx9zKMuRnNLL/auJevGLh4InOAla/xpV57BZ0VH+ZtkUFp+Pi0cQir238J 6ILA== X-Gm-Message-State: ALoCoQlJ1RwMfPh0LdlLDo0qpqwWs3UB+0EsZpfP8TwOBdgkD2C9YDz59IS1UF0B3VX+8PyCObO9 X-Received: by 10.180.211.2 with SMTP id my2mr13681623wic.3.1420360001852; Sun, 04 Jan 2015 00:26:41 -0800 (PST) Received: from [10.0.0.3] (bzq-79-179-0-199.red.bezeqint.net. [79.179.0.199]) by mx.google.com with ESMTPSA id ej10sm5255347wib.2.2015.01.04.00.26.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Jan 2015 00:26:41 -0800 (PST) Message-ID: <54A8F93F.4080402@cloudius-systems.com> Date: Sun, 04 Jan 2015 10:26:39 +0200 From: Vlad Zolotarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Ouyang Changchun , dev@dpdk.org References: <1419398584-19520-1-git-send-email-changchun.ouyang@intel.com> <1420355937-18484-1-git-send-email-changchun.ouyang@intel.com> <1420355937-18484-3-git-send-email-changchun.ouyang@intel.com> In-Reply-To: <1420355937-18484-3-git-send-email-changchun.ouyang@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 2/6] ixgbe: Negotiate VF API version 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: Sun, 04 Jan 2015 08:26:42 -0000 On 01/04/15 09:18, Ouyang Changchun wrote: > Negotiate API version with VF when receiving the IXGBE_VF_API_NEGOTIATE message. > > Signed-off-by: Changchun Ouyang Reviewed-by: Vlad Zolotarov > --- > lib/librte_pmd_ixgbe/ixgbe_ethdev.h | 1 + > lib/librte_pmd_ixgbe/ixgbe_pf.c | 25 +++++++++++++++++++++++++ > 2 files changed, 26 insertions(+) > > diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.h b/lib/librte_pmd_ixgbe/ixgbe_ethdev.h > index ca99170..730098d 100644 > --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.h > +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.h > @@ -159,6 +159,7 @@ struct ixgbe_vf_info { > uint16_t tx_rate[IXGBE_MAX_QUEUE_NUM_PER_VF]; > uint16_t vlan_count; > uint8_t spoofchk_enabled; > + uint8_t api_version; > }; > > /* > diff --git a/lib/librte_pmd_ixgbe/ixgbe_pf.c b/lib/librte_pmd_ixgbe/ixgbe_pf.c > index 51da1fd..495aff5 100644 > --- a/lib/librte_pmd_ixgbe/ixgbe_pf.c > +++ b/lib/librte_pmd_ixgbe/ixgbe_pf.c > @@ -469,6 +469,28 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused uint32_t vf, uint32_t *ms > } > > static int > +ixgbe_negotiate_vf_api(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) > +{ > + uint32_t api_version = msgbuf[1]; > + struct ixgbe_vf_info *vfinfo = > + *IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private); > + > + switch (api_version) { > + case ixgbe_mbox_api_10: > + case ixgbe_mbox_api_11: > + vfinfo[vf].api_version = (uint8_t)api_version; > + return 0; > + default: > + break; > + } > + > + RTE_LOG(ERR, PMD, "Negotiate invalid api version %u from VF %d\n", > + api_version, vf); > + > + return -1; > +} > + > +static int > ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) > { > uint16_t mbx_size = IXGBE_VFMAILBOX_SIZE; > @@ -512,6 +534,9 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) > case IXGBE_VF_SET_VLAN: > retval = ixgbe_vf_set_vlan(dev, vf, msgbuf); > break; > + case IXGBE_VF_API_NEGOTIATE: > + retval = ixgbe_negotiate_vf_api(dev, vf, msgbuf); > + break; > default: > PMD_DRV_LOG(DEBUG, "Unhandled Msg %8.8x", (unsigned)msgbuf[0]); > retval = IXGBE_ERR_MBX;