Merge branch 'hns-fixes'
Lin Yun Sheng says: ==================== Bugfixs for hns ethernet driver This patchset fix skb used after free and C45 op code issues in hns driver. Patch V2: 1. Remove ndev->feature checking in TX description patch. 2. Add Fixes: Tag in patch description. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
9dc351da75
|
@ -300,9 +300,9 @@ static void fill_tso_desc(struct hnae_ring *ring, void *priv,
|
||||||
mtu);
|
mtu);
|
||||||
}
|
}
|
||||||
|
|
||||||
int hns_nic_net_xmit_hw(struct net_device *ndev,
|
netdev_tx_t hns_nic_net_xmit_hw(struct net_device *ndev,
|
||||||
struct sk_buff *skb,
|
struct sk_buff *skb,
|
||||||
struct hns_nic_ring_data *ring_data)
|
struct hns_nic_ring_data *ring_data)
|
||||||
{
|
{
|
||||||
struct hns_nic_priv *priv = netdev_priv(ndev);
|
struct hns_nic_priv *priv = netdev_priv(ndev);
|
||||||
struct hnae_ring *ring = ring_data->ring;
|
struct hnae_ring *ring = ring_data->ring;
|
||||||
|
@ -361,6 +361,10 @@ int hns_nic_net_xmit_hw(struct net_device *ndev,
|
||||||
dev_queue = netdev_get_tx_queue(ndev, skb->queue_mapping);
|
dev_queue = netdev_get_tx_queue(ndev, skb->queue_mapping);
|
||||||
netdev_tx_sent_queue(dev_queue, skb->len);
|
netdev_tx_sent_queue(dev_queue, skb->len);
|
||||||
|
|
||||||
|
netif_trans_update(ndev);
|
||||||
|
ndev->stats.tx_bytes += skb->len;
|
||||||
|
ndev->stats.tx_packets++;
|
||||||
|
|
||||||
wmb(); /* commit all data before submit */
|
wmb(); /* commit all data before submit */
|
||||||
assert(skb->queue_mapping < priv->ae_handle->q_num);
|
assert(skb->queue_mapping < priv->ae_handle->q_num);
|
||||||
hnae_queue_xmit(priv->ae_handle->qs[skb->queue_mapping], buf_num);
|
hnae_queue_xmit(priv->ae_handle->qs[skb->queue_mapping], buf_num);
|
||||||
|
@ -1469,17 +1473,11 @@ static netdev_tx_t hns_nic_net_xmit(struct sk_buff *skb,
|
||||||
struct net_device *ndev)
|
struct net_device *ndev)
|
||||||
{
|
{
|
||||||
struct hns_nic_priv *priv = netdev_priv(ndev);
|
struct hns_nic_priv *priv = netdev_priv(ndev);
|
||||||
int ret;
|
|
||||||
|
|
||||||
assert(skb->queue_mapping < ndev->ae_handle->q_num);
|
assert(skb->queue_mapping < ndev->ae_handle->q_num);
|
||||||
ret = hns_nic_net_xmit_hw(ndev, skb,
|
|
||||||
&tx_ring_data(priv, skb->queue_mapping));
|
return hns_nic_net_xmit_hw(ndev, skb,
|
||||||
if (ret == NETDEV_TX_OK) {
|
&tx_ring_data(priv, skb->queue_mapping));
|
||||||
netif_trans_update(ndev);
|
|
||||||
ndev->stats.tx_bytes += skb->len;
|
|
||||||
ndev->stats.tx_packets++;
|
|
||||||
}
|
|
||||||
return (netdev_tx_t)ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hns_nic_drop_rx_fetch(struct hns_nic_ring_data *ring_data,
|
static void hns_nic_drop_rx_fetch(struct hns_nic_ring_data *ring_data,
|
||||||
|
|
|
@ -92,8 +92,8 @@ void hns_ethtool_set_ops(struct net_device *ndev);
|
||||||
void hns_nic_net_reset(struct net_device *ndev);
|
void hns_nic_net_reset(struct net_device *ndev);
|
||||||
void hns_nic_net_reinit(struct net_device *netdev);
|
void hns_nic_net_reinit(struct net_device *netdev);
|
||||||
int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h);
|
int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h);
|
||||||
int hns_nic_net_xmit_hw(struct net_device *ndev,
|
netdev_tx_t hns_nic_net_xmit_hw(struct net_device *ndev,
|
||||||
struct sk_buff *skb,
|
struct sk_buff *skb,
|
||||||
struct hns_nic_ring_data *ring_data);
|
struct hns_nic_ring_data *ring_data);
|
||||||
|
|
||||||
#endif /**__HNS_ENET_H */
|
#endif /**__HNS_ENET_H */
|
||||||
|
|
|
@ -261,7 +261,7 @@ static int hns_mdio_write(struct mii_bus *bus,
|
||||||
|
|
||||||
/* config the data needed writing */
|
/* config the data needed writing */
|
||||||
cmd_reg_cfg = devad;
|
cmd_reg_cfg = devad;
|
||||||
op = MDIO_C45_WRITE_ADDR;
|
op = MDIO_C45_WRITE_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
MDIO_SET_REG_FIELD(mdio_dev, MDIO_WDATA_REG, MDIO_WDATA_DATA_M,
|
MDIO_SET_REG_FIELD(mdio_dev, MDIO_WDATA_REG, MDIO_WDATA_DATA_M,
|
||||||
|
|
Loading…
Reference in New Issue