mirror of
https://github.com/a52xq-dev/kernel.git
synced 2026-10-18 21:58:11 +07:00
Merge gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net
David writes:
"Networking fixes:
1) Prefix length validation in xfrm layer, from Steffen Klassert.
2) TX status reporting fix in mac80211, from Andrei Otcheretianski.
3) Fix hangs due to TX_DROP in mac80211, from Bob Copeland.
4) Fix DMA error regression in b43, from Larry Finger.
5) Add input validation to xenvif_set_hash_mapping(), from Jan Beulich.
6) SMMU unmapping fix in hns driver, from Yunsheng Lin.
7) Bluetooh crash in unpairing on SMP, from Matias Karhumaa.
8) WoL handling fixes in the phy layer, from Heiner Kallweit.
9) Fix deadlock in bonding, from Mahesh Bandewar.
10) Fill ttl inherit infor in vxlan driver, from Hangbin Liu.
11) Fix TX timeouts during netpoll, from Michael Chan.
12) RXRPC layer fixes from David Howells.
13) Another batch of ndo_poll_controller() removals to deal with
excessive resource consumption during load. From Eric Dumazet.
14) Fix a specific TIPC failure secnario, from LUU Duc Canh.
15) Really disable clocks in r8169 during suspend so that low
power states can actually be reached.
16) Fix SYN backlog lockdep issue in tcp and dccp, from Eric Dumazet.
17) Fix RCU locking in netpoll SKB send, which shows up in bonding,
from Dave Jones.
18) Fix TX stalls in r8169, from Heiner Kallweit.
19) Fix locksup in nfp due to control message storms, from Jakub
Kicinski.
20) Various rmnet bug fixes from Subash Abhinov Kasiviswanathan and
Sean Tranchetti.
21) Fix use after free in ip_cmsg_recv_dstaddr(), from Eric Dumazet."
* gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net: (122 commits)
ixgbe: check return value of napi_complete_done()
sctp: fix fall-through annotation
r8169: always autoneg on resume
ipv4: fix use-after-free in ip_cmsg_recv_dstaddr()
net: qualcomm: rmnet: Fix incorrect allocation flag in receive path
net: qualcomm: rmnet: Fix incorrect allocation flag in transmit
net: qualcomm: rmnet: Skip processing loopback packets
net: systemport: Fix wake-up interrupt race during resume
rtnl: limit IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES to 4096
bonding: fix warning message
inet: make sure to grab rcu_read_lock before using ireq->ireq_opt
nfp: avoid soft lockups under control message storm
declance: Fix continuation with the adapter identification message
net: fec: fix rare tx timeout
r8169: fix network stalls due to missing bit TXCFG_AUTO_FIFO
tun: napi flags belong to tfile
tun: initialize napi_mutex unconditionally
tun: remove unused parameters
bond: take rcu lock in netpoll_send_skb_on_dev
rtnetlink: Fail dump if target netnsid is invalid
...
This commit is contained in:
commit
cec4de302c
129 changed files with 864 additions and 806 deletions
|
|
@ -425,7 +425,7 @@ tcp_mtu_probing - INTEGER
|
|||
1 - Disabled by default, enabled when an ICMP black hole detected
|
||||
2 - Always enabled, use initial MSS of tcp_base_mss.
|
||||
|
||||
tcp_probe_interval - INTEGER
|
||||
tcp_probe_interval - UNSIGNED INTEGER
|
||||
Controls how often to start TCP Packetization-Layer Path MTU
|
||||
Discovery reprobe. The default is reprobing every 10 minutes as
|
||||
per RFC4821.
|
||||
|
|
|
|||
|
|
@ -2956,7 +2956,6 @@ F: include/linux/bcm963xx_tag.h
|
|||
|
||||
BROADCOM BNX2 GIGABIT ETHERNET DRIVER
|
||||
M: Rasesh Mody <rasesh.mody@cavium.com>
|
||||
M: Harish Patil <harish.patil@cavium.com>
|
||||
M: Dept-GELinuxNICDev@cavium.com
|
||||
L: netdev@vger.kernel.org
|
||||
S: Supported
|
||||
|
|
@ -2977,6 +2976,7 @@ F: drivers/scsi/bnx2i/
|
|||
|
||||
BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
|
||||
M: Ariel Elior <ariel.elior@cavium.com>
|
||||
M: Sudarsana Kalluru <sudarsana.kalluru@cavium.com>
|
||||
M: everest-linux-l2@cavium.com
|
||||
L: netdev@vger.kernel.org
|
||||
S: Supported
|
||||
|
|
@ -5470,7 +5470,8 @@ S: Odd Fixes
|
|||
F: drivers/net/ethernet/agere/
|
||||
|
||||
ETHERNET BRIDGE
|
||||
M: Stephen Hemminger <stephen@networkplumber.org>
|
||||
M: Roopa Prabhu <roopa@cumulusnetworks.com>
|
||||
M: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
|
||||
L: bridge@lists.linux-foundation.org (moderated for non-subscribers)
|
||||
L: netdev@vger.kernel.org
|
||||
W: http://www.linuxfoundation.org/en/Net:Bridge
|
||||
|
|
@ -11979,7 +11980,7 @@ F: Documentation/scsi/LICENSE.qla4xxx
|
|||
F: drivers/scsi/qla4xxx/
|
||||
|
||||
QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
|
||||
M: Harish Patil <harish.patil@cavium.com>
|
||||
M: Shahed Shaikh <Shahed.Shaikh@cavium.com>
|
||||
M: Manish Chopra <manish.chopra@cavium.com>
|
||||
M: Dept-GELinuxNICDev@cavium.com
|
||||
L: netdev@vger.kernel.org
|
||||
|
|
@ -11987,7 +11988,6 @@ S: Supported
|
|||
F: drivers/net/ethernet/qlogic/qlcnic/
|
||||
|
||||
QLOGIC QLGE 10Gb ETHERNET DRIVER
|
||||
M: Harish Patil <harish.patil@cavium.com>
|
||||
M: Manish Chopra <manish.chopra@cavium.com>
|
||||
M: Dept-GELinuxNICDev@cavium.com
|
||||
L: netdev@vger.kernel.org
|
||||
|
|
|
|||
|
|
@ -210,6 +210,7 @@ static void bond_get_stats(struct net_device *bond_dev,
|
|||
static void bond_slave_arr_handler(struct work_struct *work);
|
||||
static bool bond_time_in_interval(struct bonding *bond, unsigned long last_act,
|
||||
int mod);
|
||||
static void bond_netdev_notify_work(struct work_struct *work);
|
||||
|
||||
/*---------------------------- General routines -----------------------------*/
|
||||
|
||||
|
|
@ -1170,9 +1171,27 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
|
|||
}
|
||||
}
|
||||
|
||||
/* don't change skb->dev for link-local packets */
|
||||
if (is_link_local_ether_addr(eth_hdr(skb)->h_dest))
|
||||
/* Link-local multicast packets should be passed to the
|
||||
* stack on the link they arrive as well as pass them to the
|
||||
* bond-master device. These packets are mostly usable when
|
||||
* stack receives it with the link on which they arrive
|
||||
* (e.g. LLDP) they also must be available on master. Some of
|
||||
* the use cases include (but are not limited to): LLDP agents
|
||||
* that must be able to operate both on enslaved interfaces as
|
||||
* well as on bonds themselves; linux bridges that must be able
|
||||
* to process/pass BPDUs from attached bonds when any kind of
|
||||
* STP version is enabled on the network.
|
||||
*/
|
||||
if (is_link_local_ether_addr(eth_hdr(skb)->h_dest)) {
|
||||
struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
|
||||
|
||||
if (nskb) {
|
||||
nskb->dev = bond->dev;
|
||||
nskb->queue_mapping = 0;
|
||||
netif_rx(nskb);
|
||||
}
|
||||
return RX_HANDLER_PASS;
|
||||
}
|
||||
if (bond_should_deliver_exact_match(skb, slave, bond))
|
||||
return RX_HANDLER_EXACT;
|
||||
|
||||
|
|
@ -1269,6 +1288,8 @@ static struct slave *bond_alloc_slave(struct bonding *bond)
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
INIT_DELAYED_WORK(&slave->notify_work, bond_netdev_notify_work);
|
||||
|
||||
return slave;
|
||||
}
|
||||
|
||||
|
|
@ -1276,6 +1297,7 @@ static void bond_free_slave(struct slave *slave)
|
|||
{
|
||||
struct bonding *bond = bond_get_bond_by_slave(slave);
|
||||
|
||||
cancel_delayed_work_sync(&slave->notify_work);
|
||||
if (BOND_MODE(bond) == BOND_MODE_8023AD)
|
||||
kfree(SLAVE_AD_INFO(slave));
|
||||
|
||||
|
|
@ -1297,39 +1319,26 @@ static void bond_fill_ifslave(struct slave *slave, struct ifslave *info)
|
|||
info->link_failure_count = slave->link_failure_count;
|
||||
}
|
||||
|
||||
static void bond_netdev_notify(struct net_device *dev,
|
||||
struct netdev_bonding_info *info)
|
||||
{
|
||||
rtnl_lock();
|
||||
netdev_bonding_info_change(dev, info);
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
||||
static void bond_netdev_notify_work(struct work_struct *_work)
|
||||
{
|
||||
struct netdev_notify_work *w =
|
||||
container_of(_work, struct netdev_notify_work, work.work);
|
||||
struct slave *slave = container_of(_work, struct slave,
|
||||
notify_work.work);
|
||||
|
||||
bond_netdev_notify(w->dev, &w->bonding_info);
|
||||
dev_put(w->dev);
|
||||
kfree(w);
|
||||
if (rtnl_trylock()) {
|
||||
struct netdev_bonding_info binfo;
|
||||
|
||||
bond_fill_ifslave(slave, &binfo.slave);
|
||||
bond_fill_ifbond(slave->bond, &binfo.master);
|
||||
netdev_bonding_info_change(slave->dev, &binfo);
|
||||
rtnl_unlock();
|
||||
} else {
|
||||
queue_delayed_work(slave->bond->wq, &slave->notify_work, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void bond_queue_slave_event(struct slave *slave)
|
||||
{
|
||||
struct bonding *bond = slave->bond;
|
||||
struct netdev_notify_work *nnw = kzalloc(sizeof(*nnw), GFP_ATOMIC);
|
||||
|
||||
if (!nnw)
|
||||
return;
|
||||
|
||||
dev_hold(slave->dev);
|
||||
nnw->dev = slave->dev;
|
||||
bond_fill_ifslave(slave, &nnw->bonding_info.slave);
|
||||
bond_fill_ifbond(bond, &nnw->bonding_info.master);
|
||||
INIT_DELAYED_WORK(&nnw->work, bond_netdev_notify_work);
|
||||
|
||||
queue_delayed_work(slave->bond->wq, &nnw->work, 0);
|
||||
queue_delayed_work(slave->bond->wq, &slave->notify_work, 0);
|
||||
}
|
||||
|
||||
void bond_lower_state_changed(struct slave *slave)
|
||||
|
|
|
|||
|
|
@ -2185,25 +2185,6 @@ error_drop_packet:
|
|||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
static void ena_netpoll(struct net_device *netdev)
|
||||
{
|
||||
struct ena_adapter *adapter = netdev_priv(netdev);
|
||||
int i;
|
||||
|
||||
/* Dont schedule NAPI if the driver is in the middle of reset
|
||||
* or netdev is down.
|
||||
*/
|
||||
|
||||
if (!test_bit(ENA_FLAG_DEV_UP, &adapter->flags) ||
|
||||
test_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags))
|
||||
return;
|
||||
|
||||
for (i = 0; i < adapter->num_queues; i++)
|
||||
napi_schedule(&adapter->ena_napi[i].napi);
|
||||
}
|
||||
#endif /* CONFIG_NET_POLL_CONTROLLER */
|
||||
|
||||
static u16 ena_select_queue(struct net_device *dev, struct sk_buff *skb,
|
||||
struct net_device *sb_dev,
|
||||
select_queue_fallback_t fallback)
|
||||
|
|
@ -2369,9 +2350,6 @@ static const struct net_device_ops ena_netdev_ops = {
|
|||
.ndo_change_mtu = ena_change_mtu,
|
||||
.ndo_set_mac_address = NULL,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = ena_netpoll,
|
||||
#endif /* CONFIG_NET_POLL_CONTROLLER */
|
||||
};
|
||||
|
||||
static int ena_device_validate_params(struct ena_adapter *adapter,
|
||||
|
|
|
|||
|
|
@ -1031,6 +1031,7 @@ static int dec_lance_probe(struct device *bdev, const int type)
|
|||
int i, ret;
|
||||
unsigned long esar_base;
|
||||
unsigned char *esar;
|
||||
const char *desc;
|
||||
|
||||
if (dec_lance_debug && version_printed++ == 0)
|
||||
printk(version);
|
||||
|
|
@ -1216,19 +1217,20 @@ static int dec_lance_probe(struct device *bdev, const int type)
|
|||
*/
|
||||
switch (type) {
|
||||
case ASIC_LANCE:
|
||||
printk("%s: IOASIC onboard LANCE", name);
|
||||
desc = "IOASIC onboard LANCE";
|
||||
break;
|
||||
case PMAD_LANCE:
|
||||
printk("%s: PMAD-AA", name);
|
||||
desc = "PMAD-AA";
|
||||
break;
|
||||
case PMAX_LANCE:
|
||||
printk("%s: PMAX onboard LANCE", name);
|
||||
desc = "PMAX onboard LANCE";
|
||||
break;
|
||||
}
|
||||
for (i = 0; i < 6; i++)
|
||||
dev->dev_addr[i] = esar[i * 4];
|
||||
|
||||
printk(", addr = %pM, irq = %d\n", dev->dev_addr, dev->irq);
|
||||
printk("%s: %s, addr = %pM, irq = %d\n",
|
||||
name, desc, dev->dev_addr, dev->irq);
|
||||
|
||||
dev->netdev_ops = &lance_netdev_ops;
|
||||
dev->watchdog_timeo = 5*HZ;
|
||||
|
|
|
|||
|
|
@ -1069,9 +1069,6 @@ static void bcm_sysport_resume_from_wol(struct bcm_sysport_priv *priv)
|
|||
{
|
||||
u32 reg;
|
||||
|
||||
/* Stop monitoring MPD interrupt */
|
||||
intrl2_0_mask_set(priv, INTRL2_0_MPD | INTRL2_0_BRCM_MATCH_TAG);
|
||||
|
||||
/* Disable RXCHK, active filters and Broadcom tag matching */
|
||||
reg = rxchk_readl(priv, RXCHK_CONTROL);
|
||||
reg &= ~(RXCHK_BRCM_TAG_MATCH_MASK <<
|
||||
|
|
@ -1081,6 +1078,17 @@ static void bcm_sysport_resume_from_wol(struct bcm_sysport_priv *priv)
|
|||
/* Clear the MagicPacket detection logic */
|
||||
mpd_enable_set(priv, false);
|
||||
|
||||
reg = intrl2_0_readl(priv, INTRL2_CPU_STATUS);
|
||||
if (reg & INTRL2_0_MPD)
|
||||
netdev_info(priv->netdev, "Wake-on-LAN (MPD) interrupt!\n");
|
||||
|
||||
if (reg & INTRL2_0_BRCM_MATCH_TAG) {
|
||||
reg = rxchk_readl(priv, RXCHK_BRCM_TAG_MATCH_STATUS) &
|
||||
RXCHK_BRCM_TAG_MATCH_MASK;
|
||||
netdev_info(priv->netdev,
|
||||
"Wake-on-LAN (filters 0x%02x) interrupt!\n", reg);
|
||||
}
|
||||
|
||||
netif_dbg(priv, wol, priv->netdev, "resumed from WOL\n");
|
||||
}
|
||||
|
||||
|
|
@ -1105,7 +1113,6 @@ static irqreturn_t bcm_sysport_rx_isr(int irq, void *dev_id)
|
|||
struct bcm_sysport_priv *priv = netdev_priv(dev);
|
||||
struct bcm_sysport_tx_ring *txr;
|
||||
unsigned int ring, ring_bit;
|
||||
u32 reg;
|
||||
|
||||
priv->irq0_stat = intrl2_0_readl(priv, INTRL2_CPU_STATUS) &
|
||||
~intrl2_0_readl(priv, INTRL2_CPU_MASK_STATUS);
|
||||
|
|
@ -1131,16 +1138,6 @@ static irqreturn_t bcm_sysport_rx_isr(int irq, void *dev_id)
|
|||
if (priv->irq0_stat & INTRL2_0_TX_RING_FULL)
|
||||
bcm_sysport_tx_reclaim_all(priv);
|
||||
|
||||
if (priv->irq0_stat & INTRL2_0_MPD)
|
||||
netdev_info(priv->netdev, "Wake-on-LAN (MPD) interrupt!\n");
|
||||
|
||||
if (priv->irq0_stat & INTRL2_0_BRCM_MATCH_TAG) {
|
||||
reg = rxchk_readl(priv, RXCHK_BRCM_TAG_MATCH_STATUS) &
|
||||
RXCHK_BRCM_TAG_MATCH_MASK;
|
||||
netdev_info(priv->netdev,
|
||||
"Wake-on-LAN (filters 0x%02x) interrupt!\n", reg);
|
||||
}
|
||||
|
||||
if (!priv->is_lite)
|
||||
goto out;
|
||||
|
||||
|
|
@ -2641,9 +2638,6 @@ static int bcm_sysport_suspend_to_wol(struct bcm_sysport_priv *priv)
|
|||
/* UniMAC receive needs to be turned on */
|
||||
umac_enable_set(priv, CMD_RX_EN, 1);
|
||||
|
||||
/* Enable the interrupt wake-up source */
|
||||
intrl2_0_mask_clear(priv, INTRL2_0_MPD | INTRL2_0_BRCM_MATCH_TAG);
|
||||
|
||||
netif_dbg(priv, wol, ndev, "entered WOL mode\n");
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1884,8 +1884,11 @@ static int bnxt_poll_work(struct bnxt *bp, struct bnxt_napi *bnapi, int budget)
|
|||
if (TX_CMP_TYPE(txcmp) == CMP_TYPE_TX_L2_CMP) {
|
||||
tx_pkts++;
|
||||
/* return full budget so NAPI will complete. */
|
||||
if (unlikely(tx_pkts > bp->tx_wake_thresh))
|
||||
if (unlikely(tx_pkts > bp->tx_wake_thresh)) {
|
||||
rx_pkts = budget;
|
||||
raw_cons = NEXT_RAW_CMP(raw_cons);
|
||||
break;
|
||||
}
|
||||
} else if ((TX_CMP_TYPE(txcmp) & 0x30) == 0x10) {
|
||||
if (likely(budget))
|
||||
rc = bnxt_rx_pkt(bp, bnapi, &raw_cons, &event);
|
||||
|
|
@ -1913,7 +1916,7 @@ static int bnxt_poll_work(struct bnxt *bp, struct bnxt_napi *bnapi, int budget)
|
|||
}
|
||||
raw_cons = NEXT_RAW_CMP(raw_cons);
|
||||
|
||||
if (rx_pkts == budget)
|
||||
if (rx_pkts && rx_pkts == budget)
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2027,8 +2030,12 @@ static int bnxt_poll(struct napi_struct *napi, int budget)
|
|||
while (1) {
|
||||
work_done += bnxt_poll_work(bp, bnapi, budget - work_done);
|
||||
|
||||
if (work_done >= budget)
|
||||
if (work_done >= budget) {
|
||||
if (!budget)
|
||||
BNXT_CP_DB_REARM(cpr->cp_doorbell,
|
||||
cpr->cp_raw_cons);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!bnxt_has_work(bp, cpr)) {
|
||||
if (napi_complete_done(napi, work_done))
|
||||
|
|
|
|||
|
|
@ -2160,6 +2160,7 @@ static void macb_configure_dma(struct macb *bp)
|
|||
else
|
||||
dmacfg &= ~GEM_BIT(TXCOEN);
|
||||
|
||||
dmacfg &= ~GEM_BIT(ADDR64);
|
||||
#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
|
||||
if (bp->hw_dma_cap & HW_DMA_CAP_64B)
|
||||
dmacfg |= GEM_BIT(ADDR64);
|
||||
|
|
|
|||
|
|
@ -1158,7 +1158,7 @@ static void fec_enet_timeout_work(struct work_struct *work)
|
|||
napi_disable(&fep->napi);
|
||||
netif_tx_lock_bh(ndev);
|
||||
fec_restart(ndev);
|
||||
netif_wake_queue(ndev);
|
||||
netif_tx_wake_all_queues(ndev);
|
||||
netif_tx_unlock_bh(ndev);
|
||||
napi_enable(&fep->napi);
|
||||
}
|
||||
|
|
@ -1273,7 +1273,7 @@ skb_done:
|
|||
|
||||
/* Since we have freed up a buffer, the ring is no longer full
|
||||
*/
|
||||
if (netif_queue_stopped(ndev)) {
|
||||
if (netif_tx_queue_stopped(nq)) {
|
||||
entries_free = fec_enet_get_free_txdesc_num(txq);
|
||||
if (entries_free >= txq->tx_wake_threshold)
|
||||
netif_tx_wake_queue(nq);
|
||||
|
|
@ -1746,7 +1746,7 @@ static void fec_enet_adjust_link(struct net_device *ndev)
|
|||
napi_disable(&fep->napi);
|
||||
netif_tx_lock_bh(ndev);
|
||||
fec_restart(ndev);
|
||||
netif_wake_queue(ndev);
|
||||
netif_tx_wake_all_queues(ndev);
|
||||
netif_tx_unlock_bh(ndev);
|
||||
napi_enable(&fep->napi);
|
||||
}
|
||||
|
|
@ -2247,7 +2247,7 @@ static int fec_enet_set_pauseparam(struct net_device *ndev,
|
|||
napi_disable(&fep->napi);
|
||||
netif_tx_lock_bh(ndev);
|
||||
fec_restart(ndev);
|
||||
netif_wake_queue(ndev);
|
||||
netif_tx_wake_all_queues(ndev);
|
||||
netif_tx_unlock_bh(ndev);
|
||||
napi_enable(&fep->napi);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ static void hnae_unmap_buffer(struct hnae_ring *ring, struct hnae_desc_cb *cb)
|
|||
if (cb->type == DESC_TYPE_SKB)
|
||||
dma_unmap_single(ring_to_dev(ring), cb->dma, cb->length,
|
||||
ring_to_dma_dir(ring));
|
||||
else
|
||||
else if (cb->length)
|
||||
dma_unmap_page(ring_to_dev(ring), cb->dma, cb->length,
|
||||
ring_to_dma_dir(ring));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@
|
|||
#define SKB_TMP_LEN(SKB) \
|
||||
(((SKB)->transport_header - (SKB)->mac_header) + tcp_hdrlen(SKB))
|
||||
|
||||
static void fill_v2_desc(struct hnae_ring *ring, void *priv,
|
||||
int size, dma_addr_t dma, int frag_end,
|
||||
int buf_num, enum hns_desc_type type, int mtu)
|
||||
static void fill_v2_desc_hw(struct hnae_ring *ring, void *priv, int size,
|
||||
int send_sz, dma_addr_t dma, int frag_end,
|
||||
int buf_num, enum hns_desc_type type, int mtu)
|
||||
{
|
||||
struct hnae_desc *desc = &ring->desc[ring->next_to_use];
|
||||
struct hnae_desc_cb *desc_cb = &ring->desc_cb[ring->next_to_use];
|
||||
|
|
@ -64,7 +64,7 @@ static void fill_v2_desc(struct hnae_ring *ring, void *priv,
|
|||
desc_cb->type = type;
|
||||
|
||||
desc->addr = cpu_to_le64(dma);
|
||||
desc->tx.send_size = cpu_to_le16((u16)size);
|
||||
desc->tx.send_size = cpu_to_le16((u16)send_sz);
|
||||
|
||||
/* config bd buffer end */
|
||||
hnae_set_bit(rrcfv, HNSV2_TXD_VLD_B, 1);
|
||||
|
|
@ -133,6 +133,14 @@ static void fill_v2_desc(struct hnae_ring *ring, void *priv,
|
|||
ring_ptr_move_fw(ring, next_to_use);
|
||||
}
|
||||
|
||||
static void fill_v2_desc(struct hnae_ring *ring, void *priv,
|
||||
int size, dma_addr_t dma, int frag_end,
|
||||
int buf_num, enum hns_desc_type type, int mtu)
|
||||
{
|
||||
fill_v2_desc_hw(ring, priv, size, size, dma, frag_end,
|
||||
buf_num, type, mtu);
|
||||
}
|
||||
|
||||
static const struct acpi_device_id hns_enet_acpi_match[] = {
|
||||
{ "HISI00C1", 0 },
|
||||
{ "HISI00C2", 0 },
|
||||
|
|
@ -289,15 +297,15 @@ static void fill_tso_desc(struct hnae_ring *ring, void *priv,
|
|||
|
||||
/* when the frag size is bigger than hardware, split this frag */
|
||||
for (k = 0; k < frag_buf_num; k++)
|
||||
fill_v2_desc(ring, priv,
|
||||
(k == frag_buf_num - 1) ?
|
||||
fill_v2_desc_hw(ring, priv, k == 0 ? size : 0,
|
||||
(k == frag_buf_num - 1) ?
|
||||
sizeoflast : BD_MAX_SEND_SIZE,
|
||||
dma + BD_MAX_SEND_SIZE * k,
|
||||
frag_end && (k == frag_buf_num - 1) ? 1 : 0,
|
||||
buf_num,
|
||||
(type == DESC_TYPE_SKB && !k) ?
|
||||
dma + BD_MAX_SEND_SIZE * k,
|
||||
frag_end && (k == frag_buf_num - 1) ? 1 : 0,
|
||||
buf_num,
|
||||
(type == DESC_TYPE_SKB && !k) ?
|
||||
DESC_TYPE_SKB : DESC_TYPE_PAGE,
|
||||
mtu);
|
||||
mtu);
|
||||
}
|
||||
|
||||
netdev_tx_t hns_nic_net_xmit_hw(struct net_device *ndev,
|
||||
|
|
@ -1495,21 +1503,6 @@ static int hns_nic_do_ioctl(struct net_device *netdev, struct ifreq *ifr,
|
|||
return phy_mii_ioctl(phy_dev, ifr, cmd);
|
||||
}
|
||||
|
||||
/* use only for netconsole to poll with the device without interrupt */
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
static void hns_nic_poll_controller(struct net_device *ndev)
|
||||
{
|
||||
struct hns_nic_priv *priv = netdev_priv(ndev);
|
||||
unsigned long flags;
|
||||
int i;
|
||||
|
||||
local_irq_save(flags);
|
||||
for (i = 0; i < priv->ae_handle->q_num * 2; i++)
|
||||
napi_schedule(&priv->ring_data[i].napi);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
#endif
|
||||
|
||||
static netdev_tx_t hns_nic_net_xmit(struct sk_buff *skb,
|
||||
struct net_device *ndev)
|
||||
{
|
||||
|
|
@ -1962,9 +1955,6 @@ static const struct net_device_ops hns_nic_netdev_ops = {
|
|||
.ndo_set_features = hns_nic_set_features,
|
||||
.ndo_fix_features = hns_nic_fix_features,
|
||||
.ndo_get_stats64 = hns_nic_get_stats64,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = hns_nic_poll_controller,
|
||||
#endif
|
||||
.ndo_set_rx_mode = hns_nic_set_rx_mode,
|
||||
.ndo_select_queue = hns_nic_select_queue,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -789,23 +789,6 @@ static void hinic_get_stats64(struct net_device *netdev,
|
|||
stats->tx_errors = nic_tx_stats->tx_dropped;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
static void hinic_netpoll(struct net_device *netdev)
|
||||
{
|
||||
struct hinic_dev *nic_dev = netdev_priv(netdev);
|
||||
int i, num_qps;
|
||||
|
||||
num_qps = hinic_hwdev_num_qps(nic_dev->hwdev);
|
||||
for (i = 0; i < num_qps; i++) {
|
||||
struct hinic_txq *txq = &nic_dev->txqs[i];
|
||||
struct hinic_rxq *rxq = &nic_dev->rxqs[i];
|
||||
|
||||
napi_schedule(&txq->napi);
|
||||
napi_schedule(&rxq->napi);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct net_device_ops hinic_netdev_ops = {
|
||||
.ndo_open = hinic_open,
|
||||
.ndo_stop = hinic_close,
|
||||
|
|
@ -818,9 +801,6 @@ static const struct net_device_ops hinic_netdev_ops = {
|
|||
.ndo_start_xmit = hinic_xmit_frame,
|
||||
.ndo_tx_timeout = hinic_tx_timeout,
|
||||
.ndo_get_stats64 = hinic_get_stats64,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = hinic_netpoll,
|
||||
#endif
|
||||
};
|
||||
|
||||
static void netdev_features_init(struct net_device *netdev)
|
||||
|
|
|
|||
|
|
@ -921,17 +921,6 @@ static int ehea_poll(struct napi_struct *napi, int budget)
|
|||
return rx;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
static void ehea_netpoll(struct net_device *dev)
|
||||
{
|
||||
struct ehea_port *port = netdev_priv(dev);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < port->num_def_qps; i++)
|
||||
napi_schedule(&port->port_res[i].napi);
|
||||
}
|
||||
#endif
|
||||
|
||||
static irqreturn_t ehea_recv_irq_handler(int irq, void *param)
|
||||
{
|
||||
struct ehea_port_res *pr = param;
|
||||
|
|
@ -2953,9 +2942,6 @@ static const struct net_device_ops ehea_netdev_ops = {
|
|||
.ndo_open = ehea_open,
|
||||
.ndo_stop = ehea_stop,
|
||||
.ndo_start_xmit = ehea_start_xmit,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = ehea_netpoll,
|
||||
#endif
|
||||
.ndo_get_stats64 = ehea_get_stats64,
|
||||
.ndo_set_mac_address = ehea_set_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
|
|
|
|||
|
|
@ -2207,19 +2207,6 @@ restart_poll:
|
|||
return frames_processed;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
static void ibmvnic_netpoll_controller(struct net_device *dev)
|
||||
{
|
||||
struct ibmvnic_adapter *adapter = netdev_priv(dev);
|
||||
int i;
|
||||
|
||||
replenish_pools(netdev_priv(dev));
|
||||
for (i = 0; i < adapter->req_rx_queues; i++)
|
||||
ibmvnic_interrupt_rx(adapter->rx_scrq[i]->irq,
|
||||
adapter->rx_scrq[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int wait_for_reset(struct ibmvnic_adapter *adapter)
|
||||
{
|
||||
int rc, ret;
|
||||
|
|
@ -2292,9 +2279,6 @@ static const struct net_device_ops ibmvnic_netdev_ops = {
|
|||
.ndo_set_mac_address = ibmvnic_set_mac,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_tx_timeout = ibmvnic_tx_timeout,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = ibmvnic_netpoll_controller,
|
||||
#endif
|
||||
.ndo_change_mtu = ibmvnic_change_mtu,
|
||||
.ndo_features_check = ibmvnic_features_check,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3196,11 +3196,13 @@ int ixgbe_poll(struct napi_struct *napi, int budget)
|
|||
return budget;
|
||||
|
||||
/* all work done, exit the polling mode */
|
||||
napi_complete_done(napi, work_done);
|
||||
if (adapter->rx_itr_setting & 1)
|
||||
ixgbe_set_itr(q_vector);
|
||||
if (!test_bit(__IXGBE_DOWN, &adapter->state))
|
||||
ixgbe_irq_enable_queues(adapter, BIT_ULL(q_vector->v_idx));
|
||||
if (likely(napi_complete_done(napi, work_done))) {
|
||||
if (adapter->rx_itr_setting & 1)
|
||||
ixgbe_set_itr(q_vector);
|
||||
if (!test_bit(__IXGBE_DOWN, &adapter->state))
|
||||
ixgbe_irq_enable_queues(adapter,
|
||||
BIT_ULL(q_vector->v_idx));
|
||||
}
|
||||
|
||||
return min(work_done, budget - 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@
|
|||
#include "en_stats.h"
|
||||
#include "en/fs.h"
|
||||
|
||||
extern const struct net_device_ops mlx5e_netdev_ops;
|
||||
struct page_pool;
|
||||
|
||||
#define MLX5E_METADATA_ETHER_TYPE (0x8CE4)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ struct mlx5e_tc_table {
|
|||
|
||||
DECLARE_HASHTABLE(mod_hdr_tbl, 8);
|
||||
DECLARE_HASHTABLE(hairpin_tbl, 8);
|
||||
|
||||
struct notifier_block netdevice_nb;
|
||||
};
|
||||
|
||||
struct mlx5e_flow_table {
|
||||
|
|
|
|||
|
|
@ -4315,7 +4315,7 @@ static int mlx5e_xdp(struct net_device *dev, struct netdev_bpf *xdp)
|
|||
}
|
||||
}
|
||||
|
||||
static const struct net_device_ops mlx5e_netdev_ops = {
|
||||
const struct net_device_ops mlx5e_netdev_ops = {
|
||||
.ndo_open = mlx5e_open,
|
||||
.ndo_stop = mlx5e_close,
|
||||
.ndo_start_xmit = mlx5e_xmit,
|
||||
|
|
|
|||
|
|
@ -1368,6 +1368,9 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
|
|||
|
||||
*match_level = MLX5_MATCH_L2;
|
||||
}
|
||||
} else {
|
||||
MLX5_SET(fte_match_set_lyr_2_4, headers_c, svlan_tag, 1);
|
||||
MLX5_SET(fte_match_set_lyr_2_4, headers_c, cvlan_tag, 1);
|
||||
}
|
||||
|
||||
if (dissector_uses_key(f->dissector, FLOW_DISSECTOR_KEY_CVLAN)) {
|
||||
|
|
@ -2946,14 +2949,71 @@ int mlx5e_stats_flower(struct mlx5e_priv *priv,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void mlx5e_tc_hairpin_update_dead_peer(struct mlx5e_priv *priv,
|
||||
struct mlx5e_priv *peer_priv)
|
||||
{
|
||||
struct mlx5_core_dev *peer_mdev = peer_priv->mdev;
|
||||
struct mlx5e_hairpin_entry *hpe;
|
||||
u16 peer_vhca_id;
|
||||
int bkt;
|
||||
|
||||
if (!same_hw_devs(priv, peer_priv))
|
||||
return;
|
||||
|
||||
peer_vhca_id = MLX5_CAP_GEN(peer_mdev, vhca_id);
|
||||
|
||||
hash_for_each(priv->fs.tc.hairpin_tbl, bkt, hpe, hairpin_hlist) {
|
||||
if (hpe->peer_vhca_id == peer_vhca_id)
|
||||
hpe->hp->pair->peer_gone = true;
|
||||
}
|
||||
}
|
||||
|
||||
static int mlx5e_tc_netdev_event(struct notifier_block *this,
|
||||
unsigned long event, void *ptr)
|
||||
{
|
||||
struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
|
||||
struct mlx5e_flow_steering *fs;
|
||||
struct mlx5e_priv *peer_priv;
|
||||
struct mlx5e_tc_table *tc;
|
||||
struct mlx5e_priv *priv;
|
||||
|
||||
if (ndev->netdev_ops != &mlx5e_netdev_ops ||
|
||||
event != NETDEV_UNREGISTER ||
|
||||
ndev->reg_state == NETREG_REGISTERED)
|
||||
return NOTIFY_DONE;
|
||||
|
||||
tc = container_of(this, struct mlx5e_tc_table, netdevice_nb);
|
||||
fs = container_of(tc, struct mlx5e_flow_steering, tc);
|
||||
priv = container_of(fs, struct mlx5e_priv, fs);
|
||||
peer_priv = netdev_priv(ndev);
|
||||
if (priv == peer_priv ||
|
||||
!(priv->netdev->features & NETIF_F_HW_TC))
|
||||
return NOTIFY_DONE;
|
||||
|
||||
mlx5e_tc_hairpin_update_dead_peer(priv, peer_priv);
|
||||
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
int mlx5e_tc_nic_init(struct mlx5e_priv *priv)
|
||||
{
|
||||
struct mlx5e_tc_table *tc = &priv->fs.tc;
|
||||
int err;
|
||||
|
||||
hash_init(tc->mod_hdr_tbl);
|
||||
hash_init(tc->hairpin_tbl);
|
||||
|
||||
return rhashtable_init(&tc->ht, &tc_ht_params);
|
||||
err = rhashtable_init(&tc->ht, &tc_ht_params);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
tc->netdevice_nb.notifier_call = mlx5e_tc_netdev_event;
|
||||
if (register_netdevice_notifier(&tc->netdevice_nb)) {
|
||||
tc->netdevice_nb.notifier_call = NULL;
|
||||
mlx5_core_warn(priv->mdev, "Failed to register netdev notifier\n");
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static void _mlx5e_tc_del_flow(void *ptr, void *arg)
|
||||
|
|
@ -2969,6 +3029,9 @@ void mlx5e_tc_nic_cleanup(struct mlx5e_priv *priv)
|
|||
{
|
||||
struct mlx5e_tc_table *tc = &priv->fs.tc;
|
||||
|
||||
if (tc->netdevice_nb.notifier_call)
|
||||
unregister_netdevice_notifier(&tc->netdevice_nb);
|
||||
|
||||
rhashtable_free_and_destroy(&tc->ht, _mlx5e_tc_del_flow, NULL);
|
||||
|
||||
if (!IS_ERR_OR_NULL(tc->t)) {
|
||||
|
|
|
|||
|
|
@ -2000,7 +2000,7 @@ static u32 calculate_vports_min_rate_divider(struct mlx5_eswitch *esw)
|
|||
u32 max_guarantee = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= esw->total_vports; i++) {
|
||||
for (i = 0; i < esw->total_vports; i++) {
|
||||
evport = &esw->vports[i];
|
||||
if (!evport->enabled || evport->info.min_rate < max_guarantee)
|
||||
continue;
|
||||
|
|
@ -2020,7 +2020,7 @@ static int normalize_vports_min_rate(struct mlx5_eswitch *esw, u32 divider)
|
|||
int err;
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= esw->total_vports; i++) {
|
||||
for (i = 0; i < esw->total_vports; i++) {
|
||||
evport = &esw->vports[i];
|
||||
if (!evport->enabled)
|
||||
continue;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue