From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 09A92A04F0 for ; Thu, 19 Dec 2019 15:42:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F3FE31C042; Thu, 19 Dec 2019 15:42:08 +0100 (CET) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id E0B211C042 for ; Thu, 19 Dec 2019 15:42:07 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id y11so6231073wrt.6 for ; Thu, 19 Dec 2019 06:42:07 -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=C3T1l80fN7GDKQW6BX4cPMf9Z5YoN4vhSwCsr1rxlUM=; b=dOmWZDzwECXFNWNTKmM+KgR5qNqrh4QEKJ7OapnfI2He+QSjN+5P+HS2EU0BcAWcuR dUB86zwIFsYGhbukAorNvFqkn2lG5Ev3WJR/hD4UM4g/Zbjae15gmxM/aIx4zagDYokb LUA85Z+dpsIcBn9EGg6m89CIj4kHhGTwz1XBahixejVik6508f4xkaF7k8O8hkS8cE2S t6G25QZPnHIAFhFe/HEyq+EFqfbJYcDPr1NtqlGKRb3XCss9KhPtKSK2T5tWrNZnGO2U RBcx+SPtWT5Elf5kBMa1oDmXIMPjMdxXvUFrrC3gWI5FqEMWcvV0UXxazAPwwdSWmMuE OskQ== 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=C3T1l80fN7GDKQW6BX4cPMf9Z5YoN4vhSwCsr1rxlUM=; b=NfelRT3dJfwsBikMJmcg82HuHj+QhMDEWjB2KdN/GbBzhBeGWNMYI3RhSJV6GxwH3j 6gu0tqFYWRMFBJP2RNewCoDpR01oBVWNZKAM5qIsD/3nMmF29pO2HsOFAwPl3MXCjfKZ /pQwDuhYWl+o0XfR1vhgMuD1whosQkPoSZmBCj3Wt0BJnVC8ZSGGWXBETIoDPMSJFB0y J+BdCJRmpe1CZBWKFQBovtijvxYRzX7SBEaPqRPmkiiUo8Kx0bd4nIzX8UYWOfpaBJSs F63fWmz6FWS+sDwFlGSoDtdiB9+/Nl+dgmGGwo6A6JFiWwSgAaEpTbSuTZYPGan04zLQ hj8A== X-Gm-Message-State: APjAAAUpkWnY0RkFr5l1IrwKhzxl1p4vuL4ZWQv8yipL6t3ltNe4U9Ye DHPXc1oI/2rwKWiSesbVlAA= X-Google-Smtp-Source: APXvYqzyID1Cez7GmeWhm7E4cNu+HOgu2WzKi3TK06qC7XDeQYYfOke7rhsxq0BzsCk2Q2//dC1xfg== X-Received: by 2002:a5d:4984:: with SMTP id r4mr9413905wrq.137.1576766527529; Thu, 19 Dec 2019 06:42:07 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id e16sm6455659wrs.73.2019.12.19.06.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:42:07 -0800 (PST) From: luca.boccassi@gmail.com To: Pavan Nikhilesh Cc: Jerin Jacob , dpdk stable Date: Thu, 19 Dec 2019 14:34:45 +0000 Message-Id: <20191219143447.21506-138-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'event/octeontx: fix partial Rx packet handling' has been queued to LTS release 17.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 LTS release 17.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/21/19. 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. Thanks. Luca Boccassi --- >From e030fa10aa200e7f60550d6c95a8342edbef4764 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Wed, 27 Nov 2019 18:06:47 +0530 Subject: [PATCH] event/octeontx: fix partial Rx packet handling [ upstream commit 4a2121667445280e9966b4dbe673d4eca18d50a2 ] When net/octeontx is connected to event/octeontx as an event Rx adapter, PKI aka 'net/octeontx' can forward packets directly to SSO aka 'event/octeontx'. When pumping traffic to PKI if flow control is disabled internal FIFOs might be overrun causing partial l2 packets to be enqueued. SSO receives <31:0> TAG tag calculated by PKI, in normal cases <31:28> is always 0 which signifies RTE_EVENT_TYPE_ETHDEV. But in case of partial received packets PKI sets the <31:0> TAG as 0xFFFFFFFF which is an invalid event type. Add a check to see if TAG is 0xFFFFFFFF and free the partial receive packet. Fixes: d0d654986018 ("net/octeontx: support event Rx adapter") Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- drivers/event/octeontx/Makefile | 1 + drivers/event/octeontx/ssovf_worker.h | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile index 260441281e..2c029cbb66 100644 --- a/drivers/event/octeontx/Makefile +++ b/drivers/event/octeontx/Makefile @@ -42,6 +42,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/mempool/octeontx/ CFLAGS += -I$(RTE_SDK)/drivers/net/octeontx/ LDLIBS += -lrte_eal -lrte_eventdev -lrte_mempool_octeontx -lrte_pmd_octeontx +LDLIBS += -lrte_mempool LDLIBS += -lrte_bus_pci LDLIBS += -lrte_bus_vdev diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h index 4c9a4c4711..7e7d0a7f35 100644 --- a/drivers/event/octeontx/ssovf_worker.h +++ b/drivers/event/octeontx/ssovf_worker.h @@ -60,8 +60,7 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info) rte_prefetch_non_temporal(wqe); /* Get mbuf from wqe */ - mbuf = (struct rte_mbuf *)((uintptr_t)wqe - - OCTTX_PACKET_WQE_SKIP); + mbuf = (struct rte_mbuf *)((uintptr_t)wqe - OCTTX_PACKET_WQE_SKIP); mbuf->packet_type = ptype_table[wqe->s.w2.lcty][wqe->s.w2.lety][wqe->s.w2.lfty]; mbuf->data_off = RTE_PTR_DIFF(wqe->s.w3.addr, mbuf->buf_addr); @@ -74,6 +73,16 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info) return mbuf; } +static __rte_always_inline void +ssovf_octeontx_wqe_free(uint64_t work) +{ + octtx_wqe_t *wqe = (octtx_wqe_t *)(uintptr_t)work; + struct rte_mbuf *mbuf; + + mbuf = (struct rte_mbuf *)((uintptr_t)wqe - OCTTX_PACKET_WQE_SKIP); + rte_pktmbuf_free(mbuf); +} + static __rte_always_inline uint16_t ssows_get_work(struct ssows *ws, struct rte_event *ev) { @@ -87,9 +96,13 @@ ssows_get_work(struct ssows *ws, struct rte_event *ev) ws->cur_grp = sched_type_queue >> 2; sched_type_queue = sched_type_queue << 38; ev->event = sched_type_queue | (get_work0 & 0xffffffff); + if (get_work1 && ev->event_type == RTE_EVENT_TYPE_ETHDEV) { ev->mbuf = ssovf_octeontx_wqe_to_pkt(get_work1, (ev->event >> 20) & 0x7F); + } else if (unlikely((get_work0 & 0xFFFFFFFF) == 0xFFFFFFFF)) { + ssovf_octeontx_wqe_free(get_work1); + return 0; } else { ev->u64 = get_work1; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:31.813370237 +0000 +++ 0138-event-octeontx-fix-partial-Rx-packet-handling.patch 2019-12-19 14:32:26.361302902 +0000 @@ -1,8 +1,10 @@ -From 4a2121667445280e9966b4dbe673d4eca18d50a2 Mon Sep 17 00:00:00 2001 +From e030fa10aa200e7f60550d6c95a8342edbef4764 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Wed, 27 Nov 2019 18:06:47 +0530 Subject: [PATCH] event/octeontx: fix partial Rx packet handling +[ upstream commit 4a2121667445280e9966b4dbe673d4eca18d50a2 ] + When net/octeontx is connected to event/octeontx as an event Rx adapter, PKI aka 'net/octeontx' can forward packets directly to SSO aka 'event/octeontx'. @@ -17,29 +19,41 @@ packet. Fixes: d0d654986018 ("net/octeontx: support event Rx adapter") -Cc: stable@dpdk.org Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- + drivers/event/octeontx/Makefile | 1 + drivers/event/octeontx/ssovf_worker.h | 17 +++++++++++++++-- - 1 file changed, 15 insertions(+), 2 deletions(-) + 2 files changed, 16 insertions(+), 2 deletions(-) +diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile +index 260441281e..2c029cbb66 100644 +--- a/drivers/event/octeontx/Makefile ++++ b/drivers/event/octeontx/Makefile +@@ -42,6 +42,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/mempool/octeontx/ + CFLAGS += -I$(RTE_SDK)/drivers/net/octeontx/ + + LDLIBS += -lrte_eal -lrte_eventdev -lrte_mempool_octeontx -lrte_pmd_octeontx ++LDLIBS += -lrte_mempool + LDLIBS += -lrte_bus_pci + LDLIBS += -lrte_bus_vdev + diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h -index d1d3a52ae1..c4f886d63a 100644 +index 4c9a4c4711..7e7d0a7f35 100644 --- a/drivers/event/octeontx/ssovf_worker.h +++ b/drivers/event/octeontx/ssovf_worker.h -@@ -30,8 +30,7 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info) - octtx_wqe_t *wqe = (octtx_wqe_t *)(uintptr_t)work; +@@ -60,8 +60,7 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info) + rte_prefetch_non_temporal(wqe); /* Get mbuf from wqe */ - mbuf = (struct rte_mbuf *)((uintptr_t)wqe - - OCTTX_PACKET_WQE_SKIP); + mbuf = (struct rte_mbuf *)((uintptr_t)wqe - OCTTX_PACKET_WQE_SKIP); - rte_prefetch_non_temporal(mbuf); mbuf->packet_type = ptype_table[wqe->s.w2.lcty][wqe->s.w2.lety][wqe->s.w2.lfty]; -@@ -46,6 +45,16 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info) + mbuf->data_off = RTE_PTR_DIFF(wqe->s.w3.addr, mbuf->buf_addr); +@@ -74,6 +73,16 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info) return mbuf; } @@ -56,7 +70,7 @@ static __rte_always_inline uint16_t ssows_get_work(struct ssows *ws, struct rte_event *ev) { -@@ -59,9 +68,13 @@ ssows_get_work(struct ssows *ws, struct rte_event *ev) +@@ -87,9 +96,13 @@ ssows_get_work(struct ssows *ws, struct rte_event *ev) ws->cur_grp = sched_type_queue >> 2; sched_type_queue = sched_type_queue << 38; ev->event = sched_type_queue | (get_work0 & 0xffffffff);