* All Tx traffic classes will use a single sender (ignore num_queueus for tx)
*/
#define DPNI_OPT_SINGLE_SENDER 0x000100
+/**
+ * Define a custom number of congestion groups
+ */
+#define DPNI_OPT_CUSTOM_CG 0x000200
int dpni_open(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint8_t num_tcs;
uint8_t num_rx_tcs;
uint8_t qos_entries;
+ uint8_t num_cgs;
};
int dpni_create(struct fsl_mc_io *mc_io,
uint8_t qos_key_size;
uint8_t fs_key_size;
uint16_t wriop_version;
+ uint8_t num_cgs;
};
int dpni_get_attributes(struct fsl_mc_io *mc_io,
*/
#define DPNI_LINK_OPT_PFC_PAUSE 0x0000000000000010ULL
+/**
+ * Advertise 10MB full duplex
+ */
+#define DPNI_ADVERTISED_10BASET_FULL 0x0000000000000001ULL
+/**
+ * Advertise 100MB full duplex
+ */
+#define DPNI_ADVERTISED_100BASET_FULL 0x0000000000000002ULL
+/**
+ * Advertise 1GB full duplex
+ */
+#define DPNI_ADVERTISED_1000BASET_FULL 0x0000000000000004ULL
+/**
+ * Advertise auto-negotiation enable
+ */
+#define DPNI_ADVERTISED_AUTONEG 0x0000000000000008ULL
+/**
+ * Advertise 10GB full duplex
+ */
+#define DPNI_ADVERTISED_10000BASET_FULL 0x0000000000000010ULL
+/**
+ * Advertise 2.5GB full duplex
+ */
+#define DPNI_ADVERTISED_2500BASEX_FULL 0x0000000000000020ULL
+/**
+ * Advertise 5GB full duplex
+ */
+#define DPNI_ADVERTISED_5000BASET_FULL 0x0000000000000040ULL
+
+
/**
* struct - Structure representing DPNI link configuration
* @rate: Rate
uint32_t rate;
uint64_t options;
int up;
- int state_valid;
+ int state_valid;
uint64_t supported;
uint64_t advertising;
};
DPNI_CONGESTION_UNIT_FRAMES
};
-
/**
* enum dpni_dest - DPNI destination types
* @DPNI_DEST_NONE: Unassigned destination; The queue is set in parked mode and
*/
#define DPNI_CONG_OPT_FLOW_CONTROL 0x00000040
+/**
+ * enum dpni_congestion_point - Structure representing congestion point
+ * @DPNI_CP_QUEUE: Set congestion per queue, identified by QUEUE_TYPE, TC
+ * and QUEUE_INDEX
+ * @DPNI_CP_GROUP: Set congestion per queue group. Depending on options
+ * used to define the DPNI this can be either per
+ * TC (default) or per interface
+ * (DPNI_OPT_SHARED_CONGESTION set at DPNI create).
+ * QUEUE_INDEX is ignored if this type is used.
+ * @DPNI_CP_CONGESTION_GROUP: Set per congestion group id. This will work
+ * only if the DPNI is created with DPNI_OPT_CUSTOM_CG option
+ */
+
+enum dpni_congestion_point {
+ DPNI_CP_QUEUE,
+ DPNI_CP_GROUP,
+ DPNI_CP_CONGESTION_GROUP,
+};
+
/**
* struct dpni_congestion_notification_cfg - congestion notification
* configuration
* contained in 'options'
* @dest_cfg: CSCN can be send to either DPIO or DPCON WQ channel
* @notification_mode: Mask of available options; use 'DPNI_CONG_OPT_<X>' values
+ * @cg_point: Congestion point settings
+ * @cgid: id of the congestion group. The index is relative to dpni.
*/
struct dpni_congestion_notification_cfg {
uint64_t message_iova;
struct dpni_dest_cfg dest_cfg;
uint16_t notification_mode;
+ enum dpni_congestion_point cg_point;
+ int cgid;
};
int dpni_set_congestion_notification(struct fsl_mc_io *mc_io,
* FD[OFFSET].
* For more details check the Frame Descriptor section in the
* hardware documentation.
+ *@cgid :indicate the cgid to set relative to dpni
*/
struct dpni_queue {
struct {
uint64_t value;
char stash_control;
} flc;
+ int cgid;
};
/**
*/
#define DPNI_QUEUE_OPT_HOLD_ACTIVE 0x00000008
+#define DPNI_QUEUE_OPT_SET_CGID 0x00000040
+#define DPNI_QUEUE_OPT_CLEAR_CGID 0x00000080
+
int dpni_set_queue(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint16_t token,
uint32_t cmd_flags,
uint16_t token,
uint8_t page,
- uint8_t param,
+ uint16_t param,
union dpni_statistics *stat);
int dpni_reset_statistics(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint16_t token);
-/**
- * enum dpni_congestion_point - Structure representing congestion point
- * @DPNI_CP_QUEUE: Set taildrop per queue, identified by QUEUE_TYPE, TC and
- * QUEUE_INDEX
- * @DPNI_CP_GROUP: Set taildrop per queue group. Depending on options used
- * to define the DPNI this can be either per
- * TC (default) or per interface
- * (DPNI_OPT_SHARED_CONGESTION set at DPNI create).
- * QUEUE_INDEX is ignored if this type is used.
- */
-enum dpni_congestion_point {
- DPNI_CP_QUEUE,
- DPNI_CP_GROUP,
-};
-
/**
* struct dpni_taildrop - Structure representing the taildrop
* @enable: Indicates whether the taildrop is active or not.