From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com,
Jakub Kicinski <kuba@kernel.org>,
Aaron Brown <aaron.f.brown@intel.com>
Subject: [PATCH net-next v2 06/10] ice: remove unused args from ice_get_open_tunnel_port()
Date: Fri, 25 Sep 2020 17:56:45 -0700 [thread overview]
Message-ID: <20200926005649.3285089-7-kuba@kernel.org> (raw)
In-Reply-To: <20200926005649.3285089-1-kuba@kernel.org>
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>
---
drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c | 6 ++----
drivers/net/ethernet/intel/ice/ice_fdir.c | 2 +-
drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 7 ++-----
drivers/net/ethernet/intel/ice/ice_flex_pipe.h | 3 +--
4 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c
index d7430ce6af26..2d27f66ac853 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c
@@ -1268,8 +1268,7 @@ ice_fdir_write_all_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input,
bool is_tun = tun == ICE_FD_HW_SEG_TUN;
int err;
- if (is_tun && !ice_get_open_tunnel_port(&pf->hw, TNL_ALL,
- &port_num))
+ if (is_tun && !ice_get_open_tunnel_port(&pf->hw, &port_num))
continue;
err = ice_fdir_write_fltr(pf, input, add, is_tun);
if (err)
@@ -1647,8 +1646,7 @@ int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd)
}
/* return error if not an update and no available filters */
- fltrs_needed = ice_get_open_tunnel_port(hw, TNL_ALL, &tunnel_port) ?
- 2 : 1;
+ fltrs_needed = ice_get_open_tunnel_port(hw, &tunnel_port) ? 2 : 1;
if (!ice_fdir_find_fltr_by_idx(hw, fsp->location) &&
ice_fdir_num_avail_fltr(hw, pf->vsi[vsi->idx]) < fltrs_needed) {
dev_err(dev, "Failed to add filter. The maximum number of flow director filters has been reached.\n");
diff --git a/drivers/net/ethernet/intel/ice/ice_fdir.c b/drivers/net/ethernet/intel/ice/ice_fdir.c
index 6834df14332f..59c0c6a0f8c5 100644
--- a/drivers/net/ethernet/intel/ice/ice_fdir.c
+++ b/drivers/net/ethernet/intel/ice/ice_fdir.c
@@ -556,7 +556,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
memcpy(pkt, ice_fdir_pkt[idx].pkt, ice_fdir_pkt[idx].pkt_len);
loc = pkt;
} else {
- if (!ice_get_open_tunnel_port(hw, TNL_ALL, &tnl_port))
+ if (!ice_get_open_tunnel_port(hw, &tnl_port))
return ICE_ERR_DOES_NOT_EXIST;
if (!ice_fdir_pkt[idx].tun_pkt)
return ICE_ERR_PARAM;
diff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c
index b17ae3e20157..a90be061e552 100644
--- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c
+++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c
@@ -1696,12 +1696,10 @@ ice_find_free_tunnel_entry(struct ice_hw *hw, enum ice_tunnel_type type,
/**
* ice_get_open_tunnel_port - retrieve an open tunnel port
* @hw: pointer to the HW structure
- * @type: tunnel type (TNL_ALL will return any open port)
* @port: returns open port
*/
bool
-ice_get_open_tunnel_port(struct ice_hw *hw, enum ice_tunnel_type type,
- u16 *port)
+ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port)
{
bool res = false;
u16 i;
@@ -1709,8 +1707,7 @@ ice_get_open_tunnel_port(struct ice_hw *hw, enum ice_tunnel_type type,
mutex_lock(&hw->tnl_lock);
for (i = 0; i < hw->tnl.count && i < ICE_TUNNEL_MAX_ENTRIES; i++)
- if (hw->tnl.tbl[i].valid && hw->tnl.tbl[i].in_use &&
- (type == TNL_ALL || hw->tnl.tbl[i].type == type)) {
+ if (hw->tnl.tbl[i].valid && hw->tnl.tbl[i].in_use) {
*port = hw->tnl.tbl[i].port;
res = true;
break;
diff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.h b/drivers/net/ethernet/intel/ice/ice_flex_pipe.h
index 568ea519af51..a18c87d9d9b1 100644
--- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.h
+++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.h
@@ -19,8 +19,7 @@
#define ICE_PKG_CNT 4
bool
-ice_get_open_tunnel_port(struct ice_hw *hw, enum ice_tunnel_type type,
- u16 *port);
+ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port);
enum ice_status
ice_create_tunnel(struct ice_hw *hw, enum ice_tunnel_type type, u16 port);
enum ice_status ice_destroy_tunnel(struct ice_hw *hw, u16 port, bool all);
--
2.26.2
next prev parent reply other threads:[~2020-09-26 0:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-26 0:56 [PATCH net-next v2 00/10] udp_tunnel: convert Intel drivers with shared tables Jakub Kicinski
2020-09-26 0:56 ` [PATCH net-next v2 01/10] udp_tunnel: add the ability to share port tables Jakub Kicinski
2020-09-26 0:56 ` [PATCH net-next v2 02/10] netdevsim: add warnings on unexpected UDP tunnel port errors Jakub Kicinski
2020-09-26 0:56 ` [PATCH net-next v2 03/10] netdevsim: shared UDP tunnel port table support Jakub Kicinski
2020-09-26 0:56 ` [PATCH net-next v2 04/10] selftests: net: add a test for shared UDP tunnel info tables Jakub Kicinski
2020-09-26 0:56 ` [PATCH net-next v2 05/10] i40e: convert to new udp_tunnel infrastructure Jakub Kicinski
2020-09-26 0:56 ` Jakub Kicinski [this message]
2020-09-26 0:56 ` [PATCH net-next v2 07/10] ice: " Jakub Kicinski
2020-09-26 0:56 ` [PATCH net-next v2 08/10] netdevsim: support the static IANA VXLAN port flag Jakub Kicinski
2020-09-26 0:56 ` [PATCH net-next v2 09/10] selftests: net: add a test for static UDP tunnel ports Jakub Kicinski
2020-09-26 0:56 ` [PATCH net-next v2 10/10] docs: vxlan: add info about device features Jakub Kicinski
2020-09-28 16:23 ` [PATCH net-next v2 00/10] udp_tunnel: convert Intel drivers with shared tables Nguyen, Anthony L
2020-09-28 19:49 ` David Miller
2020-09-28 19:50 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200926005649.3285089-7-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=aaron.f.brown@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).