Skip to content

Commit

Permalink
net: hns: set-coalesce-usecs returns errno by dsaf.ko
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lisheng authored and David S. Miller committed Mar 28, 2016
1 parent 43adc06 commit 9832ce4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/hisilicon/hns/hnae.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ struct hnae_ae_ops {
u32 *tx_usecs, u32 *rx_usecs);
void (*get_rx_max_coalesced_frames)(struct hnae_handle *handle,
u32 *tx_frames, u32 *rx_frames);
void (*set_coalesce_usecs)(struct hnae_handle *handle, u32 timeout);
int (*set_coalesce_usecs)(struct hnae_handle *handle, u32 timeout);
int (*set_coalesce_frames)(struct hnae_handle *handle,
u32 coalesce_frames);
void (*set_promisc_mode)(struct hnae_handle *handle, u32 en);
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,13 @@ static void hns_ae_get_rx_max_coalesced_frames(struct hnae_handle *handle,
ring_pair->port_id_in_comm);
}

static void hns_ae_set_coalesce_usecs(struct hnae_handle *handle,
u32 timeout)
static int hns_ae_set_coalesce_usecs(struct hnae_handle *handle,
u32 timeout)
{
struct ring_pair_cb *ring_pair =
container_of(handle->qs[0], struct ring_pair_cb, q);

(void)hns_rcb_set_coalesce_usecs(
return hns_rcb_set_coalesce_usecs(
ring_pair->rcb_common, ring_pair->port_id_in_comm, timeout);
}

Expand Down
6 changes: 4 additions & 2 deletions drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,10 @@ static int hns_set_coalesce(struct net_device *net_dev,
(!ops->set_coalesce_frames))
return -ESRCH;

ops->set_coalesce_usecs(priv->ae_handle,
ec->rx_coalesce_usecs);
ret = ops->set_coalesce_usecs(priv->ae_handle,
ec->rx_coalesce_usecs);
if (ret)
return ret;

ret = ops->set_coalesce_frames(
priv->ae_handle,
Expand Down

0 comments on commit 9832ce4

Please sign in to comment.