ALSA: hda/realtek - Move some alc236 pintbls to fallback table
[sfrench/cifs-2.6.git] / include / net / xdp.h
index 8e0deddef35cf1df5d75eb0e6a781c57337a5fda..40c6d3398458f62519e7c0f0b967db4eec55679a 100644 (file)
@@ -129,6 +129,21 @@ void xdp_return_frame(struct xdp_frame *xdpf);
 void xdp_return_frame_rx_napi(struct xdp_frame *xdpf);
 void xdp_return_buff(struct xdp_buff *xdp);
 
+/* When sending xdp_frame into the network stack, then there is no
+ * return point callback, which is needed to release e.g. DMA-mapping
+ * resources with page_pool.  Thus, have explicit function to release
+ * frame resources.
+ */
+void __xdp_release_frame(void *data, struct xdp_mem_info *mem);
+static inline void xdp_release_frame(struct xdp_frame *xdpf)
+{
+       struct xdp_mem_info *mem = &xdpf->mem;
+
+       /* Curr only page_pool needs this */
+       if (mem->type == MEM_TYPE_PAGE_POOL)
+               __xdp_release_frame(xdpf->data, mem);
+}
+
 int xdp_rxq_info_reg(struct xdp_rxq_info *xdp_rxq,
                     struct net_device *dev, u32 queue_index);
 void xdp_rxq_info_unreg(struct xdp_rxq_info *xdp_rxq);