netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: e1000-devel@lists.sourceforge.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 net-next 6/7] ixgbe: add support for ndo_ll_poll
Date: Wed, 5 Jun 2013 08:50:42 +0000 (UTC)	[thread overview]
Message-ID: <komu51$jv$1@ger.gmane.org> (raw)
In-Reply-To: 20130603080209.18273.16368.stgit@ladj378.jer.intel.com

On Mon, 03 Jun 2013 at 08:02 GMT, Eliezer Tamir <eliezer.tamir@linux.intel.com> wrote:
> +/* called from the device poll rutine to get ownership of a q_vector */
> +static inline bool ixgbe_qv_lock_napi(struct ixgbe_q_vector *q_vector)
> +{
> +	int rc = true;

        bool rc = true;

> +	spin_lock(&q_vector->lock);
> +	if (q_vector->state & IXGBE_QV_LOCKED) {
> +		WARN_ON(q_vector->state & IXGBE_QV_STATE_NAPI);
> +		q_vector->state |= IXGBE_QV_STATE_NAPI_YIELD;
> +		rc = false;
> +	} else
> +		/* we don't care if someone yielded */
> +		q_vector->state = IXGBE_QV_STATE_NAPI;
> +	spin_unlock(&q_vector->lock);
> +	return rc;
> +}
> +
> +/* returns true is someone tried to get the qv while napi had it */
> +static inline bool ixgbe_qv_unlock_napi(struct ixgbe_q_vector *q_vector)
> +{
> +	int rc = false;

        bool rc = false;


> +	spin_lock(&q_vector->lock);
> +	WARN_ON(q_vector->state & (IXGBE_QV_STATE_POLL |
> +			       IXGBE_QV_STATE_NAPI_YIELD));
> +
> +	if (q_vector->state & IXGBE_QV_STATE_POLL_YIELD)
> +		rc = true;
> +	q_vector->state = IXGBE_QV_STATE_IDLE;
> +	spin_unlock(&q_vector->lock);
> +	return rc;
> +}
> +
> +/* called from ixgbe_low_latency_poll() */
> +static inline bool ixgbe_qv_lock_poll(struct ixgbe_q_vector *q_vector)
> +{
> +	int rc = true;

Ditto.

> +	spin_lock_bh(&q_vector->lock);
> +	if ((q_vector->state & IXGBE_QV_LOCKED)) {
> +		q_vector->state |= IXGBE_QV_STATE_POLL_YIELD;
> +		rc = false;
> +	} else
> +		/* preserve yield marks */
> +		q_vector->state |= IXGBE_QV_STATE_POLL;
> +	spin_unlock_bh(&q_vector->lock);
> +	return rc;
> +}
> +
> +/* returns true if someone tried to get the qv while it was locked */
> +static inline bool ixgbe_qv_unlock_poll(struct ixgbe_q_vector *q_vector)
> +{
> +	int rc = false;

Ditto.

> +	spin_lock_bh(&q_vector->lock);
> +	WARN_ON(q_vector->state & (IXGBE_QV_STATE_NAPI));
> +
> +	if (q_vector->state & IXGBE_QV_STATE_POLL_YIELD)
> +		rc = true;
> +	q_vector->state = IXGBE_QV_STATE_IDLE;
> +	spin_unlock_bh(&q_vector->lock);
> +	return rc;
> +}
> +


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

  reply	other threads:[~2013-06-05  8:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03  8:01 [PATCH v8 net-next 0/7] net: low latency Ethernet device polling Eliezer Tamir
2013-06-03  8:01 ` [PATCH v8 net-next 1/7] net: add napi_id and hash Eliezer Tamir
2013-06-03 12:58   ` Eric Dumazet
2013-06-03  8:01 ` [PATCH v8 net-next 2/7] net: add low latency socket poll Eliezer Tamir
2013-06-03 12:22   ` Amir Vadai
2013-06-03 13:05   ` Eric Dumazet
2013-06-03 13:53     ` Eliezer Tamir
2013-06-03  8:01 ` [PATCH v8 net-next 3/7] udp: add low latency socket poll support Eliezer Tamir
2013-06-03 13:08   ` Eric Dumazet
2013-06-03  8:01 ` [PATCH v8 net-next 4/7] tcp: " Eliezer Tamir
2013-06-03 13:09   ` Eric Dumazet
2013-06-03  8:02 ` [PATCH v8 net-next 5/7] net: simple poll/select low latency socket poll Eliezer Tamir
2013-06-03 13:15   ` Eric Dumazet
2013-06-03 13:59     ` Eliezer Tamir
2013-06-04  8:52       ` Eliezer Tamir
2013-06-03  8:02 ` [PATCH v8 net-next 6/7] ixgbe: add support for ndo_ll_poll Eliezer Tamir
2013-06-05  8:50   ` Cong Wang [this message]
2013-06-03  8:02 ` [PATCH v8 net-next 7/7] ixgbe: add extra stats " Eliezer Tamir
2013-06-03 11:23 ` [PATCH v8 net-next 0/7] net: low latency Ethernet device polling Amir Vadai

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='komu51$jv$1@ger.gmane.org' \
    --to=xiyou.wangcong@gmail.com \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).