@@ -2103,8 +2103,12 @@ static void hns3_tx_doorbell(struct hns3_enet_ring *ring, int num,
21032103 */
21042104 if (test_bit (HNS3_NIC_STATE_TX_PUSH_ENABLE , & priv -> state ) && num &&
21052105 !ring -> pending_buf && num <= HNS3_MAX_PUSH_BD_NUM && doorbell ) {
2106+ /* This smp_store_release() pairs with smp_load_aquire() in
2107+ * hns3_nic_reclaim_desc(). Ensure that the BD valid bit
2108+ * is updated.
2109+ */
2110+ smp_store_release (& ring -> last_to_use , ring -> next_to_use );
21062111 hns3_tx_push_bd (ring , num );
2107- WRITE_ONCE (ring -> last_to_use , ring -> next_to_use );
21082112 return ;
21092113 }
21102114
@@ -2115,14 +2119,18 @@ static void hns3_tx_doorbell(struct hns3_enet_ring *ring, int num,
21152119 return ;
21162120 }
21172121
2122+ /* This smp_store_release() pairs with smp_load_aquire() in
2123+ * hns3_nic_reclaim_desc(). Ensure that the BD valid bit is updated.
2124+ */
2125+ smp_store_release (& ring -> last_to_use , ring -> next_to_use );
2126+
21182127 if (ring -> tqp -> mem_base )
21192128 hns3_tx_mem_doorbell (ring );
21202129 else
21212130 writel (ring -> pending_buf ,
21222131 ring -> tqp -> io_base + HNS3_RING_TX_RING_TAIL_REG );
21232132
21242133 ring -> pending_buf = 0 ;
2125- WRITE_ONCE (ring -> last_to_use , ring -> next_to_use );
21262134}
21272135
21282136static void hns3_tsyn (struct net_device * netdev , struct sk_buff * skb ,
@@ -3308,8 +3316,6 @@ static void hns3_set_default_feature(struct net_device *netdev)
33083316
33093317 netdev -> priv_flags |= IFF_UNICAST_FLT ;
33103318
3311- netdev -> gso_partial_features |= NETIF_F_GSO_GRE_CSUM ;
3312-
33133319 netdev -> features |= NETIF_F_HW_VLAN_CTAG_FILTER |
33143320 NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
33153321 NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_GSO |
@@ -3563,9 +3569,8 @@ static void hns3_reuse_buffer(struct hns3_enet_ring *ring, int i)
35633569static bool hns3_nic_reclaim_desc (struct hns3_enet_ring * ring ,
35643570 int * bytes , int * pkts , int budget )
35653571{
3566- /* pair with ring->last_to_use update in hns3_tx_doorbell(),
3567- * smp_store_release() is not used in hns3_tx_doorbell() because
3568- * the doorbell operation already have the needed barrier operation.
3572+ /* This smp_load_acquire() pairs with smp_store_release() in
3573+ * hns3_tx_doorbell().
35693574 */
35703575 int ltu = smp_load_acquire (& ring -> last_to_use );
35713576 int ntc = ring -> next_to_clean ;
0 commit comments