From patchwork Fri Jun 28 19:29:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13716547 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EE7374077 for ; Fri, 28 Jun 2024 19:30:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719603029; cv=none; b=Rr4Ts1YJGAUd17P5kzXoaiVpkDwnqRVw1bPlZgeMokujXe3Zj4rKKK9dmgowLJsPcSascGeNw8FStcrrBAsAJDxJyZXe2iLaQOrTtCjNdBbo57kKiq6rbWyHhYC+Y7YPAwYF75zEKiJl5JW9tf3+dxW+8tfWt6kASieHoKpQczI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719603029; c=relaxed/simple; bh=d8cm1RXXqNhR0fuAlydplcPIbXhIiPBBmGD8iKc65fk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KXc3+sZ82lNaDNg2RbQtwn7zJeSAWP2FR+1TU36ucD3ZCZyYUVmkZYbV5Vovu/nB2+udgHxVXcyqb2NvkuCa0Lr4a2XbrMnDv8HLzYchR22uLMN6RZcfwrmM1cWyrUPsNhtpUN1Y+oNwQRtmsu2Q0wCicxmT/2ts9YcpQM8DprU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=ZHN3WF0F; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="ZHN3WF0F" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2c84df0e2f4so730560a91.1 for ; Fri, 28 Jun 2024 12:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719603027; x=1720207827; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=SnZeYY8as08wcK/a8n53jmHXPAEG0Gt3AENdlZajxyA=; b=ZHN3WF0F8qIui49oLXXE0H7+E34LMkURL6niodgZVhygIHexfDGTpvB9UMh3bdd6+u 9rYW9DsVG7w89cZ/cCn3rtZ7zWZiA+U+yMr2/aeR701flIsse/XDeMwo5/j+rlPsrDr4 jPbCanUsSL3kNrLVL93tPC8aqKzQvkjrxNe9U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719603027; x=1720207827; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SnZeYY8as08wcK/a8n53jmHXPAEG0Gt3AENdlZajxyA=; b=mAbhuZlH2pDK4P+AwTfmkvO8sHvAxtoVqutqv829nbJUcE9wJa0vVrysMKf1S1R8iA eaTKKVZpwk2jUQk7OqmjZSrUGO1jTDC3ZF+0M054b6/M1508+6GcRIPnPuOEFC1nNIOn y3AtBzUcAYUL6aqdzOwL52l/AKv1WLbCSS1lajgT0uQi1ugHbSWsriXFHk/Y5chneFP9 2T1M5zo0Uo5TzIfL5I4+Vk7Gcf/czILB26eeiReHlMQBsjCEtYIOsnmM3Cxvdq98jFSD KQjbxG0YwP1m3m+2iH7413w/FfVHuzCkHc/LTJD/pcva3+d1eYHEaQCbOUvZXaSkDYZ/ GBxA== X-Gm-Message-State: AOJu0Yzw73etG1bdFuw5ZZc5+rHUxgfqasqVqvaIti+LZyvOoygB3G+t P1E6MsNOSX0SWLziKPWeCRgChMarI62UG/weLllnFNXUtTEOzd06VexUVIVZwE8PZwCUHpOIy38 = X-Google-Smtp-Source: AGHT+IHbZMwDwgFsALOBUoUtuJ/zvkMg800q2I6ny8HtYswMfshyAxPntd5Zhzh6Ugib2CBSnsAnsQ== X-Received: by 2002:a17:90a:17e6:b0:2c8:8bf8:4e24 with SMTP id 98e67ed59e1d1-2c92765b57amr3994944a91.8.1719603026958; Fri, 28 Jun 2024 12:30:26 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c939cc9b04sm46707a91.0.2024.06.28.12.30.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jun 2024 12:30:25 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, richardcochran@gmail.com, horms@kernel.org, przemyslaw.kitszel@intel.com Subject: [PATCH net-next v2 01/10] bnxt_en: Add new TX timestamp completion definitions Date: Fri, 28 Jun 2024 12:29:56 -0700 Message-ID: <20240628193006.225906-2-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20240628193006.225906-1-michael.chan@broadcom.com> References: <20240628193006.225906-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The new BCM5760X chips will generate this new TX timestamp completion when a TX packet's timestamp has been taken right before transmission. The driver logic to retrieve the timestamp will be added in the next few patches. Reviewed-by: Pavan Chebbi Reviewed-by: Andy Gospodarek Signed-off-by: Michael Chan --- v2: Fix a typo in the ChangeLog. drivers/net/ethernet/broadcom/bnxt/bnxt.h | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index 9cf0acfa04e5..d3ad73d4c00a 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -181,6 +181,32 @@ struct tx_cmp { #define TX_CMP_SQ_CONS_IDX(txcmp) \ (le32_to_cpu((txcmp)->sq_cons_idx) & TX_CMP_SQ_CONS_IDX_MASK) +struct tx_ts_cmp { + __le32 tx_ts_cmp_flags_type; + #define TX_TS_CMP_FLAGS_ERROR (1 << 6) + #define TX_TS_CMP_FLAGS_TS_TYPE (1 << 7) + #define TX_TS_CMP_FLAGS_TS_TYPE_PM (0 << 7) + #define TX_TS_CMP_FLAGS_TS_TYPE_PA (1 << 7) + #define TX_TS_CMP_FLAGS_TS_FALLBACK (1 << 8) + #define TX_TS_CMP_TS_SUB_NS (0xf << 12) + #define TX_TS_CMP_TS_NS_MID (0xffff << 16) + #define TX_TS_CMP_TS_NS_MID_SFT 16 + u32 tx_ts_cmp_opaque; + __le32 tx_ts_cmp_errors_v; + #define TX_TS_CMP_V (1 << 0) + #define TX_TS_CMP_TS_INVALID_ERR (1 << 10) + __le32 tx_ts_cmp_ts_ns_lo; +}; + +#define BNXT_GET_TX_TS_48B_NS(tscmp) \ + (le32_to_cpu((tscmp)->tx_ts_cmp_ts_ns_lo) | \ + ((u64)(le32_to_cpu((tscmp)->tx_ts_cmp_flags_type) & \ + TX_TS_CMP_TS_NS_MID) << TX_TS_CMP_TS_NS_MID_SFT)) + +#define BNXT_TX_TS_ERR(tscmp) \ + (((tscmp)->tx_ts_cmp_flags_type & cpu_to_le32(TX_TS_CMP_FLAGS_ERROR)) &&\ + ((tscmp)->tx_ts_cmp_errors_v & cpu_to_le32(TX_TS_CMP_TS_INVALID_ERR))) + struct rx_cmp { __le32 rx_cmp_len_flags_type; #define RX_CMP_CMP_TYPE (0x3f << 0)