Hi Ti,
How to use the policer to realise the whitelist based on mac and ip binding. My idea is to use CPSW_ALE_IOCTL_POLICER_GLOBAL_CFG to set up a whitelist, so that only the packet, which match the policer, can go through, and all the rest are blocked. If I set up a global policer via CPSW_ALE_IOCTL_POLICER_GLOBAL_CFG, how do I set up the policer so that a machine connected to port 2 will be able to ping the A72 core.
This network topology diagram:
the packet is sent from the external port 2 to host port. The information of the packet is
src mac: 48:49:52:41:10:81
dst mac: 48:49:52:41:a1:99
src ip: 192.168.4.129
dst ip: 192.168.4.153
vlan id: 4
If I just set the vlan information in ALE entry and no longer set the vlan in policer, what should I do to set the ip and mac in policer to realize the filtering? I have colored the unmatched messages red with CPSW_ALE_IOCTL_POLICER_GLOBAL_CFG.
[MCU2_0] 18354.687527 s: src/mod/cpsw_ale.c line[3915]: 0: Vlanid: 000a, UTagged: 1ff, Mult: 1ff, UMult: 0, Member: 1ff [MCU2_0] 18354.687577 s: src/mod/cpsw_ale.c line[4051]: RAW:[0 200a1f [MCU2_0] 18354.687608 s: src/mod/cpsw_ale.c line[4056]: f1 ff0001ff] [MCU2_0] 18354.687651 s: src/mod/cpsw_ale.c line[3915]: 1: Vlanid: 0190, UTagged: 1ff, Mult: 1ff, UMult: 0, Member: 1ff [MCU2_0] 18354.687697 s: src/mod/cpsw_ale.c line[4051]: RAW:[0 21901f [MCU2_0] 18354.687728 s: src/mod/cpsw_ale.c line[4056]: f1 ff0001ff] [MCU2_0] 18354.687768 s: src/mod/cpsw_ale.c line[3915]: 2: Vlanid: 0193, UTagged: 1ff, Mult: 1ff, UMult: 0, Member: 1ff [MCU2_0] 18354.687814 s: src/mod/cpsw_ale.c line[4051]: RAW:[0 21931f [MCU2_0] 18354.687845 s: src/mod/cpsw_ale.c line[4056]: f1 ff0001ff] [MCU2_0] 18354.687894 s: src/mod/cpsw_ale.c line[3870]: 3: Address: 48495241a199, Port: 000 Se=0 Bl=0 TOUCH=0 AGE=0 TRUNK=0 [MCU2_0] 18354.687970 s: src/mod/cpsw_ale.c line[4051]: RAW:[0 100048 [MCU2_0] 18354.688005 s: src/mod/cpsw_ale.c line[4056]: 49 5241a199] [MCU2_0] 18354.688048 s: src/mod/cpsw_ale.c line[3915]: 4: Vlanid: 0196, UTagged: 1ff, Mult: 1ff, UMult: 0, Member: 1ff [MCU2_0] 18354.688096 s: src/mod/cpsw_ale.c line[4051]: RAW:[0 21961f [MCU2_0] 18354.688128 s: src/mod/cpsw_ale.c line[4056]: f1 ff0001ff] [MCU2_0] 18354.688167 s: src/mod/cpsw_ale.c line[3915]: 5: Vlanid: 0197, UTagged: 1ff, Mult: 1ff, UMult: 0, Member: 1ff [MCU2_0] 18354.688212 s: src/mod/cpsw_ale.c line[4051]: RAW:[0 21971f [MCU2_0] 18354.688243 s: src/mod/cpsw_ale.c line[4056]: f1 ff0001ff] [MCU2_0] 18354.688292 s: src/mod/cpsw_ale.c line[3849]: 6: Address: ffffffffffff, Member:1ff Su=0 FWDSTLVL=0 IGNMBITS=0 [MCU2_0] 18354.688338 s: src/mod/cpsw_ale.c line[4051]: RAW:[c 1000ff [MCU2_0] 18354.688371 s: src/mod/cpsw_ale.c line[4056]: ff ffffffff] [MCU2_0] 18354.688417 s: src/mod/cpsw_ale.c line[3870]: 7: Address: 48495241a19a, Port: 000 Se=1 Bl=0 TOUCH=0 AGE=0 TRUNK=0 [MCU2_0] 18354.688466 s: src/mod/cpsw_ale.c line[4051]: RAW:[1 100048 [MCU2_0] 18354.688497 s: src/mod/cpsw_ale.c line[4056]: 49 5241a19a] [MCU2_0] 18354.688535 s: src/mod/cpsw_ale.c line[3915]: 8: Vlanid: 0004, UTagged: 0, Mult: 9, UMult: 9, Member: 9 [MCU2_0] 18354.688579 s: src/mod/cpsw_ale.c line[4051]: RAW:[0 200400 [MCU2_0] 18354.688610 s: src/mod/cpsw_ale.c line[4056]: 90 00009009] [MCU2_0] 18354.688678 s: src/mod/cpsw_ale.c line[3870]: 26: Address: 484952412082, Port: 003 Se=0 Bl=0 TOUCH=1 AGE=1 TRUNK=0 [MCU2_0] 18354.688726 s: src/mod/cpsw_ale.c line[4051]: RAW:[c d00548 [MCU2_0] 18354.688758 s: src/mod/cpsw_ale.c line[4056]: 49 52412082] [MCU2_0] 18354.688803 s: src/mod/cpsw_ale.c line[3870]: 27: Address: 484952411081, Port: 003 Se=0 Bl=0 TOUCH=1 AGE=1 TRUNK=0 [MCU2_0] 18354.688850 s: src/mod/cpsw_ale.c line[4051]: RAW:[c d00548 [MCU2_0] 18354.688881 s: src/mod/cpsw_ale.c line[4056]: 49 52411081] [MCU2_0] 18354.688973 s: src/mod/cpsw_ale.c line[3870]: 48: Address: 484952412083, Port: 003 Se=0 Bl=0 TOUCH=1 AGE=1 TRUNK=0 [MCU2_0] 18354.689024 s: src/mod/cpsw_ale.c line[4051]: RAW:[c d00a48 [MCU2_0] 18354.689057 s: src/mod/cpsw_ale.c line[4056]: 49 52412083] [MCU2_0] 18354.689106 s: src/mod/cpsw_ale.c line[3870]: 49: Address: 48495241b19a, Port: 003 Se=0 Bl=0 TOUCH=1 AGE=1 TRUNK=0 [MCU2_0] 18354.689153 s: src/mod/cpsw_ale.c line[4051]: RAW:[c d00548 [MCU2_0] 18354.689186 s: src/mod/cpsw_ale.c line[4056]: 49 5241b19a] [MCU2_0] 18354.690565 s: src/mod/cpsw_ale.c line[4061]: [MCU2_0] 18354.690594 s: src/mod/cpsw_ale.c line[4062]: 1011 Free Entries [MCU2_0] 18354.690633 s: src/mod/cpsw_ale.c line[5603]: [MCU2_0] 18354.690669 s: src/mod/cpsw_ale.c line[5642]: 0: POLICER_DST_MAC,ALE Index: 3 [MCU2_0] 18354.690708 s: src/mod/cpsw_ale.c line[5684]: 0: POLICER_THREAD,THREAD ID:0 [MCU2_0] 18354.690752 s: src/mod/cpsw_ale.c line[5729]: 0: POLICER_STATS: Hit: 1, RedHit: 0, YellowHit: 0 [MCU2_0] 18354.690801 s: src/mod/cpsw_ale.c line[5660]: 1: POLICER_VLAN,ALE Index: 8 [MCU2_0] 18354.690836 s: src/mod/cpsw_ale.c line[5684]: 1: POLICER_THREAD,THREAD ID:0 [MCU2_0] 18354.690875 s: src/mod/cpsw_ale.c line[5729]: 1: POLICER_STATS: Hit: 1, RedHit: 0, YellowHit: 0 [MCU2_0] 18354.691137 s: src/mod/cpsw_ale.c line[5733]: [MCU2_0] 18354.691169 s: src/mod/cpsw_ale.c line[5734]: 94 Free Entries … policerEn: 1, yellowDropEn: 1, redDropEn: 1, yellowThress: 0, policerNoMatchMode: 2, noMatchPolicer: -1558156804