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 7725643C94; Tue, 12 Mar 2024 19:10:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2568F42E87; Tue, 12 Mar 2024 19:08:25 +0100 (CET) Received: from smtp-fw-33001.amazon.com (smtp-fw-33001.amazon.com [207.171.190.10]) by mails.dpdk.org (Postfix) with ESMTP id 5A30E42E61 for ; Tue, 12 Mar 2024 19:08:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1710266900; x=1741802900; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=WDV+hmSACMmsqqM212UqY/9dnqWFLG9PFU2PQ6KH3R4=; b=FdTKljlSUu55TPwOQU4t79SsOoYXlGZHJNjapUiVrOEAvqPxL/R5f9VD RbjEFispjdNhdtttwDlmZX4O2qSHviLxvUhFcX2P8V91+t00EbSSMHvnj SsvDBoMFcQRDk+KDY9ePqljN8JNS0F+P5mXKhvSxbA7PUImlJ4O9eYERC c=; X-IronPort-AV: E=Sophos;i="6.07,119,1708387200"; d="scan'208";a="332398345" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev) ([10.43.8.6]) by smtp-border-fw-33001.sea14.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2024 18:08:19 +0000 Received: from EX19MTAEUA001.ant.amazon.com [10.0.17.79:25751] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.1.140:2525] with esmtp (Farcaster) id c5e67311-9915-4c8d-99c2-36c3a3fa1b4e; Tue, 12 Mar 2024 18:08:16 +0000 (UTC) X-Farcaster-Flow-ID: c5e67311-9915-4c8d-99c2-36c3a3fa1b4e Received: from EX19D007EUB002.ant.amazon.com (10.252.51.117) by EX19MTAEUA001.ant.amazon.com (10.252.50.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 12 Mar 2024 18:08:16 +0000 Received: from EX19MTAUWA001.ant.amazon.com (10.250.64.204) by EX19D007EUB002.ant.amazon.com (10.252.51.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 12 Mar 2024 18:08:16 +0000 Received: from HFA15-CG15235BS.amazon.com (10.85.143.174) by mail-relay.amazon.com (10.250.64.204) with Microsoft SMTP Server id 15.2.1258.28 via Frontend Transport; Tue, 12 Mar 2024 18:08:14 +0000 From: To: CC: , Shai Brandes Subject: [PATCH v4 24/31] net/ena: cosmetic changes Date: Tue, 12 Mar 2024 20:07:09 +0200 Message-ID: <20240312180716.8515-25-shaibran@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240312180716.8515-1-shaibran@amazon.com> References: <20240312180716.8515-1-shaibran@amazon.com> MIME-Version: 1.0 Content-Type: text/plain 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 From: Shai Brandes This patch makes several changes to improve the style and readability of the code. Signed-off-by: Shai Brandes Reviewed-by: Amit Bernstein --- drivers/net/ena/base/ena_com.c | 13 +++++-------- drivers/net/ena/base/ena_plat_dpdk.h | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c index b98540ba63..2db21e7895 100644 --- a/drivers/net/ena/base/ena_com.c +++ b/drivers/net/ena/base/ena_com.c @@ -1914,15 +1914,14 @@ int ena_com_phc_get_timestamp(struct ena_com_dev *ena_dev, u64 *timestamp) /* PHC is in active state, update statistics according to req_id and error_flags */ if ((READ_ONCE16(read_resp->req_id) != phc->req_id) || - (read_resp->error_flags & ENA_PHC_ERROR_FLAGS)) { + (read_resp->error_flags & ENA_PHC_ERROR_FLAGS)) /* Device didn't update req_id during blocking time or timestamp is invalid, * this indicates on a device error */ phc->stats.phc_err++; - } else { + else /* Device updated req_id during blocking time with valid timestamp */ phc->stats.phc_exp++; - } } /* Setting relative timeouts */ @@ -2431,7 +2430,7 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data) timestamp = (u64)aenq_common->timestamp_low | ((u64)aenq_common->timestamp_high << 32); - ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIU64 "s]\n", + ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIu64 "s]\n", aenq_common->group, aenq_common->syndrome, timestamp); @@ -3233,16 +3232,15 @@ int ena_com_allocate_customer_metrics_buffer(struct ena_com_dev *ena_dev) { struct ena_customer_metrics *customer_metrics = &ena_dev->customer_metrics; + customer_metrics->buffer_len = ENA_CUSTOMER_METRICS_BUFFER_SIZE; ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, customer_metrics->buffer_len, customer_metrics->buffer_virt_addr, customer_metrics->buffer_dma_addr, customer_metrics->buffer_dma_handle); - if (unlikely(customer_metrics->buffer_virt_addr == NULL)) + if (unlikely(!customer_metrics->buffer_virt_addr)) return ENA_COM_NO_MEM; - customer_metrics->buffer_len = ENA_CUSTOMER_METRICS_BUFFER_SIZE; - return 0; } @@ -3285,7 +3283,6 @@ void ena_com_delete_customer_metrics_buffer(struct ena_com_dev *ena_dev) customer_metrics->buffer_dma_addr, customer_metrics->buffer_dma_handle); customer_metrics->buffer_virt_addr = NULL; - customer_metrics->buffer_len = 0; } } diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h index bb21e1bf01..9e365b0f3b 100644 --- a/drivers/net/ena/base/ena_plat_dpdk.h +++ b/drivers/net/ena/base/ena_plat_dpdk.h @@ -40,7 +40,7 @@ typedef uint64_t dma_addr_t; #define ETIME ETIMEDOUT #endif -#define ENA_PRIU64 PRIu64 +#define ENA_PRIu64 PRIu64 #define ena_atomic32_t rte_atomic32_t #define ena_mem_handle_t const struct rte_memzone * -- 2.17.1