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 EB8D9A04E0; Wed, 27 Nov 2019 12:05:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 32C635B3E; Wed, 27 Nov 2019 12:05:18 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 6E42F5B32 for ; Wed, 27 Nov 2019 12:05:16 +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 xARB5Fag022088 for ; Wed, 27 Nov 2019 03:05:15 -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=j3eokQTck6j1qTE9Auyht4i3wXn/EIZnm3f2dJeUOJg=; b=v0SZJHD6cA0sofVAJLl89OybebTCHxfW73vZifUNHf5APyDHwb3qF4NBJF0HCzGHgN7h UId9ajswUmDXQQxTr2qC7r+6IAdRHBhnIZawPc4YcjzBL7ZUOt71suIc8Oq9x1fV97Ak sJF6563A8fqjaT9svnFbIgX5QDQQG0xVU7nFucpXCHCTsQc2DKaX5xk3Tvy82iLSA8Mh SrNH+ZC8YOIj4+WIx9O3N+3yYUVIUZ30KFrkHifJMYvEoVkiEg4azJ4Ex6AQUOsT+KM/ l5Weegvmac7N6gJKyfa5gv6F0bMjZbE/8RxVV7+yWmjR3kiZS5q+aTG1STYaD/8Fmf6O 1w== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2whmdy8uj3-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 27 Nov 2019 03:05:15 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 27 Nov 2019 03:05:10 -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 03:05:10 -0800 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.17.96]) by maili.marvell.com (Postfix) with ESMTP id 0152F3F703F; Wed, 27 Nov 2019 03:05:08 -0800 (PST) From: To: CC: , Pavan Nikhilesh Date: Wed, 27 Nov 2019 16:35:07 +0530 Message-ID: <20191127110507.3599-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-dev] [PATCH] event/octeontx: handle partial receive packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" 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. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx/ssovf_worker.h | 17 +++++++++++++++-- drivers/net/octeontx/base/octeontx_pki_var.h | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h index d1d3a52ae..9c715d389 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 ((get_work0 & 0xFFFFFFFF) == 0xFFFFFFFF) { + ssovf_octeontx_wqe_free(get_work1); + return 0; } else { ev->u64 = get_work1; } diff --git a/drivers/net/octeontx/base/octeontx_pki_var.h b/drivers/net/octeontx/base/octeontx_pki_var.h index f4661d24e..2ef98964b 100644 --- a/drivers/net/octeontx/base/octeontx_pki_var.h +++ b/drivers/net/octeontx/base/octeontx_pki_var.h @@ -139,7 +139,7 @@ typedef union octtx_wqe_s { uint64_t l2b : 1; uint64_t l2m : 1; uint64_t raw : 1; - uint64_t err_lev : 3; + uint64_t err_lev : 3; uint64_t op_code : 8; } w2; -- 2.17.1