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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5445EECAAD8 for ; Tue, 13 Sep 2022 20:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0GYhzTzTzFWLBMhY0NJOY4b7XeP2u2i8TukEjdzZdBI=; b=YydmW6zh8s0dBI CDL5lEM1wY/S3Lmjjc1V1L7+1muFV+UUAuBgiT9pDJ2EtKQQjQnAuFevTVPFfD8yCqQJ3ZJtvbFRt viip9v/bf5dFNxRb6DViJ2twz4bThTXm6nc3OOSSK6uSLeBSKn4eK/wfA6BIwCx9hPbLbUrAZK1fN KsIlQZ9vOsZJRytd7ZIoUANYiIY968+l+b7WlQkzBbfM9PUO3RBXIP0sTWDES7i+hQCZaeKr6qdKx YA/cHxV+5K03tbxOiO8lK4iAoKE+tTLwEBOFgvKRu6kjf1pDMX/zNQGU3bUxt+GZ9gnnBug11ZG1F l70HnU7BrCxSF8uqX97g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYCp3-00GYpt-A5; Tue, 13 Sep 2022 20:47:57 +0000 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYCoz-00GYfH-Qp for linux-arm-kernel@lists.infradead.org; Tue, 13 Sep 2022 20:47:55 +0000 Received: by mail-qv1-xf36.google.com with SMTP id m9so10204454qvv.7 for ; Tue, 13 Sep 2022 13:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=sIW0jOj9f2zyE3XbbwArWS7yU2vU8DbR4RLobl61rlE=; b=W19uCO3pR1SMidtgHfI2O4k1qUJbea2ZLFaTiP0KGphrTeFlMLoWfLAqyba3T3gqeF dEFpxJsRqVtLXCtxqDzQAOGCVN0Yxq4ZqfxC/qRxDbdfDrlqUH1Bzl2ojo47NXaGoq4h oPGH9U3AupA0OVh9Ugk6917bb3ZPxCvjl2KRub1j+Gli78hK7lPmGJINicWKftGyVqsr Zk2rd/A2eL7/uqErExT8IoUOuj2yGO3M5HRHEGOtnkstq2NN5cHkAZ/lSd6R8ofmo9wH V9Vopl3ru4YRwy7gadCWVvNzNpIZJ/mqCBp03s5dEzKgccIJ1lcAz9BuW9po56qg4bz5 WxoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=sIW0jOj9f2zyE3XbbwArWS7yU2vU8DbR4RLobl61rlE=; b=yJA2D3c6HBnRzHfTkg7UeCrlgMYdRU0GostbGef5KbREuBYmCXUCj6vU5/msi1n/sV jS33CUddgwVSDlgKOwvoMJBN8pgH/BDsiIeg2lHUfzCoWEAhnd1CDdCQSKZJFksYQUVt Nk9Tc2vTMFFsXK2RA8IfPH+C52fG2nTmLINU3Ny9UAzHjMg+2ziYyTkBeTS6kobC4fBg 9du/Y6W7OI5xlxjZW3sA57TydwFvg+ixsiX7qDJZODJwKoJObRFcrE7Hxd7DhS2GvEXw VwTS7NfiLRYqLGwgXIcpzLNB7PnrX2FgcQV5/Kfhwyo/gLnh5ZvJSFteHdy/l+OwMHsF MZ3A== X-Gm-Message-State: ACgBeo2FGUWRm5UhzYU0mtFs23uzeXSNAT/ZURel8k48qBTls+1TTvwA aTqPPO1SHlkoZ6yb2sRnKdo58eoeseEQoga17BZTLw== X-Google-Smtp-Source: AA6agR6xLK8C4qJdigsd8yEHH+TKpLgN5MT9yfh5GJuDfSkVGSo1vafy06eImNkjtngmdW4n+PDEfxLUFOM32v1oeZA= X-Received: by 2002:ad4:5ce9:0:b0:49f:ee02:50c7 with SMTP id iv9-20020ad45ce9000000b0049fee0250c7mr28733575qvb.105.1663102069229; Tue, 13 Sep 2022 13:47:49 -0700 (PDT) MIME-Version: 1.0 References: <20220912214432.928989-1-nhuck@google.com> <20220913081548.gmngjwuagbt63j7h@wse-c0155> In-Reply-To: <20220913081548.gmngjwuagbt63j7h@wse-c0155> From: Nathan Huckleberry Date: Tue, 13 Sep 2022 13:46:00 -0700 Message-ID: Subject: Re: [PATCH] net: sparx5: Fix return type of sparx5_port_xmit_impl To: Casper Andersson Cc: Dan Carpenter , llvm@lists.linux.dev, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , UNGLinuxDriver@microchip.com, Nathan Chancellor , Nick Desaulniers , Tom Rix , Horatiu Vultur , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220913_134753_926343_5CFBCB32 X-CRM114-Status: GOOD ( 21.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hey Casper, On Tue, Sep 13, 2022 at 1:15 AM Casper Andersson wrote: > > Hi, > > On 2022-09-12 14:44, Nathan Huckleberry wrote: > > The ndo_start_xmit field in net_device_ops is expected to be of type > > netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). > > > > The mismatched return type breaks forward edge kCFI since the underlying > > function definition does not match the function hook definition. > > > > The return type of sparx5_port_xmit_impl should be changed from int to > > netdev_tx_t. > > I noticed that the functions that assign the return value inside > sparx5_port_xmit_impl also have return type int, which would ideally > also be changed. But a bigger issue might be that > sparx5_ptp_txtstamp_request and sparx5_inject (called inside > sparx5_port_xmit_impl) returns -EBUSY (-16), when they should return > NETDEV_TX_BUSY (16). If this is an issue then it also needs to be fixed. It's not clear to me what happens when returning an error vs NETDEV_TX_BUSY. The netdev_tx_t enum allows negative values, so returning an error might be valid. If anyone more familiar with this code has insight into why it's done like this, that'd be useful. The important bit here for me is changing the return type on the hooked function since the current code will cause panics. > > sparx5_fdma_xmit also has int return type, but always returns > NETDEV_TX_OK right now. > > Best Regards, > Casper > Thanks, Huck _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel