Skip to content

Commit 19835b1

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: "Another week, another set of bug fixes: 1) Fix pskb_pull length in __xfrm_transport_prep(), from Xin Long. 2) Fix double xfrm_state put in esp{4,6}_gro_receive(), also from Xin Long. 3) Re-arm discovery timer properly in mac80211 mesh code, from Linus Lüssing. 4) Prevent buffer overflows in nf_conntrack_pptp debug code, from Pablo Neira Ayuso. 5) Fix race in ktls code between tls_sw_recvmsg() and tls_decrypt_done(), from Vinay Kumar Yadav. 6) Fix crashes on TCP fallback in MPTCP code, from Paolo Abeni. 7) More validation is necessary of untrusted GSO packets coming from virtualization devices, from Willem de Bruijn. 8) Fix endianness of bnxt_en firmware message length accesses, from Edwin Peer. 9) Fix infinite loop in sch_fq_pie, from Davide Caratti. 10) Fix lockdep splat in DSA by setting lockless TX in netdev features for slave ports, from Vladimir Oltean. 11) Fix suspend/resume crashes in mlx5, from Mark Bloch. 12) Fix use after free in bpf fmod_ret, from Alexei Starovoitov. 13) ARP retransmit timer guard uses wrong offset, from Hongbin Liu. 14) Fix leak in inetdev_init(), from Yang Yingliang. 15) Don't try to use inet hash and unhash in l2tp code, results in crashes. From Eric Dumazet" * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (77 commits) l2tp: add sk_family checks to l2tp_validate_socket l2tp: do not use inet_hash()/inet_unhash() net: qrtr: Allocate workqueue before kernel_bind mptcp: remove msk from the token container at destruction time. mptcp: fix race between MP_JOIN and close mptcp: fix unblocking connect() net/sched: act_ct: add nat mangle action only for NAT-conntrack devinet: fix memleak in inetdev_init() virtio_vsock: Fix race condition in virtio_transport_recv_pkt drivers/net/ibmvnic: Update VNIC protocol version reporting NFC: st21nfca: add missed kfree_skb() in an error path neigh: fix ARP retransmit timer guard bpf, selftests: Add a verifier test for assigning 32bit reg states to 64bit ones bpf, selftests: Verifier bounds tests need to be updated bpf: Fix a verifier issue when assigning 32bit reg states to 64bit ones bpf: Fix use-after-free in fmod_ret check net/mlx5e: replace EINVAL in mlx5e_flower_parse_meta() net/mlx5e: Fix MLX5_TC_CT dependencies net/mlx5e: Properly set default values when disabling adaptive moderation net/mlx5e: Fix arch depending casting issue in FEC ...
2 parents ffeb595 + d9a81a2 commit 19835b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+806
-337
lines changed

arch/powerpc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ config PPC
126126
select ARCH_HAS_MMIOWB if PPC64
127127
select ARCH_HAS_PHYS_TO_DMA
128128
select ARCH_HAS_PMEM_API
129+
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
129130
select ARCH_HAS_PTE_DEVMAP if PPC_BOOK3S_64
130131
select ARCH_HAS_PTE_SPECIAL
131132
select ARCH_HAS_MEMBARRIER_CALLBACKS

