LCOV - code coverage report
Current view: top level - vnet/gso - gso_api.c (source / functions) Hit Total Coverage
Test: coverage-filtered.info Lines: 11 11 100.0 %
Date: 2023-10-26 01:39:38 Functions: 4 4 100.0 %

          Line data    Source code
       1             : /*
       2             :  *------------------------------------------------------------------
       3             :  * gso_api.c - Generic Segmentation Offload api
       4             :  *
       5             :  * Copyright (c) 2019 Cisco and/or its affiliates.
       6             :  * Licensed under the Apache License, Version 2.0 (the "License");
       7             :  * you may not use this file except in compliance with the License.
       8             :  * You may obtain a copy of the License at:
       9             :  *
      10             :  *     http://www.apache.org/licenses/LICENSE-2.0
      11             :  *
      12             :  * Unless required by applicable law or agreed to in writing, software
      13             :  * distributed under the License is distributed on an "AS IS" BASIS,
      14             :  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      15             :  * See the License for the specific language governing permissions and
      16             :  * limitations under the License.
      17             :  *------------------------------------------------------------------
      18             :  */
      19             : 
      20             : #include <vnet/vnet.h>
      21             : #include <vlibmemory/api.h>
      22             : #include <vnet/gso/gso.h>
      23             : 
      24             : #include <vnet/format_fns.h>
      25             : #include <vnet/gso/gso.api_enum.h>
      26             : #include <vnet/gso/gso.api_types.h>
      27             : 
      28             : #define REPLY_MSG_ID_BASE gso_main.msg_id_base
      29             : #include <vlibapi/api_helper_macros.h>
      30             : 
      31             : static void
      32         641 :   vl_api_feature_gso_enable_disable_t_handler
      33             :   (vl_api_feature_gso_enable_disable_t * mp)
      34             : {
      35             :   vl_api_feature_gso_enable_disable_reply_t *rmp;
      36         641 :   int rv = 0;
      37             : 
      38         641 :   VALIDATE_SW_IF_INDEX (mp);
      39             : 
      40             :   rv =
      41         641 :     vnet_sw_interface_gso_enable_disable (ntohl (mp->sw_if_index),
      42         641 :                                           mp->enable_disable);
      43             : 
      44         641 :   BAD_SW_IF_INDEX_LABEL;
      45             : 
      46         641 :   REPLY_MACRO (VL_API_FEATURE_GSO_ENABLE_DISABLE_REPLY);
      47             : }
      48             : 
      49             : #include <vnet/gso/gso.api.c>
      50             : 
      51             : static clib_error_t *
      52         575 : feature_gso_api_hookup (vlib_main_t * vm)
      53             : {
      54             :   /*
      55             :    * Set up the (msg_name, crc, message-id) table
      56             :    */
      57         575 :   gso_main.msg_id_base = setup_message_id_table ();
      58             : 
      59         575 :   return 0;
      60             : }
      61             : 
      62       13823 : VLIB_API_INIT_FUNCTION (feature_gso_api_hookup);
      63             : 
      64             : /*
      65             :  * fd.io coding-style-patch-verification: ON
      66             :  *
      67             :  * Local Variables:
      68             :  * eval: (c-set-style "gnu")
      69             :  * End:
      70             :  */

Generated by: LCOV version 1.14