net/ionic: use socket id passed in for Rx and Tx queues
authorAndrew Boyer <aboyer@pensando.io>
Tue, 16 Feb 2021 20:35:34 +0000 (12:35 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 25 Feb 2021 15:58:56 +0000 (16:58 +0100)
Pipe the value from the queue setup routines through to
ionic_qcq_alloc().

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
drivers/net/ionic/ionic_lif.c
drivers/net/ionic/ionic_lif.h
drivers/net/ionic/ionic_rxtx.c

index 87579a0..dd79068 100644 (file)
@@ -588,6 +588,7 @@ static int
 ionic_qcq_alloc(struct ionic_lif *lif,
                uint8_t type,
                size_t struct_size,
+               uint32_t socket_id,
                uint32_t index,
                const char *type_name,
                uint16_t flags,
@@ -603,7 +604,6 @@ ionic_qcq_alloc(struct ionic_lif *lif,
        rte_iova_t q_base_pa = 0;
        rte_iova_t cq_base_pa = 0;
        rte_iova_t sg_base_pa = 0;
-       uint32_t socket_id = rte_socket_id();
        int err;
 
        *qcq = NULL;
@@ -721,7 +721,7 @@ ionic_qcq_free(struct ionic_qcq *qcq)
 }
 
 int
-ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t index,
+ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,
                uint16_t nrxq_descs, struct ionic_rx_qcq **rxq_out)
 {
        struct ionic_rx_qcq *rxq;
@@ -732,6 +732,7 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t index,
        err = ionic_qcq_alloc(lif,
                IONIC_QTYPE_RXQ,
                sizeof(struct ionic_rx_qcq),
+               socket_id,
                index,
                "rx",
                flags,
@@ -752,7 +753,7 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t index,
 }
 
 int
-ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t index,
+ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,
                uint16_t ntxq_descs, struct ionic_tx_qcq **txq_out)
 {
        struct ionic_tx_qcq *txq;
@@ -763,6 +764,7 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t index,
        err = ionic_qcq_alloc(lif,
                IONIC_QTYPE_TXQ,
                sizeof(struct ionic_tx_qcq),
+               socket_id,
                index,
                "tx",
                flags,
@@ -791,6 +793,7 @@ ionic_admin_qcq_alloc(struct ionic_lif *lif)
        err = ionic_qcq_alloc(lif,
                IONIC_QTYPE_ADMINQ,
                sizeof(struct ionic_admin_qcq),
+               rte_socket_id(),
                0,
                "admin",
                flags,
@@ -816,6 +819,7 @@ ionic_notify_qcq_alloc(struct ionic_lif *lif)
        err = ionic_qcq_alloc(lif,
                IONIC_QTYPE_NOTIFYQ,
                sizeof(struct ionic_notify_qcq),
+               rte_socket_id(),
                0,
                "notify",
                flags,
index a8243eb..ba1471b 100644 (file)
@@ -196,10 +196,12 @@ int ionic_dev_promiscuous_disable(struct rte_eth_dev *dev);
 int ionic_dev_allmulticast_enable(struct rte_eth_dev *dev);
 int ionic_dev_allmulticast_disable(struct rte_eth_dev *dev);
 
-int ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t index,
-       uint16_t nrxq_descs, struct ionic_rx_qcq **qcq_out);
-int ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t index,
-       uint16_t ntxq_descs, struct ionic_tx_qcq **qcq_out);
+int ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id,
+       uint32_t index, uint16_t nrxq_descs,
+       struct ionic_rx_qcq **qcq_out);
+int ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id,
+       uint32_t index, uint16_t ntxq_descs,
+       struct ionic_tx_qcq **qcq_out);
 void ionic_qcq_free(struct ionic_qcq *qcq);
 
 int ionic_qcq_enable(struct ionic_qcq *qcq);
index 5f836f0..89b3773 100644 (file)
@@ -191,7 +191,7 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,
        eth_dev->data->tx_queue_state[tx_queue_id] =
                RTE_ETH_QUEUE_STATE_STOPPED;
 
-       err = ionic_tx_qcq_alloc(lif, tx_queue_id, nb_desc, &txq);
+       err = ionic_tx_qcq_alloc(lif, socket_id, tx_queue_id, nb_desc, &txq);
        if (err) {
                IONIC_PRINT(DEBUG, "Queue allocation failure");
                return -EINVAL;
@@ -718,7 +718,7 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
        eth_dev->data->rx_queue_state[rx_queue_id] =
                RTE_ETH_QUEUE_STATE_STOPPED;
 
-       err = ionic_rx_qcq_alloc(lif, rx_queue_id, nb_desc,
+       err = ionic_rx_qcq_alloc(lif, socket_id, rx_queue_id, nb_desc,
                        &rxq);
        if (err) {
                IONIC_PRINT(ERR, "Queue %d allocation failure", rx_queue_id);