Skip to content

Commit d788c93

Browse files
pieterj-xilinxkuba-moo
authored andcommitted
sfc: cleanup and reduce netlink error messages
Reduce the length of netlink error messages as they are likely to be truncated anyway. Additionally, reword netlink error messages so they are more consistent with previous messages. Fixes: 9dbc8d2 ("sfc: add decrement ipv6 hop limit by offloading set hop limit actions") Fixes: 3c9561c ("sfc: support TC decap rules matching on enc_ip_tos") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Pieter Jansen van Vuuren <[email protected]> Reviewed-by: Edward Cree <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 7798b59 commit d788c93

File tree

1 file changed

+19
-19
lines changed
  • drivers/net/ethernet/sfc

1 file changed

+19
-19
lines changed

drivers/net/ethernet/sfc/tc.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -629,14 +629,14 @@ static int efx_tc_flower_record_encap_match(struct efx_nic *efx,
629629
}
630630
if (child_ip_tos_mask != old->child_ip_tos_mask) {
631631
NL_SET_ERR_MSG_FMT_MOD(extack,
632-
"Pseudo encap match for TOS mask %#04x conflicts with existing pseudo(MASK) entry for TOS mask %#04x",
632+
"Pseudo encap match for TOS mask %#04x conflicts with existing mask %#04x",
633633
child_ip_tos_mask,
634634
old->child_ip_tos_mask);
635635
return -EEXIST;
636636
}
637637
if (child_udp_sport_mask != old->child_udp_sport_mask) {
638638
NL_SET_ERR_MSG_FMT_MOD(extack,
639-
"Pseudo encap match for UDP src port mask %#x conflicts with existing pseudo(MASK) entry for mask %#x",
639+
"Pseudo encap match for UDP src port mask %#x conflicts with existing mask %#x",
640640
child_udp_sport_mask,
641641
old->child_udp_sport_mask);
642642
return -EEXIST;
@@ -1081,7 +1081,7 @@ static int efx_tc_pedit_add(struct efx_nic *efx, struct efx_tc_action_set *act,
10811081
/* check that we do not decrement ttl twice */
10821082
if (!efx_tc_flower_action_order_ok(act,
10831083
EFX_TC_AO_DEC_TTL)) {
1084-
NL_SET_ERR_MSG_MOD(extack, "Unsupported: multiple dec ttl");
1084+
NL_SET_ERR_MSG_MOD(extack, "multiple dec ttl are not supported");
10851085
return -EOPNOTSUPP;
10861086
}
10871087
act->do_ttl_dec = 1;
@@ -1106,7 +1106,7 @@ static int efx_tc_pedit_add(struct efx_nic *efx, struct efx_tc_action_set *act,
11061106
/* check that we do not decrement hoplimit twice */
11071107
if (!efx_tc_flower_action_order_ok(act,
11081108
EFX_TC_AO_DEC_TTL)) {
1109-
NL_SET_ERR_MSG_MOD(extack, "Unsupported: multiple dec ttl");
1109+
NL_SET_ERR_MSG_MOD(extack, "multiple dec ttl are not supported");
11101110
return -EOPNOTSUPP;
11111111
}
11121112
act->do_ttl_dec = 1;
@@ -1120,7 +1120,7 @@ static int efx_tc_pedit_add(struct efx_nic *efx, struct efx_tc_action_set *act,
11201120
}
11211121

11221122
NL_SET_ERR_MSG_FMT_MOD(extack,
1123-
"Unsupported: ttl add action type %x %x %x/%x",
1123+
"ttl add action type %x %x %x/%x is not supported",
11241124
fa->mangle.htype, fa->mangle.offset,
11251125
fa->mangle.val, fa->mangle.mask);
11261126
return -EOPNOTSUPP;
@@ -1164,7 +1164,7 @@ static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act,
11641164
case 0:
11651165
if (fa->mangle.mask) {
11661166
NL_SET_ERR_MSG_FMT_MOD(extack,
1167-
"Unsupported: mask (%#x) of eth.dst32 mangle",
1167+
"mask (%#x) of eth.dst32 mangle is not supported",
11681168
fa->mangle.mask);
11691169
return -EOPNOTSUPP;
11701170
}
@@ -1184,15 +1184,15 @@ static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act,
11841184
mung->dst_mac_16 = 1;
11851185
} else {
11861186
NL_SET_ERR_MSG_FMT_MOD(extack,
1187-
"Unsupported: mask (%#x) of eth+4 mangle is not high or low 16b",
1187+
"mask (%#x) of eth+4 mangle is not high or low 16b",
11881188
fa->mangle.mask);
11891189
return -EOPNOTSUPP;
11901190
}
11911191
return efx_tc_complete_mac_mangle(efx, act, mung, extack);
11921192
case 8:
11931193
if (fa->mangle.mask) {
11941194
NL_SET_ERR_MSG_FMT_MOD(extack,
1195-
"Unsupported: mask (%#x) of eth.src32 mangle",
1195+
"mask (%#x) of eth.src32 mangle is not supported",
11961196
fa->mangle.mask);
11971197
return -EOPNOTSUPP;
11981198
}
@@ -1201,7 +1201,7 @@ static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act,
12011201
mung->src_mac_32 = 1;
12021202
return efx_tc_complete_mac_mangle(efx, act, mung, extack);
12031203
default:
1204-
NL_SET_ERR_MSG_FMT_MOD(extack, "Unsupported: mangle eth+%u %x/%x",
1204+
NL_SET_ERR_MSG_FMT_MOD(extack, "mangle eth+%u %x/%x is not supported",
12051205
fa->mangle.offset, fa->mangle.val, fa->mangle.mask);
12061206
return -EOPNOTSUPP;
12071207
}
@@ -1217,7 +1217,7 @@ static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act,
12171217
/* check that pedit applies to ttl only */
12181218
if (fa->mangle.mask != ~EFX_TC_HDR_TYPE_TTL_MASK) {
12191219
NL_SET_ERR_MSG_FMT_MOD(extack,
1220-
"Unsupported: mask (%#x) out of range, only support mangle action on ipv4.ttl",
1220+
"mask (%#x) out of range, only support mangle action on ipv4.ttl",
12211221
fa->mangle.mask);
12221222
return -EOPNOTSUPP;
12231223
}
@@ -1227,7 +1227,7 @@ static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act,
12271227
*/
12281228
if (match->mask.ip_ttl != U8_MAX) {
12291229
NL_SET_ERR_MSG_FMT_MOD(extack,
1230-
"Unsupported: only support mangle ipv4.ttl when we have an exact match on ttl, mask used for match (%#x)",
1230+
"only support mangle ttl when we have an exact match, current mask (%#x)",
12311231
match->mask.ip_ttl);
12321232
return -EOPNOTSUPP;
12331233
}
@@ -1237,15 +1237,15 @@ static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act,
12371237
*/
12381238
if (match->value.ip_ttl == 0) {
12391239
NL_SET_ERR_MSG_MOD(extack,
1240-
"Unsupported: we cannot decrement ttl past 0");
1240+
"decrement ttl past 0 is not supported");
12411241
return -EOPNOTSUPP;
12421242
}
12431243

12441244
/* check that we do not decrement ttl twice */
12451245
if (!efx_tc_flower_action_order_ok(act,
12461246
EFX_TC_AO_DEC_TTL)) {
12471247
NL_SET_ERR_MSG_MOD(extack,
1248-
"Unsupported: multiple dec ttl");
1248+
"multiple dec ttl is not supported");
12491249
return -EOPNOTSUPP;
12501250
}
12511251

