From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5F63B5A8E for ; Wed, 18 Mar 2015 13:04:43 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 18 Mar 2015 05:02:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,422,1422950400"; d="scan'208";a="468887756" Received: from smonroyx-mobl.ger.corp.intel.com (HELO [10.237.220.32]) ([10.237.220.32]) by FMSMGA003.fm.intel.com with ESMTP; 18 Mar 2015 04:57:22 -0700 Message-ID: <550969D7.90707@intel.com> Date: Wed, 18 Mar 2015 12:04:39 +0000 From: "Gonzalez Monroy, Sergio" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: dev@dpdk.org 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> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 12:04:43 -0000 On 18/03/2015 12:01, Sergio Gonzalez Monroy wrote: > 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. > > Signed-off-by: Sergio Gonzalez Monroy > --- > lib/librte_pmd_e1000/igb_pf.c | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > 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) > } > > static int > +igb_vf_set_rlpml(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) > +{ > + struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + uint16_t rlpml = msgbuf[1] & E1000_VMOLR_RLPML_MASK; > + uint32_t max_frame = rlpml + ETHER_HDR_LEN + ETHER_CRC_LEN; > + uint32_t vmolr; > + > + if ((max_frame < ETHER_MIN_LEN) || (max_frame > ETHER_MAX_JUMBO_FRAME_LEN)) > + return -1; > + > + vmolr = E1000_READ_REG(hw, E1000_VMOLR(vf)); > + > + vmolr &= ~E1000_VMOLR_RLPML_MASK; > + vmolr |= rlpml; > + > + /* Enable Long Packet support */ > + vmolr |= 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 = 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 = igb_vf_set_multicast(dev, vf, msgbuf); > break; > + case E1000_VF_SET_LPE: > + retval = igb_vf_set_rlpml(dev, vf, msgbuf); > + break; > case E1000_VF_SET_VLAN: > retval = igb_vf_set_vlan(dev, vf, msgbuf); > break; This patch is targeting 2.1 release. Sergio