* [Intel-wired-lan] [PATCH] igb: handle vlan types with checker enabled
@ 2021-08-13 7:45 zhaoxiao
2021-08-13 16:32 ` Nguyen, Anthony L
0 siblings, 1 reply; 3+ messages in thread
From: zhaoxiao @ 2021-08-13 7:45 UTC (permalink / raw)
To: intel-wired-lan
The sparse build (C=2) finds some issues with how the driver
dealt with the (very difficult) hardware that in some generations
uses little-endian, and in others uses big endian, for the VLAN
field. The code as written picks __le16 as a type and for some
hardware revisions we override it to __be16 as done in this
patch.
drivers/net/ethernet/intel/igb/igb_main.c:2676:48: warning: incorrect type in assignment (different base types)
drivers/net/ethernet/intel/igb/igb_main.c:2676:48: expected restricted __be16 [usertype] vlan_tci
drivers/net/ethernet/intel/igb/igb_main.c:2676:48: got unsigned short [usertype] vlan_priority:3
Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 6221dafc76b9..a42eb9b1fa3e 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2673,7 +2673,8 @@ static int igb_parse_cls_flower(struct igb_adapter *adapter,
}
input->filter.match_flags |= IGB_FILTER_FLAG_VLAN_TCI;
- input->filter.vlan_tci = key->vlan_priority;
+ input->filter.vlan_tci =
+ (__force __be16)key->vlan_priority;
}
}
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Intel-wired-lan] [PATCH] igb: handle vlan types with checker enabled
2021-08-13 7:45 [Intel-wired-lan] [PATCH] igb: handle vlan types with checker enabled zhaoxiao
@ 2021-08-13 16:32 ` Nguyen, Anthony L
0 siblings, 0 replies; 3+ messages in thread
From: Nguyen, Anthony L @ 2021-08-13 16:32 UTC (permalink / raw)
To: jeffrey.t.kirsher, davem, zhaoxiao; +Cc: netdev, intel-wired-lan, linux-kernel
On Fri, 2021-08-13 at 15:45 +0800, zhaoxiao wrote:
> The sparse build (C=2) finds some issues with how the driver
> dealt with the (very difficult) hardware that in some generations
> uses little-endian, and in others uses big endian, for the VLAN
> field. The code as written picks __le16 as a type and for some
> hardware revisions we override it to __be16 as done in this
> patch.
>
> drivers/net/ethernet/intel/igb/igb_main.c:2676:48: warning: incorrect
> type in assignment (different base types)
> drivers/net/ethernet/intel/igb/igb_main.c:2676:48: expected
> restricted __be16 [usertype] vlan_tci
> drivers/net/ethernet/intel/igb/igb_main.c:2676:48: got unsigned
> short [usertype] vlan_priority:3
Thanks for the patch, but this has already been resolved [1].
Thanks,
Tony
[1]
https://patchwork.kernel.org/project/netdevbpf/patch/20210526172346.351
5587-6-anthony.l.nguyen@intel.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Intel-wired-lan] [PATCH] igb: handle vlan types with checker enabled
@ 2021-08-13 16:32 ` Nguyen, Anthony L
0 siblings, 0 replies; 3+ messages in thread
From: Nguyen, Anthony L @ 2021-08-13 16:32 UTC (permalink / raw)
To: intel-wired-lan
On Fri, 2021-08-13 at 15:45 +0800, zhaoxiao wrote:
> The sparse build (C=2) finds some issues with how the driver
> dealt with the (very difficult) hardware that in some generations
> uses little-endian, and in others uses big endian, for the VLAN
> field. The code as written picks __le16 as a type and for some
> hardware revisions we override it to __be16 as done in this
> patch.
>
> drivers/net/ethernet/intel/igb/igb_main.c:2676:48: warning: incorrect
> type in assignment (different base types)
> drivers/net/ethernet/intel/igb/igb_main.c:2676:48: expected
> restricted __be16 [usertype] vlan_tci
> drivers/net/ethernet/intel/igb/igb_main.c:2676:48: got unsigned
> short [usertype] vlan_priority:3
Thanks for the patch, but this has already been resolved [1].
Thanks,
Tony
[1]
https://patchwork.kernel.org/project/netdevbpf/patch/20210526172346.351
5587-6-anthony.l.nguyen at intel.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-13 16:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13 7:45 [Intel-wired-lan] [PATCH] igb: handle vlan types with checker enabled zhaoxiao
2021-08-13 16:32 ` Nguyen, Anthony L
2021-08-13 16:32 ` Nguyen, Anthony L
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.