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 A8FDAA0524 for ; Fri, 5 Feb 2021 12:38:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A2AAF4067B; Fri, 5 Feb 2021 12:38:46 +0100 (CET) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mails.dpdk.org (Postfix) with ESMTP id 6A477188A57 for ; Fri, 5 Feb 2021 12:38:45 +0100 (CET) Received: by mail-wr1-f42.google.com with SMTP id g10so7362105wrx.1 for ; Fri, 05 Feb 2021 03:38:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t9or/GLJISHNYO82R+EiEekRF6eWf4C1I2VO/Ydoqcw=; b=T9RROBxzpu0QPcNxVaz13ZoGkQFV1uBVID5h5f38bzsolCxwrJ7LAr+86EKZYMz2nM BPBmU6S6icpXXVscYxbwuWkkfxpDa4p3OKLov0UWgAAAFhCEAW4Fu3zta2XiD3oh/s8n iU4/Wwkz6qT4aU3J7jiiBEupdUtenRGlZHROTjgmfneEBqf+iIq4bzWBSujGF8rkXx38 RQssf9nknxvjszGRgCx6lJ2i2VvHTfc6xIfgcgzxTkKxqBtdzGsf61kA4uGX5V4iV2jn El0f7wrW6ouy/hnTTSa/7GNq5ZdNEYiX/R3F0Sy2q/stEEmT7uqvXloAgWK0yNy5Mfni +haA== 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:mime-version:content-transfer-encoding; bh=t9or/GLJISHNYO82R+EiEekRF6eWf4C1I2VO/Ydoqcw=; b=umheli3Oc6Jxkgzun9czkf0nuTZKs36onIsRoPl//E+TYaBjeojUqi9xW9L4WLG3oV TeJWXfpDYAM+90TLWQ8KEkJHgAmEnzNWIPKUDwFbSsNt8JM6fSRZVDoHttzi5LbU5EfE 9tESoBNsnnDzw2B2StFMN8DPCfV/KnLoKQyA5/ijDIBIxF3PvRIfA0yXTl/dkIa8FhoV cHxHwXbPa2antEyBjjQK4nP9RKQi5D0noURMvZarACQuwA0mcyLVIPcfaKemFUyxEX/O 1H3OQ1a4itVO247Id6VNJCVAk2YSG+0wjWwC6WQSSlcPvkKSHYWz5YgIFTRrIAlSekja CUuw== X-Gm-Message-State: AOAM531sd44hKbBdmfaG2J5gy/uXIS9ZGuSqqZcYwg+AUs5c9062w1yM Hb4w3EnEpNecubbRNRnsQtA= X-Google-Smtp-Source: ABdhPJzJreU27RZQg9FAf/nJyOnNNNOO4c5/5/Sgc2O3o6XFkwRwEhF05dsj/o5cetvOL9tzGxOtUQ== X-Received: by 2002:a5d:44cc:: with SMTP id z12mr4509337wrr.7.1612525125189; Fri, 05 Feb 2021 03:38:45 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id z15sm11078388wrs.25.2021.02.05.03.38.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:38:44 -0800 (PST) From: luca.boccassi@gmail.com To: Andrew Boyer Cc: dpdk stable Date: Fri, 5 Feb 2021 11:18:59 +0000 Message-Id: <20210205111920.1272063-253-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ionic: fix address handling in Tx' has been queued to stable release 20.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/3cac3c84be76c19744b58650ec76cfb025a870c2 Thanks. Luca Boccassi --- >From 3cac3c84be76c19744b58650ec76cfb025a870c2 Mon Sep 17 00:00:00 2001 From: Andrew Boyer Date: Mon, 18 Jan 2021 12:35:08 -0800 Subject: [PATCH] net/ionic: fix address handling in Tx [ upstream commit 7c3a867ba2e51766e632b409822a4aac051d93bd ] Don't assume standard headroom. Use helper variables to improve readability. Fixes: a27d901331da ("net/ionic: add Rx and Tx handling") Signed-off-by: Andrew Boyer --- drivers/net/ionic/ionic_rxtx.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c index 7804b30ff9..9466099352 100644 --- a/drivers/net/ionic/ionic_rxtx.c +++ b/drivers/net/ionic/ionic_rxtx.c @@ -315,7 +315,8 @@ ionic_tx_tso(struct ionic_queue *q, struct rte_mbuf *txm, struct ionic_txq_desc *desc; struct ionic_txq_sg_elem *elem; struct rte_mbuf *txm_seg; - uint64_t desc_addr = 0; + rte_iova_t data_iova; + uint64_t desc_addr = 0, next_addr; uint16_t desc_len = 0; uint8_t desc_nsge; uint32_t hdrlen; @@ -352,6 +353,7 @@ ionic_tx_tso(struct ionic_queue *q, struct rte_mbuf *txm, seglen = hdrlen + mss; left = txm->data_len; + data_iova = rte_mbuf_data_iova(txm); desc = ionic_tx_tso_next(q, &elem); start = true; @@ -361,7 +363,7 @@ ionic_tx_tso(struct ionic_queue *q, struct rte_mbuf *txm, while (left > 0) { len = RTE_MIN(seglen, left); frag_left = seglen - len; - desc_addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(txm)); + desc_addr = rte_cpu_to_le_64(data_iova + offset); desc_len = len; desc_nsge = 0; left -= len; @@ -385,24 +387,23 @@ ionic_tx_tso(struct ionic_queue *q, struct rte_mbuf *txm, txm_seg = txm->next; while (txm_seg != NULL) { offset = 0; + data_iova = rte_mbuf_data_iova(txm_seg); left = txm_seg->data_len; stats->frags++; while (left > 0) { - rte_iova_t data_iova; - data_iova = rte_mbuf_data_iova(txm_seg); - elem->addr = rte_cpu_to_le_64(data_iova) + offset; + next_addr = rte_cpu_to_le_64(data_iova + offset); if (frag_left > 0) { len = RTE_MIN(frag_left, left); frag_left -= len; + elem->addr = next_addr; elem->len = len; elem++; desc_nsge++; } else { len = RTE_MIN(mss, left); frag_left = mss - len; - data_iova = rte_mbuf_data_iova(txm_seg); - desc_addr = rte_cpu_to_le_64(data_iova); + desc_addr = next_addr; desc_len = len; desc_nsge = 0; } @@ -410,6 +411,7 @@ ionic_tx_tso(struct ionic_queue *q, struct rte_mbuf *txm, offset += len; if (txm_seg->next != NULL && frag_left > 0) continue; + done = (txm_seg->next == NULL && left == 0); ionic_tx_tso_post(q, desc, txm_seg, desc_addr, desc_nsge, desc_len, @@ -443,7 +445,7 @@ ionic_tx(struct ionic_queue *q, struct rte_mbuf *txm, bool encap; bool has_vlan; uint64_t ol_flags = txm->ol_flags; - uint64_t addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(txm)); + uint64_t addr; uint8_t opcode = IONIC_TXQ_DESC_OPCODE_CSUM_NONE; uint8_t flags = 0; @@ -473,6 +475,8 @@ ionic_tx(struct ionic_queue *q, struct rte_mbuf *txm, flags |= has_vlan ? IONIC_TXQ_DESC_FLAG_VLAN : 0; flags |= encap ? IONIC_TXQ_DESC_FLAG_ENCAP : 0; + addr = rte_cpu_to_le_64(rte_mbuf_data_iova(txm)); + desc->cmd = encode_txq_desc_cmd(opcode, flags, txm->nb_segs - 1, addr); desc->len = txm->data_len; desc->vlan_tci = txm->vlan_tci; -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:40.319980750 +0000 +++ 0253-net-ionic-fix-address-handling-in-Tx.patch 2021-02-05 11:18:29.266699870 +0000 @@ -1 +1 @@ -From 7c3a867ba2e51766e632b409822a4aac051d93bd Mon Sep 17 00:00:00 2001 +From 3cac3c84be76c19744b58650ec76cfb025a870c2 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7c3a867ba2e51766e632b409822a4aac051d93bd ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -17 +18 @@ -index 23e7d8aef7..2a706b812c 100644 +index 7804b30ff9..9466099352 100644 @@ -20 +21 @@ -@@ -334,7 +334,8 @@ ionic_tx_tso(struct ionic_qcq *txq, struct rte_mbuf *txm, +@@ -315,7 +315,8 @@ ionic_tx_tso(struct ionic_queue *q, struct rte_mbuf *txm, @@ -30 +31 @@ -@@ -371,6 +372,7 @@ ionic_tx_tso(struct ionic_qcq *txq, struct rte_mbuf *txm, +@@ -352,6 +353,7 @@ ionic_tx_tso(struct ionic_queue *q, struct rte_mbuf *txm, @@ -38 +39 @@ -@@ -380,7 +382,7 @@ ionic_tx_tso(struct ionic_qcq *txq, struct rte_mbuf *txm, +@@ -361,7 +363,7 @@ ionic_tx_tso(struct ionic_queue *q, struct rte_mbuf *txm, @@ -47 +48 @@ -@@ -404,24 +406,23 @@ ionic_tx_tso(struct ionic_qcq *txq, struct rte_mbuf *txm, +@@ -385,24 +387,23 @@ ionic_tx_tso(struct ionic_queue *q, struct rte_mbuf *txm, @@ -76 +77 @@ -@@ -429,6 +430,7 @@ ionic_tx_tso(struct ionic_qcq *txq, struct rte_mbuf *txm, +@@ -410,6 +411,7 @@ ionic_tx_tso(struct ionic_queue *q, struct rte_mbuf *txm, @@ -84 +85 @@ -@@ -463,7 +465,7 @@ ionic_tx(struct ionic_qcq *txq, struct rte_mbuf *txm, +@@ -443,7 +445,7 @@ ionic_tx(struct ionic_queue *q, struct rte_mbuf *txm, @@ -93 +94 @@ -@@ -493,6 +495,8 @@ ionic_tx(struct ionic_qcq *txq, struct rte_mbuf *txm, +@@ -473,6 +475,8 @@ ionic_tx(struct ionic_queue *q, struct rte_mbuf *txm,