Message ID | 1420355937-18484-3-git-send-email-changchun.ouyang@intel.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 7DA6A5A6A; Sun, 4 Jan 2015 08:19:12 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 76E3C5A5F for <dev@dpdk.org>; Sun, 4 Jan 2015 08:19:10 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 03 Jan 2015 23:16:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,694,1413270000"; d="scan'208";a="664127045" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 03 Jan 2015 23:19:09 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t047J7aV030932; Sun, 4 Jan 2015 15:19:07 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t047J406018532; Sun, 4 Jan 2015 15:19:06 +0800 Received: (from couyang@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t047J4IF018528; Sun, 4 Jan 2015 15:19:04 +0800 From: Ouyang Changchun <changchun.ouyang@intel.com> To: dev@dpdk.org Date: Sun, 4 Jan 2015 15:18:53 +0800 Message-Id: <1420355937-18484-3-git-send-email-changchun.ouyang@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1420355937-18484-1-git-send-email-changchun.ouyang@intel.com> References: <1419398584-19520-1-git-send-email-changchun.ouyang@intel.com> <1420355937-18484-1-git-send-email-changchun.ouyang@intel.com> Subject: [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 <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Ouyang Changchun
Jan. 4, 2015, 7:18 a.m. UTC
Negotiate API version with VF when receiving the IXGBE_VF_API_NEGOTIATE message.
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
---
lib/librte_pmd_ixgbe/ixgbe_ethdev.h | 1 +
lib/librte_pmd_ixgbe/ixgbe_pf.c | 25 +++++++++++++++++++++++++
2 files changed, 26 insertions(+)
Comments
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 <changchun.ouyang@intel.com> Reviewed-by: Vlad Zolotarov <vladz@cloudius-systems.com> > --- > 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;
On 01/04/15 10:26, Vlad Zolotarov wrote: > > 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 <changchun.ouyang@intel.com> > > Reviewed-by: Vlad Zolotarov <vladz@cloudius-systems.com> One small remark below. > >> --- >> 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: Why version 2.0 is not negotiated? >> + 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; >
Hi Vlad, > -----Original Message----- > From: Vlad Zolotarov [mailto:vladz@cloudius-systems.com] > Sent: Sunday, January 4, 2015 4:30 PM > To: Ouyang, Changchun; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 2/6] ixgbe: Negotiate VF API version > > > On 01/04/15 10:26, Vlad Zolotarov wrote: > > > > 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 <changchun.ouyang@intel.com> > > > > Reviewed-by: Vlad Zolotarov <vladz@cloudius-systems.com> Thanks for your reviewing. > > One small remark below. > > > > >> --- > >> 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: > > Why version 2.0 is not negotiated? > Because it doesn't fully support 2.0 features yet. Thanks Changchun
On 01/04/15 10:37, Ouyang, Changchun wrote: > Hi Vlad, > >> -----Original Message----- >> From: Vlad Zolotarov [mailto:vladz@cloudius-systems.com] >> Sent: Sunday, January 4, 2015 4:30 PM >> To: Ouyang, Changchun; dev@dpdk.org >> Subject: Re: [dpdk-dev] [PATCH v4 2/6] ixgbe: Negotiate VF API version >> >> >> On 01/04/15 10:26, Vlad Zolotarov wrote: >>> 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 <changchun.ouyang@intel.com> >>> Reviewed-by: Vlad Zolotarov <vladz@cloudius-systems.com> > Thanks for your reviewing. > >> One small remark below. >> >>>> --- >>>> 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: >> Why version 2.0 is not negotiated? >> > Because it doesn't fully support 2.0 features yet. Well, it that case u should not support 2.0 in patch 3 as well. > > Thanks > Changchun >
> -----Original Message----- > From: Vlad Zolotarov [mailto:vladz@cloudius-systems.com] > Sent: Sunday, January 4, 2015 4:40 PM > To: Ouyang, Changchun; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 2/6] ixgbe: Negotiate VF API version > > > On 01/04/15 10:37, Ouyang, Changchun wrote: > > Hi Vlad, > > > >> -----Original Message----- > >> From: Vlad Zolotarov [mailto:vladz@cloudius-systems.com] > >> Sent: Sunday, January 4, 2015 4:30 PM > >> To: Ouyang, Changchun; dev@dpdk.org > >> Subject: Re: [dpdk-dev] [PATCH v4 2/6] ixgbe: Negotiate VF API > >> version > >> > >> > >> On 01/04/15 10:26, Vlad Zolotarov wrote: > >>> 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 <changchun.ouyang@intel.com> > >>> Reviewed-by: Vlad Zolotarov <vladz@cloudius-systems.com> > > Thanks for your reviewing. > > > >> One small remark below. > >> > >>>> --- > >>>> 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: > >> Why version 2.0 is not negotiated? > >> > > Because it doesn't fully support 2.0 features yet. > > Well, it that case u should not support 2.0 in patch 3 as well. My opinion is that In patch 3, ixgbe_get_vf_queues need api_11 or api_20 to support it, That mean the feature require those 2 api version, and it can't work with lower version like api_10. Here the code show the pf has the capability of supporting api_10 and api_11, I think it doesn't contradict. Thanks Changchun
On 01/04/15 10:51, Ouyang, Changchun wrote: >> -----Original Message----- >> From: Vlad Zolotarov [mailto:vladz@cloudius-systems.com] >> Sent: Sunday, January 4, 2015 4:40 PM >> To: Ouyang, Changchun; dev@dpdk.org >> Subject: Re: [dpdk-dev] [PATCH v4 2/6] ixgbe: Negotiate VF API version >> >> >> On 01/04/15 10:37, Ouyang, Changchun wrote: >>> Hi Vlad, >>> >>>> -----Original Message----- >>>> From: Vlad Zolotarov [mailto:vladz@cloudius-systems.com] >>>> Sent: Sunday, January 4, 2015 4:30 PM >>>> To: Ouyang, Changchun; dev@dpdk.org >>>> Subject: Re: [dpdk-dev] [PATCH v4 2/6] ixgbe: Negotiate VF API >>>> version >>>> >>>> >>>> On 01/04/15 10:26, Vlad Zolotarov wrote: >>>>> 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 <changchun.ouyang@intel.com> >>>>> Reviewed-by: Vlad Zolotarov <vladz@cloudius-systems.com> >>> Thanks for your reviewing. >>> >>>> One small remark below. >>>> >>>>>> --- >>>>>> 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: >>>> Why version 2.0 is not negotiated? >>>> >>> Because it doesn't fully support 2.0 features yet. >> Well, it that case u should not support 2.0 in patch 3 as well. > My opinion is that In patch 3, ixgbe_get_vf_queues need api_11 or api_20 to support it, > That mean the feature require those 2 api version, and it can't work with lower version like api_10. > Here the code show the pf has the capability of supporting api_10 and api_11, > I think it doesn't contradict. After a second pass on this code and code in PATCH3 I agree that it's ok. > Thanks > Changchun >
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;