Commit 79ede4ae authored by John Hurley's avatar John Hurley Committed by David S. Miller

nfp: add helper to get flower cmsg length

Add a helper function that returns the length of the cmsg data when given
the cmsg skb
Signed-off-by: default avatarJohn Hurley <john.hurley@netronome.com>
Signed-off-by: default avatarSimon Horman <simon.horman@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 14a0d032
...@@ -323,6 +323,11 @@ static inline void *nfp_flower_cmsg_get_data(struct sk_buff *skb) ...@@ -323,6 +323,11 @@ static inline void *nfp_flower_cmsg_get_data(struct sk_buff *skb)
return (unsigned char *)skb->data + NFP_FLOWER_CMSG_HLEN; return (unsigned char *)skb->data + NFP_FLOWER_CMSG_HLEN;
} }
static inline int nfp_flower_cmsg_get_data_len(struct sk_buff *skb)
{
return skb->len - NFP_FLOWER_CMSG_HLEN;
}
struct sk_buff * struct sk_buff *
nfp_flower_cmsg_mac_repr_start(struct nfp_app *app, unsigned int num_ports); nfp_flower_cmsg_mac_repr_start(struct nfp_app *app, unsigned int num_ports);
void void
......
...@@ -140,7 +140,7 @@ nfp_flower_update_stats(struct nfp_app *app, struct nfp_fl_stats_frame *stats) ...@@ -140,7 +140,7 @@ nfp_flower_update_stats(struct nfp_app *app, struct nfp_fl_stats_frame *stats)
void nfp_flower_rx_flow_stats(struct nfp_app *app, struct sk_buff *skb) void nfp_flower_rx_flow_stats(struct nfp_app *app, struct sk_buff *skb)
{ {
unsigned int msg_len = skb->len - NFP_FLOWER_CMSG_HLEN; unsigned int msg_len = nfp_flower_cmsg_get_data_len(skb);
struct nfp_fl_stats_frame *stats_frame; struct nfp_fl_stats_frame *stats_frame;
unsigned char *msg; unsigned char *msg;
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment