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 709944381B; Fri, 5 Jan 2024 01:51:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59D31402AC; Fri, 5 Jan 2024 01:51:32 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by mails.dpdk.org (Postfix) with ESMTP id B3CFB4027C for ; Fri, 5 Jan 2024 01:51:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704415890; x=1735951890; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ZOxE641QV3MD/jxHS8vCaX6sZuP9pbVR7Nziq+hO8Eo=; b=IAeA48p58uMailz7Woc+HFIqQdpqx/t44C0P1GSiX10gq5eR5KQEIXVJ rBspTyXqgd0cTWbm/FMrH9O0A5O5RIItSllARXblJXfOztUuTVeo14Etg oFsxaxQt9ryEKyUGYu3TSlOyLYyGHf4lkC5duvleRbmg8Ko29W0JZy6lh qYrtRjnfsgHCLDjQPsCGYdl+PhnCZJ//5lfwzvyjK6DJZw12jDELSQ1Fj 46QhRVwF8AABABJmHkRt1Z6Pf4zMQ+jhY2NE8RPxCd4dadcZwM04O+wfv vRG+OAe5dJCPJ1LjuDMDkfHpnq4hWegLiQICaqkvzyUaN1QvmPLDi6kiX A==; X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="4505443" X-IronPort-AV: E=Sophos;i="6.04,332,1695711600"; d="scan'208";a="4505443" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2024 16:51:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="784053885" X-IronPort-AV: E=Sophos;i="6.04,332,1695711600"; d="scan'208";a="784053885" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Jan 2024 16:51:27 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 4 Jan 2024 16:51:26 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 4 Jan 2024 16:51:26 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 4 Jan 2024 16:51:26 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QRd3KlFh6mPhWJUpqTDTW1J5nXL+dPTSPRtaC47ih8KqyfcI+OylpjMNAusq837SK+78Jp9l2/n5w9R8XFCHsBV/y6YbneelPNe/5JP7Uw9MnudioIZQwNU90gNcDvTSsYHQ/veS0hgHpo3Vi2HZWSgv7svkSUX66Yvo/ZDUFoHMAclky/QJNIx+f7JmtLRIk0m+TgSnpF/5itkxjnVxZ7e9jZdaMgo47KEEZ724sT7UFBwCVgnB9sj/mq1e/dR4EyquNNp5mEXbLbIJOynauSTmaXEPdsbYWPW8QWQ2otm8b9rCkcHG4trQQj9wvp5wEHqyUe7pgoJsvT7or8xPfA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YIQE21OkJW9AlVzzJ3Ao9Cq4YnoeHqgqjpkh/5f3oIk=; b=BIX53HYCiAOAhux57MzhfBk2ux885tKC+YktPqsNY/Z1WbqqfUjdtdmhnRg1F86SJaB4jbJiZ12ZyS+bhN4K2AWODrO1SUl4b0CJufx/wCWT+Ukv5JKLDYLlBB0CqF1bzP3jlXJgkJptazlPhpKJnbNNYmQm04X5gLYY0kTQyvE47mZE5X/e/4hb7f7giP21Bziil7uDv5EP4RuILlI8miFFie4blfJQfwqOOvtzIJZqqqQKbfnHwK+BoS/RJCY27m1sqRO8eCYiitwkLs5Yf7kIc/nqkMxENLJ/SDIiiTRC8Zghkw0AbBNC1AGPwdwZ7QjPisdaCyKc26aIBIFPcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM4PR11MB5994.namprd11.prod.outlook.com (2603:10b6:8:5d::20) by SJ0PR11MB5663.namprd11.prod.outlook.com (2603:10b6:a03:3bc::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.15; Fri, 5 Jan 2024 00:51:24 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::fc91:526:bead:4f73]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::fc91:526:bead:4f73%4]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 00:51:24 +0000 From: "Zhang, Qi Z" To: "Su, Simei" , Chuanyu Xue , "Lu, Wenzhuo" , "Xing, Beilei" CC: "dev@dpdk.org" Subject: RE: [PATCH v2] net/e1000: support launchtime feature Thread-Topic: [PATCH v2] net/e1000: support launchtime feature Thread-Index: AQHaO0IkusRW5B/nVEWlX17g+00gT7DJAVeAgAFqrhA= Date: Fri, 5 Jan 2024 00:51:24 +0000 Message-ID: References: <20231217202040.478959-1-chuanyu.xue@uconn.edu> <20231230163509.175037-1-chuanyu.xue@uconn.edu> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB5994:EE_|SJ0PR11MB5663:EE_ x-ms-office365-filtering-correlation-id: 53c44467-ad92-42c0-5777-08dc0d887118 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PWxFeeZscTTCJARMvRT2yx0hkG8iF0FzeHOgXTJZ5+eEjfa3q+DqHFCZ1g7TfDiOKRqSnqRQ7uM1xa8ixEZ4q6EYgb/5ebbBM+7tTy+i6lVeCEaT00+ZHGVXd16H9ci9Mz6MmHSgQtfiimFKcgud7C00eHv16W7qZ5CiUZCN9Hn7BfrfvQHKv+v3E6evLZqqCfNArlCST+NAUP4bss9IAHBP3k6ulp8HYq3lN/hC/HyO8HxKpXoVER7xFZ9sNHnAS9OTWz4aDFzU7si5k3TojmQQ7baEAF/VGTdQh17/Ls//Iw07RoftvtCLhn2X5im9zZScVE+V3IPoyuSH8+0J0ZGIGFmL9di9SlH4OlYqBUAEUL8GS+rhSyr7aw0l7vZs2odNhOnthtEF3J+6/IV//KTYAB44jTauKdV1HB/dqZqIdYqescuanUO/U3eX07UZNXVt9Rf4TZPlT+rHgwbwYcJE2T90yIuna8BAqaI7MMtNBfwxm/d8PW7KFP93K9HtvBgmMlxRnjmqy9mVhi8kLRvEvjfw9O/qxAg9lk/D99GoCTTXkl/sHSq6fT6oW1MlXWK4QJhygauXPhBma5j6lPjBy56GOZQrLD64jsLG5DpFFoTG9p9mG51UeTtGqY6V x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5994.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(346002)(39860400002)(396003)(136003)(376002)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(6506007)(83380400001)(55016003)(38100700002)(86362001)(2906002)(26005)(122000001)(82960400001)(76116006)(53546011)(71200400001)(38070700009)(4326008)(316002)(7696005)(296002)(110136005)(6636002)(66446008)(478600001)(8936002)(8676002)(66476007)(66556008)(66946007)(64756008)(33656002)(52536014)(9686003)(5660300002)(30864003)(41300700001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?kW1qWjfQRx/SjyGllrlU9wF1ZlgAgJtLurjOfNcxoEI4QPJAdsVIvcmQ2NUK?= =?us-ascii?Q?46c9xaPFwsOky+ISn94Gb56Mi6S6GfIc35lT/2b4HUNFqo5y4WJFeknOkxuP?= =?us-ascii?Q?V8LJ+o8zAzuPZOEpYVCGtg/eOmnLCfOUrUv4mGXDk5StJCXkf8qGJLvj66Sb?= =?us-ascii?Q?nuTd97YDtkpQKvWKb9gNT4Tl2y2/rFSHChDhc3SzKpMwBbv+UQG2NJ6QCFQf?= =?us-ascii?Q?4LuKrnBo15Ko+RkyypnRUJjELFDEofz+T07w9nAAg6jnRdg0riSRYBRmWKiF?= =?us-ascii?Q?pF24uJS4RcKi8UFAm4fM0MGb/eMre1aY31dRxYeqBifI7QChznFkuOvkEfbc?= =?us-ascii?Q?5HKys7Og7NbcdqnSs1qoGnMG/gXsdQCB46qGyUHO92GiKSwWp2jpLLeeHSrg?= =?us-ascii?Q?hwJNu6PtkktbB5tR9/7hxa8tqWHKHyy7IioUcwZH5ZXJRbjSMNedved/gqQf?= =?us-ascii?Q?Noe1HEwUJSPxxdx0SaF9efHXz64DEIgA9oG8nTYeSEkaVaTph2m6D192myhe?= =?us-ascii?Q?S67f7Fjd1Cgj8g/t9k/h63lnCqWounZh57ejXbWqh0cBwkWQPRKtndJNe+Qa?= =?us-ascii?Q?uVl3eiWPWdR7xTAuAVEzJDKLI4QkaAJERHQlk7cIbDjbOSMLC6VDKD30XrVx?= =?us-ascii?Q?Ab1UAuPTn1fMqyQ7b/l5pd9BRzjFYlOMJPGh1eeVm9qeujpufaJHyBd94s4V?= =?us-ascii?Q?0JehfZYC1L5H5K2NljJEoCB/imzJaq64OeCcXjY4pOnqQ/dynycEhjz1BZXi?= =?us-ascii?Q?bL4z8UkCHxPkJR2VD6jZLvO7hLVO+OekIrOtAamc4bu/89NMD4nTGjo6AUjm?= =?us-ascii?Q?RlR+JpfPKOtSwWqLUhJ/Co3CCyCN510ees94eQM2PPFV7/xtxR/KszGcfdP9?= =?us-ascii?Q?jHWJF9GpS6KxENQEXxqViZ8rpwbFOkKgkUA/W8UHHsxrYRsanUKWivUNfsE5?= =?us-ascii?Q?xE3wVJCKkicJzFF//8axhYxBYPMcAg89lW/TR87AHcHY8VDE1LnSWU8t8ZoB?= =?us-ascii?Q?eSQXpQJwCeiyfSom36DjoGf0LEHv0ZDaCwy78S0gbNhJqovMVW7jXOSEpfta?= =?us-ascii?Q?zcLdHPIS3yYaZ1Y1n58KP/rmpq6ru/xOh+uzdO40bhG4hvTNhnsN7K3C3LQN?= =?us-ascii?Q?Q2xGRQdtBriV1XheI1lmy/UA7t6uh5tV91LiWWr3ExM51kL3UTCcrnlWJYzT?= =?us-ascii?Q?mi5iGSDiYYPl7TxkuN52kDP4HsKqj8Gcz1/mQnYnoeveg3eO0HESw3QkXXvn?= =?us-ascii?Q?PvG01lO8fcj52TVWMRwWeT5EZMEDWOZ/+GZNIllcLUDQ+3+cywys1VqVpjlD?= =?us-ascii?Q?NoVck8Lu5julCrHPhA1+EEgVSKILzyCZ0VifF/jxR4VIs/X1kF0aPxSX/hHf?= =?us-ascii?Q?pRs9qyM5uT5jETW3AefcuOnHWJbpvAHYpy+OhDqnfU0hrhOGPlEvnI024UKB?= =?us-ascii?Q?/yOHktrN/fuQsDqPuPFX887y4/A4HKV350+OoMSJeZvC1V/tuMx+5idI5UtN?= =?us-ascii?Q?+qUjxe6p5BNfqq/BDHM51bDiSXvzt5Q60JiXAUgQtfs+bYyfrSSDWfvgyOcu?= =?us-ascii?Q?3/es4+jpiD/7yp4xJRNNb9TUjjS/WRjCgESe/P2q?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5994.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53c44467-ad92-42c0-5777-08dc0d887118 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2024 00:51:24.3388 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GBNlepxR6LHz1L6aCahv+38cOBF30y7C7ztSMkCFiI6+OFoy6EthJhRtR7LMCIINgmnxEv+cFpkJOGgokGF6IQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5663 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Su, Simei > Sent: Thursday, January 4, 2024 11:13 AM > To: Chuanyu Xue ; Lu, Wenzhuo > ; Zhang, Qi Z ; Xing, Beilei > > Cc: dev@dpdk.org > Subject: RE: [PATCH v2] net/e1000: support launchtime feature >=20 >=20 > > -----Original Message----- > > From: Chuanyu Xue > > Sent: Sunday, December 31, 2023 12:35 AM > > To: Su, Simei ; Lu, Wenzhuo > > ; Zhang, Qi Z ; Xing, > > Beilei > > Cc: dev@dpdk.org; Chuanyu Xue > > Subject: [PATCH v2] net/e1000: support launchtime feature > > > > Enable the time-based scheduled Tx of packets based on the > > RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP flag. The launchtime defines > the > > packet transmission time based on PTP clock at MAC layer, which should > > be set to the advanced transmit descriptor. > > > > Signed-off-by: Chuanyu Xue > > --- > > change log: > > > > v2: > > - Add delay compensation for i210 NIC by setting tx offset register. > > - Revise read_clock function. > > > > drivers/net/e1000/base/e1000_regs.h | 1 + > > drivers/net/e1000/e1000_ethdev.h | 14 +++++++ > > drivers/net/e1000/igb_ethdev.c | 63 > > ++++++++++++++++++++++++++++- > > drivers/net/e1000/igb_rxtx.c | 42 +++++++++++++++---- > > 4 files changed, 112 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/net/e1000/base/e1000_regs.h > > b/drivers/net/e1000/base/e1000_regs.h > > index d44de59c29..092d9d71e6 100644 > > --- a/drivers/net/e1000/base/e1000_regs.h > > +++ b/drivers/net/e1000/base/e1000_regs.h > > @@ -162,6 +162,7 @@ > > > > /* QAV Tx mode control register */ > > #define E1000_I210_TQAVCTRL 0x3570 > > +#define E1000_I210_LAUNCH_OS0 0x3578 > > > > /* QAV Tx mode control register bitfields masks */ > > /* QAV enable */ > > diff --git a/drivers/net/e1000/e1000_ethdev.h > > b/drivers/net/e1000/e1000_ethdev.h > > index 718a9746ed..339ae1f4b6 100644 > > --- a/drivers/net/e1000/e1000_ethdev.h > > +++ b/drivers/net/e1000/e1000_ethdev.h > > @@ -382,6 +382,20 @@ extern struct igb_rss_filter_list > > igb_filter_rss_list; TAILQ_HEAD(igb_flow_mem_list, igb_flow_mem); > > extern struct igb_flow_mem_list igb_flow_list; > > > > +/* > > + * Macros to compensate the constant latency observed in i210 for > > +launch time > > + * > > + * launch time =3D (offset_speed - offset_base + txtime) * 32 > > + * offset_speed is speed dependent, set in E1000_I210_LAUNCH_OS0 */ > > +#define IGB_I210_TX_OFFSET_BASE 0xffe0 > > +#define IGB_I210_TX_OFFSET_SPEED_10 0xc7a0 > > +#define IGB_I210_TX_OFFSET_SPEED_100 0x86e0 > > +#define IGB_I210_TX_OFFSET_SPEED_1000 0xbe00 > > + > > +extern uint64_t igb_tx_timestamp_dynflag; extern int > > +igb_tx_timestamp_dynfield_offset; > > + > > extern const struct rte_flow_ops igb_flow_ops; > > > > /* > > diff --git a/drivers/net/e1000/igb_ethdev.c > > b/drivers/net/e1000/igb_ethdev.c index 8858f975f8..2262035710 100644 > > --- a/drivers/net/e1000/igb_ethdev.c > > +++ b/drivers/net/e1000/igb_ethdev.c > > @@ -223,6 +223,7 @@ static int igb_timesync_read_time(struct > > rte_eth_dev *dev, > > struct timespec *timestamp); > > static int igb_timesync_write_time(struct rte_eth_dev *dev, > > const struct timespec *timestamp); > > +static int eth_igb_read_clock(struct rte_eth_dev *dev, uint64_t > > +*clock); > > static int eth_igb_rx_queue_intr_enable(struct rte_eth_dev *dev, > > uint16_t queue_id); > > static int eth_igb_rx_queue_intr_disable(struct rte_eth_dev *dev, @@ > > -313,6 > > +314,9 @@ static const struct rte_pci_id pci_id_igbvf_map[] =3D { > > { .vendor_id =3D 0, /* sentinel */ }, > > }; > > > > +uint64_t igb_tx_timestamp_dynflag; > > +int igb_tx_timestamp_dynfield_offset =3D -1; > > + > > static const struct rte_eth_desc_lim rx_desc_lim =3D { > > .nb_max =3D E1000_MAX_RING_DESC, > > .nb_min =3D E1000_MIN_RING_DESC, > > @@ -389,6 +393,7 @@ static const struct eth_dev_ops eth_igb_ops =3D { > > .timesync_adjust_time =3D igb_timesync_adjust_time, > > .timesync_read_time =3D igb_timesync_read_time, > > .timesync_write_time =3D igb_timesync_write_time, > > + .read_clock =3D eth_igb_read_clock, > > }; > > > > /* > > @@ -1188,6 +1193,40 @@ eth_igb_rxtx_control(struct rte_eth_dev *dev, > > E1000_WRITE_FLUSH(hw); > > } > > > > + > > +static uint32_t igb_tx_offset(struct rte_eth_dev *dev) { > > + struct e1000_hw *hw =3D > > + E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); > > + > > + uint16_t duplex, speed; > > + hw->mac.ops.get_link_up_info(hw, &speed, &duplex); > > + > > + uint32_t launch_os0 =3D E1000_READ_REG(hw, > E1000_I210_LAUNCH_OS0); > > + if (hw->mac.type !=3D e1000_i210) { > > + /* Set launch offset to base, no compensation */ > > + launch_os0 |=3D IGB_I210_TX_OFFSET_BASE; > > + } else { > > + /* Set launch offset depend on link speeds */ > > + switch (speed) { > > + case SPEED_10: > > + launch_os0 |=3D IGB_I210_TX_OFFSET_SPEED_10; > > + break; > > + case SPEED_100: > > + launch_os0 |=3D IGB_I210_TX_OFFSET_SPEED_100; > > + break; > > + case SPEED_1000: > > + launch_os0 |=3D IGB_I210_TX_OFFSET_SPEED_1000; > > + break; > > + default: > > + launch_os0 |=3D IGB_I210_TX_OFFSET_BASE; > > + break; > > + } > > + } > > + > > + return launch_os0; > > +} > > + > > static int > > eth_igb_start(struct rte_eth_dev *dev) { @@ -1198,6 +1237,7 @@ > > eth_igb_start(struct rte_eth_dev *dev) > > struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > > struct rte_intr_handle *intr_handle =3D pci_dev->intr_handle; > > int ret, mask; > > + uint32_t tqavctrl; > > uint32_t intr_vector =3D 0; > > uint32_t ctrl_ext; > > uint32_t *speeds; > > @@ -1273,6 +1313,15 @@ eth_igb_start(struct rte_eth_dev *dev) > > > > eth_igb_tx_init(dev); > > > > + if (igb_tx_timestamp_dynflag > 0) { > > + tqavctrl =3D E1000_READ_REG(hw, E1000_I210_TQAVCTRL); > > + tqavctrl |=3D E1000_TQAVCTRL_MODE; /* Enable Qav mode */ > > + tqavctrl |=3D E1000_TQAVCTRL_FETCH_ARB; /* ARB fetch, no > Round > > Robin*/ > > + tqavctrl |=3D E1000_TQAVCTRL_LAUNCH_TIMER_ENABLE; /* > Enable Tx > > launch time*/ > > + E1000_WRITE_REG(hw, E1000_I210_TQAVCTRL, tqavctrl); > > + E1000_WRITE_REG(hw, E1000_I210_LAUNCH_OS0, > > igb_tx_offset(dev)); > > + } > > + > > /* This can fail when allocating mbufs for descriptor rings */ > > ret =3D eth_igb_rx_init(dev); > > if (ret) { > > @@ -1393,7 +1442,6 @@ eth_igb_start(struct rte_eth_dev *dev) > > > > eth_igb_rxtx_control(dev, true); > > eth_igb_link_update(dev, 0); > > - > > PMD_INIT_LOG(DEBUG, "<<"); > > > > return 0; > > @@ -4882,6 +4930,19 @@ igb_timesync_read_tx_timestamp(struct > > rte_eth_dev *dev, > > return 0; > > } > > > > +static int > > +eth_igb_read_clock(struct rte_eth_dev *dev, uint64_t *clock) { > > + struct e1000_adapter *adapter =3D dev->data->dev_private; > > + struct rte_timecounter *tc =3D &adapter->systime_tc; > > + uint64_t cycles; > > + > > + cycles =3D igb_read_systime_cyclecounter(dev); > > + *clock =3D rte_timecounter_update(tc, cycles); > > + > > + return 0; > > +} > > + > > static int > > eth_igb_get_reg_length(struct rte_eth_dev *dev __rte_unused) { diff > > --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c > > index 448c4b7d9d..5cafd6f1ce 100644 > > --- a/drivers/net/e1000/igb_rxtx.c > > +++ b/drivers/net/e1000/igb_rxtx.c > > @@ -244,12 +244,13 @@ check_tso_para(uint64_t ol_req, union > > igb_tx_offload ol_para) static inline void igbe_set_xmit_ctx(struct > > igb_tx_queue* txq, > > volatile struct e1000_adv_tx_context_desc *ctx_txd, > > - uint64_t ol_flags, union igb_tx_offload tx_offload) > > + uint64_t ol_flags, union igb_tx_offload tx_offload, uint64_t > > +txtime) > > { > > uint32_t type_tucmd_mlhl; > > uint32_t mss_l4len_idx; > > uint32_t ctx_idx, ctx_curr; > > uint32_t vlan_macip_lens; > > + uint32_t launch_time; > > union igb_tx_offload tx_offload_mask; > > > > ctx_curr =3D txq->ctx_curr; > > @@ -312,16 +313,25 @@ igbe_set_xmit_ctx(struct igb_tx_queue* txq, > > } > > } > > > > - txq->ctx_cache[ctx_curr].flags =3D ol_flags; > > - txq->ctx_cache[ctx_curr].tx_offload.data =3D > > - tx_offload_mask.data & tx_offload.data; > > - txq->ctx_cache[ctx_curr].tx_offload_mask =3D tx_offload_mask; > > + if (!txtime) { > > + txq->ctx_cache[ctx_curr].flags =3D ol_flags; > > + txq->ctx_cache[ctx_curr].tx_offload.data =3D > > + tx_offload_mask.data & tx_offload.data; > > + txq->ctx_cache[ctx_curr].tx_offload_mask =3D tx_offload_mask; > > + } > > > > ctx_txd->type_tucmd_mlhl =3D rte_cpu_to_le_32(type_tucmd_mlhl); > > vlan_macip_lens =3D (uint32_t)tx_offload.data; > > ctx_txd->vlan_macip_lens =3D rte_cpu_to_le_32(vlan_macip_lens); > > ctx_txd->mss_l4len_idx =3D rte_cpu_to_le_32(mss_l4len_idx); > > ctx_txd->u.seqnum_seed =3D 0; > > + > > + if (txtime) { > > + launch_time =3D (txtime - IGB_I210_TX_OFFSET_BASE) % > > NSEC_PER_SEC; > > + ctx_txd->u.launch_time =3D rte_cpu_to_le_32(launch_time / > 32); > > + } else { > > + ctx_txd->u.launch_time =3D 0; > > + } > > } > > > > /* > > @@ -400,6 +410,7 @@ eth_igb_xmit_pkts(void *tx_queue, struct rte_mbuf > > **tx_pkts, > > uint32_t new_ctx =3D 0; > > uint32_t ctx =3D 0; > > union igb_tx_offload tx_offload =3D {0}; > > + uint64_t ts; > > > > txq =3D tx_queue; > > sw_ring =3D txq->sw_ring; > > @@ -552,7 +563,13 @@ eth_igb_xmit_pkts(void *tx_queue, struct > rte_mbuf > > **tx_pkts, > > txe->mbuf =3D NULL; > > } > > > > - igbe_set_xmit_ctx(txq, ctx_txd, tx_ol_req, > tx_offload); > > + if (igb_tx_timestamp_dynflag > 0) { > > + ts =3D *RTE_MBUF_DYNFIELD(tx_pkt, > > + > igb_tx_timestamp_dynfield_offset, uint64_t *); > > + igbe_set_xmit_ctx(txq, ctx_txd, > tx_ol_req, tx_offload, > > ts); > > + } else { > > + igbe_set_xmit_ctx(txq, ctx_txd, > tx_ol_req, tx_offload, > > 0); > > + } > > > > txe->last_id =3D tx_last; > > tx_id =3D txe->next_id; > > @@ -1464,7 +1481,8 @@ igb_get_tx_port_offloads_capa(struct > rte_eth_dev > > *dev) > > RTE_ETH_TX_OFFLOAD_TCP_CKSUM | > > RTE_ETH_TX_OFFLOAD_SCTP_CKSUM | > > RTE_ETH_TX_OFFLOAD_TCP_TSO | > > - RTE_ETH_TX_OFFLOAD_MULTI_SEGS; > > + RTE_ETH_TX_OFFLOAD_MULTI_SEGS | > > + RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP; > > > > return tx_offload_capa; > > } > > @@ -2579,9 +2597,11 @@ eth_igb_tx_init(struct rte_eth_dev *dev) { > > struct e1000_hw *hw; > > struct igb_tx_queue *txq; > > + uint64_t offloads =3D dev->data->dev_conf.txmode.offloads; > > uint32_t tctl; > > uint32_t txdctl; > > uint16_t i; > > + int err; > > > > hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); > > > > @@ -2612,6 +2632,14 @@ eth_igb_tx_init(struct rte_eth_dev *dev) > > dev->data->tx_queue_state[i] =3D > RTE_ETH_QUEUE_STATE_STARTED; > > } > > > > + if (offloads & RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP) { > > + err =3D rte_mbuf_dyn_tx_timestamp_register( > > + &igb_tx_timestamp_dynfield_offset, > > + &igb_tx_timestamp_dynflag); > > + if (err) > > + PMD_DRV_LOG(ERR, "Failed to register tx timestamp > dynamic > > field"); > > + } > > + > > /* Program the Transmit Control Register. */ > > tctl =3D E1000_READ_REG(hw, E1000_TCTL); > > tctl &=3D ~E1000_TCTL_CT; > > -- > > 2.25.1 >=20 > Reviewed-by: Simei Su Applied to dpdk-next-net-intel. Thanks Qi >=20 > Thanks, > Simei