From patchwork Thu Feb 4 19:58:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Boyer X-Patchwork-Id: 87768 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 704E8A0524; Thu, 4 Feb 2021 21:00:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93D4524083F; Thu, 4 Feb 2021 20:59:46 +0100 (CET) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mails.dpdk.org (Postfix) with ESMTP id 0E68B240837 for ; Thu, 4 Feb 2021 20:59:46 +0100 (CET) Received: by mail-pj1-f42.google.com with SMTP id lw17so5544100pjb.0 for ; Thu, 04 Feb 2021 11:59:45 -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=AzMhYmx8/vwlskBO7ngBk/4OOrMcSuMYCxGm8mcWvkY=; b=Xf40o3yCAL3rvECdYjSWn5Mth0guDAAyjF6Y5vgR852L3EkSvnmsUExrOzY0h7RnW3 nyZpjSPpiwJissvOfI4V2p9k7iHiHUmHwHysnKKjdGzDi8r1OwqadzXImcV1o59jzFTw YwltGmJIOIJWbVHUft/iJAKzXAeqyBTGMnlzp5lq0RSxcfYKOgTeLWeoRpYIJvZHpOLN VdbHN3CtDjJqLzUqssEkA6Bl92EMLjGu3/QPkr1I5wyXMcUEoRzTFW7XCxqeCdYcUQor RknB5TC432+4UHMe6pE86vPOv2DELhFx2pzQw1do67YeY+UumD5Zt1Is+DzOwMibEIQ6 ypbw== 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=AzMhYmx8/vwlskBO7ngBk/4OOrMcSuMYCxGm8mcWvkY=; b=VP7rEQu3CeGZvFRJwsp+snFifG0XfmVlL+Pi2fUHXTuZlKi8qN6Xv5vGIfMRnsrOOa lg6V1tcQmKdljZYmYLE8aiD2qonlwo3jK7S1vj5X0amJtjPmn2S55F/LDIwsymsYTH/e 6ZurZW2b05Cj9sVIfPf2Ge2yWcFqhvYTzJxYof52Uz8r5GAY7JoCk5UovPpiXwe5MjXh CkwSTtUgZob9/JrMwNps5FSGsBnFOXamnu+YIfC+3BuxAK6FwwAIvDjhPNJWhod7kIIb T3o/fFs1C5jQeS9ZegwwNLabcc4Y9cmD4FSYNw7LGgMTounwyUFHvz5L63uBt4/5vYkh m8OQ== X-Gm-Message-State: AOAM530bQJ/b+kXpZVW+9uBpUi5j3yren75Kv1qEoM0atJnbyr/tIFci 4/09acekm+lGVu49/BRy/X/96JdJO8vbxw== X-Google-Smtp-Source: ABdhPJxKa87ThCT3s3q/m02MdvCt6/o6ybK39RMaiQWq+uq4mGmb3jqmMcqyawkeqXUN/DeyKxBJ0Q== X-Received: by 2002:a17:90a:598c:: with SMTP id l12mr627215pji.70.1612468785063; Thu, 04 Feb 2021 11:59:45 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id r14sm7757915pgi.27.2021.02.04.11.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 11:59:44 -0800 (PST) From: Andrew Boyer To: dev@dpdk.org Cc: Alfredo Cardigliano , Andrew Boyer Date: Thu, 4 Feb 2021 11:58:52 -0800 Message-Id: <20210204195853.13411-14-aboyer@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210204195853.13411-1-aboyer@pensando.io> References: <20210204195853.13411-1-aboyer@pensando.io> Subject: [dpdk-dev] [PATCH 13/14] net/ionic: fix Tx fragment limit check 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" This was missed when updating to the v1 Tx queue structures. Store the value in the queue for easy access. Fixes: 786c64763b50 ("net/ionic: clean up Tx queue version support") Signed-off-by: Andrew Boyer --- drivers/net/ionic/ionic_lif.c | 6 +++++- drivers/net/ionic/ionic_lif.h | 1 + drivers/net/ionic/ionic_rxtx.c | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c index dd79068948..b8023e0632 100644 --- a/drivers/net/ionic/ionic_lif.c +++ b/drivers/net/ionic/ionic_lif.c @@ -757,10 +757,13 @@ 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; - uint16_t flags; + uint16_t flags, num_segs_fw; int err; flags = IONIC_QCQ_F_SG; + + num_segs_fw = IONIC_TX_MAX_SG_ELEMS_V1 + 1; + err = ionic_qcq_alloc(lif, IONIC_QTYPE_TXQ, sizeof(struct ionic_tx_qcq), @@ -777,6 +780,7 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index, return err; txq->flags = flags; + txq->num_segs_fw = num_segs_fw; lif->txqcqs[index] = txq; *txq_out = txq; diff --git a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h index 5885aa1546..9f00ba2973 100644 --- a/drivers/net/ionic/ionic_lif.h +++ b/drivers/net/ionic/ionic_lif.h @@ -92,6 +92,7 @@ struct ionic_tx_qcq { struct ionic_qcq qcq; /* cacheline2 */ + uint16_t num_segs_fw; /* # segs supported by current FW */ uint16_t flags; struct ionic_tx_stats stats; diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c index 81182b5dc4..b83ea1bcaa 100644 --- a/drivers/net/ionic/ionic_rxtx.c +++ b/drivers/net/ionic/ionic_rxtx.c @@ -598,9 +598,9 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, (PKT_TX_OFFLOAD_MASK ^ IONIC_TX_OFFLOAD_MASK) uint16_t -ionic_prep_pkts(void *tx_queue __rte_unused, struct rte_mbuf **tx_pkts, - uint16_t nb_pkts) +ionic_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { + struct ionic_tx_qcq *txq = tx_queue; struct rte_mbuf *txm; uint64_t offloads; int i = 0; @@ -608,7 +608,7 @@ ionic_prep_pkts(void *tx_queue __rte_unused, struct rte_mbuf **tx_pkts, for (i = 0; i < nb_pkts; i++) { txm = tx_pkts[i]; - if (txm->nb_segs > IONIC_TX_MAX_SG_ELEMS) { + if (txm->nb_segs > txq->num_segs_fw) { rte_errno = -EINVAL; break; }