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 F062BA04E0 for ; Wed, 27 Nov 2019 13:36:56 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BAC751B943; Wed, 27 Nov 2019 13:36:56 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 1053A58C3; Wed, 27 Nov 2019 13:36:53 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xARCVCbI028362; Wed, 27 Nov 2019 04:36:53 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=NIyKj3sNTQ0ZF0zu+a1g7ggxS6aqPbVjQbiUxuHEru0=; b=fOEPHyRH0jVcqWp+ZoVripA5nfvFjUYbDAdh8rTYpX3yQeKekfYB9vyj0UO2ZbnXXyfF vntRmvv/91s7Kq1ARTB8iSBGxJtLJdmNL6WTjGhgFKrMvW4t2j9A8mZlfSxY7RFvC2xO 3CiZzBqQ0sl04OvGmx3fSr/Emfm8k1vkU3f+wLykimJ9TsTnHwb8gtq5Ls/gDRn1l/OH DI/cxgW//8vcJQCdMSgeSHrfvaa29ZhX+9jTEy9UzDx4Fg2uLoBhfltxnNZaoq5kNShK pGlWO/qwTN0VmKZo9Dcx55lqdNR/XSJeV+5snRwc+AnU0H0nbm3Yl3U8fSmGu8tPHKO+ 3A== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2whmdy94k3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 27 Nov 2019 04:36:53 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 27 Nov 2019 04:36:50 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 27 Nov 2019 04:36:50 -0800 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.17.96]) by maili.marvell.com (Postfix) with ESMTP id 248553F703F; Wed, 27 Nov 2019 04:36:48 -0800 (PST) From: To: CC: , Pavan Nikhilesh , Date: Wed, 27 Nov 2019 18:06:47 +0530 Message-ID: <20191127123647.7596-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-27_02:2019-11-27,2019-11-27 signatures=0 Subject: [dpdk-stable] [dpdk-dev] [PATCH v2] event/octeontx: fix partial Rx packet handling 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" From: Pavan Nikhilesh 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. Cc: stable@dpdk.org Fixes: d0d654986018 ("net/octeontx: support event Rx adapter") Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx/ssovf_worker.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h index d1d3a52ae..c4f886d63 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; /* 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) 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) { @@ -59,9 +68,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.17.1