From patchwork Wed Aug 29 10:47:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 145416 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp522360ljw; Wed, 29 Aug 2018 03:51:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbvC85P9MhV6/jHMCo3E/ysRrjidMveX7ZVSbOfE5XtR4kdfFadfp/xS1P7NPWKvGkZIDqF X-Received: by 2002:adf:9281:: with SMTP id 1-v6mr4102044wrn.69.1535539883496; Wed, 29 Aug 2018 03:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535539883; cv=none; d=google.com; s=arc-20160816; b=KMJwIMF+uA0yJLQzJO81GgswDw50ESE1h7AoFfTCowgnTKqc+0muZxFrOwZvITmbjo z0J30DgIt/y/5ssz8bd734CUwONYwWcrA+uxg2FD1iItIdr7Aw5BGjxPzjHa/rK3/0hg qkPp2aeCJJ1du/IWwkbcgsEETQjxBpswXo3BWpydK350JiReTUqv1oKiPeIG9FWTNpDI Ad4+3hMBrDyQWlc7aiRXsoY7tBLkAyXfWWxnzthKdLNZFPE+mYF7iGhvfqRNsYar5AAP cSootgDhzMfHKnjqXL9Sg3KhcksshHUWHKzrSU96NG82r5M03TiTXIGsQzHKpcfkVI9t PkWw== 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:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature:arc-authentication-results; bh=0hg8V2LlP9afyIJohDdIrDFFCzLnrS57KRv+EsR6KB8=; b=Fca/VSny66qjeEfzSilv3/LHHoIhUVAytoZxhB+oQBD1mB9V/UrkebBQ5kSlVHU8YF yJ8QuPtgRa2TMGN6YLVz/5oZAaADPcrsqYc5prtjKyHn1rg1JLUqlF1CpCBlfVxrZHk9 gp4BiThdjkbg5FN9uNpAwHUh7eYaT7Y6VnquMa0UpmsoLV5ANyPykvZjBg8tMMgwpIJl Hqwn25a815olrJt7g0nuB6apf04wNM2AHmvUa43CcTSy3nrOTJIxjHsCSSG9iPvLVLpW /2QVASFmLk9IIZM726IzO1bjO2ogBeoAekMr2FDxlny+vrBGTDeaNt0FA6xfG3m2U5hn s26A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=eUDyi2gH; 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 80-v6si3367804wmi.124.2018.08.29.03.51.23; Wed, 29 Aug 2018 03:51:23 -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; dkim=fail header.i=@nxp.com header.s=selector1 header.b=eUDyi2gH; 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 9E73A5B2C; Wed, 29 Aug 2018 12:50:04 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00083.outbound.protection.outlook.com [40.107.0.83]) by dpdk.org (Postfix) with ESMTP id 66A3058C6 for ; Wed, 29 Aug 2018 12:49:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0hg8V2LlP9afyIJohDdIrDFFCzLnrS57KRv+EsR6KB8=; b=eUDyi2gHek8sFeFcVuLsdROOSa0WUGYwZFD1MsZa7LM1tCXjit4lM33bH6APNXzSJ5vl2WzfLraBWn4+EMDGWVGEGDxbqEvmqGXjigdWhKxFb2X1QXmuakHkVkk2RvCuFRne32v+Y65fg2a1ma3GKqx3UX/1WNRK7BdG5d9QdAo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.143.30.134) by VI1PR0401MB2543.eurprd04.prod.outlook.com (2603:10a6:800:56::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Wed, 29 Aug 2018 10:49:55 +0000 From: Hemant Agrawal To: dev@dpdk.org, ferruh.yigit@intel.com Cc: dpdk-up@NXP1.onmicrosoft.com Date: Wed, 29 Aug 2018 16:17:37 +0530 Message-Id: <1535539660-20228-11-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535539660-20228-1-git-send-email-hemant.agrawal@nxp.com> References: <1535539660-20228-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: BM1PR0101CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::33) To VI1PR0401MB2543.eurprd04.prod.outlook.com (2603:10a6:800:56::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ef62cf6-2373-4ac1-55ac-08d60d9d289d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4618075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2543; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB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qfZhbPxYIZgMjSSWlyDUspPGDWhOTHW+bxNyCmlT/Kjk+vML0eMnTUktco/ECmp9YQOUHFvf5U53oxgWE/HWwl0LvUi6H+4vndryKx8VGMAhatB0BJRw3GNh7aahyiRx7VuD8EB/XxkyWK56pZ/8YwopRpx62DUJUgEj+L2ePgLi9P+rUUA+fYgJUoBD7UYiMqAxrZOeu8UCcmCGVWjV476GgN7/wnamDIdA3dp5/9cM5taZCtpZru9O/EpxKWafAnO8/H0pegSRFlIU8J+rTXUFO7E9nykNG3mQ/+eQVSC3p1BteGax+JEnxxYuB0MVldgeHB7mDSjjTVhZcgQFOLnnOeSbPsQ; 4:oH6nf1DLpaGf7H/CrLJHX/0LwAb62dlRsNiXyfgN/e7XJw0AiuL4cOSAqumPm/9nceSOkl2fqUNTVK5Ohn58TAWVvhBxtsXCMreV8kWaNbdyH7bn0G8dtnLucsMMK9VYkWo9FYDvefTAjapkCxrtc8pDnHdCTYVq1MBShckCiVuxw4n1uyo3LsWhHsEwcG49CTCovpm/ZAixScl2rZ55SvtYoDgYh/cJ2SQjHzZ9xzBSa1b4t+F0tf0s996NYGZbgO7KmPTGtrTmeFWVennx6kAX/Sv/GDCmQh1C6J/g01YziCqUYSyBUgLaKlGmY3cP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699016); SRVR:VI1PR0401MB2543; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2543; X-Forefront-PRVS: 077929D941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(136003)(366004)(396003)(39860400002)(376002)(189003)(199004)(6512007)(6486002)(16526019)(53936002)(486006)(186003)(11346002)(105586002)(6116002)(106356001)(5660300001)(50466002)(68736007)(5009440100003)(2616005)(25786009)(48376002)(386003)(4326008)(55236004)(6666003)(73566003)(86362001)(956004)(107886003)(446003)(3846002)(26005)(575784001)(6506007)(476003)(316002)(52116002)(50226002)(478600001)(47776003)(66066001)(8936002)(16586007)(76176011)(51416003)(97736004)(44832011)(81166006)(8676002)(7736002)(305945005)(36756003)(81156014)(2906002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2543; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0401MB2543; 23:aMCADvqQDtMlLhHfuL5S/+DUsLu+Io/gKeGwfso?= z6iu7/m1Htw+kV9C1kvjMLgxIrNMlEQGVkDjVQ4V8jYzWe12gDjUUYLA+LL0Gt1f1x8Nokg/p+mKPn6JEPY8UWCUjOFHid7phsaUVJYKw+XA4vq0FzxuvCQ/cw6+N0I1AoKY7ETAQMD131LTbebPufBnQS7qlAvMIKbf53snpAfam6zS5h5lAhNhttrE1ig9UWEL2dg54hbl7kR+tmO7nl3tdpqxNUnuX3uKzGp3v0Rz5K8MyI36oGvEktUthnvegRf9PZPR8sgA0OI52Oi2z4FuvWglhrl8bm5q18zPa0dcwAagdTIGbzw5wUWUg4fUhCQEeu9UavcoXux3cOyGwqGQo2JwS4i0Ws7i2QBJmbrHLvlh5WbpuASCMugxxAo/PQzVlrAqd1+1EbbucvQtmw4sBwgCchqQ7I90BmjJPvkFo2v7xz8xRmw0qQ7gpg5DB7kWrld0s8EL8rkjnyao1K17l8J4LN3U617ZUw5Va81+crgzM2sgBLyzIShaoXxX1shUEmN3RfJzu5IXdBHYXC2F2GKfb+Nv60yidTd8i1OcQOfs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q7iRxldWufp/LfyRVPMUpFEim5PK47cIgc= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2543; 6:4onMcZC59wuDB/0cKc9U0BTt1OVqp2f5AyIVkBGSm9TuYwRV09tmwacoiKRdsM/R7Nvs2zhFgF7EGW8BDhUUwv1aFAlFmPtTOecTWbK+ufc2kVGC4txjU8bQ/gAGwzaeWKBSKFZYdPDD2k9udZYcG5Szpu247lvkKGU7709JJu1mtHzEkJqxyOuPRO7CH8IPYszVwoHTmYsk/tnN9S+KwjvZ2J6lVxki4Q2AwTbB5rCEzKvTniYin4TmaxdyvIge2JS6VKInjVTsoA4HOKAzegSf6PaPzYfyZtKEnTFEODwxIGhE3AuynW8f4fKA0CED3Rw+/EfhESfaMagTv/SczCRK9QjuwEa+uLjnN1vBk+XSh+K4YGplo9HMW4IoqQjdFP1lIFRXb3arppRU8NUZe0SA6HNBAM069+PoLUuyteksvcholKgkJ7XuRZ0sA6OqWRz/IUB9QGKX4QrKIlVkwg==; 5:FVg2E4zpV2mctkzcGLq0kmqi/ZnrGX2YRxAtniobwHnhwr2A2mUlwgACuVE5UtC+jacXfwXpWQUQl9rlTZFUTGBhZWixP/FzamiN7cftDRsKKjL5+UI4GBFMV2Xr2ExNYvgJ9zMqlmswgurvLQzx0KGiuJFQb4bXiioQQbKqBv0=; 7:3neGkaQ1gfPWSReItMmBYfC3clr2iDNmAameW9+iK7QfVorSMW2Zu9pv7bEUJmUt6bOgzeh60pjtiEvZBo6gNwe/epx5KLBc3SJAlotm8AjWEOBap4r3S5Qbdt+7B3Ackw2vdBqE9uESIQhm7a2pmHPS5PhwLKiGeD6WxrXOvX/94MN3xRi0vhC6AE1ChoaFACaVC81wTjhhfcmsR/Iv6GVdBhN9fKVi+0rolpVf87FePHqg8hVYu/B8vHjxudOS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2018 10:49:55.4043 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ef62cf6-2373-4ac1-55ac-08d60d9d289d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2543 Subject: [dpdk-dev] [PATCH 10/13] net/dpaa: separate Rx function for LS1046 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 is to avoid the checks in datapath Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 9 +++++-- drivers/net/dpaa/dpaa_rxtx.c | 60 +++++++++++++++++++++++++++++++++--------- drivers/net/dpaa/dpaa_rxtx.h | 3 +++ 3 files changed, 58 insertions(+), 14 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index df72510..76cd0f7 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -658,8 +658,13 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, "ret:%d(%s)", rxq->fqid, ret, strerror(ret)); return ret; } - rxq->cb.dqrr_dpdk_pull_cb = dpaa_rx_cb; - rxq->cb.dqrr_prepare = dpaa_rx_cb_prepare; + if (dpaa_svr_family == SVR_LS1043A_FAMILY) { + rxq->cb.dqrr_dpdk_pull_cb = dpaa_rx_cb_no_prefetch; + } else { + rxq->cb.dqrr_dpdk_pull_cb = dpaa_rx_cb; + rxq->cb.dqrr_prepare = dpaa_rx_cb_prepare; + } + rxq->is_static = true; } dev->data->rx_queues[queue_idx] = rxq; diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 6698c97..2c57741 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -398,8 +398,9 @@ dpaa_eth_fd_to_mbuf(const struct qm_fd *fd, uint32_t ifid) return mbuf; } +/* Specific for LS1043 */ void -dpaa_rx_cb(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, +dpaa_rx_cb_no_prefetch(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, void **bufs, int num_bufs) { struct rte_mbuf *mbuf; @@ -411,17 +412,13 @@ dpaa_rx_cb(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, uint32_t length; uint8_t format; - if (dpaa_svr_family != SVR_LS1046A_FAMILY) { - bp_info = DPAA_BPID_TO_POOL_INFO(dqrr[0]->fd.bpid); - ptr = rte_dpaa_mem_ptov(qm_fd_addr(&dqrr[0]->fd)); - rte_prefetch0((void *)((uint8_t *)ptr + DEFAULT_RX_ICEOF)); - bufs[0] = (struct rte_mbuf *)((char *)ptr - - bp_info->meta_data_size); - } + bp_info = DPAA_BPID_TO_POOL_INFO(dqrr[0]->fd.bpid); + ptr = rte_dpaa_mem_ptov(qm_fd_addr(&dqrr[0]->fd)); + rte_prefetch0((void *)((uint8_t *)ptr + DEFAULT_RX_ICEOF)); + bufs[0] = (struct rte_mbuf *)((char *)ptr - bp_info->meta_data_size); for (i = 0; i < num_bufs; i++) { - if (dpaa_svr_family != SVR_LS1046A_FAMILY && - i < num_bufs - 1) { + if (i < num_bufs - 1) { bp_info = DPAA_BPID_TO_POOL_INFO(dqrr[i + 1]->fd.bpid); ptr = rte_dpaa_mem_ptov(qm_fd_addr(&dqrr[i + 1]->fd)); rte_prefetch0((void *)((uint8_t *)ptr + @@ -458,6 +455,46 @@ dpaa_rx_cb(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, } } +void +dpaa_rx_cb(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, + void **bufs, int num_bufs) +{ + struct rte_mbuf *mbuf; + const struct qm_fd *fd; + struct dpaa_if *dpaa_intf; + uint16_t offset, i; + uint32_t length; + uint8_t format; + + for (i = 0; i < num_bufs; i++) { + fd = &dqrr[i]->fd; + dpaa_intf = fq[0]->dpaa_intf; + + format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> + DPAA_FD_FORMAT_SHIFT; + if (unlikely(format == qm_fd_sg)) { + bufs[i] = dpaa_eth_sg_to_mbuf(fd, dpaa_intf->ifid); + continue; + } + + offset = (fd->opaque & DPAA_FD_OFFSET_MASK) >> + DPAA_FD_OFFSET_SHIFT; + length = fd->opaque & DPAA_FD_LENGTH_MASK; + + mbuf = bufs[i]; + mbuf->data_off = offset; + mbuf->data_len = length; + mbuf->pkt_len = length; + mbuf->port = dpaa_intf->ifid; + + mbuf->nb_segs = 1; + mbuf->ol_flags = 0; + mbuf->next = NULL; + rte_mbuf_refcnt_set(mbuf, 1); + dpaa_eth_packet_info(mbuf, mbuf->buf_addr); + } +} + void dpaa_rx_cb_prepare(struct qm_dqrr_entry *dq, void **bufs) { struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(dq->fd.bpid); @@ -468,8 +505,7 @@ void dpaa_rx_cb_prepare(struct qm_dqrr_entry *dq, void **bufs) * So we prefetch the annoation beforehand, so that it is available * in cache when accessed. */ - if (dpaa_svr_family == SVR_LS1046A_FAMILY) - rte_prefetch0((void *)((uint8_t *)ptr + DEFAULT_RX_ICEOF)); + rte_prefetch0((void *)((uint8_t *)ptr + DEFAULT_RX_ICEOF)); *bufs = (struct rte_mbuf *)((char *)ptr - bp_info->meta_data_size); } diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index 6de70a7..75b093c 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -270,4 +270,7 @@ void dpaa_rx_cb(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, void **bufs, int num_bufs); void dpaa_rx_cb_prepare(struct qm_dqrr_entry *dq, void **bufs); + +void dpaa_rx_cb_no_prefetch(struct qman_fq **fq, + struct qm_dqrr_entry **dqrr, void **bufs, int num_bufs); #endif