From 65546253f9ca398fe6970da536ea78e504aa978f Mon Sep 17 00:00:00 2001 From: Alok Makhariya Date: Wed, 7 Jan 2015 16:50:31 +0530 Subject: dpa_eth_sg: Patch to not allow Jumbo packet to ASF when flag is disabled. This patch checks fd->length20 therefore not allowing jumbo packet to ASF when JUMBO flag is not enabled. Signed-off-by: Alok Makhariya Change-Id: Id6a111b823acd3a4b3152f5044262abfb3ca1f06 Reviewed-on: http://git.am.freescale.net:8181/27894 Reviewed-by: Madalin-Cristian Bucur Tested-by: Review Code-CDREVIEW Reviewed-by: Sandeep Malik Reviewed-by: Honghua Yin diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c index 2e541a8..21ad475 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c @@ -578,14 +578,21 @@ void __hot _dpa_rx(struct net_device *net_dev, if (likely(fd->format == qm_fd_contig)) { #if defined(CONFIG_AS_FASTPATH) || defined(CONFIG_FSL_FMAN_TEST) - /* Execute the Rx processing hook, if it exists. */ - if (dpaa_eth_hooks.rx_default && - dpaa_eth_hooks.rx_default((void *)fd, net_dev, fqid) - == DPAA_ETH_STOLEN) { - /* won't count the rx bytes in */ - return; +#if defined(CONFIG_AS_FASTPATH) && !defined(CONFIG_FSL_DPAA_ETH_JUMBO_FRAME) + /* Do not allow Jumbo packet to ASF */ + if (likely(fd->length20 <= 1514)) { +#endif + /* Execute the Rx processing hook, if it exists. */ + if (dpaa_eth_hooks.rx_default && + dpaa_eth_hooks.rx_default((void *)fd, net_dev, + fqid) == DPAA_ETH_STOLEN) { + /* won't count the rx bytes in */ + return; + } +#if defined(CONFIG_AS_FASTPATH) && !defined(CONFIG_FSL_DPAA_ETH_JUMBO_FRAME) } #endif +#endif skb = contig_fd_to_skb(priv, fd, &use_gro); } else skb = sg_fd_to_skb(priv, fd, &use_gro, count_ptr); -- cgit v0.10.2