Semiconductor maker Cavium Inc. (CAVM) has agreed to buy QLogic Corp. (QLGC) in a deal that values the networking infrastructure maker at about $1.36 billion, including $355 million in cash.