From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id D4F41239; Sun, 5 May 2019 04:50:18 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 May 2019 19:50:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,431,1549958400"; d="scan'208";a="136945648" Received: from pgsmsx112.gar.corp.intel.com ([10.108.55.201]) by orsmga007.jf.intel.com with ESMTP; 04 May 2019 19:50:16 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.111]) by PGSMSX112.gar.corp.intel.com ([169.254.3.40]) with mapi id 14.03.0415.000; Sun, 5 May 2019 10:50:15 +0800 From: "Zhao1, Wei" To: "Zhang, Qi Z" , "Lu, Wenzhuo" CC: "Stillwell Jr, Paul M" , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/iavf: enable more link speed Thread-Index: AQHVAoKvp36zDw5z90GEJf8/xaDm+6Zb1W+g Date: Sun, 5 May 2019 02:50:14 +0000 Message-ID: References: <20190504140910.8935-1-qi.z.zhang@intel.com> In-Reply-To: <20190504140910.8935-1-qi.z.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/iavf: enable more link speed 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: Sun, 05 May 2019 02:50:19 -0000 Acked-by: Wei Zhao > -----Original Message----- > From: Zhang, Qi Z > Sent: Saturday, May 4, 2019 10:09 PM > To: Lu, Wenzhuo ; Zhao1, Wei > Cc: Stillwell Jr, Paul M ; dev@dpdk.org; Z= hang, > Qi Z ; stable@dpdk.org > Subject: [PATCH] net/iavf: enable more link speed >=20 > Enable advanced link speed mode (VIRTCHNL_VF_CAP_ADV_LINK_SPEED) so > iavf PMD can identify more link speed that reported by pf. >=20 > Cc: stable@dpdk.org >=20 > Signed-off-by: Qi Zhang > --- > drivers/net/iavf/base/virtchnl.h | 17 ++++++++++++++++- > drivers/net/iavf/iavf.h | 2 +- > drivers/net/iavf/iavf_ethdev.c | 21 +++++++++++++++------ > drivers/net/iavf/iavf_vchnl.c | 4 ++-- > 4 files changed, 34 insertions(+), 10 deletions(-) >=20 > diff --git a/drivers/net/iavf/base/virtchnl.h b/drivers/net/iavf/base/vir= tchnl.h > index 13bfdb86b..10b65380c 100644 > --- a/drivers/net/iavf/base/virtchnl.h > +++ b/drivers/net/iavf/base/virtchnl.h > @@ -258,6 +258,8 @@ VIRTCHNL_CHECK_STRUCT_LEN(16, > virtchnl_vsi_resource); > #define VIRTCHNL_VF_OFFLOAD_ENCAP 0X00100000 > #define VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM 0X00200000 > #define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM 0X00400000 > +/* Define below the capability flags that are not offloads */ > +#define VIRTCHNL_VF_CAP_ADV_LINK_SPEED 0x00000080 >=20 > #define VF_BASE_MODE_OFFLOADS (VIRTCHNL_VF_OFFLOAD_L2 | \ > VIRTCHNL_VF_OFFLOAD_VLAN | \ > @@ -562,10 +564,23 @@ enum virtchnl_event_codes { struct > virtchnl_pf_event { > enum virtchnl_event_codes event; > union { > + /* If the PF driver does not support the new speed reporting > + * capabilities then use link_event else use link_event_adv to > + * get the speed and link information. The ability to understand > + * new speeds is indicated by setting the capability flag > + * VIRTCHNL_VF_CAP_ADV_LINK_SPEED in vf_cap_flags > parameter > + * in virtchnl_vf_resource struct and can be used to determine > + * which link event struct to use below. > + */ > struct { > enum virtchnl_link_speed link_speed; > - bool link_status; > + u8 link_status; > } link_event; > + struct { > + /* link_speed provided in Mbps */ > + u32 link_speed; > + u8 link_status; > + } link_event_adv; > } event_data; >=20 > int severity; > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index > e6e3e8d30..9a334e41c 100644 > --- a/drivers/net/iavf/iavf.h > +++ b/drivers/net/iavf/iavf.h > @@ -95,7 +95,7 @@ struct iavf_info { > /* Event from pf */ > bool dev_closed; > bool link_up; > - enum virtchnl_link_speed link_speed; > + uint32_t link_speed; >=20 > struct iavf_vsi vsi; > bool vf_reset; > diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethde= v.c index > 7a0696ed7..bd9c5ecdf 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -584,24 +584,33 @@ iavf_dev_link_update(struct rte_eth_dev *dev, > * when receive LINK_CHANGE evnet from PF by Virtchnnl. > */ > switch (vf->link_speed) { > - case VIRTCHNL_LINK_SPEED_100MB: > + case 10: > + new_link.link_speed =3D ETH_SPEED_NUM_10M; > + break; > + case 100: > new_link.link_speed =3D ETH_SPEED_NUM_100M; > break; > - case VIRTCHNL_LINK_SPEED_1GB: > + case 1000: > new_link.link_speed =3D ETH_SPEED_NUM_1G; > break; > - case VIRTCHNL_LINK_SPEED_10GB: > + case 10000: > new_link.link_speed =3D ETH_SPEED_NUM_10G; > break; > - case VIRTCHNL_LINK_SPEED_20GB: > + case 20000: > new_link.link_speed =3D ETH_SPEED_NUM_20G; > break; > - case VIRTCHNL_LINK_SPEED_25GB: > + case 25000: > new_link.link_speed =3D ETH_SPEED_NUM_25G; > break; > - case VIRTCHNL_LINK_SPEED_40GB: > + case 40000: > new_link.link_speed =3D ETH_SPEED_NUM_40G; > break; > + case 50000: > + new_link.link_speed =3D ETH_SPEED_NUM_50G; > + break; > + case 100000: > + new_link.link_speed =3D ETH_SPEED_NUM_100G; > + break; > default: > new_link.link_speed =3D ETH_SPEED_NUM_NONE; > break; > diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.= c index > 6381fb63c..da6401d35 100644 > --- a/drivers/net/iavf/iavf_vchnl.c > +++ b/drivers/net/iavf/iavf_vchnl.c > @@ -153,7 +153,7 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, > uint8_t *msg, > case VIRTCHNL_EVENT_LINK_CHANGE: > PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE > event"); > vf->link_up =3D pf_msg->event_data.link_event.link_status; > - vf->link_speed =3D pf_msg->event_data.link_event.link_speed; > + vf->link_speed =3D pf_msg- > >event_data.link_event_adv.link_speed; > iavf_dev_link_update(dev, 0); > _rte_eth_dev_callback_process(dev, > RTE_ETH_EVENT_INTR_LSC, > NULL); > @@ -344,7 +344,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter) > * add advanced/optional offload capabilities > */ >=20 > - caps =3D IAVF_BASIC_OFFLOAD_CAPS; > + caps =3D IAVF_BASIC_OFFLOAD_CAPS | > VIRTCHNL_VF_CAP_ADV_LINK_SPEED; >=20 > args.in_args =3D (uint8_t *)∩︀ > args.in_args_size =3D sizeof(caps); > -- > 2.13.6 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 42EE1A0096 for ; Sun, 5 May 2019 04:50:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 56C9829AC; Sun, 5 May 2019 04:50:21 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id D4F41239; Sun, 5 May 2019 04:50:18 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 May 2019 19:50:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,431,1549958400"; d="scan'208";a="136945648" Received: from pgsmsx112.gar.corp.intel.com ([10.108.55.201]) by orsmga007.jf.intel.com with ESMTP; 04 May 2019 19:50:16 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.111]) by PGSMSX112.gar.corp.intel.com ([169.254.3.40]) with mapi id 14.03.0415.000; Sun, 5 May 2019 10:50:15 +0800 From: "Zhao1, Wei" To: "Zhang, Qi Z" , "Lu, Wenzhuo" CC: "Stillwell Jr, Paul M" , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/iavf: enable more link speed Thread-Index: AQHVAoKvp36zDw5z90GEJf8/xaDm+6Zb1W+g Date: Sun, 5 May 2019 02:50:14 +0000 Message-ID: References: <20190504140910.8935-1-qi.z.zhang@intel.com> In-Reply-To: <20190504140910.8935-1-qi.z.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/iavf: enable more link speed 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190505025014.hVeHtQ8Ueg8djEegkak4f0xe6d_RqSBP5vR44yjae50@z> Acked-by: Wei Zhao > -----Original Message----- > From: Zhang, Qi Z > Sent: Saturday, May 4, 2019 10:09 PM > To: Lu, Wenzhuo ; Zhao1, Wei > Cc: Stillwell Jr, Paul M ; dev@dpdk.org; Z= hang, > Qi Z ; stable@dpdk.org > Subject: [PATCH] net/iavf: enable more link speed >=20 > Enable advanced link speed mode (VIRTCHNL_VF_CAP_ADV_LINK_SPEED) so > iavf PMD can identify more link speed that reported by pf. >=20 > Cc: stable@dpdk.org >=20 > Signed-off-by: Qi Zhang > --- > drivers/net/iavf/base/virtchnl.h | 17 ++++++++++++++++- > drivers/net/iavf/iavf.h | 2 +- > drivers/net/iavf/iavf_ethdev.c | 21 +++++++++++++++------ > drivers/net/iavf/iavf_vchnl.c | 4 ++-- > 4 files changed, 34 insertions(+), 10 deletions(-) >=20 > diff --git a/drivers/net/iavf/base/virtchnl.h b/drivers/net/iavf/base/vir= tchnl.h > index 13bfdb86b..10b65380c 100644 > --- a/drivers/net/iavf/base/virtchnl.h > +++ b/drivers/net/iavf/base/virtchnl.h > @@ -258,6 +258,8 @@ VIRTCHNL_CHECK_STRUCT_LEN(16, > virtchnl_vsi_resource); > #define VIRTCHNL_VF_OFFLOAD_ENCAP 0X00100000 > #define VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM 0X00200000 > #define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM 0X00400000 > +/* Define below the capability flags that are not offloads */ > +#define VIRTCHNL_VF_CAP_ADV_LINK_SPEED 0x00000080 >=20 > #define VF_BASE_MODE_OFFLOADS (VIRTCHNL_VF_OFFLOAD_L2 | \ > VIRTCHNL_VF_OFFLOAD_VLAN | \ > @@ -562,10 +564,23 @@ enum virtchnl_event_codes { struct > virtchnl_pf_event { > enum virtchnl_event_codes event; > union { > + /* If the PF driver does not support the new speed reporting > + * capabilities then use link_event else use link_event_adv to > + * get the speed and link information. The ability to understand > + * new speeds is indicated by setting the capability flag > + * VIRTCHNL_VF_CAP_ADV_LINK_SPEED in vf_cap_flags > parameter > + * in virtchnl_vf_resource struct and can be used to determine > + * which link event struct to use below. > + */ > struct { > enum virtchnl_link_speed link_speed; > - bool link_status; > + u8 link_status; > } link_event; > + struct { > + /* link_speed provided in Mbps */ > + u32 link_speed; > + u8 link_status; > + } link_event_adv; > } event_data; >=20 > int severity; > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index > e6e3e8d30..9a334e41c 100644 > --- a/drivers/net/iavf/iavf.h > +++ b/drivers/net/iavf/iavf.h > @@ -95,7 +95,7 @@ struct iavf_info { > /* Event from pf */ > bool dev_closed; > bool link_up; > - enum virtchnl_link_speed link_speed; > + uint32_t link_speed; >=20 > struct iavf_vsi vsi; > bool vf_reset; > diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethde= v.c index > 7a0696ed7..bd9c5ecdf 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -584,24 +584,33 @@ iavf_dev_link_update(struct rte_eth_dev *dev, > * when receive LINK_CHANGE evnet from PF by Virtchnnl. > */ > switch (vf->link_speed) { > - case VIRTCHNL_LINK_SPEED_100MB: > + case 10: > + new_link.link_speed =3D ETH_SPEED_NUM_10M; > + break; > + case 100: > new_link.link_speed =3D ETH_SPEED_NUM_100M; > break; > - case VIRTCHNL_LINK_SPEED_1GB: > + case 1000: > new_link.link_speed =3D ETH_SPEED_NUM_1G; > break; > - case VIRTCHNL_LINK_SPEED_10GB: > + case 10000: > new_link.link_speed =3D ETH_SPEED_NUM_10G; > break; > - case VIRTCHNL_LINK_SPEED_20GB: > + case 20000: > new_link.link_speed =3D ETH_SPEED_NUM_20G; > break; > - case VIRTCHNL_LINK_SPEED_25GB: > + case 25000: > new_link.link_speed =3D ETH_SPEED_NUM_25G; > break; > - case VIRTCHNL_LINK_SPEED_40GB: > + case 40000: > new_link.link_speed =3D ETH_SPEED_NUM_40G; > break; > + case 50000: > + new_link.link_speed =3D ETH_SPEED_NUM_50G; > + break; > + case 100000: > + new_link.link_speed =3D ETH_SPEED_NUM_100G; > + break; > default: > new_link.link_speed =3D ETH_SPEED_NUM_NONE; > break; > diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.= c index > 6381fb63c..da6401d35 100644 > --- a/drivers/net/iavf/iavf_vchnl.c > +++ b/drivers/net/iavf/iavf_vchnl.c > @@ -153,7 +153,7 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, > uint8_t *msg, > case VIRTCHNL_EVENT_LINK_CHANGE: > PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE > event"); > vf->link_up =3D pf_msg->event_data.link_event.link_status; > - vf->link_speed =3D pf_msg->event_data.link_event.link_speed; > + vf->link_speed =3D pf_msg- > >event_data.link_event_adv.link_speed; > iavf_dev_link_update(dev, 0); > _rte_eth_dev_callback_process(dev, > RTE_ETH_EVENT_INTR_LSC, > NULL); > @@ -344,7 +344,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter) > * add advanced/optional offload capabilities > */ >=20 > - caps =3D IAVF_BASIC_OFFLOAD_CAPS; > + caps =3D IAVF_BASIC_OFFLOAD_CAPS | > VIRTCHNL_VF_CAP_ADV_LINK_SPEED; >=20 > args.in_args =3D (uint8_t *)∩︀ > args.in_args_size =3D sizeof(caps); > -- > 2.13.6