drivers/crypto/chelsio/chtls/chtls_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ int chtls_push_frames(struct chtls_sock *csk, int comp)
682682
make_tx_data_wr(sk, skb, immdlen, len,
683683
credits_needed, completion);
684684
tp->snd_nxt += len;
685-
tp->lsndtime = tcp_time_stamp(tp);
685+
tp->lsndtime = tcp_jiffies32;
686686
if (completion)
687687
ULP_SKB_CB(skb)->flags &= ~ULPCB_FLAG_NEED_HDR;
688688
} else {

drivers/net/bonding/bond_sysfs_slave.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@ int bond_sysfs_slave_add(struct slave *slave)
149149

150150
err = kobject_init_and_add(&slave->kobj, &slave_ktype,
151151
&(slave->dev->dev.kobj), "bonding_slave");
152-
if (err)
152+
if (err) {
153+
kobject_put(&slave->kobj);
153154
return err;
155+
}
154156

155157
for (a = slave_attrs; *a; ++a) {
156158
err = sysfs_create_file(&slave->kobj, &((*a)->attr));

drivers/net/dsa/ocelot/felix.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,17 @@ static void felix_vlan_add(struct dsa_switch *ds, int port,
102102
const struct switchdev_obj_port_vlan *vlan)
103103
{
104104
struct ocelot *ocelot = ds->priv;
105+
u16 flags = vlan->flags;
105106
u16 vid;
106107
int err;
107108

109+
if (dsa_is_cpu_port(ds, port))
110+
flags &= ~BRIDGE_VLAN_INFO_UNTAGGED;
111+
108112
for (vid = vlan->vid_begin; vid <= vlan->vid_end; vid++) {
109113
err = ocelot_vlan_add(ocelot, port, vid,
110-
vlan->flags & BRIDGE_VLAN_INFO_PVID,
111-
vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED);
114+
flags & BRIDGE_VLAN_INFO_PVID,
115+
flags & BRIDGE_VLAN_INFO_UNTAGGED);
112116
if (err) {
113117
dev_err(ds->dev, "Failed to add VLAN %d to port %d: %d\n",
114118
vid, port, err);

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4176,14 +4176,12 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
41764176
int i, intr_process, rc, tmo_count;
41774177
struct input *req = msg;
41784178
u32 *data = msg;
4179-
__le32 *resp_len;
41804179
u8 *valid;
41814180
u16 cp_ring_id, len = 0;
41824181
struct hwrm_err_output *resp = bp->hwrm_cmd_resp_addr;
41834182
u16 max_req_len = BNXT_HWRM_MAX_REQ_LEN;
41844183
struct hwrm_short_input short_input = {0};
41854184
u32 doorbell_offset = BNXT_GRCPF_REG_CHIMP_COMM_TRIGGER;
4186-
u8 *resp_addr = (u8 *)bp->hwrm_cmd_resp_addr;
41874185
u32 bar_offset = BNXT_GRCPF_REG_CHIMP_COMM;
41884186
u16 dst = BNXT_HWRM_CHNL_CHIMP;
41894187

@@ -4201,7 +4199,6 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
42014199
bar_offset = BNXT_GRCPF_REG_KONG_COMM;
42024200
doorbell_offset = BNXT_GRCPF_REG_KONG_COMM_TRIGGER;
42034201
resp = bp->hwrm_cmd_kong_resp_addr;
4204-
resp_addr = (u8 *)bp->hwrm_cmd_kong_resp_addr;
42054202
}
42064203

42074204
memset(resp, 0, PAGE_SIZE);
@@ -4270,7 +4267,6 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
42704267
tmo_count = HWRM_SHORT_TIMEOUT_COUNTER;
42714268
timeout = timeout - HWRM_SHORT_MIN_TIMEOUT * HWRM_SHORT_TIMEOUT_COUNTER;
42724269
tmo_count += DIV_ROUND_UP(timeout, HWRM_MIN_TIMEOUT);
4273-
resp_len = (__le32 *)(resp_addr + HWRM_RESP_LEN_OFFSET);
42744270

42754271
if (intr_process) {
42764272
u16 seq_id = bp->hwrm_intr_seq_id;
@@ -4298,9 +4294,8 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
42984294
le16_to_cpu(req->req_type));
42994295
return -EBUSY;
43004296
}
4301-
len = (le32_to_cpu(*resp_len) & HWRM_RESP_LEN_MASK) >>
4302-
HWRM_RESP_LEN_SFT;
4303-
valid = resp_addr + len - 1;
4297+
len = le16_to_cpu(resp->resp_len);
4298+
valid = ((u8 *)resp) + len - 1;
43044299
} else {
43054300
int j;
43064301

@@ -4311,8 +4306,7 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
43114306
*/
43124307
if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state))
43134308
return -EBUSY;
4314-
len = (le32_to_cpu(*resp_len) & HWRM_RESP_LEN_MASK) >>
4315-
HWRM_RESP_LEN_SFT;
4309+
len = le16_to_cpu(resp->resp_len);
43164310
if (len)
43174311
break;
43184312
/* on first few passes, just barely sleep */
@@ -4334,7 +4328,7 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
43344328
}
43354329

