]> git.baikalelectronics.ru Git - kernel.git/commitdiff
xdp: Rename convert_to_xdp_frame in xdp_convert_buff_to_frame
authorLorenzo Bianconi <lorenzo@kernel.org>
Thu, 28 May 2020 20:47:29 +0000 (22:47 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 1 Jun 2020 22:02:53 +0000 (15:02 -0700)
In order to use standard 'xdp' prefix, rename convert_to_xdp_frame
utility routine in xdp_convert_buff_to_frame and replace all the
occurrences

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Link: https://lore.kernel.org/bpf/6344f739be0d1a08ab2b9607584c4d5478c8c083.1590698295.git.lorenzo@kernel.org
16 files changed:
drivers/net/ethernet/amazon/ena/ena_netdev.c
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/ice/ice_txrx_lib.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
drivers/net/ethernet/marvell/mvneta.c
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
drivers/net/ethernet/sfc/rx.c
drivers/net/ethernet/socionext/netsec.c
drivers/net/ethernet/ti/cpsw_priv.c
drivers/net/tun.c
drivers/net/veth.c
drivers/net/virtio_net.c
include/net/xdp.h
kernel/bpf/cpumap.c
kernel/bpf/devmap.c

index 46865d5bd7e70d04848cd9afc085fc8ee444781d..a0af74c939715984665a95dfd7362ad3fbe70e81 100644 (file)
@@ -263,7 +263,7 @@ static int ena_xdp_tx_map_buff(struct ena_ring *xdp_ring,
        dma_addr_t dma = 0;
        u32 size;
 
-       tx_info->xdpf = convert_to_xdp_frame(xdp);
+       tx_info->xdpf = xdp_convert_buff_to_frame(xdp);
        size = tx_info->xdpf->len;
        ena_buf = tx_info->bufs;
 
index f613782f2f56f8e07377607c5cdc58a13bcb549b..f9555c847f7373516ae7b622998e670520c2ba03 100644 (file)
@@ -2167,7 +2167,7 @@ static int i40e_xmit_xdp_ring(struct xdp_frame *xdpf,
 
 int i40e_xmit_xdp_tx_ring(struct xdp_buff *xdp, struct i40e_ring *xdp_ring)
 {
-       struct xdp_frame *xdpf = convert_to_xdp_frame(xdp);
+       struct xdp_frame *xdpf = xdp_convert_buff_to_frame(xdp);
 
        if (unlikely(!xdpf))
                return I40E_XDP_CONSUMED;
index ab2031b1c6359e80720106f7a932049cc159a3c4..02b12736ea80d4551d3d3460339eb0706941d22f 100644 (file)
@@ -254,7 +254,7 @@ int ice_xmit_xdp_ring(void *data, u16 size, struct ice_ring *xdp_ring)
  */
 int ice_xmit_xdp_buff(struct xdp_buff *xdp, struct ice_ring *xdp_ring)
 {
-       struct xdp_frame *xdpf = convert_to_xdp_frame(xdp);
+       struct xdp_frame *xdpf = xdp_convert_buff_to_frame(xdp);
 
        if (unlikely(!xdpf))
                return ICE_XDP_CONSUMED;
index a59c166f794f5501ad0544ccc4824f132153ed21..f162b8b8f34585fbfd1688b48d099d9cdda3ddd4 100644 (file)
@@ -2215,7 +2215,7 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter,
        case XDP_PASS:
                break;
        case XDP_TX:
-               xdpf = convert_to_xdp_frame(xdp);
+               xdpf = xdp_convert_buff_to_frame(xdp);
                if (unlikely(!xdpf)) {
                        result = IXGBE_XDP_CONSUMED;
                        break;
index 86add9fbd36c46b7fb61363ee175fb9fbb9479f5..be9d2a8da51521623d56fb48294b25da3abd66e3 100644 (file)
@@ -107,7 +107,7 @@ static int ixgbe_run_xdp_zc(struct ixgbe_adapter *adapter,
        case XDP_PASS:
                break;
        case XDP_TX:
-               xdpf = convert_to_xdp_frame(xdp);
+               xdpf = xdp_convert_buff_to_frame(xdp);
                if (unlikely(!xdpf)) {
                        result = IXGBE_XDP_CONSUMED;
                        break;
index 15e42a7f8a86d17a5bf15407fbf46416f6e9666c..011cd26953d934394ddd261678e19b77d13ba112 100644 (file)
@@ -2073,7 +2073,7 @@ mvneta_xdp_xmit_back(struct mvneta_port *pp, struct xdp_buff *xdp)
        int cpu;
        u32 ret;
 
-       xdpf = convert_to_xdp_frame(xdp);
+       xdpf = xdp_convert_buff_to_frame(xdp);
        if (unlikely(!xdpf))
                return MVNETA_XDP_DROPPED;
 
index 3bea1d4be53b7f832824b80ff2c2edc3078deef6..c9d308e919655543091092dc1e4102b71db6b60e 100644 (file)
@@ -64,7 +64,7 @@ mlx5e_xmit_xdp_buff(struct mlx5e_xdpsq *sq, struct mlx5e_rq *rq,
        struct xdp_frame *xdpf;
        dma_addr_t dma_addr;
 
-       xdpf = convert_to_xdp_frame(xdp);
+       xdpf = xdp_convert_buff_to_frame(xdp);
        if (unlikely(!xdpf))
                return false;
 
@@ -97,10 +97,10 @@ mlx5e_xmit_xdp_buff(struct mlx5e_xdpsq *sq, struct mlx5e_rq *rq,
                xdpi.frame.xdpf     = xdpf;
                xdpi.frame.dma_addr = dma_addr;
        } else {
-               /* Driver assumes that convert_to_xdp_frame returns an xdp_frame
-                * that points to the same memory region as the original
-                * xdp_buff. It allows to map the memory only once and to use
-                * the DMA_BIDIRECTIONAL mode.
+               /* Driver assumes that xdp_convert_buff_to_frame returns
+                * an xdp_frame that points to the same memory region as
+                * the original xdp_buff. It allows to map the memory only
+                * once and to use the DMA_BIDIRECTIONAL mode.
                 */
 
                xdpi.mode = MLX5E_XDP_XMIT_MODE_PAGE;
index 68c47a8c71df4bade2cf4fce34c919c21ecca9c7..c01916cff5076e4015fa77e1904ecc8177253fe2 100644 (file)
@@ -329,7 +329,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel,
 
        case XDP_TX:
                /* Buffer ownership passes to tx on success. */
-               xdpf = convert_to_xdp_frame(&xdp);
+               xdpf = xdp_convert_buff_to_frame(&xdp);
                err = efx_xdp_tx_buffers(efx, 1, &xdpf, true);
                if (unlikely(err != 1)) {
                        efx_free_rx_buffers(rx_queue, rx_buf, 1);
index e1f4be4b3d69debf90c12cf2bdf8c99016bea2a9..328bc38848bb3a12fc1a8e288c19f11db8cc9328 100644 (file)
@@ -867,7 +867,7 @@ static u32 netsec_xdp_queue_one(struct netsec_priv *priv,
 static u32 netsec_xdp_xmit_back(struct netsec_priv *priv, struct xdp_buff *xdp)
 {
        struct netsec_desc_ring *tx_ring = &priv->desc_ring[NETSEC_RING_TX];
-       struct xdp_frame *xdpf = convert_to_xdp_frame(xdp);
+       struct xdp_frame *xdpf = xdp_convert_buff_to_frame(xdp);
        u32 ret;
 
        if (unlikely(!xdpf))
index d940628bff8d3250d4ec3245d67228588f61e1f2..a399f3659346eeb75acec4af6f4a55ad4bd3c4b3 100644 (file)
@@ -1355,7 +1355,7 @@ int cpsw_run_xdp(struct cpsw_priv *priv, int ch, struct xdp_buff *xdp,
                ret = CPSW_XDP_PASS;
                break;
        case XDP_TX:
-               xdpf = convert_to_xdp_frame(xdp);
+               xdpf = xdp_convert_buff_to_frame(xdp);
                if (unlikely(!xdpf))
                        goto drop;
 
index b0ab882c021e7c2747e8c05b90a3e28adad51eee..858b012074bd1e733ccaf6255dd733a6eef432b1 100644 (file)
@@ -1295,7 +1295,7 @@ resample:
 
 static int tun_xdp_tx(struct net_device *dev, struct xdp_buff *xdp)
 {
-       struct xdp_frame *frame = convert_to_xdp_frame(xdp);
+       struct xdp_frame *frame = xdp_convert_buff_to_frame(xdp);
 
        if (unlikely(!frame))
                return -EOVERFLOW;
index fb5c17361f6439c48e13beced9327bd1d621cb77..b594f03eeddba986dc04fa1353a3cf9561fd0d32 100644 (file)
@@ -541,7 +541,7 @@ out:
 static int veth_xdp_tx(struct veth_rq *rq, struct xdp_buff *xdp,
                       struct veth_xdp_tx_bq *bq)
 {
-       struct xdp_frame *frame = convert_to_xdp_frame(xdp);
+       struct xdp_frame *frame = xdp_convert_buff_to_frame(xdp);
 
        if (unlikely(!frame))
                return -EOVERFLOW;
index b6951aa76295035f289f24a743bcf6f87c78c8d7..ba38765dc4905aa9c461fb49e75a47e6440f81ec 100644 (file)
@@ -703,7 +703,7 @@ static struct sk_buff *receive_small(struct net_device *dev,
                        break;
                case XDP_TX:
                        stats->xdp_tx++;
-                       xdpf = convert_to_xdp_frame(&xdp);
+                       xdpf = xdp_convert_buff_to_frame(&xdp);
                        if (unlikely(!xdpf))
                                goto err_xdp;
                        err = virtnet_xdp_xmit(dev, 1, &xdpf, 0);
@@ -892,7 +892,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
                        break;
                case XDP_TX:
                        stats->xdp_tx++;
-                       xdpf = convert_to_xdp_frame(&xdp);
+                       xdpf = xdp_convert_buff_to_frame(&xdp);
                        if (unlikely(!xdpf))
                                goto err_xdp;
                        err = virtnet_xdp_xmit(dev, 1, &xdpf, 0);
index db5c2c687f48fdecd1b948be2ac4e09ecf9c3337..609f819ed08bc0127b061758a6dbc244f1b636f5 100644 (file)
@@ -123,7 +123,7 @@ void xdp_convert_frame_to_buff(struct xdp_frame *frame, struct xdp_buff *xdp)
 
 /* Convert xdp_buff to xdp_frame */
 static inline
-struct xdp_frame *convert_to_xdp_frame(struct xdp_buff *xdp)
+struct xdp_frame *xdp_convert_buff_to_frame(struct xdp_buff *xdp)
 {
        struct xdp_frame *xdp_frame;
        int metasize;
index 8b85bfddfac7e5b3dd79a7f26a2f2d6669d26fe6..27595fc6da56b18eb0dfee3fa24366c2f70ca7aa 100644 (file)
@@ -621,7 +621,7 @@ int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_buff *xdp,
 {
        struct xdp_frame *xdpf;
 
-       xdpf = convert_to_xdp_frame(xdp);
+       xdpf = xdp_convert_buff_to_frame(xdp);
        if (unlikely(!xdpf))
                return -EOVERFLOW;
 
index c04fb1c72f5e8bb9333af337ae1f41208f79b0cc..854b09beb16bb0f0e8bc2a0b4e221de388bce0a1 100644 (file)
@@ -465,7 +465,7 @@ static inline int __xdp_enqueue(struct net_device *dev, struct xdp_buff *xdp,
        if (unlikely(err))
                return err;
 
-       xdpf = convert_to_xdp_frame(xdp);
+       xdpf = xdp_convert_buff_to_frame(xdp);
        if (unlikely(!xdpf))
                return -EOVERFLOW;