|
@@ -30,6 +30,8 @@
|
|
|
|
|
|
#define BNX2X_MAX_EMUL_MULTI 16
|
|
#define BNX2X_MAX_EMUL_MULTI 16
|
|
|
|
|
|
|
|
+#define MAC_LEADING_ZERO_CNT (ALIGN(ETH_ALEN, sizeof(u32)) - ETH_ALEN)
|
|
|
|
+
|
|
/**** Exe Queue interfaces ****/
|
|
/**** Exe Queue interfaces ****/
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -441,6 +443,36 @@ static bool bnx2x_put_credit_vlan_mac(struct bnx2x_vlan_mac_obj *o)
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int bnx2x_get_n_elements(struct bnx2x *bp, struct bnx2x_vlan_mac_obj *o,
|
|
|
|
+ int n, u8 *buf)
|
|
|
|
+{
|
|
|
|
+ struct bnx2x_vlan_mac_registry_elem *pos;
|
|
|
|
+ u8 *next = buf;
|
|
|
|
+ int counter = 0;
|
|
|
|
+
|
|
|
|
+ /* traverse list */
|
|
|
|
+ list_for_each_entry(pos, &o->head, link) {
|
|
|
|
+ if (counter < n) {
|
|
|
|
+ /* place leading zeroes in buffer */
|
|
|
|
+ memset(next, 0, MAC_LEADING_ZERO_CNT);
|
|
|
|
+
|
|
|
|
+ /* place mac after leading zeroes*/
|
|
|
|
+ memcpy(next + MAC_LEADING_ZERO_CNT, pos->u.mac.mac,
|
|
|
|
+ ETH_ALEN);
|
|
|
|
+
|
|
|
|
+ /* calculate address of next element and
|
|
|
|
+ * advance counter
|
|
|
|
+ */
|
|
|
|
+ counter++;
|
|
|
|
+ next = buf + counter * ALIGN(ETH_ALEN, sizeof(u32));
|
|
|
|
+
|
|
|
|
+ DP(BNX2X_MSG_SP, "copied element number %d to address %p element was %pM\n",
|
|
|
|
+ counter, next, pos->u.mac.mac);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return counter * ETH_ALEN;
|
|
|
|
+}
|
|
|
|
+
|
|
/* check_add() callbacks */
|
|
/* check_add() callbacks */
|
|
static int bnx2x_check_mac_add(struct bnx2x_vlan_mac_obj *o,
|
|
static int bnx2x_check_mac_add(struct bnx2x_vlan_mac_obj *o,
|
|
union bnx2x_classification_ramrod_data *data)
|
|
union bnx2x_classification_ramrod_data *data)
|
|
@@ -1886,6 +1918,7 @@ void bnx2x_init_mac_obj(struct bnx2x *bp,
|
|
mac_obj->check_move = bnx2x_check_move;
|
|
mac_obj->check_move = bnx2x_check_move;
|
|
mac_obj->ramrod_cmd =
|
|
mac_obj->ramrod_cmd =
|
|
RAMROD_CMD_ID_ETH_CLASSIFICATION_RULES;
|
|
RAMROD_CMD_ID_ETH_CLASSIFICATION_RULES;
|
|
|
|
+ mac_obj->get_n_elements = bnx2x_get_n_elements;
|
|
|
|
|
|
/* Exe Queue */
|
|
/* Exe Queue */
|
|
bnx2x_exe_queue_init(bp,
|
|
bnx2x_exe_queue_init(bp,
|