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 X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 18935C352A3 for ; Tue, 11 Feb 2020 15:18:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E4F2320870 for ; Tue, 11 Feb 2020 15:18:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="EeE2FHmq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730327AbgBKPST (ORCPT ); Tue, 11 Feb 2020 10:18:19 -0500 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:62417 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727786AbgBKPSS (ORCPT ); Tue, 11 Feb 2020 10:18:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1581434299; x=1612970299; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FGp+Rcc/qlSDGQ5PrluTCOhn6C/8zh7ZQK/FKMLno+E=; b=EeE2FHmqO56kTRCwQJZDbM/3PFerIUMqis5Fpoe7nmDIrNsFeQKYYGcV wchr1MZsHAAJg6VyzwyM218VESrn/NVVVTuNsianDDhwSLqL0dBS4mEi5 nNcY8OQviKyg6mdiFh+qpwMxpz8Q1hnC6rF2fhQbM7m9AaUhx5GInjKi4 A=; IronPort-SDR: 5EKKNsIXKL+4K6rtjlDcUZOwwRnB8qB32xILurpGFVXDXuKlX3HjW25ZBk9rgbXofPKkxwKGMR Sgx3dvSPS8RA== X-IronPort-AV: E=Sophos;i="5.70,428,1574121600"; d="scan'208";a="24354285" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1e-17c49630.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 11 Feb 2020 15:18:14 +0000 Received: from EX13MTAUWA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1e-17c49630.us-east-1.amazon.com (Postfix) with ESMTPS id C0CA4A2CDF; Tue, 11 Feb 2020 15:18:12 +0000 (UTC) Received: from EX13D10UWA004.ant.amazon.com (10.43.160.64) by EX13MTAUWA001.ant.amazon.com (10.43.160.118) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 11 Feb 2020 15:17:58 +0000 Received: from EX13MTAUWA001.ant.amazon.com (10.43.160.58) by EX13D10UWA004.ant.amazon.com (10.43.160.64) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 11 Feb 2020 15:17:57 +0000 Received: from dev-dsk-sameehj-1c-1edacdb5.eu-west-1.amazon.com (172.19.82.3) by mail-relay.amazon.com (10.43.160.118) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 11 Feb 2020 15:17:57 +0000 Received: by dev-dsk-sameehj-1c-1edacdb5.eu-west-1.amazon.com (Postfix, from userid 9775579) id AEE8381D3A; Tue, 11 Feb 2020 15:17:56 +0000 (UTC) From: To: , CC: Sameeh Jubran , , , , , , , , , , , , , Subject: [PATCH V2 net 06/12] net: ena: rss: fix failure to get indirection table Date: Tue, 11 Feb 2020 15:17:45 +0000 Message-ID: <20200211151751.29718-7-sameehj@amazon.com> X-Mailer: git-send-email 2.24.1.AMZN In-Reply-To: <20200211151751.29718-1-sameehj@amazon.com> References: <20200211151751.29718-1-sameehj@amazon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sameeh Jubran On old hardware, getting / setting the hash function is not supported while gettting / setting the indirection table is. This commit enables us to still show the indirection table on older hardwares by setting the hash function and key to NULL. Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Sameeh Jubran --- drivers/net/ethernet/amazon/ena/ena_ethtool.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/amazon/ena/ena_ethtool.c b/drivers/net/ethernet/amazon/ena/ena_ethtool.c index 8b56383b6..8be9df885 100644 --- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c +++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c @@ -648,7 +648,21 @@ static int ena_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, if (rc) return rc; + /* We call this function in order to check if the device + * supports getting/setting the hash function. + */ rc = ena_com_get_hash_function(adapter->ena_dev, &ena_func, key); + + if (rc) { + if (rc == -EOPNOTSUPP) { + key = NULL; + hfunc = NULL; + rc = 0; + } + + return rc; + } + if (rc) return rc; -- 2.24.1.AMZN