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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 A12A3C25B50 for ; Tue, 24 Jan 2023 12:15:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 405D44186A; Tue, 24 Jan 2023 12:15:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 405D44186A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1674562540; bh=99dD3Nx9yrryoaWeCXYP6SZhuQtTeeUDwzucf4p2CtY=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=oTCqYeyu+qPLZB3Ml0ZTgWZk6DSCDgdYetQC1ic2Sf+QYtYRaFEncDXY/pDXV7ofo bY9M5IAjs+/BcF5JwomkyBhG2V6WJkQmEXRM84J4iEKoxsISIBiuw1Y0HyM6EZ81k+ Xi7JuYYr5rfmad5exlvVeyHVh++PCTyiGAIQeWOrDped+8FP8Ubc0tnzSpBLgcVopW bZ6Bq85lPiRakpyioEWFNSGrxXTotJ4YDBMDHRnZga0h6cyVFROUOWPBcDT18P8Lv/ 9PtEB7yoDVlQhGNFocMDWZbYVN3V38MTavSnKz6qH2sxcy9RJLUMSz7lSwK3cRjYLz ZBGhNTok6KNuQ== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JD_WB5aWUOzw; Tue, 24 Jan 2023 12:15:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id D26D8418A3; Tue, 24 Jan 2023 12:15:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D26D8418A3 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 6CDE71BF2C5 for ; Tue, 24 Jan 2023 12:15:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 461C960F4E for ; Tue, 24 Jan 2023 12:15:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 461C960F4E X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3fakMTSIg6Rq for ; Tue, 24 Jan 2023 12:15:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 77BE960C16 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by smtp3.osuosl.org (Postfix) with ESMTPS id 77BE960C16 for ; Tue, 24 Jan 2023 12:15:35 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id E424ACE1AE3; Tue, 24 Jan 2023 12:15:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64974C4339B; Tue, 24 Jan 2023 12:15:28 +0000 (UTC) From: Leon Romanovsky To: "David S . Miller" , Jakub Kicinski , Steffen Klassert Date: Tue, 24 Jan 2023 13:55:01 +0200 Message-Id: <87ca361391c6cc2dcd10e8013836b33ecbe00b57.1674560845.git.leon@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674562529; bh=tcMiwRJ5LZ16nTM2ZXcPFHoJ273vNAD9QNT1hf7PpJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tf12cMDAn6grw+KP2FN5/pkaCe5oJ9gQpLI/1zz0nX55VmccBAwX4L5zVweS8WpV6 K4GDGpaT+TZXYYNF2a7eEdBnrOt0wadpL/2qPPVqR/YybQT23z9UUnr4eaeUk0YLsF GuBd3w++hhC4LACjnXRJGCez7fIoYe24dsZv1euBJiZCcdUKrCsGanBgGLEYcGJSYJ v5nhaxxUNHdYaB7wFCN+P3hK9nyYXt2lON4ylE9ueuJzuPceNJP1cg+j5oezpWXbBV abrGxSvFLqti+S+s9Tj9yhhKlTDjtEeC4FlRfq7PJkvOMqCGU91aBES3aFWhV9BnZX cSkkGYlhLjgEQ== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=tf12cMDA Subject: [Intel-wired-lan] [PATCH net-next v1 05/10] netdevsim: Fill IPsec state validation failure reason X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Veaceslav Falico , Herbert Xu , Jonathan Corbet , Jay Vosburgh , oss-drivers@corigine.com, linux-doc@vger.kernel.org, Raju Rangoju , Jesse Brandeburg , Eric Dumazet , netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Ayush Sawal , Simon Horman , Tony Nguyen , Paolo Abeni , Leon Romanovsky , Saeed Mahameed , Andy Gospodarek Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" From: Leon Romanovsky Rely on extack to return failure reason. Signed-off-by: Leon Romanovsky --- drivers/net/netdevsim/ipsec.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/netdevsim/ipsec.c b/drivers/net/netdevsim/ipsec.c index 84a02d69abad..f0d58092e7e9 100644 --- a/drivers/net/netdevsim/ipsec.c +++ b/drivers/net/netdevsim/ipsec.c @@ -140,25 +140,24 @@ static int nsim_ipsec_add_sa(struct xfrm_state *xs, ipsec = &ns->ipsec; if (xs->id.proto != IPPROTO_ESP && xs->id.proto != IPPROTO_AH) { - netdev_err(dev, "Unsupported protocol 0x%04x for ipsec offload\n", - xs->id.proto); + NL_SET_ERR_MSG_MOD(extack, "Unsupported protocol for ipsec offload"); return -EINVAL; } if (xs->calg) { - netdev_err(dev, "Compression offload not supported\n"); + NL_SET_ERR_MSG_MOD(extack, "Compression offload not supported"); return -EINVAL; } if (xs->xso.type != XFRM_DEV_OFFLOAD_CRYPTO) { - netdev_err(dev, "Unsupported ipsec offload type\n"); + NL_SET_ERR_MSG_MOD(extack, "Unsupported ipsec offload type"); return -EINVAL; } /* find the first unused index */ ret = nsim_ipsec_find_empty_idx(ipsec); if (ret < 0) { - netdev_err(dev, "No space for SA in Rx table!\n"); + NL_SET_ERR_MSG_MOD(extack, "No space for SA in Rx table!"); return ret; } sa_idx = (u16)ret; @@ -173,7 +172,7 @@ static int nsim_ipsec_add_sa(struct xfrm_state *xs, /* get the key and salt */ ret = nsim_ipsec_parse_proto_keys(xs, sa.key, &sa.salt); if (ret) { - netdev_err(dev, "Failed to get key data for SA table\n"); + NL_SET_ERR_MSG_MOD(extack, "Failed to get key data for SA table"); return ret; } -- 2.39.1 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan