From patchwork Wed Jun 2 01:37:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 453967 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 766BFC47080 for ; Wed, 2 Jun 2021 01:37:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F5A7613CD for ; Wed, 2 Jun 2021 01:37:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbhFBBj0 (ORCPT ); Tue, 1 Jun 2021 21:39:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:39544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbhFBBjR (ORCPT ); Tue, 1 Jun 2021 21:39:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BE3E5613D0; Wed, 2 Jun 2021 01:37:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622597855; bh=M/ZysRBLIPv4r8ElzEgdCcwOQrmKbRoWvBHNauuJh3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SGSjSQhgWn5TqNaaGGYVhmAISmKxkJokI2MsqPjmkWvtpXVywFXOSJTjRITZDlz61 Ufc+xlpNtYxbEROuQ1KPSWpAqWIWwjed0ldv8OX2tHOOghMrU5K3VWy+yECNjooVN4 /vsS1ABhQ5aaHJ+B0VydrUdtetdK7/MNnmhiV7zc9iLgvjQaDV8l5gM9UXLMmTj6+Z 1a5/UFIYl1l4hBWOj2wMAAMUp6aP9VZEVwvcoeYfRGAfvJs9F4KYxrsONikDni/ycv alldJsiV/AoYi7GeEEPIPB5ENz3imoP7P6NQNS2pju/Acz/NP2uBqONk9cGIuNLRJF +Va9VDV0IZ/IQ== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Tariq Toukan , Aya Levin , Moshe Shemesh , Saeed Mahameed Subject: [net 7/8] net/mlx5e: Fix conflict with HW TS and CQE compression Date: Tue, 1 Jun 2021 18:37:22 -0700 Message-Id: <20210602013723.1142650-8-saeed@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210602013723.1142650-1-saeed@kernel.org> References: <20210602013723.1142650-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Aya Levin When a driver's profile doesn't support a dedicated PTP-RQ, configuration of CQE compression while HW TS is configured should fail. Fixes: 885b8cfb161e ("net/mlx5e: Update ethtool setting of CQE compression") Signed-off-by: Aya Levin Reviewed-by: Moshe Shemesh Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index c4724742eef1..d6513aef5cd4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -1894,6 +1894,13 @@ int mlx5e_modify_rx_cqe_compression_locked(struct mlx5e_priv *priv, bool new_val if (curr_val == new_val) return 0; + if (new_val && !priv->profile->rx_ptp_support && + priv->tstamp.rx_filter != HWTSTAMP_FILTER_NONE) { + netdev_err(priv->netdev, + "Profile doesn't support enabling of CQE compression while hardware time-stamping is enabled.\n"); + return -EINVAL; + } + new_params = priv->channels.params; MLX5E_SET_PFLAG(&new_params, MLX5E_PFLAG_RX_CQE_COMPRESS, new_val); if (priv->tstamp.rx_filter != HWTSTAMP_FILTER_NONE)