net: rmnet_data: Stop adding pad bytes for MAPv4 uplink packets

Hardware does not handle pad bytes in egress packets when uplink
aggregation is not enabled. This is due to the translation support
added on hardware for MAPv4.

Change-Id: Ic246a4548561450035d5252221032d72eff44518
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
This commit is contained in:
Subash Abhinov Kasiviswanathan 2015-10-08 18:59:00 -06:00 committed by Gerrit - the friendly Code Review server
parent 22d9613376
commit f0db5bc32a
3 changed files with 19 additions and 3 deletions

View File

@ -441,7 +441,13 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,
rmnet_stats_ul_checksum(ckresult);
}
map_header = rmnet_map_add_map_header(skb, additional_header_length);
if ((config->egress_data_format & RMNET_EGRESS_FORMAT_MAP_CKSUMV4) &&
(!(config->egress_data_format & RMNET_EGRESS_FORMAT_AGGREGATION)))
map_header = rmnet_map_add_map_header
(skb, additional_header_length, RMNET_MAP_NO_PAD_BYTES);
else
map_header = rmnet_map_add_map_header
(skb, additional_header_length, RMNET_MAP_ADD_PAD_BYTES);
if (!map_header) {
LOGD("%s", "Failed to add MAP header to egress packet");

View File

@ -132,12 +132,15 @@ enum rmnet_map_agg_state_e {
#define RMNET_MAP_COMMAND_UNSUPPORTED 2
#define RMNET_MAP_COMMAND_INVALID 3
#define RMNET_MAP_NO_PAD_BYTES 0
#define RMNET_MAP_ADD_PAD_BYTES 1
uint8_t rmnet_map_demultiplex(struct sk_buff *skb);
struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb,
struct rmnet_phys_ep_conf_s *config);
struct rmnet_map_header_s *rmnet_map_add_map_header(struct sk_buff *skb,
int hdrlen);
int hdrlen, int pad);
rx_handler_result_t rmnet_map_command(struct sk_buff *skb,
struct rmnet_phys_ep_conf_s *config);
void rmnet_map_aggregate(struct sk_buff *skb,

View File

@ -64,6 +64,8 @@ struct agg_work {
* @skb: Socket buffer ("packet") to modify
* @hdrlen: Number of bytes of header data which should not be included in
* MAP length field
* @pad: Specify if padding the MAP packet to make it 4 byte aligned is
* necessary
*
* Padding is calculated and set appropriately in MAP header. Mux ID is
* initialized to 0.
@ -76,7 +78,7 @@ struct agg_work {
* todo: Parameterize skb alignment
*/
struct rmnet_map_header_s *rmnet_map_add_map_header(struct sk_buff *skb,
int hdrlen)
int hdrlen, int pad)
{
uint32_t padding, map_datalen;
uint8_t *padbytes;
@ -90,6 +92,11 @@ struct rmnet_map_header_s *rmnet_map_add_map_header(struct sk_buff *skb,
skb_push(skb, sizeof(struct rmnet_map_header_s));
memset(map_header, 0, sizeof(struct rmnet_map_header_s));
if (pad == RMNET_MAP_NO_PAD_BYTES) {
map_header->pkt_len = htons(map_datalen);
return map_header;
}
padding = ALIGN(map_datalen, 4) - map_datalen;
if (padding == 0)