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 E9D0543C92; Tue, 12 Mar 2024 14:13:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D376D406FF; Tue, 12 Mar 2024 14:13:10 +0100 (CET) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) by mails.dpdk.org (Postfix) with ESMTP id D73CC402D8 for ; Tue, 12 Mar 2024 14:13:09 +0100 (CET) Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-42f2009e559so40418951cf.0 for ; Tue, 12 Mar 2024 06:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710249189; x=1710853989; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zpqG2kxZKERfNJ5meMiG0w3AsxVta4yqMtczkn3Xd6A=; b=UTEVmMmGFjIQKJlTl2zLEYd5ukXg3TI8JejxgHqe0icX0sAgRkO8z9htS5RgZE9po2 G1/CWLQUIKAIBEthl4ENajk902dHMPf8VMkjxJWSb+/50Rll8LWtWukyUl+YY+oQIdYd oxOxoYUhqburtPo/n30iMqxtwdS0iXzof07AE5V3eMPShShkFSoY58GkboQf/fKBpA17 04q4Tqoo4kTInsoMt0MgvYNxsXBlLIV5Szmpm6WoqJ6/ysoRyLkBJ509NkCFcWonDSxZ KNsiPNP095PGXshOZynoFZivx0eDs0WpI1OiUWy+K3/ov3c5vGVgHtQH4Pmu7fzIatAo sqTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710249189; x=1710853989; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zpqG2kxZKERfNJ5meMiG0w3AsxVta4yqMtczkn3Xd6A=; b=GMhVKLUI3pGQq03gJCta/nOjsD0SrYbW3j3sH6cJfEZcDR8UVleodPfnT6lcfIWTXG XIv3/rD8+BQWmKr5LJh2phluJN49/ITYWHxacaF11e1V443oA1WezmjiSYYG3Glq9cjW iQEKqfmSKMXz385+j5taCNOV+vNhNUbFHl/QrlzJ0baiVtpofTDcWGkzSCISMwwKMZSj /P6xSuLWr6M9h31AhFzVwb+V24ZyWYGjqjyvic4s8hbNBlQBpUNa+Ni1FtGxEwNZlbmL JtCpo/ldisOsoRZDiP176V2LCB16xHhxNfVunAaKPJkriwnPU9UQAxnyO/GATq/GHKXr 5N2Q== X-Gm-Message-State: AOJu0Yyzi6zJjOpGYf5I0JDM6FSpaUqDRtBYPtUgDCxHZJcbibPqpSv/ OpmwtQ78D2wVfgNVhN7wXdJ4iL4DgbVOol+bNhq3XYypYl69jM31eWnONc4eENqZkX9RFes2sfy mVmwCmiZxL+xHLqzjyexMV5/juRUHmk1lpG0= X-Google-Smtp-Source: AGHT+IHRMvDtZx7DBVmpaWE6/ZENusfuOgkvy6mD4TCvCeW9IseqwoP8w4A+W58SkPTFcERukAXiLqWUppFBirIm6f8= X-Received: by 2002:ac8:5787:0:b0:42e:7fd6:9dc5 with SMTP id v7-20020ac85787000000b0042e7fd69dc5mr17754184qta.22.1710249189003; Tue, 12 Mar 2024 06:13:09 -0700 (PDT) MIME-Version: 1.0 References: <20240311163912.11229-1-stephen@networkplumber.org> In-Reply-To: <20240311163912.11229-1-stephen@networkplumber.org> From: Jerin Jacob Date: Tue, 12 Mar 2024 18:42:43 +0530 Message-ID: Subject: Re: [PATCH] net/bnx2x: fix indentation To: Stephen Hemminger Cc: dev@dpdk.org, Julien Aube Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Mon, Mar 11, 2024 at 10:16=E2=80=AFPM Stephen Hemminger wrote: > > The DPDK style of indentation uses tabs not spaces. > This file had mix of both. Convert it. https://mails.dpdk.org/archives/test-report/2024-March/608887.html Fix the following one too WARNING:BRACES: braces {} are not necessary for single statement blocks #109: FILE: drivers/net/bnx2x/bnx2x_stats.c:494: + if (IS_VF(sc)) { + return; + } WARNING:BRACES: braces {} are not necessary for any arm of this statement #116: FILE: drivers/net/bnx2x/bnx2x_stats.c:498: + if (sc->port.pmf) { [...] - else if (sc->func_stx) { [...] WARNING:BRACES: braces {} are not necessary for single statement blocks #123: FILE: drivers/net/bnx2x/bnx2x_stats.c:502: + else if (sc->func_stx) { + bnx2x_func_stats_init(sc); + } > > Signed-off-by: Stephen Hemminger > --- > drivers/net/bnx2x/bnx2x_stats.c | 174 ++++++++++++++++---------------- > 1 file changed, 87 insertions(+), 87 deletions(-) > > diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_st= ats.c > index 69132c7c806e..895113c1e175 100644 > --- a/drivers/net/bnx2x/bnx2x_stats.c > +++ b/drivers/net/bnx2x/bnx2x_stats.c > @@ -487,32 +487,32 @@ bnx2x_func_stats_init(struct bnx2x_softc *sc) > static void > bnx2x_stats_start(struct bnx2x_softc *sc) > { > - /* > - * VFs travel through here as part of the statistics FSM, but no act= ion > - * is required > - */ > - if (IS_VF(sc)) { > - return; > - } > + /* > + * VFs travel through here as part of the statistics FSM, but no = action > + * is required > + */ > + if (IS_VF(sc)) { > + return; > + } > > - if (sc->port.pmf) { > - bnx2x_port_stats_init(sc); > - } > + if (sc->port.pmf) { > + bnx2x_port_stats_init(sc); > + } > > - else if (sc->func_stx) { > - bnx2x_func_stats_init(sc); > - } > + else if (sc->func_stx) { > + bnx2x_func_stats_init(sc); > + } > > - bnx2x_hw_stats_post(sc); > - bnx2x_storm_stats_post(sc); > + bnx2x_hw_stats_post(sc); > + bnx2x_storm_stats_post(sc); > } > > static void > bnx2x_stats_pmf_start(struct bnx2x_softc *sc) > { > - bnx2x_stats_comp(sc); > - bnx2x_stats_pmf_update(sc); > - bnx2x_stats_start(sc); > + bnx2x_stats_comp(sc); > + bnx2x_stats_pmf_update(sc); > + bnx2x_stats_start(sc); > } > > static void > @@ -1334,84 +1334,84 @@ bnx2x_port_stats_base_init(struct bnx2x_softc *sc= ) > static void > bnx2x_prep_fw_stats_req(struct bnx2x_softc *sc) > { > - int i; > - int first_queue_query_index; > - struct stats_query_header *stats_hdr =3D &sc->fw_stats_req->hdr; > - rte_iova_t cur_data_offset; > - struct stats_query_entry *cur_query_entry; > + int i; > + int first_queue_query_index; > + struct stats_query_header *stats_hdr =3D &sc->fw_stats_req->hdr; > + rte_iova_t cur_data_offset; > + struct stats_query_entry *cur_query_entry; > > - stats_hdr->cmd_num =3D sc->fw_stats_num; > - stats_hdr->drv_stats_counter =3D 0; > + stats_hdr->cmd_num =3D sc->fw_stats_num; > + stats_hdr->drv_stats_counter =3D 0; > > - /* > - * The storm_counters struct contains the counters of completed > - * statistics requests per storm which are incremented by FW > - * each time it completes hadning a statistics ramrod. We will > - * check these counters in the timer handler and discard a > - * (statistics) ramrod completion. > - */ > - cur_data_offset =3D (sc->fw_stats_data_mapping + > - offsetof(struct bnx2x_fw_stats_data, storm_counter= s)); > + /* > + * The storm_counters struct contains the counters of completed > + * statistics requests per storm which are incremented by FW > + * each time it completes hadning a statistics ramrod. We will > + * check these counters in the timer handler and discard a > + * (statistics) ramrod completion. > + */ > + cur_data_offset =3D (sc->fw_stats_data_mapping + > + offsetof(struct bnx2x_fw_stats_data, storm_cou= nters)); > > - stats_hdr->stats_counters_addrs.hi =3D htole32(U64_HI(cur_data_offse= t)); > - stats_hdr->stats_counters_addrs.lo =3D htole32(U64_LO(cur_data_offse= t)); > + stats_hdr->stats_counters_addrs.hi =3D htole32(U64_HI(cur_data_of= fset)); > + stats_hdr->stats_counters_addrs.lo =3D htole32(U64_LO(cur_data_of= fset)); > > - /* > - * Prepare the first stats ramrod (will be completed with > - * the counters equal to zero) - init counters to something differen= t. > - */ > - memset(&sc->fw_stats_data->storm_counters, 0xff, > - sizeof(struct stats_counter)); > + /* > + * Prepare the first stats ramrod (will be completed with > + * the counters equal to zero) - init counters to something diffe= rent. > + */ > + memset(&sc->fw_stats_data->storm_counters, 0xff, > + sizeof(struct stats_counter)); > > - /**** Port FW statistics data ****/ > - cur_data_offset =3D (sc->fw_stats_data_mapping + > - offsetof(struct bnx2x_fw_stats_data, port)); > + /**** Port FW statistics data ****/ > + cur_data_offset =3D (sc->fw_stats_data_mapping + > + offsetof(struct bnx2x_fw_stats_data, port)); > > - cur_query_entry =3D &sc->fw_stats_req->query[BNX2X_PORT_QUERY_IDX]; > + cur_query_entry =3D &sc->fw_stats_req->query[BNX2X_PORT_QUERY_IDX= ]; > > - cur_query_entry->kind =3D STATS_TYPE_PORT; > - /* For port query index is a DON'T CARE */ > - cur_query_entry->index =3D SC_PORT(sc); > - /* For port query funcID is a DON'T CARE */ > - cur_query_entry->funcID =3D htole16(SC_FUNC(sc)); > - cur_query_entry->address.hi =3D htole32(U64_HI(cur_data_offset)); > - cur_query_entry->address.lo =3D htole32(U64_LO(cur_data_offset)); > + cur_query_entry->kind =3D STATS_TYPE_PORT; > + /* For port query index is a DON'T CARE */ > + cur_query_entry->index =3D SC_PORT(sc); > + /* For port query funcID is a DON'T CARE */ > + cur_query_entry->funcID =3D htole16(SC_FUNC(sc)); > + cur_query_entry->address.hi =3D htole32(U64_HI(cur_data_offset)); > + cur_query_entry->address.lo =3D htole32(U64_LO(cur_data_offset)); > > - /**** PF FW statistics data ****/ > - cur_data_offset =3D (sc->fw_stats_data_mapping + > - offsetof(struct bnx2x_fw_stats_data, pf)); > + /**** PF FW statistics data ****/ > + cur_data_offset =3D (sc->fw_stats_data_mapping + > + offsetof(struct bnx2x_fw_stats_data, pf)); > > - cur_query_entry =3D &sc->fw_stats_req->query[BNX2X_PF_QUERY_IDX]; > + cur_query_entry =3D &sc->fw_stats_req->query[BNX2X_PF_QUERY_IDX]; > > - cur_query_entry->kind =3D STATS_TYPE_PF; > - /* For PF query index is a DON'T CARE */ > - cur_query_entry->index =3D SC_PORT(sc); > - cur_query_entry->funcID =3D htole16(SC_FUNC(sc)); > - cur_query_entry->address.hi =3D htole32(U64_HI(cur_data_offset)); > - cur_query_entry->address.lo =3D htole32(U64_LO(cur_data_offset)); > + cur_query_entry->kind =3D STATS_TYPE_PF; > + /* For PF query index is a DON'T CARE */ > + cur_query_entry->index =3D SC_PORT(sc); > + cur_query_entry->funcID =3D htole16(SC_FUNC(sc)); > + cur_query_entry->address.hi =3D htole32(U64_HI(cur_data_offset)); > + cur_query_entry->address.lo =3D htole32(U64_LO(cur_data_offset)); > > - /**** Clients' queries ****/ > - cur_data_offset =3D (sc->fw_stats_data_mapping + > - offsetof(struct bnx2x_fw_stats_data, queue_stats))= ; > + /**** Clients' queries ****/ > + cur_data_offset =3D (sc->fw_stats_data_mapping + > + offsetof(struct bnx2x_fw_stats_data, queue_sta= ts)); > > - /* > - * First queue query index depends whether FCoE offloaded request wi= ll > - * be included in the ramrod > - */ > + /* > + * First queue query index depends whether FCoE offloaded request= will > + * be included in the ramrod > + */ > first_queue_query_index =3D (BNX2X_FIRST_QUEUE_QUERY_IDX - 1); > > - for (i =3D 0; i < sc->num_queues; i++) { > - cur_query_entry =3D > - &sc->fw_stats_req->query[first_queue_query_index + i]; > + for (i =3D 0; i < sc->num_queues; i++) { > + cur_query_entry =3D > + &sc->fw_stats_req->query[first_queue_query_index = + i]; > > - cur_query_entry->kind =3D STATS_TYPE_QUEUE; > - cur_query_entry->index =3D bnx2x_stats_id(&sc->fp[i]); > - cur_query_entry->funcID =3D htole16(SC_FUNC(sc)); > - cur_query_entry->address.hi =3D htole32(U64_HI(cur_data_offset)); > - cur_query_entry->address.lo =3D htole32(U64_LO(cur_data_offset)); > + cur_query_entry->kind =3D STATS_TYPE_QUEUE; > + cur_query_entry->index =3D bnx2x_stats_id(&sc->fp[i]); > + cur_query_entry->funcID =3D htole16(SC_FUNC(sc)); > + cur_query_entry->address.hi =3D htole32(U64_HI(cur_data_o= ffset)); > + cur_query_entry->address.lo =3D htole32(U64_LO(cur_data_o= ffset)); > > - cur_data_offset +=3D sizeof(struct per_queue_stats); > - } > + cur_data_offset +=3D sizeof(struct per_queue_stats); > + } > } > > void bnx2x_memset_stats(struct bnx2x_softc *sc) > @@ -1476,7 +1476,7 @@ bnx2x_stats_init(struct bnx2x_softc *sc) > } > > PMD_DRV_LOG(DEBUG, sc, "port_stx 0x%x func_stx 0x%x", > - sc->port.port_stx, sc->func_stx); > + sc->port.port_stx, sc->func_stx); > > /* pmf should retrieve port statistics from SP on a non-init*/ > if (!sc->stats_init && sc->port.pmf && sc->port.port_stx) { > @@ -1492,11 +1492,11 @@ bnx2x_stats_init(struct bnx2x_softc *sc) > REG_RD(sc, NIG_REG_STAT0_BRB_TRUNCATE + port*0x38); > if (!CHIP_IS_E3(sc)) { > REG_RD_DMAE(sc, NIG_REG_STAT0_EGRESS_MAC_PKT0 + port*0x50= , > - RTE_PTR_ADD(&sc->port.old_nig_stats, > - offsetof(struct nig_stats, egress_mac_pkt= 0_lo)), 2); > + RTE_PTR_ADD(&sc->port.old_nig_stats, > + offsetof(struct nig_stats, egress= _mac_pkt0_lo)), 2); > REG_RD_DMAE(sc, NIG_REG_STAT0_EGRESS_MAC_PKT1 + port*0x50= , > - RTE_PTR_ADD(&sc->port.old_nig_stats, > - offsetof(struct nig_stats, egress_mac_pkt= 1_lo)), 2); > + RTE_PTR_ADD(&sc->port.old_nig_stats, > + offsetof(struct nig_stats, egress= _mac_pkt1_lo)), 2); > } > > /* function stats */ > @@ -1506,9 +1506,9 @@ bnx2x_stats_init(struct bnx2x_softc *sc) > memset(&sc->fp[i].old_xclient, 0, sizeof(sc->fp[i].old_xc= lient)); > if (sc->stats_init) { > memset(&sc->fp[i].eth_q_stats, 0, > - sizeof(sc->fp[i].eth_q_stats)); > + sizeof(sc->fp[i].eth_q_stats)); > memset(&sc->fp[i].eth_q_stats_old, 0, > - sizeof(sc->fp[i].eth_q_stats_old)= ); > + sizeof(sc->fp[i].eth_q_stats_old)); > } > } > > -- > 2.43.0 >