43364330
/* Last byte of resp contains valid bit */
4337-
valid = resp_addr + len - 1;
4331+
valid = ((u8 *)resp) + len - 1;
43384332
for (j = 0; j < HWRM_VALID_BIT_DELAY_USEC; j++) {
43394333
/* make sure we read from updated DMA memory */
43404334
dma_rmb();
@@ -9310,7 +9304,7 @@ static void __bnxt_close_nic(struct bnxt *bp, bool irq_re_init,
93109304
bnxt_free_skbs(bp);
93119305

93129306
/* Save ring stats before shutdown */
9313-
if (bp->bnapi)
9307+
if (bp->bnapi && irq_re_init)
93149308
bnxt_get_ring_stats(bp, &bp->net_stats_prev);
93159309
if (irq_re_init) {
93169310
bnxt_free_irq(bp);

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -656,11 +656,6 @@ struct nqe_cn {
656656
#define HWRM_CMD_TIMEOUT (bp->hwrm_cmd_timeout)
657657
#define HWRM_RESET_TIMEOUT ((HWRM_CMD_TIMEOUT) * 4)
658658
#define HWRM_COREDUMP_TIMEOUT ((HWRM_CMD_TIMEOUT) * 12)
659-
#define HWRM_RESP_ERR_CODE_MASK 0xffff
660-
#define HWRM_RESP_LEN_OFFSET 4
661-
#define HWRM_RESP_LEN_MASK 0xffff0000
662-
#define HWRM_RESP_LEN_SFT 16
663-
#define HWRM_RESP_VALID_MASK 0xff000000
664659
#define BNXT_HWRM_REQ_MAX_SIZE 128
665660
#define BNXT_HWRM_REQS_PER_PAGE (BNXT_PAGE_SIZE / \
666661
BNXT_HWRM_REQ_MAX_SIZE)

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,11 +2012,12 @@ int bnxt_flash_package_from_file(struct net_device *dev, const char *filename,
20122012

20132013
bnxt_hwrm_fw_set_time(bp);
20142014

2015-
if (bnxt_find_nvram_item(dev, BNX_DIR_TYPE_UPDATE,
2016-
BNX_DIR_ORDINAL_FIRST, BNX_DIR_EXT_NONE,
2017-
&index, &item_len, NULL) != 0) {
2015+
rc = bnxt_find_nvram_item(dev, BNX_DIR_TYPE_UPDATE,
2016+
BNX_DIR_ORDINAL_FIRST, BNX_DIR_EXT_NONE,
2017+
&index, &item_len, NULL);
2018+
if (rc) {
20182019
netdev_err(dev, "PKG update area not created in nvram\n");
2019-
return -ENOBUFS;
2020+
return rc;
20202021
}
20212022

20222023
rc = request_firmware(&fw, filename, &dev->dev);

drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2914,7 +2914,7 @@ static int dpaa_eth_probe(struct platform_device *pdev)
29142914
}
29152915

29162916
/* Do this here, so we can be verbose early */
2917-
SET_NETDEV_DEV(net_dev, dev);
2917+
SET_NETDEV_DEV(net_dev, dev->parent);
29182918
dev_set_drvdata(dev, net_dev);
29192919

29202920
priv = netdev_priv(net_dev);

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4678,12 +4678,10 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq,
46784678
dev_err(dev, "Error %ld in VERSION_EXCHG_RSP\n", rc);
46794679
break;
46804680
}
4681-
dev_info(dev, "Partner protocol version is %d\n",
4682-
crq->version_exchange_rsp.version);
4683-
if (be16_to_cpu(crq->version_exchange_rsp.version) <
4684-
ibmvnic_version)
4685-
ibmvnic_version =
4681+
ibmvnic_version =
46864682
be16_to_cpu(crq->version_exchange_rsp.version);
4683+
dev_info(dev, "Partner protocol version is %d\n",
4684+
ibmvnic_version);
46874685
send_cap_queries(adapter);
46884686
break;
46894687
case QUERY_CAPABILITY_RSP:

drivers/net/ethernet/mellanox/mlx5/core/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ config MLX5_ESWITCH
8080

8181
config MLX5_TC_CT
8282
bool "MLX5 TC connection tracking offload support"
83-
depends on MLX5_CORE_EN && NET_SWITCHDEV && NF_FLOW_TABLE && NET_ACT_CT && NET_TC_SKB_EXT
83+
depends on MLX5_ESWITCH && NF_FLOW_TABLE && NET_ACT_CT && NET_TC_SKB_EXT
8484
default y
8585
help
8686
Say Y here if you want to support offloading connection tracking rules

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,10 +1068,12 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv);
10681068

10691069
void mlx5e_build_default_indir_rqt(u32 *indirection_rqt, int len,
10701070
int num_channels);
1071-
void mlx5e_set_tx_cq_mode_params(struct mlx5e_params *params,
1072-
u8 cq_period_mode);
1073-
void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params,
1074-
u8 cq_period_mode);
1071+
1072+
void mlx5e_reset_tx_moderation(struct mlx5e_params *params, u8 cq_period_mode);
1073+
void mlx5e_reset_rx_moderation(struct mlx5e_params *params, u8 cq_period_mode);
1074+
void mlx5e_set_tx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode);
1075+
void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode);
1076+
10751077
void mlx5e_set_rq_type(struct mlx5_core_dev *mdev, struct mlx5e_params *params);
10761078
void mlx5e_init_rq_type_params(struct mlx5_core_dev *mdev,
10771079
struct mlx5e_params *params);

