netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] net: r8169: Disable multicast filter for RTL_GIGA_MAC_VER_46
@ 2023-10-27 21:30 Patrick Thompson
  2023-10-27 21:50 ` Patrick Thompson
  2023-10-28  8:38 ` Heiner Kallweit
  0 siblings, 2 replies; 7+ messages in thread
From: Patrick Thompson @ 2023-10-27 21:30 UTC (permalink / raw)
  To: netdev
  Cc: Patrick Thompson, Chun-Hao Lin, David S. Miller, Eric Dumazet,
	Heiner Kallweit, Jakub Kicinski, Paolo Abeni, linux-kernel,
	nic_swsd

MAC_VER_46 ethernet adapters fail to detect eapol packets unless
allmulti is enabled. Add exception for VER_46 in the same way VER_35
has an exception.

Fixes: 6e1d0b898818 ("r8169:add support for RTL8168H and RTL8107E")
Signed-off-by: Patrick Thompson <ptf@google.com>
---

Changes in v2:
- add Fixes tag
- add net annotation
- update description

 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 361b90007148b..a775090650e3a 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -2584,7 +2584,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.42.0.820.g83a721a137-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] net: r8169: Disable multicast filter for RTL_GIGA_MAC_VER_46
  2023-10-27 21:30 [PATCH v2] net: r8169: Disable multicast filter for RTL_GIGA_MAC_VER_46 Patrick Thompson
@ 2023-10-27 21:50 ` Patrick Thompson
  2023-10-28  8:06   ` Heiner Kallweit
  2023-10-28  8:38 ` Heiner Kallweit
  1 sibling, 1 reply; 7+ messages in thread
From: Patrick Thompson @ 2023-10-27 21:50 UTC (permalink / raw)
  To: netdev
  Cc: Chun-Hao Lin, David S. Miller, Eric Dumazet, Heiner Kallweit,
	Jakub Kicinski, Paolo Abeni, linux-kernel, nic_swsd,
	Jeffery Miller

Hello Heiner,

I haven't heard back from realtek about the possibility that this
affects other MAC_VERs. Do you think it's acceptable to merge this
patch for now and if/when we hear back from realtek I can adjust the
function again?

Thank you,
Patrick

On Fri, Oct 27, 2023 at 5:31 PM Patrick Thompson <ptf@google.com> wrote:
>
> MAC_VER_46 ethernet adapters fail to detect eapol packets unless
> allmulti is enabled. Add exception for VER_46 in the same way VER_35
> has an exception.
>
> Fixes: 6e1d0b898818 ("r8169:add support for RTL8168H and RTL8107E")
> Signed-off-by: Patrick Thompson <ptf@google.com>
> ---
>
> Changes in v2:
> - add Fixes tag
> - add net annotation
> - update description
>
>  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 361b90007148b..a775090650e3a 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -2584,7 +2584,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.42.0.820.g83a721a137-goog
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] net: r8169: Disable multicast filter for RTL_GIGA_MAC_VER_46
  2023-10-27 21:50 ` Patrick Thompson
@ 2023-10-28  8:06   ` Heiner Kallweit
  0 siblings, 0 replies; 7+ messages in thread
From: Heiner Kallweit @ 2023-10-28  8:06 UTC (permalink / raw)
  To: Patrick Thompson, netdev
  Cc: Chun-Hao Lin, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, linux-kernel, nic_swsd, Jeffery Miller

On 27.10.2023 23:50, Patrick Thompson wrote:
> Hello Heiner,
> 
> I haven't heard back from realtek about the possibility that this
> affects other MAC_VERs. Do you think it's acceptable to merge this
> patch for now and if/when we hear back from realtek I can adjust the
> function again?
> 
Fine with me. 
Would be nice if mc filtering could be switched on/off via ethtool,
because now we have to disable mc filtering for all the unaffected
users too.

> Thank you,
> Patrick
> 
Heiner

> On Fri, Oct 27, 2023 at 5:31 PM Patrick Thompson <ptf@google.com> wrote:
>>
>> MAC_VER_46 ethernet adapters fail to detect eapol packets unless
>> allmulti is enabled. Add exception for VER_46 in the same way VER_35
>> has an exception.
>>
>> Fixes: 6e1d0b898818 ("r8169:add support for RTL8168H and RTL8107E")
>> Signed-off-by: Patrick Thompson <ptf@google.com>
>> ---
>>
>> Changes in v2:
>> - add Fixes tag
>> - add net annotation
>> - update description
>>
>>  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 361b90007148b..a775090650e3a 100644
>> --- a/drivers/net/ethernet/realtek/r8169_main.c
>> +++ b/drivers/net/ethernet/realtek/r8169_main.c
>> @@ -2584,7 +2584,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.42.0.820.g83a721a137-goog
>>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] net: r8169: Disable multicast filter for RTL_GIGA_MAC_VER_46
  2023-10-27 21:30 [PATCH v2] net: r8169: Disable multicast filter for RTL_GIGA_MAC_VER_46 Patrick Thompson
  2023-10-27 21:50 ` Patrick Thompson
