30
30
#include " countercheckorch.h"
31
31
#include " notifier.h"
32
32
#include " fdborch.h"
33
+ #include " switchorch.h"
33
34
#include " stringutility.h"
34
35
#include " subscriberstatetable.h"
35
36
@@ -49,6 +50,7 @@ extern NeighOrch *gNeighOrch;
49
50
extern CrmOrch *gCrmOrch ;
50
51
extern BufferOrch *gBufferOrch ;
51
52
extern FdbOrch *gFdbOrch ;
53
+ extern SwitchOrch *gSwitchOrch ;
52
54
extern Directory<Orch*> gDirectory ;
53
55
extern sai_system_port_api_t *sai_system_port_api;
54
56
extern string gMySwitchType ;
@@ -61,6 +63,7 @@ extern event_handle_t g_events_handle;
61
63
#define VLAN_PREFIX " Vlan"
62
64
#define DEFAULT_VLAN_ID 1
63
65
#define MAX_VALID_VLAN_ID 4094
66
+ #define DEFAULT_HOSTIF_TX_QUEUE 7
64
67
65
68
#define PORT_SPEED_LIST_DEFAULT_SIZE 16
66
69
#define PORT_STATE_POLLING_SEC 5
@@ -2599,6 +2602,23 @@ bool PortsOrch::createVlanHostIntf(Port& vl, string hostif_name)
2599
2602
attr.value .chardata [SAI_HOSTIF_NAME_SIZE - 1 ] = ' \0 ' ;
2600
2603
attrs.push_back (attr);
2601
2604
2605
+ bool set_hostif_tx_queue = false ;
2606
+ if (gSwitchOrch ->querySwitchCapability (SAI_OBJECT_TYPE_HOSTIF, SAI_HOSTIF_ATTR_QUEUE))
2607
+ {
2608
+ set_hostif_tx_queue = true ;
2609
+ }
2610
+ else
2611
+ {
2612
+ SWSS_LOG_WARN (" Hostif queue attribute not supported" );
2613
+ }
2614
+
2615
+ if (set_hostif_tx_queue)
2616
+ {
2617
+ attr.id = SAI_HOSTIF_ATTR_QUEUE;
2618
+ attr.value .u32 = DEFAULT_HOSTIF_TX_QUEUE;
2619
+ attrs.push_back (attr);
2620
+ }
2621
+
2602
2622
sai_status_t status = sai_hostif_api->create_hostif (&vl.m_vlan_info .host_intf_id , gSwitchId , (uint32_t )attrs.size (), attrs.data ());
2603
2623
if (status != SAI_STATUS_SUCCESS)
2604
2624
{
@@ -4842,6 +4862,23 @@ bool PortsOrch::addHostIntfs(Port &port, string alias, sai_object_id_t &host_int
4842
4862
attr.value .chardata [SAI_HOSTIF_NAME_SIZE - 1 ] = ' \0 ' ;
4843
4863
attrs.push_back (attr);
4844
4864
4865
+ bool set_hostif_tx_queue = false ;
4866
+ if (gSwitchOrch ->querySwitchCapability (SAI_OBJECT_TYPE_HOSTIF, SAI_HOSTIF_ATTR_QUEUE))
4867
+ {
4868
+ set_hostif_tx_queue = true ;
4869
+ }
4870
+ else
4871
+ {
4872
+ SWSS_LOG_WARN (" Hostif queue attribute not supported" );
4873
+ }
4874
+
4875
+ if (set_hostif_tx_queue)
4876
+ {
4877
+ attr.id = SAI_HOSTIF_ATTR_QUEUE;
4878
+ attr.value .u32 = DEFAULT_HOSTIF_TX_QUEUE;
4879
+ attrs.push_back (attr);
4880
+ }
4881
+
4845
4882
sai_status_t status = sai_hostif_api->create_hostif (&host_intfs_id, gSwitchId , (uint32_t )attrs.size (), attrs.data ());
4846
4883
if (status != SAI_STATUS_SUCCESS)
4847
4884
{
0 commit comments