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 C1A0B58EF for ; Wed, 18 Mar 2015 13:01:34 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 18 Mar 2015 04:58:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,422,1422950400"; d="scan'208";a="468886549" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 18 Mar 2015 04:54:14 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t2IC1WhV017333 for ; Wed, 18 Mar 2015 12:01:32 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t2IC1Vo7026592 for ; Wed, 18 Mar 2015 12:01:31 GMT Received: (from smonroy@localhost) by sivswdev02.ir.intel.com with id t2IC1V6n026487 for dev@dpdk.org; Wed, 18 Mar 2015 12:01:31 GMT From: Sergio Gonzalez Monroy To: dev@dpdk.org Date: Wed, 18 Mar 2015 12:01:31 +0000 Message-Id: <1426680091-26328-1-git-send-email-sergio.gonzalez.monroy@intel.com> X-Mailer: git-send-email 1.8.5.4 Subject: [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:01:35 -0000 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; -- 1.9.3