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 08AE8CD1292 for ; Thu, 4 Apr 2024 07:58:49 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ate/FqtLPoabmtnhvroX4h5y2jeEpOMwaUGUMkBWwok=; b=g+YZxDLKtn6Bb4 iMxBjCrBVE49MU8uCYXop8ZzkOPvVb6X5nYi1UVR+WD6d/7yhn5/DV26i+orimZzdPwHTl2M82WWT 3s/DojIFtKbn1fmwxVHQOb4JPqX78WE1IaX0WQ5tWb6bjAXqf5sFQwm8zWA8f1mzN1gHwsovw+6nO BDG7TJTwop0SqrZUSQdgwhZkDYbvL3RrEsYy325qKCn697vt6LTkfXxomK3hArK3lr4pyyo7vCAQ8 e3nxyadS7c2lbCw0oxOjy+ZsdLnxgPoujilDvm7lJgy4mAIYNvTpn36StLaTqh/JNbizJ+qH4dYmq PjearJMhhoTMLNT94KsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsHzV-00000001jgD-0MyZ; Thu, 04 Apr 2024 07:58:33 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsHzP-00000001jZX-3KkM for linux-arm-kernel@lists.infradead.org; Thu, 04 Apr 2024 07:58:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1712217507; x=1743753507; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ex8Jbm7t4k8Fpjz2pzUFpRuPZgP2C2fuI1ETdKnGMcE=; b=p61nAfhp6gmOb2ng0mx3IzSWqzCZ/H0ckCe/b51pxbEFo2lwBRhLZflU OTZGFBEDHJPjgwCQceQBTEvD9kqXSaXfjFeOHgCPXdzmnBK9Mqf+Oi8vv QDsOr9v0nZQoDacNr2KkHW6hk1ZVbviPAEtlIO4p/gvxpfxIMeVgDymT1 ydRXmksd/hq1FAoO8LTYbae/wT5Qgnnp65lc2ciTPQWA94GloX3DjZqRW YXULpxMh4emBOpNlsU0aCG0yLPEl/aCA2m1okc7tOmx5nxx4nPlmPs7qA dMdm1fr0j2XrbPm3HUfdL5smcQGYkmT0Ke8zKw5a+7Fk1BcQJAxYccrTA g==; X-CSE-ConnectionGUID: xzFzvc8LTJeba3q7BJRCVg== X-CSE-MsgGUID: exhvIqGvSK6Mb92ZHSxnIg== X-IronPort-AV: E=Sophos;i="6.07,178,1708412400"; d="scan'208";a="21363534" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 Apr 2024 00:58:22 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 4 Apr 2024 00:58:16 -0700 Received: from DEN-DL-M70577 (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 4 Apr 2024 00:58:14 -0700 Date: Thu, 4 Apr 2024 07:58:13 +0000 From: Daniel Machon To: Horatiu Vultur CC: Lars Povlsen , Steen Hegelund , , "David S. Miller" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni , , , Subject: Re: [PATCH net-next 2/3] net: sparx5: add support for tc flower mirred action. Message-ID: <20240404075813.nploesovm4katckb@DEN-DL-M70577> References: <20240403-mirror-redirect-actions-v1-0-c8e7c8132c89@microchip.com> <20240403-mirror-redirect-actions-v1-2-c8e7c8132c89@microchip.com> <20240404064627.6m25m2mi7zbpqbyo@DEN-DL-M31836.microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240404064627.6m25m2mi7zbpqbyo@DEN-DL-M31836.microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240404_005828_291924_82E8C773 X-CRM114-Status: GOOD ( 17.82 ) 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 > The 04/03/2024 20:41, Daniel Machon wrote: > > Hi Daniel, > > ... > > > +static int sparx5_tc_action_mirred(struct vcap_admin *admin, > > + struct vcap_rule *vrule, > > + struct flow_cls_offload *fco, > > + struct flow_action_entry *act) > > +{ > > + struct vcap_u72_action ports = {0}; > > Maybe this is just a preferences, but usually we use memset instead of {0}; Yes, I think this falls under preference. I'd like to keep this one as is. > > > + int err; > > + > > + if (admin->vtype != VCAP_TYPE_IS0 && admin->vtype != VCAP_TYPE_IS2) { > > + NL_SET_ERR_MSG_MOD(fco->common.extack, > > + "Mirror action not supported in this VCAP"); > > + return -EOPNOTSUPP; > > + } > > + > > + err = vcap_rule_add_action_u32(vrule, VCAP_AF_MASK_MODE, > > + SPX5_PMM_OR_DSTMASK); > > + if (err) > > + return err; > > + > > + sparx5_tc_flower_set_port_mask(&ports, act->dev); > > + > > + err = vcap_rule_add_action_u72(vrule, VCAP_AF_PORT_MASK, &ports); > > + if (err) > > + return err; > > You can just return directly the return value from vcap_rule_add_action_u72 > Something like: > > return vcap_rule_add_action_u72(...) > Yes, seems like a reasonable change :-) I need to respin anyway, since NIPA is complaining about something I didn't catch in my local run. Will incorporate changes in v2 - thanks. > > + > > + return 0; > > +} > > -- > > 2.34.1 > > > > -- > /Horatiu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel