Commit 360ea6fc authored by David S. Miller's avatar David S. Miller

Merge branch 'net-hns3-misc-updates'

Huazhong Tan says:

====================
net: hns3: misc updates

There are some misc updates for the HNS3 ethernet driver.

====================

Reviewed-by: Jakub Kicinski <kuba@kernel.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c1f1f16c 2c7bcc1d
...@@ -623,20 +623,6 @@ void hns3_request_update_promisc_mode(struct hnae3_handle *handle) ...@@ -623,20 +623,6 @@ void hns3_request_update_promisc_mode(struct hnae3_handle *handle)
ops->request_update_promisc_mode(handle); ops->request_update_promisc_mode(handle);
} }
int hns3_update_promisc_mode(struct net_device *netdev, u8 promisc_flags)
{
struct hns3_nic_priv *priv = netdev_priv(netdev);
struct hnae3_handle *h = priv->ae_handle;
if (h->ae_algo->ops->set_promisc_mode) {
return h->ae_algo->ops->set_promisc_mode(h,
promisc_flags & HNAE3_UPE,
promisc_flags & HNAE3_MPE);
}
return 0;
}
void hns3_enable_vlan_filter(struct net_device *netdev, bool enable) void hns3_enable_vlan_filter(struct net_device *netdev, bool enable)
{ {
struct hns3_nic_priv *priv = netdev_priv(netdev); struct hns3_nic_priv *priv = netdev_priv(netdev);
...@@ -3670,12 +3656,10 @@ static void hns3_ring_get_cfg(struct hnae3_queue *q, struct hns3_nic_priv *priv, ...@@ -3670,12 +3656,10 @@ static void hns3_ring_get_cfg(struct hnae3_queue *q, struct hns3_nic_priv *priv,
ring = &priv->ring[q->tqp_index]; ring = &priv->ring[q->tqp_index];
desc_num = priv->ae_handle->kinfo.num_tx_desc; desc_num = priv->ae_handle->kinfo.num_tx_desc;
ring->queue_index = q->tqp_index; ring->queue_index = q->tqp_index;
ring->io_base = (u8 __iomem *)q->io_base + HNS3_TX_REG_OFFSET;
} else { } else {
ring = &priv->ring[q->tqp_index + queue_num]; ring = &priv->ring[q->tqp_index + queue_num];
desc_num = priv->ae_handle->kinfo.num_rx_desc; desc_num = priv->ae_handle->kinfo.num_rx_desc;
ring->queue_index = q->tqp_index; ring->queue_index = q->tqp_index;
ring->io_base = q->io_base;
} }
hnae3_set_bit(ring->flag, HNAE3_RING_TYPE_B, ring_type); hnae3_set_bit(ring->flag, HNAE3_RING_TYPE_B, ring_type);
......
...@@ -42,13 +42,8 @@ enum hns3_nic_state { ...@@ -42,13 +42,8 @@ enum hns3_nic_state {
#define HNS3_RING_TX_RING_PKTNUM_RECORD_REG 0x0006C #define HNS3_RING_TX_RING_PKTNUM_RECORD_REG 0x0006C
#define HNS3_RING_TX_RING_EBD_OFFSET_REG 0x00070 #define HNS3_RING_TX_RING_EBD_OFFSET_REG 0x00070
#define HNS3_RING_TX_RING_BD_ERR_REG 0x00074 #define HNS3_RING_TX_RING_BD_ERR_REG 0x00074
#define HNS3_RING_PREFETCH_EN_REG 0x0007C
#define HNS3_RING_CFG_VF_NUM_REG 0x00080
#define HNS3_RING_ASID_REG 0x0008C
#define HNS3_RING_EN_REG 0x00090 #define HNS3_RING_EN_REG 0x00090
#define HNS3_TX_REG_OFFSET 0x40
#define HNS3_RX_HEAD_SIZE 256 #define HNS3_RX_HEAD_SIZE 256
#define HNS3_TX_TIMEOUT (5 * HZ) #define HNS3_TX_TIMEOUT (5 * HZ)
...@@ -380,7 +375,6 @@ struct ring_stats { ...@@ -380,7 +375,6 @@ struct ring_stats {
}; };
struct hns3_enet_ring { struct hns3_enet_ring {
u8 __iomem *io_base; /* base io address for the ring */
struct hns3_desc *desc; /* dma map address space */ struct hns3_desc *desc; /* dma map address space */
struct hns3_desc_cb *desc_cb; struct hns3_desc_cb *desc_cb;
struct hns3_enet_ring *next; struct hns3_enet_ring *next;
...@@ -607,7 +601,6 @@ void hns3_set_vector_coalesce_rl(struct hns3_enet_tqp_vector *tqp_vector, ...@@ -607,7 +601,6 @@ void hns3_set_vector_coalesce_rl(struct hns3_enet_tqp_vector *tqp_vector,
u32 rl_value); u32 rl_value);
void hns3_enable_vlan_filter(struct net_device *netdev, bool enable); void hns3_enable_vlan_filter(struct net_device *netdev, bool enable);
int hns3_update_promisc_mode(struct net_device *netdev, u8 promisc_flags);
void hns3_request_update_promisc_mode(struct hnae3_handle *handle); void hns3_request_update_promisc_mode(struct hnae3_handle *handle);
#ifdef CONFIG_HNS3_DCB #ifdef CONFIG_HNS3_DCB
......
...@@ -3944,6 +3944,9 @@ static void hclge_periodic_service_task(struct hclge_dev *hdev) ...@@ -3944,6 +3944,9 @@ static void hclge_periodic_service_task(struct hclge_dev *hdev)
{ {
unsigned long delta = round_jiffies_relative(HZ); unsigned long delta = round_jiffies_relative(HZ);
if (test_bit(HCLGE_STATE_RST_FAIL, &hdev->state))
return;
/* Always handle the link updating to make sure link state is /* Always handle the link updating to make sure link state is
* updated when it is triggered by mbx. * updated when it is triggered by mbx.
*/ */
......
...@@ -266,7 +266,7 @@ struct hclge_mac { ...@@ -266,7 +266,7 @@ struct hclge_mac {
u32 fec_mode; /* active fec mode */ u32 fec_mode; /* active fec mode */
u32 user_fec_mode; u32 user_fec_mode;
u32 fec_ability; u32 fec_ability;
int link; /* store the link status of mac & phy (if phy exit) */ int link; /* store the link status of mac & phy (if phy exists) */
struct phy_device *phydev; struct phy_device *phydev;
struct mii_bus *mdio_bus; struct mii_bus *mdio_bus;
phy_interface_t phy_if; phy_interface_t phy_if;
...@@ -749,7 +749,6 @@ struct hclge_dev { ...@@ -749,7 +749,6 @@ struct hclge_dev {
u16 num_tx_desc; /* desc num of per tx queue */ u16 num_tx_desc; /* desc num of per tx queue */
u16 num_rx_desc; /* desc num of per rx queue */ u16 num_rx_desc; /* desc num of per rx queue */
u8 hw_tc_map; u8 hw_tc_map;
u8 tc_num_last_time;
enum hclge_fc_mode fc_mode_last_time; enum hclge_fc_mode fc_mode_last_time;
u8 support_sfp_query; u8 support_sfp_query;
......
...@@ -1788,10 +1788,10 @@ static int hclgevf_reset_prepare_wait(struct hclgevf_dev *hdev) ...@@ -1788,10 +1788,10 @@ static int hclgevf_reset_prepare_wait(struct hclgevf_dev *hdev)
{ {
#define HCLGEVF_RESET_SYNC_TIME 100 #define HCLGEVF_RESET_SYNC_TIME 100
if (hdev->reset_type == HNAE3_VF_FUNC_RESET) {
struct hclge_vf_to_pf_msg send_msg; struct hclge_vf_to_pf_msg send_msg;
int ret = 0; int ret;
if (hdev->reset_type == HNAE3_VF_FUNC_RESET) {
hclgevf_build_send_msg(&send_msg, HCLGE_MBX_RESET, 0); hclgevf_build_send_msg(&send_msg, HCLGE_MBX_RESET, 0);
ret = hclgevf_send_mbx_msg(hdev, &send_msg, true, NULL, 0); ret = hclgevf_send_mbx_msg(hdev, &send_msg, true, NULL, 0);
if (ret) { if (ret) {
...@@ -1806,10 +1806,10 @@ static int hclgevf_reset_prepare_wait(struct hclgevf_dev *hdev) ...@@ -1806,10 +1806,10 @@ static int hclgevf_reset_prepare_wait(struct hclgevf_dev *hdev)
/* inform hardware that preparatory work is done */ /* inform hardware that preparatory work is done */
msleep(HCLGEVF_RESET_SYNC_TIME); msleep(HCLGEVF_RESET_SYNC_TIME);
hclgevf_reset_handshake(hdev, true); hclgevf_reset_handshake(hdev, true);
dev_info(&hdev->pdev->dev, "prepare reset(%d) wait done, ret:%d\n", dev_info(&hdev->pdev->dev, "prepare reset(%d) wait done\n",
hdev->reset_type, ret); hdev->reset_type);
return ret; return 0;
} }
static void hclgevf_dump_rst_info(struct hclgevf_dev *hdev) static void hclgevf_dump_rst_info(struct hclgevf_dev *hdev)
...@@ -2186,6 +2186,9 @@ static void hclgevf_periodic_service_task(struct hclgevf_dev *hdev) ...@@ -2186,6 +2186,9 @@ static void hclgevf_periodic_service_task(struct hclgevf_dev *hdev)
unsigned long delta = round_jiffies_relative(HZ); unsigned long delta = round_jiffies_relative(HZ);
struct hnae3_handle *handle = &hdev->nic; struct hnae3_handle *handle = &hdev->nic;
if (test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state))
return;
if (time_is_after_jiffies(hdev->last_serv_processed + HZ)) { if (time_is_after_jiffies(hdev->last_serv_processed + HZ)) {
delta = jiffies - hdev->last_serv_processed; delta = jiffies - hdev->last_serv_processed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment