Commit 80439a17 authored by Mintz, Yuval's avatar Mintz, Yuval Committed by David S. Miller

qede: Remove 'num_tc'.

Driver currently doesn't support multi-CoS, but it contains logic
where multiple transmission queues could be theoretically manipulated.
No point in maintaining the infrastructure at the moment.
Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6d937acf
...@@ -127,10 +127,9 @@ struct qede_dev { ...@@ -127,10 +127,9 @@ struct qede_dev {
const struct qed_eth_ops *ops; const struct qed_eth_ops *ops;
struct qed_dev_eth_info dev_info; struct qed_dev_eth_info dev_info;
#define QEDE_MAX_RSS_CNT(edev) ((edev)->dev_info.num_queues) #define QEDE_MAX_RSS_CNT(edev) ((edev)->dev_info.num_queues)
#define QEDE_MAX_TSS_CNT(edev) ((edev)->dev_info.num_queues * \ #define QEDE_MAX_TSS_CNT(edev) ((edev)->dev_info.num_queues)
(edev)->dev_info.num_tc)
struct qede_fastpath *fp_array; struct qede_fastpath *fp_array;
u8 req_num_tx; u8 req_num_tx;
...@@ -139,17 +138,9 @@ struct qede_dev { ...@@ -139,17 +138,9 @@ struct qede_dev {
u8 fp_num_rx; u8 fp_num_rx;
u16 req_queues; u16 req_queues;
u16 num_queues; u16 num_queues;
u8 num_tc;
#define QEDE_QUEUE_CNT(edev) ((edev)->num_queues) #define QEDE_QUEUE_CNT(edev) ((edev)->num_queues)
#define QEDE_RSS_COUNT(edev) ((edev)->num_queues - (edev)->fp_num_tx) #define QEDE_RSS_COUNT(edev) ((edev)->num_queues - (edev)->fp_num_tx)
#define QEDE_TSS_COUNT(edev) (((edev)->num_queues - (edev)->fp_num_rx) * \ #define QEDE_TSS_COUNT(edev) ((edev)->num_queues - (edev)->fp_num_rx)
(edev)->num_tc)
#define QEDE_TX_IDX(edev, txqidx) ((edev)->fp_num_rx + (txqidx) % \
QEDE_TSS_COUNT(edev))
#define QEDE_TC_IDX(edev, txqidx) ((txqidx) / QEDE_TSS_COUNT(edev))
#define QEDE_TX_QUEUE(edev, txqidx) \
(&(edev)->fp_array[QEDE_TX_IDX((edev), (txqidx))].txqs[QEDE_TC_IDX(\
(edev), (txqidx))])
struct qed_int_info int_info; struct qed_int_info int_info;
unsigned char primary_mac[ETH_ALEN]; unsigned char primary_mac[ETH_ALEN];
...@@ -324,7 +315,7 @@ struct qede_fastpath { ...@@ -324,7 +315,7 @@ struct qede_fastpath {
struct napi_struct napi; struct napi_struct napi;
struct qed_sb_info *sb_info; struct qed_sb_info *sb_info;
struct qede_rx_queue *rxq; struct qede_rx_queue *rxq;
struct qede_tx_queue *txqs; struct qede_tx_queue *txq;
#define VEC_NAME_SIZE (sizeof(((struct net_device *)0)->name) + 8) #define VEC_NAME_SIZE (sizeof(((struct net_device *)0)->name) + 8)
char name[VEC_NAME_SIZE]; char name[VEC_NAME_SIZE];
......
...@@ -59,8 +59,8 @@ static const struct { ...@@ -59,8 +59,8 @@ static const struct {
QEDE_TQSTAT(stopped_cnt), QEDE_TQSTAT(stopped_cnt),
}; };
#define QEDE_TQSTATS_DATA(dev, sindex, tssid, tcid) \ #define QEDE_TQSTATS_DATA(dev, sindex, tssid) \
(*((u64 *)(((void *)(&dev->fp_array[tssid].txqs[tcid])) +\ (*((u64 *)(((void *)((dev)->fp_array[tssid].txq)) + \
qede_tqstats_arr[(sindex)].offset))) qede_tqstats_arr[(sindex)].offset)))
static const struct { static const struct {
...@@ -175,7 +175,6 @@ static void qede_get_strings_stats(struct qede_dev *edev, u8 *buf) ...@@ -175,7 +175,6 @@ static void qede_get_strings_stats(struct qede_dev *edev, u8 *buf)
int i, j, k; int i, j, k;
for (i = 0, k = 0; i < QEDE_QUEUE_CNT(edev); i++) { for (i = 0, k = 0; i < QEDE_QUEUE_CNT(edev); i++) {
int tc;
if (edev->fp_array[i].type & QEDE_FASTPATH_RX) { if (edev->fp_array[i].type & QEDE_FASTPATH_RX) {
for (j = 0; j < QEDE_NUM_RQSTATS; j++) for (j = 0; j < QEDE_NUM_RQSTATS; j++)
...@@ -186,14 +185,12 @@ static void qede_get_strings_stats(struct qede_dev *edev, u8 *buf) ...@@ -186,14 +185,12 @@ static void qede_get_strings_stats(struct qede_dev *edev, u8 *buf)
} }
if (edev->fp_array[i].type & QEDE_FASTPATH_TX) { if (edev->fp_array[i].type & QEDE_FASTPATH_TX) {
for (tc = 0; tc < edev->num_tc; tc++) { for (j = 0; j < QEDE_NUM_TQSTATS; j++)
for (j = 0; j < QEDE_NUM_TQSTATS; j++) sprintf(buf + (k + j) *
sprintf(buf + (k + j) * ETH_GSTRING_LEN,
ETH_GSTRING_LEN, "%d: %s", i,
"%d.%d: %s", i, tc, qede_tqstats_arr[j].string);
qede_tqstats_arr[j].string); k += QEDE_NUM_TQSTATS;
k += QEDE_NUM_TQSTATS;
}
} }
} }
...@@ -240,21 +237,16 @@ static void qede_get_ethtool_stats(struct net_device *dev, ...@@ -240,21 +237,16 @@ static void qede_get_ethtool_stats(struct net_device *dev,
mutex_lock(&edev->qede_lock); mutex_lock(&edev->qede_lock);
for (qid = 0; qid < QEDE_QUEUE_CNT(edev); qid++) { for (qid = 0; qid < QEDE_QUEUE_CNT(edev); qid++) {
int tc;
if (edev->fp_array[qid].type & QEDE_FASTPATH_RX) { if (edev->fp_array[qid].type & QEDE_FASTPATH_RX)
for (sidx = 0; sidx < QEDE_NUM_RQSTATS; sidx++) for (sidx = 0; sidx < QEDE_NUM_RQSTATS; sidx++)
buf[cnt++] = QEDE_RQSTATS_DATA(edev, sidx, qid); buf[cnt++] = QEDE_RQSTATS_DATA(edev, sidx, qid);
}
if (edev->fp_array[qid].type & QEDE_FASTPATH_TX) { if (edev->fp_array[qid].type & QEDE_FASTPATH_TX)
for (tc = 0; tc < edev->num_tc; tc++) { for (sidx = 0; sidx < QEDE_NUM_TQSTATS; sidx++)
for (sidx = 0; sidx < QEDE_NUM_TQSTATS; sidx++) buf[cnt++] = QEDE_TQSTATS_DATA(edev,
buf[cnt++] = QEDE_TQSTATS_DATA(edev, sidx,
sidx, qid);
qid, tc);
}
}
} }
for (sidx = 0; sidx < QEDE_NUM_STATS; sidx++) { for (sidx = 0; sidx < QEDE_NUM_STATS; sidx++) {
...@@ -281,7 +273,7 @@ static int qede_get_sset_count(struct net_device *dev, int stringset) ...@@ -281,7 +273,7 @@ static int qede_get_sset_count(struct net_device *dev, int stringset)
num_stats--; num_stats--;
} }
return num_stats + QEDE_RSS_COUNT(edev) * QEDE_NUM_RQSTATS + return num_stats + QEDE_RSS_COUNT(edev) * QEDE_NUM_RQSTATS +
QEDE_TSS_COUNT(edev) * QEDE_NUM_TQSTATS * edev->num_tc; QEDE_TSS_COUNT(edev) * QEDE_NUM_TQSTATS;
case ETH_SS_PRIV_FLAGS: case ETH_SS_PRIV_FLAGS:
return QEDE_PRI_FLAG_LEN; return QEDE_PRI_FLAG_LEN;
case ETH_SS_TEST: case ETH_SS_TEST:
...@@ -1178,7 +1170,7 @@ static int qede_selftest_transmit_traffic(struct qede_dev *edev, ...@@ -1178,7 +1170,7 @@ static int qede_selftest_transmit_traffic(struct qede_dev *edev,
for_each_queue(i) { for_each_queue(i) {
if (edev->fp_array[i].type & QEDE_FASTPATH_TX) { if (edev->fp_array[i].type & QEDE_FASTPATH_TX) {
txq = edev->fp_array[i].txqs; txq = edev->fp_array[i].txq;
break; break;
} }
} }
......
...@@ -547,7 +547,7 @@ static netdev_tx_t qede_start_xmit(struct sk_buff *skb, ...@@ -547,7 +547,7 @@ static netdev_tx_t qede_start_xmit(struct sk_buff *skb,
/* Get tx-queue context and netdev index */ /* Get tx-queue context and netdev index */
txq_index = skb_get_queue_mapping(skb); txq_index = skb_get_queue_mapping(skb);
WARN_ON(txq_index >= QEDE_TSS_COUNT(edev)); WARN_ON(txq_index >= QEDE_TSS_COUNT(edev));
txq = QEDE_TX_QUEUE(edev, txq_index); txq = edev->fp_array[edev->fp_num_rx + txq_index].txq;
netdev_txq = netdev_get_tx_queue(ndev, txq_index); netdev_txq = netdev_get_tx_queue(ndev, txq_index);
WARN_ON(qed_chain_get_elem_left(&txq->tx_pbl) < (MAX_SKB_FRAGS + 1)); WARN_ON(qed_chain_get_elem_left(&txq->tx_pbl) < (MAX_SKB_FRAGS + 1));
...@@ -881,16 +881,6 @@ bool qede_has_rx_work(struct qede_rx_queue *rxq) ...@@ -881,16 +881,6 @@ bool qede_has_rx_work(struct qede_rx_queue *rxq)
return hw_comp_cons != sw_comp_cons; return hw_comp_cons != sw_comp_cons;
} }
static bool qede_has_tx_work(struct qede_fastpath *fp)
{
u8 tc;
for (tc = 0; tc < fp->edev->num_tc; tc++)
if (qede_txq_has_work(&fp->txqs[tc]))
return true;
return false;
}
static inline void qede_rx_bd_ring_consume(struct qede_rx_queue *rxq) static inline void qede_rx_bd_ring_consume(struct qede_rx_queue *rxq)
{ {
qed_chain_consume(&rxq->rx_bd_ring); qed_chain_consume(&rxq->rx_bd_ring);
...@@ -1633,12 +1623,9 @@ static int qede_poll(struct napi_struct *napi, int budget) ...@@ -1633,12 +1623,9 @@ static int qede_poll(struct napi_struct *napi, int budget)
napi); napi);
struct qede_dev *edev = fp->edev; struct qede_dev *edev = fp->edev;
int rx_work_done = 0; int rx_work_done = 0;
u8 tc;
for (tc = 0; tc < edev->num_tc; tc++) if (likely(fp->type & QEDE_FASTPATH_TX) && qede_txq_has_work(fp->txq))
if (likely(fp->type & QEDE_FASTPATH_TX) && qede_tx_int(edev, fp->txq);
qede_txq_has_work(&fp->txqs[tc]))
qede_tx_int(edev, &fp->txqs[tc]);
rx_work_done = (likely(fp->type & QEDE_FASTPATH_RX) && rx_work_done = (likely(fp->type & QEDE_FASTPATH_RX) &&
qede_has_rx_work(fp->rxq)) ? qede_has_rx_work(fp->rxq)) ?
...@@ -1664,7 +1651,7 @@ static int qede_poll(struct napi_struct *napi, int budget) ...@@ -1664,7 +1651,7 @@ static int qede_poll(struct napi_struct *napi, int budget)
if (!((likely(fp->type & QEDE_FASTPATH_RX) && if (!((likely(fp->type & QEDE_FASTPATH_RX) &&
qede_has_rx_work(fp->rxq)) || qede_has_rx_work(fp->rxq)) ||
(likely(fp->type & QEDE_FASTPATH_TX) && (likely(fp->type & QEDE_FASTPATH_TX) &&
qede_has_tx_work(fp)))) { qede_txq_has_work(fp->txq)))) {
napi_complete(napi); napi_complete(napi);
/* Update and reenable interrupts */ /* Update and reenable interrupts */
...@@ -2330,8 +2317,6 @@ static struct qede_dev *qede_alloc_etherdev(struct qed_dev *cdev, ...@@ -2330,8 +2317,6 @@ static struct qede_dev *qede_alloc_etherdev(struct qed_dev *cdev,
memset(&edev->stats, 0, sizeof(edev->stats)); memset(&edev->stats, 0, sizeof(edev->stats));
memcpy(&edev->dev_info, info, sizeof(*info)); memcpy(&edev->dev_info, info, sizeof(*info));
edev->num_tc = edev->dev_info.num_tc;
INIT_LIST_HEAD(&edev->vlan_list); INIT_LIST_HEAD(&edev->vlan_list);
return edev; return edev;
...@@ -2429,7 +2414,7 @@ static void qede_free_fp_array(struct qede_dev *edev) ...@@ -2429,7 +2414,7 @@ static void qede_free_fp_array(struct qede_dev *edev)
kfree(fp->sb_info); kfree(fp->sb_info);
kfree(fp->rxq); kfree(fp->rxq);
kfree(fp->txqs); kfree(fp->txq);
} }
kfree(edev->fp_array); kfree(edev->fp_array);
} }
...@@ -2462,7 +2447,7 @@ static int qede_alloc_fp_array(struct qede_dev *edev) ...@@ -2462,7 +2447,7 @@ static int qede_alloc_fp_array(struct qede_dev *edev)
for_each_queue(i) { for_each_queue(i) {
fp = &edev->fp_array[i]; fp = &edev->fp_array[i];
fp->sb_info = kcalloc(1, sizeof(*fp->sb_info), GFP_KERNEL); fp->sb_info = kzalloc(sizeof(*fp->sb_info), GFP_KERNEL);
if (!fp->sb_info) { if (!fp->sb_info) {
DP_NOTICE(edev, "sb info struct allocation failed\n"); DP_NOTICE(edev, "sb info struct allocation failed\n");
goto err; goto err;
...@@ -2479,22 +2464,15 @@ static int qede_alloc_fp_array(struct qede_dev *edev) ...@@ -2479,22 +2464,15 @@ static int qede_alloc_fp_array(struct qede_dev *edev)
} }
if (fp->type & QEDE_FASTPATH_TX) { if (fp->type & QEDE_FASTPATH_TX) {
fp->txqs = kcalloc(edev->num_tc, sizeof(*fp->txqs), fp->txq = kzalloc(sizeof(*fp->txq), GFP_KERNEL);
GFP_KERNEL); if (!fp->txq)
if (!fp->txqs) {
DP_NOTICE(edev,
"TXQ array allocation failed\n");
goto err; goto err;
}
} }
if (fp->type & QEDE_FASTPATH_RX) { if (fp->type & QEDE_FASTPATH_RX) {
fp->rxq = kcalloc(1, sizeof(*fp->rxq), GFP_KERNEL); fp->rxq = kzalloc(sizeof(*fp->rxq), GFP_KERNEL);
if (!fp->rxq) { if (!fp->rxq)
DP_NOTICE(edev,
"RXQ struct allocation failed\n");
goto err; goto err;
}
} }
} }
...@@ -3031,16 +3009,13 @@ static int qede_alloc_mem_txq(struct qede_dev *edev, struct qede_tx_queue *txq) ...@@ -3031,16 +3009,13 @@ static int qede_alloc_mem_txq(struct qede_dev *edev, struct qede_tx_queue *txq)
/* This function frees all memory of a single fp */ /* This function frees all memory of a single fp */
static void qede_free_mem_fp(struct qede_dev *edev, struct qede_fastpath *fp) static void qede_free_mem_fp(struct qede_dev *edev, struct qede_fastpath *fp)
{ {
int tc;
qede_free_mem_sb(edev, fp->sb_info); qede_free_mem_sb(edev, fp->sb_info);
if (fp->type & QEDE_FASTPATH_RX) if (fp->type & QEDE_FASTPATH_RX)
qede_free_mem_rxq(edev, fp->rxq); qede_free_mem_rxq(edev, fp->rxq);
if (fp->type & QEDE_FASTPATH_TX) if (fp->type & QEDE_FASTPATH_TX)
for (tc = 0; tc < edev->num_tc; tc++) qede_free_mem_txq(edev, fp->txq);
qede_free_mem_txq(edev, &fp->txqs[tc]);
} }
/* This function allocates all memory needed for a single fp (i.e. an entity /* This function allocates all memory needed for a single fp (i.e. an entity
...@@ -3048,7 +3023,7 @@ static void qede_free_mem_fp(struct qede_dev *edev, struct qede_fastpath *fp) ...@@ -3048,7 +3023,7 @@ static void qede_free_mem_fp(struct qede_dev *edev, struct qede_fastpath *fp)
*/ */
static int qede_alloc_mem_fp(struct qede_dev *edev, struct qede_fastpath *fp) static int qede_alloc_mem_fp(struct qede_dev *edev, struct qede_fastpath *fp)
{ {
int rc, tc; int rc;
rc = qede_alloc_mem_sb(edev, fp->sb_info, fp->id); rc = qede_alloc_mem_sb(edev, fp->sb_info, fp->id);
if (rc) if (rc)
...@@ -3061,11 +3036,9 @@ static int qede_alloc_mem_fp(struct qede_dev *edev, struct qede_fastpath *fp) ...@@ -3061,11 +3036,9 @@ static int qede_alloc_mem_fp(struct qede_dev *edev, struct qede_fastpath *fp)
} }
if (fp->type & QEDE_FASTPATH_TX) { if (fp->type & QEDE_FASTPATH_TX) {
for (tc = 0; tc < edev->num_tc; tc++) { rc = qede_alloc_mem_txq(edev, fp->txq);
rc = qede_alloc_mem_txq(edev, &fp->txqs[tc]); if (rc)
if (rc) goto err;
goto err;
}
} }
return 0; return 0;
...@@ -3108,7 +3081,7 @@ static int qede_alloc_mem_load(struct qede_dev *edev) ...@@ -3108,7 +3081,7 @@ static int qede_alloc_mem_load(struct qede_dev *edev)
/* This function inits fp content and resets the SB, RXQ and TXQ structures */ /* This function inits fp content and resets the SB, RXQ and TXQ structures */
static void qede_init_fp(struct qede_dev *edev) static void qede_init_fp(struct qede_dev *edev)
{ {
int queue_id, rxq_index = 0, txq_index = 0, tc; int queue_id, rxq_index = 0, txq_index = 0;
struct qede_fastpath *fp; struct qede_fastpath *fp;
for_each_queue(queue_id) { for_each_queue(queue_id) {
...@@ -3117,25 +3090,15 @@ static void qede_init_fp(struct qede_dev *edev) ...@@ -3117,25 +3090,15 @@ static void qede_init_fp(struct qede_dev *edev)
fp->edev = edev; fp->edev = edev;
fp->id = queue_id; fp->id = queue_id;
memset((void *)&fp->napi, 0, sizeof(fp->napi));
memset((void *)fp->sb_info, 0, sizeof(*fp->sb_info));
if (fp->type & QEDE_FASTPATH_RX) { if (fp->type & QEDE_FASTPATH_RX) {
memset((void *)fp->rxq, 0, sizeof(*fp->rxq));
fp->rxq->rxq_id = rxq_index++; fp->rxq->rxq_id = rxq_index++;
} }
if (fp->type & QEDE_FASTPATH_TX) { if (fp->type & QEDE_FASTPATH_TX) {
memset((void *)fp->txqs, 0, fp->txq->index = txq_index++;
(edev->num_tc * sizeof(*fp->txqs))); if (edev->dev_info.is_legacy)
for (tc = 0; tc < edev->num_tc; tc++) { fp->txq->is_legacy = 1;
fp->txqs[tc].index = txq_index +
tc * QEDE_TSS_COUNT(edev);
if (edev->dev_info.is_legacy)
fp->txqs[tc].is_legacy = true;
}
txq_index++;
} }
snprintf(fp->name, sizeof(fp->name), "%s-fp-%d", snprintf(fp->name, sizeof(fp->name), "%s-fp-%d",
...@@ -3307,7 +3270,8 @@ static int qede_stop_queues(struct qede_dev *edev) ...@@ -3307,7 +3270,8 @@ static int qede_stop_queues(struct qede_dev *edev)
{ {
struct qed_update_vport_params vport_update_params; struct qed_update_vport_params vport_update_params;
struct qed_dev *cdev = edev->cdev; struct qed_dev *cdev = edev->cdev;
int rc, tc, i; struct qede_fastpath *fp;
int rc, i;
/* Disable the vport */ /* Disable the vport */
memset(&vport_update_params, 0, sizeof(vport_update_params)); memset(&vport_update_params, 0, sizeof(vport_update_params));
...@@ -3324,16 +3288,12 @@ static int qede_stop_queues(struct qede_dev *edev) ...@@ -3324,16 +3288,12 @@ static int qede_stop_queues(struct qede_dev *edev)
/* Flush Tx queues. If needed, request drain from MCP */ /* Flush Tx queues. If needed, request drain from MCP */
for_each_queue(i) { for_each_queue(i) {
struct qede_fastpath *fp = &edev->fp_array[i]; fp = &edev->fp_array[i];
if (fp->type & QEDE_FASTPATH_TX) { if (fp->type & QEDE_FASTPATH_TX) {
for (tc = 0; tc < edev->num_tc; tc++) { rc = qede_drain_txq(edev, fp->txq, true);
struct qede_tx_queue *txq = &fp->txqs[tc]; if (rc)
return rc;
rc = qede_drain_txq(edev, txq, true);
if (rc)
return rc;
}
} }
} }
...@@ -3341,29 +3301,24 @@ static int qede_stop_queues(struct qede_dev *edev) ...@@ -3341,29 +3301,24 @@ static int qede_stop_queues(struct qede_dev *edev)
for (i = QEDE_QUEUE_CNT(edev) - 1; i >= 0; i--) { for (i = QEDE_QUEUE_CNT(edev) - 1; i >= 0; i--) {
struct qed_stop_rxq_params rx_params; struct qed_stop_rxq_params rx_params;
fp = &edev->fp_array[i];
/* Stop the Tx Queue(s) */ /* Stop the Tx Queue(s) */
if (edev->fp_array[i].type & QEDE_FASTPATH_TX) { if (fp->type & QEDE_FASTPATH_TX) {
for (tc = 0; tc < edev->num_tc; tc++) { struct qed_stop_txq_params tx_params;
struct qed_stop_txq_params tx_params;
u8 val; tx_params.rss_id = i;
tx_params.tx_queue_id = fp->txq->index;
tx_params.rss_id = i;
val = edev->fp_array[i].txqs[tc].index;
tx_params.tx_queue_id = val;
rc = edev->ops->q_tx_stop(cdev, &tx_params); rc = edev->ops->q_tx_stop(cdev, &tx_params);
if (rc) { if (rc)
DP_ERR(edev, "Failed to stop TXQ #%d\n",
tx_params.tx_queue_id);
return rc; return rc;
}
}
} }
/* Stop the Rx Queue */ /* Stop the Rx Queue */
if (edev->fp_array[i].type & QEDE_FASTPATH_RX) { if (fp->type & QEDE_FASTPATH_RX) {
memset(&rx_params, 0, sizeof(rx_params)); memset(&rx_params, 0, sizeof(rx_params));
rx_params.rss_id = i; rx_params.rss_id = i;
rx_params.rx_queue_id = edev->fp_array[i].rxq->rxq_id; rx_params.rx_queue_id = fp->rxq->rxq_id;
rc = edev->ops->q_rx_stop(cdev, &rx_params); rc = edev->ops->q_rx_stop(cdev, &rx_params);
if (rc) { if (rc) {
...@@ -3383,7 +3338,6 @@ static int qede_stop_queues(struct qede_dev *edev) ...@@ -3383,7 +3338,6 @@ static int qede_stop_queues(struct qede_dev *edev)
static int qede_start_queues(struct qede_dev *edev, bool clear_stats) static int qede_start_queues(struct qede_dev *edev, bool clear_stats)
{ {
int rc, tc, i;
int vlan_removal_en = 1; int vlan_removal_en = 1;
struct qed_dev *cdev = edev->cdev; struct qed_dev *cdev = edev->cdev;
struct qed_update_vport_params vport_update_params; struct qed_update_vport_params vport_update_params;
...@@ -3391,6 +3345,7 @@ static int qede_start_queues(struct qede_dev *edev, bool clear_stats) ...@@ -3391,6 +3345,7 @@ static int qede_start_queues(struct qede_dev *edev, bool clear_stats)
struct qed_dev_info *qed_info = &edev->dev_info.common; struct qed_dev_info *qed_info = &edev->dev_info.common;
struct qed_start_vport_params start = {0}; struct qed_start_vport_params start = {0};
bool reset_rss_indir = false; bool reset_rss_indir = false;
int rc, i;
if (!edev->num_queues) { if (!edev->num_queues) {
DP_ERR(edev, DP_ERR(edev,
...@@ -3454,11 +3409,8 @@ static int qede_start_queues(struct qede_dev *edev, bool clear_stats) ...@@ -3454,11 +3409,8 @@ static int qede_start_queues(struct qede_dev *edev, bool clear_stats)
qede_update_rx_prod(edev, rxq); qede_update_rx_prod(edev, rxq);
} }
if (!(fp->type & QEDE_FASTPATH_TX)) if (fp->type & QEDE_FASTPATH_TX) {
continue; struct qede_tx_queue *txq = fp->txq;
for (tc = 0; tc < edev->num_tc; tc++) {
struct qede_tx_queue *txq = &fp->txqs[tc];
p_phys_table = qed_chain_get_pbl_phys(&txq->tx_pbl); p_phys_table = qed_chain_get_pbl_phys(&txq->tx_pbl);
page_cnt = qed_chain_get_page_cnt(&txq->tx_pbl); page_cnt = qed_chain_get_page_cnt(&txq->tx_pbl);
...@@ -3468,7 +3420,7 @@ static int qede_start_queues(struct qede_dev *edev, bool clear_stats) ...@@ -3468,7 +3420,7 @@ static int qede_start_queues(struct qede_dev *edev, bool clear_stats)
q_params.queue_id = txq->index; q_params.queue_id = txq->index;
q_params.vport_id = 0; q_params.vport_id = 0;
q_params.sb = fp->sb_info->igu_sb_id; q_params.sb = fp->sb_info->igu_sb_id;
q_params.sb_idx = TX_PI(tc); q_params.sb_idx = TX_PI(0);
rc = edev->ops->q_tx_start(cdev, &q_params, rc = edev->ops->q_tx_start(cdev, &q_params,
p_phys_table, page_cnt, p_phys_table, page_cnt,
...@@ -3480,7 +3432,7 @@ static int qede_start_queues(struct qede_dev *edev, bool clear_stats) ...@@ -3480,7 +3432,7 @@ static int qede_start_queues(struct qede_dev *edev, bool clear_stats)
} }
txq->hw_cons_ptr = txq->hw_cons_ptr =
&fp->sb_info->sb_virt->pi_array[TX_PI(tc)]; &fp->sb_info->sb_virt->pi_array[TX_PI(0)];
SET_FIELD(txq->tx_db.data.params, SET_FIELD(txq->tx_db.data.params,
ETH_DB_DATA_DEST, DB_DEST_XCM); ETH_DB_DATA_DEST, DB_DEST_XCM);
SET_FIELD(txq->tx_db.data.params, ETH_DB_DATA_AGG_CMD, SET_FIELD(txq->tx_db.data.params, ETH_DB_DATA_AGG_CMD,
...@@ -3654,8 +3606,8 @@ static int qede_load(struct qede_dev *edev, enum qede_load_mode mode) ...@@ -3654,8 +3606,8 @@ static int qede_load(struct qede_dev *edev, enum qede_load_mode mode)
rc = qede_alloc_mem_load(edev); rc = qede_alloc_mem_load(edev);
if (rc) if (rc)
goto err1; goto err1;
DP_INFO(edev, "Allocated %d RSS queues on %d TC/s\n", DP_INFO(edev, "Allocated %d Rx, %d Tx queues\n",
QEDE_QUEUE_CNT(edev), edev->num_tc); QEDE_RSS_COUNT(edev), QEDE_TSS_COUNT(edev));
rc = qede_set_real_num_queues(edev); rc = qede_set_real_num_queues(edev);
if (rc) if (rc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment