Skip to content

Commit f049b82

Browse files
kuba-moodavem330
authored andcommitted
ice: remove unused args from ice_get_open_tunnel_port()
ice_get_open_tunnel_port() is always passed TNL_ALL as the second parameter. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 40a98cb commit f049b82

4 files changed

Lines changed: 6 additions & 12 deletions

File tree

‎drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,8 +1268,7 @@ ice_fdir_write_all_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input,
12681268
bool is_tun = tun == ICE_FD_HW_SEG_TUN;
12691269
int err;
12701270

1271-
if (is_tun && !ice_get_open_tunnel_port(&pf->hw, TNL_ALL,
1272-
&port_num))
1271+
if (is_tun && !ice_get_open_tunnel_port(&pf->hw, &port_num))
12731272
continue;
12741273
err = ice_fdir_write_fltr(pf, input, add, is_tun);
12751274
if (err)
@@ -1647,8 +1646,7 @@ int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd)
16471646
}
16481647

16491648
/* return error if not an update and no available filters */
1650-
fltrs_needed = ice_get_open_tunnel_port(hw, TNL_ALL, &tunnel_port) ?
1651-
2 : 1;
1649+
fltrs_needed = ice_get_open_tunnel_port(hw, &tunnel_port) ? 2 : 1;
16521650
if (!ice_fdir_find_fltr_by_idx(hw, fsp->location) &&
16531651
ice_fdir_num_avail_fltr(hw, pf->vsi[vsi->idx]) < fltrs_needed) {
16541652
dev_err(dev, "Failed to add filter. The maximum number of flow director filters has been reached.\n");

‎drivers/net/ethernet/intel/ice/ice_fdir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
556556
memcpy(pkt, ice_fdir_pkt[idx].pkt, ice_fdir_pkt[idx].pkt_len);
557557
loc = pkt;
558558
} else {
559-
if (!ice_get_open_tunnel_port(hw, TNL_ALL, &tnl_port))
559+
if (!ice_get_open_tunnel_port(hw, &tnl_port))
560560
return ICE_ERR_DOES_NOT_EXIST;
561561
if (!ice_fdir_pkt[idx].tun_pkt)
562562
return ICE_ERR_PARAM;

‎drivers/net/ethernet/intel/ice/ice_flex_pipe.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,21 +1696,18 @@ ice_find_free_tunnel_entry(struct ice_hw *hw, enum ice_tunnel_type type,
16961696
/**
16971697
* ice_get_open_tunnel_port - retrieve an open tunnel port
16981698
* @hw: pointer to the HW structure
1699-
* @type: tunnel type (TNL_ALL will return any open port)
17001699
* @port: returns open port
17011700
*/
17021701
bool
1703-
ice_get_open_tunnel_port(struct ice_hw *hw, enum ice_tunnel_type type,
1704-
u16 *port)
1702+
ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port)
17051703
{
17061704
bool res = false;
17071705
u16 i;
17081706

17091707
mutex_lock(&hw->tnl_lock);
17101708

17111709
for (i = 0; i < hw->tnl.count && i < ICE_TUNNEL_MAX_ENTRIES; i++)
1712-
if (hw->tnl.tbl[i].valid && hw->tnl.tbl[i].in_use &&
1713-
(type == TNL_ALL || hw->tnl.tbl[i].type == type)) {
1710+
if (hw->tnl.tbl[i].valid && hw->tnl.tbl[i].in_use) {
17141711
*port = hw->tnl.tbl[i].port;
17151712
res = true;
17161713
break;

‎drivers/net/ethernet/intel/ice/ice_flex_pipe.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
#define ICE_PKG_CNT 4
2020

2121
bool
22-
ice_get_open_tunnel_port(struct ice_hw *hw, enum ice_tunnel_type type,
23-
u16 *port);
22+
ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port);
2423
enum ice_status
2524
ice_create_tunnel(struct ice_hw *hw, enum ice_tunnel_type type, u16 port);
2625
enum ice_status ice_destroy_tunnel(struct ice_hw *hw, u16 port, bool all);

0 commit comments

Comments
 (0)