From patchwork Wed Jun 26 16:43:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13713191 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 E3DFE18FC75 for ; Wed, 26 Jun 2024 16:43:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719420226; cv=none; b=SCsO8kKEFHtITXZ/BX+s92z+3op/WWchia6nTG67tfgESxd/1MibipBuiWq6o7o11JhoFghzKaPGO8UO/z0CovrFP0YpykPb+4xOu8rBaKNxFEmuiKRdHWyVr82i0eK3+swsvA0O99YXu5y9m+VzuENaCstf/+e1A27OrXe1izI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719420226; c=relaxed/simple; bh=4HsPCyAqoH9VOB5PfyF2OhP0Tcfzn94IF6yU3n+PXWo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ItNB5gsG1oPQuEwIcYK2MHOBC3kU2MPQYBgdSovANz3XpzUtrLPi0kfMP18SWsXMix0tAfSbnF0xm8sJbL/MubfKpqK2IjaE7FFizxkRpZkzu3JaZoj4SX4XkxjyfgIHVUkxH4Dcoz+eXb/MK8TSvhwLB2ggxNHmtueOsDCKUNw= 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=XSesTc41; arc=none smtp.client-ip=209.85.222.169 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="XSesTc41" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-79c2c05638cso94315885a.3 for ; Wed, 26 Jun 2024 09:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719420224; x=1720025024; 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=LSTKzvXtxh6OZ7aiqGVsq05A96dhIv59dL3ZvrKQY2c=; b=XSesTc41MrtQnV4zlp85krYSlVW4EYRIAh6r5UdpEeFhBC8/SOZl2wDQO1WZ/NLfsv VGAJkxJL4z504Ybx1+jUsohxU1wQZgnEmZlAFszUur5HChUabofr5nz07pUyyt6qaT5B aj0mEIB5xNLObNx4ublnvWUJox/UXKnirGbyk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719420224; x=1720025024; 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=LSTKzvXtxh6OZ7aiqGVsq05A96dhIv59dL3ZvrKQY2c=; b=bsq/aCkFLSktWqjuURfbyGFQ3GAaL99VhN+M3mSk6rsCtzJzKa/oZZbevyx8Nkhb39 jh+SeSgsmMsw68YjnpYVN7hbG+sbMiPthPpR43iKj5dQP55e3wukFmMHf0nVnTfHEEZf WZFbvHJzZ6gBTclBfPU1071WcmtgDfxhE0TSAWhUIhkfLn6hC/sM1+BWeSYegD94PF9K niOVeDLXnbUPjVzS+kq3oLyuIam9EjIvSKz7gRReygF2H17cBbgQq4uYGWWym+5bUQdf /koil3z+GMlLWNC41A6x3WjuetaaYfbP3c3iEDeALfQLgg9RDHgWL9hPSgk52uTVR8jl 5Rlw== X-Gm-Message-State: AOJu0YzUlbdBCaheeooWcWzyNMLTpwpDD22gPzkFkDaYi863JGiK6XbC 1sFxBadebFK6nyLMEQNeVNpjYGcN7hk4JWrkKAyKrlx335WLeEnWH3sjLqWA7ZJhz5toSpIqO1M = X-Google-Smtp-Source: AGHT+IG82qydysI2F2KAktOWjiLDQ1tgOyP6B6eSsPDpsRr/p3pNJc1cL3JOzZVPqq4ISsBgNNAvwg== X-Received: by 2002:a05:620a:4549:b0:797:db7a:bc2 with SMTP id af79cd13be357-79be6f13d66mr1262072385a.57.1719420223206; Wed, 26 Jun 2024 09:43:43 -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.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jun 2024 09:43:42 -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 07/10] bnxt_en: Remove an impossible condition check for PTP TX pending SKB Date: Wed, 26 Jun 2024 09:43:04 -0700 Message-ID: <20240626164307.219568-8-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 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 c284aa370c64..ed2bbdf6b25f 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -838,12 +838,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);