@@ -530,15 +530,15 @@ static int fwevtq_handler(struct sge_rspq *q, const __be64 *rsp,
530
530
531
531
txq = q -> adap -> sge .egr_map [qid - q -> adap -> sge .egr_start ];
532
532
txq -> restarts ++ ;
533
- if (( u8 * ) txq < ( u8 * ) q -> adap -> sge . ofldtxq ) {
533
+ if (txq -> q_type == CXGB4_TXQ_ETH ) {
534
534
struct sge_eth_txq * eq ;
535
535
536
536
eq = container_of (txq , struct sge_eth_txq , q );
537
537
netif_tx_wake_queue (eq -> txq );
538
538
} else {
539
- struct sge_ofld_txq * oq ;
539
+ struct sge_uld_txq * oq ;
540
540
541
- oq = container_of (txq , struct sge_ofld_txq , q );
541
+ oq = container_of (txq , struct sge_uld_txq , q );
542
542
tasklet_schedule (& oq -> qresume_tsk );
543
543
}
544
544
} else if (opcode == CPL_FW6_MSG || opcode == CPL_FW4_MSG ) {
@@ -885,15 +885,6 @@ static int setup_sge_queues(struct adapter *adap)
885
885
}
886
886
}
887
887
888
- j = s -> ofldqsets / adap -> params .nports ; /* iscsi queues per channel */
889
- for_each_ofldtxq (s , i ) {
890
- err = t4_sge_alloc_ofld_txq (adap , & s -> ofldtxq [i ],
891
- adap -> port [i / j ],
892
- s -> fw_evtq .cntxt_id );
893
- if (err )
894
- goto freeout ;
895
- }
896
-
897
888
for_each_port (adap , i ) {
898
889
/* Note that cmplqid below is 0 if we don't
899
890
* have RDMA queues, and that's the right value.
@@ -1922,8 +1913,18 @@ static void disable_dbs(struct adapter *adap)
1922
1913
1923
1914
for_each_ethrxq (& adap -> sge , i )
1924
1915
disable_txq_db (& adap -> sge .ethtxq [i ].q );
1925
- for_each_ofldtxq (& adap -> sge , i )
1926
- disable_txq_db (& adap -> sge .ofldtxq [i ].q );
1916
+ if (is_offload (adap )) {
1917
+ struct sge_uld_txq_info * txq_info =
1918
+ adap -> sge .uld_txq_info [CXGB4_TX_OFLD ];
1919
+
1920
+ if (txq_info ) {
1921
+ for_each_ofldtxq (& adap -> sge , i ) {
1922
+ struct sge_uld_txq * txq = & txq_info -> uldtxq [i ];
1923
+
1924
+ disable_txq_db (& txq -> q );
1925
+ }
1926
+ }
1927
+ }
1927
1928
for_each_port (adap , i )
1928
1929
disable_txq_db (& adap -> sge .ctrlq [i ].q );
1929
1930
}
@@ -1934,8 +1935,18 @@ static void enable_dbs(struct adapter *adap)
1934
1935
1935
1936
for_each_ethrxq (& adap -> sge , i )
1936
1937
enable_txq_db (adap , & adap -> sge .ethtxq [i ].q );
1937
- for_each_ofldtxq (& adap -> sge , i )
1938
- enable_txq_db (adap , & adap -> sge .ofldtxq [i ].q );
1938
+ if (is_offload (adap )) {
1939
+ struct sge_uld_txq_info * txq_info =
1940
+ adap -> sge .uld_txq_info [CXGB4_TX_OFLD ];
1941
+
1942
+ if (txq_info ) {
1943
+ for_each_ofldtxq (& adap -> sge , i ) {
1944
+ struct sge_uld_txq * txq = & txq_info -> uldtxq [i ];
1945
+
1946
+ enable_txq_db (adap , & txq -> q );
1947
+ }
1948
+ }
1949
+ }
1939
1950
for_each_port (adap , i )
1940
1951
enable_txq_db (adap , & adap -> sge .ctrlq [i ].q );
1941
1952
}
@@ -2006,8 +2017,17 @@ static void recover_all_queues(struct adapter *adap)
2006
2017
2007
2018
for_each_ethrxq (& adap -> sge , i )
2008
2019
sync_txq_pidx (adap , & adap -> sge .ethtxq [i ].q );
2009
- for_each_ofldtxq (& adap -> sge , i )
2010
- sync_txq_pidx (adap , & adap -> sge .ofldtxq [i ].q );
2020
+ if (is_offload (adap )) {
2021
+ struct sge_uld_txq_info * txq_info =
2022
+ adap -> sge .uld_txq_info [CXGB4_TX_OFLD ];
2023
+ if (txq_info ) {
2024
+ for_each_ofldtxq (& adap -> sge , i ) {
2025
+ struct sge_uld_txq * txq = & txq_info -> uldtxq [i ];
2026
+
2027
+ sync_txq_pidx (adap , & txq -> q );
2028
+ }
2029
+ }
2030
+ }
2011
2031
for_each_port (adap , i )
2012
2032
sync_txq_pidx (adap , & adap -> sge .ctrlq [i ].q );
2013
2033
}
@@ -3991,7 +4011,7 @@ static inline bool is_x_10g_port(const struct link_config *lc)
3991
4011
static void cfg_queues (struct adapter * adap )
3992
4012
{
3993
4013
struct sge * s = & adap -> sge ;
3994
- int i , n10g = 0 , qidx = 0 ;
4014
+ int i = 0 , n10g = 0 , qidx = 0 ;
3995
4015
#ifndef CONFIG_CHELSIO_T4_DCB
3996
4016
int q10g = 0 ;
3997
4017
#endif
@@ -4006,8 +4026,7 @@ static void cfg_queues(struct adapter *adap)
4006
4026
adap -> params .crypto = 0 ;
4007
4027
}
4008
4028
4009
- for_each_port (adap , i )
4010
- n10g += is_x_10g_port (& adap2pinfo (adap , i )-> link_cfg );
4029
+ n10g += is_x_10g_port (& adap2pinfo (adap , i )-> link_cfg );
4011
4030
#ifdef CONFIG_CHELSIO_T4_DCB
4012
4031
/* For Data Center Bridging support we need to be able to support up
4013
4032
* to 8 Traffic Priorities; each of which will be assigned to its
@@ -4075,9 +4094,6 @@ static void cfg_queues(struct adapter *adap)
4075
4094
for (i = 0 ; i < ARRAY_SIZE (s -> ctrlq ); i ++ )
4076
4095
s -> ctrlq [i ].q .size = 512 ;
4077
4096
4078
- for (i = 0 ; i < ARRAY_SIZE (s -> ofldtxq ); i ++ )
4079
- s -> ofldtxq [i ].q .size = 1024 ;
4080
-
4081
4097
init_rspq (adap , & s -> fw_evtq , 0 , 1 , 1024 , 64 );
4082
4098
init_rspq (adap , & s -> intrq , 0 , 1 , 512 , 64 );
4083
4099
}
0 commit comments