bnx2x: don't write dcb/llfc fields in STORM memory
authorDmitry Kravkov <dmitry@broadcom.com>
Fri, 1 Apr 2011 00:04:01 +0000 (17:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Apr 2011 00:04:01 +0000 (17:04 -0700)
We could get hardware attention during DCB/FCoE traffic without this
fix.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2x/bnx2x_cmn.h

index ef37b98d614694ebb972046c52a253fe28e7d846..775fef031ad89d2bb39b6f5402c896c8281e3c2d 100644 (file)
@@ -1041,12 +1041,23 @@ static inline void storm_memset_cmng(struct bnx2x *bp,
                                struct cmng_struct_per_port *cmng,
                                u8 port)
 {
-       size_t size = sizeof(struct cmng_struct_per_port);
+       size_t size =
+               sizeof(struct rate_shaping_vars_per_port) +
+               sizeof(struct fairness_vars_per_port) +
+               sizeof(struct safc_struct_per_port) +
+               sizeof(struct pfc_struct_per_port);
 
        u32 addr = BAR_XSTRORM_INTMEM +
                        XSTORM_CMNG_PER_PORT_VARS_OFFSET(port);
 
        __storm_memset_struct(bp, addr, size, (u32 *)cmng);
+
+       addr += size + 4 /* SKIP DCB+LLFC */;
+       size = sizeof(struct cmng_struct_per_port) -
+               size /* written */ - 4 /*skipped*/;
+
+       __storm_memset_struct(bp, addr, size,
+                             (u32 *)(cmng->traffic_type_to_priority_cos));
 }
 
 /* HW Lock for shared dual port PHYs */