Skip to content

Commit 1ae26bf

Browse files
rogerqdavem330
authored andcommitted
net: ethernet: ti: am65_cpsw: remove cpu argument am65_cpsw_run_xdp
am65_cpsw_run_xdp() can figure out the cpu id itself. No need to pass it around 2 functions so drop it. Signed-off-by: Roger Quadros <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9a369ae commit 1ae26bf

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/net/ethernet/ti/am65-cpsw-nuss.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,14 +1167,14 @@ static int am65_cpsw_xdp_tx_frame(struct net_device *ndev,
11671167

11681168
static int am65_cpsw_run_xdp(struct am65_cpsw_rx_flow *flow,
11691169
struct am65_cpsw_port *port,
1170-
struct xdp_buff *xdp,
1171-
int cpu, int *len)
1170+
struct xdp_buff *xdp, int *len)
11721171
{
11731172
struct am65_cpsw_common *common = flow->common;
11741173
struct net_device *ndev = port->ndev;
11751174
int ret = AM65_CPSW_XDP_CONSUMED;
11761175
struct am65_cpsw_tx_chn *tx_chn;
11771176
struct netdev_queue *netif_txq;
1177+
int cpu = smp_processor_id();
11781178
struct xdp_frame *xdpf;
11791179
struct bpf_prog *prog;
11801180
struct page *page;
@@ -1274,7 +1274,7 @@ static void am65_cpsw_nuss_rx_csum(struct sk_buff *skb, u32 csum_info)
12741274
}
12751275

12761276
static int am65_cpsw_nuss_rx_packets(struct am65_cpsw_rx_flow *flow,
1277-
int cpu, int *xdp_state)
1277+
int *xdp_state)
12781278
{
12791279
struct am65_cpsw_rx_chn *rx_chn = &flow->common->rx_chns;
12801280
u32 buf_dma_len, pkt_len, port_id = 0, csum_info;
@@ -1334,8 +1334,7 @@ static int am65_cpsw_nuss_rx_packets(struct am65_cpsw_rx_flow *flow,
13341334
xdp_init_buff(&xdp, PAGE_SIZE, &port->xdp_rxq[flow->id]);
13351335
xdp_prepare_buff(&xdp, page_addr, AM65_CPSW_HEADROOM,
13361336
pkt_len, false);
1337-
*xdp_state = am65_cpsw_run_xdp(flow, port, &xdp,
1338-
cpu, &pkt_len);
1337+
*xdp_state = am65_cpsw_run_xdp(flow, port, &xdp, &pkt_len);
13391338
if (*xdp_state != AM65_CPSW_XDP_PASS)
13401339
goto allocate;
13411340

@@ -1401,7 +1400,6 @@ static int am65_cpsw_nuss_rx_poll(struct napi_struct *napi_rx, int budget)
14011400
{
14021401
struct am65_cpsw_rx_flow *flow = am65_cpsw_napi_to_rx_flow(napi_rx);
14031402
struct am65_cpsw_common *common = flow->common;
1404-
int cpu = smp_processor_id();
14051403
int xdp_state_or = 0;
14061404
int cur_budget, ret;
14071405
int xdp_state;
@@ -1410,7 +1408,7 @@ static int am65_cpsw_nuss_rx_poll(struct napi_struct *napi_rx, int budget)
14101408
/* process only this flow */
14111409
cur_budget = budget;
14121410
while (cur_budget--) {
1413-
ret = am65_cpsw_nuss_rx_packets(flow, cpu, &xdp_state);
1411+
ret = am65_cpsw_nuss_rx_packets(flow, &xdp_state);
14141412
xdp_state_or |= xdp_state;
14151413
if (ret)
14161414
break;

0 commit comments

Comments
 (0)