net: cpsw: avoid alignment faults by taking NET_IP_ALIGN into account
[sfrench/cifs-2.6.git] / drivers / net / ethernet / ti / cpsw.c
index 33142d505fc816f01dca0a1573ff6bd45776fc31..03575c0175008af8e194f2e6084a41ff7446cb2b 100644 (file)
@@ -349,7 +349,7 @@ static void cpsw_rx_handler(void *token, int len, int status)
        struct cpsw_common      *cpsw = ndev_to_cpsw(xmeta->ndev);
        int                     pkt_size = cpsw->rx_packet_max;
        int                     ret = 0, port, ch = xmeta->ch;
-       int                     headroom = CPSW_HEADROOM;
+       int                     headroom = CPSW_HEADROOM_NA;
        struct net_device       *ndev = xmeta->ndev;
        struct cpsw_priv        *priv;
        struct page_pool        *pool;
@@ -392,7 +392,7 @@ static void cpsw_rx_handler(void *token, int len, int status)
        }
 
        if (priv->xdp_prog) {
-               int headroom = CPSW_HEADROOM, size = len;
+               int size = len;
 
                xdp_init_buff(&xdp, PAGE_SIZE, &priv->xdp_rxq[ch]);
                if (status & CPDMA_RX_VLAN_ENCAP) {
@@ -442,7 +442,7 @@ requeue:
        xmeta->ndev = ndev;
        xmeta->ch = ch;
 
-       dma = page_pool_get_dma_addr(new_page) + CPSW_HEADROOM;
+       dma = page_pool_get_dma_addr(new_page) + CPSW_HEADROOM_NA;
        ret = cpdma_chan_submit_mapped(cpsw->rxv[ch].ch, new_page, dma,
                                       pkt_size, 0);
        if (ret < 0) {