From patchwork Tue Aug 6 13:42:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Abreu X-Patchwork-Id: 11078955 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15DA014DB for ; Tue, 6 Aug 2019 13:43:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04E75288F4 for ; Tue, 6 Aug 2019 13:43:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED258289A1; Tue, 6 Aug 2019 13:43:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 85F47288F4 for ; Tue, 6 Aug 2019 13:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=HyiED8ntDstGxyWqLeIA8eBEvyKuA6tRKOOy5mlP9zg=; b=PZAAFVXekiVY05Be+LVJ0Wdcld ZGS0pAO7zfQ7vYQAYnC/TZaSDyxNysNYSM+9HM4OyTaO7CzOY8jm8SSHQ6w6+rqsdkofK47fe8seP vzipvDpiEjQdBCYHzpAZ1fA6f9/7MR7h3kBV+aurGfqZ4Kn0Eqr/CR2B2bkHioMtqnbsENt3rTomD lNHTLvUTIPWGZp0Id8BLngurRxpcRolttjO/m02B9LiJbLIEWSPFpKYM5Hby3VWItYZHGUrdYgkfc FrCJ1EF94fEIPQ9LbWmoIWRafFdHl/Riqk+1eGxey3HkruzUpfkZHqUnqTmIse9fw5xPwYYvds41x jDqVcmIw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1huzkb-0008UT-V4; Tue, 06 Aug 2019 13:43:41 +0000 Received: from dc8-smtprelay2.synopsys.com ([198.182.47.102] helo=smtprelay-out1.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1huzjs-0007lk-MK for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2019 13:43:00 +0000 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 519B3C21C4; Tue, 6 Aug 2019 13:42:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1565098976; bh=Qxwoph4ddCKg0VtmbodiUMUPm3P937Jz58/B5VZy51c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=ULYr+UdhBO3+Uc9CTdHLRngBPuCG2n91HGFuxxyCI1sirT+Oaoq7JBCbF0pxzWCwe mIU3+JW1n/s/481MyV2usAz4xFGcmUao/SDBXrL/lm+4IAfw3g4WESSvVbLQPrHynv YXwvbRwsxVyBdTFde1j1l6sDgzJiycjROR0mpGcuEzoC9YaAda/wGFL+VpoCCGOTX/ mHvSjjbuUVBffj7XzZl+KM68bGaOm2YYUBnwhot2qU89aBEFpGj2UsyRY/LT2xZjrX PVlDpK9kHk6Hoxk3117s41s1MT/e/mYG72YKqYnqQHCOohCDsh8GKhf76vJ8rzDmDd 2vdNW0EpPZmXQ== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id 15EAAA006A; Tue, 6 Aug 2019 13:42:55 +0000 (UTC) From: Jose Abreu To: netdev@vger.kernel.org Subject: [PATCH net-next v2 05/10] net: stmmac: selftests: Add RSS test Date: Tue, 6 Aug 2019 15:42:46 +0200 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190806_064257_259187_8826D4C5 X-CRM114-Status: GOOD ( 11.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Joao Pinto , Alexandre Torgue , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , Giuseppe Cavallaro , "David S. Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add a test for RSS in the stmmac selftests. Signed-off-by: Jose Abreu --- Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Jose Abreu Cc: "David S. Miller" Cc: Maxime Coquelin Cc: netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- .../net/ethernet/stmicro/stmmac/stmmac_selftests.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c index a97b1ea76438..83b775a8cedc 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c @@ -700,6 +700,21 @@ static int stmmac_test_flowctrl(struct stmmac_priv *priv) return ret; } +static int stmmac_test_rss(struct stmmac_priv *priv) +{ + struct stmmac_packet_attrs attr = { }; + + if (!priv->dma_cap.rssen || !priv->rss.enable) + return -EOPNOTSUPP; + + attr.dst = priv->dev->dev_addr; + attr.exp_hash = true; + attr.sport = 0x321; + attr.dport = 0x123; + + return __stmmac_test_loopback(priv, &attr); +} + #define STMMAC_LOOPBACK_NONE 0 #define STMMAC_LOOPBACK_MAC 1 #define STMMAC_LOOPBACK_PHY 2 @@ -745,6 +760,10 @@ static const struct stmmac_test { .name = "Flow Control ", .lb = STMMAC_LOOPBACK_PHY, .fn = stmmac_test_flowctrl, + }, { + .name = "RSS ", + .lb = STMMAC_LOOPBACK_PHY, + .fn = stmmac_test_rss, }, };