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 5F817A0679 for ; Fri, 5 Apr 2019 09:28:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BABB61B445; Fri, 5 Apr 2019 09:27:58 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id DC6741B442 for ; Fri, 5 Apr 2019 09:27:56 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2019 00:27:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,310,1549958400"; d="scan'208";a="220802212" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 05 Apr 2019 00:27:55 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 5 Apr 2019 00:27:55 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 5 Apr 2019 00:27:54 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.93]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.149]) with mapi id 14.03.0415.000; Fri, 5 Apr 2019 15:27:52 +0800 From: "Zhang, Qi Z" To: "Yang, Qiming" , "Lu, Wenzhuo" CC: "dev@dpdk.org" , "Stillwell Jr, Paul M" Thread-Topic: [PATCH] net/ice: send driver version to firmware Thread-Index: AQHU5c6mFQEoKWq6l0+nDwvO0DlksKYqykuAgAJsAvA= Date: Fri, 5 Apr 2019 07:27:52 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153363E53@SHSMSX103.ccr.corp.intel.com> References: <20190329012953.18130-1-qi.z.zhang@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzQxNjQ2YzAtYjY3OC00MDdlLWE0ZTktZDliNzJlYjk0NzljIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNkxhM3RncFVnYnMycjVzbkJ5Tlo3bU1qOEUrZThQNmh0dkhkemhNZUZkSFpoYm9UTmFjTFE3b1B2WGVtXC80SkIifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/ice: send driver version to firmware 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: <20190405072752.aE45CxG8UAuLu28X1N08D91HrypP5B66rpOsjb1987Q@z> > -----Original Message----- > From: Yang, Qiming > Sent: Thursday, April 4, 2019 10:28 AM > To: Zhang, Qi Z ; Lu, Wenzhuo > Cc: dev@dpdk.org; Stillwell Jr, Paul M > Subject: RE: [PATCH] net/ice: send driver version to firmware >=20 >=20 >=20 > -----Original Message----- > From: Zhang, Qi Z > Sent: Friday, March 29, 2019 9:30 AM > To: Lu, Wenzhuo ; Yang, Qiming > > Cc: dev@dpdk.org; Stillwell Jr, Paul M ; Z= hang, Qi Z > > Subject: [PATCH] net/ice: send driver version to firmware >=20 > The driver must send its version information to the firmware, so the firm= ware > knows the driver is up. Otherwise, it will cause unexpected OS package > downloading when multiple driver instances running on the same device. >=20 > Signed-off-by: Paul M Stillwell Jr > Signed-off-by: Qi Zhang > --- > drivers/net/ice/base/ice_adminq_cmd.h | 12 ++++++++++++ > drivers/net/ice/base/ice_common.c | 36 > +++++++++++++++++++++++++++++++++++ > drivers/net/ice/base/ice_common.h | 3 +++ > drivers/net/ice/base/ice_type.h | 4 ++++ > drivers/net/ice/ice_ethdev.c | 21 ++++++++++++++++++++ > 5 files changed, 76 insertions(+) >=20 > diff --git a/drivers/net/ice/base/ice_adminq_cmd.h > b/drivers/net/ice/base/ice_adminq_cmd.h > index d2ab9eeff..bbdca83fc 100644 > --- a/drivers/net/ice/base/ice_adminq_cmd.h > +++ b/drivers/net/ice/base/ice_adminq_cmd.h > @@ -38,6 +38,17 @@ struct ice_aqc_get_ver { }; >=20 >=20 > +/* Send driver version (indirect 0x0002) */ struct ice_aqc_driver_ver { > + u8 major_ver; > + u8 minor_ver; > + u8 build_ver; > + u8 subbuild_ver; > + u8 reserved[4]; > + __le32 addr_high; > + __le32 addr_low; > +}; > + >=20 > /* Queue Shutdown (direct 0x0003) */ > struct ice_aqc_q_shutdown { > @@ -2182,6 +2193,7 @@ struct ice_aq_desc { > u8 raw[16]; > struct ice_aqc_generic generic; > struct ice_aqc_get_ver get_ver; > + struct ice_aqc_driver_ver driver_ver; > struct ice_aqc_q_shutdown q_shutdown; > struct ice_aqc_req_res res_owner; > struct ice_aqc_manage_mac_read mac_read; diff --git > a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c > index 3d2e5f347..c74e4e1d4 100644 > --- a/drivers/net/ice/base/ice_common.c > +++ b/drivers/net/ice/base/ice_common.c > @@ -1512,6 +1512,42 @@ enum ice_status ice_aq_get_fw_ver(struct ice_hw > *hw, struct ice_sq_cd *cd) > return status; > } >=20 > +/** > + * ice_aq_send_driver_ver > + * @hw: pointer to the HW struct > + * @dv: driver's major, minor version > + * @cd: pointer to command details structure or NULL > + * > + * Send the driver version (0x0002) to the firmware */ enum ice_status > +ice_aq_send_driver_ver(struct ice_hw *hw, struct ice_driver_ver *dv, > + struct ice_sq_cd *cd) > +{ > + struct ice_aqc_driver_ver *cmd; > + struct ice_aq_desc desc; > + u16 len; > + > + cmd =3D &desc.params.driver_ver; > + > + if (!dv) > + return ICE_ERR_PARAM; > + > + ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_driver_ver); > + > + desc.flags |=3D CPU_TO_LE16(ICE_AQ_FLAG_RD); > + cmd->major_ver =3D dv->major_ver; > + cmd->minor_ver =3D dv->minor_ver; > + cmd->build_ver =3D dv->build_ver; > + cmd->subbuild_ver =3D dv->subbuild_ver; > + > + len =3D 0; > + while (len < sizeof(dv->driver_string) && > + IS_ASCII(dv->driver_string[len]) && dv->driver_string[len]) > + len++; > + > + return ice_aq_send_cmd(hw, &desc, dv->driver_string, len, cd); } >=20 > /** > * ice_aq_q_shutdown > diff --git a/drivers/net/ice/base/ice_common.h > b/drivers/net/ice/base/ice_common.h > index e8f2ce9d8..58c66fdc0 100644 > --- a/drivers/net/ice/base/ice_common.h > +++ b/drivers/net/ice/base/ice_common.h > @@ -119,6 +119,9 @@ ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc > *desc, enum ice_status ice_aq_get_fw_ver(struct ice_hw *hw, struct > ice_sq_cd *cd); >=20 > enum ice_status > +ice_aq_send_driver_ver(struct ice_hw *hw, struct ice_driver_ver *dv, > + struct ice_sq_cd *cd); > +enum ice_status > ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 > report_mode, > struct ice_aqc_get_phy_caps_data *caps, > struct ice_sq_cd *cd); > diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_t= ype.h > index b0bdec2df..e4979b832 100644 > --- a/drivers/net/ice/base/ice_type.h > +++ b/drivers/net/ice/base/ice_type.h > @@ -22,6 +22,10 @@ > #define MIN_T(_t, _a, _b) min((_t)(_a), (_t)(_b)) > #endif >=20 > +#ifndef IS_ASCII > +#define IS_ASCII(_ch) ((_ch) < 0x80) > +#endif > + > #include "ice_status.h" > #include "ice_hw_autogen.h" > #include "ice_devids.h" > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c = index > 85311dde0..922a211f1 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -1244,6 +1244,21 @@ ice_setup_vsi(struct ice_pf *pf, enum ice_vsi_type > type) } >=20 > static int > +ice_send_driver_ver(struct ice_hw *hw) > +{ > + struct ice_driver_ver dv; > + > + /* we don't have driver version use 0 for dummy */ > + dv.major_ver =3D 0; > + dv.minor_ver =3D 0; > + dv.build_ver =3D 0; > + dv.subbuild_ver =3D 0; > + strncpy((char *)dv.driver_string, "dpdk", sizeof(dv.driver_string)); > + > + return ice_aq_send_driver_ver(hw, &dv, NULL); } > + > +static int > ice_pf_setup(struct ice_pf *pf) > { > struct ice_vsi *vsi; > @@ -1401,6 +1416,12 @@ ice_dev_init(struct rte_eth_dev *dev) > goto err_pf_setup; > } >=20 > + ret =3D ice_send_driver_ver(hw); > + if (ret) { > + PMD_INIT_LOG(ERR, "Failed to send driver version"); > + goto err_pf_setup; > + } > + > vsi =3D pf->main_vsi; >=20 > /* Disable double vlan by default */ > -- > 2.13.6 >=20 >=20 > Should the share code part and PMD part be separated into two patches? That might be better, but I assume you are still ok with this :) > Acked-by: Qiming Yang Applied to dpdk-next-net-intel Thanks Qi