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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 284C2C4CEC9 for ; Wed, 18 Sep 2019 06:31:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E8C39218AE for ; Wed, 18 Sep 2019 06:31:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568788309; bh=lNSzM/zmTZ5Sd3pxrsWBE+lpg0SWXyFFpchBtkjunjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xYsZsZSwYpGMFSCmw/8iM5ZNlAQdfuEfQifk23ezmvw1DATRTJCKT3cN78k5URxzt Ekt2dnjkDgpJka+ipB5S3QWjuj2z/3a7MTG86myebY/KFwyCJCfVfavBWkAHM4S4Ae MAWNI6hc67y+28InPDt6FqsnXpWN1jAE4L3NLC8o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727459AbfIRGXM (ORCPT ); Wed, 18 Sep 2019 02:23:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:43114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726656AbfIRGW7 (ORCPT ); Wed, 18 Sep 2019 02:22:59 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 47D8721920; Wed, 18 Sep 2019 06:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568787778; bh=lNSzM/zmTZ5Sd3pxrsWBE+lpg0SWXyFFpchBtkjunjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k+2hmPxxMASyfDDwyIwCefStHA3oLxQssX4Vx/SKu1N958oPryOmxCz1n4TsGXvIV dBzDl/ThdPZWX814lhGY+p03OCVGNHcvqnj9lmBpJ/BXTAPuti0qzG3bLzFqNCRTK3 g099QHpv56BXQmB8yZc6WrnS4P89gwyl0yY4QwRA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Chulski , Shaul Ben-Mayor , Russell King , "David S. Miller" Subject: [PATCH 4.19 08/50] net: phylink: Fix flow control resolution Date: Wed, 18 Sep 2019 08:18:51 +0200 Message-Id: <20190918061223.817031776@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190918061223.116178343@linuxfoundation.org> References: <20190918061223.116178343@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Stefan Chulski [ Upstream commit 63b2ed4e10b2e6c913e1d8cdd728e7fba4115a3d ] Regarding to IEEE 802.3-2015 standard section 2 28B.3 Priority resolution - Table 28-3 - Pause resolution In case of Local device Pause=1 AsymDir=0, Link partner Pause=1 AsymDir=1, Local device resolution should be enable PAUSE transmit, disable PAUSE receive. And in case of Local device Pause=1 AsymDir=1, Link partner Pause=1 AsymDir=0, Local device resolution should be enable PAUSE receive, disable PAUSE transmit. Fixes: 9525ae83959b ("phylink: add phylink infrastructure") Signed-off-by: Stefan Chulski Reported-by: Shaul Ben-Mayor Acked-by: Russell King Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/phylink.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -380,8 +380,8 @@ static void phylink_get_fixed_state(stru * Local device Link partner * Pause AsymDir Pause AsymDir Result * 1 X 1 X TX+RX - * 0 1 1 1 RX - * 1 1 0 1 TX + * 0 1 1 1 TX + * 1 1 0 1 RX */ static void phylink_resolve_flow(struct phylink *pl, struct phylink_link_state *state) @@ -402,7 +402,7 @@ static void phylink_resolve_flow(struct new_pause = MLO_PAUSE_TX | MLO_PAUSE_RX; else if (pause & MLO_PAUSE_ASYM) new_pause = state->pause & MLO_PAUSE_SYM ? - MLO_PAUSE_RX : MLO_PAUSE_TX; + MLO_PAUSE_TX : MLO_PAUSE_RX; } else { new_pause = pl->link_config.pause & MLO_PAUSE_TXRX_MASK; }