From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBA05C433B4 for ; Tue, 6 Apr 2021 08:42:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83574613C2 for ; Tue, 6 Apr 2021 08:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244418AbhDFImc (ORCPT ); Tue, 6 Apr 2021 04:42:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244404AbhDFImb (ORCPT ); Tue, 6 Apr 2021 04:42:31 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DA05C06174A for ; Tue, 6 Apr 2021 01:42:22 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id i143so7272998yba.10 for ; Tue, 06 Apr 2021 01:42:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kwsTCxAhw3dF0GAm7sPVjyGArt4+iGQXiKg3gB/niEo=; b=OmPt5GlYu2KEaDFgQh72FZkv2hZb2kru4agJXq7+Qr6+VLkTMsJpEySLeZRGDeFJNh YfSfsnnG37Clmnl5CpQojwlRdco3kpsfMnVUJeneI8+zhdD/cPtbNvEGZXZCvW/A26hU hQ18asRgAc2E7H6LkfKrMQh5CWTWzbX99PjVoIMQHVk7dmKZuCFViMZHoXETFq4etVvE lKvGRHFZEyQd4g/ibam5B4YoM36JkRuSS/y+cfLHCSdiB5lNg90FfVl4ber/+dhYvDTY HOtMCF/4pDGTO5VTtMleQYU/Ec53j1mfGKKf7kkPAltS346WPoiL0KRG+r/EPTmJeILx xqkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kwsTCxAhw3dF0GAm7sPVjyGArt4+iGQXiKg3gB/niEo=; b=prm2VUiTHojQxSLUSiPMP88Kos4nvRcefVkbLf0XqkjoSg8dFZ7IEcXAfEazZUwHut XGzlJ3vqNEy+pGuoQz59veISEsWWCmdR4qN00aMkwVDugOfFkntAzgNQg9eD0DSr0ypC zVMKzHE9iYA3O7AYie+pnXzFgMIFUYtNoagIAJUitXeTxrGKCthezbE0lL6car08icxf HYIVRO0gziLqn085PzKeS1Ybsy1oq4GMSRNxLO8yzD4qg2AZgoD/IWCvph5w0Hrd2TBK z1JNWjIrAzkJ/ZYRjWcQl/Ul3VG0nFBOgvkzZW4Ctklhewgz2bP6E0fY5MkkPuSWTSCz MMFw== X-Gm-Message-State: AOAM533O7LfN5hWJB6GKTiBU0YDzc1aQ0E2EZdRGrduxaJDpuMaydAy0 TsTVkZ3TTzcdipRoXaWVJLAPNzwxgw2BzOJ0XlM7xQ== X-Google-Smtp-Source: ABdhPJyHynTnKquoiGNp1O+FetHdDzISEyyH9PhG7IkkKKJHyTUHirX5cCXJljsTpgFD4pIiWERAmOAKEBxiDD7VPnQ= X-Received: by 2002:a25:6a88:: with SMTP id f130mr42247222ybc.234.1617698541330; Tue, 06 Apr 2021 01:42:21 -0700 (PDT) MIME-Version: 1.0 References: <20210406073509.13734-1-kurt@linutronix.de> In-Reply-To: <20210406073509.13734-1-kurt@linutronix.de> From: Eric Dumazet Date: Tue, 6 Apr 2021 10:42:09 +0200 Message-ID: Subject: Re: [PATCH net v3] net: hsr: Reset MAC header for Tx path To: Kurt Kanzenbach Cc: "David S. Miller" , Jakub Kicinski , Murali Karicheri , Taehee Yoo , Vladimir Oltean , George McCollister , Luc Van Oostenryck , Wang Hai , Daniel Borkmann , Jesper Dangaard Brouer , Willem de Bruijn , Sebastian Andrzej Siewior , netdev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Apr 6, 2021 at 9:35 AM Kurt Kanzenbach wrote: > > Reset MAC header in HSR Tx path. This is needed, because direct packet > transmission, e.g. by specifying PACKET_QDISC_BYPASS does not reset the MAC > header. > > This has been observed using the following setup: > > |$ ip link add name hsr0 type hsr slave1 lan0 slave2 lan1 supervision 45 version 1 > |$ ifconfig hsr0 up > |$ ./test hsr0 > > The test binary is using mmap'ed sockets and is specifying the > PACKET_QDISC_BYPASS socket option. > > This patch resolves the following warning on a non-patched kernel: > > |[ 112.725394] ------------[ cut here ]------------ > |[ 112.731418] WARNING: CPU: 1 PID: 257 at net/hsr/hsr_forward.c:560 hsr_forward_skb+0x484/0x568 > |[ 112.739962] net/hsr/hsr_forward.c:560: Malformed frame (port_src hsr0) > > The warning can be safely removed, because the other call sites of > hsr_forward_skb() make sure that the skb is prepared correctly. > > Fixes: d346a3fae3ff ("packet: introduce PACKET_QDISC_BYPASS socket option") > Signed-off-by: Kurt Kanzenbach > --- Reviewed-by: Eric Dumazet