From patchwork Wed Jul 15 16:40:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 235607 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp29683ilg; Wed, 15 Jul 2020 09:40:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnYG3oQ1yMyONQ82o1e3ARL3icxR+12mtyvPryIT0f0I9j6PObd647ep5/3bDTbZKamBmI X-Received: by 2002:a17:906:33ca:: with SMTP id w10mr10433056eja.171.1594831224884; Wed, 15 Jul 2020 09:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594831224; cv=none; d=google.com; s=arc-20160816; b=xbjK8tT4+jJIyCtNVO11oEWZjMct7sTCKqVVOudIP6OsWf87JOv7nCpUjxXkl7Gu/b BE021uIfCfaSajyvEYxIDtDBsVHZWuu3u3hPvWb1NxJ0OBhbgY+lY4RYgUEh1yame5TT cwoXyaLBGxVmc0VtvsTLbxyPdW5L6c2AbjUxvOklkm1cuhx81UxdOxBvXlW68nggcc+b zaZB8Z2A+Uouk7UEsmVdYwjA6wZuKJ6fLzKjOqXQT0vBXZ96NRPt7Ij7E2r6BwFHlnLb eM26wjR3UNWDv/SVb1F13QBiZeHB58tTE4DljCResV4UNi5YXnAyuLpSu4g14WvGgr0o 1JBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=l9F2o1gesIVnYJhZiValfLiNSoAwf9JeCCag42kCIhw=; b=r/E+RKijaG+HfWnobuNvtqG24msHK3X+NQUJplDR4kFLGEo5Nj0EYHAVafHCQJfgcT OGF59/HX7J3xWJ39XM7Ih4Pl1z1KOT40i3jQBLQGzxz/YY7efhn1NmKaA8BFSVyRUXqR MqREgieRYFaHx+LWZmAzXGbBX5FX4bqQ2a1whCFWtCfTtfFlYqpMgRcqNyXMps+vQd8S SMGg/UBIa0bD7k2rfpP9MQE37tsxICPUjL5U/OM6Qg7fRRjNVyDzzMSrijab8FKqcvgO PdXFTDdtNGgEcQ2AIDdF91/+lZe4Ge469Ct2mJYqM4xC7zVR4Mgvm5ca4e9Zd96/ehGN WTGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pOYUydWs; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o19si1571140ejb.144.2020.07.15.09.40.24; Wed, 15 Jul 2020 09:40:24 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pOYUydWs; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726201AbgGOQkW (ORCPT + 9 others); Wed, 15 Jul 2020 12:40:22 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:42638 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725832AbgGOQkV (ORCPT ); Wed, 15 Jul 2020 12:40:21 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 06FGeG9i003829; Wed, 15 Jul 2020 11:40:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1594831216; bh=l9F2o1gesIVnYJhZiValfLiNSoAwf9JeCCag42kCIhw=; h=From:To:Subject:Date:In-Reply-To:References; b=pOYUydWsjV15MttD6f3f7N0GbW76lJoenLILsfkvQ+uKDLqOxmkVAjElsnykej79v hEn5IQSar6BmIP4WlhFqen/9ZMVTwXxmjKjCSSxTTGRZmeHQZWJ/M4wTh0jL5E9OJd pmL0pcmGNV86wqmKWENA7WUjxJE39TrrJQLiZgS0= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 06FGeGI4102665 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 15 Jul 2020 11:40:16 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 15 Jul 2020 11:40:15 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Wed, 15 Jul 2020 11:40:15 -0500 Received: from uda0868495.fios-router.home (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 06FGeCvZ081717; Wed, 15 Jul 2020 11:40:14 -0500 From: Murali Karicheri To: , , , , , , , Subject: [net-next PATCH v2 1/9] net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames Date: Wed, 15 Jul 2020 12:40:02 -0400 Message-ID: <20200715164012.1222-2-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200715164012.1222-1-m-karicheri2@ti.com> References: <20200715164012.1222-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For small Ethernet frames with size less than minimum size 66 for HSR vs 60 for regular Ethernet frames, hsr driver currently doesn't pad the frame to make it minimum size. This results in incorrect LSDU size being populated in the HSR tag for these frames. Fix this by padding the frame to the minimum size applicable for HSR. Signed-off-by: Murali Karicheri Reviewed-by: Grygorii Strashko --- net/hsr/hsr_forward.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index ed13760463de..e42fd356f073 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -127,6 +127,9 @@ static void hsr_fill_tag(struct sk_buff *skb, struct hsr_frame_info *frame, int lane_id; int lsdu_size; + /* pad to minimum packet size which is 60 + 6 (HSR tag) */ + skb_put_padto(skb, ETH_ZLEN + HSR_HLEN); + if (port->type == HSR_PT_SLAVE_A) lane_id = 0; else