Netdev Archive on lore.kernel.org
 help / color / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Charles DAYMAND <charles.daymand@wifirst.fr>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net] r8169: fix multicast tx issue with macvlan interface
Date: Wed, 8 Apr 2020 00:40:32 +0200
Message-ID: <fe30ab8d-2915-e049-ef30-760960f5efdc@gmail.com> (raw)
In-Reply-To: <d9c6ba82-4f3e-0f7e-e1f8-516da25e1fe4@gmail.com>

On 07.04.2020 08:22, Heiner Kallweit wrote:
> On 07.04.2020 01:20, Eric Dumazet wrote:
>>
>>
>> On 4/6/20 3:16 PM, Heiner Kallweit wrote:
>>
>>>
>>> In a similar context Realtek made me aware of a hw issue if IP header
>>> has the options field set. You mentioned problems with multicast packets,
>>> and based on the following code the root cause may be related.
>>>
>>> br_ip4_multicast_alloc_query()
>>> -> iph->ihl = 6;
>>>
>>> I'd appreciate if you could test (with HW tx checksumming enabled)
>>> whether this experimental patch fixes the issue with invalid/lost
>>> multicasts.
>>>
>>>
>>> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
>>> index e40e8eaeb..dd251ddb8 100644
>>> --- a/drivers/net/ethernet/realtek/r8169_main.c
>>> +++ b/drivers/net/ethernet/realtek/r8169_main.c
>>> @@ -4319,6 +4319,10 @@ static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
>>>  		    rtl_chip_supports_csum_v2(tp))
>>>  			features &= ~NETIF_F_ALL_TSO;
>>>  	} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
>>> +		if (ip_hdrlen(skb) > sizeof(struct iphdr)) {
>>
>> Packet could be non IPv4 at this point. (IPv6 for instance)
>>
> Right, I should have mentioned it:
> This experimental patch is for IPv4 only. In a final version (if it indeed
> fixes the issue) I had to extend the condition and check for IPv4.
> 
>>> +			pr_info("hk: iphdr has options field set\n");
>>> +			features &= ~NETIF_F_CSUM_MASK;
>>> +		}
>>>  		if (skb->len < ETH_ZLEN) {
>>>  			switch (tp->mac_version) {
>>>  			case RTL_GIGA_MAC_VER_11:
>>>
> 

Here comes an updated version of the experimental patch that checks for IPv4.
It's part of a bigger experimental patch here, therefore it's not fully
optimized.


diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index e40e8eaeb..69e35da6c 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4307,6 +4307,23 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 	return NETDEV_TX_BUSY;
 }
 
+static netdev_features_t rtl8168evl_features_check(struct sk_buff *skb,
+						   netdev_features_t features)
+{
+	__be16 proto = vlan_get_protocol(skb);
+
+	if (skb->ip_summed == CHECKSUM_PARTIAL) {
+		if (proto == htons(ETH_P_IP)) {
+			if (ip_hdrlen(skb) > sizeof(struct iphdr)) {
+				pr_info("hk: iphdr has options field set\n");
+				features &= ~NETIF_F_CSUM_MASK;
+			}
+		}
+	}
+
+	return features;
+}
+
 static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
 						struct net_device *dev,
 						netdev_features_t features)
@@ -4314,6 +4331,9 @@ static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
 	int transport_offset = skb_transport_offset(skb);
 	struct rtl8169_private *tp = netdev_priv(dev);
 
+	if (tp->mac_version == RTL_GIGA_MAC_VER_34)
+		features = rtl8168evl_features_check(skb, features);
+
 	if (skb_is_gso(skb)) {
 		if (transport_offset > GTTCPHO_MAX &&
 		    rtl_chip_supports_csum_v2(tp))
-- 
2.26.0



  reply index

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27  9:08 Charles Daymand
2020-03-27  9:39 ` Heiner Kallweit
2020-03-27 17:41   ` Heiner Kallweit
2020-03-27 18:52     ` Eric Dumazet
2020-03-27 19:17       ` Heiner Kallweit
2020-03-27 19:42         ` Eric Dumazet
     [not found]           ` <CAFJtzm03QpjGRs70tth26BdUFN_o8zsJOccbnA58ma+2uwiGcg@mail.gmail.com>
2020-03-31 13:48             ` Charles DAYMAND
2020-03-31 14:07             ` Heiner Kallweit
2020-04-06 14:12               ` Charles DAYMAND
2020-04-06 22:16                 ` Heiner Kallweit
2020-04-06 23:20                   ` Eric Dumazet
2020-04-07  6:22                     ` Heiner Kallweit
2020-04-07 22:40                       ` Heiner Kallweit [this message]
2020-04-10  9:53                         ` Charles DAYMAND
2020-04-13 18:06                 ` Heiner Kallweit
2020-04-13 18:20                   ` Eric Dumazet
2020-04-15 11:55                     ` Charles Daymand
2020-05-12 18:37                       ` Heiner Kallweit
2020-04-27 21:12                     ` Florent Fourcot
2020-04-30 16:50                       ` Heiner Kallweit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe30ab8d-2915-e049-ef30-760960f5efdc@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=charles.daymand@wifirst.fr \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git