From d2c55feac3b207a2400d762322022ea7b110b65e Mon Sep 17 00:00:00 2001 From: Bogdan Purcareata Date: Fri, 13 Oct 2017 15:45:43 +0000 Subject: staging: fsl-dpaa2/eth: Update Rx headroom computation Instead of the old opaque value, define the Rx buffer headroom size based on other frame buffer fields, in accordance to how we expect them to be configured by MC. Based on DPNI_BUF_LAYOUT_OPT_TIMESTAMP, MC will enable an additional field in the Tx hardware annotation area, increasing its size to 128. Update the driver value to reflect this. Signed-off-by: Bogdan Purcareata Integrated-by: Guanhua Gao diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h index 456efbc..0126878 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h @@ -115,17 +115,19 @@ /* PTP nominal frequency 1GHz */ #define DPAA2_PTP_NOMINAL_FREQ_PERIOD_NS 1 -/* Leave enough extra space in the headroom to make sure the skb is - * not realloc'd in forwarding scenarios. - */ -#define DPAA2_ETH_RX_HEAD_ROOM 192 - /* We are accommodating a skb backpointer and some S/G info * in the frame's software annotation. The hardware * options are either 0 or 64, so we choose the latter. */ #define DPAA2_ETH_SWA_SIZE 64 +/* Extra headroom space requested to hardware, in order to make sure there's + * no realloc'ing in forwarding scenarios + */ +#define DPAA2_ETH_RX_HEAD_ROOM \ + (DPAA2_ETH_TX_HWA_SIZE - DPAA2_ETH_RX_HWA_SIZE + \ + DPAA2_ETH_TX_BUF_ALIGN + HH_DATA_MOD) + /* Must keep this struct smaller than DPAA2_ETH_SWA_SIZE */ struct dpaa2_eth_swa { struct sk_buff *skb; -- cgit v0.10.2