Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal [202305][sflow]: Remove the ENABLE_SFLOW_DROPMON flag #38

Closed
wants to merge 2 commits into from

Conversation

vadymhlushko-mlnx
Copy link
Owner

Why I did it

To simplify usability and increase adoption of the sFlow + dropmon feature without rebuilding an image.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Remove the ENABLE_SFLOW_DROPMON compilation flag, and remove unnecessary patches.

How to verify it

  1. Configure the sFlow on the switch
root@sonic:/home/admin# config feature state sflow enabled
root@sonic:/home/admin# config sflow enable
root@sonic:/home/admin# config sflow collector add collector0 30.1.1.2 --port 6343
root@sonic:/home/admin# config sflow polling-interval 20
root@sonic:/home/admin# config sflow interface disable all
root@sonic:/home/admin# config sflow interface enable Ethernet4
root@sonic:/home/admin# config sflow interface sample-rate Ethernet4 256
  1. Configure the Host (PTF)
root@a8f0f3e20879:/# ifconfig eth1 30.1.1.2/24
root@a8f0f3e20879:/# ifconfig eth2 40.1.1.2/24
  1. Launch the sflowtool on Host (PTF)
sflowtool -J -p 6343 > drop_packets_1k
  1. Send the dropped packets from Host (PTF) to the switch via scapy
root@a8f0f3e20879:/# scapy
Welcome to Scapy (2.2.0-dev)
>>> pkt_nok = Ether(src="00:00:00:00:00", dst="SWITCH_MAC_address")/IP(src="0.0.0.0", dst="40.1.1.5")/TCP()
>>> sendp(pkt_nok, iface="eth2", count=1000)
  1. Check the L3 counters on the switch
root@sonic:/home/admin# show interfaces counters rif
         IFACE    RX_OK      RX_BPS    RX_PPS    RX_ERR    TX_OK    TX_BPS    TX_PPS    TX_ERR
--------------  -------  ----------  --------  --------  -------  --------  --------  --------
     Ethernet2       24  459.32 B/s    0.82/s         1        0  0.00 B/s    0.00/s         0
     Ethernet4        0    0.00 B/s    0.00/s     1,000        0  0.00 B/s    0.00/s         0
  1. Check the samples that were captured by the sflowtool on the Host (PTF)
root@a8f0f3e20879:/# cat drop_packets_1k
...
  {
   "sampleType_tag":"0:5",
   "sampleType":"DISCARD",
   "sampleSequenceNo":"309",
   "sourceId":"0:127",
   "dropEvents":"32",
   "inputPort":"127",
   "outputPort":"0",
   "discardCode":"285",
   "discardReason":"unknown_l3",
   "elements":[{
     "discarded_flowBlock_tag":"0:1038",
     "discarded_extendedType":"function",
     "discarded_symbol":"ip_rcv_finish_core.constprop.0+0x1c4/0x"
    },
    {
     "discarded_flowBlock_tag":"0:1",
     "discarded_flowSampleType":"HEADER",
     "discarded_headerProtocol":"1",
     "discarded_sampledPacketSize":"54",
     "discarded_strippedBytes":"4",
     "discarded_headerLen":"54",
     "discarded_headerBytes":"98-03-9B-94-D4-80-00-00-00-00-00-00-08-00-45-00-00-28-00-01-00-00-40-06-51-CA-00-00-00-00-28-01-01-05-00-14-00-50-00-00-00-00-00-00-00-00-50-02-20-00-66-79-00-00",
     "discarded_dstMAC":"98039b94d480",
     "discarded_srcMAC":"000000000000",
     "discarded_IPSize":"36",
     "discarded_ip.tot_len":"40",
     "discarded_srcIP":"0.0.0.0",
     "discarded_dstIP":"40.1.1.5",
     "discarded_IPProtocol":"6",
     "discarded_IPTOS":"0",
     "discarded_IPTTL":"64",
     "discarded_IPID":"256",
     "discarded_TCPSrcPort":"20",
     "discarded_TCPDstPort":"80",
     "discarded_TCPFlags":"2"
    }
   ]
  }

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

…n feature unconditionally

Signed-off-by: vadymhlushko-mlnx <vadymh@nvidia.com>
…rnel version

Signed-off-by: vadymhlushko-mlnx <vadymh@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant