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 B8839A0521; Tue, 3 Nov 2020 11:53:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 92C9CC926; Tue, 3 Nov 2020 11:53:02 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 1202AC918 for ; Tue, 3 Nov 2020 11:53:00 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A3AoJ8K021442; Tue, 3 Nov 2020 02:52:59 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=pfpt0220; bh=h9sYbQ3uiQrqYh+MahWHsOuM2RoId7kNMrWBKqNeBiw=; b=fdnojQMljL7iqNdoXjBaK0CrmTvgg+5lbbutbHAcYnf73COvjWX2MmgHN7hBPfyq3HEx SpmWklhqzQ9BRx91B1rbg+MKKPW1M9FMu1BmX4APxpVhHjgojRdthmpMqvA8KLDYdCk2 trwzHcnrr+xVucNmZsiKn9PoDIa3cY6UIE4TsCI+puU9xwLIkdeMRjRAL304qrgb8fgX c4iX95/PMXsKbTSdeKzr3ICKktNA07PVYtQ4+77qTgADy9bXssRDvZ3Ra90kS6Sx3JPk IlUx2Pzy8dIIGpjAZEBoxZ7OSufDJuFNaJIwOSGALxJwuyy5EtNcdmLeaDmJks1jd/2E jA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 34h7envhse-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 03 Nov 2020 02:52:59 -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.1497.2; Tue, 3 Nov 2020 02:52:57 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Tue, 3 Nov 2020 02:52:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ue3wzKuH8LZfNp/kkXiByCBdrCrGeYqvPvvJdYgoTNt8GvbVeFwDL8MoiDnMnzOaCsrQjUdTidH5T66E4uX+jq2Q9W1bb0YH7q4yTo5TFQfgkL5qFsPqFZa8SXEJYAMpF26vE+9U1/WlmvhtnkdbskIbrsNQ9hfEVPbiaQxO9UebjVnqSSjbN2esmGbOz8hyuIabapYMJ0hgdPyR/7G4GEzbs1+JPHN65Epenuu0L7kR675FhQ4kLwcS34zwQhfQTjBHDNPaGXB4hShvSdj5GiKPe0MOWS6GZ+nJZsvMAZGRzknpolyS7WT8MF/2aTWQ17Zktw/wYfXF+k+R78VI1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h9sYbQ3uiQrqYh+MahWHsOuM2RoId7kNMrWBKqNeBiw=; b=RQGq6kHZxdwvPo1To1tASRP7KD5M9hdlSvBPuHx0CRqoRQIh4+6LDrQcvh1+i72vCGZHGLyBgWZiYYzJ9BYMV7mkcrKcJZbpFm8f24Hu78JhKqkE00e2sUCfaaNNptkqkyWMBy1G3G2pN5lBKxUCdySZhfhm74osCVbKG0BYIno+k7VvKjDo1XdVDycLLPR8jZGvbY/jBkn6ZS1TF482cMsm/PyI/9CtwjqoAkHkVMdcgjWBnL+Q0HVLNrn0Wes3LXDP49NREm+UznNYP2s8MZzzjmmvdMmzcTXRx+PAB2823VPxWowkoF8bRe+Zmg4f/pNDb6RZG7X2SgypsCxHeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h9sYbQ3uiQrqYh+MahWHsOuM2RoId7kNMrWBKqNeBiw=; b=t8I4Ql1aMNDb+UMG3sCeUUzPT7SDhRIMtKxFaGrQUzRT93HJUAeWbm4YUZ9YIPRDyhRhLf87LhQ+wgdnIjk3eYU0Cfuzjmot4DOjznUHywjC3RWHonu2ZIJ/sqDr1en+wKxthQLvqubojGJk1+3a9Jeyso2KqaX7y41b2LkbQig= Authentication-Results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=marvell.com; Received: from CO6PR18MB3842.namprd18.prod.outlook.com (2603:10b6:5:341::16) by MWHPR18MB1646.namprd18.prod.outlook.com (2603:10b6:300:cf::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.29; Tue, 3 Nov 2020 10:52:53 +0000 Received: from CO6PR18MB3842.namprd18.prod.outlook.com ([fe80::b960:6770:a1:2a19]) by CO6PR18MB3842.namprd18.prod.outlook.com ([fe80::b960:6770:a1:2a19%7]) with mapi id 15.20.3499.032; Tue, 3 Nov 2020 10:52:53 +0000 Date: Tue, 3 Nov 2020 16:22:37 +0530 From: Harman Kalra To: Thomas Monjalon CC: , , , , , , , , Nithin Dabilpuram , Kiran Kumar K Message-ID: <20201103105235.GA65452@outlook.office365.com> References: <20201029092751.3837177-1-thomas@monjalon.net> <20201103001407.2931963-1-thomas@monjalon.net> <20201103001407.2931963-10-thomas@monjalon.net> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201103001407.2931963-10-thomas@monjalon.net> User-Agent: Mutt/1.10.0 (2018-05-17) X-Originating-IP: [1.6.215.26] X-ClientProxiedBy: BM1PR0101CA0045.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::31) To CO6PR18MB3842.namprd18.prod.outlook.com (2603:10b6:5:341::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from outlook.office365.com (1.6.215.26) by BM1PR0101CA0045.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Tue, 3 Nov 2020 10:52:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b1af98fa-21ef-463a-2604-08d87fe69d41 X-MS-TrafficTypeDiagnostic: MWHPR18MB1646: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zLS73V7rObwXFhrpnncGmhNsAANu8KqusXqraR3AgENLRYH1/qhWhKNaHujKaImbl5485BP6CNOevpy4p2r3W+RvmS6OMiJ+b55h6zaVvDZV1wIhbLXtoWoHSSPqAautbQCYTpJZJeRn/8He+mFZo5qz/OshcJ8RiLauYv3MkULSupzMmPL9s8pmLecv8id7HTfteoIBKPmB2Y4Q/HGITZCdqXo4lYEY2Nwsp9kB853lPNc/J4qvH75YGlDp8H8wO9lDmuLK2YuLo+/dOMJM+YFsi7AWwRA9UswKUZKPVEpCwntKVTX06XV7OypKF3mhhtgkQqMXMZpLOaUlC3I2DeRpoOx8MZuKVXxDMMkPbpd0bZurKIZ7BraUXzx4BDKEw4NQljnEo2aV0w3ah93Ltw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB3842.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(396003)(39860400002)(366004)(376002)(86362001)(6666004)(16526019)(1006002)(186003)(26005)(8676002)(5660300002)(6506007)(6916009)(8936002)(4326008)(33656002)(7696005)(52116002)(478600001)(107886003)(2906002)(55016002)(9686003)(316002)(956004)(1076003)(54906003)(66476007)(66946007)(66556008)(83380400001)(36456003)(42976004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: s5LxIy1aQgPBmMcZeUFIa+pcA8lRGbkVJ0OSo7Y3oLDxJQ7qaHnaCR05NEeQCVRJ7ArN7JpaD1AnKLGQQQJgQBJDeisra03u7LJ0dnC6yMWd1Zi/9yYo9OYw6vMR6epcPL2EnK3KWlp+VABiaxJh/bbd6f9PAzdjlcZHpxBoLEl6hhjI0mZCHdSvyiL0RYGrEL//flg/qU2sCgw4+5BS17FCsVf4Xk7U1T61V+Fd0lH8UqMa9Ast4SJK9M8VJWYE9n9da+A+zVi/7F9HCnIEFHLkpBBwgBvGv9bYDohd4xiDO3/Fy992xY5mUWtOq0Ni5R77ATCKLvcSuBvQ/jhR6iYoQvUZOV900ykQCiyzptQc1YvR9nfL3W3KrN44SLHFhfvWW1nP0XcbJ69fg0VhMtGalkTpCudpOgs5I8VtD6cWM29FOW+aiZlmNWbfHqfBjoZ8ucqvKQL6zGPNtAv0jkn/d7ss8KuhzvreAVp5k9RyYfO5AD9glzfQKGg78xzpAeWUSjCqPSbyz/Lq8kqoYNmRDCl5HSwtDb97hHull/LAZFMWrr1qM1fIfsXQGzcrfkwWT0pCVM+KKncPFNFBKNd+IF4VlJjwU/K5yx4P6gcnCvQlg1B4lHAkpURbEQDd X-MS-Exchange-CrossTenant-Network-Message-Id: b1af98fa-21ef-463a-2604-08d87fe69d41 X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB3842.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2020 10:52:53.2573 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: H3BenYGUloaRV5u01IX8BM0I2Tn9Ny9BBHm42+kbhGbuzcVpXBJd7dGHqJx6Jebc3c8krOkpmslas6jTy00zDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR18MB1646 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-03_07:2020-11-03, 2020-11-03 signatures=0 Subject: Re: [dpdk-dev] [PATCH v3 09/16] net/octeontx2: switch Rx timestamp to dynamic mbuf field 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" On Tue, Nov 03, 2020 at 01:14:00AM +0100, Thomas Monjalon wrote: > The mbuf timestamp is moved to a dynamic field > in order to allow removal of the deprecated static field. > The related mbuf flag is also replaced. > > The dynamic offset and flag are stored in struct otx2_timesync_info > to favor cache locality. > > Signed-off-by: Thomas Monjalon Hi Thomas, With the following changes, ptpclient and testpmd(ieee1588 mode) is crashing for us. I am debugging the issue and will update soon. ------------------ Steps to reproduce: 1. Testpmd: ./dpdk-testpmd -c 0xffff01 -n 4 -w 0002:05:00.0 -- -i --port-topology=loop testpmd> set fwd ieee1588 testpmd> set port 0 ptype_mask 0xf testpmd> start I am sending ptp packets using scapy from the peer: >>> p = Ether(src='98:03:9b:67:b0:d0', dst='FA:62:0C:27:AD:BC', >>> type=35063)/Raw(load='\x00\x02') >>> sendp (p, iface="p5p2") I am observing seg fault even for 1 packet. 2. ./ptpclient -l 1 -n 4 -w 0002:05:00.0 -- -p 0xf -- on board ptp4l -E -2 -H -i p5p2 -m -q -p /dev/ptp4 ... on peer Thanks Harman > --- > drivers/net/octeontx2/otx2_ethdev.c | 10 ++++++++++ > drivers/net/octeontx2/otx2_rx.h | 19 ++++++++++++++++--- > 2 files changed, 26 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c > index cfb733a4b5..f6962be9b2 100644 > --- a/drivers/net/octeontx2/otx2_ethdev.c > +++ b/drivers/net/octeontx2/otx2_ethdev.c > @@ -2219,6 +2219,16 @@ otx2_nix_dev_start(struct rte_eth_dev *eth_dev) > else > otx2_nix_timesync_disable(eth_dev); > > + if (dev->rx_offload_flags & NIX_RX_OFFLOAD_TSTAMP_F) { > + rc = rte_mbuf_dyn_rx_timestamp_register( > + &dev->tstamp.tstamp_dynfield_offset, > + &dev->tstamp.rx_tstamp_dynflag); > + if (rc != 0) { > + otx2_err("Failed to register Rx timestamp field/flag"); > + return -rte_errno; > + } > + } > + > /* Update VF about data off shifted by 8 bytes if PTP already > * enabled in PF owning this VF > */ > diff --git a/drivers/net/octeontx2/otx2_rx.h b/drivers/net/octeontx2/otx2_rx.h > index 61a5c436dd..926f614a4e 100644 > --- a/drivers/net/octeontx2/otx2_rx.h > +++ b/drivers/net/octeontx2/otx2_rx.h > @@ -49,6 +49,8 @@ struct otx2_timesync_info { > uint64_t rx_tstamp; > rte_iova_t tx_tstamp_iova; > uint64_t *tx_tstamp; > + uint64_t rx_tstamp_dynflag; > + int tstamp_dynfield_offset; > uint8_t tx_ready; > uint8_t rx_ready; > } __rte_cache_aligned; > @@ -63,6 +65,14 @@ union mbuf_initializer { > uint64_t value; > }; > > +static inline rte_mbuf_timestamp_t * > +otx2_timestamp_dynfield(struct rte_mbuf *mbuf, > + struct otx2_timesync_info *info) > +{ > + return RTE_MBUF_DYNFIELD(mbuf, > + info->tstamp_dynfield_offset, rte_mbuf_timestamp_t *); > +} > + > static __rte_always_inline void > otx2_nix_mbuf_to_tstamp(struct rte_mbuf *mbuf, > struct otx2_timesync_info *tstamp, const uint16_t flag, > @@ -77,15 +87,18 @@ otx2_nix_mbuf_to_tstamp(struct rte_mbuf *mbuf, > /* Reading the rx timestamp inserted by CGX, viz at > * starting of the packet data. > */ > - mbuf->timestamp = rte_be_to_cpu_64(*tstamp_ptr); > + *otx2_timestamp_dynfield(mbuf, tstamp) = > + rte_be_to_cpu_64(*tstamp_ptr); > /* PKT_RX_IEEE1588_TMST flag needs to be set only in case > * PTP packets are received. > */ > if (mbuf->packet_type == RTE_PTYPE_L2_ETHER_TIMESYNC) { > - tstamp->rx_tstamp = mbuf->timestamp; > + tstamp->rx_tstamp = > + *otx2_timestamp_dynfield(mbuf, tstamp); > tstamp->rx_ready = 1; > mbuf->ol_flags |= PKT_RX_IEEE1588_PTP | > - PKT_RX_IEEE1588_TMST | PKT_RX_TIMESTAMP; > + PKT_RX_IEEE1588_TMST | > + tstamp->rx_tstamp_dynflag; > } > } > } > -- > 2.28.0 >