aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLisheng <lisheng011@huawei.com>2016-03-28 06:40:57 -0400
committerDavid S. Miller <davem@davemloft.net>2016-03-28 11:39:16 -0400
commit9832ce4c0bb90e4dcedf4280947341b1eb6728e6 (patch)
tree9bf472819f1ded8315787852c97ab2e3afafe50c
parent43adc067c5a070a5ef97d0c25e33df19c4481484 (diff)
net: hns: set-coalesce-usecs returns errno by dsaf.ko
It may fail to set coalesce usecs to HW, and Ethtool needs to know if it is successful to cfg the parameter or not. So it needs return the errno by dsaf.ko. Signed-off-by: Lisheng <lisheng011@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hnae.h2
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c6
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_ethtool.c6
3 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.h b/drivers/net/ethernet/hisilicon/hns/hnae.h
index 37d0cce392be..e8d36aaea223 100644
--- a/drivers/net/ethernet/hisilicon/hns/hnae.h
+++ b/drivers/net/ethernet/hisilicon/hns/hnae.h
@@ -469,7 +469,7 @@ struct hnae_ae_ops {
469 u32 *tx_usecs, u32 *rx_usecs); 469 u32 *tx_usecs, u32 *rx_usecs);
470 void (*get_rx_max_coalesced_frames)(struct hnae_handle *handle, 470 void (*get_rx_max_coalesced_frames)(struct hnae_handle *handle,
471 u32 *tx_frames, u32 *rx_frames); 471 u32 *tx_frames, u32 *rx_frames);
472 void (*set_coalesce_usecs)(struct hnae_handle *handle, u32 timeout); 472 int (*set_coalesce_usecs)(struct hnae_handle *handle, u32 timeout);
473 int (*set_coalesce_frames)(struct hnae_handle *handle, 473 int (*set_coalesce_frames)(struct hnae_handle *handle,
474 u32 coalesce_frames); 474 u32 coalesce_frames);
475 void (*set_promisc_mode)(struct hnae_handle *handle, u32 en); 475 void (*set_promisc_mode)(struct hnae_handle *handle, u32 en);
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
index 1dd1d6974d47..a1cb461ac45f 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
@@ -469,13 +469,13 @@ static void hns_ae_get_rx_max_coalesced_frames(struct hnae_handle *handle,
469 ring_pair->port_id_in_comm); 469 ring_pair->port_id_in_comm);
470} 470}
471 471
472static void hns_ae_set_coalesce_usecs(struct hnae_handle *handle, 472static int hns_ae_set_coalesce_usecs(struct hnae_handle *handle,
473 u32 timeout) 473 u32 timeout)
474{ 474{
475 struct ring_pair_cb *ring_pair = 475 struct ring_pair_cb *ring_pair =
476 container_of(handle->qs[0], struct ring_pair_cb, q); 476 container_of(handle->qs[0], struct ring_pair_cb, q);
477 477
478 (void)hns_rcb_set_coalesce_usecs( 478 return hns_rcb_set_coalesce_usecs(
479 ring_pair->rcb_common, ring_pair->port_id_in_comm, timeout); 479 ring_pair->rcb_common, ring_pair->port_id_in_comm, timeout);
480} 480}
481 481
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
index 0e7da3f0a564..3d746c887873 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
@@ -794,8 +794,10 @@ static int hns_set_coalesce(struct net_device *net_dev,
794 (!ops->set_coalesce_frames)) 794 (!ops->set_coalesce_frames))
795 return -ESRCH; 795 return -ESRCH;
796 796
797 ops->set_coalesce_usecs(priv->ae_handle, 797 ret = ops->set_coalesce_usecs(priv->ae_handle,
798 ec->rx_coalesce_usecs); 798 ec->rx_coalesce_usecs);
799 if (ret)
800 return ret;
799 801
800 ret = ops->set_coalesce_frames( 802 ret = ops->set_coalesce_frames(
801 priv->ae_handle, 803 priv->ae_handle,