Merge branch 'there-are-some-cleanup-for-hns3-driver'
Jijie Shao says: ==================== There are some cleanup for hns3 driver v3: https://lore.kernel.org/20250621083310.52c8e7ae@kernel.org v2: https://lore.kernel.org/20250617010255.1183069-1-shaojijie@huawei.com v1: https://lore.kernel.org/20250612021317.1487943-1-shaojijie@huawei.com ==================== Link: https://patch.msgid.link/20250623040043.857782-1-shaojijie@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -348,7 +348,7 @@ static int hclge_comm_cmd_csq_clean(struct hclge_comm_hw *hw)
|
||||
static int hclge_comm_cmd_csq_done(struct hclge_comm_hw *hw)
|
||||
{
|
||||
u32 head = hclge_comm_read_dev(hw, HCLGE_COMM_NIC_CSQ_HEAD_REG);
|
||||
return head == hw->cmq.csq.next_to_use;
|
||||
return head == (u32)hw->cmq.csq.next_to_use;
|
||||
}
|
||||
|
||||
static u32 hclge_get_cmdq_tx_timeout(u16 opcode, u32 tx_timeout)
|
||||
|
||||
@@ -684,7 +684,7 @@ static int hns3_dbg_rx_queue_info(struct hnae3_handle *h,
|
||||
char *buf, int len)
|
||||
{
|
||||
char data_str[ARRAY_SIZE(rx_queue_info_items)][HNS3_DBG_DATA_STR_LEN];
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
|
||||
char *result[ARRAY_SIZE(rx_queue_info_items)];
|
||||
struct hns3_nic_priv *priv = h->priv;
|
||||
char content[HNS3_DBG_INFO_LEN];
|
||||
@@ -789,7 +789,7 @@ static int hns3_dbg_tx_queue_info(struct hnae3_handle *h,
|
||||
char *buf, int len)
|
||||
{
|
||||
char data_str[ARRAY_SIZE(tx_queue_info_items)][HNS3_DBG_DATA_STR_LEN];
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
|
||||
char *result[ARRAY_SIZE(tx_queue_info_items)];
|
||||
struct hns3_nic_priv *priv = h->priv;
|
||||
char content[HNS3_DBG_INFO_LEN];
|
||||
@@ -1034,7 +1034,7 @@ static int hns3_dbg_tx_bd_info(struct hns3_dbg_data *d, char *buf, int len)
|
||||
static void
|
||||
hns3_dbg_dev_caps(struct hnae3_handle *h, char *buf, int len, int *pos)
|
||||
{
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
|
||||
unsigned long *caps = ae_dev->caps;
|
||||
u32 i, state;
|
||||
|
||||
@@ -1239,7 +1239,7 @@ static const struct hns3_dbg_func hns3_dbg_cmd_func[] = {
|
||||
static int hns3_dbg_read_cmd(struct hns3_dbg_data *dbg_data,
|
||||
enum hnae3_dbg_cmd cmd, char *buf, int len)
|
||||
{
|
||||
const struct hnae3_ae_ops *ops = dbg_data->handle->ae_algo->ops;
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(dbg_data->handle);
|
||||
const struct hns3_dbg_func *cmd_func;
|
||||
u32 i;
|
||||
|
||||
@@ -1364,7 +1364,7 @@ hns3_dbg_common_file_init(struct hnae3_handle *handle, u32 cmd)
|
||||
|
||||
int hns3_dbg_init(struct hnae3_handle *handle)
|
||||
{
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
|
||||
const char *name = pci_name(handle->pdev);
|
||||
int ret;
|
||||
u32 i;
|
||||
|
||||
@@ -547,9 +547,9 @@ void hns3_set_vector_coalesce_rx_ql(struct hns3_enet_tqp_vector *tqp_vector,
|
||||
static void hns3_vector_coalesce_init(struct hns3_enet_tqp_vector *tqp_vector,
|
||||
struct hns3_nic_priv *priv)
|
||||
{
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(priv->ae_handle->pdev);
|
||||
struct hns3_enet_coalesce *tx_coal = &tqp_vector->tx_group.coal;
|
||||
struct hns3_enet_coalesce *rx_coal = &tqp_vector->rx_group.coal;
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(priv->ae_handle);
|
||||
struct hns3_enet_coalesce *ptx_coal = &priv->tx_coal;
|
||||
struct hns3_enet_coalesce *prx_coal = &priv->rx_coal;
|
||||
|
||||
@@ -960,7 +960,7 @@ static void hns3_nic_set_rx_mode(struct net_device *netdev)
|
||||
|
||||
void hns3_request_update_promisc_mode(struct hnae3_handle *handle)
|
||||
{
|
||||
const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
|
||||
|
||||
if (ops->request_update_promisc_mode)
|
||||
ops->request_update_promisc_mode(handle);
|
||||
@@ -1304,7 +1304,7 @@ static int hns3_get_l4_protocol(struct sk_buff *skb, u8 *ol4_proto,
|
||||
static bool hns3_tunnel_csum_bug(struct sk_buff *skb)
|
||||
{
|
||||
struct hns3_nic_priv *priv = netdev_priv(skb->dev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(priv->ae_handle->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(priv->ae_handle);
|
||||
union l4_hdr_info l4;
|
||||
|
||||
/* device version above V3(include V3), the hardware can
|
||||
@@ -1504,7 +1504,7 @@ static int hns3_handle_vtags(struct hns3_enet_ring *tx_ring,
|
||||
* VLAN enabled, only one VLAN header is allowed in skb, otherwise it
|
||||
* will cause RAS error.
|
||||
*/
|
||||
ae_dev = pci_get_drvdata(handle->pdev);
|
||||
ae_dev = hns3_get_ae_dev(handle);
|
||||
if (unlikely(skb_vlan_tagged_multi(skb) &&
|
||||
ae_dev->dev_version <= HNAE3_DEVICE_VERSION_V2 &&
|
||||
handle->port_base_vlan_state ==
|
||||
@@ -1690,8 +1690,8 @@ static int hns3_fill_desc(struct hns3_enet_ring *ring, dma_addr_t dma,
|
||||
#define HNS3_LIKELY_BD_NUM 1
|
||||
|
||||
struct hns3_desc *desc = &ring->desc[ring->next_to_use];
|
||||
unsigned int frag_buf_num;
|
||||
int k, sizeoflast;
|
||||
unsigned int frag_buf_num, k;
|
||||
int sizeoflast;
|
||||
|
||||
if (likely(size <= HNS3_MAX_BD_SIZE)) {
|
||||
desc->addr = cpu_to_le64(dma);
|
||||
@@ -1863,7 +1863,7 @@ static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size,
|
||||
unsigned int bd_num, u8 max_non_tso_bd_num)
|
||||
{
|
||||
unsigned int tot_len = 0;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < max_non_tso_bd_num - 1U; i++)
|
||||
tot_len += bd_size[i];
|
||||
@@ -1891,7 +1891,7 @@ static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size,
|
||||
|
||||
void hns3_shinfo_pack(struct skb_shared_info *shinfo, __u32 *size)
|
||||
{
|
||||
int i;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < MAX_SKB_FRAGS; i++)
|
||||
size[i] = skb_frag_size(&shinfo->frags[i]);
|
||||
@@ -2207,9 +2207,9 @@ static int hns3_handle_tx_sgl(struct hns3_enet_ring *ring,
|
||||
struct hns3_desc_cb *desc_cb = &ring->desc_cb[ring->next_to_use];
|
||||
u32 nfrag = skb_shinfo(skb)->nr_frags + 1;
|
||||
struct sg_table *sgt;
|
||||
int i, bd_num = 0;
|
||||
int bd_num = 0;
|
||||
dma_addr_t dma;
|
||||
u32 cb_len;
|
||||
u32 cb_len, i;
|
||||
int nents;
|
||||
|
||||
if (skb_has_frag_list(skb))
|
||||
@@ -2447,7 +2447,7 @@ static int hns3_nic_set_features(struct net_device *netdev,
|
||||
if ((netdev->features & NETIF_F_HW_TC) > (features & NETIF_F_HW_TC) &&
|
||||
h->ae_algo->ops->cls_flower_active(h)) {
|
||||
netdev_err(netdev,
|
||||
"there are offloaded TC filters active, cannot disable HW TC offload");
|
||||
"there are offloaded TC filters active, cannot disable HW TC offload\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -2544,7 +2544,7 @@ static void hns3_nic_get_stats64(struct net_device *netdev,
|
||||
struct hnae3_handle *handle = priv->ae_handle;
|
||||
struct rtnl_link_stats64 ring_total_stats;
|
||||
struct hns3_enet_ring *ring;
|
||||
unsigned int idx;
|
||||
int idx;
|
||||
|
||||
if (test_bit(HNS3_NIC_STATE_DOWN, &priv->state))
|
||||
return;
|
||||
@@ -2770,7 +2770,7 @@ static int hns3_nic_change_mtu(struct net_device *netdev, int new_mtu)
|
||||
|
||||
static int hns3_get_timeout_queue(struct net_device *ndev)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
/* Find the stopped queue the same way the stack does */
|
||||
for (i = 0; i < ndev->num_tx_queues; i++) {
|
||||
@@ -2851,7 +2851,7 @@ static bool hns3_get_tx_timeo_queue_info(struct net_device *ndev)
|
||||
struct hns3_nic_priv *priv = netdev_priv(ndev);
|
||||
struct hnae3_handle *h = hns3_get_handle(ndev);
|
||||
struct hns3_enet_ring *tx_ring;
|
||||
int timeout_queue;
|
||||
u32 timeout_queue;
|
||||
|
||||
timeout_queue = hns3_get_timeout_queue(ndev);
|
||||
if (timeout_queue >= ndev->num_tx_queues) {
|
||||
@@ -3821,7 +3821,7 @@ static int hns3_gro_complete(struct sk_buff *skb, u32 l234info)
|
||||
{
|
||||
__be16 type = skb->protocol;
|
||||
struct tcphdr *th;
|
||||
int depth = 0;
|
||||
u32 depth = 0;
|
||||
|
||||
while (eth_type_vlan(type)) {
|
||||
struct vlan_hdr *vh;
|
||||
@@ -4747,7 +4747,7 @@ map_ring_fail:
|
||||
|
||||
static void hns3_nic_init_coal_cfg(struct hns3_nic_priv *priv)
|
||||
{
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(priv->ae_handle->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(priv->ae_handle);
|
||||
struct hns3_enet_coalesce *tx_coal = &priv->tx_coal;
|
||||
struct hns3_enet_coalesce *rx_coal = &priv->rx_coal;
|
||||
|
||||
@@ -5226,7 +5226,7 @@ static void hns3_info_show(struct hns3_nic_priv *priv)
|
||||
static void hns3_set_cq_period_mode(struct hns3_nic_priv *priv,
|
||||
enum dim_cq_period_mode mode, bool is_tx)
|
||||
{
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(priv->ae_handle->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(priv->ae_handle);
|
||||
struct hnae3_handle *handle = priv->ae_handle;
|
||||
int i;
|
||||
|
||||
@@ -5264,7 +5264,7 @@ void hns3_cq_period_mode_init(struct hns3_nic_priv *priv,
|
||||
|
||||
static void hns3_state_init(struct hnae3_handle *handle)
|
||||
{
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
|
||||
struct net_device *netdev = handle->kinfo.netdev;
|
||||
struct hns3_nic_priv *priv = netdev_priv(netdev);
|
||||
|
||||
@@ -5934,7 +5934,7 @@ static const struct hns3_hw_error_info hns3_hw_err[] = {
|
||||
static void hns3_process_hw_error(struct hnae3_handle *handle,
|
||||
enum hnae3_hw_error_type type)
|
||||
{
|
||||
int i;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(hns3_hw_err); i++) {
|
||||
if (hns3_hw_err[i].type == type) {
|
||||
|
||||
@@ -621,7 +621,7 @@ struct hns3_reset_type_map {
|
||||
enum hnae3_reset_type rst_type;
|
||||
};
|
||||
|
||||
static inline int ring_space(struct hns3_enet_ring *ring)
|
||||
static inline u32 ring_space(struct hns3_enet_ring *ring)
|
||||
{
|
||||
/* This smp_load_acquire() pairs with smp_store_release() in
|
||||
* hns3_nic_reclaim_one_desc called by hns3_clean_tx_ring.
|
||||
@@ -692,7 +692,7 @@ static inline unsigned int hns3_page_order(struct hns3_enet_ring *ring)
|
||||
|
||||
/* iterator for handling rings in ring group */
|
||||
#define hns3_for_each_ring(pos, head) \
|
||||
for (pos = (head).ring; (pos); pos = (pos)->next)
|
||||
for ((pos) = (head).ring; (pos); (pos) = (pos)->next)
|
||||
|
||||
#define hns3_get_handle(ndev) \
|
||||
(((struct hns3_nic_priv *)netdev_priv(ndev))->ae_handle)
|
||||
|
||||
@@ -86,7 +86,7 @@ static int hns3_get_sset_count(struct net_device *netdev, int stringset);
|
||||
static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en)
|
||||
{
|
||||
struct hnae3_handle *h = hns3_get_handle(ndev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
|
||||
int ret;
|
||||
|
||||
if (!h->ae_algo->ops->set_loopback ||
|
||||
@@ -171,7 +171,7 @@ static void hns3_lp_setup_skb(struct sk_buff *skb)
|
||||
* the purpose of mac or serdes selftest.
|
||||
*/
|
||||
handle = hns3_get_handle(ndev);
|
||||
ae_dev = pci_get_drvdata(handle->pdev);
|
||||
ae_dev = hns3_get_ae_dev(handle);
|
||||
if (ae_dev->dev_version < HNAE3_DEVICE_VERSION_V2)
|
||||
ethh->h_dest[5] += HNS3_NIC_LB_DST_MAC_ADDR;
|
||||
eth_zero_addr(ethh->h_source);
|
||||
@@ -436,7 +436,7 @@ static void hns3_self_test(struct net_device *ndev,
|
||||
data[i] = HNS3_NIC_LB_TEST_UNEXECUTED;
|
||||
|
||||
if (hns3_nic_resetting(ndev)) {
|
||||
netdev_err(ndev, "dev resetting!");
|
||||
netdev_err(ndev, "dev resetting!\n");
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ static const struct hns3_pflag_desc hns3_priv_flags[HNAE3_PFLAG_MAX] = {
|
||||
static int hns3_get_sset_count(struct net_device *netdev, int stringset)
|
||||
{
|
||||
struct hnae3_handle *h = hns3_get_handle(netdev);
|
||||
const struct hnae3_ae_ops *ops = h->ae_algo->ops;
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(h);
|
||||
|
||||
if (!ops->get_sset_count)
|
||||
return -EOPNOTSUPP;
|
||||
@@ -540,8 +540,8 @@ static void hns3_get_strings_tqps(struct hnae3_handle *handle, u8 **data)
|
||||
static void hns3_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
|
||||
{
|
||||
struct hnae3_handle *h = hns3_get_handle(netdev);
|
||||
const struct hnae3_ae_ops *ops = h->ae_algo->ops;
|
||||
int i;
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(h);
|
||||
u32 i;
|
||||
|
||||
if (!ops->get_strings)
|
||||
return;
|
||||
@@ -569,7 +569,7 @@ static u64 *hns3_get_stats_tqps(struct hnae3_handle *handle, u64 *data)
|
||||
struct hns3_nic_priv *nic_priv = handle->priv;
|
||||
struct hns3_enet_ring *ring;
|
||||
u8 *stat;
|
||||
int i, j;
|
||||
u32 i, j;
|
||||
|
||||
/* get stats for Tx */
|
||||
for (i = 0; i < kinfo->num_tqps; i++) {
|
||||
@@ -692,7 +692,7 @@ static void hns3_get_pauseparam(struct net_device *netdev,
|
||||
struct ethtool_pauseparam *param)
|
||||
{
|
||||
struct hnae3_handle *h = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
|
||||
|
||||
if (!test_bit(HNAE3_DEV_SUPPORT_PAUSE_B, ae_dev->caps))
|
||||
return;
|
||||
@@ -706,7 +706,7 @@ static int hns3_set_pauseparam(struct net_device *netdev,
|
||||
struct ethtool_pauseparam *param)
|
||||
{
|
||||
struct hnae3_handle *h = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
|
||||
|
||||
if (!test_bit(HNAE3_DEV_SUPPORT_PAUSE_B, ae_dev->caps))
|
||||
return -EOPNOTSUPP;
|
||||
@@ -725,7 +725,7 @@ static int hns3_set_pauseparam(struct net_device *netdev,
|
||||
static void hns3_get_ksettings(struct hnae3_handle *h,
|
||||
struct ethtool_link_ksettings *cmd)
|
||||
{
|
||||
const struct hnae3_ae_ops *ops = h->ae_algo->ops;
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(h);
|
||||
|
||||
/* 1.auto_neg & speed & duplex from cmd */
|
||||
if (ops->get_ksettings_an_result)
|
||||
@@ -751,7 +751,7 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
|
||||
struct ethtool_link_ksettings *cmd)
|
||||
{
|
||||
struct hnae3_handle *h = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
|
||||
const struct hnae3_ae_ops *ops;
|
||||
u8 module_type;
|
||||
u8 media_type;
|
||||
@@ -794,7 +794,7 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
|
||||
break;
|
||||
default:
|
||||
|
||||
netdev_warn(netdev, "Unknown media type");
|
||||
netdev_warn(netdev, "Unknown media type\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -814,7 +814,7 @@ static int hns3_check_ksettings_param(const struct net_device *netdev,
|
||||
const struct ethtool_link_ksettings *cmd)
|
||||
{
|
||||
struct hnae3_handle *handle = hns3_get_handle(netdev);
|
||||
const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
|
||||
u8 module_type = HNAE3_MODULE_TYPE_UNKNOWN;
|
||||
u8 media_type = HNAE3_MEDIA_TYPE_UNKNOWN;
|
||||
u32 lane_num;
|
||||
@@ -842,7 +842,7 @@ static int hns3_check_ksettings_param(const struct net_device *netdev,
|
||||
if (cmd->base.duplex == DUPLEX_HALF &&
|
||||
media_type != HNAE3_MEDIA_TYPE_COPPER) {
|
||||
netdev_err(netdev,
|
||||
"only copper port supports half duplex!");
|
||||
"only copper port supports half duplex!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -861,8 +861,8 @@ static int hns3_set_link_ksettings(struct net_device *netdev,
|
||||
const struct ethtool_link_ksettings *cmd)
|
||||
{
|
||||
struct hnae3_handle *handle = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
|
||||
const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
|
||||
int ret;
|
||||
|
||||
/* Chip don't support this mode. */
|
||||
@@ -932,7 +932,7 @@ static u32 hns3_get_rss_key_size(struct net_device *netdev)
|
||||
static u32 hns3_get_rss_indir_size(struct net_device *netdev)
|
||||
{
|
||||
struct hnae3_handle *h = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
|
||||
|
||||
return ae_dev->dev_specs.rss_ind_tbl_size;
|
||||
}
|
||||
@@ -954,7 +954,7 @@ static int hns3_set_rss(struct net_device *netdev,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct hnae3_handle *h = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
|
||||
|
||||
if (!h->ae_algo->ops->set_rss)
|
||||
return -EOPNOTSUPP;
|
||||
@@ -1030,8 +1030,8 @@ static int hns3_set_reset(struct net_device *netdev, u32 *flags)
|
||||
{
|
||||
enum hnae3_reset_type rst_type = HNAE3_NONE_RESET;
|
||||
struct hnae3_handle *h = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
|
||||
const struct hnae3_ae_ops *ops = h->ae_algo->ops;
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(h);
|
||||
const struct hns3_reset_type_map *rst_type_map;
|
||||
enum ethtool_reset_flags rst_flags;
|
||||
u32 i, size;
|
||||
@@ -1195,7 +1195,7 @@ static int hns3_set_tx_push(struct net_device *netdev, u32 tx_push)
|
||||
{
|
||||
struct hns3_nic_priv *priv = netdev_priv(netdev);
|
||||
struct hnae3_handle *h = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
|
||||
u32 old_state = test_bit(HNS3_NIC_STATE_TX_PUSH_ENABLE, &priv->state);
|
||||
|
||||
if (!test_bit(HNAE3_DEV_SUPPORT_TX_PUSH_B, ae_dev->caps) && tx_push)
|
||||
@@ -1313,7 +1313,7 @@ static int hns3_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)
|
||||
static int hns3_nway_reset(struct net_device *netdev)
|
||||
{
|
||||
struct hnae3_handle *handle = hns3_get_handle(netdev);
|
||||
const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
|
||||
struct phy_device *phy = netdev->phydev;
|
||||
int autoneg;
|
||||
|
||||
@@ -1321,7 +1321,7 @@ static int hns3_nway_reset(struct net_device *netdev)
|
||||
return 0;
|
||||
|
||||
if (hns3_nic_resetting(netdev)) {
|
||||
netdev_err(netdev, "dev resetting!");
|
||||
netdev_err(netdev, "dev resetting!\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
@@ -1390,7 +1390,7 @@ static int hns3_check_gl_coalesce_para(struct net_device *netdev,
|
||||
struct ethtool_coalesce *cmd)
|
||||
{
|
||||
struct hnae3_handle *handle = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
|
||||
u32 rx_gl, tx_gl;
|
||||
|
||||
if (cmd->rx_coalesce_usecs > ae_dev->dev_specs.max_int_gl) {
|
||||
@@ -1462,7 +1462,7 @@ static int hns3_check_ql_coalesce_param(struct net_device *netdev,
|
||||
struct ethtool_coalesce *cmd)
|
||||
{
|
||||
struct hnae3_handle *handle = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
|
||||
|
||||
if ((cmd->tx_max_coalesced_frames || cmd->rx_max_coalesced_frames) &&
|
||||
!ae_dev->dev_specs.int_ql_max) {
|
||||
@@ -1486,7 +1486,7 @@ hns3_check_cqe_coalesce_param(struct net_device *netdev,
|
||||
struct kernel_ethtool_coalesce *kernel_coal)
|
||||
{
|
||||
struct hnae3_handle *handle = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
|
||||
|
||||
if ((kernel_coal->use_cqe_mode_tx || kernel_coal->use_cqe_mode_rx) &&
|
||||
!hnae3_ae_dev_cq_supported(ae_dev)) {
|
||||
@@ -1662,8 +1662,8 @@ static void hns3_get_fec_stats(struct net_device *netdev,
|
||||
struct ethtool_fec_stats *fec_stats)
|
||||
{
|
||||
struct hnae3_handle *handle = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
|
||||
const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
|
||||
|
||||
if (!hnae3_ae_dev_fec_stats_supported(ae_dev) || !ops->get_fec_stats)
|
||||
return;
|
||||
@@ -1713,8 +1713,8 @@ static int hns3_get_fecparam(struct net_device *netdev,
|
||||
struct ethtool_fecparam *fec)
|
||||
{
|
||||
struct hnae3_handle *handle = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
|
||||
const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
|
||||
u8 fec_ability;
|
||||
u8 fec_mode;
|
||||
|
||||
@@ -1738,8 +1738,8 @@ static int hns3_set_fecparam(struct net_device *netdev,
|
||||
struct ethtool_fecparam *fec)
|
||||
{
|
||||
struct hnae3_handle *handle = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
|
||||
const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
|
||||
u32 fec_mode;
|
||||
|
||||
if (!test_bit(HNAE3_DEV_SUPPORT_FEC_B, ae_dev->caps))
|
||||
@@ -1760,8 +1760,8 @@ static int hns3_get_module_info(struct net_device *netdev,
|
||||
#define HNS3_SFF_8636_V1_3 0x03
|
||||
|
||||
struct hnae3_handle *handle = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
|
||||
const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
|
||||
struct hns3_sfp_type sfp_type;
|
||||
int ret;
|
||||
|
||||
@@ -1810,8 +1810,8 @@ static int hns3_get_module_eeprom(struct net_device *netdev,
|
||||
struct ethtool_eeprom *ee, u8 *data)
|
||||
{
|
||||
struct hnae3_handle *handle = hns3_get_handle(netdev);
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
|
||||
const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
|
||||
struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
|
||||
const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
|
||||
|
||||
if (ae_dev->dev_version < HNAE3_DEVICE_VERSION_V2 ||
|
||||
!ops->get_module_eeprom)
|
||||
@@ -1937,7 +1937,7 @@ static int hns3_set_tunable(struct net_device *netdev,
|
||||
int i, ret = 0;
|
||||
|
||||
if (hns3_nic_resetting(netdev) || !priv->ring) {
|
||||
netdev_err(netdev, "failed to set tunable value, dev resetting!");
|
||||
netdev_err(netdev, "failed to set tunable value, dev resetting!\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
|
||||
@@ -830,10 +830,10 @@ hclge_dbg_dump_reg_tqp(struct hclge_dev *hdev,
|
||||
{
|
||||
const struct hclge_dbg_dfx_message *dfx_message = reg_info->dfx_msg;
|
||||
const struct hclge_dbg_reg_common_msg *reg_msg = ®_info->reg_msg;
|
||||
u32 index, entry, i, cnt, min_num;
|
||||
struct hclge_desc *desc_src;
|
||||
u32 index, entry, i, cnt;
|
||||
int bd_num, min_num, ret;
|
||||
struct hclge_desc *desc;
|
||||
int bd_num, ret;
|
||||
|
||||
ret = hclge_dbg_get_dfx_bd_num(hdev, reg_msg->offset, &bd_num);
|
||||
if (ret)
|
||||
@@ -885,9 +885,9 @@ hclge_dbg_dump_reg_common(struct hclge_dev *hdev,
|
||||
const struct hclge_dbg_reg_common_msg *reg_msg = ®_info->reg_msg;
|
||||
const struct hclge_dbg_dfx_message *dfx_message = reg_info->dfx_msg;
|
||||
struct hclge_desc *desc_src;
|
||||
int bd_num, min_num, ret;
|
||||
int bd_num, min_num, ret, i;
|
||||
struct hclge_desc *desc;
|
||||
u32 entry, i;
|
||||
u32 entry;
|
||||
|
||||
ret = hclge_dbg_get_dfx_bd_num(hdev, reg_msg->offset, &bd_num);
|
||||
if (ret)
|
||||
@@ -1279,7 +1279,7 @@ static int hclge_dbg_dump_reg_cmd(struct hclge_dev *hdev,
|
||||
{
|
||||
const struct hclge_dbg_reg_type_info *reg_info;
|
||||
int pos = 0, ret = 0;
|
||||
int i;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(hclge_dbg_reg_info); i++) {
|
||||
reg_info = &hclge_dbg_reg_info[i];
|
||||
@@ -2110,7 +2110,7 @@ static int hclge_dbg_dump_mng_table(struct hclge_dev *hdev, char *buf, int len)
|
||||
for (i = 0; i < HCLGE_DBG_MNG_TBL_MAX; i++) {
|
||||
hclge_cmd_setup_basic_desc(&desc, HCLGE_MAC_ETHERTYPE_IDX_RD,
|
||||
true);
|
||||
req0 = (struct hclge_mac_ethertype_idx_rd_cmd *)&desc.data;
|
||||
req0 = (struct hclge_mac_ethertype_idx_rd_cmd *)desc.data;
|
||||
req0->index = cpu_to_le16(i);
|
||||
|
||||
ret = hclge_cmd_send(&hdev->hw, &desc, 1);
|
||||
@@ -2648,9 +2648,8 @@ static void hclge_dbg_dump_mac_list(struct hclge_dev *hdev, char *buf, int len,
|
||||
struct hclge_mac_node *mac_node, *tmp;
|
||||
struct hclge_vport *vport;
|
||||
struct list_head *list;
|
||||
u32 func_id;
|
||||
u32 func_id, i;
|
||||
int pos = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(mac_list_items); i++)
|
||||
result[i] = &data_str[i][0];
|
||||
|
||||
@@ -582,7 +582,7 @@ static u64 *hclge_comm_get_stats(struct hclge_dev *hdev,
|
||||
int size, u64 *data)
|
||||
{
|
||||
u64 *buf = data;
|
||||
u32 i;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
if (strs[i].stats_num > hdev->ae_dev->dev_specs.mac_stats_num)
|
||||
@@ -599,7 +599,7 @@ static void hclge_comm_get_strings(struct hclge_dev *hdev, u32 stringset,
|
||||
const struct hclge_comm_stats_str strs[],
|
||||
int size, u8 **data)
|
||||
{
|
||||
u32 i;
|
||||
int i;
|
||||
|
||||
if (stringset != ETH_SS_STATS)
|
||||
return;
|
||||
@@ -2358,7 +2358,7 @@ static int hclge_common_thrd_config(struct hclge_dev *hdev,
|
||||
for (i = 0; i < 2; i++) {
|
||||
hclge_cmd_setup_basic_desc(&desc[i],
|
||||
HCLGE_OPC_RX_COM_THRD_ALLOC, false);
|
||||
req = (struct hclge_rx_com_thrd *)&desc[i].data;
|
||||
req = (struct hclge_rx_com_thrd *)desc[i].data;
|
||||
|
||||
/* The first descriptor set the NEXT bit to 1 */
|
||||
if (i == 0)
|
||||
@@ -2624,7 +2624,7 @@ int hclge_cfg_mac_speed_dup(struct hclge_dev *hdev, int speed, u8 duplex, u8 lan
|
||||
int ret;
|
||||
|
||||
duplex = hclge_check_speed_dup(duplex, speed);
|
||||
if (!mac->support_autoneg && mac->speed == speed &&
|
||||
if (!mac->support_autoneg && mac->speed == (u32)speed &&
|
||||
mac->duplex == duplex && (mac->lane_num == lane_num || lane_num == 0))
|
||||
return 0;
|
||||
|
||||
@@ -2652,7 +2652,7 @@ static int hclge_cfg_mac_speed_dup_h(struct hnae3_handle *handle, int speed,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
hdev->hw.mac.req_speed = speed;
|
||||
hdev->hw.mac.req_speed = (u32)speed;
|
||||
hdev->hw.mac.req_duplex = duplex;
|
||||
|
||||
return 0;
|
||||
@@ -3446,7 +3446,7 @@ static int hclge_tp_port_init(struct hclge_dev *hdev)
|
||||
static int hclge_update_port_info(struct hclge_dev *hdev)
|
||||
{
|
||||
struct hclge_mac *mac = &hdev->hw.mac;
|
||||
int speed;
|
||||
u32 speed;
|
||||
int ret;
|
||||
|
||||
/* get the port info from SFP cmd if not copper port */
|
||||
@@ -6989,7 +6989,7 @@ static int hclge_get_all_rules(struct hnae3_handle *handle,
|
||||
struct hclge_dev *hdev = vport->back;
|
||||
struct hclge_fd_rule *rule;
|
||||
struct hlist_node *node2;
|
||||
int cnt = 0;
|
||||
u32 cnt = 0;
|
||||
|
||||
if (!hnae3_ae_dev_fd_supported(hdev->ae_dev))
|
||||
return -EOPNOTSUPP;
|
||||
@@ -8223,14 +8223,14 @@ static int hclge_update_desc_vfid(struct hclge_desc *desc, int vfid, bool clr)
|
||||
word_num = vfid / 32;
|
||||
bit_num = vfid % 32;
|
||||
if (clr)
|
||||
desc[1].data[word_num] &= cpu_to_le32(~(1 << bit_num));
|
||||
desc[1].data[word_num] &= cpu_to_le32(~(1U << bit_num));
|
||||
else
|
||||
desc[1].data[word_num] |= cpu_to_le32(1 << bit_num);
|
||||
} else {
|
||||
word_num = (vfid - HCLGE_VF_NUM_IN_FIRST_DESC) / 32;
|
||||
bit_num = vfid % 32;
|
||||
if (clr)
|
||||
desc[2].data[word_num] &= cpu_to_le32(~(1 << bit_num));
|
||||
desc[2].data[word_num] &= cpu_to_le32(~(1U << bit_num));
|
||||
else
|
||||
desc[2].data[word_num] |= cpu_to_le32(1 << bit_num);
|
||||
}
|
||||
@@ -9292,7 +9292,7 @@ static int hclge_add_mgr_tbl(struct hclge_dev *hdev,
|
||||
static int init_mgr_tbl(struct hclge_dev *hdev)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(hclge_mgr_table); i++) {
|
||||
ret = hclge_add_mgr_tbl(hdev, &hclge_mgr_table[i]);
|
||||
@@ -10713,7 +10713,7 @@ int hclge_set_vport_mtu(struct hclge_vport *vport, int new_mtu)
|
||||
max_frm_size = max(max_frm_size, HCLGE_MAC_DEFAULT_FRAME);
|
||||
mutex_lock(&hdev->vport_lock);
|
||||
/* VF's mps must fit within hdev->mps */
|
||||
if (vport->vport_id && max_frm_size > hdev->mps) {
|
||||
if (vport->vport_id && (u32)max_frm_size > hdev->mps) {
|
||||
mutex_unlock(&hdev->vport_lock);
|
||||
return -EINVAL;
|
||||
} else if (vport->vport_id) {
|
||||
@@ -10724,7 +10724,7 @@ int hclge_set_vport_mtu(struct hclge_vport *vport, int new_mtu)
|
||||
|
||||
/* PF's mps must be greater then VF's mps */
|
||||
for (i = 1; i < hdev->num_alloc_vport; i++)
|
||||
if (max_frm_size < hdev->vport[i].mps) {
|
||||
if ((u32)max_frm_size < hdev->vport[i].mps) {
|
||||
dev_err(&hdev->pdev->dev,
|
||||
"failed to set pf mtu for less than vport %d, mps = %u.\n",
|
||||
i, hdev->vport[i].mps);
|
||||
@@ -11214,7 +11214,7 @@ static int hclge_init_nic_client_instance(struct hnae3_ae_dev *ae_dev,
|
||||
{
|
||||
struct hnae3_client *client = vport->nic.client;
|
||||
struct hclge_dev *hdev = ae_dev->priv;
|
||||
int rst_cnt = hdev->rst_stats.reset_cnt;
|
||||
u32 rst_cnt = hdev->rst_stats.reset_cnt;
|
||||
int ret;
|
||||
|
||||
ret = client->ops->init_instance(&vport->nic);
|
||||
@@ -11258,7 +11258,7 @@ static int hclge_init_roce_client_instance(struct hnae3_ae_dev *ae_dev,
|
||||
{
|
||||
struct hclge_dev *hdev = ae_dev->priv;
|
||||
struct hnae3_client *client;
|
||||
int rst_cnt;
|
||||
u32 rst_cnt;
|
||||
int ret;
|
||||
|
||||
if (!hnae3_dev_roce_supported(hdev) || !hdev->roce_client ||
|
||||
@@ -11423,7 +11423,7 @@ static int hclge_pci_init(struct hclge_dev *hdev)
|
||||
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev,
|
||||
"can't set consistent PCI DMA");
|
||||
"can't set consistent PCI DMA\n");
|
||||
goto err_disable_device;
|
||||
}
|
||||
dev_warn(&pdev->dev, "set DMA mask to 32 bits\n");
|
||||
@@ -12088,7 +12088,7 @@ static int hclge_vf_rate_param_check(struct hclge_dev *hdev,
|
||||
int min_tx_rate, int max_tx_rate)
|
||||
{
|
||||
if (min_tx_rate != 0 ||
|
||||
max_tx_rate < 0 || max_tx_rate > hdev->hw.mac.max_speed) {
|
||||
max_tx_rate < 0 || (u32)max_tx_rate > hdev->hw.mac.max_speed) {
|
||||
dev_err(&hdev->pdev->dev,
|
||||
"min_tx_rate:%d [0], max_tx_rate:%d [0, %u]\n",
|
||||
min_tx_rate, max_tx_rate, hdev->hw.mac.max_speed);
|
||||
@@ -12113,7 +12113,7 @@ static int hclge_set_vf_rate(struct hnae3_handle *handle, int vf,
|
||||
if (!vport)
|
||||
return -EINVAL;
|
||||
|
||||
if (!force && max_tx_rate == vport->vf_info.max_tx_rate)
|
||||
if (!force && (u32)max_tx_rate == vport->vf_info.max_tx_rate)
|
||||
return 0;
|
||||
|
||||
ret = hclge_tm_qs_shaper_cfg(vport, max_tx_rate);
|
||||
|
||||
@@ -749,16 +749,17 @@ static int hclge_get_rss_key(struct hclge_vport *vport,
|
||||
#define HCLGE_RSS_MBX_RESP_LEN 8
|
||||
struct hclge_dev *hdev = vport->back;
|
||||
struct hclge_comm_rss_cfg *rss_cfg;
|
||||
int rss_hash_key_size;
|
||||
u8 index;
|
||||
|
||||
index = mbx_req->msg.data[0];
|
||||
rss_cfg = &hdev->rss_cfg;
|
||||
rss_hash_key_size = sizeof(rss_cfg->rss_hash_key);
|
||||
|
||||
/* Check the query index of rss_hash_key from VF, make sure no
|
||||
* more than the size of rss_hash_key.
|
||||
*/
|
||||
if (((index + 1) * HCLGE_RSS_MBX_RESP_LEN) >
|
||||
sizeof(rss_cfg->rss_hash_key)) {
|
||||
if (((index + 1) * HCLGE_RSS_MBX_RESP_LEN) > rss_hash_key_size) {
|
||||
dev_warn(&hdev->pdev->dev,
|
||||
"failed to get the rss hash key, the index(%u) invalid !\n",
|
||||
index);
|
||||
@@ -800,7 +801,7 @@ static void hclge_handle_link_change_event(struct hclge_dev *hdev,
|
||||
|
||||
static bool hclge_cmd_crq_empty(struct hclge_hw *hw)
|
||||
{
|
||||
u32 tail = hclge_read_dev(hw, HCLGE_COMM_NIC_CRQ_TAIL_REG);
|
||||
int tail = hclge_read_dev(hw, HCLGE_COMM_NIC_CRQ_TAIL_REG);
|
||||
|
||||
return tail == hw->hw.cmq.crq.next_to_use;
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ int hclge_mac_mdio_config(struct hclge_dev *hdev)
|
||||
|
||||
mdio_bus->parent = &hdev->pdev->dev;
|
||||
mdio_bus->priv = hdev;
|
||||
mdio_bus->phy_mask = ~(1 << mac->phy_addr);
|
||||
mdio_bus->phy_mask = ~(1U << mac->phy_addr);
|
||||
ret = mdiobus_register(mdio_bus);
|
||||
if (ret) {
|
||||
dev_err(mdio_bus->parent,
|
||||
|
||||
@@ -25,7 +25,7 @@ struct ifreq;
|
||||
#define HCLGE_PTP_TIME_SEC_H_MASK GENMASK(15, 0)
|
||||
#define HCLGE_PTP_TIME_SEC_L_REG 0x54
|
||||
#define HCLGE_PTP_TIME_NSEC_REG 0x58
|
||||
#define HCLGE_PTP_TIME_NSEC_MASK GENMASK(29, 0)
|
||||
#define HCLGE_PTP_TIME_NSEC_MASK 0x3fffffffLL
|
||||
#define HCLGE_PTP_TIME_NSEC_NEG BIT(31)
|
||||
#define HCLGE_PTP_TIME_SYNC_REG 0x5C
|
||||
#define HCLGE_PTP_TIME_SYNC_EN BIT(0)
|
||||
|
||||
@@ -2465,7 +2465,7 @@ static int hclgevf_init_nic_client_instance(struct hnae3_ae_dev *ae_dev,
|
||||
struct hnae3_client *client)
|
||||
{
|
||||
struct hclgevf_dev *hdev = ae_dev->priv;
|
||||
int rst_cnt = hdev->rst_stats.rst_cnt;
|
||||
u32 rst_cnt = hdev->rst_stats.rst_cnt;
|
||||
int ret;
|
||||
|
||||
ret = client->ops->init_instance(&hdev->nic);
|
||||
@@ -2625,7 +2625,7 @@ static int hclgevf_pci_init(struct hclgevf_dev *hdev)
|
||||
|
||||
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "can't set consistent PCI DMA, exiting");
|
||||
dev_err(&pdev->dev, "can't set consistent PCI DMA, exiting\n");
|
||||
goto err_disable_device;
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ static bool hclgevf_cmd_crq_empty(struct hclgevf_hw *hw)
|
||||
{
|
||||
u32 tail = hclgevf_read_dev(hw, HCLGE_COMM_NIC_CRQ_TAIL_REG);
|
||||
|
||||
return tail == hw->hw.cmq.crq.next_to_use;
|
||||
return tail == (u32)hw->hw.cmq.crq.next_to_use;
|
||||
}
|
||||
|
||||
static void hclgevf_handle_mbx_response(struct hclgevf_dev *hdev,
|
||||
|
||||
@@ -127,37 +127,38 @@ void hclgevf_get_regs(struct hnae3_handle *handle, u32 *version,
|
||||
|
||||
struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
|
||||
struct hnae3_queue *tqp;
|
||||
int i, j, reg_um;
|
||||
int i, j, reg_num;
|
||||
u32 *reg = data;
|
||||
|
||||
*version = hdev->fw_version;
|
||||
reg += hclgevf_reg_get_header(reg);
|
||||
|
||||
/* fetching per-VF registers values from VF PCIe register space */
|
||||
reg_um = ARRAY_SIZE(cmdq_reg_addr_list);
|
||||
reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_CMDQ, reg_um, reg);
|
||||
for (i = 0; i < reg_um; i++)
|
||||
reg_num = ARRAY_SIZE(cmdq_reg_addr_list);
|
||||
reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_CMDQ, reg_num, reg);
|
||||
for (i = 0; i < reg_num; i++)
|
||||
*reg++ = hclgevf_read_dev(&hdev->hw, cmdq_reg_addr_list[i]);
|
||||
|
||||
reg_um = ARRAY_SIZE(common_reg_addr_list);
|
||||
reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_COMMON, reg_um, reg);
|
||||
for (i = 0; i < reg_um; i++)
|
||||
reg_num = ARRAY_SIZE(common_reg_addr_list);
|
||||
reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_COMMON, reg_num, reg);
|
||||
for (i = 0; i < reg_num; i++)
|
||||
*reg++ = hclgevf_read_dev(&hdev->hw, common_reg_addr_list[i]);
|
||||
|
||||
reg_um = ARRAY_SIZE(ring_reg_addr_list);
|
||||
reg_num = ARRAY_SIZE(ring_reg_addr_list);
|
||||
for (j = 0; j < hdev->num_tqps; j++) {
|
||||
reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_RING, reg_um, reg);
|
||||
reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_RING, reg_num, reg);
|
||||
tqp = &hdev->htqp[j].q;
|
||||
for (i = 0; i < reg_um; i++)
|
||||
for (i = 0; i < reg_num; i++)
|
||||
*reg++ = readl_relaxed(tqp->io_base -
|
||||
HCLGEVF_TQP_REG_OFFSET +
|
||||
ring_reg_addr_list[i]);
|
||||
}
|
||||
|
||||
reg_um = ARRAY_SIZE(tqp_intr_reg_addr_list);
|
||||
reg_num = ARRAY_SIZE(tqp_intr_reg_addr_list);
|
||||
for (j = 0; j < hdev->num_msi_used - 1; j++) {
|
||||
reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_TQP_INTR, reg_um, reg);
|
||||
for (i = 0; i < reg_um; i++)
|
||||
reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_TQP_INTR,
|
||||
reg_num, reg);
|
||||
for (i = 0; i < reg_num; i++)
|
||||
*reg++ = hclgevf_read_dev(&hdev->hw,
|
||||
tqp_intr_reg_addr_list[i] +
|
||||
HCLGEVF_RING_INT_REG_OFFSET * j);
|
||||
|
||||
Reference in New Issue
Block a user