File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
drivers/net/ethernet/freescale/dpaa Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -2055,19 +2055,23 @@ static int dpaa_start_xmit(struct sk_buff *skb, struct net_device *net_dev)
2055
2055
/* MAX_SKB_FRAGS is equal or larger than our dpaa_SGT_MAX_ENTRIES;
2056
2056
* make sure we don't feed FMan with more fragments than it supports.
2057
2057
*/
2058
- if (nonlinear &&
2059
- likely (skb_shinfo (skb )-> nr_frags < DPAA_SGT_MAX_ENTRIES )) {
2060
- /* Just create a S/G fd based on the skb */
2061
- err = skb_to_sg_fd (priv , skb , & fd );
2062
- percpu_priv -> tx_frag_skbuffs ++ ;
2063
- } else {
2058
+ if (unlikely (nonlinear &&
2059
+ (skb_shinfo (skb )-> nr_frags >= DPAA_SGT_MAX_ENTRIES ))) {
2064
2060
/* If the egress skb contains more fragments than we support
2065
2061
* we have no choice but to linearize it ourselves.
2066
2062
*/
2067
- if (unlikely ( nonlinear ) && __skb_linearize (skb ))
2063
+ if (__skb_linearize (skb ))
2068
2064
goto enomem ;
2069
2065
2070
- /* Finally, create a contig FD from this skb */
2066
+ nonlinear = skb_is_nonlinear (skb );
2067
+ }
2068
+
2069
+ if (nonlinear ) {
2070
+ /* Just create a S/G fd based on the skb */
2071
+ err = skb_to_sg_fd (priv , skb , & fd );
2072
+ percpu_priv -> tx_frag_skbuffs ++ ;
2073
+ } else {
2074
+ /* Create a contig FD from this skb */
2071
2075
err = skb_to_contig_fd (priv , skb , & fd , & offset );
2072
2076
}
2073
2077
if (unlikely (err < 0 ))
You can’t perform that action at this time.
0 commit comments