struct page_pool *pool;
        struct sk_buff *skb;
        struct xdp_buff xdp;
+       int headroom, ret;
        u32 *psdata;
        void *pa;
-       int ret;
 
        *xdp_state = 0;
        pool = rx_chn->pg_pool;
                xdp_prepare_buff(&xdp, pa, PRUETH_HEADROOM, pkt_len, false);
 
                *xdp_state = emac_run_xdp(emac, &xdp, page, &pkt_len);
-               if (*xdp_state == ICSSG_XDP_PASS)
-                       skb = xdp_build_skb_from_buff(&xdp);
-               else
+               if (*xdp_state != ICSSG_XDP_PASS)
                        goto requeue;
+               headroom = xdp.data - xdp.data_hard_start;
+               pkt_len = xdp.data_end - xdp.data;
        } else {
-               /* prepare skb and send to n/w stack */
-               skb = napi_build_skb(pa, PAGE_SIZE);
+               headroom = PRUETH_HEADROOM;
        }
 
+       /* prepare skb and send to n/w stack */
+       skb = napi_build_skb(pa, PAGE_SIZE);
        if (!skb) {
                ndev->stats.rx_dropped++;
                page_pool_recycle_direct(pool, page);
                goto requeue;
        }
 
-       skb_reserve(skb, PRUETH_HEADROOM);
+       skb_reserve(skb, headroom);
        skb_put(skb, pkt_len);
        skb->dev = ndev;