get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/8340/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 8340,
    "url": "http://patches.dpdk.org/api/patches/8340/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1446198204-9852-3-git-send-email-danielx.t.mrzyglod@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1446198204-9852-3-git-send-email-danielx.t.mrzyglod@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446198204-9852-3-git-send-email-danielx.t.mrzyglod@intel.com",
    "date": "2015-10-30T09:43:20",
    "name": "[dpdk-dev,v2,2/6] ixgbe: add additional ieee1588 support functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "7b42e27d25a1c07d45f146c72d446819110d4abb",
    "submitter": {
        "id": 23,
        "url": "http://patches.dpdk.org/api/people/23/?format=api",
        "name": "Daniel Mrzyglod",
        "email": "danielx.t.mrzyglod@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1446198204-9852-3-git-send-email-danielx.t.mrzyglod@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/8340/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/8340/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 550B58E6A;\n\tFri, 30 Oct 2015 10:46:06 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 19D568E68\n\tfor <dev@dpdk.org>; Fri, 30 Oct 2015 10:46:03 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga102.jf.intel.com with ESMTP; 30 Oct 2015 02:46:03 -0700",
            "from unknown ([10.217.248.15])\n\tby orsmga002.jf.intel.com with SMTP; 30 Oct 2015 02:46:01 -0700",
            "by  (sSMTP sendmail emulation); Fri, 30 Oct 2015 10:45:18 +0100"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,217,1444719600\"; d=\"scan'208\";a=\"838722808\"",
        "From": "Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 30 Oct 2015 10:43:20 +0100",
        "Message-Id": "<1446198204-9852-3-git-send-email-danielx.t.mrzyglod@intel.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<1446198204-9852-1-git-send-email-danielx.t.mrzyglod@intel.com>",
        "References": "<1443799208-9408-1-git-send-email-danielx.t.mrzyglod@intel.com>\n\t<1446198204-9852-1-git-send-email-danielx.t.mrzyglod@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/6] ixgbe: add additional ieee1588 support\n\tfunctions",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add additional functions to support the existing IEEE1588\nfunctionality and to enable getting, setting and adjusting\nthe device time.\n\nSigned-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n drivers/net/ixgbe/ixgbe_ethdev.c | 313 +++++++++++++++++++++++++++++++++++++--\n drivers/net/ixgbe/ixgbe_ethdev.h |  22 +++\n 2 files changed, 324 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c\nindex 4373661..2c39501 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.c\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.c\n@@ -126,10 +126,17 @@\n #define IXGBE_HKEY_MAX_INDEX 10\n \n /* Additional timesync values. */\n-#define IXGBE_TIMINCA_16NS_SHIFT 24\n-#define IXGBE_TIMINCA_INCVALUE   16000000\n-#define IXGBE_TIMINCA_INIT       ((0x02 << IXGBE_TIMINCA_16NS_SHIFT) \\\n-\t\t\t\t  | IXGBE_TIMINCA_INCVALUE)\n+#define NSEC_PER_SEC             1000000000L\n+#define IXGBE_INCVAL_10GB        0x66666666\n+#define IXGBE_INCVAL_1GB         0x40000000\n+#define IXGBE_INCVAL_100         0x50000000\n+#define IXGBE_INCVAL_SHIFT_10GB  28\n+#define IXGBE_INCVAL_SHIFT_1GB   24\n+#define IXGBE_INCVAL_SHIFT_100   21\n+#define IXGBE_INCVAL_SHIFT_82599 7\n+#define IXGBE_INCPER_SHIFT_82599 24\n+\n+#define IXGBE_CYCLECOUNTER_MASK   0xffffffffffffffff\n \n static int eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev);\n static int eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev);\n@@ -325,6 +332,11 @@ static int ixgbe_timesync_read_rx_timestamp(struct rte_eth_dev *dev,\n \t\t\t\t\t    uint32_t flags);\n static int ixgbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,\n \t\t\t\t\t    struct timespec *timestamp);\n+static int ixgbe_timesync_time_adjust(struct rte_eth_dev *dev, int64_t delta);\n+static int ixgbe_timesync_time_get(struct rte_eth_dev *dev,\n+\t\tstruct timespec *timestamp);\n+static int ixgbe_timesync_time_set(struct rte_eth_dev *dev,\n+\t\tstruct timespec *timestamp);\n \n /*\n  * Define VF Stats MACRO for Non \"cleared on read\" register\n@@ -465,6 +477,9 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {\n \t.get_eeprom_length    = ixgbe_get_eeprom_length,\n \t.get_eeprom           = ixgbe_get_eeprom,\n \t.set_eeprom           = ixgbe_set_eeprom,\n+\t.timesync_time_adjust      = ixgbe_timesync_time_adjust,\n+\t.timesync_time_get     = ixgbe_timesync_time_get,\n+\t.timesync_time_set     = ixgbe_timesync_time_set,\n };\n \n /*\n@@ -5267,20 +5282,273 @@ ixgbe_dev_set_mc_addr_list(struct rte_eth_dev *dev,\n \t\t\t\t\t ixgbe_dev_addr_list_itr, TRUE);\n }\n \n+static inline uint64_t\n+timespec_to_ns(const struct timespec *ts)\n+{\n+\treturn ((uint64_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;\n+}\n+\n+static struct timespec\n+ns_to_timespec(uint64_t nsec)\n+{\n+\tstruct timespec ts = {0, 0};\n+\n+\tif (nsec == 0)\n+\t\treturn ts;\n+\n+\tts.tv_sec = nsec / NSEC_PER_SEC;\n+\tts.tv_nsec = nsec % NSEC_PER_SEC;\n+\n+\treturn ts;\n+}\n+\n+/*\n+ * Converts cycle counter cycles to nanoseconds.\n+ */\n+static inline uint64_t\n+cyclecounter_cycles_to_ns(const struct cyclecounter *cc,\n+\t\t      uint64_t cycles, uint64_t mask, uint64_t *frac)\n+{\n+\tuint64_t ns;\n+\n+\t/* Add fractional nanoseconds */\n+\tns = cycles + *frac;\n+\t*frac = ns & mask;\n+\n+\t/* Shift to get only nanoseconds. */\n+\treturn ns >> cc->shift;\n+}\n+\n+/*\n+ * Like cyclecounter_cycles_to_ns(), but this is used when\n+ * computing a time previous to the stored in the cycle counter.\n+ */\n+static uint64_t\n+cyclecounter_cycles_to_ns_backwards(const struct cyclecounter *cc,\n+\t\t\t       uint64_t cycles, uint64_t frac)\n+{\n+\treturn ((cycles - frac) >> cc->shift);\n+}\n+\n+/*\n+ * Register units might not be nanoseconds. This function converts\n+ * these units into nanoseconds and adds to the previous time stored.\n+ */\n+static uint64_t\n+timecounter_cycles_to_ns_time(struct timecounter *tc, uint64_t cycle_tstamp)\n+{\n+\tuint64_t delta;\n+\tuint64_t nsec = tc->nsec, frac = tc->frac;\n+\n+\tdelta = (cycle_tstamp - tc->cycle_last) & tc->cc->mask;\n+\t/*\n+\t * Cycle counts that are correctly converted as they\n+\t * are between -1/2 max cycle count and +1/2 max cycle count.\n+\t */\n+\tif (delta > (tc->cc->mask / 2)) {\n+\t\tdelta = (tc->cycle_last - cycle_tstamp) & tc->cc->mask;\n+\t\tnsec -= cyclecounter_cycles_to_ns_backwards(tc->cc, delta, frac);\n+\t} else {\n+\t\tnsec += cyclecounter_cycles_to_ns(tc->cc, delta, tc->mask, &frac);\n+\t}\n+\n+\treturn nsec;\n+}\n+\n+static uint64_t\n+ixgbe_read_timesync_cyclecounter(struct rte_eth_dev *dev)\n+{\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tuint64_t systime_cycles = 0;\n+\n+\tswitch (hw->mac.type) {\n+\tcase ixgbe_mac_X550:\n+\t\t/* SYSTIMEL stores ns and SYSTIMEH stores seconds. */\n+\t\tsystime_cycles = (uint64_t)IXGBE_READ_REG(hw, IXGBE_SYSTIML);\n+\t\tsystime_cycles += (uint64_t)IXGBE_READ_REG(hw, IXGBE_SYSTIMH)\n+\t\t\t\t* NSEC_PER_SEC;\n+\t\tbreak;\n+\tdefault:\n+\t\tsystime_cycles |= (uint64_t)IXGBE_READ_REG(hw, IXGBE_SYSTIML);\n+\t\tsystime_cycles |= (uint64_t)IXGBE_READ_REG(hw, IXGBE_SYSTIMH)\n+\t\t\t\t<< 32;\n+\t}\n+\n+\treturn systime_cycles;\n+}\n+\n+/*\n+ * Get nanoseconds since the last call of this function.\n+ */\n+static uint64_t\n+timecounter_read_ns_delta(struct rte_eth_dev *dev)\n+{\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tuint64_t cycle_now, cycle_delta;\n+\tuint64_t ns_offset;\n+\tstruct ixgbe_adapter *adapter =\n+\t\t\t\t(struct ixgbe_adapter *)dev->data->dev_private;\n+\n+\t/* Read cycle counter. */\n+\tcycle_now = adapter->tc.cc->read(dev);\n+\n+\t/* Calculate the delta since the last timecounter_read_delta(). */\n+\tcycle_delta = (cycle_now - adapter->tc.cycle_last) & adapter->tc.cc->mask;\n+\n+\t/* Convert to nanoseconds. */\n+\tif (hw->mac.type == ixgbe_mac_X550)\n+\t\t/* Registers store directly nanoseconds, no need to convert. */\n+\t\tns_offset = cycle_delta;\n+\telse\n+\t\tns_offset = cyclecounter_cycles_to_ns(adapter->tc.cc, cycle_delta,\n+\t\t\t\t\tadapter->tc.mask, &adapter->tc.frac);\n+\n+\t/* Store current cycle counter for next timecounter_read_ns_delta() call. */\n+\tadapter->tc.cycle_last = cycle_now;\n+\n+\treturn ns_offset;\n+}\n+\n+static uint64_t\n+timecounter_read(struct rte_eth_dev *dev)\n+{\n+\tuint64_t nsec;\n+\tstruct ixgbe_adapter *adapter =\n+\t\t\t(struct ixgbe_adapter *)dev->data->dev_private;\n+\n+\t/* Increment time by nanoseconds since last call. */\n+\tnsec = timecounter_read_ns_delta(dev);\n+\tnsec += adapter->tc.nsec;\n+\tadapter->tc.nsec = nsec;\n+\n+\treturn nsec;\n+}\n+\n+\n+static void\n+timecounter_init(struct rte_eth_dev *dev,\n+\t\t      uint64_t start_time)\n+{\n+\tstruct ixgbe_adapter *adapter =\n+\t\t\t\t(struct ixgbe_adapter *)dev->data->dev_private;\n+\tadapter->tc.cc = &adapter->cc;\n+\tadapter->tc.cycle_last = adapter->tc.cc->read(dev);\n+\tadapter->tc.nsec = start_time;\n+\tadapter->tc.mask = (1ULL << adapter->tc.cc->shift) - 1;\n+\tadapter->tc.frac = 0;\n+}\n+\n+static void\n+ixgbe_start_cyclecounter(struct rte_eth_dev *dev)\n+{\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct ixgbe_adapter *adapter =\n+\t\t(struct ixgbe_adapter *)dev->data->dev_private;\n+\tstruct rte_eth_link link;\n+\tuint32_t incval = 0;\n+\tuint32_t shift = 0;\n+\n+\t/* Get current link speed. */\n+\tmemset(&link, 0, sizeof(link));\n+\tixgbe_dev_link_update(dev, 1);\n+\trte_ixgbe_dev_atomic_read_link_status(dev, &link);\n+\n+\tswitch (link.link_speed) {\n+\tcase ETH_LINK_SPEED_100:\n+\t\tincval = IXGBE_INCVAL_100;\n+\t\tshift = IXGBE_INCVAL_SHIFT_100;\n+\t\tbreak;\n+\tcase ETH_LINK_SPEED_1000:\n+\t\tincval = IXGBE_INCVAL_1GB;\n+\t\tshift = IXGBE_INCVAL_SHIFT_1GB;\n+\t\tbreak;\n+\tcase ETH_LINK_SPEED_10000:\n+\tdefault:\n+\t\tincval = IXGBE_INCVAL_10GB;\n+\t\tshift = IXGBE_INCVAL_SHIFT_10GB;\n+\t\tbreak;\n+\t}\n+\n+\tswitch (hw->mac.type) {\n+\tcase ixgbe_mac_X550:\n+\t\t/* Independent of link speed. */\n+\t\tincval = 1;\n+\t\t/* Cycles read will be interpreted as ns. */\n+\t\tshift = 0;\n+\t\t/* Fall-through */\n+\tcase ixgbe_mac_X540:\n+\t\tIXGBE_WRITE_REG(hw, IXGBE_TIMINCA, incval);\n+\t\tbreak;\n+\tcase ixgbe_mac_82599EB:\n+\t\tincval >>= IXGBE_INCVAL_SHIFT_82599;\n+\t\tshift -= IXGBE_INCVAL_SHIFT_82599;\n+\t\tIXGBE_WRITE_REG(hw, IXGBE_TIMINCA,\n+\t\t\t(1 << IXGBE_INCPER_SHIFT_82599) | incval);\n+\t\tbreak;\n+\tdefault:\n+\t\t/* Not supported. */\n+\t\treturn;\n+\t}\n+\n+\tmemset(&adapter->cc, 0, sizeof(struct cyclecounter));\n+\tadapter->cc.read = ixgbe_read_timesync_cyclecounter;\n+\tadapter->cc.mask = IXGBE_CYCLECOUNTER_MASK;\n+\tadapter->cc.shift = shift;\n+}\n+\n+static int\n+ixgbe_timesync_time_adjust(struct rte_eth_dev *dev, int64_t delta)\n+{\n+\tstruct ixgbe_adapter *adapter =\n+\t\t\t(struct ixgbe_adapter *)dev->data->dev_private;\n+\n+\tadapter->tc.nsec += delta;\n+\n+\treturn 0;\n+}\n+\n+static int\n+ixgbe_timesync_time_set(struct rte_eth_dev *dev, struct timespec *ts)\n+{\n+\tuint64_t ns;\n+\n+\tns = timespec_to_ns(ts);\n+\t/* Reset the timecounter. */\n+\ttimecounter_init(dev, ns);\n+\n+\treturn 0;\n+}\n+\n+static int\n+ixgbe_timesync_time_get(struct rte_eth_dev *dev, struct timespec *ts)\n+{\n+\tuint64_t ns;\n+\n+\tns = timecounter_read(dev);\n+\t*ts = ns_to_timespec(ns);\n+\n+\treturn 0;\n+}\n+\n static int\n ixgbe_timesync_enable(struct rte_eth_dev *dev)\n {\n \tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \tuint32_t tsync_ctl;\n \tuint32_t tsauxc;\n+\tuint64_t ns;\n+\tstruct timespec zerotime = {0, 0};\n \n \t/* Enable system time for platforms where it isn't on by default. */\n \ttsauxc = IXGBE_READ_REG(hw, IXGBE_TSAUXC);\n \ttsauxc &= ~IXGBE_TSAUXC_DISABLE_SYSTIME;\n-\tIXGBE_WRITE_REG(hw, IXGBE_TSAUXC, tsauxc);\n \n-\t/* Start incrementing the register used to timestamp PTP packets. */\n-\tIXGBE_WRITE_REG(hw, IXGBE_TIMINCA, IXGBE_TIMINCA_INIT);\n+\t/* Set 0.0 epoch time to initialize timecounter. */\n+\tns = timespec_to_ns(&zerotime);\n+\tixgbe_start_cyclecounter(dev);\n+\ttimecounter_init(dev, ns);\n+\n+\tIXGBE_WRITE_REG(hw, IXGBE_TSAUXC, tsauxc);\n \n \t/* Enable L2 filtering of IEEE1588/802.1AS Ethernet frame types. */\n \tIXGBE_WRITE_REG(hw, IXGBE_ETQF(IXGBE_ETQF_FILTER_1588),\n@@ -5298,6 +5566,9 @@ ixgbe_timesync_enable(struct rte_eth_dev *dev)\n \ttsync_ctl |= IXGBE_TSYNCTXCTL_ENABLED;\n \tIXGBE_WRITE_REG(hw, IXGBE_TSYNCTXCTL, tsync_ctl);\n \n+\t/* After writing to registers should be flush. */\n+\tIXGBE_WRITE_FLUSH(hw);\n+\n \treturn 0;\n }\n \n@@ -5332,9 +5603,13 @@ ixgbe_timesync_read_rx_timestamp(struct rte_eth_dev *dev,\n \t\t\t\t uint32_t flags __rte_unused)\n {\n \tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct ixgbe_adapter *adapter =\n+\t\t(struct ixgbe_adapter *)dev->data->dev_private;\n+\n \tuint32_t tsync_rxctl;\n \tuint32_t rx_stmpl;\n \tuint32_t rx_stmph;\n+\tuint64_t regival = 0;\n \n \ttsync_rxctl = IXGBE_READ_REG(hw, IXGBE_TSYNCRXCTL);\n \tif ((tsync_rxctl & IXGBE_TSYNCRXCTL_VALID) == 0)\n@@ -5342,9 +5617,15 @@ ixgbe_timesync_read_rx_timestamp(struct rte_eth_dev *dev,\n \n \trx_stmpl = IXGBE_READ_REG(hw, IXGBE_RXSTMPL);\n \trx_stmph = IXGBE_READ_REG(hw, IXGBE_RXSTMPH);\n+\ttimecounter_read(dev);\n \n-\ttimestamp->tv_sec = (uint64_t)(((uint64_t)rx_stmph << 32) | rx_stmpl);\n-\ttimestamp->tv_nsec = 0;\n+\tif (hw->mac.type == ixgbe_mac_X550)\n+\t\tregival = (uint64_t)((uint64_t) rx_stmph * NSEC_PER_SEC\n+\t\t\t+ rx_stmpl);\n+\telse\n+\t\tregival = (uint64_t)(((uint64_t)rx_stmph << 32) | rx_stmpl);\n+\tregival = timecounter_cycles_to_ns_time(&adapter->tc, regival);\n+\t*timestamp = ns_to_timespec(regival);\n \n \treturn  0;\n }\n@@ -5354,9 +5635,13 @@ ixgbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,\n \t\t\t\t struct timespec *timestamp)\n {\n \tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct ixgbe_adapter *adapter =\n+\t\t(struct ixgbe_adapter *)dev->data->dev_private;\n+\n \tuint32_t tsync_txctl;\n \tuint32_t tx_stmpl;\n \tuint32_t tx_stmph;\n+\tuint64_t regival = 0;\n \n \ttsync_txctl = IXGBE_READ_REG(hw, IXGBE_TSYNCTXCTL);\n \tif ((tsync_txctl & IXGBE_TSYNCTXCTL_VALID) == 0)\n@@ -5364,9 +5649,15 @@ ixgbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,\n \n \ttx_stmpl = IXGBE_READ_REG(hw, IXGBE_TXSTMPL);\n \ttx_stmph = IXGBE_READ_REG(hw, IXGBE_TXSTMPH);\n+\ttimecounter_read(dev);\n \n-\ttimestamp->tv_sec = (uint64_t)(((uint64_t)tx_stmph << 32) | tx_stmpl);\n-\ttimestamp->tv_nsec = 0;\n+\tif (hw->mac.type == ixgbe_mac_X550)\n+\t\tregival = (uint64_t)((uint64_t) tx_stmph * NSEC_PER_SEC\n+\t\t\t+ tx_stmpl);\n+\telse\n+\t\tregival = (uint64_t)(((uint64_t)tx_stmph << 32) | tx_stmpl);\n+\tregival = timecounter_cycles_to_ns_time(&adapter->tc, regival);\n+\t*timestamp = ns_to_timespec(regival);\n \n \treturn  0;\n }\ndiff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h\nindex f75c6dd..2ace8c0 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.h\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.h\n@@ -255,6 +255,26 @@ struct ixgbe_filter_info {\n };\n \n /*\n+ * Structure for cyclecounter IEEE1588 functionality.\n+ */\n+struct cyclecounter {\n+\tuint64_t (*read)(struct rte_eth_dev *dev);\n+\tuint64_t mask;\n+\tuint32_t shift;\n+};\n+\n+/*\n+ * Structure to hold and calculate Unix epoch time.\n+ */\n+struct timecounter {\n+\tstruct cyclecounter *cc;\n+\tuint64_t cycle_last;\n+\tuint64_t nsec;\n+\tuint64_t mask;\n+\tuint64_t frac;\n+};\n+\n+/*\n  * Structure to store private data for each driver instance (for each port).\n  */\n struct ixgbe_adapter {\n@@ -276,6 +296,8 @@ struct ixgbe_adapter {\n \n \tbool rx_bulk_alloc_allowed;\n \tbool rx_vec_allowed;\n+\tstruct cyclecounter cc;\n+\tstruct timecounter tc;\n };\n \n #define IXGBE_DEV_PRIVATE_TO_HW(adapter)\\\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/6"
    ]
}