/* Returns the number of Tx descriptors needed for the given Ethernet packet. Ethernet packets require addition of WR and CPL headers.  */
static unsigned int calc_tx_descs(const struct sk_buff *skb)
/* Returns the number of Tx descriptors needed for the given Ethernet packet. Ethernet packets require addition of WR and CPL headers.  */
static unsigned int calc_tx_descs(const struct sk_buff *skb)
{
	unsigned int flits;
	if (skb->len <= WR_LEN - sizeof(struct cpl_tx_pkt))
		return 1;
	flits = sgl_len(skb_shinfo(skb)->nr_frags + 1) + 2;
	if (skb_shinfo(skb)->gso_size)
		flits++;
	return flits_to_desc(flits);
}