DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wu, Jingjing" <jingjing.wu@intel.com>
To: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>
Subject: Re: [dpdk-dev] [PATCH 1/2] ixgbe: VF supports mailbox interruption for	PF link up/down
Date: Fri, 27 May 2016 08:31:07 +0000	[thread overview]
Message-ID: <9BB6961774997848B5B42BEC655768F80E148ECC@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1464069991-31051-2-git-send-email-wenzhuo.lu@intel.com>

> +static void ixgbevf_mbx_process(struct rte_eth_dev *dev) {
> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> +	u32 in_msg = 0;
> +
> +	if (ixgbe_read_mbx(hw, &in_msg, 1, 0))
> +		return;
> +
> +	/* PF reset VF event */
> +	if (in_msg == 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 = IXGBE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> +	struct ixgbe_interrupt *intr =
> +		IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
> +	ixgbevf_intr_disable(hw);
> +
> +	/* read-on-clear nic registers here */
> +	eicr = IXGBE_READ_REG(hw, IXGBE_VTEICR);
> +	intr->flags = 0;
> +
> +	/* only one misc vector supported - mailbox */
> +	eicr &= IXGBE_VTEICR_MASK;
> +	if (eicr == IXGBE_MISC_VEC_ID)
> +		intr->flags |= IXGBE_FLAG_MAILBOX;
> +
> +	return 0;
> +}
> +
> +static int
> +ixgbevf_dev_interrupt_action(struct rte_eth_dev *dev) {
> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> +	struct ixgbe_interrupt *intr =
> +		IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
> +
> +	if (intr->flags & IXGBE_FLAG_MAILBOX) {
> +		ixgbevf_mbx_process(dev);
> +		intr->flags &= ~IXGBE_FLAG_MAILBOX;
> +	}
> +
> +	ixgbevf_intr_enable(hw);
> +
> +	return 0;
> +}


For the readability, it's better to put ixgbevf_intr_disable and ixgbevf_intr_enable
in the same function,  for example, at the beginning and ending of
ixgbevf_dev_interrupt_handler.

Thanks
Jingjing

  reply	other threads:[~2016-05-27  8:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24  6:06 [dpdk-dev] [PATCH 0/2] support mailbox interruption on ixgbe/igb VF Wenzhuo Lu
2016-05-24  6:06 ` [dpdk-dev] [PATCH 1/2] ixgbe: VF supports mailbox interruption for PF link up/down Wenzhuo Lu
2016-05-27  8:31   ` Wu, Jingjing [this message]
2016-05-31  8:45     ` Lu, Wenzhuo
2016-05-24  6:06 ` [dpdk-dev] [PATCH 2/2] igb: " Wenzhuo Lu
2016-06-01  1:53 ` [dpdk-dev] [PATCH v2 0/2] support mailbox interruption on ixgbe/igb VF Wenzhuo Lu
2016-06-01  1:53   ` [dpdk-dev] [PATCH v2 1/2] ixgbe: VF supports mailbox interruption for PF link up/down Wenzhuo Lu
2016-06-02  3:38     ` Wu, Jingjing
2016-06-14 16:53     ` Bruce Richardson
2016-06-15  0:57       ` Lu, Wenzhuo
2016-06-01  1:53   ` [dpdk-dev] [PATCH v2 2/2] igb: " Wenzhuo Lu
2016-06-13  0:48     ` Wu, Jingjing
2016-06-15 10:29   ` [dpdk-dev] [PATCH v2 0/2] support mailbox interruption on ixgbe/igb VF Bruce Richardson
2016-06-28 10:16 ` [dpdk-dev] [PATCH " Luca Boccassi
2016-06-28 15:10   ` Luca Boccassi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9BB6961774997848B5B42BEC655768F80E148ECC@SHSMSX103.ccr.corp.intel.com \
    --to=jingjing.wu@intel.com \
    --cc=dev@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).