From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id CEA5358E4 for ; Wed, 18 Mar 2015 17:01:36 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 18 Mar 2015 08:58:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,423,1422950400"; d="scan'208";a="468983750" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by FMSMGA003.fm.intel.com with ESMTP; 18 Mar 2015 08:54:15 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.117]) by IRSMSX104.ger.corp.intel.com ([169.254.5.145]) with mapi id 14.03.0195.001; Wed, 18 Mar 2015 16:01:10 +0000 From: "Ananyev, Konstantin" To: "Gonzalez Monroy, Sergio" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] igb: handle VF LPE mailbox message Thread-Index: AQHQYXNbSnrML1lcgUm5FrjAwY7fhZ0iZnCw Date: Wed, 18 Mar 2015 16:01:09 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258213F7221@irsmsx105.ger.corp.intel.com> References: <1426680091-26328-1-git-send-email-sergio.gonzalez.monroy@intel.com> In-Reply-To: <1426680091-26328-1-git-send-email-sergio.gonzalez.monroy@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] igb: handle VF LPE mailbox message 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: Wed, 18 Mar 2015 16:01:37 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Sergio Gonzalez Monr= oy > Sent: Wednesday, March 18, 2015 12:02 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] igb: handle VF LPE mailbox message >=20 > This patch adds the handle function for the LPE mailbox message (VF to > PF) to set maximum packet size, which can be used to enable jumbo > frame support. >=20 > Signed-off-by: Sergio Gonzalez Monroy Acked-by: Konstantin Ananyev > --- > lib/librte_pmd_e1000/igb_pf.c | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) >=20 > diff --git a/lib/librte_pmd_e1000/igb_pf.c b/lib/librte_pmd_e1000/igb_pf.= c > index bc3816a..2d49379 100644 > --- a/lib/librte_pmd_e1000/igb_pf.c > +++ b/lib/librte_pmd_e1000/igb_pf.c > @@ -395,6 +395,31 @@ igb_vf_set_vlan(struct rte_eth_dev *dev, uint32_t vf= , uint32_t *msgbuf) > } >=20 > static int > +igb_vf_set_rlpml(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) > +{ > + struct e1000_hw *hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private)= ; > + uint16_t rlpml =3D msgbuf[1] & E1000_VMOLR_RLPML_MASK; > + uint32_t max_frame =3D rlpml + ETHER_HDR_LEN + ETHER_CRC_LEN; > + uint32_t vmolr; > + > + if ((max_frame < ETHER_MIN_LEN) || (max_frame > ETHER_MAX_JUMBO_FRAME_L= EN)) > + return -1; > + > + vmolr =3D E1000_READ_REG(hw, E1000_VMOLR(vf)); > + > + vmolr &=3D ~E1000_VMOLR_RLPML_MASK; > + vmolr |=3D rlpml; > + > + /* Enable Long Packet support */ > + vmolr |=3D E1000_VMOLR_LPE; > + > + E1000_WRITE_REG(hw, E1000_VMOLR(vf), vmolr); > + E1000_WRITE_FLUSH(hw); > + > + return 0; > +} > + > +static int > igb_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) > { > uint16_t mbx_size =3D E1000_VFMAILBOX_SIZE; > @@ -428,6 +453,9 @@ igb_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t= vf) > case E1000_VF_SET_MULTICAST: > retval =3D igb_vf_set_multicast(dev, vf, msgbuf); > break; > + case E1000_VF_SET_LPE: > + retval =3D igb_vf_set_rlpml(dev, vf, msgbuf); > + break; > case E1000_VF_SET_VLAN: > retval =3D igb_vf_set_vlan(dev, vf, msgbuf); > break; > -- > 1.9.3