CentaurusInfra / mizar

Mizar – Experimental, High Scale and High Performance Cloud Network https://mizar.readthedocs.io
https://mizar.readthedocs.io
GNU General Public License v2.0
112 stars 50 forks source link

Send label-policy data to XDP table #488

Closed Hong-Chang closed 3 years ago

Hong-Chang commented 3 years ago

What does this PR do?

  1. Send label-policy data to Daemon
  2. Add trn_cli functions to receive label-policy data for daemon
  3. Add xdp table and corresponding structures for label-policy data
  4. Input label-policy data to xdp table

Why is it needed? After the pr, label-policy data are stored in xdp table for future retrieving.

How was this tested? I added unit tests and did manual e2e test. The label-policy data were generated from operator and eventually observed in xdp table.

Are there any user facing / API changes? No.

Closes #455 , close #456

Hong-Chang commented 3 years ago

I feel this can be simplified to use just pod_and_namespace APIs / functions that can handle both. Can you please look into it? That would be a lot less code to test/maintain.

pod/ namespace/ pod and namespace are 3 different rules and they are independent. Although we can forcely combine them together by adding some extra tags in one api, it will break single responsibility principle.

vinaykul commented 3 years ago

I just spoke to Hong and he explained why we need to have separate tables for pod, ns, and pod+ns. This looks good to me. Please get @clu2xlu / @phudtran to review, and merge if they don't have any issues. /lgtm