Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3735789rwi; Wed, 12 Oct 2022 06:13:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4/cACvNGdaPUjRRuTSJfTBo7g8r8ZtaqJbemSFWbbGwS6mV7mWO/DfAk2EMcmgzWKjC7ah X-Received: by 2002:aa7:dc10:0:b0:440:b446:c0cc with SMTP id b16-20020aa7dc10000000b00440b446c0ccmr27349852edu.34.1665580384572; Wed, 12 Oct 2022 06:13:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665580384; cv=none; d=google.com; s=arc-20160816; b=uwNQggX5vSOVKgye0UjVXKVM5BwOnKV2CXWitShPy3QdG8KyBNdyykFrqcJx3B60Ya Pba+ha8ut5v54uHW3bnKy91KXiAzbc6wwfrr/keTKkQ1uhkU0TnXbhUjHN1Jlcp0yzQ2 P9zdGI90LLiiQFs/gXTw5cevZl///z9s8yBehUM0hSOfr38l1qXkfO5u11OtfeFuC+ix Wz481jcIa0fp0emSo0sYfmMyJsok7mJ5ytHgq6cEUKrft4Kcg1kSVoJGTJ12sTQOoY28 qHmQqAmYrlTFoycjE5wSvOzhApaIQ0d1Skm9M9E4GTjPjqvlnjvRWilm9Tapl48DR/RI I/eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:subject:cc:to:from:date:message-id:dkim-signature; bh=9/RIE4UtfSnbb24YnWB8sjXppAAKMhorvgvYfIUj5k4=; b=yhhwpS+7gOs/y+20PuDLqfj4jGCv2tGhnJy5w7yMd3l2OK5jtYbXUhkvmUOzYE4wD3 1RLCqIKK/Eur3RABu15QO5Evp1Ho9jDHrRyJpJgHKrK9tSrV8x9xg7hTr8bDZn7vi3y8 h+LP84eNjJI2wUHPrU2xSQI56+rO5k/DqkiIoBYr06y40t+BsZm4FjX9wAMxqQbjFAkA aFD6eYTeYM7Fzom+Z54N7ySb6E7Vy/aKu5MC5LjbZ3hhKYR3bX08fBdETfg4gQPCLAnQ kOzzFGVa+hJGXtRUrMWuNrSIrLQpWu3yYGiRf4OK4y6c88HK6Hv8NKXIfDSMzi3LAZVz Oz2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dBQz1uVS; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ck16-20020a0564021c1000b0045731196587si10701207edb.64.2022.10.12.06.12.27; Wed, 12 Oct 2022 06:13:04 -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=@gmail.com header.s=20210112 header.b=dBQz1uVS; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229761AbiJLMeb (ORCPT + 99 others); Wed, 12 Oct 2022 08:34:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbiJLMe2 (ORCPT ); Wed, 12 Oct 2022 08:34:28 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC8D9C6960; Wed, 12 Oct 2022 05:34:27 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id a26so37673012ejc.4; Wed, 12 Oct 2022 05:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=9/RIE4UtfSnbb24YnWB8sjXppAAKMhorvgvYfIUj5k4=; b=dBQz1uVSih9iBYNDG+HvDmLo2oLgdqcmQEq1z+bpjGgeQM2VbL6mvbFTVD8bQrRg8w SiDoQTUOn4BCEALVWnpIxLPD4/QogY2rqMaNw+ZseI4XTqvSDEdmj+EdlTzAVPxvuUFX SLg9sUHpH27bwUUp4wZDxlh9Hobs39km8D0RBUghVFePZh1v8bx356ApfBUGtBJrpllt 83ZikNmUH+iCo0LL3ZKoaDisVK5douU410IW0J0xSK20RxgIkQR/XiSY09xxp/aUBjBh Mo71R3FtgBUjzsmevzYgpWXa6eCJ3btCkjFTjPYzdbj7WBTT+RpU+62Wo5mSbcuee5/H yPZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9/RIE4UtfSnbb24YnWB8sjXppAAKMhorvgvYfIUj5k4=; b=FJfzh6R60MOgI5P7ca2o4P1a4KBrT+WHXxuLMzn22fTW/3v1mia4LSsa0t4bN9vmaF 50VEum1vKkDCjVYFF9OGo+y381Mm663KnF+JgYJ7yKSqDxkb31hsNoegAHa82Yy9d/sG EGbzCvOVj3u19kUW0rDTtdluwTgW877P01rc8z9+eqr5tl+PMcQNCK/iN4UfNwyhfV5w Y8jwETlRVrHKphWSJ46m/UFidI1PTl1DT9OnKx1GpidrjYEwD/Ea01q+re2vhpx5uumX f+hC4BdhdMQ6xPgWdBFk92z9XMgI90uDGrNqnJcuR9W/jdM5OuhJIrbxGgidNBhDOZMR ihhA== X-Gm-Message-State: ACrzQf3Pta+WuQkz07EfwwqykaTtn/Xnsd++KwOelPPy8WV2o4+pwLyl uBLycl4IsZD9GLj5P1kPvRk= X-Received: by 2002:a17:907:8a15:b0:782:e6da:f13d with SMTP id sc21-20020a1709078a1500b00782e6daf13dmr22750273ejc.152.1665578066004; Wed, 12 Oct 2022 05:34:26 -0700 (PDT) Received: from Ansuel-xps. (93-42-70-134.ip85.fastwebnet.it. [93.42.70.134]) by smtp.gmail.com with ESMTPSA id r10-20020a17090609ca00b00780636a85fasm1133082eje.221.2022.10.12.05.34.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Oct 2022 05:34:25 -0700 (PDT) Message-ID: <6346b451.170a0220.2c49b.3ebc@mx.google.com> X-Google-Original-Message-ID: Date: Wed, 12 Oct 2022 14:34:22 +0200 From: Christian Marangi To: Andrew Lunn Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Russell King (Oracle)" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Pawel Dembicki , Lech Perczak Subject: Re: [net PATCH 1/2] net: dsa: qca8k: fix inband mgmt for big-endian systems References: <20221010111459.18958-1-ansuelsmth@gmail.com> <63446da5.050a0220.92e81.d3fb@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On Wed, Oct 12, 2022 at 02:29:26PM +0200, Andrew Lunn wrote: > On Mon, Oct 10, 2022 at 02:44:46PM +0200, Christian Marangi wrote: > > On Mon, Oct 10, 2022 at 08:53:01PM +0200, Andrew Lunn wrote: > > > > /* Special struct emulating a Ethernet header */ > > > > struct qca_mgmt_ethhdr { > > > > - u32 command; /* command bit 31:0 */ > > > > - u32 seq; /* seq 63:32 */ > > > > - u32 mdio_data; /* first 4byte mdio */ > > > > + __le32 command; /* command bit 31:0 */ > > > > + __le32 seq; /* seq 63:32 */ > > > > + __le32 mdio_data; /* first 4byte mdio */ > > > > __be16 hdr; /* qca hdr */ > > > > } __packed; > > > > > > It looks odd that hdr is BE while the rest are LE. Did you check this? > > > > > > Andrew > > > > Yes we did many test to analyze this and I just checked with some > > tcpdump that the hdr is BE everytime. > > That might actual make sense. The comment says: > > > > > /* Special struct emulating a Ethernet header */ > > And hdr is where the Ether type would be, which is network endian, > i.e. big endian. > > Andrew Yes that is my theory... hdr is in the ether type position so it's the only part that the switch treat in a standard way as it has to be like that or a dev creating a tagger driver would have no way to understand if the packet is autocast, in band ack or a simple packet so who created the fw for the switch had this concern in mind and stick to keeping at least the hdr in a standard way. -- Ansuel