Lines Matching full:qs
721 * @qs: the queue set
726 static void init_qset_cntxt(struct sge_qset *qs, unsigned int id) in init_qset_cntxt() argument
728 qs->rspq.cntxt_id = id; in init_qset_cntxt()
729 qs->fl[0].cntxt_id = 2 * id; in init_qset_cntxt()
730 qs->fl[1].cntxt_id = 2 * id + 1; in init_qset_cntxt()
731 qs->txq[TXQ_ETH].cntxt_id = FW_TUNNEL_SGEEC_START + id; in init_qset_cntxt()
732 qs->txq[TXQ_ETH].token = FW_TUNNEL_TID_START + id; in init_qset_cntxt()
733 qs->txq[TXQ_OFLD].cntxt_id = FW_OFLD_SGEEC_START + id; in init_qset_cntxt()
734 qs->txq[TXQ_CTRL].cntxt_id = FW_CTRL_SGEEC_START + id; in init_qset_cntxt()
735 qs->txq[TXQ_CTRL].token = FW_CTRL_TID_START + id; in init_qset_cntxt()
1246 struct sge_qset *qs, struct sge_txq *q) in t3_stop_tx_queue() argument
1249 set_bit(TXQ_ETH, &qs->txq_stopped); in t3_stop_tx_queue()
1267 struct sge_qset *qs; in t3_eth_xmit() local
1281 qs = &pi->qs[qidx]; in t3_eth_xmit()
1282 q = &qs->txq[TXQ_ETH]; in t3_eth_xmit()
1291 t3_stop_tx_queue(txq, qs, q); in t3_eth_xmit()
1308 t3_stop_tx_queue(txq, qs, q); in t3_eth_xmit()
1311 test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) { in t3_eth_xmit()
1330 qs->port_stats[SGE_PSTAT_TX_CSUM]++; in t3_eth_xmit()
1332 qs->port_stats[SGE_PSTAT_TSO]++; in t3_eth_xmit()
1334 qs->port_stats[SGE_PSTAT_VLANINS]++; in t3_eth_xmit()
1427 struct sge_qset *qs = txq_to_qset(q, qid); in check_desc_avail() local
1429 set_bit(qid, &qs->txq_stopped); in check_desc_avail()
1433 test_and_clear_bit(qid, &qs->txq_stopped)) in check_desc_avail()
1523 struct sge_qset *qs = container_of(w, struct sge_qset, in restart_ctrlq() local
1525 struct sge_txq *q = &qs->txq[TXQ_CTRL]; in restart_ctrlq()
1543 set_bit(TXQ_CTRL, &qs->txq_stopped); in restart_ctrlq()
1547 test_and_clear_bit(TXQ_CTRL, &qs->txq_stopped)) in restart_ctrlq()
1554 t3_write_reg(qs->adap, A_SG_KDOORBELL, in restart_ctrlq()
1565 ret = ctrl_xmit(adap, &adap->sge.qs[0].txq[TXQ_CTRL], skb); in t3_mgmt_tx()
1743 struct sge_qset *qs = container_of(w, struct sge_qset, in restart_offloadq() local
1745 struct sge_txq *q = &qs->txq[TXQ_OFLD]; in restart_offloadq()
1746 const struct port_info *pi = netdev_priv(qs->netdev); in restart_offloadq()
1758 set_bit(TXQ_OFLD, &qs->txq_stopped); in restart_offloadq()
1762 test_and_clear_bit(TXQ_OFLD, &qs->txq_stopped)) in restart_offloadq()
1836 struct sge_qset *qs = &adap->sge.qs[queue_set(skb)]; in t3_offload_tx() local
1839 return ctrl_xmit(adap, &qs->txq[TXQ_CTRL], skb); in t3_offload_tx()
1841 return ofld_xmit(adap, &qs->txq[TXQ_OFLD], skb); in t3_offload_tx()
1860 struct sge_qset *qs = rspq_to_qset(q); in offload_enqueue() local
1862 napi_schedule(&qs->napi); in offload_enqueue()
1898 struct sge_qset *qs = container_of(napi, struct sge_qset, napi); in ofld_poll() local
1899 struct sge_rspq *q = &qs->rspq; in ofld_poll()
1900 struct adapter *adapter = qs->adap; in ofld_poll()
1980 * @qs: the queue set to resume
1985 static void restart_tx(struct sge_qset *qs) in restart_tx() argument
1987 if (test_bit(TXQ_ETH, &qs->txq_stopped) && in restart_tx()
1988 should_restart_tx(&qs->txq[TXQ_ETH]) && in restart_tx()
1989 test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) { in restart_tx()
1990 qs->txq[TXQ_ETH].restarts++; in restart_tx()
1991 if (netif_running(qs->netdev)) in restart_tx()
1992 netif_tx_wake_queue(qs->tx_q); in restart_tx()
1995 if (test_bit(TXQ_OFLD, &qs->txq_stopped) && in restart_tx()
1996 should_restart_tx(&qs->txq[TXQ_OFLD]) && in restart_tx()
1997 test_and_clear_bit(TXQ_OFLD, &qs->txq_stopped)) { in restart_tx()
1998 qs->txq[TXQ_OFLD].restarts++; in restart_tx()
2001 queue_work(cxgb3_wq, &qs->txq[TXQ_OFLD].qresume_task); in restart_tx()
2003 if (test_bit(TXQ_CTRL, &qs->txq_stopped) && in restart_tx()
2004 should_restart_tx(&qs->txq[TXQ_CTRL]) && in restart_tx()
2005 test_and_clear_bit(TXQ_CTRL, &qs->txq_stopped)) { in restart_tx()
2006 qs->txq[TXQ_CTRL].restarts++; in restart_tx()
2009 queue_work(cxgb3_wq, &qs->txq[TXQ_CTRL].qresume_task); in restart_tx()
2088 struct sge_qset *qs = rspq_to_qset(rq); in rx_eth() local
2096 qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++; in rx_eth()
2100 skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]); in rx_eth()
2103 qs->port_stats[SGE_PSTAT_VLANEX]++; in rx_eth()
2108 napi_gro_receive(&qs->napi, skb); in rx_eth()
2126 * @qs: the associated queue set
2134 static void lro_add_page(struct adapter *adap, struct sge_qset *qs, in lro_add_page() argument
2138 struct port_info *pi = netdev_priv(qs->netdev); in lro_add_page()
2145 if (!qs->nomem) { in lro_add_page()
2146 skb = napi_get_frags(&qs->napi); in lro_add_page()
2147 qs->nomem = !skb; in lro_add_page()
2164 qs->nomem = 0; in lro_add_page()
2173 cpl = qs->lro_va = sd->pg_chunk.va + 2; in lro_add_page()
2175 if ((qs->netdev->features & NETIF_F_RXCSUM) && in lro_add_page()
2178 qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++; in lro_add_page()
2182 cpl = qs->lro_va; in lro_add_page()
2198 skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]); in lro_add_page()
2201 qs->port_stats[SGE_PSTAT_VLANEX]++; in lro_add_page()
2204 napi_gro_frags(&qs->napi); in lro_add_page()
2209 * @qs: the queue set corresponding to the response
2216 static inline void handle_rsp_cntrl_info(struct sge_qset *qs, u32 flags) in handle_rsp_cntrl_info() argument
2222 clear_bit(TXQ_RUNNING, &qs->txq[TXQ_ETH].flags); in handle_rsp_cntrl_info()
2227 qs->txq[TXQ_ETH].processed += credits; in handle_rsp_cntrl_info()
2231 qs->txq[TXQ_CTRL].processed += credits; in handle_rsp_cntrl_info()
2235 clear_bit(TXQ_RUNNING, &qs->txq[TXQ_OFLD].flags); in handle_rsp_cntrl_info()
2239 qs->txq[TXQ_OFLD].processed += credits; in handle_rsp_cntrl_info()
2245 * @qs: the queue set whose Tx queues are to be examined
2252 static void check_ring_db(struct adapter *adap, struct sge_qset *qs, in check_ring_db() argument
2256 struct sge_txq *txq = &qs->txq[TXQ_ETH]; in check_ring_db()
2267 struct sge_txq *txq = &qs->txq[TXQ_OFLD]; in check_ring_db()
2310 * @qs: the queue set to which the response queue belongs
2322 static int process_responses(struct adapter *adap, struct sge_qset *qs, in process_responses() argument
2325 struct sge_rspq *q = &qs->rspq; in process_responses()
2336 int lro = !!(qs->netdev->features & NETIF_F_GRO); in process_responses()
2373 fl = (len & F_RSPD_FLQ) ? &qs->fl[1] : &qs->fl[0]; in process_responses()
2380 lro_add_page(adap, qs, fl, in process_responses()
2408 handle_rsp_cntrl_info(qs, flags); in process_responses()
2450 check_ring_db(adap, qs, sleeping); in process_responses()
2453 if (unlikely(qs->txq_stopped != 0)) in process_responses()
2454 restart_tx(qs); in process_responses()
2476 struct sge_qset *qs = container_of(napi, struct sge_qset, napi); in napi_rx_handler() local
2477 struct adapter *adap = qs->adap; in napi_rx_handler()
2478 int work_done = process_responses(adap, qs, budget); in napi_rx_handler()
2497 t3_write_reg(adap, A_SG_GTS, V_RSPQ(qs->rspq.cntxt_id) | in napi_rx_handler()
2498 V_NEWTIMER(qs->rspq.next_holdoff) | in napi_rx_handler()
2499 V_NEWINDEX(qs->rspq.cidx)); in napi_rx_handler()
2507 * @qs: the queue set owning the response queue
2518 static int process_pure_responses(struct adapter *adap, struct sge_qset *qs, in process_pure_responses() argument
2521 struct sge_rspq *q = &qs->rspq; in process_pure_responses()
2537 handle_rsp_cntrl_info(qs, flags); in process_pure_responses()
2551 check_ring_db(adap, qs, sleeping); in process_pure_responses()
2554 if (unlikely(qs->txq_stopped != 0)) in process_pure_responses()
2555 restart_tx(qs); in process_pure_responses()
2577 struct sge_qset *qs = rspq_to_qset(q); in handle_responses() local
2583 if (is_pure_response(r) && process_pure_responses(adap, qs, r) == 0) { in handle_responses()
2588 napi_schedule(&qs->napi); in handle_responses()
2598 struct sge_qset *qs = cookie; in t3_sge_intr_msix() local
2599 struct adapter *adap = qs->adap; in t3_sge_intr_msix()
2600 struct sge_rspq *q = &qs->rspq; in t3_sge_intr_msix()
2603 if (process_responses(adap, qs, -1) == 0) in t3_sge_intr_msix()
2617 struct sge_qset *qs = cookie; in t3_sge_intr_msix_napi() local
2618 struct sge_rspq *q = &qs->rspq; in t3_sge_intr_msix_napi()
2622 if (handle_responses(qs->adap, q) < 0) in t3_sge_intr_msix_napi()
2638 struct sge_rspq *q = &adap->sge.qs[0].rspq; in t3_intr_msi()
2642 if (process_responses(adap, &adap->sge.qs[0], -1)) { in t3_intr_msi()
2649 process_responses(adap, &adap->sge.qs[1], -1)) { in t3_intr_msi()
2650 struct sge_rspq *q1 = &adap->sge.qs[1].rspq; in t3_intr_msi()
2665 static int rspq_check_napi(struct sge_qset *qs) in rspq_check_napi() argument
2667 struct sge_rspq *q = &qs->rspq; in rspq_check_napi()
2669 return is_new_response(&q->desc[q->cidx], q) && napi_schedule(&qs->napi); in rspq_check_napi()
2683 struct sge_rspq *q = &adap->sge.qs[0].rspq; in t3_intr_msi_napi()
2687 new_packets = rspq_check_napi(&adap->sge.qs[0]); in t3_intr_msi_napi()
2689 new_packets += rspq_check_napi(&adap->sge.qs[1]); in t3_intr_msi_napi()
2721 struct sge_rspq *q0 = &adap->sge.qs[0].rspq; in t3_intr()
2722 struct sge_rspq *q1 = &adap->sge.qs[1].rspq; in t3_intr()
2759 struct sge_rspq *q0 = &adap->sge.qs[0].rspq; in t3b_intr()
2776 process_responses_gts(adap, &adap->sge.qs[1].rspq); in t3b_intr()
2793 struct sge_qset *qs0 = &adap->sge.qs[0]; in t3b_intr_napi()
2811 napi_schedule(&adap->sge.qs[1].napi); in t3b_intr_napi()
2909 struct sge_qset *qs = from_timer(qs, t, tx_reclaim_timer); in sge_timer_tx() local
2910 struct port_info *pi = netdev_priv(qs->netdev); in sge_timer_tx()
2915 if (__netif_tx_trylock(qs->tx_q)) { in sge_timer_tx()
2916 tbd[TXQ_ETH] = reclaim_completed_tx(adap, &qs->txq[TXQ_ETH], in sge_timer_tx()
2918 __netif_tx_unlock(qs->tx_q); in sge_timer_tx()
2921 if (spin_trylock(&qs->txq[TXQ_OFLD].lock)) { in sge_timer_tx()
2922 tbd[TXQ_OFLD] = reclaim_completed_tx(adap, &qs->txq[TXQ_OFLD], in sge_timer_tx()
2924 spin_unlock(&qs->txq[TXQ_OFLD].lock); in sge_timer_tx()
2930 mod_timer(&qs->tx_reclaim_timer, jiffies + next_period); in sge_timer_tx()
2950 struct sge_qset *qs = from_timer(qs, t, rx_reclaim_timer); in sge_timer_rx() local
2951 struct port_info *pi = netdev_priv(qs->netdev); in sge_timer_rx()
2956 &qs->rspq.lock : &adap->sge.qs[0].rspq.lock; in sge_timer_rx()
2961 if (napi_is_scheduled(&qs->napi)) in sge_timer_rx()
2967 if (status & (1 << qs->rspq.cntxt_id)) { in sge_timer_rx()
2968 qs->rspq.starved++; in sge_timer_rx()
2969 if (qs->rspq.credits) { in sge_timer_rx()
2970 qs->rspq.credits--; in sge_timer_rx()
2971 refill_rspq(adap, &qs->rspq, 1); in sge_timer_rx()
2972 qs->rspq.restarted++; in sge_timer_rx()
2974 1 << qs->rspq.cntxt_id); in sge_timer_rx()
2979 if (qs->fl[0].credits < qs->fl[0].size) in sge_timer_rx()
2980 __refill_fl(adap, &qs->fl[0]); in sge_timer_rx()
2981 if (qs->fl[1].credits < qs->fl[1].size) in sge_timer_rx()
2982 __refill_fl(adap, &qs->fl[1]); in sge_timer_rx()
2987 mod_timer(&qs->rx_reclaim_timer, jiffies + RX_RECLAIM_PERIOD); in sge_timer_rx()
2992 * @qs: the SGE queue set
2998 void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p) in t3_update_qset_coalesce() argument
3000 qs->rspq.holdoff_tmr = max(p->coalesce_usecs * 10, 1U);/* can't be 0 */ in t3_update_qset_coalesce()
3001 qs->rspq.polling = p->polling; in t3_update_qset_coalesce()
3002 qs->napi.poll = p->polling ? napi_rx_handler : ofld_poll; in t3_update_qset_coalesce()
3027 struct sge_qset *q = &adapter->sge.qs[id]; in t3_sge_alloc_qset()
3200 struct sge_qset *q = &adap->sge.qs[i]; in t3_start_sge_timers()
3223 struct sge_qset *q = &adap->sge.qs[i]; in t3_stop_sge_timers()
3243 t3_free_qset(adap, &adap->sge.qs[i]); in t3_free_sge_resources()
3292 struct sge_qset *qs = &adap->sge.qs[i]; in t3_sge_stop() local
3294 cancel_work_sync(&qs->txq[TXQ_OFLD].qresume_task); in t3_sge_stop()
3295 cancel_work_sync(&qs->txq[TXQ_CTRL].qresume_task); in t3_sge_stop()