lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 21 Aug 2020 11:54:58 -0400
From:   Murali Karicheri <m-karicheri2@...com>
To:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Grygorii Strashko <grygorii.strashko@...com>,
        <jpirko@...hat.com>
Subject: Re: VLAN over HSR/PRP - Issue with rx_handler not called for VLAN hw
 acceleration



On 8/21/20 11:10 AM, Murali Karicheri wrote:
> Hello Jiri,
> 
> On 8/19/20 12:08 PM, Murali Karicheri wrote:
>> All,
>>
>> I am working to add VLAN interface creation over HSR/PRP interface.
>> It works fine after I fixed the HSR driver to allow creation of
>> VLAN over it and with VLAN without hw acceleration. But with hw
>> acceleration, the HSR hook is bypassed in net/core/dev.c as
>>
>>      if (skb_vlan_tag_present(skb)) {
>>          if (pt_prev) {
>>              ret = deliver_skb(skb, pt_prev, orig_dev);
>>              pt_prev = NULL;
>>          }
>>          if (vlan_do_receive(&skb))
>>              goto another_round;
>>          else if (unlikely(!skb))
>>              goto out;
>>      }
>>
>>      rx_handler = rcu_dereference(skb->dev->rx_handler);
>>      if (rx_handler) {
>>          if (pt_prev) {
>>              ret = deliver_skb(skb, pt_prev, orig_dev);
>>              pt_prev = NULL;
>>          }
>>          switch (rx_handler(&skb)) {
>>          case RX_HANDLER_CONSUMED:
>>              ret = NET_RX_SUCCESS;
>>              goto out;
>>          case RX_HANDLER_ANOTHER:
>>              goto another_round;
>>          case RX_HANDLER_EXACT:
>>              deliver_exact = true;
>>          case RX_HANDLER_PASS:
>>              break;
>>          default:
>>              BUG();
>>          }
>>      }
>>
>> What is the best way to address this issue? With VLAN hw acceleration,
>> skb_vlan_tag_present(skb) is true and rx_handler() is not called.
>>
> I find that you have modified vlan_do_receive() in the past and
> wondering if you have some insight into the issue. I also see the same
> issue when I create VLAN interfaces over a linux bridge over TI's cpsw
> interfaces. I understand that bridge code also use the same hook
> (rx_handler) as HSR to receive the frames. The vlan interface doesn't
> get the frames. With VLAN acceleration disabled, VLAN interfaces seems
> to work fine. I  have two AM572x IDKs with CPSW port connected back to
> back. I setup Linux bridge and run stp to avoid looks. I don't
> understand what vlan_do_receive() is doing. Could you explain?

I think I got it. That appears to be the main vlan receive function
at the ingress. Correct?

> probably it needs to false for Linux bridge and HSR case so that
> the rx_handler will receive the frame? As a HACK, I will muck around
> with this code to return false and see if that helps.
> 
> Setup used for my work.
> 
> 192.168.100.10  192.168.101.10           192.168.100.20 192.168.101.20
>   br0.100        br0.101                     br0.100      br0.101
>    |-----------|                                |--------------|
>          |                                            |
>          br0 (192.168.2.10)                         br0 (192.168.2.20)
> DUT-1-----|--eth0 <-------------------------> eth0---|-----DUT-1
>            |--eth1 <-------------------------> eth1---|
> 
> Now Ping between 192.168.100.10 and 192.168.100.20 or
> 192.168.101.10 and 192.168.101.20
> 
> Commands below.
> 
> DUT-1
> 
> brctl addbr br0
> brctl addif br0 eth0
> brctl addif br0 eth1
> ifconfig eth0 up
> ifconfig eth1 up
> brctl stp br0 yes
> ifconfig br0 192.168.2.10
> 
> ip link add link br0 name br0.100 type vlan id 100
> ip link add link br0 name br0.101 type vlan id 101
> ifconfig br0.100 192.168.100.10
> ifconfig br0.101 192.168.101.10
> 
> 
> DUT-2
> 
> brctl addbr br0
> brctl addif br0 eth0
> brctl addif br0 eth1
> ifconfig eth0 up
> ifconfig eth1 up
> brctl stp br0 yes
> ifconfig br0 192.168.2.20
> 
> ip link add link br0 name br0.100 type vlan id 100
> ip link add link br0 name br0.101 type vlan id 101
> ifconfig br0.100 192.168.100.20
> ifconfig br0.101 192.168.101.20
> 
>> Thanks
>>
> 

-- 
Murali Karicheri
Texas Instruments

Powered by blists - more mailing lists