summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_cli.c
AgeCommit message (Collapse)AuthorFilesLines
2021-12-03interface: add multi tx-queues support for new tx infraMohsin Kazmi1-10/+150
Type: feature Change-Id: I231f782b3c56dc2b10321e4569ac7acdad1c11da Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-10-06docs: vnet comment nitfixesNathan Skrzypczak1-4/+5
Type: improvement Change-Id: Iac01d7830b53819ace8f199554be10ab89ecdb97 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-22interface: allow an interface's index to be given in 'sh int'Neale Ranns1-0/+15
Type: improvement e.g.: DBGvpp# sh int 3 Name Idx State MTU (L3/IP4/IP6/MPLS) Counter Count loop2 3 down 9000/0/0/0 Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: Ie296167ab2b1b9576b46f6d4d9fb9546aef3a0da
2021-09-08interface: add custom interface name supportSteven Luong1-0/+49
add CLI "set interface name <current-int-name> <new-int-name> and the corresponding binary API to allow custom interface name setting for any interface. Type: feature Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I2b39da59879fd4526bcb5aa5854b6bd21e72ea73
2021-08-11fib: A 16-8-8 and a 8-8-8-8 versions of an ip4_fib_tNeale Ranns1-5/+5
Type: feature The difference being the MTRIE type they contain. THE FIB continues to use the 16-8-8 version. Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I5a54d4e6e6cc639f18a3fb65ef2925507a7ef1de
2021-07-28gre: set proper fib index for unnumbered interfaces, unset fib index before ↵Stanislav Zaikin1-2/+17
forwarding gre payload This commit introduces 2 fixes: 1) After GRE decapsulation sw_if_index[VLIB_TX] is set as fib index of GRE tunnel. But since GRE tunnel can work on v4 endpoints and have v6 payload, we need to reset it. In case we get IPv6 packet inside IPv4 GRE tunnel (or vice-versa) fib index can be (and usually is) invalid. 2) Check that ip-table and ip6-table are the same when setting interface as an unnumbered one. Also, fix for the pipe test include setting the right unnumbered interface for the pipes Type: fix Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com> Change-Id: Id13d239cfdd21e0db6b1c9725f01c40d4af4d800
2021-07-08interface: unable to to assign tx queue to last worker threadSteven Luong1-4/+3
Using the cli "set interface tx-queue", it is not possible to assign tx queue to the last worker thread. The reason is that vdm->first_worker_thread_index is 1. Adding that to clib_bitmap_last_set (bitmap) exceeds vdm->last_worker_thread_index when the CLI specifies the last worker thread. Also make the threads argument optional to enable user to unbind a queue from any thread. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I796259c20f571289c8f5a97b9418caf452d0ab3d
2021-05-27interface: add tx-queue cli support for new tx infraMohsin Kazmi1-0/+97
Type: improvement set interface tx-queue tap1 queue 2 threads 1-2 show hardware-interfaces tap1 Name Idx Link Hardware tap1 2 up tap1 Link speed: unknown RX Queues: queue thread mode 0 vpp_wk_1 (2) polling TX Queues: queue shared thread(s) 0 no 0 1 no 1 2 yes 1-2 3 no 3 4 no 4 Ethernet address 02:fe:09:3a:48:ff VIRTIO interface instance 1 set interface tx-queue tap0 queue 4 threads show hardware-interfaces tap0 Name Idx Link Hardware tap0 1 up tap0 Link speed: unknown RX Queues: queue thread mode 0 vpp_wk_0 (1) polling TX Queues: queue shared thread(s) 0 no 0 1 no 1 2 no 2 3 no 3 4 no Ethernet address 02:fe:03:6a:66:fc VIRTIO interface instance 0 Change-Id: I6154476ec9ff0b14287098529c88a14b779371a5 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-04-22misc: add filter for specific error for pcap traceBenoît Ganne1-1/+12
Type: feature Change-Id: I325257454df1cc22833fa6a1dedd4739d4d5a558 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-03-05interface: move vnet_pcap_t to vnetDamjan Marion1-1/+2
It naturally belogns there... Type: refactor Change-Id: I05f7ba01103a5e9b3756f1ea69c8cc5d8f26f0a0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-02classify: fix crash if no pcap filter has been configuredBenoît Ganne1-1/+2
If no pcap filters have ever been configured and we try to enable pcap capture with a filter, cm->classify_table_index_by_sw_if_index is not initialized yet. Type: fix Change-Id: I2f509c58f9984951b1ad81c1c8ed912cb594fce1 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-02-26interface: fix sh int rxNathan Skrzypczak1-1/+1
Type: fix Change-Id: Iebe2db66af1e769486a117d6284375ce5ffff0b4 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-01-26interface: remove vnet_device_input_runtime_tMohammed Hawari1-98/+0
Change-Id: I85a463b4ca15baf11e3eb70189f5190ba2585170 Type: refactor Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2021-01-22interface: fix rx-placement api/cli for new infraMohammed Hawari1-43/+34
Change-Id: Ic977ffe761efc2129c61aec581da5479fe4838da Type: fix Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2021-01-21interface: rx queue infra rework, part oneDamjan Marion1-20/+69
Type: improvement Change-Id: I4008cadfd5141f921afbdc09a3ebcd1dcf88eb29 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-15classify: add pcap/trace classfier mgmt API callsJon Loeliger1-5/+3
Add lookup/get/set API calls to manage both PCAP and Trace filtering Classifier tables. The "lookup" call may be used to identify a Classifier table within a chain of tables taht matches a particular mask vector. For efficiency, this call should be used to determine to which table a match vector should be added. The "get" calls return the first table within a chain (either a PCAP or the Trace) set of tables. The "set" call may be used to add a new table to one such chain. If the "sort_masks" flag is set, the tables within the chain are ordered such that the most-specific mask is first, and the least-specific mask is last. A call that "sets" a chain to ~0 will delete and free all the tables with a chain. The PCAP filters are per-interface, with "local0", (that is, sw_if_index == 0) holding the system-wide PCAP filter. The Classifier used a reference-counted "set" for each PCAP or trace filter that it stored. The ref counts were not used, and the vector of tables was only used temporarily to establish a sorted order for tables based on masks. None of that complexity was actually warranted, and where it was used, the same could be achieved more simply. Type: refactor Signed-off-by: Jon Loeliger <jdl@netgate.com> Change-Id: Icc56116cca91b91c631ca0628e814fb53f3677d2
2020-12-14misc: refactor clib_bitmap_foreach macroDamjan Marion1-6/+6
Type: refactor Change-Id: I077110e1a422722e20aa546a6f3224c06ab0cde5 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-10/+10
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-11-13ethernet: mac must support 64-bits loadsBenoît Ganne1-2/+2
ethernet dataplane loads MAC addresses as 64-bits loads for efficiency. We must make sure it is valid, especially for the vector of secondary MACs. Type: fix Change-Id: I851e319b8a973c154e85ff9f05f3b8e385939788 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-10-08interface: shorten vnet_hw_if_rx_modeDamjan Marion1-11/+11
This is part of bigger refactor. Type: refactor Change-Id: I6fc2c0a1e2d217a70952901bcf775b8485bd3c20 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-08l2: input performanceNeale Ranns1-21/+2
Type: improvement - cache the values form the BD on the input config to avoid loading - avoid the short write long read on the sequence number - use vlib_buffer_enqueue_to_next Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I33442b9104b457e4c638d26e9ad3bc965687a0bc
2020-09-09interface: support configuring RSS steering queuesChenmin Sun1-0/+83
This patch adds the RSS steering queues set interface, and it's implementation in DPDK device: /* Interface to set rss queues of the interface */ typedef clib_error_t *(vnet_interface_rss_queues_set_t) (struct vnet_main_t * vnm, struct vnet_hw_interface_t * hi, clib_bitmap_t *bitmap); This patch also introduces a command line to set the RSS queues: set interface rss queues <interface> <list <queue-list>> To display the rss queues, use "show hardware-interfaces" Below is the example to configure rss queues for interface Gig0: vpp# set interface rss queues Gig0 list 0,2,4-7 vpp# show hardware-interfaces brief Name Idx Link Hardware VirtualFunctionEthernet18/1/0 1 down VirtualFunctionEthernet18/1/0 Link speed: unknown RSS queues: 0 2 4 5 6 7 local0 0 down local0 Link speed: unknown vpp# Users can also configure the rss queues on a dpdk interface in startup.conf: dpdk { dev 0000:18:01.0 { rss-queues 0,2,5-7 } } Type: feature Signed-off-by: Chenmin Sun <chenmin.sun@intel.com> Change-Id: I1835595a1c54016a84eabee9fd62ce137935385d
2020-09-02misc: fix pcap [rx|tx|drop] filename stem overflowBenoît Ganne1-1/+1
Type: fix Change-Id: I2b6b7b6f28cbf7accf883743e390b0031dd13bbb Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-08-06misc: harmonize namesDave Barach1-1/+2
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ibad744788e200ce012ad88ff59c2c34920742454
2020-08-05interface: add pcap trace data preallocationDave Barach1-4/+46
Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2e53fa85a0b4082666f57a3a58a09c04ae2001b5
2020-07-24interface: fix show/clear hardware-interfaces string overflowBenoît Ganne1-5/+19
Type: fix Change-Id: Iab99bc1f6c309fae6eaa714b484274fe7072a4cb Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-06-16interface: add minimal vpp pkt trace for error-dropDave Barach1-1/+1
Provide a minimal trace [ip4/ip6 src/dst address] for dropped pkts when the user specifies "trace add error-drop XXXX", but does not trace pkts from the original input node. This is a wireshark dissector problem. Packets thrown at error-drop may be well-formed, or not. VPP must not crash, no matter what. The minimal trace capture and decode could be enhanced. Anyone interested in doing that must consider all of the corner-cases involved. This version should be at least somewhat useful. Note that "pcap trace drop ..." - and the packet generator - seem like the right tools to use when researching more complex issues. Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I961ca133980ffa2a1e5707879a443b21442ed894
2020-01-27classify: pcap / packet trace debug CLI bugsDave Barach1-1/+1
"classify filter trace ... " and "classify filter pcap ..." are mutually exclusive. vnet_pcap_dispatch_trace_configure needs to check for set->table_indices == NULL. Type: fix Ticket: VPP-1827 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I43733364087ffb0a43de92e450955033431d559d
2020-01-14classify: Reduce the include dependencies on vnet_classify.hNeale Ranns1-0/+1
Type: refactor currently vnet_classify.h is included in ip.h where it's not required. Change-Id: Id55682637601655aa2edda681536a979c8e323bd Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-12-19interface: Prevent bad inner-dot1q any exact-match configurationJon Loeliger1-3/+3
Someone much more knowledgeable than I wrote: For L3 IP forwarding, any VLAN tags on a packet must be exact match to a sub-interface which means both outer and inner VLAN tag IDs must be exact-matched to specific values defined of that sub-interface. Without exact match on a L3 sub-interface, VPP has no mechanism to know what VLAN tags to use for packet output, such as ARP request packets or IP packets, on that sub-interface. Thus, sub-interface with "inner-dot1q any" is not an exact match sub-interface by definition since no match is present on inner tag. While in the area, fix a memory leak that would ensue on poorly configured interfaces. Change-Id: I8d17a96dbca3e3724c297ecc935ca61764e6ce2e Type: fix Signed-off-by: Jon Loeliger <jdl@netgate.com>
2019-11-12interface: Allow VLAN tag-rewrite on non-sub-interfaces too.Jon Loeliger1-2/+26
This fix was first made in commit fdea5c6a00b74971dbb1b7ec4e25839a871006ca but was subsequently lost in commit 053204ab039d34a990ff0e14c32ce3b294fcce0e Added unit test for setting VTR on a non-sub-interface to help ensure no future regressions of this ability. Type: fix Change-Id: I71ce2684fb72383741455829ae2d397ea2e95eae Signed-off-by: Jon Loeliger <jdl@netgate.com>
2019-10-09interface: callback to manage extra MAC addressesMatthew Smith1-0/+152
Type: feature New callback vnet_hw_interface_add_del_mac_address(). Add or delete secondary MAC addresses on a hardware interface. This will allow packets to be processed which have a destination MAC address other than the primary programmed MAC address without needing to put the device into promiscuous mode. Change-Id: I6beecbcb8932fc1fe45b567f76fa3706feefae2c Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2019-09-26misc: add vnet classify filter set supportDave Barach1-7/+15
Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I79b216d2499df143f53977e5b70382f6f887e0bc
2019-09-23misc: unify pcap rx / tx / drop traceDave Barach1-65/+120
Use a single vnet_pcap_t in vlib_global_main, specifically to support unified tracing Update sphinx docs, doxygen tags Type: refactor Ticket: VPP-1776 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Id15d41a596712968c0714cef1bd2cd5bc9cbdd55
2019-09-23interface: use the correct condition for checking if the pcap fd is openAndrew Yourtchenko1-1/+1
The 9af7e2e87e used a comparison that fd is >= 0 to check that the pcap needs closing. While the pcap_close() function does reset the file descriptor to -1, the freshly initialized structure has it equal to 0. This causes the VPP to close stdin if the packets are being seen on pg interface without the capture file being opened. This triggers the vpp attempting to read from STDIN (another bug), which results in running out of memory. Change-Id: I11d61422701500a9b3e0dd52d59383f297d57f54 Type: fix Fixes: 9af7e2e87e Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-09-20misc: classifier-based packet trace filterDave Barach1-2/+19
See .../src/vnet/classify/trace_classify.h for the business end of the scheme. It would be best to hash pkts, prefetch buckets, and do the primary table lookups two at a time. The inline as given works, but perf tuning will be required. "At least it works..." Add "classify filter" debug cli, for example: classify filter mask l3 ip4 src dst \ match l3 ip4 dst 192.168.2.10 src 192.168.1.10 Add "pcap rx | tx trace ... filter" to use the current classify filter chain Patch includes sphinx documentation and doxygen tags. Next step: device-driver integration Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I05b1358a769f61e6d32470e0c87058f640486b26
2019-09-10misc: clean up "pcap [rx|tx] trace" debug CLIDave Barach1-168/+149
Separate debug CLI arg parsing from the underlying action function. Fixes a number of subtle ordering dependencies, and will allow us to add a binary API to control the feature at some point in the future. Type: refactor Ticket: VPP-1770 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Id0dbeda06dad20e756c941c691e2088ce3c50ec7
2019-08-20fix pcap_write functionJack Xu1-0/+2
when use pcap cli to capture pcakets into two files rx01.pcap && rx02.pcap, the first time: 1)pcap rx trace on max 100 intfc any file rx01.pcap 2)......the process of capture data to buffer...... 3)pcap rx trace off the second time: 4)pcap rx trace on max 100 intfc any file rx02.pcap 5)......the process of capture data to buffer...... 6)pcap rx trace off the pcap_write function bug in this two lines pm->n_packets_captured = 0; if (pm->n_packets_captured >= pm->n_packets_to_capture) referring to calling pcap_close() will result in that the twice pcap cli both writes the packets into rx01.pcap, but nothing into rx02.pcap. Beside, the rx02.pcap file will not be created. solution: separate the pcap_close() out of pcap_write() Change-Id: Iedeb46f9cf0a4cb12449fd75a4014f95f3bb3fa8 Signed-off-by: Jack Xu <jack.c.xu@ericsson.com>
2019-08-01interface: fix pcap tx/rx trace cli handlingJohn Lo1-9/+4
Provide default packet_to_capture value. Display interface name correctly for "pcap tx/rx trace status". Type: fix Signed-off-by: John Lo <loj@cisco.com> Change-Id: I7064d0dbea236a9aff68bba7fbaf2c4a73b16c6f Signed-off-by: John Lo <loj@cisco.com>
2019-05-17Add a debug-CLI leak-checkerDave Barach1-26/+14
leak-check { <any-debug-cli-command-and-args> } Hint: "set term history off" or you'll have to sort through a bunch of bogus leaks related to the debug cli history mechanism. Cleaned up a set of reported leaks in the "show interface" command. At some point, we thought about making a per-thread vlib_mains vector, but we never did that. Several interface-related CLI's maintained local static cache vectors. Not a bad idea, but not useful as things shook out. Removed the static vectors. Change-Id: I756bf2721a0d91993ecfded34c79da406f30a548 Signed-off-by: Dave Barach <dave@barachs.net>
2019-05-03mp_safe SW_INTERFACE_DUMP, SW_INTERFACE_DETAILS, SW_INTERFACE_TAG_ADD_DEL,Steven Luong1-0/+1
BRIDGE_DOMAIN_DUMP, CONTROL_PING, CONTROL_PING_REPLY, and show interface CLI Change-Id: I2927573b66bb5dd134b37ffb72af0e6676750917 Signed-off-by: Steven Luong <sluong@cisco.com> (cherry picked from commit 15c31921a628c5500cbed2ebc588d7ddbaa970a3)
2019-04-16vpp-1647: fix typo in pcap_trace_command_internalDave Barach1-1/+1
pcap rx trace on max 100 intfc tap0 then pcap rx trace status Displays "local0" instead of "tap0" due to a typo in pcap_trace_command_internal(...). Change-Id: Id2de6a24174aac24d9051b7404f01edc806a6573 Signed-off-by: Dave Barach <dave@barachs.net>
2019-04-05fix pcap_trace cli output issueJack Xu1-2/+4
Change-Id: Ia2be56e198c960788430705b356170f8cc12c450 Signed-off-by: Jack Xu <jack.c.xu@ericsson.com>
2019-02-26Move pcap rx/tx trace code out of the dpdk pluginDave Barach1-0/+286
Moved code to the ethernet input node, and the interface output path(s). Since we no longer skip ethernet-input, there's no reason for device drivers to know anything about pcap rx tracing, etc. Change-Id: I08d32fb1b90cbee1bd4f609837d533e047b36fa4 Signed-off-by: Dave Barach <dave@barachs.net>
2018-11-13L2 feautre bitmaps output verbose/non-verbose modeNeale Ranns1-2/+3
Change-Id: I15ff191ee8724a3354c074db590472db05e0652e Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-10-23c11 safe string handling supportDave Barach1-1/+1
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-09-26vnet: show interface rx-placement may display garbage charactersSteven1-1/+1
Before ------ DBGvpp# sh int rx-mode sh int rx-mode Thread 1 (vpp_wk_0^@): node vmxnet3-input: vmxnet3-0/b/0/0 queue 0 (polling) Thread 2 (vpp_wk_1^@): node vmxnet3-input: vmxnet3-0/13/0/0 queue 0 (polling) DBGvpp# After ----- DBGvpp# sh int rx-placement sh int rx-placement Thread 1 (vpp_wk_0): node vmxnet3-input: vmxnet3-0/b/0/0 queue 0 (polling) Thread 2 (vpp_wk_1): node vmxnet3-input: vmxnet3-0/13/0/0 queue 0 (polling) DBGvpp# Change-Id: I5910d502757054c3942fac9d20c5104e95fc6b56 Signed-off-by: Steven <sluong@cisco.com>
2018-09-24Trivial: Clean up some typos.Paul Vinciguerra1-4/+4
Change-Id: I085615fde1f966490f30ed5d32017b8b088cfd59 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-08-24rx-placement: Add API call for interface rx-placementMohsin Kazmi1-23/+42
Change-Id: I9228ce29e9d2fc862a2d076b4072bcdd728d6dd1 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-07-20IP directed broadcastNeale Ranns1-0/+40
with ip direct broadcast enable a packet to the interface's subnet broadcast address with be sent L2 broadcast on the interface. dissabled, it will be dropped. it is disabled by default, which preserves current behaviour Change-Id: If154cb92e64834e97a541b32624354348a0eafb3 Signed-off-by: Neale Ranns <nranns@cisco.com>