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 018C341BB3; Fri, 3 Feb 2023 01:30:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F83740DDA; Fri, 3 Feb 2023 01:30:36 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id E1C7440A79 for ; Fri, 3 Feb 2023 01:30:35 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id o16-20020a17090ad25000b00230759a8c06so506678pjw.2 for ; Thu, 02 Feb 2023 16:30:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=U1qkRyL7k1O3GWP6YiWMhcDyAlECBOtvyqrEtzt92G4=; b=eV85NSarfWiZOrqnyyCdHseEXhm5IUQTeH1bxlkEY549dDNFX3qjWZJq4hzXpIelze cmgWjsIzzZc6E5o8zfejbg7GpTrWj5zEz4eY1ekf1Fva9q4Bxdb5ePmkspO5TIDLc9yZ rzpCXiDC7XhwJ8kKINgtWKxMr5fyD+1YKgknoer8RMefM1oL6S1v2NO4VRYWys4izRqG e+EcptO+OkFAMx/x5IClszgrjAsSGGjjTabIQxAh5Czj5TF5TpKVjg4rpEfH2lC4FVVn e4e6YP9hqya+hOGcQxaJ6gram3hQ47WyxOUtU+AVaoxeS4y+RewHY6qbv35E0sW3aIfJ XMLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U1qkRyL7k1O3GWP6YiWMhcDyAlECBOtvyqrEtzt92G4=; b=gqzlJLCdsoW2CIQNYgmMmJPhCuEqovoppO8ycpnGVR0SpUb91suk0dv3ygxilpzL8d 4u9rfkfS8wEVopovN+NdbqIxRvbflQIHxiAZNHBpiF0LVgORb8FBBvKgS90caqsCBbH4 0D1TbCp/yr6TWE+nnNCJEJc/5mzs+np+Y9+E+nUgU/6IOkRzu8CXLrkrqvvQWRnnNzM/ rE+UM9jtOJasugIFRyiwH8S7C/5DU/+bSsz/RxOPnkfzsGMGpaRWrHJaUXEQNaEOLzbD R4vYxrZbYkCLyXjxlrULnEKk1TVzOHj3VKsn8igb5FmtYpH3vGZKi4Paa0uycvWzG6es EzGw== X-Gm-Message-State: AO0yUKUmZNETmnYLW4S59FuvtG16nWpqwQM29CBpvoQUfWO/a9OUAeSX 7a3OSFF2U5RMirMMZL+1tZ0FIA== X-Google-Smtp-Source: AK7set8Hi3VcAp6Zl0B5jsUo6buq1pmvFedfbm0gGjWY1bUWUYK3usJBH6eXUPOgERujyi9W7ng+TQ== X-Received: by 2002:a17:902:f54a:b0:194:6409:b54a with SMTP id h10-20020a170902f54a00b001946409b54amr8657622plf.49.1675384235046; Thu, 02 Feb 2023 16:30:35 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x2-20020a1709027c0200b0019472226769sm247318pll.251.2023.02.02.16.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 16:30:34 -0800 (PST) Date: Thu, 2 Feb 2023 16:30:32 -0800 From: Stephen Hemminger To: Simei Su Cc: qi.z.zhang@intel.com, junfeng.guo@intel.com, dev@dpdk.org, wenjun1.wu@intel.com Subject: Re: [PATCH v3 2/2] net/igc: enable launch time offloading Message-ID: <20230202163032.5e83a648@hermes.local> In-Reply-To: <20230202071801.30576-3-simei.su@intel.com> References: <20230201073014.431924-1-simei.su@intel.com> <20230202071801.30576-1-simei.su@intel.com> <20230202071801.30576-3-simei.su@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Thu, 2 Feb 2023 15:18:01 +0800 Simei Su wrote: > > +static uint32_t igc_tx_launchtime(uint64_t txtime, uint16_t port_id) > +{ > + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > + struct igc_adapter *adapter = IGC_DEV_PRIVATE(dev); > + uint64_t base_time = adapter->base_time; > + uint64_t cycle_time = adapter->cycle_time; > + uint32_t launchtime; > + > + launchtime = (txtime - base_time) % cycle_time; > + > + return rte_cpu_to_le_32(launchtime); > +} Divide in transmit path will slow things down. Better to use something like rte_reciprocal_divide_64() to avoid slow 64 bit divide.