mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Merge in late fixes in preparation for the net-next PR. Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
@@ -15,6 +15,7 @@ definitions:
|
||||
type: enum
|
||||
name: event-type
|
||||
enum-name: mptcp-event-type
|
||||
doc: Netlink MPTCP event types
|
||||
name-prefix: mptcp-event-
|
||||
entries:
|
||||
-
|
||||
|
||||
@@ -1018,10 +1018,8 @@ zl3073x_dpll_output_pin_phase_adjust_get(const struct dpll_pin *dpll_pin,
|
||||
out_id = zl3073x_output_pin_out_get(pin->id);
|
||||
out = zl3073x_out_state_get(zldev, out_id);
|
||||
|
||||
/* Convert value to ps and reverse two's complement negation applied
|
||||
* during 'set'
|
||||
*/
|
||||
*phase_adjust = -out->phase_comp * pin->phase_gran;
|
||||
/* The value in the register is expressed in half synth clock cycles. */
|
||||
*phase_adjust = out->phase_comp * pin->phase_gran;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1043,10 +1041,8 @@ zl3073x_dpll_output_pin_phase_adjust_set(const struct dpll_pin *dpll_pin,
|
||||
out_id = zl3073x_output_pin_out_get(pin->id);
|
||||
out = *zl3073x_out_state_get(zldev, out_id);
|
||||
|
||||
/* The value in the register is stored as two's complement negation
|
||||
* of requested value and expressed in half synth clock cycles.
|
||||
*/
|
||||
out.phase_comp = -phase_adjust / pin->phase_gran;
|
||||
/* The value in the register is expressed in half synth clock cycles. */
|
||||
out.phase_comp = phase_adjust / pin->phase_gran;
|
||||
|
||||
/* Update output configuration from mailbox */
|
||||
return zl3073x_out_state_set(zldev, out_id, &out);
|
||||
|
||||
@@ -791,26 +791,29 @@ static int bond_update_speed_duplex(struct slave *slave)
|
||||
struct ethtool_link_ksettings ecmd;
|
||||
int res;
|
||||
|
||||
slave->speed = SPEED_UNKNOWN;
|
||||
slave->duplex = DUPLEX_UNKNOWN;
|
||||
|
||||
res = __ethtool_get_link_ksettings(slave_dev, &ecmd);
|
||||
if (res < 0)
|
||||
return 1;
|
||||
goto speed_duplex_unknown;
|
||||
if (ecmd.base.speed == 0 || ecmd.base.speed == ((__u32)-1))
|
||||
return 1;
|
||||
goto speed_duplex_unknown;
|
||||
switch (ecmd.base.duplex) {
|
||||
case DUPLEX_FULL:
|
||||
case DUPLEX_HALF:
|
||||
break;
|
||||
default:
|
||||
return 1;
|
||||
goto speed_duplex_unknown;
|
||||
}
|
||||
|
||||
slave->speed = ecmd.base.speed;
|
||||
slave->duplex = ecmd.base.duplex;
|
||||
|
||||
return 0;
|
||||
|
||||
speed_duplex_unknown:
|
||||
slave->speed = SPEED_UNKNOWN;
|
||||
slave->duplex = DUPLEX_UNKNOWN;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *bond_slave_link_status(s8 link)
|
||||
|
||||
@@ -284,6 +284,7 @@ static void ser_release(struct work_struct *work)
|
||||
{
|
||||
struct list_head list;
|
||||
struct ser_device *ser, *tmp;
|
||||
struct tty_struct *tty;
|
||||
|
||||
spin_lock(&ser_lock);
|
||||
list_replace_init(&ser_release_list, &list);
|
||||
@@ -292,9 +293,11 @@ static void ser_release(struct work_struct *work)
|
||||
if (!list_empty(&list)) {
|
||||
rtnl_lock();
|
||||
list_for_each_entry_safe(ser, tmp, &list, node) {
|
||||
tty = ser->tty;
|
||||
dev_close(ser->dev);
|
||||
unregister_netdevice(ser->dev);
|
||||
debugfs_deinit(ser);
|
||||
tty_kref_put(tty);
|
||||
}
|
||||
rtnl_unlock();
|
||||
}
|
||||
@@ -355,8 +358,6 @@ static void ldisc_close(struct tty_struct *tty)
|
||||
{
|
||||
struct ser_device *ser = tty->disc_data;
|
||||
|
||||
tty_kref_put(ser->tty);
|
||||
|
||||
spin_lock(&ser_lock);
|
||||
list_move(&ser->node, &ser_release_list);
|
||||
spin_unlock(&ser_lock);
|
||||
|
||||
@@ -165,7 +165,7 @@ config AMD_XGBE
|
||||
select CRC32
|
||||
select PHYLIB
|
||||
select AMD_XGBE_HAVE_ECC if X86
|
||||
select NET_SELFTESTS
|
||||
imply NET_SELFTESTS
|
||||
help
|
||||
This driver supports the AMD 10GbE Ethernet device found on an
|
||||
AMD SoC.
|
||||
|
||||
@@ -705,14 +705,12 @@ static void macb_mac_link_up(struct phylink_config *config,
|
||||
if (rx_pause)
|
||||
ctrl |= MACB_BIT(PAE);
|
||||
|
||||
/* Initialize rings & buffers as clearing MACB_BIT(TE) in link down
|
||||
* cleared the pipeline and control registers.
|
||||
*/
|
||||
macb_init_buffers(bp);
|
||||
|
||||
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)
|
||||
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
|
||||
queue->tx_head = 0;
|
||||
queue->tx_tail = 0;
|
||||
queue_writel(queue, IER,
|
||||
bp->rx_intr_mask | MACB_TX_INT_FLAGS | MACB_BIT(HRESP));
|
||||
}
|
||||
}
|
||||
|
||||
macb_or_gem_writel(bp, NCFGR, ctrl);
|
||||
@@ -2954,6 +2952,7 @@ static int macb_open(struct net_device *dev)
|
||||
}
|
||||
|
||||
bp->macbgem_ops.mog_init_rings(bp);
|
||||
macb_init_buffers(bp);
|
||||
|
||||
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
|
||||
napi_enable(&queue->napi_rx);
|
||||
|
||||
@@ -1049,13 +1049,13 @@ static void hns3_init_tx_spare_buffer(struct hns3_enet_ring *ring)
|
||||
int order;
|
||||
|
||||
if (!alloc_size)
|
||||
return;
|
||||
goto not_init;
|
||||
|
||||
order = get_order(alloc_size);
|
||||
if (order > MAX_PAGE_ORDER) {
|
||||
if (net_ratelimit())
|
||||
dev_warn(ring_to_dev(ring), "failed to allocate tx spare buffer, exceed to max order\n");
|
||||
return;
|
||||
goto not_init;
|
||||
}
|
||||
|
||||
tx_spare = devm_kzalloc(ring_to_dev(ring), sizeof(*tx_spare),
|
||||
@@ -1093,6 +1093,13 @@ alloc_pages_error:
|
||||
devm_kfree(ring_to_dev(ring), tx_spare);
|
||||
devm_kzalloc_error:
|
||||
ring->tqp->handle->kinfo.tx_spare_buf_size = 0;
|
||||
not_init:
|
||||
/* When driver init or reset_init, the ring->tx_spare is always NULL;
|
||||
* but when called from hns3_set_ringparam, it's usually not NULL, and
|
||||
* will be restored if hns3_init_all_ring() failed. So it's safe to set
|
||||
* ring->tx_spare to NULL here.
|
||||
*/
|
||||
ring->tx_spare = NULL;
|
||||
}
|
||||
|
||||
/* Use hns3_tx_spare_space() to make sure there is enough buffer
|
||||
|
||||
@@ -307,7 +307,7 @@ static void octep_setup_iq_regs_cn93_pf(struct octep_device *oct, int iq_no)
|
||||
}
|
||||
|
||||
/* Setup registers for a hardware Rx Queue */
|
||||
static void octep_setup_oq_regs_cn93_pf(struct octep_device *oct, int oq_no)
|
||||
static int octep_setup_oq_regs_cn93_pf(struct octep_device *oct, int oq_no)
|
||||
{
|
||||
u64 reg_val;
|
||||
u64 oq_ctl = 0ULL;
|
||||
@@ -355,6 +355,7 @@ static void octep_setup_oq_regs_cn93_pf(struct octep_device *oct, int oq_no)
|
||||
reg_val = ((u64)time_threshold << 32) |
|
||||
CFG_GET_OQ_INTR_PKT(oct->conf);
|
||||
octep_write_csr64(oct, CN93_SDP_R_OUT_INT_LEVELS(oq_no), reg_val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Setup registers for a PF mailbox */
|
||||
@@ -709,14 +710,26 @@ static void octep_enable_interrupts_cn93_pf(struct octep_device *oct)
|
||||
/* Disable all interrupts */
|
||||
static void octep_disable_interrupts_cn93_pf(struct octep_device *oct)
|
||||
{
|
||||
u64 intr_mask = 0ULL;
|
||||
u64 reg_val, intr_mask = 0ULL;
|
||||
int srn, num_rings, i;
|
||||
|
||||
srn = CFG_GET_PORTS_PF_SRN(oct->conf);
|
||||
num_rings = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
|
||||
|
||||
for (i = 0; i < num_rings; i++)
|
||||
intr_mask |= (0x1ULL << (srn + i));
|
||||
for (i = 0; i < num_rings; i++) {
|
||||
intr_mask |= BIT_ULL(srn + i);
|
||||
reg_val = octep_read_csr64(oct,
|
||||
CN93_SDP_R_IN_INT_LEVELS(srn + i));
|
||||
reg_val &= ~CN93_INT_ENA_BIT;
|
||||
octep_write_csr64(oct,
|
||||
CN93_SDP_R_IN_INT_LEVELS(srn + i), reg_val);
|
||||
|
||||
reg_val = octep_read_csr64(oct,
|
||||
CN93_SDP_R_OUT_INT_LEVELS(srn + i));
|
||||
reg_val &= ~CN93_INT_ENA_BIT;
|
||||
octep_write_csr64(oct,
|
||||
CN93_SDP_R_OUT_INT_LEVELS(srn + i), reg_val);
|
||||
}
|
||||
|
||||
octep_write_csr64(oct, CN93_SDP_EPF_IRERR_RINT_ENA_W1C, intr_mask);
|
||||
octep_write_csr64(oct, CN93_SDP_EPF_ORERR_RINT_ENA_W1C, intr_mask);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <linux/pci.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/jiffies.h>
|
||||
|
||||
#include "octep_config.h"
|
||||
#include "octep_main.h"
|
||||
@@ -327,12 +328,14 @@ static void octep_setup_iq_regs_cnxk_pf(struct octep_device *oct, int iq_no)
|
||||
}
|
||||
|
||||
/* Setup registers for a hardware Rx Queue */
|
||||
static void octep_setup_oq_regs_cnxk_pf(struct octep_device *oct, int oq_no)
|
||||
static int octep_setup_oq_regs_cnxk_pf(struct octep_device *oct, int oq_no)
|
||||
{
|
||||
u64 reg_val;
|
||||
u64 oq_ctl = 0ULL;
|
||||
u32 time_threshold = 0;
|
||||
struct octep_oq *oq = oct->oq[oq_no];
|
||||
unsigned long t_out_jiffies;
|
||||
u32 time_threshold = 0;
|
||||
u64 oq_ctl = 0ULL;
|
||||
u64 reg_ba_val;
|
||||
u64 reg_val;
|
||||
|
||||
oq_no += CFG_GET_PORTS_PF_SRN(oct->conf);
|
||||
reg_val = octep_read_csr64(oct, CNXK_SDP_R_OUT_CONTROL(oq_no));
|
||||
@@ -343,6 +346,36 @@ static void octep_setup_oq_regs_cnxk_pf(struct octep_device *oct, int oq_no)
|
||||
reg_val = octep_read_csr64(oct, CNXK_SDP_R_OUT_CONTROL(oq_no));
|
||||
} while (!(reg_val & CNXK_R_OUT_CTL_IDLE));
|
||||
}
|
||||
octep_write_csr64(oct, CNXK_SDP_R_OUT_WMARK(oq_no), oq->max_count);
|
||||
/* Wait for WMARK to get applied */
|
||||
usleep_range(10, 15);
|
||||
|
||||
octep_write_csr64(oct, CNXK_SDP_R_OUT_SLIST_BADDR(oq_no),
|
||||
oq->desc_ring_dma);
|
||||
octep_write_csr64(oct, CNXK_SDP_R_OUT_SLIST_RSIZE(oq_no),
|
||||
oq->max_count);
|
||||
reg_ba_val = octep_read_csr64(oct, CNXK_SDP_R_OUT_SLIST_BADDR(oq_no));
|
||||
|
||||
if (reg_ba_val != oq->desc_ring_dma) {
|
||||
t_out_jiffies = jiffies + 10 * HZ;
|
||||
do {
|
||||
if (reg_ba_val == ULLONG_MAX)
|
||||
return -EFAULT;
|
||||
octep_write_csr64(oct,
|
||||
CNXK_SDP_R_OUT_SLIST_BADDR(oq_no),
|
||||
oq->desc_ring_dma);
|
||||
octep_write_csr64(oct,
|
||||
CNXK_SDP_R_OUT_SLIST_RSIZE(oq_no),
|
||||
oq->max_count);
|
||||
reg_ba_val =
|
||||
octep_read_csr64(oct,
|
||||
CNXK_SDP_R_OUT_SLIST_BADDR(oq_no));
|
||||
} while ((reg_ba_val != oq->desc_ring_dma) &&
|
||||
time_before(jiffies, t_out_jiffies));
|
||||
|
||||
if (reg_ba_val != oq->desc_ring_dma)
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
reg_val &= ~(CNXK_R_OUT_CTL_IMODE);
|
||||
reg_val &= ~(CNXK_R_OUT_CTL_ROR_P);
|
||||
@@ -356,10 +389,6 @@ static void octep_setup_oq_regs_cnxk_pf(struct octep_device *oct, int oq_no)
|
||||
reg_val |= (CNXK_R_OUT_CTL_ES_P);
|
||||
|
||||
octep_write_csr64(oct, CNXK_SDP_R_OUT_CONTROL(oq_no), reg_val);
|
||||
octep_write_csr64(oct, CNXK_SDP_R_OUT_SLIST_BADDR(oq_no),
|
||||
oq->desc_ring_dma);
|
||||
octep_write_csr64(oct, CNXK_SDP_R_OUT_SLIST_RSIZE(oq_no),
|
||||
oq->max_count);
|
||||
|
||||
oq_ctl = octep_read_csr64(oct, CNXK_SDP_R_OUT_CONTROL(oq_no));
|
||||
|
||||
@@ -385,6 +414,7 @@ static void octep_setup_oq_regs_cnxk_pf(struct octep_device *oct, int oq_no)
|
||||
reg_val &= ~0xFFFFFFFFULL;
|
||||
reg_val |= CFG_GET_OQ_WMARK(oct->conf);
|
||||
octep_write_csr64(oct, CNXK_SDP_R_OUT_WMARK(oq_no), reg_val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Setup registers for a PF mailbox */
|
||||
@@ -720,14 +750,26 @@ static void octep_enable_interrupts_cnxk_pf(struct octep_device *oct)
|
||||
/* Disable all interrupts */
|
||||
static void octep_disable_interrupts_cnxk_pf(struct octep_device *oct)
|
||||
{
|
||||
u64 intr_mask = 0ULL;
|
||||
u64 reg_val, intr_mask = 0ULL;
|
||||
int srn, num_rings, i;
|
||||
|
||||
srn = CFG_GET_PORTS_PF_SRN(oct->conf);
|
||||
num_rings = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
|
||||
|
||||
for (i = 0; i < num_rings; i++)
|
||||
intr_mask |= (0x1ULL << (srn + i));
|
||||
for (i = 0; i < num_rings; i++) {
|
||||
intr_mask |= BIT_ULL(srn + i);
|
||||
reg_val = octep_read_csr64(oct,
|
||||
CNXK_SDP_R_IN_INT_LEVELS(srn + i));
|
||||
reg_val &= ~CNXK_INT_ENA_BIT;
|
||||
octep_write_csr64(oct,
|
||||
CNXK_SDP_R_IN_INT_LEVELS(srn + i), reg_val);
|
||||
|
||||
reg_val = octep_read_csr64(oct,
|
||||
CNXK_SDP_R_OUT_INT_LEVELS(srn + i));
|
||||
reg_val &= ~CNXK_INT_ENA_BIT;
|
||||
octep_write_csr64(oct,
|
||||
CNXK_SDP_R_OUT_INT_LEVELS(srn + i), reg_val);
|
||||
}
|
||||
|
||||
octep_write_csr64(oct, CNXK_SDP_EPF_IRERR_RINT_ENA_W1C, intr_mask);
|
||||
octep_write_csr64(oct, CNXK_SDP_EPF_ORERR_RINT_ENA_W1C, intr_mask);
|
||||
|
||||
@@ -77,7 +77,7 @@ struct octep_pci_win_regs {
|
||||
|
||||
struct octep_hw_ops {
|
||||
void (*setup_iq_regs)(struct octep_device *oct, int q);
|
||||
void (*setup_oq_regs)(struct octep_device *oct, int q);
|
||||
int (*setup_oq_regs)(struct octep_device *oct, int q);
|
||||
void (*setup_mbox_regs)(struct octep_device *oct, int mbox);
|
||||
|
||||
irqreturn_t (*mbox_intr_handler)(void *ioq_vector);
|
||||
|
||||
@@ -416,5 +416,6 @@ static inline u64 cn9k_pemx_pfx_csx_pfcfgx(u64 pem, u32 pf, u32 offset)
|
||||
#define CN93_PEM_BAR4_INDEX 7
|
||||
#define CN93_PEM_BAR4_INDEX_SIZE 0x400000ULL
|
||||
#define CN93_PEM_BAR4_INDEX_OFFSET (CN93_PEM_BAR4_INDEX * CN93_PEM_BAR4_INDEX_SIZE)
|
||||
#define CN93_INT_ENA_BIT BIT_ULL(62)
|
||||
|
||||
#endif /* _OCTEP_REGS_CN9K_PF_H_ */
|
||||
|
||||
@@ -413,5 +413,6 @@
|
||||
#define CNXK_PEM_BAR4_INDEX 7
|
||||
#define CNXK_PEM_BAR4_INDEX_SIZE 0x400000ULL
|
||||
#define CNXK_PEM_BAR4_INDEX_OFFSET (CNXK_PEM_BAR4_INDEX * CNXK_PEM_BAR4_INDEX_SIZE)
|
||||
#define CNXK_INT_ENA_BIT BIT_ULL(62)
|
||||
|
||||
#endif /* _OCTEP_REGS_CNXK_PF_H_ */
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "octep_config.h"
|
||||
#include "octep_main.h"
|
||||
|
||||
static void octep_oq_free_ring_buffers(struct octep_oq *oq);
|
||||
|
||||
static void octep_oq_reset_indices(struct octep_oq *oq)
|
||||
{
|
||||
oq->host_read_idx = 0;
|
||||
@@ -170,11 +172,15 @@ static int octep_setup_oq(struct octep_device *oct, int q_no)
|
||||
goto oq_fill_buff_err;
|
||||
|
||||
octep_oq_reset_indices(oq);
|
||||
oct->hw_ops.setup_oq_regs(oct, q_no);
|
||||
if (oct->hw_ops.setup_oq_regs(oct, q_no))
|
||||
goto oq_setup_err;
|
||||
|
||||
oct->num_oqs++;
|
||||
|
||||
return 0;
|
||||
|
||||
oq_setup_err:
|
||||
octep_oq_free_ring_buffers(oq);
|
||||
oq_fill_buff_err:
|
||||
vfree(oq->buff_info);
|
||||
oq->buff_info = NULL;
|
||||
|
||||
@@ -196,7 +196,7 @@ static void octep_vf_setup_iq_regs_cn93(struct octep_vf_device *oct, int iq_no)
|
||||
}
|
||||
|
||||
/* Setup registers for a hardware Rx Queue */
|
||||
static void octep_vf_setup_oq_regs_cn93(struct octep_vf_device *oct, int oq_no)
|
||||
static int octep_vf_setup_oq_regs_cn93(struct octep_vf_device *oct, int oq_no)
|
||||
{
|
||||
struct octep_vf_oq *oq = oct->oq[oq_no];
|
||||
u32 time_threshold = 0;
|
||||
@@ -239,6 +239,7 @@ static void octep_vf_setup_oq_regs_cn93(struct octep_vf_device *oct, int oq_no)
|
||||
time_threshold = CFG_GET_OQ_INTR_TIME(oct->conf);
|
||||
reg_val = ((u64)time_threshold << 32) | CFG_GET_OQ_INTR_PKT(oct->conf);
|
||||
octep_vf_write_csr64(oct, CN93_VF_SDP_R_OUT_INT_LEVELS(oq_no), reg_val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Setup registers for a VF mailbox */
|
||||
|
||||
@@ -199,11 +199,13 @@ static void octep_vf_setup_iq_regs_cnxk(struct octep_vf_device *oct, int iq_no)
|
||||
}
|
||||
|
||||
/* Setup registers for a hardware Rx Queue */
|
||||
static void octep_vf_setup_oq_regs_cnxk(struct octep_vf_device *oct, int oq_no)
|
||||
static int octep_vf_setup_oq_regs_cnxk(struct octep_vf_device *oct, int oq_no)
|
||||
{
|
||||
struct octep_vf_oq *oq = oct->oq[oq_no];
|
||||
unsigned long t_out_jiffies;
|
||||
u32 time_threshold = 0;
|
||||
u64 oq_ctl = ULL(0);
|
||||
u64 reg_ba_val;
|
||||
u64 reg_val;
|
||||
|
||||
reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_CONTROL(oq_no));
|
||||
@@ -214,6 +216,38 @@ static void octep_vf_setup_oq_regs_cnxk(struct octep_vf_device *oct, int oq_no)
|
||||
reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_CONTROL(oq_no));
|
||||
} while (!(reg_val & CNXK_VF_R_OUT_CTL_IDLE));
|
||||
}
|
||||
octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_WMARK(oq_no),
|
||||
oq->max_count);
|
||||
/* Wait for WMARK to get applied */
|
||||
usleep_range(10, 15);
|
||||
|
||||
octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_SLIST_BADDR(oq_no),
|
||||
oq->desc_ring_dma);
|
||||
octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_SLIST_RSIZE(oq_no),
|
||||
oq->max_count);
|
||||
reg_ba_val = octep_vf_read_csr64(oct,
|
||||
CNXK_VF_SDP_R_OUT_SLIST_BADDR(oq_no));
|
||||
if (reg_ba_val != oq->desc_ring_dma) {
|
||||
t_out_jiffies = jiffies + 10 * HZ;
|
||||
do {
|
||||
if (reg_ba_val == ULLONG_MAX)
|
||||
return -EFAULT;
|
||||
octep_vf_write_csr64(oct,
|
||||
CNXK_VF_SDP_R_OUT_SLIST_BADDR
|
||||
(oq_no), oq->desc_ring_dma);
|
||||
octep_vf_write_csr64(oct,
|
||||
CNXK_VF_SDP_R_OUT_SLIST_RSIZE
|
||||
(oq_no), oq->max_count);
|
||||
reg_ba_val =
|
||||
octep_vf_read_csr64(oct,
|
||||
CNXK_VF_SDP_R_OUT_SLIST_BADDR
|
||||
(oq_no));
|
||||
} while ((reg_ba_val != oq->desc_ring_dma) &&
|
||||
time_before(jiffies, t_out_jiffies));
|
||||
|
||||
if (reg_ba_val != oq->desc_ring_dma)
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
reg_val &= ~(CNXK_VF_R_OUT_CTL_IMODE);
|
||||
reg_val &= ~(CNXK_VF_R_OUT_CTL_ROR_P);
|
||||
@@ -227,8 +261,6 @@ static void octep_vf_setup_oq_regs_cnxk(struct octep_vf_device *oct, int oq_no)
|
||||
reg_val |= (CNXK_VF_R_OUT_CTL_ES_P);
|
||||
|
||||
octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_CONTROL(oq_no), reg_val);
|
||||
octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_SLIST_BADDR(oq_no), oq->desc_ring_dma);
|
||||
octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_SLIST_RSIZE(oq_no), oq->max_count);
|
||||
|
||||
oq_ctl = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_CONTROL(oq_no));
|
||||
/* Clear the ISIZE and BSIZE (22-0) */
|
||||
@@ -250,6 +282,7 @@ static void octep_vf_setup_oq_regs_cnxk(struct octep_vf_device *oct, int oq_no)
|
||||
reg_val &= ~GENMASK_ULL(31, 0);
|
||||
reg_val |= CFG_GET_OQ_WMARK(oct->conf);
|
||||
octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_WMARK(oq_no), reg_val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Setup registers for a VF mailbox */
|
||||
|
||||
@@ -55,7 +55,7 @@ struct octep_vf_mmio {
|
||||
|
||||
struct octep_vf_hw_ops {
|
||||
void (*setup_iq_regs)(struct octep_vf_device *oct, int q);
|
||||
void (*setup_oq_regs)(struct octep_vf_device *oct, int q);
|
||||
int (*setup_oq_regs)(struct octep_vf_device *oct, int q);
|
||||
void (*setup_mbox_regs)(struct octep_vf_device *oct, int mbox);
|
||||
|
||||
irqreturn_t (*non_ioq_intr_handler)(void *ioq_vector);
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "octep_vf_config.h"
|
||||
#include "octep_vf_main.h"
|
||||
|
||||
static void octep_vf_oq_free_ring_buffers(struct octep_vf_oq *oq);
|
||||
|
||||
static void octep_vf_oq_reset_indices(struct octep_vf_oq *oq)
|
||||
{
|
||||
oq->host_read_idx = 0;
|
||||
@@ -171,11 +173,15 @@ static int octep_vf_setup_oq(struct octep_vf_device *oct, int q_no)
|
||||
goto oq_fill_buff_err;
|
||||
|
||||
octep_vf_oq_reset_indices(oq);
|
||||
oct->hw_ops.setup_oq_regs(oct, q_no);
|
||||
if (oct->hw_ops.setup_oq_regs(oct, q_no))
|
||||
goto oq_setup_err;
|
||||
|
||||
oct->num_oqs++;
|
||||
|
||||
return 0;
|
||||
|
||||
oq_setup_err:
|
||||
octep_vf_oq_free_ring_buffers(oq);
|
||||
oq_fill_buff_err:
|
||||
vfree(oq->buff_info);
|
||||
oq->buff_info = NULL;
|
||||
|
||||
@@ -1823,6 +1823,8 @@ static int cgx_lmac_exit(struct cgx *cgx)
|
||||
cgx->mac_ops->mac_pause_frm_config(cgx, lmac->lmac_id, false);
|
||||
cgx_configure_interrupt(cgx, lmac, lmac->lmac_id, true);
|
||||
kfree(lmac->mac_to_index_bmap.bmap);
|
||||
rvu_free_bitmap(&lmac->rx_fc_pfvf_bmap);
|
||||
rvu_free_bitmap(&lmac->tx_fc_pfvf_bmap);
|
||||
kfree(lmac->name);
|
||||
kfree(lmac);
|
||||
}
|
||||
|
||||
@@ -3632,11 +3632,22 @@ static void rvu_remove(struct pci_dev *pdev)
|
||||
devm_kfree(&pdev->dev, rvu);
|
||||
}
|
||||
|
||||
static void rvu_shutdown(struct pci_dev *pdev)
|
||||
{
|
||||
struct rvu *rvu = pci_get_drvdata(pdev);
|
||||
|
||||
if (!rvu)
|
||||
return;
|
||||
|
||||
rvu_clear_rvum_blk_revid(rvu);
|
||||
}
|
||||
|
||||
static struct pci_driver rvu_driver = {
|
||||
.name = DRV_NAME,
|
||||
.id_table = rvu_id_table,
|
||||
.probe = rvu_probe,
|
||||
.remove = rvu_remove,
|
||||
.shutdown = rvu_shutdown,
|
||||
};
|
||||
|
||||
static int __init rvu_init_module(void)
|
||||
|
||||
@@ -3315,6 +3315,7 @@ err_free_zc_bmap:
|
||||
err_sriov_cleannup:
|
||||
otx2_sriov_vfcfg_cleanup(pf);
|
||||
err_pf_sriov_init:
|
||||
otx2_unregister_dl(pf);
|
||||
otx2_shutdown_tc(pf);
|
||||
err_mcam_flow_del:
|
||||
otx2_mcam_flow_del(pf);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user