Network Function Virtualization (NFV) shed new light for the design, deployment, and management of cloud networks. Many network functions such as firewalls, load balancers, and intrusion detection systems can be virtualized by servers. However, network operators often have to sacrifice programmability to achieve high throughput, especially at networks’ edge where complex network functions are required. Here, we design, implement and evaluate Hybrid Modular Switch (HyMoS). The hybrid hardware/software switch aims to meet the requirements of modern-day NFV applications by providing high-throughput, highly programmable packet forwarding. HyMoS utilizes P4-compatible Network Interface Cards (NICs), PCI Express interface and CPU to act as line cards, switch fabric, and fabric controller respectively. HyMos turns PCI Express interface into a non-blocking switch fabric with a throughput of hundreds of Gigabits per second. Compared to existing NFV infrastructure, HyMoS offers modularity in hardware and software as well as a higher degree of programmability by supporting a superset of P4 language.