int lro_frag_len;
void *lro_va;
struct net_device *netdev;
+ struct netdev_queue *tx_q; /* associated netdev TX queue */
unsigned long txq_stopped; /* which Tx queues are stopped */
struct timer_list tx_reclaim_timer; /* reclaims TX buffers */
unsigned long port_stats[SGE_PSTAT_MAX];
void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p);
int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports,
int irq_vec_idx, const struct qset_params *p,
- int ntxq, struct net_device *dev);
+ int ntxq, struct net_device *dev,
+ struct netdev_queue *netdevq);
int t3_get_desc(const struct sge_qset *qs, unsigned int qnum, unsigned int idx,
unsigned char *data);
irqreturn_t t3_sge_intr_msix(int irq, void *cookie);
err = t3_sge_alloc_qset(adap, qset_idx, 1,
(adap->flags & USING_MSIX) ? qset_idx + 1 :
irq_idx,
- &adap->params.sge.qset[qset_idx], ntxq, dev);
+ &adap->params.sge.qset[qset_idx], ntxq, dev,
+ netdev_get_tx_queue(dev, j));
if (err) {
t3_stop_sge_timers(adap);
t3_free_sge_resources(adap);
"Could not initialize offload capabilities\n");
}
+ dev->real_num_tx_queues = pi->nqsets;
link_start(dev);
t3_port_intr_enable(adapter, pi->port_id);
- netif_start_queue(dev);
+ netif_tx_start_all_queues(dev);
if (!other_ports)
schedule_chk_task(adapter);
struct adapter *adapter = pi->adapter;
t3_port_intr_disable(adapter, pi->port_id);
- netif_stop_queue(dev);
+ netif_tx_stop_all_queues(dev);
pi->phy.ops->power_down(&pi->phy, 1);
netif_carrier_off(dev);
t3_mac_disable(&pi->mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX);
for (i = 0; i < ai->nports; ++i) {
struct net_device *netdev;
- netdev = alloc_etherdev(sizeof(struct port_info));
+ netdev = alloc_etherdev_mq(sizeof(struct port_info), SGE_QSETS);
if (!netdev) {
err = -ENOMEM;
goto out_free_dev;
pi->rx_csum_offload = 1;
pi->port_id = i;
netif_carrier_off(netdev);
+ netif_tx_stop_all_queues(netdev);
netdev->irq = pdev->irq;
netdev->mem_start = mmio_start;
netdev->mem_end = mmio_start + mmio_len - 1;
htonl(V_WR_TID(q->token)));
}
-static inline void t3_stop_queue(struct net_device *dev, struct sge_qset *qs,
- struct sge_txq *q)
+static inline void t3_stop_tx_queue(struct netdev_queue *txq,
+ struct sge_qset *qs, struct sge_txq *q)
{
- netif_stop_queue(dev);
+ netif_tx_stop_queue(txq);
set_bit(TXQ_ETH, &qs->txq_stopped);
q->stops++;
}
*/
int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev)
{
+ int qidx;
unsigned int ndesc, pidx, credits, gen, compl;
const struct port_info *pi = netdev_priv(dev);
struct adapter *adap = pi->adapter;
- struct sge_qset *qs = pi->qs;
- struct sge_txq *q = &qs->txq[TXQ_ETH];
+ struct netdev_queue *txq;
+ struct sge_qset *qs;
+ struct sge_txq *q;
/*
* The chip min packet length is 9 octets but play safe and reject
return NETDEV_TX_OK;
}
+ qidx = skb_get_queue_mapping(skb);
+ qs = &pi->qs[qidx];
+ q = &qs->txq[TXQ_ETH];
+ txq = netdev_get_tx_queue(dev, qidx);
+
spin_lock(&q->lock);
reclaim_completed_tx(adap, q);
ndesc = calc_tx_descs(skb);
if (unlikely(credits < ndesc)) {
- t3_stop_queue(dev, qs, q);
+ t3_stop_tx_queue(txq, qs, q);
dev_err(&adap->pdev->dev,
"%s: Tx ring %u full while queue awake!\n",
dev->name, q->cntxt_id & 7);
q->in_use += ndesc;
if (unlikely(credits - ndesc < q->stop_thres)) {
- t3_stop_queue(dev, qs, q);
+ t3_stop_tx_queue(txq, qs, q);
if (should_restart_tx(q) &&
test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
q->restarts++;
- netif_wake_queue(dev);
+ netif_tx_wake_queue(txq);
}
}
test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
qs->txq[TXQ_ETH].restarts++;
if (netif_running(qs->netdev))
- netif_wake_queue(qs->netdev);
+ netif_tx_wake_queue(qs->tx_q);
}
if (test_bit(TXQ_OFLD, &qs->txq_stopped) &&
* @p: configuration parameters for this queue set
* @ntxq: number of Tx queues for the queue set
* @netdev: net device associated with this queue set
+ * @netdevq: net device TX queue associated with this queue set
*
* Allocate resources and initialize an SGE queue set. A queue set
* comprises a response queue, two Rx free-buffer queues, and up to 3
*/
int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports,
int irq_vec_idx, const struct qset_params *p,
- int ntxq, struct net_device *dev)
+ int ntxq, struct net_device *dev,
+ struct netdev_queue *netdevq)
{
int i, avail, ret = -ENOMEM;
struct sge_qset *q = &adapter->sge.qs[id];
q->adap = adapter;
q->netdev = dev;
+ q->tx_q = netdevq;
t3_update_qset_coalesce(q, p);
init_lro_mgr(q, lro_mgr);