From patchwork Wed Jun 26 16:42:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13713185 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 C445E18FC8C for ; Wed, 26 Jun 2024 16:43:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719420216; cv=none; b=Hw4UqJKjvYtek2ZJmY0nSU9XtcSAprOrjoGJ0jEgTBmqQQXDgYGZe7uscy6RRhbiTE5GfGAETpxrUnsdCiCKxz52WCZGalS7ESQGmGeKph1iCYrh3boPuyDm8klcVEPMrrZdtSm1x+cKmiVYUZnA8Z3JZCqjefIpjdKsUiaC/hY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719420216; c=relaxed/simple; bh=VwoVeAnF7sXXn2+QvAd8ZA7yQG5Gg7PBAurFVZvFOEs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Wz04Psxy5m4Bzp3M0YSE14dFN6Sik9gcCKpOwej/pH1s67YJEsFA0dTKOJhdKlTKJCF51DBwyKJD3qWMtFwMQ/rFShSkQh/bdQk9O8MJgGNvp1NPoPB8qBYwYMOwKUNSl2Da5umnKYu/HcZpiwnSZERCguTAAxc2d/F6R+Q581Q= 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=Z890qIKJ; arc=none smtp.client-ip=209.85.222.173 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="Z890qIKJ" Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-795a4fde8bfso406269685a.2 for ; Wed, 26 Jun 2024 09:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719420214; x=1720025014; 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=wXPJ8Wq+xQjKAbn0W6a+yEhetIHGX5/uROKicxN+ZFw=; b=Z890qIKJ73PXcU/RzJ4g0TtqPCnTMGrm4n8COKkZmn7AdMZe1q25G3AW0WvRkzfM1B LQpD+cXbn7RzesTKiOVlUE+ws6SpEZhrUUrqBLDPnoF9h9ZeyWua8p+NMNIP88/NazG1 zWu1M6+j21q4tu2eosX+eQZ6G9UZInWlDEM+0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719420214; x=1720025014; 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=wXPJ8Wq+xQjKAbn0W6a+yEhetIHGX5/uROKicxN+ZFw=; b=royu4Y24+zQKz0GFHDAHV5Y4SJCevfMJRkOTRKYeXRt95ufZK/pZyesWpXsSKffiCm WD1nJZvGk22wkuoH+8dL2dUp2hbqxweze8AtyUOncrE31Wkc7LkfoD8Qk90ay6v6Mo4x 77AJcoDzYH+D1qoj58gFZXCOr51j8E0fboh6yzyzK+yRcPcybZ8GytGtg9jugchgyDOa K73yfvwGJ75oHqJ7JOVTkpsAS5RFVp8RiJtWjRJKeraLhbn9rCEUOTWIBTOAT5a8Zy2n B/ZB7A+z3rGK/73ZmOpCE3quxFjAw6AUHvqeJuUoBtp8X5JkPTAL9E9FigDDzLcVpbvM +AXw== X-Gm-Message-State: AOJu0YzXzU1g5GhC8o/KArGDBRox4n/Z1hFnz5YPLzJPgadFh0I/Pwyc MpyA/3hieeY/Ham0feetpq9eopuJxX7GDR1ZQvGoXAOyc9iUSKNEwCzQHjV8Pw== X-Google-Smtp-Source: AGHT+IFxvOLaIKgw0VEiESu6jxwSNQWcaTzAqKnSHV6Cbb95+qUW347DckR8RhMG9jADQHW5Ek5csQ== X-Received: by 2002:a05:620a:25d0:b0:79b:f963:d25 with SMTP id af79cd13be357-79bf9630d29mr874415385a.75.1719420213421; Wed, 26 Jun 2024 09:43:33 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79d53c42aafsm53570485a.58.2024.06.26.09.43.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jun 2024 09:43:32 -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 Subject: [PATCH net-next 01/10] bnxt_en: Add new TX timestamp completion definitions Date: Wed, 26 Jun 2024 09:42:58 -0700 Message-ID: <20240626164307.219568-2-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20240626164307.219568-1-michael.chan@broadcom.com> References: <20240626164307.219568-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 retreive the timestamp will be added in the next few patches. Reviewed-by: Pavan Chebbi Reviewed-by: Andy Gospodarek Signed-off-by: Michael Chan --- 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)