From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5E8ACA0C46; Wed, 9 Jun 2021 13:06:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D04294069B; Wed, 9 Jun 2021 13:06:38 +0200 (CEST) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id A06AA4003C for ; Wed, 9 Jun 2021 13:06:37 +0200 (CEST) Received: by mail-pj1-f41.google.com with SMTP id d5-20020a17090ab305b02901675357c371so1181998pjr.1 for ; Wed, 09 Jun 2021 04:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=M/dJtGLjstvTcMfupPz1aea7zTxYnWXjl3LqPjUJkQg=; b=hq6g8K7FO8cSo0Z5xqF414kz7sIZwE9oN2EMuHIFkAXeBXGT9Vl9ja4/f/DahuwzKA De5G2T9bD80KlrUiX1Wd0zeIwEHN/eUwvBZVRtowMGJwVrWP3tCuv28zuO9umLUgd9BI px4JeyDf3oZRsVsQn5WUuj5Gd9ZtHn89iq0ryuphQynwXPQAMLMIBs8ulIDj2zkl3bhS 0L2AN05B+3odQWQUBZM/h1LxLukAZ1lIuG8Qybs240PA+0pgVE/TNXwNDd6YnJwoG9zC N2Aw2owUn9VUkknbzgynHgIcMijc+VDRsSYkYjnozMcUQ8MHTuMKQuteYe6KGnZeGjqJ B9jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=M/dJtGLjstvTcMfupPz1aea7zTxYnWXjl3LqPjUJkQg=; b=QRtFeQQkD+UCb6wCRrZDVbg0quLvNshRaWgNRNFkuYO0UrGnstGz2pjHDpf+COo/wp 3rFFVsn0DYEvtjELBvhTXVYtyna79arkpuk/mBGF03LD6uXziRN+45+vrLPKHGHrfZ2l F34Tp55jIZaCLM6aWHVxLZTNRONTMjAxGx1u9F8CcnTkO44rW1zCCaKNSHnbz0myth3J s0MQk7E0pjwDHEvaqrpOGKhSdiA3jO68BevJqI0oB6cNst9VnuHT8Uqh9QUiYwnaXVWA cAFtBcrw3qlZJ2Eog9N1roPrdbRH33lsoJ5eUCV1jkvpr73BnNd/o+FMB4WAhTElKhkB K9lA== X-Gm-Message-State: AOAM531x/Cx8TIxuVozd6xy/sYxgJLPI3McKHXZFhTSTu2P9iFra+pIj gyVvTNTxVPNvFxBBps13PA0= X-Google-Smtp-Source: ABdhPJyK/30LC7nQuno8WaUutzRAzLQVpHW0t0Tc60G3GHZTis9MQ/TEc2ezHoUqFMMnhQw47OKw9w== X-Received: by 2002:a17:902:7d8f:b029:116:4b69:c7c5 with SMTP id a15-20020a1709027d8fb02901164b69c7c5mr413576plm.58.1623236796720; Wed, 09 Jun 2021 04:06:36 -0700 (PDT) Received: from gmail.com ([1.6.215.26]) by smtp.gmail.com with ESMTPSA id t1sm2577952pjs.20.2021.06.09.04.06.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jun 2021 04:06:36 -0700 (PDT) Date: Wed, 9 Jun 2021 16:36:11 +0530 From: Nithin Dabilpuram To: Pavan Nikhilesh Bhagavatula Cc: "dev@dpdk.org" , Jerin Jacob Kollanukkaran , Sunil Kumar Kori , Satha Koteswara Rao Kottidi , Kiran Kumar Kokkilagadda , Satheesh Paul , Ashwin Sekhar Thalakalath Kottilveetil Message-ID: References: <20210306153404.10781-1-ndabilpuram@marvell.com> <20210607175943.31690-1-ndabilpuram@marvell.com> <20210607175943.31690-56-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v2 55/62] net/cnxk: add base PTP timesync support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On Tue, Jun 08, 2021 at 12:04:45PM +0000, Pavan Nikhilesh Bhagavatula wrote: > > > > > >+static __rte_always_inline void > >+cn10k_nix_xmit_prepare_tstamp(uintptr_t lmt_addr, const uint64_t > >*cmd, > >+ const uint64_t ol_flags, const uint16_t > >no_segdw, > >+ const uint16_t flags) > >+{ > >+ if (flags & NIX_TX_OFFLOAD_TSTAMP_F) { > >+ const uint8_t is_ol_tstamp = !(ol_flags & > >PKT_TX_IEEE1588_TMST); > >+ struct nix_send_ext_s *send_hdr_ext = > >+ (struct nix_send_ext_s > >*)lmt_addr + 16; > >+ uint64_t *lmt = (uint64_t *)lmt_addr; > >+ uint16_t off = (no_segdw - 1) << 1; > >+ struct nix_send_mem_s *send_mem; > >+ > >+ send_mem = (struct nix_send_mem_s *)(lmt + off); > >+ send_hdr_ext->w0.subdc = NIX_SUBDC_EXT; > >+ send_hdr_ext->w0.tstmp = 1; > >+ if (flags & NIX_TX_MULTI_SEG_F) { > >+ /* Retrieving the default desc values */ > >+ lmt[off] = cmd[2]; > >+ > >+ /* Using compiler barier to avoid voilation of C > >+ * aliasing rules. > >+ */ > >+ rte_compiler_barrier(); > >+ } > >+ > >+ /* Packets for which PKT_TX_IEEE1588_TMST is not set, > >tx tstamp > >+ * should not be recorded, hence changing the alg type > >to > >+ * NIX_SENDMEMALG_SET and also changing send mem > >addr field to > >+ * next 8 bytes as it corrpt the actual tx tstamp > >registered > >+ * address. > >+ */ > >+ send_mem->w0.subdc = NIX_SUBDC_MEM; > >+ send_mem->w0.alg = NIX_SENDMEMALG_SETTSTMP - > >(is_ol_tstamp); > >+ send_mem->addr = (rte_iova_t)((uint64_t *)cmd[3]); > > Missing address increment for non-tstmp packets here. Ack, will fix it. > > >+ } > >+} > >+ > > > > > static __rte_always_inline void > >+cn9k_nix_xmit_prepare_tstamp(uint64_t *cmd, const uint64_t > >*send_mem_desc, > >+ const uint64_t ol_flags, const uint16_t > >no_segdw, > >+ const uint16_t flags) > >+{ > >+ if (flags & NIX_TX_OFFLOAD_TSTAMP_F) { > >+ struct nix_send_mem_s *send_mem; > >+ uint16_t off = (no_segdw - 1) << 1; > >+ const uint8_t is_ol_tstamp = !(ol_flags & > >PKT_TX_IEEE1588_TMST); > >+ > >+ send_mem = (struct nix_send_mem_s *)(cmd + off); > >+ if (flags & NIX_TX_MULTI_SEG_F) { > >+ /* Retrieving the default desc values */ > >+ cmd[off] = send_mem_desc[6]; > >+ > >+ /* Using compiler barier to avoid voilation of C > >+ * aliasing rules. > >+ */ > >+ rte_compiler_barrier(); > >+ } > >+ > >+ /* Packets for which PKT_TX_IEEE1588_TMST is not set, > >tx tstamp > >+ * should not be recorded, hence changing the alg type > >to > >+ * NIX_SENDMEMALG_SET and also changing send mem > >addr field to > >+ * next 8 bytes as it corrpt the actual tx tstamp > >registered > >+ * address. > >+ */ > >+ send_mem->w0.cn9k.alg = > >+ NIX_SENDMEMALG_SETTSTMP - > >(is_ol_tstamp); > >+ > >+ send_mem->addr = (rte_iova_t)((uint64_t > >*)send_mem_desc[7] + > >+ (is_ol_tstamp)); > > Need to increment by at-least 8 bytes. Ack. > > >+ } > >+} > >+ > >