mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge tag 'net-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski:
"Including fixes from xfrm, bpf, netfilter, and wireless.
Current release - regressions:
- xfrm: fix XFRM_MSG_MAPPING ABI breakage caused by inserting a new
value in the middle of an enum
- unix: fix an issue in unix_shutdown causing the other end
read/write failures
- phy: mdio: fix memory leak
Current release - new code bugs:
- mlx5e: improve MQPRIO resiliency against bad configs
Previous releases - regressions:
- bpf: fix integer overflow leading to OOB access in map element
pre-allocation
- stmmac: dwmac-rk: fix ethernet on rk3399 based devices
- netfilter: conntrack: fix boot failure with
nf_conntrack.enable_hooks=1
- brcmfmac: revert using ISO3166 country code and 0 rev as fallback
- i40e: fix freeing of uninitialized misc IRQ vector
- iavf: fix double unlock of crit_lock
Previous releases - always broken:
- bpf, arm: fix register clobbering in div/mod implementation
- netfilter: nf_tables: correct issues in netlink rule change event
notifications
- dsa: tag_dsa: fix mask for trunked packets
- usb: r8152: don't resubmit rx immediately to avoid soft lockup on
device unplug
- i40e: fix endless loop under rtnl if FW fails to correctly respond
to capability query
- mlx5e: fix rx checksum offload coexistence with ipsec offload
- mlx5: force round second at 1PPS out start time and allow it only
in supported clock modes
- phy: pcs: xpcs: fix incorrect CL37 AN sequence, EEE disable
sequence
Misc:
- xfrm: slightly rejig the new policy uAPI to make it less cryptic"
* tag 'net-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (66 commits)
net: prefer socket bound to interface when not in VRF
iavf: fix double unlock of crit_lock
i40e: Fix freeing of uninitialized misc IRQ vector
i40e: fix endless loop under rtnl
dt-bindings: net: dsa: marvell: fix compatible in example
ionic: move filter sync_needed bit set
gve: report 64bit tx_bytes counter from gve_handle_report_stats()
gve: fix gve_get_stats()
rtnetlink: fix if_nlmsg_stats_size() under estimation
gve: Properly handle errors in gve_assign_qpl
gve: Avoid freeing NULL pointer
gve: Correct available tx qpl check
unix: Fix an issue in unix_shutdown causing the other end read/write failures
net: stmmac: trigger PCS EEE to turn off on link down
net: pcs: xpcs: fix incorrect steps on disable EEE
netlink: annotate data races around nlk->bound
net: pcs: xpcs: fix incorrect CL37 AN sequence
net: sfp: Fix typo in state machine debug string
net/sched: sch_taprio: properly cancel timer from taprio_destroy()
net: bridge: fix under estimation in br_get_linkxstats_size()
...
This commit is contained in:
1
CREDITS
1
CREDITS
@@ -971,6 +971,7 @@ D: PowerPC
|
||||
N: Daniel Drake
|
||||
E: dsd@gentoo.org
|
||||
D: USBAT02 CompactFlash support in usb-storage
|
||||
D: ZD1211RW wireless driver
|
||||
S: UK
|
||||
|
||||
N: Oleg Drokin
|
||||
|
||||
@@ -83,7 +83,7 @@ Example:
|
||||
#interrupt-cells = <2>;
|
||||
|
||||
switch0: switch@0 {
|
||||
compatible = "marvell,mv88e6390";
|
||||
compatible = "marvell,mv88e6190";
|
||||
reg = <0>;
|
||||
reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
|
||||
|
||||
|
||||
@@ -8609,9 +8609,8 @@ F: Documentation/devicetree/bindings/iio/humidity/st,hts221.yaml
|
||||
F: drivers/iio/humidity/hts221*
|
||||
|
||||
HUAWEI ETHERNET DRIVER
|
||||
M: Bin Luo <luobin9@huawei.com>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Supported
|
||||
S: Orphan
|
||||
F: Documentation/networking/device_drivers/ethernet/huawei/hinic.rst
|
||||
F: drivers/net/ethernet/huawei/hinic/
|
||||
|
||||
@@ -17794,7 +17793,6 @@ F: drivers/staging/nvec/
|
||||
|
||||
STAGING - OLPC SECONDARY DISPLAY CONTROLLER (DCON)
|
||||
M: Jens Frederich <jfrederich@gmail.com>
|
||||
M: Daniel Drake <dsd@laptop.org>
|
||||
M: Jon Nettleton <jon.nettleton@gmail.com>
|
||||
S: Maintained
|
||||
W: http://wiki.laptop.org/go/DCON
|
||||
@@ -20700,7 +20698,6 @@ S: Maintained
|
||||
F: mm/zbud.c
|
||||
|
||||
ZD1211RW WIRELESS DRIVER
|
||||
M: Daniel Drake <dsd@gentoo.org>
|
||||
M: Ulrich Kunitz <kune@deine-taler.de>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
L: zd1211-devs@lists.sourceforge.net (subscribers-only)
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
* +-----+
|
||||
* |RSVD | JIT scratchpad
|
||||
* current ARM_SP => +-----+ <= (BPF_FP - STACK_SIZE + SCRATCH_SIZE)
|
||||
* | ... | caller-saved registers
|
||||
* +-----+
|
||||
* | ... | arguments passed on stack
|
||||
* ARM_SP during call => +-----|
|
||||
* | |
|
||||
* | ... | Function call stack
|
||||
* | |
|
||||
@@ -63,6 +67,12 @@
|
||||
*
|
||||
* When popping registers off the stack at the end of a BPF function, we
|
||||
* reference them via the current ARM_FP register.
|
||||
*
|
||||
* Some eBPF operations are implemented via a call to a helper function.
|
||||
* Such calls are "invisible" in the eBPF code, so it is up to the calling
|
||||
* program to preserve any caller-saved ARM registers during the call. The
|
||||
* JIT emits code to push and pop those registers onto the stack, immediately
|
||||
* above the callee stack frame.
|
||||
*/
|
||||
#define CALLEE_MASK (1 << ARM_R4 | 1 << ARM_R5 | 1 << ARM_R6 | \
|
||||
1 << ARM_R7 | 1 << ARM_R8 | 1 << ARM_R9 | \
|
||||
@@ -70,6 +80,8 @@
|
||||
#define CALLEE_PUSH_MASK (CALLEE_MASK | 1 << ARM_LR)
|
||||
#define CALLEE_POP_MASK (CALLEE_MASK | 1 << ARM_PC)
|
||||
|
||||
#define CALLER_MASK (1 << ARM_R0 | 1 << ARM_R1 | 1 << ARM_R2 | 1 << ARM_R3)
|
||||
|
||||
enum {
|
||||
/* Stack layout - these are offsets from (top of stack - 4) */
|
||||
BPF_R2_HI,
|
||||
@@ -464,6 +476,7 @@ static inline int epilogue_offset(const struct jit_ctx *ctx)
|
||||
|
||||
static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op)
|
||||
{
|
||||
const int exclude_mask = BIT(ARM_R0) | BIT(ARM_R1);
|
||||
const s8 *tmp = bpf2a32[TMP_REG_1];
|
||||
|
||||
#if __LINUX_ARM_ARCH__ == 7
|
||||
@@ -495,11 +508,17 @@ static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op)
|
||||
emit(ARM_MOV_R(ARM_R0, rm), ctx);
|
||||
}
|
||||
|
||||
/* Push caller-saved registers on stack */
|
||||
emit(ARM_PUSH(CALLER_MASK & ~exclude_mask), ctx);
|
||||
|
||||
/* Call appropriate function */
|
||||
emit_mov_i(ARM_IP, op == BPF_DIV ?
|
||||
(u32)jit_udiv32 : (u32)jit_mod32, ctx);
|
||||
emit_blx_r(ARM_IP, ctx);
|
||||
|
||||
/* Restore caller-saved registers from stack */
|
||||
emit(ARM_POP(CALLER_MASK & ~exclude_mask), ctx);
|
||||
|
||||
/* Save return value */
|
||||
if (rd != ARM_R0)
|
||||
emit(ARM_MOV_R(rd, ARM_R0), ctx);
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
|
||||
fm1mac3: ethernet@e4000 {
|
||||
phy-handle = <&sgmii_aqr_phy3>;
|
||||
phy-connection-type = "sgmii-2500";
|
||||
phy-connection-type = "2500base-x";
|
||||
sleep = <&rcpm 0x20000000>;
|
||||
};
|
||||
|
||||
|
||||
@@ -780,7 +780,7 @@ struct gve_queue_page_list *gve_assign_rx_qpl(struct gve_priv *priv)
|
||||
gve_num_tx_qpls(priv));
|
||||
|
||||
/* we are out of rx qpls */
|
||||
if (id == priv->qpl_cfg.qpl_map_size)
|
||||
if (id == gve_num_tx_qpls(priv) + gve_num_rx_qpls(priv))
|
||||
return NULL;
|
||||
|
||||
set_bit(id, priv->qpl_cfg.qpl_id_map);
|
||||
|
||||
@@ -41,6 +41,7 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
|
||||
{
|
||||
struct gve_priv *priv = netdev_priv(dev);
|
||||
unsigned int start;
|
||||
u64 packets, bytes;
|
||||
int ring;
|
||||
|
||||
if (priv->rx) {
|
||||
@@ -48,10 +49,12 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
|
||||
do {
|
||||
start =
|
||||
u64_stats_fetch_begin(&priv->rx[ring].statss);
|
||||
s->rx_packets += priv->rx[ring].rpackets;
|
||||
s->rx_bytes += priv->rx[ring].rbytes;
|
||||
packets = priv->rx[ring].rpackets;
|
||||
bytes = priv->rx[ring].rbytes;
|
||||
} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
|
||||
start));
|
||||
s->rx_packets += packets;
|
||||
s->rx_bytes += bytes;
|
||||
}
|
||||
}
|
||||
if (priv->tx) {
|
||||
@@ -59,10 +62,12 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
|
||||
do {
|
||||
start =
|
||||
u64_stats_fetch_begin(&priv->tx[ring].statss);
|
||||
s->tx_packets += priv->tx[ring].pkt_done;
|
||||
s->tx_bytes += priv->tx[ring].bytes_done;
|
||||
packets = priv->tx[ring].pkt_done;
|
||||
bytes = priv->tx[ring].bytes_done;
|
||||
} while (u64_stats_fetch_retry(&priv->tx[ring].statss,
|
||||
start));
|
||||
s->tx_packets += packets;
|
||||
s->tx_bytes += bytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,6 +87,9 @@ static int gve_alloc_counter_array(struct gve_priv *priv)
|
||||
|
||||
static void gve_free_counter_array(struct gve_priv *priv)
|
||||
{
|
||||
if (!priv->counter_array)
|
||||
return;
|
||||
|
||||
dma_free_coherent(&priv->pdev->dev,
|
||||
priv->num_event_counters *
|
||||
sizeof(*priv->counter_array),
|
||||
@@ -142,6 +150,9 @@ static int gve_alloc_stats_report(struct gve_priv *priv)
|
||||
|
||||
static void gve_free_stats_report(struct gve_priv *priv)
|
||||
{
|
||||
if (!priv->stats_report)
|
||||
return;
|
||||
|
||||
del_timer_sync(&priv->stats_report_timer);
|
||||
dma_free_coherent(&priv->pdev->dev, priv->stats_report_len,
|
||||
priv->stats_report, priv->stats_report_bus);
|
||||
@@ -370,18 +381,19 @@ static void gve_free_notify_blocks(struct gve_priv *priv)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (priv->msix_vectors) {
|
||||
/* Free the irqs */
|
||||
for (i = 0; i < priv->num_ntfy_blks; i++) {
|
||||
struct gve_notify_block *block = &priv->ntfy_blocks[i];
|
||||
int msix_idx = i;
|
||||
if (!priv->msix_vectors)
|
||||
return;
|
||||
|
||||
irq_set_affinity_hint(priv->msix_vectors[msix_idx].vector,
|
||||
NULL);
|
||||
free_irq(priv->msix_vectors[msix_idx].vector, block);
|
||||
}
|
||||
free_irq(priv->msix_vectors[priv->mgmt_msix_idx].vector, priv);
|
||||
/* Free the irqs */
|
||||
for (i = 0; i < priv->num_ntfy_blks; i++) {
|
||||
struct gve_notify_block *block = &priv->ntfy_blocks[i];
|
||||
int msix_idx = i;
|
||||
|
||||
irq_set_affinity_hint(priv->msix_vectors[msix_idx].vector,
|
||||
NULL);
|
||||
free_irq(priv->msix_vectors[msix_idx].vector, block);
|
||||
}
|
||||
free_irq(priv->msix_vectors[priv->mgmt_msix_idx].vector, priv);
|
||||
dma_free_coherent(&priv->pdev->dev,
|
||||
priv->num_ntfy_blks * sizeof(*priv->ntfy_blocks),
|
||||
priv->ntfy_blocks, priv->ntfy_block_bus);
|
||||
@@ -1185,9 +1197,10 @@ static void gve_handle_reset(struct gve_priv *priv)
|
||||
|
||||
void gve_handle_report_stats(struct gve_priv *priv)
|
||||
{
|
||||
int idx, stats_idx = 0, tx_bytes;
|
||||
unsigned int start = 0;
|
||||
struct stats *stats = priv->stats_report->stats;
|
||||
int idx, stats_idx = 0;
|
||||
unsigned int start = 0;
|
||||
u64 tx_bytes;
|
||||
|
||||
if (!gve_get_report_stats(priv))
|
||||
return;
|
||||
|
||||
@@ -104,8 +104,14 @@ static int gve_prefill_rx_pages(struct gve_rx_ring *rx)
|
||||
if (!rx->data.page_info)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!rx->data.raw_addressing)
|
||||
if (!rx->data.raw_addressing) {
|
||||
rx->data.qpl = gve_assign_rx_qpl(priv);
|
||||
if (!rx->data.qpl) {
|
||||
kvfree(rx->data.page_info);
|
||||
rx->data.page_info = NULL;
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < slots; i++) {
|
||||
if (!rx->data.raw_addressing) {
|
||||
struct page *page = rx->data.qpl->pages[i];
|
||||
|
||||
@@ -4871,7 +4871,8 @@ static void i40e_clear_interrupt_scheme(struct i40e_pf *pf)
|
||||
{
|
||||
int i;
|
||||
|
||||
i40e_free_misc_vector(pf);
|
||||
if (test_bit(__I40E_MISC_IRQ_REQUESTED, pf->state))
|
||||
i40e_free_misc_vector(pf);
|
||||
|
||||
i40e_put_lump(pf->irq_pile, pf->iwarp_base_vector,
|
||||
I40E_IWARP_IRQ_PILE_ID);
|
||||
@@ -10113,7 +10114,7 @@ static int i40e_get_capabilities(struct i40e_pf *pf,
|
||||
if (pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOMEM) {
|
||||
/* retry with a larger buffer */
|
||||
buf_len = data_size;
|
||||
} else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK) {
|
||||
} else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK || err) {
|
||||
dev_info(&pf->pdev->dev,
|
||||
"capability discovery failed, err %s aq_err %s\n",
|
||||
i40e_stat_str(&pf->hw, err),
|
||||
|
||||
@@ -1965,7 +1965,6 @@ static void iavf_watchdog_task(struct work_struct *work)
|
||||
}
|
||||
adapter->aq_required = 0;
|
||||
adapter->current_op = VIRTCHNL_OP_UNKNOWN;
|
||||
mutex_unlock(&adapter->crit_lock);
|
||||
queue_delayed_work(iavf_wq,
|
||||
&adapter->watchdog_task,
|
||||
msecs_to_jiffies(10));
|
||||
|
||||
@@ -252,6 +252,7 @@ struct mlx5e_params {
|
||||
struct {
|
||||
u16 mode;
|
||||
u8 num_tc;
|
||||
struct netdev_tc_txq tc_to_txq[TC_MAX_QUEUE];
|
||||
} mqprio;
|
||||
bool rx_cqe_compress_def;
|
||||
bool tunneled_offload_en;
|
||||
@@ -845,6 +846,7 @@ struct mlx5e_priv {
|
||||
struct mlx5e_channel_stats channel_stats[MLX5E_MAX_NUM_CHANNELS];
|
||||
struct mlx5e_channel_stats trap_stats;
|
||||
struct mlx5e_ptp_stats ptp_stats;
|
||||
u16 stats_nch;
|
||||
u16 max_nch;
|
||||
u8 max_opened_tc;
|
||||
bool tx_ptp_opened;
|
||||
@@ -1100,12 +1102,6 @@ int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
|
||||
struct ethtool_pauseparam *pauseparam);
|
||||
|
||||
/* mlx5e generic netdev management API */
|
||||
static inline unsigned int
|
||||
mlx5e_calc_max_nch(struct mlx5e_priv *priv, const struct mlx5e_profile *profile)
|
||||
{
|
||||
return priv->netdev->num_rx_queues / max_t(u8, profile->rq_groups, 1);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
mlx5e_tx_mpwqe_supported(struct mlx5_core_dev *mdev)
|
||||
{
|
||||
@@ -1114,11 +1110,13 @@ mlx5e_tx_mpwqe_supported(struct mlx5_core_dev *mdev)
|
||||
}
|
||||
|
||||
int mlx5e_priv_init(struct mlx5e_priv *priv,
|
||||
const struct mlx5e_profile *profile,
|
||||
struct net_device *netdev,
|
||||
struct mlx5_core_dev *mdev);
|
||||
void mlx5e_priv_cleanup(struct mlx5e_priv *priv);
|
||||
struct net_device *
|
||||
mlx5e_create_netdev(struct mlx5_core_dev *mdev, unsigned int txqs, unsigned int rxqs);
|
||||
mlx5e_create_netdev(struct mlx5_core_dev *mdev, const struct mlx5e_profile *profile,
|
||||
unsigned int txqs, unsigned int rxqs);
|
||||
int mlx5e_attach_netdev(struct mlx5e_priv *priv);
|
||||
void mlx5e_detach_netdev(struct mlx5e_priv *priv);
|
||||
void mlx5e_destroy_netdev(struct mlx5e_priv *priv);
|
||||
|
||||
@@ -35,7 +35,7 @@ static void mlx5e_hv_vhca_fill_stats(struct mlx5e_priv *priv, void *data,
|
||||
{
|
||||
int ch, i = 0;
|
||||
|
||||
for (ch = 0; ch < priv->max_nch; ch++) {
|
||||
for (ch = 0; ch < priv->stats_nch; ch++) {
|
||||
void *buf = data + i;
|
||||
|
||||
if (WARN_ON_ONCE(buf +
|
||||
@@ -51,7 +51,7 @@ static void mlx5e_hv_vhca_fill_stats(struct mlx5e_priv *priv, void *data,
|
||||
static int mlx5e_hv_vhca_stats_buf_size(struct mlx5e_priv *priv)
|
||||
{
|
||||
return (sizeof(struct mlx5e_hv_vhca_per_ring_stats) *
|
||||
priv->max_nch);
|
||||
priv->stats_nch);
|
||||
}
|
||||
|
||||
static void mlx5e_hv_vhca_stats_work(struct work_struct *work)
|
||||
@@ -100,7 +100,7 @@ static void mlx5e_hv_vhca_stats_control(struct mlx5_hv_vhca_agent *agent,
|
||||
sagent = &priv->stats_agent;
|
||||
|
||||
block->version = MLX5_HV_VHCA_STATS_VERSION;
|
||||
block->rings = priv->max_nch;
|
||||
block->rings = priv->stats_nch;
|
||||
|
||||
if (!block->command) {
|
||||
cancel_delayed_work_sync(&priv->stats_agent.work);
|
||||
|
||||
@@ -13,8 +13,6 @@ struct mlx5e_ptp_fs {
|
||||
bool valid;
|
||||
};
|
||||
|
||||
#define MLX5E_PTP_CHANNEL_IX 0
|
||||
|
||||
struct mlx5e_ptp_params {
|
||||
struct mlx5e_params params;
|
||||
struct mlx5e_sq_param txq_sq_param;
|
||||
@@ -509,6 +507,7 @@ static int mlx5e_init_ptp_rq(struct mlx5e_ptp *c, struct mlx5e_params *params,
|
||||
rq->mdev = mdev;
|
||||
rq->hw_mtu = MLX5E_SW2HW_MTU(params, params->sw_mtu);
|
||||
rq->stats = &c->priv->ptp_stats.rq;
|
||||
rq->ix = MLX5E_PTP_CHANNEL_IX;
|
||||
rq->ptp_cyc2time = mlx5_rq_ts_translator(mdev);
|
||||
err = mlx5e_rq_set_handlers(rq, params, false);
|
||||
if (err)
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "en_stats.h"
|
||||
#include <linux/ptp_classify.h>
|
||||
|
||||
#define MLX5E_PTP_CHANNEL_IX 0
|
||||
|
||||
struct mlx5e_ptpsq {
|
||||
struct mlx5e_txqsq txqsq;
|
||||
struct mlx5e_cq ts_cq;
|
||||
|
||||
@@ -2036,6 +2036,17 @@ static int set_pflag_tx_port_ts(struct net_device *netdev, bool enable)
|
||||
}
|
||||
|
||||
new_params = priv->channels.params;
|
||||
/* Don't allow enabling TX-port-TS if MQPRIO mode channel offload is
|
||||
* active, since it defines explicitly which TC accepts the packet.
|
||||
* This conflicts with TX-port-TS hijacking the PTP traffic to a specific
|
||||
* HW TX-queue.
|
||||
*/
|
||||
if (enable && new_params.mqprio.mode == TC_MQPRIO_MODE_CHANNEL) {
|
||||
netdev_err(priv->netdev,
|
||||
"%s: MQPRIO mode channel offload is active, cannot set the TX-port-TS\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
MLX5E_SET_PFLAG(&new_params, MLX5E_PFLAG_TX_PORT_TS, enable);
|
||||
/* No need to verify SQ stop room as
|
||||
* ptpsq.txqsq.stop_room <= generic_sq->stop_room, and both
|
||||
|
||||
@@ -2264,7 +2264,7 @@ void mlx5e_set_netdev_mtu_boundaries(struct mlx5e_priv *priv)
|
||||
}
|
||||
|
||||
static int mlx5e_netdev_set_tcs(struct net_device *netdev, u16 nch, u8 ntc,
|
||||
struct tc_mqprio_qopt_offload *mqprio)
|
||||
struct netdev_tc_txq *tc_to_txq)
|
||||
{
|
||||
int tc, err;
|
||||
|
||||
@@ -2282,11 +2282,8 @@ static int mlx5e_netdev_set_tcs(struct net_device *netdev, u16 nch, u8 ntc,
|
||||
for (tc = 0; tc < ntc; tc++) {
|
||||
u16 count, offset;
|
||||
|
||||
/* For DCB mode, map netdev TCs to offset 0
|
||||
* We have our own UP to TXQ mapping for QoS
|
||||
*/
|
||||
count = mqprio ? mqprio->qopt.count[tc] : nch;
|
||||
offset = mqprio ? mqprio->qopt.offset[tc] : 0;
|
||||
count = tc_to_txq[tc].count;
|
||||
offset = tc_to_txq[tc].offset;
|
||||
netdev_set_tc_queue(netdev, tc, count, offset);
|
||||
}
|
||||
|
||||
@@ -2315,19 +2312,24 @@ int mlx5e_update_tx_netdev_queues(struct mlx5e_priv *priv)
|
||||
|
||||
static int mlx5e_update_netdev_queues(struct mlx5e_priv *priv)
|
||||
{
|
||||
struct netdev_tc_txq old_tc_to_txq[TC_MAX_QUEUE], *tc_to_txq;
|
||||
struct net_device *netdev = priv->netdev;
|
||||
int old_num_txqs, old_ntc;
|
||||
int num_rxqs, nch, ntc;
|
||||
int err;
|
||||
int i;
|
||||
|
||||
old_num_txqs = netdev->real_num_tx_queues;
|
||||
old_ntc = netdev->num_tc ? : 1;
|
||||
for (i = 0; i < ARRAY_SIZE(old_tc_to_txq); i++)
|
||||
old_tc_to_txq[i] = netdev->tc_to_txq[i];
|
||||
|
||||
nch = priv->channels.params.num_channels;
|
||||
ntc = mlx5e_get_dcb_num_tc(&priv->channels.params);
|
||||
ntc = priv->channels.params.mqprio.num_tc;
|
||||
num_rxqs = nch * priv->profile->rq_groups;
|
||||
tc_to_txq = priv->channels.params.mqprio.tc_to_txq;
|
||||
|
||||
err = mlx5e_netdev_set_tcs(netdev, nch, ntc, NULL);
|
||||
err = mlx5e_netdev_set_tcs(netdev, nch, ntc, tc_to_txq);
|
||||
if (err)
|
||||
goto err_out;
|
||||
err = mlx5e_update_tx_netdev_queues(priv);
|
||||
@@ -2350,11 +2352,14 @@ err_txqs:
|
||||
WARN_ON_ONCE(netif_set_real_num_tx_queues(netdev, old_num_txqs));
|
||||
|
||||
err_tcs:
|
||||
mlx5e_netdev_set_tcs(netdev, old_num_txqs / old_ntc, old_ntc, NULL);
|
||||
WARN_ON_ONCE(mlx5e_netdev_set_tcs(netdev, old_num_txqs / old_ntc, old_ntc,
|
||||
old_tc_to_txq));
|
||||
err_out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static MLX5E_DEFINE_PREACTIVATE_WRAPPER_CTX(mlx5e_update_netdev_queues);
|
||||
|
||||
static void mlx5e_set_default_xps_cpumasks(struct mlx5e_priv *priv,
|
||||
struct mlx5e_params *params)
|
||||
{
|
||||
@@ -2861,6 +2866,58 @@ static int mlx5e_modify_channels_vsd(struct mlx5e_channels *chs, bool vsd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mlx5e_mqprio_build_default_tc_to_txq(struct netdev_tc_txq *tc_to_txq,
|
||||
int ntc, int nch)
|
||||
{
|
||||
int tc;
|
||||
|
||||
memset(tc_to_txq, 0, sizeof(*tc_to_txq) * TC_MAX_QUEUE);
|
||||
|
||||
/* Map netdev TCs to offset 0.
|
||||
* We have our own UP to TXQ mapping for DCB mode of QoS
|
||||
*/
|
||||
for (tc = 0; tc < ntc; tc++) {
|
||||
tc_to_txq[tc] = (struct netdev_tc_txq) {
|
||||
.count = nch,
|
||||
.offset = 0,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static void mlx5e_mqprio_build_tc_to_txq(struct netdev_tc_txq *tc_to_txq,
|
||||
struct tc_mqprio_qopt *qopt)
|
||||
{
|
||||
int tc;
|
||||
|
||||
for (tc = 0; tc < TC_MAX_QUEUE; tc++) {
|
||||
tc_to_txq[tc] = (struct netdev_tc_txq) {
|
||||
.count = qopt->count[tc],
|
||||
.offset = qopt->offset[tc],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static void mlx5e_params_mqprio_dcb_set(struct mlx5e_params *params, u8 num_tc)
|
||||
{
|
||||
params->mqprio.mode = TC_MQPRIO_MODE_DCB;
|
||||
params->mqprio.num_tc = num_tc;
|
||||
mlx5e_mqprio_build_default_tc_to_txq(params->mqprio.tc_to_txq, num_tc,
|
||||
params->num_channels);
|
||||
}
|
||||
|
||||
static void mlx5e_params_mqprio_channel_set(struct mlx5e_params *params,
|
||||
struct tc_mqprio_qopt *qopt)
|
||||
{
|
||||
params->mqprio.mode = TC_MQPRIO_MODE_CHANNEL;
|
||||
params->mqprio.num_tc = qopt->num_tc;
|
||||
mlx5e_mqprio_build_tc_to_txq(params->mqprio.tc_to_txq, qopt);
|
||||
}
|
||||
|
||||
static void mlx5e_params_mqprio_reset(struct mlx5e_params *params)
|
||||
{
|
||||
mlx5e_params_mqprio_dcb_set(params, 1);
|
||||
}
|
||||
|
||||
static int mlx5e_setup_tc_mqprio_dcb(struct mlx5e_priv *priv,
|
||||
struct tc_mqprio_qopt *mqprio)
|
||||
{
|
||||
@@ -2874,8 +2931,7 @@ static int mlx5e_setup_tc_mqprio_dcb(struct mlx5e_priv *priv,
|
||||
return -EINVAL;
|
||||
|
||||
new_params = priv->channels.params;
|
||||
new_params.mqprio.mode = TC_MQPRIO_MODE_DCB;
|
||||
new_params.mqprio.num_tc = tc ? tc : 1;
|
||||
mlx5e_params_mqprio_dcb_set(&new_params, tc ? tc : 1);
|
||||
|
||||
err = mlx5e_safe_switch_params(priv, &new_params,
|
||||
mlx5e_num_channels_changed_ctx, NULL, true);
|
||||
@@ -2889,9 +2945,17 @@ static int mlx5e_mqprio_channel_validate(struct mlx5e_priv *priv,
|
||||
struct tc_mqprio_qopt_offload *mqprio)
|
||||
{
|
||||
struct net_device *netdev = priv->netdev;
|
||||
struct mlx5e_ptp *ptp_channel;
|
||||
int agg_count = 0;
|
||||
int i;
|
||||
|
||||
ptp_channel = priv->channels.ptp;
|
||||
if (ptp_channel && test_bit(MLX5E_PTP_STATE_TX, ptp_channel->state)) {
|
||||
netdev_err(netdev,
|
||||
"Cannot activate MQPRIO mode channel since it conflicts with TX port TS\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (mqprio->qopt.offset[0] != 0 || mqprio->qopt.num_tc < 1 ||
|
||||
mqprio->qopt.num_tc > MLX5E_MAX_NUM_MQPRIO_CH_TC)
|
||||
return -EINVAL;
|
||||
@@ -2926,25 +2990,12 @@ static int mlx5e_mqprio_channel_validate(struct mlx5e_priv *priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mlx5e_mqprio_channel_set_tcs_ctx(struct mlx5e_priv *priv, void *ctx)
|
||||
{
|
||||
struct tc_mqprio_qopt_offload *mqprio = (struct tc_mqprio_qopt_offload *)ctx;
|
||||
struct net_device *netdev = priv->netdev;
|
||||
u8 num_tc;
|
||||
|
||||
if (priv->channels.params.mqprio.mode != TC_MQPRIO_MODE_CHANNEL)
|
||||
return -EINVAL;
|
||||
|
||||
num_tc = priv->channels.params.mqprio.num_tc;
|
||||
mlx5e_netdev_set_tcs(netdev, 0, num_tc, mqprio);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mlx5e_setup_tc_mqprio_channel(struct mlx5e_priv *priv,
|
||||
struct tc_mqprio_qopt_offload *mqprio)
|
||||
{
|
||||
mlx5e_fp_preactivate preactivate;
|
||||
struct mlx5e_params new_params;
|
||||
bool nch_changed;
|
||||
int err;
|
||||
|
||||
err = mlx5e_mqprio_channel_validate(priv, mqprio);
|
||||
@@ -2952,12 +3003,12 @@ static int mlx5e_setup_tc_mqprio_channel(struct mlx5e_priv *priv,
|
||||
return err;
|
||||
|
||||
new_params = priv->channels.params;
|
||||
new_params.mqprio.mode = TC_MQPRIO_MODE_CHANNEL;
|
||||
new_params.mqprio.num_tc = mqprio->qopt.num_tc;
|
||||
err = mlx5e_safe_switch_params(priv, &new_params,
|
||||
mlx5e_mqprio_channel_set_tcs_ctx, mqprio, true);
|
||||
mlx5e_params_mqprio_channel_set(&new_params, &mqprio->qopt);
|
||||
|
||||
return err;
|
||||
nch_changed = mlx5e_get_dcb_num_tc(&priv->channels.params) > 1;
|
||||
preactivate = nch_changed ? mlx5e_num_channels_changed_ctx :
|
||||
mlx5e_update_netdev_queues_ctx;
|
||||
return mlx5e_safe_switch_params(priv, &new_params, preactivate, NULL, true);
|
||||
}
|
||||
|
||||
static int mlx5e_setup_tc_mqprio(struct mlx5e_priv *priv,
|
||||
@@ -3065,7 +3116,7 @@ void mlx5e_fold_sw_stats64(struct mlx5e_priv *priv, struct rtnl_link_stats64 *s)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < priv->max_nch; i++) {
|
||||
for (i = 0; i < priv->stats_nch; i++) {
|
||||
struct mlx5e_channel_stats *channel_stats = &priv->channel_stats[i];
|
||||
struct mlx5e_rq_stats *xskrq_stats = &channel_stats->xskrq;
|
||||
struct mlx5e_rq_stats *rq_stats = &channel_stats->rq;
|
||||
@@ -4186,13 +4237,11 @@ void mlx5e_build_nic_params(struct mlx5e_priv *priv, struct mlx5e_xsk *xsk, u16
|
||||
struct mlx5_core_dev *mdev = priv->mdev;
|
||||
u8 rx_cq_period_mode;
|
||||
|
||||
priv->max_nch = mlx5e_calc_max_nch(priv, priv->profile);
|
||||
|
||||
params->sw_mtu = mtu;
|
||||
params->hard_mtu = MLX5E_ETH_HARD_MTU;
|
||||
params->num_channels = min_t(unsigned int, MLX5E_MAX_NUM_CHANNELS / 2,
|
||||
priv->max_nch);
|
||||
params->mqprio.num_tc = 1;
|
||||
mlx5e_params_mqprio_reset(params);
|
||||
|
||||
/* Set an initial non-zero value, so that mlx5e_select_queue won't
|
||||
* divide by zero if called before first activating channels.
|
||||
@@ -4682,8 +4731,35 @@ static const struct mlx5e_profile mlx5e_nic_profile = {
|
||||
.rx_ptp_support = true,
|
||||
};
|
||||
|
||||
static unsigned int
|
||||
mlx5e_calc_max_nch(struct mlx5_core_dev *mdev, struct net_device *netdev,
|
||||
const struct mlx5e_profile *profile)
|
||||
|
||||
{
|
||||
unsigned int max_nch, tmp;
|
||||
|
||||
/* core resources */
|
||||
max_nch = mlx5e_get_max_num_channels(mdev);
|
||||
|
||||
/* netdev rx queues */
|
||||
tmp = netdev->num_rx_queues / max_t(u8, profile->rq_groups, 1);
|
||||
max_nch = min_t(unsigned int, max_nch, tmp);
|
||||
|
||||
/* netdev tx queues */
|
||||
tmp = netdev->num_tx_queues;
|
||||
if (mlx5_qos_is_supported(mdev))
|
||||
tmp -= mlx5e_qos_max_leaf_nodes(mdev);
|
||||
if (MLX5_CAP_GEN(mdev, ts_cqe_to_dest_cqn))
|
||||
tmp -= profile->max_tc;
|
||||
tmp = tmp / profile->max_tc;
|
||||
max_nch = min_t(unsigned int, max_nch, tmp);
|
||||
|
||||
return max_nch;
|
||||
}
|
||||
|
||||
/* mlx5e generic netdev management API (move to en_common.c) */
|
||||
int mlx5e_priv_init(struct mlx5e_priv *priv,
|
||||
const struct mlx5e_profile *profile,
|
||||
struct net_device *netdev,
|
||||
struct mlx5_core_dev *mdev)
|
||||
{
|
||||
@@ -4691,6 +4767,8 @@ int mlx5e_priv_init(struct mlx5e_priv *priv,
|
||||
priv->mdev = mdev;
|
||||
priv->netdev = netdev;
|
||||
priv->msglevel = MLX5E_MSG_LEVEL;
|
||||
priv->max_nch = mlx5e_calc_max_nch(mdev, netdev, profile);
|
||||
priv->stats_nch = priv->max_nch;
|
||||
priv->max_opened_tc = 1;
|
||||
|
||||
if (!alloc_cpumask_var(&priv->scratchpad.cpumask, GFP_KERNEL))
|
||||
@@ -4734,7 +4812,8 @@ void mlx5e_priv_cleanup(struct mlx5e_priv *priv)
|
||||
}
|
||||
|
||||
struct net_device *
|
||||
mlx5e_create_netdev(struct mlx5_core_dev *mdev, unsigned int txqs, unsigned int rxqs)
|
||||
mlx5e_create_netdev(struct mlx5_core_dev *mdev, const struct mlx5e_profile *profile,
|
||||
unsigned int txqs, unsigned int rxqs)
|
||||
{
|
||||
struct net_device *netdev;
|
||||
int err;
|
||||
@@ -4745,7 +4824,7 @@ mlx5e_create_netdev(struct mlx5_core_dev *mdev, unsigned int txqs, unsigned int
|
||||
return NULL;
|
||||
}
|
||||
|
||||
err = mlx5e_priv_init(netdev_priv(netdev), netdev, mdev);
|
||||
err = mlx5e_priv_init(netdev_priv(netdev), profile, netdev, mdev);
|
||||
if (err) {
|
||||
mlx5_core_err(mdev, "mlx5e_priv_init failed, err=%d\n", err);
|
||||
goto err_free_netdev;
|
||||
@@ -4787,7 +4866,7 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
|
||||
clear_bit(MLX5E_STATE_DESTROYING, &priv->state);
|
||||
|
||||
/* max number of channels may have changed */
|
||||
max_nch = mlx5e_get_max_num_channels(priv->mdev);
|
||||
max_nch = mlx5e_calc_max_nch(priv->mdev, priv->netdev, profile);
|
||||
if (priv->channels.params.num_channels > max_nch) {
|
||||
mlx5_core_warn(priv->mdev, "MLX5E: Reducing number of channels to %d\n", max_nch);
|
||||
/* Reducing the number of channels - RXFH has to be reset, and
|
||||
@@ -4795,7 +4874,18 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
|
||||
*/
|
||||
priv->netdev->priv_flags &= ~IFF_RXFH_CONFIGURED;
|
||||
priv->channels.params.num_channels = max_nch;
|
||||
if (priv->channels.params.mqprio.mode == TC_MQPRIO_MODE_CHANNEL) {
|
||||
mlx5_core_warn(priv->mdev, "MLX5E: Disabling MQPRIO channel mode\n");
|
||||
mlx5e_params_mqprio_reset(&priv->channels.params);
|
||||
}
|
||||
}
|
||||
if (max_nch != priv->max_nch) {
|
||||
mlx5_core_warn(priv->mdev,
|
||||
"MLX5E: Updating max number of channels from %u to %u\n",
|
||||
priv->max_nch, max_nch);
|
||||
priv->max_nch = max_nch;
|
||||
}
|
||||
|
||||
/* 1. Set the real number of queues in the kernel the first time.
|
||||
* 2. Set our default XPS cpumask.
|
||||
* 3. Build the RQT.
|
||||
@@ -4860,7 +4950,7 @@ mlx5e_netdev_attach_profile(struct net_device *netdev, struct mlx5_core_dev *mde
|
||||
struct mlx5e_priv *priv = netdev_priv(netdev);
|
||||
int err;
|
||||
|
||||
err = mlx5e_priv_init(priv, netdev, mdev);
|
||||
err = mlx5e_priv_init(priv, new_profile, netdev, mdev);
|
||||
if (err) {
|
||||
mlx5_core_err(mdev, "mlx5e_priv_init failed, err=%d\n", err);
|
||||
return err;
|
||||
@@ -4886,20 +4976,12 @@ priv_cleanup:
|
||||
int mlx5e_netdev_change_profile(struct mlx5e_priv *priv,
|
||||
const struct mlx5e_profile *new_profile, void *new_ppriv)
|
||||
{
|
||||
unsigned int new_max_nch = mlx5e_calc_max_nch(priv, new_profile);
|
||||
const struct mlx5e_profile *orig_profile = priv->profile;
|
||||
struct net_device *netdev = priv->netdev;
|
||||
struct mlx5_core_dev *mdev = priv->mdev;
|
||||
void *orig_ppriv = priv->ppriv;
|
||||
int err, rollback_err;
|
||||
|
||||
/* sanity */
|
||||
if (new_max_nch != priv->max_nch) {
|
||||
netdev_warn(netdev, "%s: Replacing profile with different max channels\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* cleanup old profile */
|
||||
mlx5e_detach_netdev(priv);
|
||||
priv->profile->cleanup(priv);
|
||||
@@ -4995,7 +5077,7 @@ static int mlx5e_probe(struct auxiliary_device *adev,
|
||||
nch = mlx5e_get_max_num_channels(mdev);
|
||||
txqs = nch * profile->max_tc + ptp_txqs + qos_sqs;
|
||||
rxqs = nch * profile->rq_groups;
|
||||
netdev = mlx5e_create_netdev(mdev, txqs, rxqs);
|
||||
netdev = mlx5e_create_netdev(mdev, profile, txqs, rxqs);
|
||||
if (!netdev) {
|
||||
mlx5_core_err(mdev, "mlx5e_create_netdev failed\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -596,7 +596,6 @@ static void mlx5e_build_rep_params(struct net_device *netdev)
|
||||
MLX5_CQ_PERIOD_MODE_START_FROM_CQE :
|
||||
MLX5_CQ_PERIOD_MODE_START_FROM_EQE;
|
||||
|
||||
priv->max_nch = mlx5e_calc_max_nch(priv, priv->profile);
|
||||
params = &priv->channels.params;
|
||||
|
||||
params->num_channels = MLX5E_REP_PARAMS_DEF_NUM_CHANNELS;
|
||||
@@ -1169,7 +1168,7 @@ mlx5e_vport_vf_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
|
||||
nch = mlx5e_get_max_num_channels(dev);
|
||||
txqs = nch * profile->max_tc;
|
||||
rxqs = nch * profile->rq_groups;
|
||||
netdev = mlx5e_create_netdev(dev, txqs, rxqs);
|
||||
netdev = mlx5e_create_netdev(dev, profile, txqs, rxqs);
|
||||
if (!netdev) {
|
||||
mlx5_core_warn(dev,
|
||||
"Failed to create representor netdev for vport %d\n",
|
||||
|
||||
@@ -1001,14 +1001,9 @@ static inline void mlx5e_handle_csum(struct net_device *netdev,
|
||||
goto csum_unnecessary;
|
||||
|
||||
if (likely(is_last_ethertype_ip(skb, &network_depth, &proto))) {
|
||||
u8 ipproto = get_ip_proto(skb, network_depth, proto);
|
||||
|
||||
if (unlikely(ipproto == IPPROTO_SCTP))
|
||||
if (unlikely(get_ip_proto(skb, network_depth, proto) == IPPROTO_SCTP))
|
||||
goto csum_unnecessary;
|
||||
|
||||
if (unlikely(mlx5_ipsec_is_rx_flow(cqe)))
|
||||
goto csum_none;
|
||||
|
||||
stats->csum_complete++;
|
||||
skb->ip_summed = CHECKSUM_COMPLETE;
|
||||
skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "en.h"
|
||||
#include "en_accel/tls.h"
|
||||
#include "en_accel/en_accel.h"
|
||||
#include "en/ptp.h"
|
||||
|
||||
static unsigned int stats_grps_num(struct mlx5e_priv *priv)
|
||||
{
|
||||
@@ -450,7 +451,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(sw)
|
||||
|
||||
memset(s, 0, sizeof(*s));
|
||||
|
||||
for (i = 0; i < priv->max_nch; i++) {
|
||||
for (i = 0; i < priv->stats_nch; i++) {
|
||||
struct mlx5e_channel_stats *channel_stats =
|
||||
&priv->channel_stats[i];
|
||||
int j;
|
||||
@@ -2076,7 +2077,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(ptp)
|
||||
if (priv->rx_ptp_opened) {
|
||||
for (i = 0; i < NUM_PTP_RQ_STATS; i++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
ptp_rq_stats_desc[i].format);
|
||||
ptp_rq_stats_desc[i].format, MLX5E_PTP_CHANNEL_IX);
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
@@ -2119,7 +2120,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(ptp) { return; }
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(channels)
|
||||
{
|
||||
int max_nch = priv->max_nch;
|
||||
int max_nch = priv->stats_nch;
|
||||
|
||||
return (NUM_RQ_STATS * max_nch) +
|
||||
(NUM_CH_STATS * max_nch) +
|
||||
@@ -2133,7 +2134,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(channels)
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(channels)
|
||||
{
|
||||
bool is_xsk = priv->xsk.ever_used;
|
||||
int max_nch = priv->max_nch;
|
||||
int max_nch = priv->stats_nch;
|
||||
int i, j, tc;
|
||||
|
||||
for (i = 0; i < max_nch; i++)
|
||||
@@ -2175,7 +2176,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(channels)
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(channels)
|
||||
{
|
||||
bool is_xsk = priv->xsk.ever_used;
|
||||
int max_nch = priv->max_nch;
|
||||
int max_nch = priv->stats_nch;
|
||||
int i, j, tc;
|
||||
|
||||
for (i = 0; i < max_nch; i++)
|
||||
|
||||
@@ -79,12 +79,16 @@ int esw_acl_egress_lgcy_setup(struct mlx5_eswitch *esw,
|
||||
int dest_num = 0;
|
||||
int err = 0;
|
||||
|
||||
if (MLX5_CAP_ESW_EGRESS_ACL(esw->dev, flow_counter)) {
|
||||
if (vport->egress.legacy.drop_counter) {
|
||||
drop_counter = vport->egress.legacy.drop_counter;
|
||||
} else if (MLX5_CAP_ESW_EGRESS_ACL(esw->dev, flow_counter)) {
|
||||
drop_counter = mlx5_fc_create(esw->dev, false);
|
||||
if (IS_ERR(drop_counter))
|
||||
if (IS_ERR(drop_counter)) {
|
||||
esw_warn(esw->dev,
|
||||
"vport[%d] configure egress drop rule counter err(%ld)\n",
|
||||
vport->vport, PTR_ERR(drop_counter));
|
||||
drop_counter = NULL;
|
||||
}
|
||||
vport->egress.legacy.drop_counter = drop_counter;
|
||||
}
|
||||
|
||||
@@ -123,7 +127,7 @@ int esw_acl_egress_lgcy_setup(struct mlx5_eswitch *esw,
|
||||
flow_act.action = MLX5_FLOW_CONTEXT_ACTION_DROP;
|
||||
|
||||
/* Attach egress drop flow counter */
|
||||
if (!IS_ERR_OR_NULL(drop_counter)) {
|
||||
if (drop_counter) {
|
||||
flow_act.action |= MLX5_FLOW_CONTEXT_ACTION_COUNT;
|
||||
drop_ctr_dst.type = MLX5_FLOW_DESTINATION_TYPE_COUNTER;
|
||||
drop_ctr_dst.counter_id = mlx5_fc_id(drop_counter);
|
||||
@@ -162,7 +166,7 @@ void esw_acl_egress_lgcy_cleanup(struct mlx5_eswitch *esw,
|
||||
esw_acl_egress_table_destroy(vport);
|
||||
|
||||
clean_drop_counter:
|
||||
if (!IS_ERR_OR_NULL(vport->egress.legacy.drop_counter)) {
|
||||
if (vport->egress.legacy.drop_counter) {
|
||||
mlx5_fc_destroy(esw->dev, vport->egress.legacy.drop_counter);
|
||||
vport->egress.legacy.drop_counter = NULL;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user