Skip to content

Commit 4635fd3

Browse files
Kaaameanguy11
authored andcommitted
iavf: Disallow changing rx/tx-frames and rx/tx-frames-irq
Remove from supported_coalesce_params ETHTOOL_COALESCE_MAX_FRAMES and ETHTOOL_COALESCE_MAX_FRAMES_IRQ. As tx-frames-irq allowed user to change budget for iavf_clean_tx_irq, remove work_limit and use define for budget. Without this patch there would be possibility to change rx/tx-frames and rx/tx-frames-irq, which for rx/tx-frames did nothing, while for rx/tx-frames-irq it changed rx/tx-frames and only changed budget for cleaning NAPI poll. Fixes: fbb7ddf ("i40evf: core ethtool functionality") Signed-off-by: Przemyslaw Patynowski <[email protected]> Signed-off-by: Jun Zhang <[email protected]> Tested-by: Marek Szlosek <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 968996c commit 4635fd3

File tree

4 files changed

+1
-13
lines changed

4 files changed

+1
-13
lines changed

drivers/net/ethernet/intel/iavf/iavf.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ struct iavf_vsi {
6464
u16 id;
6565
DECLARE_BITMAP(state, __IAVF_VSI_STATE_SIZE__);
6666
int base_vector;
67-
u16 work_limit;
6867
u16 qs_handle;
6968
void *priv; /* client driver data reference. */
7069
};

drivers/net/ethernet/intel/iavf/iavf_ethtool.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -692,12 +692,8 @@ static int __iavf_get_coalesce(struct net_device *netdev,
692692
struct ethtool_coalesce *ec, int queue)
693693
{
694694
struct iavf_adapter *adapter = netdev_priv(netdev);
695-
struct iavf_vsi *vsi = &adapter->vsi;
696695
struct iavf_ring *rx_ring, *tx_ring;
697696

698-
ec->tx_max_coalesced_frames = vsi->work_limit;
699-
ec->rx_max_coalesced_frames = vsi->work_limit;
700-
701697
/* Rx and Tx usecs per queue value. If user doesn't specify the
702698
* queue, return queue 0's value to represent.
703699
*/
@@ -825,12 +821,8 @@ static int __iavf_set_coalesce(struct net_device *netdev,
825821
struct ethtool_coalesce *ec, int queue)
826822
{
827823
struct iavf_adapter *adapter = netdev_priv(netdev);
828-
struct iavf_vsi *vsi = &adapter->vsi;
829824
int i;
830825

831-
if (ec->tx_max_coalesced_frames_irq || ec->rx_max_coalesced_frames_irq)
832-
vsi->work_limit = ec->tx_max_coalesced_frames_irq;
833-
834826
if (ec->rx_coalesce_usecs == 0) {
835827
if (ec->use_adaptive_rx_coalesce)
836828
netif_info(adapter, drv, netdev, "rx-usecs=0, need to disable adaptive-rx for a complete disable\n");
@@ -1969,8 +1961,6 @@ static int iavf_set_rxfh(struct net_device *netdev, const u32 *indir,
19691961

19701962
static const struct ethtool_ops iavf_ethtool_ops = {
19711963
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
1972-
ETHTOOL_COALESCE_MAX_FRAMES |
1973-
ETHTOOL_COALESCE_MAX_FRAMES_IRQ |
19741964
ETHTOOL_COALESCE_USE_ADAPTIVE,
19751965
.get_drvinfo = iavf_get_drvinfo,
19761966
.get_link = ethtool_op_get_link,

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2240,7 +2240,6 @@ int iavf_parse_vf_resource_msg(struct iavf_adapter *adapter)
22402240

22412241
adapter->vsi.back = adapter;
22422242
adapter->vsi.base_vector = 1;
2243-
adapter->vsi.work_limit = IAVF_DEFAULT_IRQ_WORK;
22442243
vsi->netdev = adapter->netdev;
22452244
vsi->qs_handle = adapter->vsi_res->qset_handle;
22462245
if (adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) {

drivers/net/ethernet/intel/iavf/iavf_txrx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static bool iavf_clean_tx_irq(struct iavf_vsi *vsi,
194194
struct iavf_tx_buffer *tx_buf;
195195
struct iavf_tx_desc *tx_desc;
196196
unsigned int total_bytes = 0, total_packets = 0;
197-
unsigned int budget = vsi->work_limit;
197+
unsigned int budget = IAVF_DEFAULT_IRQ_WORK;
198198

199199
tx_buf = &tx_ring->tx_bi[i];
200200
tx_desc = IAVF_TX_DESC(tx_ring, i);

0 commit comments

Comments
 (0)