All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dmitry Kravkov" <dmitry@broadcom.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: "Ariel Elior" <ariele@broadcom.com>,
	"Eilon Greenstein" <eilong@broadcom.com>
Subject: [PATCH v2 net-next 11/12] bnx2x: Remove on-stack napi struct variable
Date: Sun, 13 Nov 2011 14:47:28 +0200	[thread overview]
Message-ID: <1321188449-5822-12-git-send-email-dmitry@broadcom.com> (raw)
In-Reply-To: <1321188449-5822-1-git-send-email-dmitry@broadcom.com>

From: Ariel Elior <ariele@broadcom.com>

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index e9a91a3..13dad92 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -79,19 +79,21 @@ static inline void bnx2x_bz_fp(struct bnx2x *bp, int index)
  * @to:		destination FP index
  *
  * Makes sure the contents of the bp->fp[to].napi is kept
- * intact.
+ * intact. This is done by first copying the napi struct from
+ * the target to the source, and then mem copying the entire
+ * source onto the target
  */
 static inline void bnx2x_move_fp(struct bnx2x *bp, int from, int to)
 {
 	struct bnx2x_fastpath *from_fp = &bp->fp[from];
 	struct bnx2x_fastpath *to_fp = &bp->fp[to];
-	struct napi_struct orig_napi = to_fp->napi;
+
+	/* Copy the NAPI object as it has been already initialized */
+	from_fp->napi = to_fp->napi;
+
 	/* Move bnx2x_fastpath contents */
 	memcpy(to_fp, from_fp, sizeof(*to_fp));
 	to_fp->index = to;
-
-	/* Restore the NAPI object as it has been already initialized */
-	to_fp->napi = orig_napi;
 }
 
 int load_count[2][3] = { {0} }; /* per-path: 0-common, 1-port0, 2-port1 */
-- 
1.7.7.2

  parent reply	other threads:[~2011-11-13 12:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-13 12:47 [PATCH v2 net-next 00/12] bnx2x series Dmitry Kravkov
2011-11-13 12:47 ` [PATCH v2 net-next 01/12] bnx2x: allow FCoE and DCB for 578xx Dmitry Kravkov
2011-11-13 12:47 ` [PATCH v2 net-next 02/12] bnx2x: use rx_queue index for skb_record_rx_queue() Dmitry Kravkov
2011-11-13 12:47 ` [PATCH v2 net-next 03/12] bnx2x: remove unused variable Dmitry Kravkov
2011-11-13 12:47 ` [PATCH v2 net-next 04/12] bnx2x: separate FCoE and iSCSI license initialization Dmitry Kravkov
2011-11-13 12:47 ` [PATCH v2 net-next 05/12] bnx2x: propagate DCBX negotiation Dmitry Kravkov
2011-11-13 12:47 ` [PATCH v2 net-next 06/12] bnx2x: DCBX: use #define instead of magic Dmitry Kravkov
2011-11-13 12:47 ` [PATCH v2 net-next 07/12] bnx2x: simplify definition of RX_SGE_MASK_LEN and use it Dmitry Kravkov
2011-11-13 13:10   ` Joe Perches
2011-11-13 13:37     ` Dmitry Kravkov
2011-11-13 12:47 ` [PATCH v2 net-next 08/12] bnx2x: remove unused #define Dmitry Kravkov
2011-11-13 12:47 ` [PATCH v2 net-next 09/12] bnx2x: add fan failure event handling Dmitry Kravkov
2011-11-13 12:47 ` [PATCH v2 net-next 10/12] bnx2x: prevent race in statistics flow Dmitry Kravkov
2011-11-13 12:47 ` Dmitry Kravkov [this message]
2011-11-13 12:47 ` [PATCH v2 net-next 12/12] bnx2x: update driver version to 1.70.35-0 Dmitry Kravkov

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=1321188449-5822-12-git-send-email-dmitry@broadcom.com \
    --to=dmitry@broadcom.com \
    --cc=ariele@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=eilong@broadcom.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.