All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ethernet: Remove vf rate limit check for drivers
@ 2022-06-09  8:47 Simon Horman
  2022-06-11  5:22 ` Jakub Kicinski
  2022-06-11  5:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Horman @ 2022-06-09  8:47 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski, Paolo Abeni
  Cc: Michael Chan, Jesse Brandeburg, Tony Nguyen, Shahed Shaikh,
	Manish Chopra, Bin Chen, GR-Linux-NIC-Dev, netdev, oss-drivers

From: Bin Chen <bin.chen@corigine.com>

The commit a14857c27a50 ("rtnetlink: verify rate parameters for calls to
ndo_set_vf_rate") has been merged to master, so we can to remove the
now-duplicate checks in drivers.

Signed-off-by: Bin Chen <bin.chen@corigine.com>
Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c      |  2 +-
 drivers/net/ethernet/huawei/hinic/hinic_sriov.c      |  6 ------
 drivers/net/ethernet/intel/ice/ice_sriov.c           | 10 ----------
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c |  6 ++----
 4 files changed, 3 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index ddf2f3963abe..c4ed43604ddc 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -307,7 +307,7 @@ int bnxt_set_vf_bw(struct net_device *dev, int vf_id, int min_tx_rate,
 		return -EINVAL;
 	}
 
-	if (min_tx_rate > pf_link_speed || min_tx_rate > max_tx_rate) {
+	if (min_tx_rate > pf_link_speed) {
 		netdev_info(bp->dev, "min tx rate %d is invalid for VF %d\n",
 			    min_tx_rate, vf_id);
 		return -EINVAL;
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_sriov.c b/drivers/net/ethernet/huawei/hinic/hinic_sriov.c
index 01e7d3c0b68e..df555847afb5 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_sriov.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_sriov.c
@@ -852,12 +852,6 @@ int hinic_ndo_set_vf_bw(struct net_device *netdev,
 		return -EINVAL;
 	}
 
-	if (max_tx_rate < min_tx_rate) {
-		netif_err(nic_dev, drv, netdev, "Max rate %d must be greater than or equal to min rate %d\n",
-			  max_tx_rate, min_tx_rate);
-		return -EINVAL;
-	}
-
 	err = hinic_port_link_state(nic_dev, &link_state);
 	if (err) {
 		netif_err(nic_dev, drv, netdev,
diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c
index bb1721f1321d..86093b2511d8 100644
--- a/drivers/net/ethernet/intel/ice/ice_sriov.c
+++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
@@ -1593,16 +1593,6 @@ ice_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate,
 		goto out_put_vf;
 	}
 
-	/* when max_tx_rate is zero that means no max Tx rate limiting, so only
-	 * check if max_tx_rate is non-zero
-	 */
-	if (max_tx_rate && min_tx_rate > max_tx_rate) {
-		dev_err(dev, "Cannot set min Tx rate %d Mbps greater than max Tx rate %d Mbps\n",
-			min_tx_rate, max_tx_rate);
-		ret = -EINVAL;
-		goto out_put_vf;
-	}
-
 	if (min_tx_rate && ice_is_dcb_active(pf)) {
 		dev_err(dev, "DCB on PF is currently enabled. VF min Tx rate limiting not allowed on this PF.\n");
 		ret = -EOPNOTSUPP;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
index e90fa97c0ae6..8dd7aa08ecfb 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
@@ -1869,8 +1869,7 @@ int qlcnic_sriov_set_vf_tx_rate(struct net_device *netdev, int vf,
 	if (!min_tx_rate)
 		min_tx_rate = QLC_VF_MIN_TX_RATE;
 
-	if (max_tx_rate &&
-	    (max_tx_rate >= 10000 || max_tx_rate < min_tx_rate)) {
+	if (max_tx_rate && max_tx_rate >= 10000) {
 		netdev_err(netdev,
 			   "Invalid max Tx rate, allowed range is [%d - %d]",
 			   min_tx_rate, QLC_VF_MAX_TX_RATE);
@@ -1880,8 +1879,7 @@ int qlcnic_sriov_set_vf_tx_rate(struct net_device *netdev, int vf,
 	if (!max_tx_rate)
 		max_tx_rate = 10000;
 
-	if (min_tx_rate &&
-	    (min_tx_rate > max_tx_rate || min_tx_rate < QLC_VF_MIN_TX_RATE)) {
+	if (min_tx_rate && min_tx_rate < QLC_VF_MIN_TX_RATE) {
 		netdev_err(netdev,
 			   "Invalid min Tx rate, allowed range is [%d - %d]",
 			   QLC_VF_MIN_TX_RATE, max_tx_rate);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] ethernet: Remove vf rate limit check for drivers
  2022-06-09  8:47 [PATCH net-next] ethernet: Remove vf rate limit check for drivers Simon Horman
@ 2022-06-11  5:22 ` Jakub Kicinski
  2022-06-12  7:50   ` Simon Horman
  2022-06-11  5:30 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2022-06-11  5:22 UTC (permalink / raw)
  To: Simon Horman, Bin Chen
  Cc: David Miller, Paolo Abeni, Michael Chan, Jesse Brandeburg,
	Tony Nguyen, Shahed Shaikh, Manish Chopra, GR-Linux-NIC-Dev,
	netdev, oss-drivers

On Thu,  9 Jun 2022 10:47:17 +0200 Simon Horman wrote:
> From: Bin Chen <bin.chen@corigine.com>
> 
> The commit a14857c27a50 ("rtnetlink: verify rate parameters for calls to
> ndo_set_vf_rate") has been merged to master, so we can to remove the
> now-duplicate checks in drivers.

Thanks for the follow up!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] ethernet: Remove vf rate limit check for drivers
  2022-06-09  8:47 [PATCH net-next] ethernet: Remove vf rate limit check for drivers Simon Horman
  2022-06-11  5:22 ` Jakub Kicinski
