From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Junlong Wang <wang.junlong1@zte.com.cn>,
Lijie Shan <shan.lijie@zte.com.cn>
Subject: [RFC 5/5] net/zxdh: fix indentation in mtr get and use assign
Date: Sat, 22 Feb 2025 18:42:24 -0800 [thread overview]
Message-ID: <20250223024334.1216477-6-stephen@networkplumber.org> (raw)
In-Reply-To: <20250223024334.1216477-1-stephen@networkplumber.org>
Fix the indentation of the initialized structure and
use assignment instead of memcpy
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/zxdh/zxdh_mtr.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/net/zxdh/zxdh_mtr.c b/drivers/net/zxdh/zxdh_mtr.c
index 2df5f1cd88..3797a5b29b 100644
--- a/drivers/net/zxdh/zxdh_mtr.c
+++ b/drivers/net/zxdh/zxdh_mtr.c
@@ -151,22 +151,22 @@ zxdh_meter_cap_get(struct rte_eth_dev *dev __rte_unused,
struct rte_mtr_error *error __rte_unused)
{
struct rte_mtr_capabilities capa = {
- .n_max = ZXDH_MAX_MTR_NUM,
- .n_shared_max = ZXDH_SHARE_FLOW_MAX,
- .meter_srtcm_rfc2697_n_max = ZXDH_MAX_MTR_PROFILE_NUM,
- .meter_trtcm_rfc2698_n_max = ZXDH_MAX_MTR_PROFILE_NUM,
- .color_aware_srtcm_rfc2697_supported = 1,
- .color_aware_trtcm_rfc2698_supported = 1,
- .meter_rate_max = ZXDH_SRTCM_CIR_MAX_BPS,
- .meter_policy_n_max = ZXDH_MAX_POLICY_NUM,
- .srtcm_rfc2697_byte_mode_supported = 1,
- .srtcm_rfc2697_packet_mode_supported = 1,
- .trtcm_rfc2698_byte_mode_supported = 1,
- .trtcm_rfc2698_packet_mode_supported = 1,
- .stats_mask = RTE_MTR_STATS_N_PKTS_DROPPED | RTE_MTR_STATS_N_BYTES_DROPPED,
+ .n_max = ZXDH_MAX_MTR_NUM,
+ .n_shared_max = ZXDH_SHARE_FLOW_MAX,
+ .meter_srtcm_rfc2697_n_max = ZXDH_MAX_MTR_PROFILE_NUM,
+ .meter_trtcm_rfc2698_n_max = ZXDH_MAX_MTR_PROFILE_NUM,
+ .color_aware_srtcm_rfc2697_supported = 1,
+ .color_aware_trtcm_rfc2698_supported = 1,
+ .meter_rate_max = ZXDH_SRTCM_CIR_MAX_BPS,
+ .meter_policy_n_max = ZXDH_MAX_POLICY_NUM,
+ .srtcm_rfc2697_byte_mode_supported = 1,
+ .srtcm_rfc2697_packet_mode_supported = 1,
+ .trtcm_rfc2698_byte_mode_supported = 1,
+ .trtcm_rfc2698_packet_mode_supported = 1,
+ .stats_mask = RTE_MTR_STATS_N_PKTS_DROPPED | RTE_MTR_STATS_N_BYTES_DROPPED,
};
- memcpy(cap, &capa, sizeof(capa));
+ *cap = capa;
return 0;
}
--
2.47.2
prev parent reply other threads:[~2025-02-23 2:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-23 2:42 [RFC 0/5] net/zxdh: possible changes Stephen Hemminger
2025-02-23 2:42 ` [RFC 1/5] net/zxdh: remove __rte_unused from function prototypes Stephen Hemminger
2025-02-23 2:42 ` [RFC 2/5] net/zxdh: remove __rte_unused attribute Stephen Hemminger
2025-02-23 2:42 ` [RFC 3/5] net/zxdh: fix RTE_ASSERT expression Stephen Hemminger
2025-02-23 2:42 ` [RFC 4/5] net/zxdh: make callback table const and static Stephen Hemminger
2025-02-23 2:42 ` Stephen Hemminger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250223024334.1216477-6-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=shan.lijie@zte.com.cn \
--cc=wang.junlong1@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).