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 smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 05AABC4167D for ; Wed, 8 Nov 2023 15:10:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 86FF9404AF; Wed, 8 Nov 2023 15:10:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 86FF9404AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1699456238; bh=+gI2dZux3PxtZiXAwacKZi/1Z0hBdbz60D4bzf/9RbM=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=yAGPYkeWmxILBqeDqNTjjV7EuuyYUb1eLx0osyn8lAfycAnXlGN2yRvtW1Yv2BcP7 Gut65hZHu3eoiz35UbT9V8JgFD0FwsA3wXWHZBFHI82qM4Sc3exPJGFQKiBHI9JBGv E0gK1Jxa24JmRpBPMOxu2odDuzfOhlpVitH1+MeZGbbvUvkG09z9GH+nw96l7CDxiN HttTBOAwJ50ALDcV9HPEAExnnbtBEMC+Ko29s3/UaSmVYnrt2guWT2OpB+sKv507ot gpjDj5BMQNVacBqRG0pbnqW7o419qRMOj/XdaBKYEQHgLgn/XxxCK+LIl9g/cXMlly 0aI573xO5+gpA== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gDvEpVzawYbZ; Wed, 8 Nov 2023 15:10:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 1FC7340B2F; Wed, 8 Nov 2023 15:10:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 1FC7340B2F Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 26C631BF473 for ; Wed, 8 Nov 2023 15:10:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id F278C415FA for ; Wed, 8 Nov 2023 15:10:35 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org F278C415FA 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 R4XRaGeTbMuW for ; Wed, 8 Nov 2023 15:10:35 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 1E769415F0 for ; Wed, 8 Nov 2023 15:10:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 1E769415F0 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-549-ClR-7Y0IOCeBTJnzrMdaPg-1; Wed, 08 Nov 2023 10:10:26 -0500 X-MC-Unique: ClR-7Y0IOCeBTJnzrMdaPg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AC718892281; Wed, 8 Nov 2023 15:10:21 +0000 (UTC) Received: from p1.luc.cera.cz (unknown [10.45.225.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id C48DDC12911; Wed, 8 Nov 2023 15:10:19 +0000 (UTC) From: Ivan Vecera To: intel-wired-lan@lists.osuosl.org Date: Wed, 8 Nov 2023 16:10:18 +0100 Message-ID: <20231108151018.72670-1-ivecera@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699456233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=PDc6Ow/bSblo3GhUEPhnVNdc0LfbXdgWx7MoQyklJ7Q=; b=c6i+IAqZYAVdJv8JsaPFTiodQ6FJ8rSVqcWt/qWci4wabfmV4MRPU0v0lqc9dxgcsthAFN C3+4tQjBhMjJBvDeV7hIJi8VRhmSq4fV4CO1FvrIfbnY/4HUuJzmA470GRa3trLkuvfSeC mfWuYO9Kna/ejzxheWMAYeeu3krXkjk= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=c6i+IAqZ Subject: [Intel-wired-lan] [PATCH iwl-net] i40e: Fix max frame size check 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: Wojciech Drewek , "open list:NETWORKING DRIVERS" , Jesse Brandeburg , open list , Eric Dumazet , Tony Nguyen , Jeff Kirsher , Jacob Keller , Jakub Kicinski , Todd Fujinaka , Paolo Abeni , "David S. Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Commit 3a2c6ced90e1 ("i40e: Add a check to see if MFS is set") added a check for port's MFS (max frame size) value. The value is stored in PRTGL_SAH register for each physical port. According datasheet this register is defined as: PRTGL_SAH[PRT]: (0x001E2140 + 0x4*PRT, PRT=0...3) where PRT is physical port number. The existing check does not take port number into account and reads actually MFS value always for port 0 that is correct for PF 0 but not for other PFs. Update PRTGL_SAH register definition so it takes a port number as an argument and fix the check by passing the port number. Also fix the warning message that use for a port number a local variable 'i' that really does not contain such information. Fixes: 3a2c6ced90e1 ("i40e: Add a check to see if MFS is set") Cc: Todd Fujinaka Signed-off-by: Ivan Vecera --- drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++-- drivers/net/ethernet/intel/i40e/i40e_register.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 4f445f6835de..6a2907674583 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -16219,11 +16219,11 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* make sure the MFS hasn't been set lower than the default */ #define MAX_FRAME_SIZE_DEFAULT 0x2600 - val = (rd32(&pf->hw, I40E_PRTGL_SAH) & + val = (rd32(&pf->hw, I40E_PRTGL_SAH(pf->hw.port)) & I40E_PRTGL_SAH_MFS_MASK) >> I40E_PRTGL_SAH_MFS_SHIFT; if (val < MAX_FRAME_SIZE_DEFAULT) dev_warn(&pdev->dev, "MFS for port %x has been set below the default: %x\n", - i, val); + pf->hw.port, val); /* Add a filter to drop all Flow control frames from any VSI from being * transmitted. By doing so we stop a malicious VF from sending out diff --git a/drivers/net/ethernet/intel/i40e/i40e_register.h b/drivers/net/ethernet/intel/i40e/i40e_register.h index f408fcf23ce8..75edfe3d43f7 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_register.h +++ b/drivers/net/ethernet/intel/i40e/i40e_register.h @@ -498,7 +498,7 @@ #define I40E_VSILAN_QBASE_VSIQTABLE_ENA_SHIFT 11 #define I40E_VSILAN_QBASE_VSIQTABLE_ENA_MASK I40E_MASK(0x1, I40E_VSILAN_QBASE_VSIQTABLE_ENA_SHIFT) #define I40E_VSILAN_QTABLE(_i, _VSI) (0x00200000 + ((_i) * 2048 + (_VSI) * 4)) /* _i=0...7, _VSI=0...383 */ /* Reset: PFR */ -#define I40E_PRTGL_SAH 0x001E2140 /* Reset: GLOBR */ +#define I40E_PRTGL_SAH(_PRT) (0x001E2140 + ((_PRT) * 4)) /* _PRT=0...3 */ /* Reset: GLOBR */ #define I40E_PRTGL_SAH_FC_SAH_SHIFT 0 #define I40E_PRTGL_SAH_FC_SAH_MASK I40E_MASK(0xFFFF, I40E_PRTGL_SAH_FC_SAH_SHIFT) #define I40E_PRTGL_SAH_MFS_SHIFT 16 -- 2.41.0 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan