Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2497906imm; Mon, 24 Sep 2018 05:29:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ9h9gnU3Vn0eDvdg1GOK/XHXiaKtp5PVVItcdsneVne7cjakmdqoR3uQBRs4dsWhKs6rIw X-Received: by 2002:a62:cd3:: with SMTP id 80-v6mr10322568pfm.184.1537792192095; Mon, 24 Sep 2018 05:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792192; cv=none; d=google.com; s=arc-20160816; b=hlBulfFGKvoJWXxAbjb6AL6mgZs3sbNIvnGEt5WR65r9UYr5hnoI7hgiuBVezR1Cp6 4W8xKc8QGyyO3nGiTfrSoUwvj3Oq3HZptRmBgWWo0NW1uzwbveKB/pzwXUCEt2BDqla5 SeHaN/QT6BxpPwRUBhBbcNysGiIdRTH0aFxPbg+szRVV65rRfnI4qij09uEX2lR4oKSP JdkEzJ4/nTvWqet49bNauCEM9OZuV0WaT6F3yF2q83rQoSeLI/KO2/QgezYGe/YI94kM BL4vma9ejey2CfYlKdP5EinGC7cCfCBYOJbfQIEr7iXQESHktRn0nR2yOTDUPDmN+Nrx rQPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=95MLa+LeQdAUKwSmeEkQbNRkYEJ78Qqn84wkq1gXHN0=; b=V3Of6stibuhC3G/05qfMetGg9lN7MN+bpjdKe5ySTVkSzaj75TDscQBRiBZWVsEky5 B7mSunJVpoNXe7uE2engphLRWtd0urJcgNiLvh/dMFTaf30xgJeukftmVREIMMdbDBCC odqoVTf//orkD2RFUa9UfAk5ErjL6T/i8bgy4P8mhrH5v1i3+tmxz9+M9jBjs33U6ha5 eX1C1rPTpdoL9cPWcN/hhK9SreiiDZ/CWqRwECBD/26yvkFlmeDYGKSWOaBExN0OrGga Qf49dG1lDi12zXVoYhM/0ZVKX6EnxKH70Odcis6jw5j1eEcyRT/jbYVYidWAqQVNTOnv 3u/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5-v6si6077218pgn.314.2018.09.24.05.29.36; Mon, 24 Sep 2018 05:29:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733259AbeIXS3J (ORCPT + 99 others); Mon, 24 Sep 2018 14:29:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57232 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732305AbeIXS3I (ORCPT ); Mon, 24 Sep 2018 14:29:08 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B11E3108B; Mon, 24 Sep 2018 12:27:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tariq Toukan , Eran Ben Elisha , Saeed Mahameed Subject: [PATCH 4.18 015/235] net/mlx5: Use u16 for Work Queue buffer fragment size Date: Mon, 24 Sep 2018 13:50:01 +0200 Message-Id: <20180924113106.028019927@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tariq Toukan [ Upstream commit 8d71e818506718e8d7032ce824b5c74a17d4f7a5 ] Minimal stride size is 16. Hence, the number of strides in a fragment (of PAGE_SIZE) is <= PAGE_SIZE / 16 <= 4K. u16 is sufficient to represent this. Fixes: 388ca8be0037 ("IB/mlx5: Implement fragmented completion queue (CQ)") Signed-off-by: Tariq Toukan Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/wq.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/wq.h | 2 +- include/linux/mlx5/driver.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/wq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/wq.c @@ -39,9 +39,9 @@ u32 mlx5_wq_cyc_get_size(struct mlx5_wq_ return (u32)wq->fbc.sz_m1 + 1; } -u32 mlx5_wq_cyc_get_frag_size(struct mlx5_wq_cyc *wq) +u16 mlx5_wq_cyc_get_frag_size(struct mlx5_wq_cyc *wq) { - return (u32)wq->fbc.frag_sz_m1 + 1; + return wq->fbc.frag_sz_m1 + 1; } u32 mlx5_cqwq_get_size(struct mlx5_cqwq *wq) --- a/drivers/net/ethernet/mellanox/mlx5/core/wq.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/wq.h @@ -80,7 +80,7 @@ int mlx5_wq_cyc_create(struct mlx5_core_ void *wqc, struct mlx5_wq_cyc *wq, struct mlx5_wq_ctrl *wq_ctrl); u32 mlx5_wq_cyc_get_size(struct mlx5_wq_cyc *wq); -u32 mlx5_wq_cyc_get_frag_size(struct mlx5_wq_cyc *wq); +u16 mlx5_wq_cyc_get_frag_size(struct mlx5_wq_cyc *wq); int mlx5_wq_qp_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param, void *qpc, struct mlx5_wq_qp *wq, --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -357,7 +357,7 @@ struct mlx5_frag_buf { struct mlx5_frag_buf_ctrl { struct mlx5_frag_buf frag_buf; u32 sz_m1; - u32 frag_sz_m1; + u16 frag_sz_m1; u32 strides_offset; u8 log_sz; u8 log_stride;