Lines Matching refs:qs
725 * @qs: the queue set
730 static void init_qset_cntxt(struct sge_qset *qs, unsigned int id)
732 qs->rspq.cntxt_id = id;
733 qs->fl[0].cntxt_id = 2 * id;
734 qs->fl[1].cntxt_id = 2 * id + 1;
735 qs->txq[TXQ_ETH].cntxt_id = FW_TUNNEL_SGEEC_START + id;
736 qs->txq[TXQ_ETH].token = FW_TUNNEL_TID_START + id;
737 qs->txq[TXQ_OFLD].cntxt_id = FW_OFLD_SGEEC_START + id;
738 qs->txq[TXQ_CTRL].cntxt_id = FW_CTRL_SGEEC_START + id;
739 qs->txq[TXQ_CTRL].token = FW_CTRL_TID_START + id;
1251 struct sge_qset *qs, struct sge_txq *q)
1254 set_bit(TXQ_ETH, &qs->txq_stopped);
1272 struct sge_qset *qs;
1286 qs = &pi->qs[qidx];
1287 q = &qs->txq[TXQ_ETH];
1296 t3_stop_tx_queue(txq, qs, q);
1313 t3_stop_tx_queue(txq, qs, q);
1316 test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
1335 qs->port_stats[SGE_PSTAT_TX_CSUM]++;
1337 qs->port_stats[SGE_PSTAT_TSO]++;
1339 qs->port_stats[SGE_PSTAT_VLANINS]++;
1432 struct sge_qset *qs = txq_to_qset(q, qid);
1434 set_bit(qid, &qs->txq_stopped);
1438 test_and_clear_bit(qid, &qs->txq_stopped))
1528 struct sge_qset *qs = from_tasklet(qs, t, txq[TXQ_CTRL].qresume_tsk);
1529 struct sge_txq *q = &qs->txq[TXQ_CTRL];
1547 set_bit(TXQ_CTRL, &qs->txq_stopped);
1551 test_and_clear_bit(TXQ_CTRL, &qs->txq_stopped))
1558 t3_write_reg(qs->adap, A_SG_KDOORBELL,
1569 ret = ctrl_xmit(adap, &adap->sge.qs[0].txq[TXQ_CTRL], skb);
1746 struct sge_qset *qs = from_tasklet(qs, t, txq[TXQ_OFLD].qresume_tsk);
1747 struct sge_txq *q = &qs->txq[TXQ_OFLD];
1748 const struct port_info *pi = netdev_priv(qs->netdev);
1760 set_bit(TXQ_OFLD, &qs->txq_stopped);
1764 test_and_clear_bit(TXQ_OFLD, &qs->txq_stopped))
1838 struct sge_qset *qs = &adap->sge.qs[queue_set(skb)];
1841 return ctrl_xmit(adap, &qs->txq[TXQ_CTRL], skb);
1843 return ofld_xmit(adap, &qs->txq[TXQ_OFLD], skb);
1862 struct sge_qset *qs = rspq_to_qset(q);
1864 napi_schedule(&qs->napi);
1900 struct sge_qset *qs = container_of(napi, struct sge_qset, napi);
1901 struct sge_rspq *q = &qs->rspq;
1902 struct adapter *adapter = qs->adap;
1982 * @qs: the queue set to resume
1987 static void restart_tx(struct sge_qset *qs)
1989 if (test_bit(TXQ_ETH, &qs->txq_stopped) &&
1990 should_restart_tx(&qs->txq[TXQ_ETH]) &&
1991 test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
1992 qs->txq[TXQ_ETH].restarts++;
1993 if (netif_running(qs->netdev))
1994 netif_tx_wake_queue(qs->tx_q);
1997 if (test_bit(TXQ_OFLD, &qs->txq_stopped) &&
1998 should_restart_tx(&qs->txq[TXQ_OFLD]) &&
1999 test_and_clear_bit(TXQ_OFLD, &qs->txq_stopped)) {
2000 qs->txq[TXQ_OFLD].restarts++;
2001 tasklet_schedule(&qs->txq[TXQ_OFLD].qresume_tsk);
2003 if (test_bit(TXQ_CTRL, &qs->txq_stopped) &&
2004 should_restart_tx(&qs->txq[TXQ_CTRL]) &&
2005 test_and_clear_bit(TXQ_CTRL, &qs->txq_stopped)) {
2006 qs->txq[TXQ_CTRL].restarts++;
2007 tasklet_schedule(&qs->txq[TXQ_CTRL].qresume_tsk);
2086 struct sge_qset *qs = rspq_to_qset(rq);
2094 qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
2098 skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);
2101 qs->port_stats[SGE_PSTAT_VLANEX]++;
2106 napi_gro_receive(&qs->napi, skb);
2124 * @qs: the associated queue set
2132 static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
2136 struct port_info *pi = netdev_priv(qs->netdev);
2143 if (!qs->nomem) {
2144 skb = napi_get_frags(&qs->napi);
2145 qs->nomem = !skb;
2165 qs->nomem = 0;
2174 cpl = qs->lro_va = sd->pg_chunk.va + 2;
2176 if ((qs->netdev->features & NETIF_F_RXCSUM) &&
2179 qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
2183 cpl = qs->lro_va;
2200 skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);
2203 qs->port_stats[SGE_PSTAT_VLANEX]++;
2206 napi_gro_frags(&qs->napi);
2211 * @qs: the queue set corresponding to the response
2218 static inline void handle_rsp_cntrl_info(struct sge_qset *qs, u32 flags)
2224 clear_bit(TXQ_RUNNING, &qs->txq[TXQ_ETH].flags);
2229 qs->txq[TXQ_ETH].processed += credits;
2233 qs->txq[TXQ_CTRL].processed += credits;
2237 clear_bit(TXQ_RUNNING, &qs->txq[TXQ_OFLD].flags);
2241 qs->txq[TXQ_OFLD].processed += credits;
2247 * @qs: the queue set whose Tx queues are to be examined
2254 static void check_ring_db(struct adapter *adap, struct sge_qset *qs,
2258 struct sge_txq *txq = &qs->txq[TXQ_ETH];
2269 struct sge_txq *txq = &qs->txq[TXQ_OFLD];
2312 * @qs: the queue set to which the response queue belongs
2324 static int process_responses(struct adapter *adap, struct sge_qset *qs,
2327 struct sge_rspq *q = &qs->rspq;
2338 int lro = !!(qs->netdev->features & NETIF_F_GRO);
2375 fl = (len & F_RSPD_FLQ) ? &qs->fl[1] : &qs->fl[0];
2382 lro_add_page(adap, qs, fl,
2410 handle_rsp_cntrl_info(qs, flags);
2452 check_ring_db(adap, qs, sleeping);
2455 if (unlikely(qs->txq_stopped != 0))
2456 restart_tx(qs);
2478 struct sge_qset *qs = container_of(napi, struct sge_qset, napi);
2479 struct adapter *adap = qs->adap;
2480 int work_done = process_responses(adap, qs, budget);
2499 t3_write_reg(adap, A_SG_GTS, V_RSPQ(qs->rspq.cntxt_id) |
2500 V_NEWTIMER(qs->rspq.next_holdoff) |
2501 V_NEWINDEX(qs->rspq.cidx));
2517 * @qs: the queue set owning the response queue
2528 static int process_pure_responses(struct adapter *adap, struct sge_qset *qs,
2531 struct sge_rspq *q = &qs->rspq;
2547 handle_rsp_cntrl_info(qs, flags);
2561 check_ring_db(adap, qs, sleeping);
2564 if (unlikely(qs->txq_stopped != 0))
2565 restart_tx(qs);
2587 struct sge_qset *qs = rspq_to_qset(q);
2593 if (is_pure_response(r) && process_pure_responses(adap, qs, r) == 0) {
2598 napi_schedule(&qs->napi);
2608 struct sge_qset *qs = cookie;
2609 struct adapter *adap = qs->adap;
2610 struct sge_rspq *q = &qs->rspq;
2613 if (process_responses(adap, qs, -1) == 0)
2627 struct sge_qset *qs = cookie;
2628 struct sge_rspq *q = &qs->rspq;
2632 if (handle_responses(qs->adap, q) < 0)
2648 struct sge_rspq *q = &adap->sge.qs[0].rspq;
2652 if (process_responses(adap, &adap->sge.qs[0], -1)) {
2659 process_responses(adap, &adap->sge.qs[1], -1)) {
2660 struct sge_rspq *q1 = &adap->sge.qs[1].rspq;
2675 static int rspq_check_napi(struct sge_qset *qs)
2677 struct sge_rspq *q = &qs->rspq;
2679 if (!napi_is_scheduled(&qs->napi) &&
2681 napi_schedule(&qs->napi);
2698 struct sge_rspq *q = &adap->sge.qs[0].rspq;
2702 new_packets = rspq_check_napi(&adap->sge.qs[0]);
2704 new_packets += rspq_check_napi(&adap->sge.qs[1]);
2736 struct sge_rspq *q0 = &adap->sge.qs[0].rspq;
2737 struct sge_rspq *q1 = &adap->sge.qs[1].rspq;
2774 struct sge_rspq *q0 = &adap->sge.qs[0].rspq;
2791 process_responses_gts(adap, &adap->sge.qs[1].rspq);
2808 struct sge_qset *qs0 = &adap->sge.qs[0];
2826 napi_schedule(&adap->sge.qs[1].napi);
2924 struct sge_qset *qs = from_timer(qs, t, tx_reclaim_timer);
2925 struct port_info *pi = netdev_priv(qs->netdev);
2930 if (__netif_tx_trylock(qs->tx_q)) {
2931 tbd[TXQ_ETH] = reclaim_completed_tx(adap, &qs->txq[TXQ_ETH],
2933 __netif_tx_unlock(qs->tx_q);
2936 if (spin_trylock(&qs->txq[TXQ_OFLD].lock)) {
2937 tbd[TXQ_OFLD] = reclaim_completed_tx(adap, &qs->txq[TXQ_OFLD],
2939 spin_unlock(&qs->txq[TXQ_OFLD].lock);
2945 mod_timer(&qs->tx_reclaim_timer, jiffies + next_period);
2965 struct sge_qset *qs = from_timer(qs, t, rx_reclaim_timer);
2966 struct port_info *pi = netdev_priv(qs->netdev);
2971 &qs->rspq.lock : &adap->sge.qs[0].rspq.lock;
2976 if (napi_is_scheduled(&qs->napi))
2982 if (status & (1 << qs->rspq.cntxt_id)) {
2983 qs->rspq.starved++;
2984 if (qs->rspq.credits) {
2985 qs->rspq.credits--;
2986 refill_rspq(adap, &qs->rspq, 1);
2987 qs->rspq.restarted++;
2989 1 << qs->rspq.cntxt_id);
2994 if (qs->fl[0].credits < qs->fl[0].size)
2995 __refill_fl(adap, &qs->fl[0]);
2996 if (qs->fl[1].credits < qs->fl[1].size)
2997 __refill_fl(adap, &qs->fl[1]);
3002 mod_timer(&qs->rx_reclaim_timer, jiffies + RX_RECLAIM_PERIOD);
3007 * @qs: the SGE queue set
3013 void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p)
3015 qs->rspq.holdoff_tmr = max(p->coalesce_usecs * 10, 1U);/* can't be 0 */
3016 qs->rspq.polling = p->polling;
3017 qs->napi.poll = p->polling ? napi_rx_handler : ofld_poll;
3042 struct sge_qset *q = &adapter->sge.qs[id];
3215 struct sge_qset *q = &adap->sge.qs[i];
3238 struct sge_qset *q = &adap->sge.qs[i];
3258 t3_free_qset(adap, &adap->sge.qs[i]);
3304 struct sge_qset *qs = &adap->sge.qs[i];
3306 tasklet_kill(&qs->txq[TXQ_OFLD].qresume_tsk);
3307 tasklet_kill(&qs->txq[TXQ_CTRL].qresume_tsk);