be2net: support configuration of 64 multicast addresses instead of 32
Subsystems (2)
PATCH 1/5 be2net: support configuration of 64 multicast addresses instead of 32
To send upto 64 addresses in the multicast-set cmd, the non-embeeded cmd format that provides for a bigger buffer is used instead of an embedded format.
Signed-off-by Sathya Perla <[email protected]>
--- drivers/net/benet/be.h | 1 + drivers/net/benet/be_cmds.c | 23 ++++++++++++++--------- drivers/net/benet/be_cmds.h | 7 +++++-- drivers/net/benet/be_main.c | 41 +++++++++++++++++++++++++++++++++++------ 4 files changed, 55 insertions(+), 17 deletions(-)
drivers/net/benet/be.h +1 -0
@@ -254,6 +254,7 @@ struct be_adapter {struct vlan_group *vlan_grp;u16 num_vlans;u8 vlan_tag[VLAN_GROUP_ARRAY_LEN ]; +struct be_dma_mem mc_cmd_mem;struct be_stats_obj stats;/* Work queue used to perform periodic tasks like getting statistics */
drivers/net/benet/be_cmds.c +14 -9
@@ -990,24 +990,30 @@ int be_cmd_promiscuous_config(struct be_adapter *adapter, u8 port_num, bool en)* (mc == NULL) => multicast promiscous */ int be_cmd_multicast_set (struct be_adapter *adapter,u32 if_id, -struct dev_mc_list *mc_list,u32 mc_count) +struct dev_mc_list *mc_list,u32 mc_count, +struct be_dma_mem *mem) { -#define BE_MAX_MC 32/* set mcast promisc if > 32 */ struct be_mcc_wrb *wrb; -struct be_cmd_req_mcast_mac_config *req; +struct be_cmd_req_mcast_mac_config *req = mem->va; +struct be_sge *sge; +int status;spin_lock_bh (&adapter->mcc_lock); wrb =wrb_from_mccq (adapter); - req =embedded_payload (wrb); + sge =nonembedded_sgl (wrb); +memset (req,0 ,sizeof (*req)); -be_wrb_hdr_prepare (wrb,sizeof (*req), true,0 ); +be_wrb_hdr_prepare (wrb,sizeof (*req), false,1 ); + sge->pa_hi =cpu_to_le32 (upper_32_bits (mem->dma)); + sge->pa_lo =cpu_to_le32 (mem->dma &0xFFFFFFFF ); + sge->len =cpu_to_le32 (mem->size);be_cmd_hdr_prepare (&req->hdr,CMD_SUBSYSTEM_COMMON ,OPCODE_COMMON_NTWK_MULTICAST_SET ,sizeof (*req)); req->interface_id = if_id; -if (mc_list && mc_count <=BE_MAX_MC ) { +if (mc_list) {int i;struct dev_mc_list *mc;
@@ -1019,11 +1025,10 @@ int be_cmd_multicast_set(struct be_adapter *adapter, u32 if_id, req->promiscuous =1 ; } -be_mcc_notify_wait (adapter); + status =be_mcc_notify_wait (adapter);spin_unlock_bh (&adapter->mcc_lock); - -return 0 ; +return status; }/* Uses synchrounous mcc */
drivers/net/benet/be_cmds.h +5 -2
@@ -590,6 +590,8 @@ struct be_cmd_req_promiscuous_config {u16 rsvd0; } __packed; +/******************** Multicast MAC Config *******************/ +#define BE_MAX_MC 64/* set mcast promisc if > 64 */ struct macaddr {u8 byte[ETH_ALEN ]; };
@@ -599,7 +601,7 @@ struct be_cmd_req_mcast_mac_config {u16 num_mac;u8 promiscuous;u8 interface_id; -struct macaddr mac[32 ]; +struct macaddr mac[BE_MAX_MC ]; } __packed; static inline struct be_hw_stats *
@@ -828,7 +830,8 @@ extern int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id,extern int be_cmd_promiscuous_config (struct be_adapter *adapter,u8 port_num,bool en);extern int be_cmd_multicast_set (struct be_adapter *adapter,u32 if_id, -struct dev_mc_list *mc_list,u32 mc_count); +struct dev_mc_list *mc_list,u32 mc_count, +struct be_dma_mem *mem);extern int be_cmd_set_flow_control (struct be_adapter *adapter,u32 tx_fc,u32 rx_fc); extern int be_cmd_get_flow_control(struct be_adapter *adapter,
drivers/net/benet/be_main.c +35 -6
82 lines not on this page · raw message
Signature · 1 line
1.6.5.2
From: Sathya Perla <[email protected]>
Date: Mon, 23 Nov 2009 13:31:10 +0530
Quoted 4 lines
To send upto 64 addresses in the multicast-set cmd, the non-embeeded cmd format that provides for a bigger buffer is used instead of an embedded format.
Signed-off-by Sathya Perla <[email protected]>
Applied.