]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
sfc: use ALIGN macro for aligning frame sizes
authorJarod Wilson <jarod@redhat.com>
Mon, 30 Nov 2015 22:12:21 +0000 (17:12 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Dec 2015 04:56:37 +0000 (23:56 -0500)
Don't open-code it.

CC: Solarflare linux maintainers <linux-net-drivers@solarflare.com>
CC: Shradha Shah <sshah@solarflare.com>
CC: netdev@vger.kernel.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Acked-by: Bert Kenward <bkenward@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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)
 {