Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2110444rdb; Mon, 20 Nov 2023 02:09:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFS3j7XX4kM9UhPomJDsGHDJH8iw/sMu8zPGaJI2ETwz0BIvsl/Hf65n/48To4BUOmN2DfU X-Received: by 2002:a05:6a00:f06:b0:6cb:68d7:b163 with SMTP id cr6-20020a056a000f0600b006cb68d7b163mr4500359pfb.23.1700474950517; Mon, 20 Nov 2023 02:09:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700474950; cv=none; d=google.com; s=arc-20160816; b=0taPipGB81bRlApeBNWbYXMrpwDq9R5q03R8bASE37GPOYUI3yypZfaVceokoEHS7J m/flNgjrQ914tsugScd84+NPxJo9co0NO7PrS0hiR9dVFv7yrJC+5nJepg2wZpdefDwJ V1piWfwCzCg2iIoP9B6RAXANkNF6AdzXndnRGUmso2V4giCJkf/k8nK0jyYA3zzSJA3z 6cELQ8kr2SWK9GIGTgoWC3WKAL9LKfnFFY4y6QSi5p6NTUXVR1n7bxVBvoForc9O0Bru vu5GLFomXb4zA8GHuZx0sJ+eCFYYKaboScglCEyoBBX7InU3h5uciFOifqCDDI5oCm6F 4znQ== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=BG5p9VqmcXaWITw4uBhbnn23kaCHWBsu/pxgIlsQDVo=; fh=koKJ7yhUP6PzvP8XUVOEOjyQaHjG1dSIgIzvmvOZvhU=; b=Jkymq92yCpqP2nfGyyHM4QZZg147ABg6xEcW//KlYlNYSCsiBLn0Rbj9a1AmF7b7y/ FNVQBfSQjImJuBN0CWMdhEM3eZ72FHH/3J8dItKCjNyt9n1S6atc96HqwnT7JdDN3wHf QGJM+igByo/sSQiyl/PL1lUowZfd0A8hMBHt0zYDbP5IV6NPtpLTADVwOmwOE7yzFJWd n0xp5NstsM/PO356Sgzs4s67smZMIrjBpJlp+TLa7YtCvQY2gSf0oPg+mNBPe4E6u97/ OshvTebRwNeKZs/EcCpHk10nE52tbJ6SMZbC/IIFsf+7fPVEUYO1947p0ic2xwH8XXBm Kgmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qEyPPQ39; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id fc6-20020a056a002e0600b006c4faa9a36esi8158690pfb.184.2023.11.20.02.09.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 02:09:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qEyPPQ39; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2AD39805DC12; Mon, 20 Nov 2023 02:08:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233013AbjKTKHw (ORCPT + 99 others); Mon, 20 Nov 2023 05:07:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232461AbjKTKHl (ORCPT ); Mon, 20 Nov 2023 05:07:41 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29513114 for ; Mon, 20 Nov 2023 02:07:38 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62C23C433C8; Mon, 20 Nov 2023 10:07:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700474857; bh=TGfMgrwe2KSPbSi99VzqSOOv4ugU1e/nyk1zzOp92KM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qEyPPQ394vbJXExhh6eX21kitVT0AmfJLg1XKcXda1q+nqME91xRGKsNFonThOvQR i4K2EQ2/aMLkdO6ny8mWPfC7nc1LyQ9acrGHvoEqew8OGRCOdPngtBZZv70NlK5jK5 A7heIR2lmBpYneiuMaE/IhxRZks3gCjVkP5M78zUU+SEA+HuRF3Ey/XS3XGNeS6RU1 a8HpfkoeO+Gb6SVUz7LArSjoVrCaHQctl6SMHmXpVDuVIGnMcFRali1cw0Z+h5uyEc aQnD4ZCaKE4tu33Kapp+xme/8zxxLMfC1WHZnQWXyUkW5nIx3sqDFj6UnOpPxnFAtb BpXvxcB2YG5eg== Date: Mon, 20 Nov 2023 10:07:32 +0000 From: Simon Horman To: Pedro Tammela Cc: Kunwu Chan , jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, kunwu.chan@hotmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: sched: Fix restricted __be16 degrades to integer Message-ID: <20231120100732.GN186930@vergenet.net> References: <20231117101815.1867175-1-chentao@kylinos.cn> 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 20 Nov 2023 02:08:02 -0800 (PST) On Fri, Nov 17, 2023 at 09:06:11AM -0300, Pedro Tammela wrote: > On 17/11/2023 07:18, Kunwu Chan wrote: > > net/sched/cls_api.c:2010:25: warning: restricted __be16 degrades to integer > > net/sched/cls_api.c:2695:50: warning: restricted __be16 degrades to integer > > > > Signed-off-by: Kunwu Chan > > --- > > net/sched/cls_api.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c > > index f73f39f61f66..4c47490eb0c1 100644 > > --- a/net/sched/cls_api.c > > +++ b/net/sched/cls_api.c > > @@ -2007,7 +2007,7 @@ static int tcf_fill_node(struct net *net, struct sk_buff *skb, > > tcm->tcm_ifindex = TCM_IFINDEX_MAGIC_BLOCK; > > tcm->tcm_block_index = block->index; > > } > > - tcm->tcm_info = TC_H_MAKE(tp->prio, tp->protocol); > > + tcm->tcm_info = TC_H_MAKE(tp->prio, be16_to_cpu(tp->protocol)); > > if (nla_put_string(skb, TCA_KIND, tp->ops->kind)) > > goto nla_put_failure; > > if (nla_put_u32(skb, TCA_CHAIN, tp->chain->index)) > > @@ -2692,7 +2692,7 @@ static bool tcf_chain_dump(struct tcf_chain *chain, struct Qdisc *q, u32 parent, > > TC_H_MAJ(tcm->tcm_info) != tp->prio) > > continue; > > if (TC_H_MIN(tcm->tcm_info) && > > - TC_H_MIN(tcm->tcm_info) != tp->protocol) > > + TC_H_MIN(tcm->tcm_info) != be16_to_cpu(tp->protocol)) > > continue; > > if (*p_index > index_start) > > memset(&cb->args[1], 0, > > I don't believe there's something to fix here Hi, as there are two patches addressing similar problems let's discuss an appropriate approach (or not) in one place. I'd like to suggest here: Link: https://lore.kernel.org/netdev/20231120100417.GM186930@vergenet.net/