@ 2022-06-11  5:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-06-11  5:30 UTC (permalink / raw)
  To: Simon Horman
  Cc: davem, kuba, pabeni, michael.chan, jesse.brandeburg,
	anthony.l.nguyen, shshaikh, manishc, bin.chen, GR-Linux-NIC-Dev,
	netdev, oss-drivers

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu,  9 Jun 2022 10:47:17 +0200 you wrote:
> From: Bin Chen <bin.chen@corigine.com>
> 
> The commit a14857c27a50 ("rtnetlink: verify rate parameters for calls to
> ndo_set_vf_rate") has been merged to master, so we can to remove the
> now-duplicate checks in drivers.
> 
> Signed-off-by: Bin Chen <bin.chen@corigine.com>
> Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
> Signed-off-by: Simon Horman <simon.horman@corigine.com>
> 
> [...]

Here is the summary with links:
  - [net-next] ethernet: Remove vf rate limit check for drivers
    https://git.kernel.org/netdev/net-next/c/10e11aa241b6

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] ethernet: Remove vf rate limit check for drivers
  2022-06-11  5:22 ` Jakub Kicinski
@ 2022-06-12  7:50   ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2022-06-12  7:50 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Bin Chen, David Miller, Paolo Abeni, Michael Chan,
	Jesse Brandeburg, Tony Nguyen, Shahed Shaikh, Manish Chopra,
	GR-Linux-NIC-Dev, netdev, oss-drivers

On Fri, Jun 10, 2022 at 10:22:32PM -0700, Jakub Kicinski wrote:
> On Thu,  9 Jun 2022 10:47:17 +0200 Simon Horman wrote:
> > From: Bin Chen <bin.chen@corigine.com>
> > 
> > The commit a14857c27a50 ("rtnetlink: verify rate parameters for calls to
> > ndo_set_vf_rate") has been merged to master, so we can to remove the
> > now-duplicate checks in drivers.
> 
> Thanks for the follow up!

Happy to help :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-12  7:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09  8:47 [PATCH net-next] ethernet: Remove vf rate limit check for drivers Simon Horman
2022-06-11  5:22 ` Jakub Kicinski
2022-06-12  7:50   ` Simon Horman
2022-06-11  5:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.