]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
be2net: send a max of 8 EQs to be_cmd_modify_eqd() on Lancer
authorKalesh AP <kalesh.purayil@emulex.com>
Fri, 12 Sep 2014 12:09:20 +0000 (17:39 +0530)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Sep 2014 21:12:15 +0000 (17:12 -0400)
The MODIFY_EQ_DELAY FW cmd on Lancer is supported for a max of 8 EQs per cmd.

Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_cmds.c

index 85edde6603fe6d8a4e3e5fe2a227b81807714e89..cd213d967529bd914072771d7033b44659ba67a7 100644 (file)
@@ -1783,8 +1783,8 @@ err:
 /* set the EQ delay interval of an EQ to specified value
  * Uses async mcc
  */
-int be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *set_eqd,
-                     int num)
+int __be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *set_eqd,
+                       int num)
 {
        struct be_mcc_wrb *wrb;
        struct be_cmd_req_modify_eq_delay *req;
@@ -1817,6 +1817,25 @@ err:
        return status;
 }
 
+int be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *set_eqd,
+                     int num)
+{
+       int num_eqs, i = 0;
+
+       if (lancer_chip(adapter) && num > 8) {
+               while (num) {
+                       num_eqs = min(num, 8);
+                       __be_cmd_modify_eqd(adapter, &set_eqd[i], num_eqs);
+                       i += num_eqs;
+                       num -= num_eqs;
+               }
+       } else {
+               __be_cmd_modify_eqd(adapter, set_eqd, num);
+       }
+
+       return 0;
+}
+
 /* Uses sycnhronous mcc */
 int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array,
                       u32 num)