Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp114120lqe; Thu, 4 Apr 2024 00:59:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYPQ8cBIIalx0b7Mvn4VxPRQHfFB6zmWFhxz4CtaI0K8EtMOtu1VRy5fCi+Voj8+EeQ0F+0rvM4BPuCobt5P6Up7DFPcKlovRHUJWDlg== X-Google-Smtp-Source: AGHT+IGBSWsdDOmPPV6Jvk8d/Ohkgc4QMZ8APxt/DsIlhsvtrfSex3cjT8A4NNgcIkRsosR0Ub0l X-Received: by 2002:a17:902:7446:b0:1e2:a7fb:3c81 with SMTP id e6-20020a170902744600b001e2a7fb3c81mr1433454plt.7.1712217575941; Thu, 04 Apr 2024 00:59:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712217575; cv=pass; d=google.com; s=arc-20160816; b=Wg598suJ2au0+Sdossj2S+/yDdc00PkO+eeCs4kmrNOQ4Dw6fr7NNthfFsHjg2fm9J BNUPtODTEXp8Uuob5lC08nvKeVoChOTDR8pCIkoenAJlhtBBVxW9SaY+5xKbglOzrDUn xTF3exxxx3cQbc298fgqX8Sj/k6OSN1CQyFwZ/5I1K/HSuT7itsVd6FaHdWW1oCtmnTo qxfnbjMWe+T5EW6qNzCWqNNlxqnWhZgo4PAcKMg4bzv1o94K1lTyoCKcurmAFnpKfvuI wmwKXbuEcEkezMsndAGzya7mcTfD3m0VkGaBLaZRikMLwn1Z2HLAXnz2HMMctD3cBs/f pYUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=81WbKCACwpjeQJQ3mOGKx6rQmVZ2f63MgQemtVq7tlA=; fh=gyxOtw4cbOJfYgbVbjhpF8DxlYlrv6j1qSz8ml2KtRI=; b=N1rCrwQo3hT7zGV4OOoT6MhZlkOAWVgoSk0fPhMS4bpxEHXJsCnAsq6sPKU15OeDpz YtXH4gvRWNt8nED1af2dS1cxYZ2kYk6tQqDHBc5U3hLbNMEmhqBPfb+asLQdrcuoNXE9 1jukvTI5R1Z115KKe+HRyQuVloc1DZA/GTTBqhG0DehH0RdQftiBLubaObk63zOvS8W2 jsL+Yxdu5zOo328L4GFWUWwVo6e2lpSK6zeNUrroFevyDmAEIb5G+B/ps8cgmZk+WZNN 1xKDbn30ngfth97kOlp8+vP2NppQfDmc5BzVZFikS2yHifZ4rHuFSfPIoafyc6MD3m0K ONKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ywRjfuXD; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-131066-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131066-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b17-20020a170902e95100b001dde10a6b04si15084496pll.187.2024.04.04.00.59.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 00:59:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131066-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ywRjfuXD; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-131066-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131066-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 68A76282D11 for ; Thu, 4 Apr 2024 07:59:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8C5D5FBBA; Thu, 4 Apr 2024 07:58:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="ywRjfuXD" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 796595CDE4; Thu, 4 Apr 2024 07:58:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712217506; cv=none; b=KWIyhy7QprBHfnOz5/wrFGX0tSlOqVCqunSsZ6oForJkXChL1ONYAMyJP3nny0a8XcMqScfQ6/dqMNvI73OD9fmONxv8RE7/dgyaoFO+UGm3sWYbsnbl8kziENPPYaX+gzd3L3XlMjzuRnvR95bAWmHajSwaMRo/4cm4greRkj8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712217506; c=relaxed/simple; bh=ex8Jbm7t4k8Fpjz2pzUFpRuPZgP2C2fuI1ETdKnGMcE=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ces7ftp5liMECRD/nFA9uAjw81joOtLVwijWooEBRws5aKKC+9Ylr2OPdM3qkUh7zhdibkZWKzvqh74bANABLiiDXSYM3wk0CiZUdGUlTsqzb4GhMjONjegWzIgdIefGE9Gp8EbxPbkhRiB6pcwq/cA8DZ+RKe7veH+Qs/bA9os= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=ywRjfuXD; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1712217503; x=1743753503; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ex8Jbm7t4k8Fpjz2pzUFpRuPZgP2C2fuI1ETdKnGMcE=; b=ywRjfuXDoSVG2YHRnqeUC2Cuhy2bfuxJlj6EsiF8adCKEdWml/BoiNEy 3sH1IMLPtKR/nP/XMipUrd8HpfPgVljqpSo01p4Xk1IF9mkJRqQCGtDv4 dPm8qX+L/04EBghkUQk21H2F8MZ8h+qCWeROp9fIYvI8PpYNiiP97u1B1 Bp9QrmofJsIUwT9dune8pDgMcgdZmYS7z5PLNyC2qOtR8xb1o7XMlQL8f BhndKu0V+jOq8D15JyJck8uebay5Ag5yW1M+Gr6dSDZdgOxbN5o27XR4p STZE2uKDBhYaAx/9uRx4tq+YyeqgjHsPXm8Yaw43+6v5pfiOQydYhaBnV w==; 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240404064627.6m25m2mi7zbpqbyo@DEN-DL-M31836.microchip.com> > 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