@ 2023-10-28  8:38 ` Heiner Kallweit
  2023-10-30 16:52   ` Patrick Thompson
  1 sibling, 1 reply; 7+ messages in thread
From: Heiner Kallweit @ 2023-10-28  8:38 UTC (permalink / raw)
  To: Patrick Thompson, netdev
  Cc: Chun-Hao Lin, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, linux-kernel, nic_swsd

On 27.10.2023 23:30, Patrick Thompson wrote:
> MAC_VER_46 ethernet adapters fail to detect eapol packets unless
> allmulti is enabled. Add exception for VER_46 in the same way VER_35
> has an exception.
> 
MAC_VER_48 (RTL8107E) has the same MAC, just a different PHY.
So I would expect that the same quirk is needed for MAC_VER_48.

MAC_VER_xx is a little misleading, actually it should be NIC_VER_xx

> Fixes: 6e1d0b898818 ("r8169:add support for RTL8168H and RTL8107E")
> Signed-off-by: Patrick Thompson <ptf@google.com>
> ---
> 
> Changes in v2:
> - add Fixes tag
> - add net annotation
> - update description
> 
>  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 361b90007148b..a775090650e3a 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -2584,7 +2584,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;


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] net: r8169: Disable multicast filter for RTL_GIGA_MAC_VER_46
  2023-10-28  8:38 ` Heiner Kallweit
@ 2023-10-30 16:52   ` Patrick Thompson
  2023-10-30 19:38     ` Heiner Kallweit
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Thompson @ 2023-10-30 16:52 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: netdev, Chun-Hao Lin, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-kernel, nic_swsd

I wouldn't trust the mc filter, the eap packet being filtered is not a
multicast packet so I wonder what else could be erroneously filtered.
I do agree that it would be nice to be able to override it for testing
purposes.

Would you like me to add MAC_VER_48 to the patch? I would not be able
to test and confirm that it affects it in the same way I have for
VER_46.

It is unfortunate that the naming doesn't quite line up.

On Sat, Oct 28, 2023 at 4:38 AM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>
> On 27.10.2023 23:30, Patrick Thompson wrote:
> > MAC_VER_46 ethernet adapters fail to detect eapol packets unless
> > allmulti is enabled. Add exception for VER_46 in the same way VER_35
> > has an exception.
> >
> MAC_VER_48 (RTL8107E) has the same MAC, just a different PHY.
> So I would expect that the same quirk is needed for MAC_VER_48.
>
> MAC_VER_xx is a little misleading, actually it should be NIC_VER_xx
>
> > Fixes: 6e1d0b898818 ("r8169:add support for RTL8168H and RTL8107E")
> > Signed-off-by: Patrick Thompson <ptf@google.com>
> > ---
> >
> > Changes in v2:
> > - add Fixes tag
> > - add net annotation
> > - update description
> >
> >  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 361b90007148b..a775090650e3a 100644
> > --- a/drivers/net/ethernet/realtek/r8169_main.c
> > +++ b/drivers/net/ethernet/realtek/r8169_main.c
> > @@ -2584,7 +2584,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;
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] net: r8169: Disable multicast filter for RTL_GIGA_MAC_VER_46
  2023-10-30 16:52   ` Patrick Thompson
@ 2023-10-30 19:38     ` Heiner Kallweit
  2023-10-30 20:35       ` Patrick Thompson
  0 siblings, 1 reply; 7+ messages in thread
From: Heiner Kallweit @ 2023-10-30 19:38 UTC (permalink / raw)
  To: Patrick Thompson
  Cc: netdev, Chun-Hao Lin, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-kernel, nic_swsd

On 30.10.2023 17:52, Patrick Thompson wrote:
> I wouldn't trust the mc filter, the eap packet being filtered is not a
> multicast packet so I wonder what else could be erroneously filtered.
> I do agree that it would be nice to be able to override it for testing
> purposes.
> 

I'm not an EAP(OL) expert, just read that EAPOL can use unicast,
broadcast , and ethernet multicast (01:80:C2:00:00:03).
What's that target MAC and IP4 address of the packet being
filtered out in your case?

