Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3989583pxf; Tue, 16 Mar 2021 03:00:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweC1eyUmJusvsmPUJ9C0wndulac8maZF3SmxPtl4vxt+VIye5jYhBMJwxUj8S4Qxfk2x2z X-Received: by 2002:aa7:da0f:: with SMTP id r15mr34799580eds.111.1615888840084; Tue, 16 Mar 2021 03:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615888840; cv=none; d=google.com; s=arc-20160816; b=M+WtafBr3Ix4w2pcwxlyu2NjxMxZvq39bR+Jd8p2ffQU7sg9GVV4WFuBzJfrmYpsSu ZPdQZxg76S0V90hwUItjbaKDkV97t5e9GKOp5nDzOpoq2SHazpZ5d5XLsJyeHSRKC1ZX 6iupanx/MQBE+SCyIyiI64dFGrDqmoryVDRb3KMOXSU4qf6q2IHZj6uaAvxUpAgbpY1e j7C/vIqMmzXpoA7C75gVrcq/5myLgcwNHuzGQfxJMcKuc2eo6u6wxGEcIZwyMDQZO5K5 qTYRjEHCAsAY2pxLE4hc3R+C1UlGFEBJ1tjRbqsYyEaP6NmEYqcbR4wyNraNfPAw2IBa 3PLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=aBKshvZZroJOJEqPn8DNQ+OxB+2otzs6b0zWYi9jYNU=; b=w0Gx3END5Owj8o0Ht++YX0gDUfAKuMHRcz1ZCvkPVzuNxbsIgNR2LobKNbK9VCueoG iWN2bMn4LMQvo/3dpss5kCEKU8wBTMyur6E3s2d9h1Jc/6KrEt/0vwfQsL59rIi0vg/Z baJNMNAEJOrUNwt9YEGNVhSM7T18kBCh6emyucvtC9UQNbpdEkPz3Lwvbwr9utad1enP kdRnZzACgywmBYOR5IFJc784KpomIVBoZNYVvaZbx/Q+gafxG50rcyE2pQf8K6U49WmD J7ti5tyVFeZGd0jSA3F0b4Qy/G3JdRMCZ0Cn4u37on6o1v322EMllsDdyV4fFh+Gsgjf weqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=W+zo528R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l10si3531531edc.380.2021.03.16.03.00.17; Tue, 16 Mar 2021 03:00:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=W+zo528R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236193AbhCPJ1s (ORCPT + 99 others); Tue, 16 Mar 2021 05:27:48 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:54544 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232787AbhCPJ1Y (ORCPT ); Tue, 16 Mar 2021 05:27:24 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12G9QNKM020140; Tue, 16 Mar 2021 02:27:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=aBKshvZZroJOJEqPn8DNQ+OxB+2otzs6b0zWYi9jYNU=; b=W+zo528R6VVODVQxIhFhk55Sgoa056kiYssn1G4dRmZK3a9U7z4QeuAJvf6XNXdwWz79 A8nirKUtioka+GHBXMeaVS+ZTXpwuNsPOzRi1LAjs2tFdX3NXFoekrecUvub+geLC/fv Uu6Ef1v8mCKJWOoFm2FzakFeIA92UV6yNj6LJtjZ0syOdcN9f9GLdFewNiXuFUydvLUV OgsyZx/yyRb/jzrbHSLfigDG5KRuayQ7FXJl3m+eKP32kbpl5zeitA+EaWYFwVLFrLxA LA/a45hR7lbSYJfDF10L1HP9WhDpw0p/JYUJUxb7dJR6sbeSssSGnLEzmAzdKcXidP/e ww== Received: from dc6wp-exch01.marvell.com ([4.21.29.232]) by mx0a-0016f401.pphosted.com with ESMTP id 378umtfrb4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 16 Mar 2021 02:27:23 -0700 Received: from DC6WP-EXCH01.marvell.com (10.76.176.21) by DC6WP-EXCH01.marvell.com (10.76.176.21) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 Mar 2021 05:27:21 -0400 Received: from maili.marvell.com (10.76.176.51) by DC6WP-EXCH01.marvell.com (10.76.176.21) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 16 Mar 2021 05:27:21 -0400 Received: from hyd1soter2.marvell.com (unknown [10.29.37.45]) by maili.marvell.com (Postfix) with ESMTP id 42A5A3F7041; Tue, 16 Mar 2021 02:27:18 -0700 (PDT) From: Hariprasad Kelam To: , CC: , , , , , , , Subject: [net PATCH 1/9] octeontx2-pf: Do not modify number of rules Date: Tue, 16 Mar 2021 14:57:05 +0530 Message-ID: <1615886833-71688-2-git-send-email-hkelam@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615886833-71688-1-git-send-email-hkelam@marvell.com> References: <1615886833-71688-1-git-send-email-hkelam@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-16_03:2021-03-15,2021-03-16 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Subbaraya Sundeep In the ETHTOOL_GRXCLSRLALL ioctl ethtool uses below structure to read number of rules from the driver. struct ethtool_rxnfc { __u32 cmd; __u32 flow_type; __u64 data; struct ethtool_rx_flow_spec fs; union { __u32 rule_cnt; __u32 rss_context; }; __u32 rule_locs[0]; }; Driver must not modify rule_cnt member. But currently driver modifies it by modifying rss_context. Hence fix it by using a local variable. Fixes: 81a43620("octeontx2-pf: Add RSS multi group support") Signed-off-by: Subbaraya Sundeep Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c index 0dbbf38..dc17784 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c @@ -257,17 +257,19 @@ int otx2_get_flow(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc, int otx2_get_all_flows(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc, u32 *rule_locs) { + u32 rule_cnt = nfc->rule_cnt; u32 location = 0; int idx = 0; int err = 0; nfc->data = pfvf->flow_cfg->ntuple_max_flows; - while ((!err || err == -ENOENT) && idx < nfc->rule_cnt) { + while ((!err || err == -ENOENT) && idx < rule_cnt) { err = otx2_get_flow(pfvf, nfc, location); if (!err) rule_locs[idx++] = location; location++; } + nfc->rule_cnt = rule_cnt; return err; } -- 2.7.4