From patchwork Fri Jul 10 16:21:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 235248 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp602380ilg; Fri, 10 Jul 2020 09:26:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKykmmDuBzrRp3ZWfBEr6BB8xTmZlcRCnC/DuVBIqSXxxrZD689eYMEICnctRuBu/HCHf3 X-Received: by 2002:a17:906:b888:: with SMTP id hb8mr61332248ejb.124.1594398365051; Fri, 10 Jul 2020 09:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594398365; cv=none; d=google.com; s=arc-20160816; b=fQJcZ1e0Y5Ffb/vtO3bcnW3PzInAr4rp1EVI/Fb5bzGf4QILfGvFy8qXRcL0pTrmYy eVTLGVfdDadBed4rgk5J8lQCkpd+A+uFF7t5jd9s42x+ghf+Lu36vsDywezLvmoEwjJL RW3g/o6aZhiZ5LbpAutYR9WuorOM56zmABaNsvUY0BrlOchUE0YUUUkZ09TqHgvBXaom z0iuTbNM9sldGfR+DF/Xoz8zRGn3Ir6t61bOMZ+ctprLnveDGAVAzCPzVk7AauhHuU+T P4VUd77eA435Uipuc/+4FvZ3ja24j96xPanKvfVUzZ9rUzM4IEaFfT1PVW7pGQ2INiI4 VAJg== 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=0PDkPSuUhvPFbzOxOeM9s8KmCPD8Mum2D7I3M7m4bM8=; b=sqTaf4FrLuycz+IxtIVbDvLcyx8am8nY/23DNtW4G6Z0l0vFbLwmqO4+ZFn5pGSrj/ LkIrYzlGHxDmof4J54vnprYdDHvhguLhlLh07g1kNQ36f222yGn6EH+oxFNUtWyeKhG+ il5JHHcD0fxu1nIfpoIHsZTDl3Ma7TfRojNABBJ/812Iia7FEqLJCM7Twi3yLutE3Bkm 2ug6rb8ZzhHsCh6tvH2L6tq8RLYz9+vH2qTz+46ioqVoDvu1I7uTeRa7L6gVnQSNuzC9 sKoMoD2YhCo8WDbQaiq9qdTxK3BaejeAat6WaxpBtqRG6OrzhdtD2dwhgJbZWsGBhYWH w2xA== 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 w23si4621816eds.47.2020.07.10.09.26.04; Fri, 10 Jul 2020 09:26:05 -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 95BDC1D9E5; Fri, 10 Jul 2020 18:25:59 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id E04641D9A4 for ; Fri, 10 Jul 2020 18:25:56 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id BC6261A04BF; Fri, 10 Jul 2020 18:25:56 +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 0A0B91A04AF; Fri, 10 Jul 2020 18:25:55 +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 734A7402D3; Sat, 11 Jul 2020 00:25:52 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Hemant Agrawal Date: Fri, 10 Jul 2020 21:51:30 +0530 Message-Id: <20200710162137.22973-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710162137.22973-1-hemant.agrawal@nxp.com> References: <20200710162137.22973-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/9] net/dpaa2: support per port Rx mbuf timestamp 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" DEV_RX_OFFLOAD_TIMESTAMP is per port, so the internal implementation shall enable it on per port basis only. Signed-off-by: Hemant Agrawal --- doc/guides/nics/features/dpaa2.ini | 2 ++ drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++-- drivers/net/dpaa2/dpaa2_ethdev.h | 2 +- drivers/net/dpaa2/dpaa2_rxtx.c | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini index 3685e2e02..831883d21 100644 --- a/doc/guides/nics/features/dpaa2.ini +++ b/doc/guides/nics/features/dpaa2.ini @@ -21,6 +21,8 @@ VLAN offload = Y L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y +Timesync = Y +Timestamp offload = Y Basic stats = Y Extended stats = Y FW version = Y diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index c530596cd..3e5502de5 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -64,7 +64,7 @@ static uint64_t dev_tx_offloads_nodis = DEV_TX_OFFLOAD_MULTI_SEGS; /* enable timestamp in mbuf */ -bool dpaa2_enable_ts; +bool dpaa2_enable_ts[RTE_MAX_ETHPORTS]; struct rte_dpaa2_xstats_name_off { char name[RTE_ETH_XSTATS_NAME_SIZE]; @@ -525,7 +525,7 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) #if !defined(RTE_LIBRTE_IEEE1588) if (rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP) #endif - dpaa2_enable_ts = true; + dpaa2_enable_ts[dev->data->port_id] = true; if (tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) tx_l3_csum_offload = true; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 2e6d26d4f..e577355d5 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -91,7 +91,7 @@ #define DPAA2_PKT_TYPE_VLAN_2 0x0260 /* enable timestamp in mbuf*/ -extern bool dpaa2_enable_ts; +extern bool dpaa2_enable_ts[]; #define DPAA2_QOS_TABLE_RECONFIGURE 1 #define DPAA2_FS_TABLE_RECONFIGURE 2 diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 86cb95268..4dd1d5f57 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -108,7 +108,7 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd, m->hash.rss = fd->simple.flc_hi; m->ol_flags |= PKT_RX_RSS_HASH; - if (dpaa2_enable_ts) { + if (dpaa2_enable_ts[m->port]) { m->timestamp = annotation->word2; m->ol_flags |= PKT_RX_TIMESTAMP; DPAA2_PMD_DP_DEBUG("pkt timestamp:0x%" PRIx64 "", m->timestamp);