diff options
author | Ioana Radulescu <ruxandra.radulescu@freescale.com> | 2013-07-08 16:52:09 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-07-30 21:05:25 (GMT) |
commit | 086d3b61366bd341cd2532142111fed2e6f2161f (patch) | |
tree | f3d38df3d1c9459af81accc7287149ec27634550 /drivers/net/ethernet/freescale/fman | |
parent | 679c0b00fa6310766b38deda6b62658e57b7e1e8 (diff) | |
download | linux-fsl-qoriq-086d3b61366bd341cd2532142111fed2e6f2161f.tar.xz |
fmd: Update range for FSL_FM_RX_EXTRA_HEADROOM
We need to reserve some space in the Rx skb buffer for NET_IP_ALIGN,
otherwise on forwarding the stack may reallocate the skb header.
The most easily available place to do this is the Rx extra headroom,
so enforce the minimum non-zero possible value as lower end of the
configuration range.
While here, enforce (and comment on) the restriction to only set values
which are a multiple of 16 bytes, which was missed in the previous
version of the help text.
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@freescale.com>
Change-Id: I9403a36f11cc1c7b9460126fb5ab97237f9bd105
Reviewed-on: http://git.am.freescale.net:8181/3482
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Hamciuc Bogdan-BHAMCIU1 <bogdan.hamciuc@freescale.com>
Reviewed-by: Bucur Madalin-Cristian-B32716 <madalin.bucur@freescale.com>
Reviewed-by: Sovaiala Cristian-Constantin-B39531 <Cristian.Sovaiala@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/fman')
-rw-r--r-- | drivers/net/ethernet/freescale/fman/Kconfig | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.h | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ethernet/freescale/fman/Kconfig b/drivers/net/ethernet/freescale/fman/Kconfig index ec7449f..eaecb1c 100644 --- a/drivers/net/ethernet/freescale/fman/Kconfig +++ b/drivers/net/ethernet/freescale/fman/Kconfig @@ -85,14 +85,16 @@ config FSL_FM_MAX_FRAME_SIZE config FSL_FM_RX_EXTRA_HEADROOM int "Add extra headroom at beginning of data buffers" depends on FSL_FMAN - range 0 384 + range 16 384 default "64" help Configure this to tell the Frame Manager to reserve some extra space at the beginning of a data buffer on the receive path, before Internal Context fields are copied. This is in addition to the private data area already reserved for driver internal - use. The option does not affect in any way the layout of + use. The provided value must be a multiple of 16. + + This option does not affect in any way the layout of transmitted buffers. You may be required to enable the config option FMAN_RESOURCE_ALLOCATION_ALGORITHM and also FMAN_DISABLE_OH_TO_REUSE_RESOURCES to have enough resources diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c index e48fbcd..b136b77 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c @@ -147,7 +147,7 @@ int fm_get_max_frm() int fm_get_rx_extra_headroom() { - return fsl_fm_rx_extra_headroom; + return ALIGN(fsl_fm_rx_extra_headroom, 16); } static int __init fm_set_max_frm(char *str) diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.h b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.h index 37c52c7..d89327c 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.h +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.h @@ -74,7 +74,7 @@ #endif #ifndef CONFIG_FSL_FM_RX_EXTRA_HEADROOM -#define CONFIG_FSL_FM_RX_EXTRA_HEADROOM 0 +#define CONFIG_FSL_FM_RX_EXTRA_HEADROOM 16 #endif typedef enum { |