drivers/net/ethernet/mellanox/mlx5/core/en/port.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -369,17 +369,19 @@ enum mlx5e_fec_supported_link_mode {
369369
*_policy = MLX5_GET(pplm_reg, _buf, fec_override_admin_##link); \
370370
} while (0)
371371

372-
#define MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(buf, policy, write, link) \
373-
do { \
374-
u16 *__policy = &(policy); \
375-
bool _write = (write); \
376-
\
377-
if (_write && *__policy) \
378-
*__policy = find_first_bit((u_long *)__policy, \
379-
sizeof(u16) * BITS_PER_BYTE);\
380-
MLX5E_FEC_OVERRIDE_ADMIN_POLICY(buf, *__policy, _write, link); \
381-
if (!_write && *__policy) \
382-
*__policy = 1 << *__policy; \
372+
#define MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(buf, policy, write, link) \
373+
do { \
374+
unsigned long policy_long; \
375+
u16 *__policy = &(policy); \
376+
bool _write = (write); \
377+
\
378+
policy_long = *__policy; \
379+
if (_write && *__policy) \
380+
*__policy = find_first_bit(&policy_long, \
381+
sizeof(policy_long) * BITS_PER_BYTE);\
382+
MLX5E_FEC_OVERRIDE_ADMIN_POLICY(buf, *__policy, _write, link); \
383+
if (!_write && *__policy) \
384+
*__policy = 1 << *__policy; \
383385
} while (0)
384386

385387
/* get/set FEC admin field for a given speed */

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,8 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv,
527527
struct dim_cq_moder *rx_moder, *tx_moder;
528528
struct mlx5_core_dev *mdev = priv->mdev;
529529
struct mlx5e_channels new_channels = {};
530+
bool reset_rx, reset_tx;
530531
int err = 0;
531-
bool reset;
532532

533533
if (!MLX5_CAP_GEN(mdev, cq_moderation))
534534
return -EOPNOTSUPP;
@@ -566,15 +566,28 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv,
566566
}
567567
/* we are opened */
568568

569-
reset = (!!coal->use_adaptive_rx_coalesce != priv->channels.params.rx_dim_enabled) ||
570-
(!!coal->use_adaptive_tx_coalesce != priv->channels.params.tx_dim_enabled);
569+
reset_rx = !!coal->use_adaptive_rx_coalesce != priv->channels.params.rx_dim_enabled;
570+
reset_tx = !!coal->use_adaptive_tx_coalesce != priv->channels.params.tx_dim_enabled;
571571

572-
if (!reset) {
572+
if (!reset_rx && !reset_tx) {
573573
mlx5e_set_priv_channels_coalesce(priv, coal);
574574
priv->channels.params = new_channels.params;
575575
goto out;
576576
}
577577

578+
if (reset_rx) {
579+
u8 mode = MLX5E_GET_PFLAG(&new_channels.params,
580+
MLX5E_PFLAG_RX_CQE_BASED_MODER);
581+
582+
mlx5e_reset_rx_moderation(&new_channels.params, mode);
583+
}
584+
if (reset_tx) {
585+
u8 mode = MLX5E_GET_PFLAG(&new_channels.params,
586+
MLX5E_PFLAG_TX_CQE_BASED_MODER);
587+
588+
mlx5e_reset_tx_moderation(&new_channels.params, mode);
589+
}
590+
578591
err = mlx5e_safe_switch_channels(priv, &new_channels, NULL, NULL);
579592

580593
out:
@@ -665,11 +678,12 @@ static const u32 pplm_fec_2_ethtool_linkmodes[] = {
665678
static int get_fec_supported_advertised(struct mlx5_core_dev *dev,
666679
struct ethtool_link_ksettings *link_ksettings)
667680
{
668-
u_long active_fec = 0;
681+
unsigned long active_fec_long;
682+
u32 active_fec;
669683
u32 bitn;
670684
int err;
671685

672-
err = mlx5e_get_fec_mode(dev, (u32 *)&active_fec, NULL);
686+
err = mlx5e_get_fec_mode(dev, &active_fec, NULL);
673687
if (err)
674688
return (err == -EOPNOTSUPP) ? 0 : err;
675689

@@ -682,10 +696,11 @@ static int get_fec_supported_advertised(struct mlx5_core_dev *dev,
682696
MLX5E_ADVERTISE_SUPPORTED_FEC(MLX5E_FEC_LLRS_272_257_1,
683697
ETHTOOL_LINK_MODE_FEC_LLRS_BIT);
684698

699+
active_fec_long = active_fec;
685700
/* active fec is a bit set, find out which bit is set and
686701
* advertise the corresponding ethtool bit
687702
*/
688-
bitn = find_first_bit(&active_fec, sizeof(u32) * BITS_PER_BYTE);
703+
bitn = find_first_bit(&active_fec_long, sizeof(active_fec_long) * BITS_PER_BYTE);
689704
if (bitn < ARRAY_SIZE(pplm_fec_2_ethtool_linkmodes))
690705
__set_bit(pplm_fec_2_ethtool_linkmodes[bitn],
691706
link_ksettings->link_modes.advertising);
@@ -1517,23 +1532,23 @@ static int mlx5e_get_fecparam(struct net_device *netdev,
15171532
{
15181533
struct mlx5e_priv *priv = netdev_priv(netdev);
15191534
struct mlx5_core_dev *mdev = priv->mdev;
1520-
u16 fec_configured = 0;
1521-
u32 fec_active = 0;
1535+
u16 fec_configured;
1536+
u32 fec_active;
15221537
int err;
15231538

15241539
err = mlx5e_get_fec_mode(mdev, &fec_active, &fec_configured);
15251540

15261541
if (err)
15271542
return err;
15281543

1529-
fecparam->active_fec = pplm2ethtool_fec((u_long)fec_active,
1530-
sizeof(u32) * BITS_PER_BYTE);
1544+
fecparam->active_fec = pplm2ethtool_fec((unsigned long)fec_active,
1545+
sizeof(unsigned long) * BITS_PER_BYTE);
15311546

15321547
if (!fecparam->active_fec)
15331548
return -EOPNOTSUPP;
15341549

1535-
fecparam->fec = pplm2ethtool_fec((u_long)fec_configured,
1536-
sizeof(u16) * BITS_PER_BYTE);
1550+
fecparam->fec = pplm2ethtool_fec((unsigned long)fec_configured,
1551+
sizeof(unsigned long) * BITS_PER_BYTE);
15371552

15381553
return 0;
15391554
}

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4716,7 +4716,7 @@ static u8 mlx5_to_net_dim_cq_period_mode(u8 cq_period_mode)
47164716
DIM_CQ_PERIOD_MODE_START_FROM_EQE;
47174717
}
47184718

4719-
void mlx5e_set_tx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode)
4719+
void mlx5e_reset_tx_moderation(struct mlx5e_params *params, u8 cq_period_mode)
47204720
{
47214721
if (params->tx_dim_enabled) {
47224722
u8 dim_period_mode = mlx5_to_net_dim_cq_period_mode(cq_period_mode);
@@ -4725,13 +4725,9 @@ void mlx5e_set_tx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode)
47254725
} else {
47264726
params->tx_cq_moderation = mlx5e_get_def_tx_moderation(cq_period_mode);
47274727
}
4728-
4729-
MLX5E_SET_PFLAG(params, MLX5E_PFLAG_TX_CQE_BASED_MODER,
4730-
params->tx_cq_moderation.cq_period_mode ==
4731-
MLX5_CQ_PERIOD_MODE_START_FROM_CQE);
47324728
}
47334729

4734-
void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode)
4730+
void mlx5e_reset_rx_moderation(struct mlx5e_params *params, u8 cq_period_mode)
47354731
{
47364732
if (params->rx_dim_enabled) {
47374733
u8 dim_period_mode = mlx5_to_net_dim_cq_period_mode(cq_period_mode);
@@ -4740,7 +4736,19 @@ void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode)
47404736
} else {
47414737
params->rx_cq_moderation = mlx5e_get_def_rx_moderation(cq_period_mode);
47424738
}
4739+
}
4740+
4741+
void mlx5e_set_tx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode)
4742+
{
4743+
mlx5e_reset_tx_moderation(params, cq_period_mode);
4744+
MLX5E_SET_PFLAG(params, MLX5E_PFLAG_TX_CQE_BASED_MODER,
4745+
params->tx_cq_moderation.cq_period_mode ==
4746+
MLX5_CQ_PERIOD_MODE_START_FROM_CQE);
4747+
}
47434748

4749+
void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode)
4750+
{
4751+
mlx5e_reset_rx_moderation(params, cq_period_mode);
47444752
MLX5E_SET_PFLAG(params, MLX5E_PFLAG_RX_CQE_BASED_MODER,
47454753
params->rx_cq_moderation.cq_period_mode ==
47464754
MLX5_CQ_PERIOD_MODE_START_FROM_CQE);

0 commit comments

Comments
 (0)