From patchwork Fri Feb 25 10:18:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 12760042 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 7C92BC433EF for ; Fri, 25 Feb 2022 10:21:41 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yDA0F+vHot5OcEvf2H+VVhshLukFPHk6qGqLsc/wXdM=; b=2g6/gHBTu9OnZN Kr7rdW7DvanurFyDa5Ft4H21adRwFmwf4DB2aCm9qSp3t+mjlC5XXeJeVCBIEzJpOv5s9ve/Mhhvd wiVJUF9s5FP2bccJqAFwR06oL38UVL3s2DvTl5zxJ4ejZPyHuVtlw0eB/Qenlp+7hMJ6Urr/NqNyj BLG9/UC/X/VmvTMya95YBTvFsVZBwonuERCBKvTIMhe1SpI9eYjuzV/UKFH2lR16nLx4+anmxh2wP tsGQCesAdvFghD9qIFZrpCvRoHEHF7bA9mJELUXGCfSk1liViKK3aBcYd8eDMs+LyXh1jCGUcbXj5 tl5LwBTtTC3egadU7v/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNXi8-004KUN-JJ; Fri, 25 Feb 2022 10:20:28 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNXgA-004JZI-SL; Fri, 25 Feb 2022 10:18:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ukTEVmN3B7Wvv/QbA8NN7LNVV3vx54CmkD3mb6AtZXE=; b=J7YrQhbjgIjxKnqzkEr/XgPKe0 qGGvk7m6TRiZIEeE9YkWKWcJI0TqELi3hsmo3A4N4H9bYZpMPLX80xkr5uinziQq5DcuuX4v1Il2W ocapRqqK1zYmWrPzZhBoGDRdTrblmYrOByqTjDGFApR0Wsz30Q3OTra7UqUz0zwcUGX0=; Received: from p200300daa7204f00f847964d075b2b3d.dip0.t-ipconnect.de ([2003:da:a720:4f00:f847:964d:75b:2b3d] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1nNXg2-0007J1-IA; Fri, 25 Feb 2022 11:18:18 +0100 From: Felix Fietkau To: netdev@vger.kernel.org, John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , Matthias Brugger Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/11] net: ethernet: mtk_eth_soc: support TC_SETUP_BLOCK for PPE offload Date: Fri, 25 Feb 2022 11:18:06 +0100 Message-Id: <20220225101811.72103-8-nbd@nbd.name> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220225101811.72103-1-nbd@nbd.name> References: <20220225101811.72103-1-nbd@nbd.name> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220225_021827_147181_4A68D610 X-CRM114-Status: UNSURE ( 9.31 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This allows offload entries to be created from user space Signed-off-by: Felix Fietkau --- drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c index 0113cddcebf4..da3bc93676f8 100644 --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c @@ -563,10 +563,13 @@ mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f) int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type, void *type_data) { - if (type == TC_SETUP_FT) + switch (type) { + case TC_SETUP_BLOCK: + case TC_SETUP_FT: return mtk_eth_setup_tc_block(dev, type_data); - - return -EOPNOTSUPP; + default: + return -EOPNOTSUPP; + } } int mtk_eth_offload_init(struct mtk_eth *eth)