Blame SOURCES/0001-netlink-Fix-the-condition-for-displaying-actual-chan.patch

c96cf6
From 89b49b2a88392c510c6a171940701ba4cf580116 Mon Sep 17 00:00:00 2001
c96cf6
From: Maxim Mikityanskiy <maximmi@mellanox.com>
c96cf6
Date: Fri, 14 Aug 2020 16:17:44 +0300
c96cf6
Subject: [PATCH 01/17] netlink: Fix the condition for displaying actual
c96cf6
 changes
c96cf6
c96cf6
This comment in the code:
c96cf6
c96cf6
    /* result is not exactly as requested, show differences */
c96cf6
c96cf6
implies that the "Actual changes" output should be displayed only if the
c96cf6
result is not as requested, which matches the legacy ethtool behavior.
c96cf6
However, in fact, ethtool-netlink displays "actual changes" even when
c96cf6
the changes are expected (e.g., one bit was requested, and it was
c96cf6
changed as requested).
c96cf6
c96cf6
This commit fixes the condition above to make the behavior match the
c96cf6
description in the comment and the behavior of the legacy ethtool. The
c96cf6
new condition excludes the req_mask bits from active_mask to avoid
c96cf6
reacting on bit changes that we asked for. The new condition now
c96cf6
matches the ifs in the loop above that print "[requested on/off]" and
c96cf6
"[not requested]".
c96cf6
c96cf6
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
c96cf6
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
c96cf6
(cherry picked from commit 83d2b635de121a16a27663cc4e3045243e56063b)
c96cf6
---
c96cf6
 netlink/features.c | 2 +-
c96cf6
 1 file changed, 1 insertion(+), 1 deletion(-)
c96cf6
c96cf6
diff --git a/netlink/features.c b/netlink/features.c
c96cf6
index 8b5b8588ca23..133529da2b9f 100644
c96cf6
--- a/netlink/features.c
c96cf6
+++ b/netlink/features.c
c96cf6
@@ -413,7 +413,7 @@ static void show_feature_changes(struct nl_context *nlctx,
c96cf6
 
c96cf6
 	diff = false;
c96cf6
 	for (i = 0; i < words; i++)
c96cf6
-		if (wanted_mask[i] || active_mask[i])
c96cf6
+		if (wanted_mask[i] || (active_mask[i] & ~sfctx->req_mask[i]))
c96cf6
 			diff = true;
c96cf6
 	if (!diff)
c96cf6
 		return;
c96cf6
-- 
c96cf6
2.26.2
c96cf6