From patchwork Wed Dec 13 14:08:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13491080 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="O5o0ZPpE" Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32555113 for ; Wed, 13 Dec 2023 06:08:23 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3363aa1b7d2so576754f8f.0 for ; Wed, 13 Dec 2023 06:08:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702476501; x=1703081301; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=yGQHYGvUGPNJmb4hVIhsOVrOl28DMQquary28poyEhI=; b=O5o0ZPpE38r9DtTMRiad58fmRZtMLom8DhHIsAEnJoq+zymQikqvINxg2E8KqZBx8Z XrRKLgwuh19odsRiWadRYQY0jrPX1wKHAN63h1HWcWdzv9QaOW0MCGeQLNm9YeY4NRNm U18smnMI3TvSyZ2myQILJH0b7YGSyy7kA7iNvGFR2zD38PbpLHmg+wi5tKIrPcoK+VJH 7JhlGc4a3QWf0TvSUJwFt3hstbCOnarCC+27eSgojbqAtqiUWRz/NQYXLPw4H2M5kOg9 O+ceZrQZHgtHA7jsgNpHzg/wZ+pcXMjjw2yJF/lLAyAOSI8+2uYGknHvDef2go/b5CLr khRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702476501; x=1703081301; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yGQHYGvUGPNJmb4hVIhsOVrOl28DMQquary28poyEhI=; b=beBxT0qViW2t1UpIDxVzVSHwrFDBXUUgxISwfN5ylofX2oGYBaimq+NgFPWb1zu6V6 gcpT2Aoz6rpuVL8tF5+a3DANquuERc4dGHs9J7XTr78IqdfzQ/Tt8ddClXViayjxiI7y NqUot0sRORe/XBnMHJy/Nu/owNxlZWX/7tCeoqi7aj+Hv6ESBU19fuKud4pNVOlF/PRh iDjh8jIsbZj0ixvlyCkHnifrr4NfeiRJuhDTI1dWW+ZTKHtaIta8XFHueEHhiVx0Mn/q mUc/kXaHvUSGc+Q7c/3rr2VRiVWq5Lcnfz4g8iDcg89wfntyT5Z4Ii7phAgwoYBcILkP AZhw== X-Gm-Message-State: AOJu0Yxs2Z+K0DwGkS+/GrLr0D+t5U8pZYKiztxfR7Szs8UtSp6rLhcC EUOP5jOEA5Vqz7bYVdcOHQjJ1Q== X-Google-Smtp-Source: AGHT+IEpPZzYdPLXcduF4nA5EE0q3P+XBry3Mlf1s1dZQZdQPkNvjIpr6Jz9Er27c37Xasi27rYwmw== X-Received: by 2002:adf:ecc2:0:b0:333:2fd2:3c0d with SMTP id s2-20020adfecc2000000b003332fd23c0dmr3268204wro.198.1702476501663; Wed, 13 Dec 2023 06:08:21 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id h11-20020adffd4b000000b003333298eb4bsm13575958wrs.61.2023.12.13.06.08.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 06:08:21 -0800 (PST) Date: Wed, 13 Dec 2023 17:08:17 +0300 From: Dan Carpenter To: Paul Blakey Cc: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Oz Sholmo , Roi Dayan , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH net 1/2] net/mlx5e: Fix error code in mlx5e_tc_action_miss_mapping_get() Message-ID: <133f4081-6f34-4e3b-b4b5-bacd76961376@moroto.mountain> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Patchwork-Delegate: kuba@kernel.org Preserve the error code if esw_add_restore_rule() fails. Don't return success. Fixes: 6702782845a5 ("net/mlx5e: TC, Set CT miss to the specific ct action instance") Signed-off-by: Dan Carpenter --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 5775699e1d3e..30932c9c9a8f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -5736,8 +5736,10 @@ int mlx5e_tc_action_miss_mapping_get(struct mlx5e_priv *priv, struct mlx5_flow_a esw = priv->mdev->priv.eswitch; attr->act_id_restore_rule = esw_add_restore_rule(esw, *act_miss_mapping); - if (IS_ERR(attr->act_id_restore_rule)) + if (IS_ERR(attr->act_id_restore_rule)) { + err = PTR_ERR(attr->act_id_restore_rule); goto err_rule; + } return 0; From patchwork Wed Dec 13 14:08:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13491081 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="raDR3LMQ" Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98A4310C for ; Wed, 13 Dec 2023 06:09:02 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3363e9240b4so341266f8f.0 for ; Wed, 13 Dec 2023 06:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702476541; x=1703081341; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=aKQmsgK550fGD+FPkX8U9qIfMTPKfTZB/dYSgLKLhHI=; b=raDR3LMQD2Yc+pWuvi6DVStJgdBYhKRHCQ0uii1O7MQSKC8Pm5qjpupa0X1KOIHl2B dT1mIqsvJJ3CKmX7J59jjDSV6W7xIPmX2RoM7J6cOJ8Prs1jh+R3tNwAX1P3GI3O74tL phAKfYogQbwiZ/UmxP3DRj+90EOnpgGlHjDfX70KFQWXtBiVUVnGZBzZHYjeGSL978NZ AtiTI3HTN1S3PKz1yvUHkEwWeT2yc7H+qzgkq1ndk2r37KxY7WGt+BgOWl9NKfM2mF9M xFy+d98N5vMuZ8ZgL3lLDFVbJQTs3nQ8U7VbaIvIsgS3AXR/1g5xlYkpoNaOwNOE5YME hSqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702476541; x=1703081341; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aKQmsgK550fGD+FPkX8U9qIfMTPKfTZB/dYSgLKLhHI=; b=KAOqxlxB2dnRlKyAk80JgCUdGscJFKOIqgiyuZ/AjsbzX7U47mx5d/J049pIro2eLP 9nzLem6o3+wQ26SV26ZvITDtMGoAY1vUj+9jKW0DtBGl4SjYYPdJi6bWHZnkJjw9+TG5 xkPFtCwY4P4Bch5oPcp3MQxoeb8lrXZpYiY8DRYtISx9kayYkDnZCOgOV3foNoYDwu4k 5S/2V+1KQceO2gU3pwaxqmbqFrf5JgG2cEEidXvFnSbFuCqAg7NnaXrwvpoVmssGi/aA p8pGp/1VU9C4cwSs+cc4U5vcRsiuCex7NYImA6wID7jR1Dencde1B72E9qoBq1ZpxFI1 3Bzw== X-Gm-Message-State: AOJu0Ywk6ihUMhYjeGvMd271ziXY4g2vyFaCErp11h1kLLPYum8VsT4H uycx2tHQIS8fiViHPdqsquPsGw== X-Google-Smtp-Source: AGHT+IHjUazdmDWYtmZHjBl/MNYaHkCncmuiI4Qik4o/6nTaZ1Cz/zKroUpSSvwn0aRFyAT+imvrQg== X-Received: by 2002:a5d:6d4a:0:b0:336:1d85:a87 with SMTP id k10-20020a5d6d4a000000b003361d850a87mr2669412wri.12.1702476541132; Wed, 13 Dec 2023 06:09:01 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id b18-20020adfe652000000b003333f5f5fd7sm13472171wrn.31.2023.12.13.06.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 06:09:00 -0800 (PST) Date: Wed, 13 Dec 2023 17:08:57 +0300 From: Dan Carpenter To: Chris Mi Cc: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Moshe Shemesh , Tariq Toukan , Shay Drory , Jianbo Liu , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH net 2/2] net/mlx5e: Fix error codes in alloc_branch_attr() Message-ID: <3504e359-aed9-421b-b2f1-e0f7b4769132@moroto.mountain> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <133f4081-6f34-4e3b-b4b5-bacd76961376@moroto.mountain> X-Mailer: git-send-email haha only kidding X-Patchwork-Delegate: kuba@kernel.org Set the error code if set_branch_dest_ft() fails. Fixes: ccbe33003b10 ("net/mlx5e: TC, Don't offload post action rule if not supported") Signed-off-by: Dan Carpenter --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 85cdba226eac..5775699e1d3e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -3778,7 +3778,8 @@ alloc_branch_attr(struct mlx5e_tc_flow *flow, break; case FLOW_ACTION_ACCEPT: case FLOW_ACTION_PIPE: - if (set_branch_dest_ft(flow->priv, attr)) + err = set_branch_dest_ft(flow->priv, attr); + if (err) goto out_err; break; case FLOW_ACTION_JUMP: @@ -3788,7 +3789,8 @@ alloc_branch_attr(struct mlx5e_tc_flow *flow, goto out_err; } *jump_count = cond->extval; - if (set_branch_dest_ft(flow->priv, attr)) + err = set_branch_dest_ft(flow->priv, attr); + if (err) goto out_err; break; default: