From patchwork Fri Jun 28 19:30:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13716553 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.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 998CC78B60 for ; Fri, 28 Jun 2024 19:30:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719603040; cv=none; b=XyqIiBN/2kXjiSaiURYxjWBsSUTiQSeIWiJoUiaW+yIw8EmHvKIIZH2dRioWR/gIywPbupfGW14AMRPx9Crgu7O0vroa7RFHB7xRBTUwpZ7BX8tnKmkgygfsVTNWRqR68H0V5gs5JK/lk+Zz9Ow7Cuix42zC/BpzY4eNW7fkYoo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719603040; c=relaxed/simple; bh=sFFLF0EpM3YF0tLpyVfZCvB4795HuB1kbHomE52blMw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KW2pA+hklEvbpjEXZmhgG7NcZFHnRFm3i8xLEQzyEbNAVTRaIyrobZpbsT0NyQRdBF+29EQsiwPVkiKzT+ddAmqxaMf8X/molfTod46AmbkF1sCFigKBYDwZjCSXO6U4U3UqirhKUKZoTHuYuzkiWdv1H3kL64VpN+d1lbVOqGk= 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=cAAXi+z2; arc=none smtp.client-ip=209.85.214.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="cAAXi+z2" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1fab03d2eecso6932975ad.0 for ; Fri, 28 Jun 2024 12:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719603038; x=1720207838; 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=HLNTQ1zAdXd/4l6XKz9YfcIIVzES0Ft4acrZvn8+rrw=; b=cAAXi+z2bjNErpD9C+UM6lfPtNZqbkDTQjwNzk83M5vMlqwxPaXH2y56jOejlYhxnq q8OnH724n1o7wJ8DZZgK4Ul7LVKKL6wKajPaHGLluIqwOdlmpOQd2CR1wBvmt6JVTBB4 RdtDy9msojhjae1AvaodOiKSiR1Jbn2GDbnTA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719603038; x=1720207838; 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=HLNTQ1zAdXd/4l6XKz9YfcIIVzES0Ft4acrZvn8+rrw=; b=A/N09PqDv5ehHgtzUT7OfPD+IK3Tsh2NZ4+fY9ZELLENdEDwlumARxSoB2LKPGZGa9 0F5YamJ7VPsuC7wNYM3MaEat/IOtOFwVgs8CwK7JmT2eBoEk565IcG8Az9pDAZbGShrf uvO10BZtwec2SpTeIXqOck7nze/1VIMZ9Awv5LKuIH3/EHZLKLqB5YxzN9x1Q6uS5479 f8Ob7VJlFOwB2NzmjBqOBGAlNdrI0zMq4byyu4rxWZIaOWUNigKRvCy7C4MjQVuOYq8d HFuDgSaQSgfIKvwV5BBI++AtJ7g+TbgAg65kbmlTaDkQDfojb0dbiFe66t194zGy0ymg aVTQ== X-Gm-Message-State: AOJu0YwCP7FGYvsKSMzj6fBDknkkwvmaDjHHOZ+i+qup6OhFNiz843uc 9Ul318H7cE0mm1aBwrbwlQuRn94Kh4sEA8NLnnTOG/P1eAZH4JXjqUVuqpVcAyGlvCRMKkH133o = X-Google-Smtp-Source: AGHT+IFPW/OThhX0rBeawhC9PpGKFSEct85RhQcAVS9L6OrHs7Jrz84NNsS3ekXJYTcHhRVROmMU4A== X-Received: by 2002:a17:90b:350d:b0:2c7:b34b:12c4 with SMTP id 98e67ed59e1d1-2c858275ademr17070986a91.31.1719603037488; Fri, 28 Jun 2024 12:30:37 -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.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jun 2024 12:30:36 -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 07/10] bnxt_en: Remove an impossible condition check for PTP TX pending SKB Date: Fri, 28 Jun 2024 12:30:02 -0700 Message-ID: <20240628193006.225906-8-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 From: Pavan Chebbi In the current 5750X PTP code paths, there is always at most one TX SKB requested for timestamp and we won't accept another one until we have retrieved the timestamp or it has timed out. Remove the unnecessary check in bnxt_get_tx_ts_p5() for a pending SKB and change the function to void. Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 ++------ drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 7 +------ drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index a9741faa960c..78ccfac0644e 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -837,12 +837,8 @@ static bool __bnxt_tx_int(struct bnxt *bp, struct bnxt_tx_ring_info *txr, if (unlikely(is_ts_pkt)) { if (BNXT_CHIP_P5(bp)) { /* PTP worker takes ownership of the skb */ - if (!bnxt_get_tx_ts_p5(bp, skb)) { - skb = NULL; - } else { - atomic64_inc(&bp->ptp_cfg->stats.ts_err); - atomic_inc(&bp->ptp_cfg->tx_avail); - } + bnxt_get_tx_ts_p5(bp, skb); + skb = NULL; } } diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c index 8431cd0ed9e9..baf191959b13 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c @@ -750,17 +750,12 @@ static long bnxt_ptp_ts_aux_work(struct ptp_clock_info *ptp_info) return HZ; } -int bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb) +void bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb) { struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; - if (ptp->txts_req.tx_skb) { - netdev_err(bp->dev, "deferring skb:one SKB is still outstanding\n"); - return -EBUSY; - } ptp->txts_req.tx_skb = skb; ptp_schedule_worker(ptp->ptp_clock, 0); - return 0; } int bnxt_get_rx_ts_p5(struct bnxt *bp, u64 *ts, u32 pkt_ts) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h index 90f1418211e9..ee1709cda47e 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h @@ -159,7 +159,7 @@ int bnxt_ptp_cfg_tstamp_filters(struct bnxt *bp); void bnxt_ptp_reapply_pps(struct bnxt *bp); int bnxt_hwtstamp_set(struct net_device *dev, struct ifreq *ifr); int bnxt_hwtstamp_get(struct net_device *dev, struct ifreq *ifr); -int bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb); +void bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb); int bnxt_get_rx_ts_p5(struct bnxt *bp, u64 *ts, u32 pkt_ts); void bnxt_tx_ts_cmp(struct bnxt *bp, struct bnxt_napi *bnapi, struct tx_ts_cmp *tscmp);