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

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