@@ -3797,6 +3797,16 @@ static int do_srxclass(struct cmd_context *ctx)
" classification rule\n");
return 1;
}
+ } else if (!strcmp(ctx->argp[0], "rule-count")) {
+ int count = get_uint_range(ctx->argp[1], 0, INT_MAX);
+
+ err = rxclass_set_rule_count(ctx, count);
+
+ if (err < 0) {
+ fprintf(stderr, "Couldn't set"
+ " the desired ntuple rule count\n");
+ return 1;
+ }
} else {
exit_bad_args();
}
@@ -5818,6 +5828,7 @@ static const struct option args[] = {
" [ context %d ]\n"
" [ loc %d]] |\n"
" delete %d\n"
+ " rule-count %d\n"
},
{
.opts = "-T|--show-time-stamping",
@@ -372,6 +372,7 @@ int rxclass_rule_get(struct cmd_context *ctx, __u32 loc);
int rxclass_rule_ins(struct cmd_context *ctx,
struct ethtool_rx_flow_spec *fsp, __u32 rss_context);
int rxclass_rule_del(struct cmd_context *ctx, __u32 loc);
+int rxclass_set_rule_count(struct cmd_context *ctx, __u32 count);
/* Module EEPROM parsing code */
void sff8079_show_all(const __u8 *id);
@@ -616,6 +616,21 @@ int rxclass_rule_del(struct cmd_context *ctx, __u32 loc)
return err;
}
+int rxclass_set_rule_count(struct cmd_context *ctx, __u32 count)
+{
+ struct ethtool_rxnfc nfccmd;
+ int err;
+
+ /* notify netdev of rule count config */
+ nfccmd.cmd = ETHTOOL_SRXCLSRLCNT;
+ nfccmd.rule_cnt = count;
+ err = send_ioctl(ctx, &nfccmd);
+ if (err < 0)
+ perror("rmgr: Cannot set RX class rule count");
+
+ return err;
+}
+
typedef enum {
OPT_NONE = 0,
OPT_S32,
@@ -1550,6 +1550,7 @@ enum ethtool_fec_config_bits {
#define ETHTOOL_PHY_STUNABLE 0x0000004f /* Set PHY tunable configuration */
#define ETHTOOL_GFECPARAM 0x00000050 /* Get FEC settings */
#define ETHTOOL_SFECPARAM 0x00000051 /* Set FEC settings */
+#define ETHTOOL_SRXCLSRLCNT 0x00000052 /* Set RX class rule count */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET