Skip to content

Commit 46515fd

Browse files
Björn TöpelJeff Kirsher
authored andcommitted
ixgbe: move common Rx functions to ixgbe_txrx_common.h
This patch prepares for the upcoming zero-copy Rx functionality, by moving/changing linkage of common functions, used both by the regular path and zero-copy path. Signed-off-by: Björn Töpel <[email protected]> Tested-by: William Tu <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 024aa58 commit 46515fd

File tree

2 files changed

+37
-18
lines changed

2 files changed

+37
-18
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "ixgbe_dcb_82599.h"
4141
#include "ixgbe_sriov.h"
4242
#include "ixgbe_model.h"
43+
#include "ixgbe_txrx_common.h"
4344

4445
char ixgbe_driver_name[] = "ixgbe";
4546
static const char ixgbe_driver_string[] =
@@ -1673,9 +1674,9 @@ static void ixgbe_update_rsc_stats(struct ixgbe_ring *rx_ring,
16731674
* order to populate the hash, checksum, VLAN, timestamp, protocol, and
16741675
* other fields within the skb.
16751676
**/
1676-
static void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring,
1677-
union ixgbe_adv_rx_desc *rx_desc,
1678-
struct sk_buff *skb)
1677+
void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring,
1678+
union ixgbe_adv_rx_desc *rx_desc,
1679+
struct sk_buff *skb)
16791680
{
16801681
struct net_device *dev = rx_ring->netdev;
16811682
u32 flags = rx_ring->q_vector->adapter->flags;
@@ -1708,8 +1709,8 @@ static void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring,
17081709
skb->protocol = eth_type_trans(skb, dev);
17091710
}
17101711

1711-
static void ixgbe_rx_skb(struct ixgbe_q_vector *q_vector,
1712-
struct sk_buff *skb)
1712+
void ixgbe_rx_skb(struct ixgbe_q_vector *q_vector,
1713+
struct sk_buff *skb)
17131714
{
17141715
napi_gro_receive(&q_vector->napi, skb);
17151716
}
@@ -1868,9 +1869,9 @@ static void ixgbe_dma_sync_frag(struct ixgbe_ring *rx_ring,
18681869
*
18691870
* Returns true if an error was encountered and skb was freed.
18701871
**/
1871-
static bool ixgbe_cleanup_headers(struct ixgbe_ring *rx_ring,
1872-
union ixgbe_adv_rx_desc *rx_desc,
1873-
struct sk_buff *skb)
1872+
bool ixgbe_cleanup_headers(struct ixgbe_ring *rx_ring,
1873+
union ixgbe_adv_rx_desc *rx_desc,
1874+
struct sk_buff *skb)
18741875
{
18751876
struct net_device *netdev = rx_ring->netdev;
18761877

@@ -2186,14 +2187,6 @@ static struct sk_buff *ixgbe_build_skb(struct ixgbe_ring *rx_ring,
21862187
return skb;
21872188
}
21882189

2189-
#define IXGBE_XDP_PASS 0
2190-
#define IXGBE_XDP_CONSUMED BIT(0)
2191-
#define IXGBE_XDP_TX BIT(1)
2192-
#define IXGBE_XDP_REDIR BIT(2)
2193-
2194-
static int ixgbe_xmit_xdp_ring(struct ixgbe_adapter *adapter,
2195-
struct xdp_frame *xdpf);
2196-
21972190
static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter,
21982191
struct ixgbe_ring *rx_ring,
21992192
struct xdp_buff *xdp)
@@ -8469,8 +8462,8 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb,
84698462
}
84708463

84718464
#endif
8472-
static int ixgbe_xmit_xdp_ring(struct ixgbe_adapter *adapter,
8473-
struct xdp_frame *xdpf)
8465+
int ixgbe_xmit_xdp_ring(struct ixgbe_adapter *adapter,
8466+
struct xdp_frame *xdpf)
84748467
{
84758468
struct ixgbe_ring *ring = adapter->xdp_ring[smp_processor_id()];
84768469
struct ixgbe_tx_buffer *tx_buffer;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/* Copyright(c) 2018 Intel Corporation. */
3+
4+
#ifndef _IXGBE_TXRX_COMMON_H_
5+
#define _IXGBE_TXRX_COMMON_H_
6+
7+
#define IXGBE_XDP_PASS 0
8+
#define IXGBE_XDP_CONSUMED BIT(0)
9+
#define IXGBE_XDP_TX BIT(1)
10+
#define IXGBE_XDP_REDIR BIT(2)
11+
12+
int ixgbe_xmit_xdp_ring(struct ixgbe_adapter *adapter,
13+
struct xdp_frame *xdpf);
14+
bool ixgbe_cleanup_headers(struct ixgbe_ring *rx_ring,
15+
union ixgbe_adv_rx_desc *rx_desc,
16+
struct sk_buff *skb);
17+
void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring,
18+
union ixgbe_adv_rx_desc *rx_desc,
19+
struct sk_buff *skb);
20+
void ixgbe_rx_skb(struct ixgbe_q_vector *q_vector,
21+
struct sk_buff *skb);
22+
23+
void ixgbe_txrx_ring_disable(struct ixgbe_adapter *adapter, int ring);
24+
void ixgbe_txrx_ring_enable(struct ixgbe_adapter *adapter, int ring);
25+
26+
#endif /* #define _IXGBE_TXRX_COMMON_H_ */

0 commit comments

Comments
 (0)