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 1ED4BA0547; Mon, 27 Sep 2021 06:37:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 98C7C40686; Mon, 27 Sep 2021 06:37:51 +0200 (CEST) Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) by mails.dpdk.org (Postfix) with ESMTP id 21F124003D for ; Mon, 27 Sep 2021 06:37:50 +0200 (CEST) Received: by mail-il1-f174.google.com with SMTP id h20so17742835ilj.13 for ; Sun, 26 Sep 2021 21:37:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ApPsl7Q1RuzzxqHD4lgDwnT+Z1jheNU2TL/QRyjOZ8E=; b=M3LlMhjWssuUx6CPUMsvyeXtP3vekfxEzmxdJ4nB21pu5Y/IgE7mXoH7RY6OxubU0M HtDvbt7n03pMWHWAathy0KwgzNsQo2JI+JOxV3rosdBgLCZw6n3gigTTRV+uqUpfUTXE w8H+DH7tpkq0IorGOL0AgoW5E+hjoom/RqwfE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ApPsl7Q1RuzzxqHD4lgDwnT+Z1jheNU2TL/QRyjOZ8E=; b=aWEV4lHO3/Hh7RVeET/rUsH8rwJzgKQbgW40oshvDL8eDDNN4uE64O/+NWekKtkKXU 2ekkuOcB7Y87xpp9AhjzfPf9Ir94plCpNDq+FH7zTvKzxAb9a8u+XCs8ftVE7eCcK4gh lzBObAXreyAAMuXWbjXFhJG6PBP92JEzRyz58QrtO1fzlYKqy7h4My7NDhOfHnwNG1pN XE7khyb4H4uXzGGtargCqnUdpwi9NOjVSJ2PmaSvZDuLYQ2PjcuvbH9NNu4KKAl17ZqW dM/IuCGmTwijoI23F0nXXut/38urI/CIgQel1D0qhNPn9mdMfimC4Yl3a5GF00RND6Kw EgTA== X-Gm-Message-State: AOAM531suWSA8POciWBQ2cjRHsbN4GNUrs06k0WAgrCqbPX3WOzSK5La pQ0IHT87XSjc0Qc6xz5PHL37TQPPCEXlVsbvNKiwgg== X-Google-Smtp-Source: ABdhPJw/2kuzHnUqcDuc/KaZJ6sk8qyB8gxDCfwUtUUHBz/K9SmHbJhhb702R1NSmfPv63Y/wNROanowfNiW9rUo2j8= X-Received: by 2002:a05:6e02:b4b:: with SMTP id f11mr4759365ilu.26.1632717469215; Sun, 26 Sep 2021 21:37:49 -0700 (PDT) MIME-Version: 1.0 References: <20210924051753.30822-1-kalesh-anakkur.purayil@broadcom.com> In-Reply-To: <20210924051753.30822-1-kalesh-anakkur.purayil@broadcom.com> From: Ajit Khaparde Date: Sun, 26 Sep 2021 21:37:33 -0700 Message-ID: To: Kalesh A P Cc: dpdk-dev , Ferruh Yigit Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000cb431e05ccf2a834" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH] net/bnxt: improve error recovery information messages 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" --000000000000cb431e05ccf2a834 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 23, 2021 at 9:57 PM Kalesh A P wrote: > > From: Kalesh AP > > The error recovery async event messages are often mistaken > for errors. Improved the wording to clarify the meaning of > these events. > Also, take the first step towards more inclusive language. > The references to master will be changed to primary. > For example: "bnxt_is_master_func" will be renamed to > "bnxt_is_primary_func()". > > Signed-off-by: Kalesh AP > Reviewed-by: Ajit Khaparde > Reviewed-by: Somnath Kotur Patch applied to dpdk-next-net-brcm. Thanks > --- > drivers/net/bnxt/bnxt.h | 6 +++--- > drivers/net/bnxt/bnxt_cpr.c | 33 ++++++++++++++++++--------------- > drivers/net/bnxt/bnxt_cpr.h | 2 +- > drivers/net/bnxt/bnxt_ethdev.c | 16 ++++++++-------- > drivers/net/bnxt/bnxt_hwrm.c | 4 ++-- > 5 files changed, 32 insertions(+), 29 deletions(-) > > diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h > index a64b138..5121d05 100644 > --- a/drivers/net/bnxt/bnxt.h > +++ b/drivers/net/bnxt/bnxt.h > @@ -501,9 +501,9 @@ struct bnxt_ctx_mem_buf_info { > struct bnxt_error_recovery_info { > /* All units in milliseconds */ > uint32_t driver_polling_freq; > - uint32_t master_func_wait_period; > + uint32_t primary_func_wait_period; > uint32_t normal_func_wait_period; > - uint32_t master_func_wait_period_after_reset; > + uint32_t primary_func_wait_period_after_reset; > uint32_t max_bailout_time_after_reset; > #define BNXT_FW_STATUS_REG 0 > #define BNXT_FW_HEARTBEAT_CNT_REG 1 > @@ -520,7 +520,7 @@ struct bnxt_error_recovery_info { > uint8_t delay_after_reset[BNXT_NUM_RESET_REG]; > #define BNXT_FLAG_ERROR_RECOVERY_HOST BIT(0) > #define BNXT_FLAG_ERROR_RECOVERY_CO_CPU BIT(1) > -#define BNXT_FLAG_MASTER_FUNC BIT(2) > +#define BNXT_FLAG_PRIMARY_FUNC BIT(2) > #define BNXT_FLAG_RECOVERY_ENABLED BIT(3) > uint32_t flags; > > diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c > index 12230dc..63ff02a 100644 > --- a/drivers/net/bnxt/bnxt_cpr.c > +++ b/drivers/net/bnxt/bnxt_cpr.c > @@ -120,6 +120,7 @@ void bnxt_handle_async_event(struct bnxt *bp, > struct bnxt_error_recovery_info *info; > uint32_t event_data; > uint32_t data1, data2; > + uint32_t status; > > data1 =3D rte_le_to_cpu_32(async_cmp->event_data1); > data2 =3D rte_le_to_cpu_32(async_cmp->event_data2); > @@ -188,24 +189,26 @@ void bnxt_handle_async_event(struct bnxt *bp, > if (!info) > return; > > - PMD_DRV_LOG(INFO, "Port %u: Error recovery async event re= ceived\n", > - port_id); > - > event_data =3D data1 & EVENT_DATA1_FLAGS_MASK; > > - if (event_data & EVENT_DATA1_FLAGS_MASTER_FUNC) > - info->flags |=3D BNXT_FLAG_MASTER_FUNC; > - else > - info->flags &=3D ~BNXT_FLAG_MASTER_FUNC; > - > - if (event_data & EVENT_DATA1_FLAGS_RECOVERY_ENABLED) > + if (event_data & EVENT_DATA1_FLAGS_RECOVERY_ENABLED) { > info->flags |=3D BNXT_FLAG_RECOVERY_ENABLED; > - else > + } else { > info->flags &=3D ~BNXT_FLAG_RECOVERY_ENABLED; > + PMD_DRV_LOG(INFO, "Driver recovery watchdog is di= sabled\n"); > + return; > + } > + > + if (event_data & EVENT_DATA1_FLAGS_MASTER_FUNC) > + info->flags |=3D BNXT_FLAG_PRIMARY_FUNC; > + else > + info->flags &=3D ~BNXT_FLAG_PRIMARY_FUNC; > > - PMD_DRV_LOG(INFO, "Port %u: recovery enabled(%d), master = function(%d)\n", > - port_id, bnxt_is_recovery_enabled(bp), > - bnxt_is_master_func(bp)); > + status =3D bnxt_read_fw_status_reg(bp, BNXT_FW_STATUS_REG= ); > + PMD_DRV_LOG(INFO, > + "Port: %u Driver recovery watchdog, role: %s,= FW status: 0x%x (%s)\n", > + port_id, bnxt_is_primary_func(bp) ? "primary"= : "backup", status, > + (status =3D=3D BNXT_FW_STATUS_HEALTHY) ? "hea= lthy" : "unhealthy"); > > if (bp->flags & BNXT_FLAG_FW_HEALTH_CHECK_SCHEDULED) > return; > @@ -361,9 +364,9 @@ int bnxt_event_hwrm_resp_handler(struct bnxt *bp, str= uct cmpl_base *cmp) > return evt; > } > > -bool bnxt_is_master_func(struct bnxt *bp) > +bool bnxt_is_primary_func(struct bnxt *bp) > { > - if (bp->recovery_info->flags & BNXT_FLAG_MASTER_FUNC) > + if (bp->recovery_info->flags & BNXT_FLAG_PRIMARY_FUNC) > return true; > > return false; > diff --git a/drivers/net/bnxt/bnxt_cpr.h b/drivers/net/bnxt/bnxt_cpr.h > index 4095c8c..73468ed 100644 > --- a/drivers/net/bnxt/bnxt_cpr.h > +++ b/drivers/net/bnxt/bnxt_cpr.h > @@ -115,7 +115,7 @@ void bnxt_wait_for_device_shutdown(struct bnxt *bp); > HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_E= NABLED > > bool bnxt_is_recovery_enabled(struct bnxt *bp); > -bool bnxt_is_master_func(struct bnxt *bp); > +bool bnxt_is_primary_func(struct bnxt *bp); > > void bnxt_stop_rxtx(struct bnxt *bp); > > diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethde= v.c > index dc7dee1..a7f203c 100644 > --- a/drivers/net/bnxt/bnxt_ethdev.c > +++ b/drivers/net/bnxt/bnxt_ethdev.c > @@ -4443,11 +4443,11 @@ static int bnxt_fw_reset_all(struct bnxt *bp) > int rc =3D 0; > > if (info->flags & BNXT_FLAG_ERROR_RECOVERY_HOST) { > - /* Reset through master function driver */ > + /* Reset through primary function driver */ > for (i =3D 0; i < info->reg_array_cnt; i++) > bnxt_write_fw_reset_reg(bp, i); > /* Wait for time specified by FW after triggering reset *= / > - rte_delay_ms(info->master_func_wait_period_after_reset); > + rte_delay_ms(info->primary_func_wait_period_after_reset); > } else if (info->flags & BNXT_FLAG_ERROR_RECOVERY_CO_CPU) { > /* Reset with the help of Kong processor */ > rc =3D bnxt_hwrm_fw_reset(bp); > @@ -4464,8 +4464,8 @@ static void bnxt_fw_reset_cb(void *arg) > struct bnxt_error_recovery_info *info =3D bp->recovery_info; > int rc =3D 0; > > - /* Only Master function can do FW reset */ > - if (bnxt_is_master_func(bp) && > + /* Only Primary function can do FW reset */ > + if (bnxt_is_primary_func(bp) && > bnxt_is_recovery_enabled(bp)) { > rc =3D bnxt_fw_reset_all(bp); > if (rc) { > @@ -4493,8 +4493,8 @@ static void bnxt_fw_reset_cb(void *arg) > * advertised by FW in HWRM_ERROR_RECOVERY_QCFG. > * When the driver detects heartbeat stop or change in reset_counter, > * it has to trigger a reset to recover from the error condition. > - * A =E2=80=9Cmaster PF=E2=80=9D is the function who will have the privi= lege to > - * initiate the chimp reset. The master PF will be elected by the > + * A =E2=80=9Cprimary function=E2=80=9D is the function who will have th= e privilege to > + * initiate the chimp reset. The primary function will be elected by the > * firmware and will be notified through async message. > */ > static void bnxt_check_fw_health(void *arg) > @@ -4532,8 +4532,8 @@ static void bnxt_check_fw_health(void *arg) > > PMD_DRV_LOG(ERR, "Detected FW dead condition\n"); > > - if (bnxt_is_master_func(bp)) > - wait_msec =3D info->master_func_wait_period; > + if (bnxt_is_primary_func(bp)) > + wait_msec =3D info->primary_func_wait_period; > else > wait_msec =3D info->normal_func_wait_period; > > diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c > index d4d8581..503add4 100644 > --- a/drivers/net/bnxt/bnxt_hwrm.c > +++ b/drivers/net/bnxt/bnxt_hwrm.c > @@ -5716,11 +5716,11 @@ int bnxt_hwrm_error_recovery_qcfg(struct bnxt *bp= ) > /* FW returned values are in units of 100msec */ > info->driver_polling_freq =3D > rte_le_to_cpu_32(resp->driver_polling_freq) * 100; > - info->master_func_wait_period =3D > + info->primary_func_wait_period =3D > rte_le_to_cpu_32(resp->master_func_wait_period) * 100; > info->normal_func_wait_period =3D > rte_le_to_cpu_32(resp->normal_func_wait_period) * 100; > - info->master_func_wait_period_after_reset =3D > + info->primary_func_wait_period_after_reset =3D > rte_le_to_cpu_32(resp->master_func_wait_period_after_rese= t) * 100; > info->max_bailout_time_after_reset =3D > rte_le_to_cpu_32(resp->max_bailout_time_after_reset) * 10= 0; > -- > 2.10.1 > --000000000000cb431e05ccf2a834--