sfc: use ALIGN macro for aligning frame sizes
Subsystems (3)
PATCH 1/1 sfc: use ALIGN macro for aligning frame sizes
Don't open-code it.
CC Solarflare linux maintainers <[email protected]>
CC Shradha Shah <[email protected]>
Signed-off-by Jarod Wilson <[email protected]>
--- drivers/net/ethernet/sfc/net_driver.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/sfc/net_driver.h +2 -1
@@ -1502,8 +1502,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) {
Signature · 1 line
1.8.3.1
Quoted 6 lines · Jarod Wilson
Don't open-code it.
CC Solarflare linux maintainers <[email protected]>CC Shradha Shah <[email protected]>Signed-off-by Jarod Wilson <[email protected]>
Acked-by Bert Kenward <[email protected]>
Quoted 20 lines
--- drivers/net/ethernet/sfc/net_driver.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/sfc/net_driver.h +2
-1@@ -1502,8 +1502,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) {
From: Jarod Wilson <[email protected]>
Date: Mon, 30 Nov 2015 17:12:21 -0500
Quoted 6 lines
Don't open-code it.
CC Solarflare linux maintainers <[email protected]>CC Shradha Shah <[email protected]>Signed-off-by Jarod Wilson <[email protected]>
Applied, thank you.