From patchwork Fri Jul 19 10:06:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 169238 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3641232ilk; Fri, 19 Jul 2019 03:07:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7txd0KKj03E6hGZYZM/a+rbbndVbdAbTaECTUj3emUX2/6VH20+fr34wt9oaoKioEx+66 X-Received: by 2002:a50:84a1:: with SMTP id 30mr45879086edq.44.1563530856908; Fri, 19 Jul 2019 03:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563530856; cv=none; d=google.com; s=arc-20160816; b=sAsQ74roq7pjMWWnmBRFN9qgAtlsKHkLJ9duVnakEzAyvCogX1O21B4fYgynQUqL2e eaFtKG/71yxMLXsz4NMFyaczC5ugrmY9pjnmIcq51o/bkFBJkIkNWn0fMiDDXvF9NN2W rhddrxCfcA0x151HCrKosL9fOvKhn3zwdm3YtM1Gbn2yWUTBAF3uF/hxhTFEtuqvGO+u Yk76LkIPq54CfINB1XaEuKQqH2b1C61Z8GSGBt0hVl94a0jxqO4oGHAUQXZMdcD3Cdqh +taN46AIUXP0GuKJiA6GwTfJwuelGDa3oJVeka3+GGPTFp9jBXMIGPKB6MGGOgRPVhz+ NCqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:cc:to :from; bh=o0Z/JLWu7k6uzo+UPTIuJtyky/lek2cPm7GFhsgueKA=; b=JOm3I54Bw5S1xUU+FfjkQTgTE6rBKb84G5ofgCxV3B+4TBuIMFgU6Xs14MTv9HEh2n e5e0f3QG8wG8PF7XOep/ydJJxba1J+3YZY76WOhRwsdr7GtOfNgydT6gW6iTbD3DWcQW wcJMKtwXXhlkX+THaynZBSNqj9MeqzbF05m5kNoblhxPnLpHt7Nx3oUG85uhd8tbq+N5 FO0XwDRGjYul07bX08Kkz69OdV5VYR0AwlDfDAYjW+a1ujbav8uhSFEohHqKa0KHCLnc MHy4KjqwHmAWmCVYGgP4TN4X+mVP605nMayqIagQDb9Lasz9n3Vx+BFRkaQQwONTK0F1 33pQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id f36si630393edd.292.2019.07.19.03.07.36; Fri, 19 Jul 2019 03:07:36 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6FF99374E; Fri, 19 Jul 2019 12:07:33 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id B553B137C; Fri, 19 Jul 2019 12:07:32 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3BACA1A01C1; Fri, 19 Jul 2019 12:07:32 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 242801A0144; Fri, 19 Jul 2019 12:07:30 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 80B17402CF; Fri, 19 Jul 2019 18:07:26 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, ferruh.yigit@intel.com Cc: stable@dpdk.org Date: Fri, 19 Jul 2019 15:36:08 +0530 Message-Id: <20190719100609.30074-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 1/2] net/dpaa: fix to add SG check for ext bufs pkts 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" This patch add check to return error as the handling for external buffer packets with SG is currently missing. Fixes: 37f9b54bd3cf ("net/dpaa: support Tx and Rx queue setup") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_rxtx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.17.1 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index f16b7e0bc..30b183607 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -957,6 +957,16 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) goto send_pkts; } } else { + /* TODO not supporting sg for external bufs*/ + if (unlikely(mbuf->nb_segs > 1)) { + /* Set frames_to_send & nb_bufs so + * that packets are transmitted till + * previous frame. + */ + frames_to_send = loop; + nb_bufs = loop; + goto send_pkts; + } state = tx_on_external_pool(q, mbuf, &fd_arr[loop]); if (unlikely(state)) { From patchwork Fri Jul 19 10:06:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 169239 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3641405ilk; Fri, 19 Jul 2019 03:07:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbdCTIHVyC9GUrpxQ5Oa+yp8HbMkxOxlasafnHff36J2BaohpUnlbqzICr3i/KGVWV9Hi1 X-Received: by 2002:a17:906:1596:: with SMTP id k22mr27320847ejd.102.1563530864645; Fri, 19 Jul 2019 03:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563530864; cv=none; d=google.com; s=arc-20160816; b=kEW/jpVUC84IMcjrHXAQPze6ykovXtQpme9WWpDAMkTO61Sgz7XJlyBiQsJ0H9uLX7 Hr/J9s8w+Qq9yIIACcLZw/4AndR6IMORIoTeUS5KNRS8Y167l2ZiS+4dUUh3exRDl2x5 /9GPqRzCcexFPu0jdK6QlgwljBm5vFqyxTeR/DnOqkd7ncU5g6rTEDeZnVO8Livgthx/ KKcI7z+uwGW0/vHkZuHXDjkuMgRKkZ3rfj8Ahiw0vbWYluHKtopJcBOOFc9Md7W+DXjS BFyb0jC+aZ48UozIzXd73sakopInD1XDGTG6kWdFCAt90v0GNeGAYYgcSBYKe7yOsW4X j8kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=GCIqYa/CDpuPlGhrD/G2wsk4Zp3JwVWkKyXm/x03WeI=; b=GhDoKNxNQEYf5GBxmCxQ6ht7YtUM+pOzM5qv3lt7cAJXt3mZ5IynqmBXUOYbXh+o45 NLwVchmm+HPZfjIU5AvbxK/CcEzkMNc6VqXMXP3Xypu0UaI59fhbocc5olbGXRckevpv kG5cXSQbZrt/um4RijXdPhQbgNJ1Lw13SL0jEYzG6bv8oyrA3LzHsJeiHA2C6gFhTPIY bDq5TZchh+0iP8zmhZlcYaQBi8mfK7tfkBiwOLQVv/ZUYhrBAVhC05+eJHI/WGEQBrTv QIxZlOa4QqFBK3u1g1oib8OTzB+Q3K+u1c7Hy4MogFyH07cBUnllhcsusu2SfBMK9O4z 5OtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id h53si401355edh.114.2019.07.19.03.07.44; Fri, 19 Jul 2019 03:07:44 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B01CB1B4B6; Fri, 19 Jul 2019 12:07:37 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id A436E5B3C; Fri, 19 Jul 2019 12:07:34 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E0ED32000D0; Fri, 19 Jul 2019 12:07:33 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5A7902000A4; Fri, 19 Jul 2019 12:07:31 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 3CE9F402D5; Fri, 19 Jul 2019 18:07:27 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Nipun Gupta , stable@dpdk.org Date: Fri, 19 Jul 2019 15:36:09 +0530 Message-Id: <20190719100609.30074-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190719100609.30074-1-hemant.agrawal@nxp.com> References: <20190719100609.30074-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/2] net/dpaa2: fix the ctrl bits in Tx SG FD 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: Nipun Gupta This patch resets frc and ctrl in sg tx fd to avoid corruption. Fixes: 774e9ea91992 ("net/dpaa2: add support for multi seg buffers") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta --- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 1 + drivers/net/dpaa2/dpaa2_rxtx.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 92fc76211..8644761db 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -229,6 +229,7 @@ enum qbman_fd_format { ((fd)->simple.frc = (0x80000000 | (len))) #define DPAA2_GET_FD_FRC_PARSE_SUM(fd) \ ((uint16_t)(((fd)->simple.frc & 0xffff0000) >> 16)) +#define DPAA2_RESET_FD_FRC(fd) ((fd)->simple.frc = 0) #define DPAA2_SET_FD_FRC(fd, _frc) ((fd)->simple.frc = _frc) #define DPAA2_RESET_FD_CTRL(fd) ((fd)->simple.ctrl = 0) diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index c6e50123c..6ca5071e0 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -370,8 +370,9 @@ eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, DPAA2_SET_FD_LEN(fd, mbuf->pkt_len); DPAA2_SET_ONLY_FD_BPID(fd, bpid); DPAA2_SET_FD_OFFSET(fd, temp->data_off); - DPAA2_SET_FD_ASAL(fd, DPAA2_ASAL_VAL); DPAA2_FD_SET_FORMAT(fd, qbman_fd_sg); + DPAA2_RESET_FD_FRC(fd); + DPAA2_RESET_FD_CTRL(fd); /*Set Scatter gather table and Scatter gather entries*/ sgt = (struct qbman_sge *)( (size_t)DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd))