Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp278068imu; Fri, 7 Dec 2018 00:31:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/UHt7YWpcoL5R9FR9EyvfkiDTvwyZIHp1g5FeseY1AJ3I2efBlEGi+NPCIkw/n88gMV1eKF X-Received: by 2002:a63:d655:: with SMTP id d21mr1159618pgj.280.1544171515244; Fri, 07 Dec 2018 00:31:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544171515; cv=none; d=google.com; s=arc-20160816; b=vyGCAaGGlxKjoF9Z4MzQenvNsdwCg8WwU3DyPD5j50ZlBn/XoJtc8TnyMNDra7b6Nz lEVReeocMpmJVo4PfWRDuQAF6J3ZbcW/RCYdQ5KlRtzAvpksF6t5xbZ4chN/XFfK2JxU 04/W71IKePqL27Mu7W5/+g0792k6HwLD2WQmOvGn3zYx+qCRaVlnjql4cxbELf5HN8TV UCfZ5EAwj0RF8Fw++6F1vrEVz3hNDUkKbNxvyYdeodJ/H1OzyZ0uLGxRBLiOVUi8wZkj X4d7bB69sMnHav8BSfGGWRuZxH6eFdvEdKqfg+Snm65dI6K12zmrdP7qaltA8CUWsEdK +yPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=h0iwBJAI3blijsYGp3lEIcvTsTsYT9KN9COxBytQTOM=; b=Ymyzz0r1Nis2imupLyo5swIMX+/TNLy+tgla1GcEUWNNGp4kgj9j4vzEHz2wJMP1tS sXjSJ+Xi45o0FuYK7WtlAawgP2n474skebshVug2onE96P/foL4ATr5O0AKpgQ6bXyUG Cw0Clks/bIlL5Pbm2whRqACCpJEJFAygG/SpH77MvJsNDsf748Z1IIaKh0yGJ+odVThj 3JG0WBQdZ5Rg+IFBE6/Hm7RaKHql53S7pYk6ec6y4B8nd4ipctOWmWY+2apQozXXrFH8 2Pb1SYbcuTrvlJit9F09ESCFZuDkDyACWgi9I6kZ+qNe/p1NrMakURpUobTDoozutSS2 2KUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uCZltnFR; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j22si2105123pgj.244.2018.12.07.00.31.39; Fri, 07 Dec 2018 00:31:55 -0800 (PST) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=uCZltnFR; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726058AbeLGIbB (ORCPT + 99 others); Fri, 7 Dec 2018 03:31:01 -0500 Received: from mail-pf1-f202.google.com ([209.85.210.202]:44175 "EHLO mail-pf1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbeLGIbA (ORCPT ); Fri, 7 Dec 2018 03:31:00 -0500 Received: by mail-pf1-f202.google.com with SMTP id b17so2705944pfc.11 for ; Fri, 07 Dec 2018 00:30:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=h0iwBJAI3blijsYGp3lEIcvTsTsYT9KN9COxBytQTOM=; b=uCZltnFR7ax58zqG9scJ9N8E4r+dnuVYScOA347gjSPuL2UwS5lSXYU5kZNbE8SRRc VPeRo3+CQ7rjqAYQPU35WC86flUef44CRiMYhVR6XCnvklRJkFoIHz1FSI15fkqRX7pM QDKgwfJWcCJf/DygsHzjFnDRu3B28z07It0IpYIMXlSvKmGtylULsCuJ2Ny2A8+TjpL+ 5ADrCuhYW2zntZBy/Bey+X53Pn+f7Ix0tctwORs7Oq2qk87w8s+NbOp+2yKyIqyAKWoH PIFAm/rV7FdasptsQHU+6aAU37zGWz/CUwvsthgxJehkwZrldOXU6i4lTviQD6nGTZPB NgUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=h0iwBJAI3blijsYGp3lEIcvTsTsYT9KN9COxBytQTOM=; b=AIFcqnIZ0vYwzLa91b8XbUSIhHx0KooPqj6+25k0ZYAy44besDcfqAuItg6Pa2bmR8 K/E5UQFqudG8VfFIvQtiWC/IGeXi9UkgLyEFyBJDddZ0xNy67uD+r+BBJae9BePykGkk O2hROvwXDpEXl3wyy9f6vgnlRj1/BzPELwIP1695KFpXge0vK7Cq27a5PnSMlEZPN975 ld5b7GzCz//mXbEXtz0/TWSnYQbU0TnW7mlX3tXuL6bkf7envACz/7LWZtXUDvzFF409 89sJbSxkDoGGu/m970TAEOjKP8gsaw+nQiEjf8wCROptI7wt/STrOkb9Xip8tNogBdf+ xvBg== X-Gm-Message-State: AA+aEWZp/BFSyStfkccDdAVTzv4mAqakAckKDy1Q8APZq899w5H0irXc c8m8tFZQLve6kEAy3SV5E3ca4tO8Bg== X-Received: by 2002:a62:61c7:: with SMTP id v190mr446590pfb.53.1544171459515; Fri, 07 Dec 2018 00:30:59 -0800 (PST) Date: Fri, 7 Dec 2018 00:30:26 -0800 Message-Id: <20181207083026.173789-1-tarick@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.20.0.rc2.403.gdbc3b29805-goog Subject: [PATCH] net/mlx4_core: Correctly set PFC param if global pause is turned off. From: Tarick Bedeir To: Eran Ben Elisha , Tariq Toukan , "David S. Miller" Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Tarick Bedeir Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rx_ppp and tx_ppp can be set between 0 and 255, so don't clamp to 1. Fixes: 6e8814ceb7e8 ("net/mlx4_en: Fix mixed PFC and Global pause user control requests") Signed-off-by: Tarick Bedeir --- drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c index f11b45001cad..d290f0787dfb 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c @@ -1084,8 +1084,8 @@ static int mlx4_en_set_pauseparam(struct net_device *dev, tx_pause = !!(pause->tx_pause); rx_pause = !!(pause->rx_pause); - rx_ppp = priv->prof->rx_ppp && !(tx_pause || rx_pause); - tx_ppp = priv->prof->tx_ppp && !(tx_pause || rx_pause); + rx_ppp = (tx_pause || rx_pause) ? 0 : priv->prof->rx_ppp; + tx_ppp = (tx_pause || rx_pause) ? 0 : priv->prof->tx_ppp; err = mlx4_SET_PORT_general(mdev->dev, priv->port, priv->rx_skb_size + ETH_FCS_LEN, -- 2.20.0.rc2.403.gdbc3b29805-goog