@@ -1259,7 +1259,7 @@ static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act,
12591259
fallthrough;
12601260
default:
12611261
NL_SET_ERR_MSG_FMT_MOD(extack,
1262-
"Unsupported: only support mangle on the ttl field (offset is %u)",
1262+
"only support mangle on the ttl field (offset is %u)",
12631263
fa->mangle.offset);
12641264
return -EOPNOTSUPP;
12651265
}
@@ -1275,7 +1275,7 @@ static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act,
12751275
/* check that pedit applies to ttl only */
12761276
if (fa->mangle.mask != EFX_TC_HDR_TYPE_HLIMIT_MASK) {
12771277
NL_SET_ERR_MSG_FMT_MOD(extack,
1278-
"Unsupported: mask (%#x) out of range, only support mangle action on ipv6.hop_limit",
1278+
"mask (%#x) out of range, only support mangle action on ipv6.hop_limit",
12791279
fa->mangle.mask);
12801280

12811281
return -EOPNOTSUPP;
@@ -1286,7 +1286,7 @@ static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act,
12861286
*/
12871287
if (match->mask.ip_ttl != U8_MAX) {
12881288
NL_SET_ERR_MSG_FMT_MOD(extack,
1289-
"Unsupported: only support mangle ipv6.hop_limit when we have an exact match on ttl, mask used for match (%#x)",
1289+
"only support hop_limit when we have an exact match, current mask (%#x)",
12901290
match->mask.ip_ttl);
12911291
return -EOPNOTSUPP;
12921292
}
@@ -1296,15 +1296,15 @@ static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act,
12961296
*/
12971297
if (match->value.ip_ttl == 0) {
12981298
NL_SET_ERR_MSG_MOD(extack,
1299-
"Unsupported: we cannot decrement hop_limit past 0");
1299+
"decrementing hop_limit past 0 is not supported");
13001300
return -EOPNOTSUPP;
13011301
}
13021302

13031303
/* check that we do not decrement hoplimit twice */
13041304
if (!efx_tc_flower_action_order_ok(act,
13051305
EFX_TC_AO_DEC_TTL)) {
13061306
NL_SET_ERR_MSG_MOD(extack,
1307-
"Unsupported: multiple dec ttl");
1307+
"multiple dec ttl is not supported");
13081308
return -EOPNOTSUPP;
13091309
}
13101310

@@ -1318,7 +1318,7 @@ static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act,
13181318
fallthrough;
13191319
default:
13201320
NL_SET_ERR_MSG_FMT_MOD(extack,
1321-
"Unsupported: only support mangle on the hop_limit field");
1321+
"only support mangle on the hop_limit field");
13221322
return -EOPNOTSUPP;
13231323
}
13241324
default:

0 commit comments

Comments
 (0)