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 28628475E for ; Fri, 27 May 2016 10:31:18 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 27 May 2016 01:31:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,373,1459839600"; d="scan'208";a="709721105" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 27 May 2016 01:31:12 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 27 May 2016 01:31:12 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 27 May 2016 01:31:11 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by shsmsx102.ccr.corp.intel.com ([169.254.2.220]) with mapi id 14.03.0248.002; Fri, 27 May 2016 16:31:08 +0800 From: "Wu, Jingjing" To: "Lu, Wenzhuo" , "dev@dpdk.org" CC: "Lu, Wenzhuo" Thread-Topic: [dpdk-dev] [PATCH 1/2] ixgbe: VF supports mailbox interruption for PF link up/down Thread-Index: AQHRtYKVNtR1XPjG2EWn1YUVo7xTBZ/Mdg/A Date: Fri, 27 May 2016 08:31:07 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F80E148ECC@SHSMSX103.ccr.corp.intel.com> References: <1464069991-31051-1-git-send-email-wenzhuo.lu@intel.com> <1464069991-31051-2-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: <1464069991-31051-2-git-send-email-wenzhuo.lu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/2] ixgbe: VF supports mailbox interruption for PF link up/down 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: Fri, 27 May 2016 08:31:19 -0000 > +static void ixgbevf_mbx_process(struct rte_eth_dev *dev) { > + struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > + u32 in_msg =3D 0; > + > + if (ixgbe_read_mbx(hw, &in_msg, 1, 0)) > + return; > + > + /* PF reset VF event */ > + if (in_msg =3D=3D IXGBE_PF_CONTROL_MSG) > + _rte_eth_dev_callback_process(dev, > RTE_ETH_EVENT_INTR_RESET); } > + RTE_ETH_EVENT_INTR_RESET is used for PF reset event reporting, and this patch is to support PF link change. Maybe RTE_ETH_EVENT_INTR_LSC should be used here instead. Or you need to distinguish which control message is coming from PF. > +static int > +ixgbevf_dev_interrupt_get_status(struct rte_eth_dev *dev) { > + uint32_t eicr; > + struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > + struct ixgbe_interrupt *intr =3D > + IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private); > + ixgbevf_intr_disable(hw); > + > + /* read-on-clear nic registers here */ > + eicr =3D IXGBE_READ_REG(hw, IXGBE_VTEICR); > + intr->flags =3D 0; > + > + /* only one misc vector supported - mailbox */ > + eicr &=3D IXGBE_VTEICR_MASK; > + if (eicr =3D=3D IXGBE_MISC_VEC_ID) > + intr->flags |=3D IXGBE_FLAG_MAILBOX; > + > + return 0; > +} > + > +static int > +ixgbevf_dev_interrupt_action(struct rte_eth_dev *dev) { > + struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > + struct ixgbe_interrupt *intr =3D > + IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private); > + > + if (intr->flags & IXGBE_FLAG_MAILBOX) { > + ixgbevf_mbx_process(dev); > + intr->flags &=3D ~IXGBE_FLAG_MAILBOX; > + } > + > + ixgbevf_intr_enable(hw); > + > + return 0; > +} For the readability, it's better to put ixgbevf_intr_disable and ixgbevf_in= tr_enable in the same function, for example, at the beginning and ending of ixgbevf_dev_interrupt_handler. Thanks Jingjing