From patchwork Tue Feb 16 20:35:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Boyer X-Patchwork-Id: 87948 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 71B31A054D; Tue, 16 Feb 2021 21:36:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E2C91607DA; Tue, 16 Feb 2021 21:36:07 +0100 (CET) Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by mails.dpdk.org (Postfix) with ESMTP id 18F421607CE for ; Tue, 16 Feb 2021 21:36:05 +0100 (CET) Received: by mail-pg1-f169.google.com with SMTP id t25so7010237pga.2 for ; Tue, 16 Feb 2021 12:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Zx5nf/o/QNdSjhOnE6vy6OwkPcI4SAI+T0NsQnhkBxg=; b=adoJL5dkikH1+IwFrfH/vkakpu306LOB5O2Pm22AvJZJZghGaqlhu/+sEqHb4SMKkZ u7bSfCrnqe5HZRRo3ThCxB4DWq9q4FWseGyiHfqTyBfaZdg6OkM98UmAmPBN5nJ+HMGp njIsHloR2xkeWMBhP3xIAJQV2qUF3stNzV4lte1NaxHRr1/UVZO4B9hLuV0rIcCFcEni geATNA3GHksP2DrUNPruPQfil+lD5Kr1Dsr+w5c8L8Jud/Q8LSQTfd+Lebbm+Hqevn30 SOvdATNCHAGwoJN96jqB+a1z00NEWNNKEK5Zz28OkQxnakf8ljXwRLHWQojlZfhytrjP lyJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=Zx5nf/o/QNdSjhOnE6vy6OwkPcI4SAI+T0NsQnhkBxg=; b=XoTuPSYMZE+f5GyXQPEgezRO8aN3AqustBVPkIE7/mxpKIgms0rXc0a5Ct6TMVj42R BrXX9NLSGz+WzdCO20RW2LUsM+ZVwxDUlkYF6Tgn6CWl7CQLLTP0emukH6ucn3zQmywu q8gn8tRXLwNwjRM7lBGNE74K6oU6Dd6xjkjm9BsmPIqrhg6BLm2Qu8EXkXWZoh+PiaRF vkZ0sfocyDKwK5sarMiR9vUT1IhnZExmFPPbRTmF4ygBkEHIu9/0w7XNqmTCyR9bmmg7 louAIEeT9A4OzgXQItQrZocg8AD1zIqarGW2TYMFSGPK984rLi3lVNS7y7bSFZ6D9IYU v+mQ== X-Gm-Message-State: AOAM531I/RZc+l1hYmn0qR33JxbDSPXMHLd8Iukubc2emPABtS3+F/1E Ep08E4XVUeF2nIT9+jjCqfw3bq8PE4MtJQ== X-Google-Smtp-Source: ABdhPJy6RmA7UORZQrk/8OCo2q8Hj4TiOavKXWS1tQ9RMaWFay9gbZjN4JOq7eCyNXxkH8QkGsZTGw== X-Received: by 2002:a63:1e07:: with SMTP id e7mr9360625pge.376.1613507763998; Tue, 16 Feb 2021 12:36:03 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id u17sm11371pgh.72.2021.02.16.12.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 12:36:03 -0800 (PST) From: Andrew Boyer To: dev@dpdk.org Cc: Alfredo Cardigliano , Andrew Boyer Date: Tue, 16 Feb 2021 12:35:34 -0800 Message-Id: <20210216203540.29290-10-aboyer@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210216203540.29290-1-aboyer@pensando.io> References: <20210216203540.29290-1-aboyer@pensando.io> In-Reply-To: <20210204195853.13411-1-aboyer@pensando.io> References: <20210204195853.13411-1-aboyer@pensando.io> Subject: [dpdk-dev] [PATCH v2 09/15] net/ionic: use the socket id passed in for Rx and Tx queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Pipe the value from the queue setup routines through to ionic_qcq_alloc(). Signed-off-by: Andrew Boyer --- drivers/net/ionic/ionic_lif.c | 10 +++++++--- drivers/net/ionic/ionic_lif.h | 10 ++++++---- drivers/net/ionic/ionic_rxtx.c | 4 ++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c index 87579a09e5..dd79068948 100644 --- a/drivers/net/ionic/ionic_lif.c +++ b/drivers/net/ionic/ionic_lif.c @@ -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, diff --git a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h index a8243ebf21..ba1471b6e9 100644 --- a/drivers/net/ionic/ionic_lif.h +++ b/drivers/net/ionic/ionic_lif.h @@ -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); diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c index 5f836f0134..89b37733b6 100644 --- a/drivers/net/ionic/ionic_rxtx.c +++ b/drivers/net/ionic/ionic_rxtx.c @@ -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);