Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1704597iob; Thu, 5 May 2022 06:50:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUGsMdDeOLwamgxFVWYMDieQHw/B1nS6kmweB4FXi+f01i12XeT+HP7Lu4XQcWvdjX5YRC X-Received: by 2002:a65:434b:0:b0:382:4fa9:3be6 with SMTP id k11-20020a65434b000000b003824fa93be6mr22129620pgq.459.1651758625483; Thu, 05 May 2022 06:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651758625; cv=none; d=google.com; s=arc-20160816; b=hXKpeXXlpLAieyxhOldNIz3BmWVpkzSLL9rv4aOIopitKuKqQzkxvZIHicEhH7GV2O ZE9ciKWkS1jDOInEJubM+dOTYEH+0JDIENSs2Tel4tIX8OSDd7DZotZ1eUHWIjNqWYRa vOy+RjXZa3f9C7APaw11OLxt3ft1ydbESyfr8lx7BrWvTrLbokyIVrm50DQNrCZIKTR1 tEY9fufIws3bzC/e630rZRaOXlxDLUCBcuzSTtjJXeioCQGjR3zk2KjlJB7st0zmEmg+ Lxe8ct+w4kzLyKjQ0Kf4bLGYjh1KVFVayuNEPUmt0LH3KgE5GPVX+by5Mq+G8itgJRE2 Jg2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XQ2Gmenb9kkOoG2Rq6BTRoR5/99ClsJUIQC84I6Q4/A=; b=u7OrkL8W9oQAkkIBmpT1+Hly6wrZJ3xBl1fsCjA+6sKx+YnvuYfgxchtGiTaX+BcSS 9Nhlk2HU3JCZmMH8BKhZZeJRdIkBWi5TL1sL1YNJ1g3Qx4CH5Gb7vDwpyhUf0v9DN1a9 wRSrY0LbQKcFm/FjVxy90SMsQoor1h6qNP4WRLzljk0WpEEKFw/sE7RrTVv3S0bawT11 CxQ8+Nx7Qm/rqZlDVkk7tnCZPOm5FzqLoyLhFZY5730KYkHAFacfIu893eVBZ4EGJF/7 id9cN1yTIf7ejqWNShpkQqSD7Zg8VkJ9HdyqB5ciSLamvbYKwAshM5yZNidgTRZNSiPe wZgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dMgOkPMF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw26-20020a056a00451a00b0050df0f5da58si1758023pfb.62.2022.05.05.06.50.10; Thu, 05 May 2022 06:50:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dMgOkPMF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356866AbiEDRTH (ORCPT + 99 others); Wed, 4 May 2022 13:19:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356333AbiEDRFJ (ORCPT ); Wed, 4 May 2022 13:05:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DC2C50B32; Wed, 4 May 2022 09:54:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2EA9A61505; Wed, 4 May 2022 16:54:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5AA22C385BA; Wed, 4 May 2022 16:54:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683241; bh=+ajv8gDEINzpPt5k/lZ7YsXmqVeb/TEI1e3IDVzr2uw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dMgOkPMFKeLZAF7jGYZ8YjqmwtXq7rOPhct9SO77hvcnqoBC/DQaYwRrU4lDgn52n aIN8lY1S06ECRWEw0CgsmjoQ/1fmmFsxwYdzIz68/75ZLkHjdoNj/oZa+4Iri/Yd21 bj8FPwIXafHPNv+InZgMrvntNwwXQX+XKvaFdIrk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Lemon , Florian Fainelli , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 106/177] net: bcmgenet: hide status block before TX timestamping Date: Wed, 4 May 2022 18:44:59 +0200 Message-Id: <20220504153102.722994656@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153053.873100034@linuxfoundation.org> References: <20220504153053.873100034@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan Lemon [ Upstream commit acac0541d1d65e81e599ec399d34d184d2424401 ] The hardware checksum offloading requires use of a transmit status block inserted before the outgoing frame data, this was updated in '9a9ba2a4aaaa ("net: bcmgenet: always enable status blocks")' However, skb_tx_timestamp() assumes that it is passed a raw frame and PTP parsing chokes on this status block. Fix this by calling __skb_pull(), which hides the TSB before calling skb_tx_timestamp(), so an outgoing PTP packet is parsed correctly. As the data in the skb has already been set up for DMA, and the dma_unmap_* calls use a separately stored address, there is no no effective change in the data transmission. Signed-off-by: Jonathan Lemon Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220424165307.591145-1-jonathan.lemon@gmail.com Fixes: d03825fba459 ("net: bcmgenet: add skb_tx_timestamp call") Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index b4f99dd284e5..8bcc39b1575c 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -1991,6 +1991,11 @@ static struct sk_buff *bcmgenet_add_tsb(struct net_device *dev, return skb; } +static void bcmgenet_hide_tsb(struct sk_buff *skb) +{ + __skb_pull(skb, sizeof(struct status_64)); +} + static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) { struct bcmgenet_priv *priv = netdev_priv(dev); @@ -2097,6 +2102,8 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) } GENET_CB(skb)->last_cb = tx_cb_ptr; + + bcmgenet_hide_tsb(skb); skb_tx_timestamp(skb); /* Decrement total BD count and advance our write pointer */ -- 2.35.1