> Would you like me to add MAC_VER_48 to the patch? I would not be able
> to test and confirm that it affects it in the same way I have for
> VER_46.
> 
Yes, VER_48 should be included because it has the same MAC as VER_46.

> It is unfortunate that the naming doesn't quite line up.
> 
> On Sat, Oct 28, 2023 at 4:38 AM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>>
>> On 27.10.2023 23:30, Patrick Thompson wrote:
>>> MAC_VER_46 ethernet adapters fail to detect eapol packets unless
>>> allmulti is enabled. Add exception for VER_46 in the same way VER_35
>>> has an exception.
>>>
>> MAC_VER_48 (RTL8107E) has the same MAC, just a different PHY.
>> So I would expect that the same quirk is needed for MAC_VER_48.
>>
>> MAC_VER_xx is a little misleading, actually it should be NIC_VER_xx
>>
>>> Fixes: 6e1d0b898818 ("r8169:add support for RTL8168H and RTL8107E")
>>> Signed-off-by: Patrick Thompson <ptf@google.com>
>>> ---
>>>
>>> Changes in v2:
>>> - add Fixes tag
>>> - add net annotation
>>> - update description
>>>
>>>  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 361b90007148b..a775090650e3a 100644
>>> --- a/drivers/net/ethernet/realtek/r8169_main.c
>>> +++ b/drivers/net/ethernet/realtek/r8169_main.c
>>> @@ -2584,7 +2584,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;
>>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] net: r8169: Disable multicast filter for RTL_GIGA_MAC_VER_46
  2023-10-30 19:38     ` Heiner Kallweit
@ 2023-10-30 20:35       ` Patrick Thompson
  0 siblings, 0 replies; 7+ messages in thread
From: Patrick Thompson @ 2023-10-30 20:35 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: netdev, Chun-Hao Lin, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-kernel, nic_swsd

The packet being filtered out by the multicast filter has a unicast
destination address matching the device, the frame only contains the
eapol protocol and does not have an IPv4 address associated with it.

I will send out a v3 patch with VER_48 included.

Sorry, I sent a non-plaintext email previously so I am resending it.

On Mon, Oct 30, 2023 at 3:38 PM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>
> On 30.10.2023 17:52, Patrick Thompson wrote:
> > I wouldn't trust the mc filter, the eap packet being filtered is not a
> > multicast packet so I wonder what else could be erroneously filtered.
> > I do agree that it would be nice to be able to override it for testing
> > purposes.
> >
>
> I'm not an EAP(OL) expert, just read that EAPOL can use unicast,
> broadcast , and ethernet multicast (01:80:C2:00:00:03).
> What's that target MAC and IP4 address of the packet being
> filtered out in your case?
>
> > Would you like me to add MAC_VER_48 to the patch? I would not be able
> > to test and confirm that it affects it in the same way I have for
> > VER_46.
> >
> Yes, VER_48 should be included because it has the same MAC as VER_46.
>
> > It is unfortunate that the naming doesn't quite line up.
> >
> > On Sat, Oct 28, 2023 at 4:38 AM Heiner Kallweit <hkallweit1@gmail.com> wrote:
> >>
> >> On 27.10.2023 23:30, Patrick Thompson wrote:
> >>> MAC_VER_46 ethernet adapters fail to detect eapol packets unless
> >>> allmulti is enabled. Add exception for VER_46 in the same way VER_35
> >>> has an exception.
> >>>
> >> MAC_VER_48 (RTL8107E) has the same MAC, just a different PHY.
> >> So I would expect that the same quirk is needed for MAC_VER_48.
> >>
> >> MAC_VER_xx is a little misleading, actually it should be NIC_VER_xx
> >>
> >>> Fixes: 6e1d0b898818 ("r8169:add support for RTL8168H and RTL8107E")
> >>> Signed-off-by: Patrick Thompson <ptf@google.com>
> >>> ---
> >>>
> >>> Changes in v2:
> >>> - add Fixes tag
> >>> - add net annotation
> >>> - update description
> >>>
> >>>  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 361b90007148b..a775090650e3a 100644
> >>> --- a/drivers/net/ethernet/realtek/r8169_main.c
> >>> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> >>> @@ -2584,7 +2584,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;
> >>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-10-30 20:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-27 21:30 [PATCH v2] net: r8169: Disable multicast filter for RTL_GIGA_MAC_VER_46 Patrick Thompson
2023-10-27 21:50 ` Patrick Thompson
2023-10-28  8:06   ` Heiner Kallweit
2023-10-28  8:38 ` Heiner Kallweit
2023-10-30 16:52   ` Patrick Thompson
2023-10-30 19:38     ` Heiner Kallweit
2023-10-30 20:35       ` Patrick Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).