Message ID | 1320163450.11011.19.camel@lb-tlvb-ariel.il.broadcom.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
From: "Ariel Elior" <ariele@broadcom.com> Date: Tue, 1 Nov 2011 18:04:10 +0200 > Napi structure was allocated on stack to hold temporary value of copied > fastpath. This can be avoided by using the source fastpath as a > scratchpad thus saving stack space and code. > Signed-off-by: Ariel Elior <ariele@broadcom.com> > Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Your patch has been severely corrupted by your email client. I'm sure your colleagues at Broadcom can help you fix this so that you can submit this patch properly. :-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index 2890443..ff67d9b 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c @@ -56,19 +56,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; }