sfc: use ALIGN macro for aligning frame sizes
[linux-drm-fsl-dcu.git] / drivers / net / ethernet / sfc / net_driver.h
index 5c0d0baa185c7e054bf59a80c1c2b419ffb864d0..38c422321cdafe299111746f77e2d5ca906a402f 100644 (file)
@@ -1504,8 +1504,9 @@ static inline struct efx_rx_buffer *efx_rx_buffer(struct efx_rx_queue *rx_queue,
  * same cycle, the XMAC can miss the IPG altogether.  We work around
  * this by adding a further 16 bytes.
  */
+#define EFX_FRAME_PAD  16
 #define EFX_MAX_FRAME_LEN(mtu) \
-       ((((mtu) + ETH_HLEN + VLAN_HLEN + 4/* FCS */ + 7) & ~7) + 16)
+       (ALIGN(((mtu) + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN + EFX_FRAME_PAD), 8))
 
 static inline bool efx_xmit_with_hwtstamp(struct sk_buff *skb)
 {