]> git.karo-electronics.de Git - linux-beck.git/commitdiff
cxgb4: Update Congestion Channel map for T6 adapter
authorHariprasad Shenai <hariprasad@chelsio.com>
Wed, 23 Dec 2015 17:17:15 +0000 (22:47 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Dec 2015 03:34:45 +0000 (22:34 -0500)
Updating Congestion Channel/Priority Map in Congestion Manager Context
for T6. In T6 port 0 is mapped to channel 0 and port 1 is mapped to
channel 1. For 2 port T4/T5 adapter, port 0 is mapped to channel 0,1 and
port 1 is mapped to channel 2,3

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

index c613bd6a609139ac32253e7a4794ec191f1ec900..2f8c736304105bd5e60aa76e858eed8a21f8aa1d 100644 (file)
@@ -5316,7 +5316,14 @@ unsigned int t4_get_mps_bg_map(struct adapter *adap, int idx)
 
        if (n == 0)
                return idx == 0 ? 0xf : 0;
-       if (n == 1)
+       /* In T6 (which is a 2 port card),
+        * port 0 is mapped to channel 0 and port 1 is mapped to channel 1.
+        * For 2 port T4/T5 adapter,
+        * port 0 is mapped to channel 0 and 1,
+        * port 1 is mapped to channel 2 and 3.
+        */
+       if ((n == 1) &&
+           (CHELSIO_CHIP_VERSION(adap->params.chip) <= CHELSIO_T5))
                return idx < 2 ? (3 << (2 * idx)) : 0;
        return 1 << idx;
 }