Hi Andrew, Thank for your reply.
On Thu, Jul 26, 2018 at 4:39 PM, Andrew Lunn <and...@lunn.ch> wrote: >> I am bit confused on how dsa needs to be actually working, >> Q's >> 1] should I be running a dhcp server on eth1 (where switch is connected) >> so that devices connected on lan* devices get an ip ? > > Nope. You need eth1 up, but otherwise you do not use it. Use the lanX > interfaces like normal Linux interfaces. Run your dhclient on lanX, etc. >> >> 2] From the device where switch is connected if the cpu port wants to send >> any data to any other user ports lan* how do i do it (just open >> socket on eth1 or lan*) ? > > Just treat the lanX interfaces as normal Linux interfaces. > I have some more query’s on DSA. I have manged to get the TI's cpsw slave1 connected to ksz9897 Ethernet switch chip partially working, I have PC connected to lan4(ip = 169.254..126.126) and the PC ip is 169.254.78.251, but when I ping from PC to lan4 I get Destination Host Unreachable, but where as I can see that in the tcpdump log for lan4 it does reply back, but it doesn’t reach the PC, Is there I am missing something here ? Log from the device on which switch is present: =================================== ~$ ifconfig eth0 Link encap:Ethernet HWaddr C4:F3:12:08:FE:7E UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:102 eth1 Link encap:Ethernet HWaddr C4:F3:12:08:FE:7F inet6 addr: fe80::c6f3:12ff:fe08:fe7f%lo/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:436 errors:0 dropped:0 overruns:0 frame:0 TX packets:516 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:37254 (36.3 KiB) TX bytes:51585 (50.3 KiB) lan4 Link encap:Ethernet HWaddr C4:F3:12:08:FE:7F inet addr:169.254.126.126 Bcast:169.254.255.255 Mask:255.255.0.0 inet6 addr: fe80::c6f3:12ff:fe08:fe7f%lo/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:436 errors:0 dropped:0 overruns:0 frame:0 TX packets:444 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:28970 (28.2 KiB) TX bytes:35214 (34.3 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1%1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:67 errors:0 dropped:0 overruns:0 frame:0 TX packets:67 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:6618 (6.4 KiB) TX bytes:6618 (6.4 KiB) ~$ tcpdump -i lan4 -v [ 661.057166] device lan4 entered promiscuous mode [ 661.061814] device eth1 entered promiscuous mode tcpdump: listening on lan4, link-type EN10MB (Ethernet), capture size 262144 bytes 07:40:20.255355 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000 tell tango-charlie.local, length 46 07:40:20.255393 ARP, Ethernet (len 6), IPv4 (len 4), Reply VB4-SN00000000 is-at c4:f3:12:08:fe:7f (oui Unknown), length 28 07:40:20.360936 IP6 (flowlabel 0x970aa, hlim 255, next-header UDP (17) payload length: 53) VB4-SN00000000.mdns > ff02::fb.mdns: [udp sum o) 07:40:20.361085 IP (tos 0x0, ttl 255, id 17259, offset 0, flags [DF], proto UDP (17), length 73) VB4-SN00000000.mdns > 224.0.0.251.mdns: 0 PTR (QM)? 251.78.254.169.in-addr.arpa. (45) 07:40:20.361848 IP (tos 0x0, ttl 255, id 1808, offset 0, flags [DF], proto UDP (17), length 100) tango-charlie.local.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/0 251.78.254.169.in-addr.arpa. (Cache flush) PTR tango-charlie.local. (72) 07:40:20.465933 IP6 (flowlabel 0x970aa, hlim 255, next-header UDP (17) payload length: 98) VB4-SN00000000.mdns > ff02::fb.mdns: [udp sum o) 07:40:20.466124 IP (tos 0x0, ttl 255, id 17288, offset 0, flags [DF], proto UDP (17), length 118) VB4-SN00000000.mdns > 224.0.0.251.mdns: 0 PTR (QM)? b.f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa. (90) 07:40:21.254161 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000 tell tango-charlie.local, length 46 07:40:21.254181 ARP, Ethernet (len 6), IPv4 (len 4), Reply VB4-SN00000000 is-at c4:f3:12:08:fe:7f (oui Unknown), length 28 07:40:25.470288 IP6 (flowlabel 0x970aa, hlim 255, next-header UDP (17) payload length: 50) VB4-SN00000000.mdns > ff02::fb.mdns: [udp sum o) 07:40:31.301929 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000 tell tango-charlie.local, length 46 07:40:31.301957 ARP, Ethernet (len 6), IPv4 (len 4), Reply VB4-SN00000000 is-at c4:f3:12:08:fe:7f (oui Unknown), length 28 07:40:32.319104 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000 tell tango-charlie.local, length 46 07:40:32.319131 ARP, Ethernet (len 6), IPv4 (len 4), Reply VB4-SN00000000 is-at c4:f3:12:08:fe:7f (oui Unknown), length 28 07:40:33.317874 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000 tell tango-charlie.local, length 46 07:40:33.317900 ARP, Ethernet (len 6), IPv4 (len 4), Reply VB4-SN00000000 is-at c4:f3:12:08:fe:7f (oui Unknown), length 28 07:40:34.317840 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000 tell tango-charlie.local, length 46 07:40:34.317866 ARP, Ethernet (len 6), IPv4 (len 4), Reply VB4-SN00000000 is-at c4:f3:12:08:fe:7f (oui Unknown), length 28 ~$ ethtool -S eth1 NIC statistics: Good Rx Frames: 715 Broadcast Rx Frames: 553 Multicast Rx Frames: 162 Pause Rx Frames: 0 Rx CRC Errors: 0 Rx Align/Code Errors: 0 Oversize Rx Frames: 0 Rx Jabbers: 0 Undersize (Short) Rx Frames: 0 Rx Fragments: 0 Rx Octets: 63055 Good Tx Frames: 812 Broadcast Tx Frames: 34 Multicast Tx Frames: 283 Pause Tx Frames: 0 Deferred Tx Frames: 0 Collisions: 0 Single Collision Tx Frames: 0 Multiple Collision Tx Frames: 0 Excessive Collisions: 0 Late Collisions: 0 Tx Underrun: 0 Carrier Sense Errors: 0 Tx Octets: 85250 Rx + Tx 64 Octet Frames: 0 Rx + Tx 65-127 Octet Frames: 1287 Rx + Tx 128-255 Octet Frames: 168 Rx + Tx 256-511 Octet Frames: 72 Rx + Tx 512-1023 Octet Frames: 0 Rx + Tx 1024-Up Octet Frames: 0 Net Octets: 148305 Rx Start of Frame Overruns: 0 Rx Middle of Frame Overruns: 0 Rx DMA Overruns: 0 Rx DMA chan 0: head_enqueue: 1 Rx DMA chan 0: tail_enqueue: 813 Rx DMA chan 0: pad_enqueue: 0 Rx DMA chan 0: misqueued: 0 Rx DMA chan 0: desc_alloc_fail: 0 Rx DMA chan 0: pad_alloc_fail: 0 Rx DMA chan 0: runt_receive_buf: 0 Rx DMA chan 0: runt_transmit_bu: 0 Rx DMA chan 0: empty_dequeue: 0 Rx DMA chan 0: busy_dequeue: 668 Rx DMA chan 0: good_dequeue: 686 Rx DMA chan 0: requeue: 0 Rx DMA chan 0: teardown_dequeue: 0 Tx DMA chan 0: head_enqueue: 812 Tx DMA chan 0: tail_enqueue: 0 Tx DMA chan 0: pad_enqueue: 0 Tx DMA chan 0: misqueued: 0 Tx DMA chan 0: desc_alloc_fail: 0 Tx DMA chan 0: pad_alloc_fail: 0 Tx DMA chan 0: runt_receive_buf: 0 Tx DMA chan 0: runt_transmit_bu: 502 Tx DMA chan 0: empty_dequeue: 812 Tx DMA chan 0: busy_dequeue: 0 Tx DMA chan 0: good_dequeue: 812 Tx DMA chan 0: requeue: 0 Tx DMA chan 0: teardown_dequeue: 0 p05_rx_hi: 0 p05_rx_undersize: 0 p05_rx_fragments: 0 p05_rx_oversize: 0 p05_rx_jabbers: 0 p05_rx_symbol_err: 0 p05_rx_crc_err: 0 p05_rx_align_err: 0 p05_rx_mac_ctrl: 0 p05_rx_pause: 0 p05_rx_bcast: 34 p05_rx_mcast: 283 p05_rx_ucast: 495 p05_rx_64_or_less: 0 p05_rx_65_127: 675 p05_rx_128_255: 87 p05_rx_256_511: 50 p05_rx_512_1023: 0 p05_rx_1024_1522: 0 p05_rx_1523_2000: 0 p05_rx_2001: 0 p05_tx_hi: 0 p05_tx_late_col: 0 p05_tx_pause: 0 p05_tx_bcast: 553 p05_tx_mcast: 165 p05_tx_ucast: 0 p05_tx_deferred: 0 p05_tx_total_col: 0 p05_tx_exc_col: 0 p05_tx_single_col: 0 p05_tx_mult_col: 0 p05_rx_total: 85250 p05_tx_total: 63473 p05_rx_discards: 505 p05_tx_discards: 0 ~$ ~$ ethtool -S lan4 NIC statistics: tx_packets: 736 tx_bytes: 59572 rx_packets: 701 rx_bytes: 45521 rx_hi: 0 rx_undersize: 0 rx_fragments: 0 rx_oversize: 0 rx_jabbers: 0 rx_symbol_err: 0 rx_crc_err: 0 rx_align_err: 0 rx_mac_ctrl: 0 rx_pause: 0 rx_bcast: 602 rx_mcast: 448 rx_ucast: 495 rx_64_or_less: 562 rx_65_127: 742 rx_128_255: 169 rx_256_511: 72 rx_512_1023: 0 rx_1024_1522: 0 rx_1523_2000: 0 rx_2001: 0 tx_hi: 0 tx_late_col: 0 tx_pause: 0 tx_bcast: 582 tx_mcast: 376 tx_ucast: 0 tx_deferred: 0 tx_total_col: 0 tx_exc_col: 0 tx_single_col: 0 tx_mult_col: 0 rx_total: 148965 tx_total: 104929 rx_discards: 505 tx_discards: 0 ~$ Logs from the PC: =================================== prabhakar@tango-charlie:~/Desktop/test$ ifconfig enx00e04c68c229 enx00e04c68c229 Link encap:Ethernet HWaddr 00:e0:4c:68:c2:29 inet addr:169.254.78.251 Bcast:169.254.255.255 Mask:255.255.0.0 inet6 addr: fe80::7cd0:12d6:d4bb:fc8b/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:209 errors:0 dropped:0 overruns:0 frame:0 TX packets:842 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:38308 (38.3 KB) TX bytes:60751 (60.7 KB) prabhakar@tango-charlie:~/Desktop/test$ ping -I enx00e04c68c229 169.254.126.126 PING 169.254.126.126 (169.254.126.126) from 169.254.78.251 enx00e04c68c229: 56(84) bytes of data. >From 169.254.78.251 icmp_seq=1 Destination Host Unreachable >From 169.254.78.251 icmp_seq=2 Destination Host Unreachable >From 169.254.78.251 icmp_seq=3 Destination Host Unreachable >From 169.254.78.251 icmp_seq=4 Destination Host Unreachable >From 169.254.78.251 icmp_seq=5 Destination Host Unreachable >From 169.254.78.251 icmp_seq=6 Destination Host Unreachable ^C --- 169.254.126.126 ping statistics --- 8 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6999ms pipe 4 prabhakar@tango-charlie:~/Desktop/test$ sudo tcpdump -i enx00e04c68c229 -v [sudo] password for prabhakar: tcpdump: listening on enx00e04c68c229, link-type EN10MB (Ethernet), capture size 262144 bytes 09:09:39.692909 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000.local tell tango-charlie, length 28 09:09:39.794135 IP6 (flowlabel 0xaf44f, hlim 255, next-header UDP (17) payload length: 54) tango-charlie.mdns > ff02::fb.mdns: [bad udp cksum 0x5fb4 -> 0x8657!] 0 PTR (QM)? 126.126.254.169.in-addr.arpa. (46) 09:09:39.794196 IP (tos 0x0, ttl 255, id 32415, offset 0, flags [DF], proto UDP (17), length 74) tango-charlie.mdns > 224.0.0.251.mdns: 0 PTR (QM)? 126.126.254.169.in-addr.arpa. (46) 09:09:39.795280 IP (tos 0x0, ttl 255, id 37104, offset 0, flags [DF], proto UDP (17), length 102) VB4-SN00000000.local.mdns > 224.0.0.251.mdns: 0*- [0q] 1/0/0 126.126.254.169.in-addr.arpa. (Cache flush) PTR VB4-SN00000000.local. (74) 09:09:40.692890 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000.local tell tango-charlie, length 28 09:09:41.710153 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000.local tell tango-charlie, length 28 09:09:42.708884 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000.local tell tango-charlie, length 28 09:09:43.708884 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000.local tell tango-charlie, length 28 09:09:44.726124 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000.local tell tango-charlie, length 28 09:09:45.724892 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000.local tell tango-charlie, length 28 09:09:46.724887 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has VB4-SN00000000.local tell tango-charlie, length 28 ^C 11 packets captured 11 packets received by filter 0 packets dropped by kernel Cheers, --Prabhakar