From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E3EA4A0A03; Mon, 18 Jan 2021 21:36:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4AE26140E62; Mon, 18 Jan 2021 21:35:47 +0100 (CET) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id A2D4C140E3E for ; Mon, 18 Jan 2021 21:35:44 +0100 (CET) Received: by mail-pj1-f44.google.com with SMTP id x20so5222988pjh.3 for ; Mon, 18 Jan 2021 12:35:44 -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; bh=hwySIY4QCRAdAeQdHlBySn/HJ3s33iZ6HTLIJHME02s=; b=L7rIMr9ltDat08VDl0S6CG+WKsDsqc6hmGEs2EJfi6uVE+zp48Wi8We16zTr/RVtE/ E0x/vUXxB/V6/1n5a8NlQt+PYA/sE5v2a6Yq4pDnirsm82fk1sNgdHZEnOVOiqbu7DFj vNo3xPIEMSuENjSHWZYMGCMJylA73VAQALO1RoiD07C95ymZjb375elbaWEt/n+83gl8 pnDYbTNJ0CGNNyA8NAs4gLL7BLUWMN+tE784Cw0zoJkvLLAeijFqlFzA1LnPp9MpM/A2 RPhWlyPt6ETXpN/G3Sq/pm7lozKjIhUSQn4EyesDRwlE4OpHBpviK10WtM+Q3iBpQRUF mUaA== 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; bh=hwySIY4QCRAdAeQdHlBySn/HJ3s33iZ6HTLIJHME02s=; b=h4/RTZMToH/Oyejd9mst9+3deR3vxp1ChSiG4C402B4r+zmphJeM6mmYXrl5KhWa8K 5Rl5H+xS3NRDpclsAb8O0Byn+FC4U8NEZ85WDTwKTuEGdTUfqsu4CpOoQrp/F0CF7jF/ LoHVumdcYhJ4+JrD/wG06NIhq4WBi+4YlUCwEMeukGseq27317PFBsVcAbJDIP4ZFkcI +bkGJ/wN3DO8bJETUEpeJ1DES9XavX9giF8hQoUy1aK/wi5jR461beDrlU5zV/42Hf40 7DOQiuqQbsM3QBIEXF00Xj6OHuaAzxdwjE1L8IS92aB4Y3pUFFN9kCDE8n5IfwCJZ77f 2S3w== X-Gm-Message-State: AOAM530x1Mcp83Nr7Vm0nfx7voQ9ewxfICbr6e0+N1/hnY4S2n9Y8yYA uV7cHByY3RVj7ZKOPDh2SXA+LsIGUwdxCA== X-Google-Smtp-Source: ABdhPJwvHU76Lt0tHmJcr4yBzyyLIiTYy5P5PTn3Cjmc5end+N9NsDGj17SRKJ11MV7FqJeMXZ95SQ== X-Received: by 2002:a17:90b:490c:: with SMTP id kr12mr1111630pjb.227.1611002143722; Mon, 18 Jan 2021 12:35:43 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id g201sm795160pfb.81.2021.01.18.12.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 12:35:43 -0800 (PST) From: Andrew Boyer To: dev@dpdk.org Cc: Alfredo Cardigliano , Andrew Boyer Date: Mon, 18 Jan 2021 12:35:01 -0800 Message-Id: <20210118203508.1332-7-aboyer@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210118203508.1332-1-aboyer@pensando.io> References: <20210118203508.1332-1-aboyer@pensando.io> Subject: [dpdk-dev] [PATCH 06/13] net/ionic: clean up Tx queue version support 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" The ionic PMD only supports TX queue version 1 or greater. Version 1 introduced a new SGL format with support for more fragments per descriptor. Signed-off-by: Andrew Boyer --- drivers/net/ionic/ionic_dev.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 8 ++++---- drivers/net/ionic/ionic_lif.c | 7 ++++++- drivers/net/ionic/ionic_rxtx.c | 8 ++++---- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/net/ionic/ionic_dev.h b/drivers/net/ionic/ionic_dev.h index 6931930543..ea89218662 100644 --- a/drivers/net/ionic/ionic_dev.h +++ b/drivers/net/ionic/ionic_dev.h @@ -107,7 +107,7 @@ static inline void ionic_struct_size_checks(void) /* I/O */ RTE_BUILD_BUG_ON(sizeof(struct ionic_txq_desc) != 16); - RTE_BUILD_BUG_ON(sizeof(struct ionic_txq_sg_desc) != 128); + RTE_BUILD_BUG_ON(sizeof(struct ionic_txq_sg_desc_v1) != 256); RTE_BUILD_BUG_ON(sizeof(struct ionic_txq_comp) != 16); RTE_BUILD_BUG_ON(sizeof(struct ionic_rxq_desc) != 16); diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index 9238bf7d36..bc9a946ab5 100644 --- a/drivers/net/ionic/ionic_ethdev.c +++ b/drivers/net/ionic/ionic_ethdev.c @@ -70,12 +70,12 @@ static const struct rte_eth_desc_lim rx_desc_lim = { .nb_align = 1, }; -static const struct rte_eth_desc_lim tx_desc_lim = { +static const struct rte_eth_desc_lim tx_desc_lim_v1 = { .nb_max = IONIC_MAX_RING_DESC, .nb_min = IONIC_MIN_RING_DESC, .nb_align = 1, - .nb_seg_max = IONIC_TX_MAX_SG_ELEMS, - .nb_mtu_seg_max = IONIC_TX_MAX_SG_ELEMS, + .nb_seg_max = IONIC_TX_MAX_SG_ELEMS_V1, + .nb_mtu_seg_max = IONIC_TX_MAX_SG_ELEMS_V1, }; static const struct eth_dev_ops ionic_eth_dev_ops = { @@ -440,7 +440,7 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev, 0; dev_info->rx_desc_lim = rx_desc_lim; - dev_info->tx_desc_lim = tx_desc_lim; + dev_info->tx_desc_lim = tx_desc_lim_v1; /* Driver-preferred Rx/Tx parameters */ dev_info->default_rxportconf.burst_size = 32; diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c index 0d2b3d56a7..ec35d81cd5 100644 --- a/drivers/net/ionic/ionic_lif.c +++ b/drivers/net/ionic/ionic_lif.c @@ -761,7 +761,7 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t index, uint16_t ntxq_descs, ntxq_descs, sizeof(struct ionic_txq_desc), sizeof(struct ionic_txq_comp), - sizeof(struct ionic_txq_sg_desc), + sizeof(struct ionic_txq_sg_desc_v1), &lif->txqcqs[index]); if (err) return err; @@ -925,6 +925,11 @@ ionic_lif_alloc(struct ionic_lif *lif) ionic_lif_queue_identify(lif); + if (lif->qtype_info[IONIC_QTYPE_TXQ].version < 1) { + IONIC_PRINT(ERR, "FW too old, please upgrade"); + return -ENXIO; + } + IONIC_PRINT(DEBUG, "Allocating Lif Info"); rte_spinlock_init(&lif->adminq_lock); diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c index 5d0e9d5d5a..c3a44faa21 100644 --- a/drivers/net/ionic/ionic_rxtx.c +++ b/drivers/net/ionic/ionic_rxtx.c @@ -311,9 +311,9 @@ static struct ionic_txq_desc * ionic_tx_tso_next(struct ionic_queue *q, struct ionic_txq_sg_elem **elem) { struct ionic_txq_desc *desc_base = q->base; - struct ionic_txq_sg_desc *sg_desc_base = q->sg_base; + struct ionic_txq_sg_desc_v1 *sg_desc_base = q->sg_base; struct ionic_txq_desc *desc = &desc_base[q->head_idx]; - struct ionic_txq_sg_desc *sg_desc = &sg_desc_base[q->head_idx]; + struct ionic_txq_sg_desc_v1 *sg_desc = &sg_desc_base[q->head_idx]; *elem = sg_desc->elems; return desc; @@ -446,9 +446,9 @@ ionic_tx(struct ionic_queue *q, struct rte_mbuf *txm, uint64_t offloads, bool not_xmit_more) { struct ionic_txq_desc *desc_base = q->base; - struct ionic_txq_sg_desc *sg_desc_base = q->sg_base; + struct ionic_txq_sg_desc_v1 *sg_desc_base = q->sg_base; struct ionic_txq_desc *desc = &desc_base[q->head_idx]; - struct ionic_txq_sg_desc *sg_desc = &sg_desc_base[q->head_idx]; + struct ionic_txq_sg_desc_v1 *sg_desc = &sg_desc_base[q->head_idx]; struct ionic_txq_sg_elem *elem = sg_desc->elems; struct ionic_tx_stats *stats = IONIC_Q_TO_TX_STATS(q); struct rte_mbuf *txm_seg; -- 2.17.1