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 BC8B2A0C43; Fri, 17 Sep 2021 19:25:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 86E0A40E0F; Fri, 17 Sep 2021 19:25:12 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id D6B87407FF for ; Fri, 17 Sep 2021 19:25:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631899510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AB13IxVpJVDSsm+LmIomzpXcDOV4qqqcaq6UUKEHUVM=; b=N2Gres8TIwN0TTLZJ675wDvFssZVysqylx2Dlwc7h7cBUtlF5lC9RW7D9BpD58ECDt5fan ciiMt8KgS0YrCj/yui6mA5BrLpWoWECw7Hja35CZtBapODfRDhWyXFgo6sU24i17wFzp0A fRFs6Qhxfg+rrF3fLAkMZM3PnIi0iVk= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-602-MV9MVhaRNRqKQKBiVuF7PA-1; Fri, 17 Sep 2021 13:25:09 -0400 X-MC-Unique: MV9MVhaRNRqKQKBiVuF7PA-1 Received: by mail-wm1-f70.google.com with SMTP id 201-20020a1c04d2000000b0030b3e4fdcfbso2169816wme.0 for ; Fri, 17 Sep 2021 10:25:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=AB13IxVpJVDSsm+LmIomzpXcDOV4qqqcaq6UUKEHUVM=; b=aJhlYwvQW5k3+9wiuALHnPtCdwSHiojgbr3vy+RFT8WrUp8bd5PzgKkehO4FfNeTfw CtBMfppwUNZD9qA43KjGYKat7DilmG+1wcoEu0axsM+zh4qbkSwS75jR232DC1tbO9Dk Gg8/3LmmOqEAfT9801IVwLSFulwpp13aQ6AfVEG/w8HfN2kZOI3eBZAy1h5GssfcVSRN MJWG7qys64AhIctCleDX5BiO9O54enzPQmlx9QiRDvJMKNfaQ8NUo+mVwSRBkNT5hutP +c74VibWKdm+bgkOP/2xgjz/t8EGSxr25liU3gnjLntBSHn3Jq4q6YSBFBlhhXXZrKLo NSlQ== X-Gm-Message-State: AOAM530H0SeTAT+N+P7NC8FxReVXQpSgDNNlC7gkiE/HYQWTdSq73QH3 g3JJop63LItLbVnpv6CuFcVyZl8zu6yjVo3WUk4UV3xmOjSUCTOb+sF9RuVNzO/Q2MkjULttpYJ CpSesDkfxSOixNn+MSXXuIUNqoJXWTpL5ziLVyUj5WCTcWsGDCY2J73E= X-Received: by 2002:a05:600c:4111:: with SMTP id j17mr8335231wmi.99.1631899507817; Fri, 17 Sep 2021 10:25:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwm2gpR8sTuTGbZm/qzoTv2ZRo5Ppbkjqd9gdAR5bw5YJOagXrReBwhOTl0haw+A8Kkeufr0A== X-Received: by 2002:a05:600c:4111:: with SMTP id j17mr8335201wmi.99.1631899507502; Fri, 17 Sep 2021 10:25:07 -0700 (PDT) Received: from [192.168.0.36] ([78.18.26.217]) by smtp.gmail.com with ESMTPSA id j2sm7279144wrq.35.2021.09.17.10.25.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Sep 2021 10:25:07 -0700 (PDT) To: Alvin Zhang , qi.z.zhang@intel.com, junfeng.guo@intel.com Cc: dev@dpdk.org References: <20210914013123.23768-1-alvinx.zhang@intel.com> From: Kevin Traynor Message-ID: Date: Fri, 17 Sep 2021 18:25:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210914013123.23768-1-alvinx.zhang@intel.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] net/ice: add ability to reduce the Rx latency 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 14/09/2021 02:31, Alvin Zhang wrote: > This patch adds a devarg parameter to enable/disable reducing the > Rx latency. > > Signed-off-by: Alvin Zhang > --- > doc/guides/nics/ice.rst | 8 ++++++++ > drivers/net/ice/ice_ethdev.c | 26 +++++++++++++++++++++++--- > drivers/net/ice/ice_ethdev.h | 1 + > 3 files changed, 32 insertions(+), 3 deletions(-) > > diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst > index 5bc472f..3db0430 100644 > --- a/doc/guides/nics/ice.rst > +++ b/doc/guides/nics/ice.rst > @@ -219,6 +219,14 @@ Runtime Config Options > > These ICE_DBG_XXX are defined in ``drivers/net/ice/base/ice_type.h``. > > +- ``Reduce Rx interrupts and latency`` (default ``0``) > + > + vRAN workloads require low latency DPDK interface for the front haul > + interface connection to Radio. Now we can reduce Rx interrupts and > + latency by specify ``1`` for parameter ``rx-low-latency``:: > + > + -a 0000:88:00.0,rx-low-latency=1 > + When would a user select this and when not? What is the trade off? The text is a bit unclear. It looks below like it reduces the interrupt latency, but not the number of interrupts. Maybe I got it wrong. > Driver compilation and testing > ------------------------------ > > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c > index a4cd39c..85662e4 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -29,12 +29,14 @@ > #define ICE_PIPELINE_MODE_SUPPORT_ARG "pipeline-mode-support" > #define ICE_PROTO_XTR_ARG "proto_xtr" > #define ICE_HW_DEBUG_MASK_ARG "hw_debug_mask" > +#define ICE_RX_LOW_LATENCY "rx-low-latency" > > static const char * const ice_valid_args[] = { > ICE_SAFE_MODE_SUPPORT_ARG, > ICE_PIPELINE_MODE_SUPPORT_ARG, > ICE_PROTO_XTR_ARG, > ICE_HW_DEBUG_MASK_ARG, > + ICE_RX_LOW_LATENCY, > NULL > }; > > @@ -1827,6 +1829,9 @@ static int ice_parse_devargs(struct rte_eth_dev *dev) > if (ret) > goto bail; > > + ret = rte_kvargs_process(kvlist, ICE_RX_LOW_LATENCY, > + &parse_bool, &ad->devargs.rx_low_latency); > + > bail: > rte_kvargs_free(kvlist); > return ret; > @@ -3144,8 +3149,9 @@ static int ice_init_rss(struct ice_pf *pf) > { > struct ice_hw *hw = ICE_VSI_TO_HW(vsi); > uint32_t val, val_tx; > - int i; > + int rx_low_latency, i; > > + rx_low_latency = vsi->adapter->devargs.rx_low_latency; > for (i = 0; i < nb_queue; i++) { > /*do actual bind*/ > val = (msix_vect & QINT_RQCTL_MSIX_INDX_M) | > @@ -3155,8 +3161,21 @@ static int ice_init_rss(struct ice_pf *pf) > > PMD_DRV_LOG(INFO, "queue %d is binding to vect %d", > base_queue + i, msix_vect); > + > /* set ITR0 value */ > - ICE_WRITE_REG(hw, GLINT_ITR(0, msix_vect), 0x2); > + if (rx_low_latency) { > + /** > + * Empirical configuration for optimal real time > + * latency reduced interrupt throttling to 2us > + */ > + ICE_WRITE_REG(hw, GLINT_ITR(0, msix_vect), 0x1); Why not set this to 0? "Setting the INTERVAL to zero enables immediate interrupt." > + ICE_WRITE_REG(hw, QRX_ITR(base_queue + i), > + QRX_ITR_NO_EXPR_M); > + } else { > + ICE_WRITE_REG(hw, GLINT_ITR(0, msix_vect), 0x2); > + ICE_WRITE_REG(hw, QRX_ITR(base_queue + i), 0); > + } > + > ICE_WRITE_REG(hw, QINT_RQCTL(base_queue + i), val); > ICE_WRITE_REG(hw, QINT_TQCTL(base_queue + i), val_tx); > } > @@ -5314,7 +5333,8 @@ static int ice_xstats_get_names(__rte_unused struct rte_eth_dev *dev, > ICE_HW_DEBUG_MASK_ARG "=0xXXX" > ICE_PROTO_XTR_ARG "=[queue:]" > ICE_SAFE_MODE_SUPPORT_ARG "=<0|1>" > - ICE_PIPELINE_MODE_SUPPORT_ARG "=<0|1>"); > + ICE_PIPELINE_MODE_SUPPORT_ARG "=<0|1>" > + ICE_RX_LOW_LATENCY "=<0|1>"); > > RTE_LOG_REGISTER_SUFFIX(ice_logtype_init, init, NOTICE); > RTE_LOG_REGISTER_SUFFIX(ice_logtype_driver, driver, NOTICE); > diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h > index b4bf651..c61cc1f 100644 > --- a/drivers/net/ice/ice_ethdev.h > +++ b/drivers/net/ice/ice_ethdev.h > @@ -463,6 +463,7 @@ struct ice_pf { > * Cache devargs parse result. > */ > struct ice_devargs { > + int rx_low_latency; > int safe_mode_support; > uint8_t proto_xtr_dflt; > int pipe_mode_support; >