How gNB figures out padding in the UL?

These concepts should be same in 5G, need to cross check.

MAC PDU will contain logical channels which denotes MAC CE’s as well as other DL-SCH / UL-SCH headers headers and payload.