r8169: Disable multicast filter for RTL_GIGA_MAC_VER_46

Message ID 20230606140041.3244713-1-ptf@google.com
State New
Headers
Series r8169: Disable multicast filter for RTL_GIGA_MAC_VER_46 |

Commit Message

Patrick Thompson June 6, 2023, 2 p.m. UTC
  MAC_VER_46 ethernet adapters fail to detect IPv6 multicast packets
unless allmulti is enabled. Add exception for VER_46 in the same way
VER_35 has an exception.

Signed-off-by: Patrick Thompson <ptf@google.com>
---

 drivers/net/ethernet/realtek/r8169_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Patrick Thompson June 6, 2023, 2:15 p.m. UTC | #1
For added context I came across this issue on this realtek adapter:
10ec:8168:103c:8267. The device erroneously filters multicast packets
that I can see with other adapters using the same netdev settings.


On Tue, Jun 6, 2023 at 10:00 AM Patrick Thompson <ptf@google.com> wrote:
>
> MAC_VER_46 ethernet adapters fail to detect IPv6 multicast packets
> unless allmulti is enabled. Add exception for VER_46 in the same way
> VER_35 has an exception.
>
> Signed-off-by: Patrick Thompson <ptf@google.com>
> ---
>
>  drivers/net/ethernet/realtek/r8169_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
> index 4b19803a7dd01..96245e96ee507 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -2583,7 +2583,8 @@ static void rtl_set_rx_mode(struct net_device *dev)
>                 rx_mode |= AcceptAllPhys;
>         } else if (netdev_mc_count(dev) > MC_FILTER_LIMIT ||
>                    dev->flags & IFF_ALLMULTI ||
> -                  tp->mac_version == RTL_GIGA_MAC_VER_35) {
> +                  tp->mac_version == RTL_GIGA_MAC_VER_35 ||
> +                  tp->mac_version == RTL_GIGA_MAC_VER_46) {
>                 /* accept all multicasts */
>         } else if (netdev_mc_empty(dev)) {
>                 rx_mode &= ~AcceptMulticast;
> --
> 2.41.0.rc0.172.g3f132b7071-goog
>
  
Heiner Kallweit June 6, 2023, 3:11 p.m. UTC | #2
On 06.06.2023 16:15, Patrick Thompson wrote:
> For added context I came across this issue on this realtek adapter:
> 10ec:8168:103c:8267. The device erroneously filters multicast packets
> that I can see with other adapters using the same netdev settings.
> 
> 
> On Tue, Jun 6, 2023 at 10:00 AM Patrick Thompson <ptf@google.com> wrote:
>>
>> MAC_VER_46 ethernet adapters fail to detect IPv6 multicast packets
>> unless allmulti is enabled. Add exception for VER_46 in the same way
>> VER_35 has an exception.
>>
>> Signed-off-by: Patrick Thompson <ptf@google.com>
>> ---
>>
>>  drivers/net/ethernet/realtek/r8169_main.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
>> index 4b19803a7dd01..96245e96ee507 100644
>> --- a/drivers/net/ethernet/realtek/r8169_main.c
>> +++ b/drivers/net/ethernet/realtek/r8169_main.c
>> @@ -2583,7 +2583,8 @@ static void rtl_set_rx_mode(struct net_device *dev)
>>                 rx_mode |= AcceptAllPhys;
>>         } else if (netdev_mc_count(dev) > MC_FILTER_LIMIT ||
>>                    dev->flags & IFF_ALLMULTI ||
>> -                  tp->mac_version == RTL_GIGA_MAC_VER_35) {
>> +                  tp->mac_version == RTL_GIGA_MAC_VER_35 ||
>> +                  tp->mac_version == RTL_GIGA_MAC_VER_46) {
>>                 /* accept all multicasts */
>>         } else if (netdev_mc_empty(dev)) {
>>                 rx_mode &= ~AcceptMulticast;
>> --
>> 2.41.0.rc0.172.g3f132b7071-goog
>>

Thanks for the report and the patch. I just asked a contact in Realtek
whether more chip versions may be affected. Then the patch should be
extended accordingly. Let's wait few days for a response.

I think we should make this a fix. Add the following as Fixes tag
and annotate the patch as "net" (see netdev FAQ).

6e1d0b898818 ("r8169:add support for RTL8168H and RTL8107E")
  
Jakub Kicinski June 6, 2023, 9:29 p.m. UTC | #3
On Tue, 6 Jun 2023 17:11:27 +0200 Heiner Kallweit wrote:
> Thanks for the report and the patch. I just asked a contact in Realtek
> whether more chip versions may be affected. Then the patch should be
> extended accordingly. Let's wait few days for a response.
> 
> I think we should make this a fix. Add the following as Fixes tag
> and annotate the patch as "net" (see netdev FAQ).
> 
> 6e1d0b898818 ("r8169:add support for RTL8168H and RTL8107E")

Perhaps it's best if you repost with the Fixes tag included once
Realtek responded.
  

Patch

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 4b19803a7dd01..96245e96ee507 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -2583,7 +2583,8 @@  static void rtl_set_rx_mode(struct net_device *dev)
 		rx_mode |= AcceptAllPhys;
 	} else if (netdev_mc_count(dev) > MC_FILTER_LIMIT ||
 		   dev->flags & IFF_ALLMULTI ||
-		   tp->mac_version == RTL_GIGA_MAC_VER_35) {
+		   tp->mac_version == RTL_GIGA_MAC_VER_35 ||
+		   tp->mac_version == RTL_GIGA_MAC_VER_46) {
 		/* accept all multicasts */
 	} else if (netdev_mc_empty(dev)) {
 		rx_mode &= ~AcceptMulticast;